Skip to content

Commit

Permalink
Overrides settings activity appear and disappear anims per comments on
Browse files Browse the repository at this point in the history
  • Loading branch information
kukabi committed Jun 19, 2020
1 parent 699389a commit 0b1c9be
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class SettingsActivity : AppCompatActivity(), SettingsRouter {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_settings)
overridePendingTransition(R.anim.enter_from_bottom, R.anim.exit_to_top)
if (savedInstanceState == null) {
loadFragment()
}
Expand All @@ -63,6 +64,11 @@ class SettingsActivity : AppCompatActivity(), SettingsRouter {
addFragment(WalletBackupSettingsFragment.newInstance())
}

override fun onBackPressed() {
super.onBackPressed()
overridePendingTransition(R.anim.enter_from_top, R.anim.exit_to_bottom)
}

override fun toWalletBackupWithRecoveryPhrase() {
addFragment(WriteDownSeedPhraseFragment.newInstance())
}
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/res/anim/enter_from_bottom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_shortAnimTime"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:shareInterpolator="true">

<translate
android:fromXDelta="0%"
android:fromYDelta="100%"
android:toXDelta="0%"
android:toYDelta="0%" />
</set>
16 changes: 16 additions & 0 deletions app/src/main/res/anim/enter_from_top.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_shortAnimTime"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:shareInterpolator="true">

<translate
android:fromXDelta="0%"
android:fromYDelta="-10%"
android:toXDelta="0%"
android:toYDelta="0%" />

<alpha
android:fromAlpha="0.2"
android:toAlpha="1" />
</set>
12 changes: 12 additions & 0 deletions app/src/main/res/anim/exit_to_bottom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_shortAnimTime"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:shareInterpolator="true">

<translate
android:fromXDelta="0%"
android:fromYDelta="0%"
android:toXDelta="0%"
android:toYDelta="100%" />
</set>
16 changes: 16 additions & 0 deletions app/src/main/res/anim/exit_to_top.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_shortAnimTime"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:shareInterpolator="true">

<translate
android:fromXDelta="0%"
android:fromYDelta="0%"
android:toXDelta="0%"
android:toYDelta="-10%" />

<alpha
android:fromAlpha="1"
android:toAlpha="0.2" />
</set>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- URLs, etc -->
<string name="ttl_store_url" translatable="false">https://store.tarilabs.com</string>
<string name="tari_url" translatable="false">https://tari.com</string>
<string name="github_repo_url" translatable="false">https://github.com/tari-project/wallet-android/</string>
<string name="github_repo_url" translatable="false">https://github.com/tari-project/wallet-android</string>
<string name="user_agreement_url">https://www.tari.com/user_agreement/</string>
<string name="privacy_policy_url">https://www.tari.com/privacy_policy/</string>
<string name="disclaimer_url">https://www.tari.com/disclaimer/</string>
Expand Down

0 comments on commit 0b1c9be

Please sign in to comment.