From 91a0438d2877ddc7cd8649375d0c7fa1b8b12983 Mon Sep 17 00:00:00 2001 From: X1nto Date: Thu, 23 Apr 2020 01:12:47 +0400 Subject: [PATCH] navbar hide fixes --- app/app.iml | 10 +++--- .../com/vanced/manager/ui/MainActivity.kt | 13 +++++--- app/src/main/res/anim/fragment_enter_left.xml | 9 ++++++ .../main/res/anim/fragment_enter_right.xml | 9 ++++++ app/src/main/res/anim/fragment_exit_left.xml | 9 ++++++ app/src/main/res/anim/fragment_exit_right.xml | 9 ++++++ app/src/main/res/anim/navbar_enter.xml | 4 +-- app/src/main/res/anim/navbar_exit.xml | 4 +-- app/src/main/res/anim/view_enter.xml | 4 +-- app/src/main/res/anim/view_exit.xml | 4 +-- .../main/res/animator/fragment_enter_left.xml | 11 ------- .../res/animator/fragment_enter_right.xml | 11 ------- .../main/res/animator/fragment_exit_left.xml | 11 ------- .../main/res/animator/fragment_exit_right.xml | 11 ------- app/src/main/res/animator/navbar_slide_in.xml | 11 ------- .../main/res/animator/navbar_slide_out.xml | 11 ------- .../main/res/animator/network_slide_in.xml | 11 ------- .../main/res/animator/network_slide_out.xml | 11 ------- .../main/res/navigation/mobile_navigation.xml | 32 +++++++++---------- 19 files changed, 74 insertions(+), 121 deletions(-) create mode 100644 app/src/main/res/anim/fragment_enter_left.xml create mode 100644 app/src/main/res/anim/fragment_enter_right.xml create mode 100644 app/src/main/res/anim/fragment_exit_left.xml create mode 100644 app/src/main/res/anim/fragment_exit_right.xml delete mode 100644 app/src/main/res/animator/fragment_enter_left.xml delete mode 100644 app/src/main/res/animator/fragment_enter_right.xml delete mode 100644 app/src/main/res/animator/fragment_exit_left.xml delete mode 100644 app/src/main/res/animator/fragment_exit_right.xml delete mode 100644 app/src/main/res/animator/navbar_slide_in.xml delete mode 100644 app/src/main/res/animator/navbar_slide_out.xml delete mode 100644 app/src/main/res/animator/network_slide_in.xml delete mode 100644 app/src/main/res/animator/network_slide_out.xml diff --git a/app/app.iml b/app/app.iml index ca568222..f8b4aecc 100644 --- a/app/app.iml +++ b/app/app.iml @@ -72,15 +72,15 @@ - + - + - - - + + + diff --git a/app/src/main/java/com/vanced/manager/ui/MainActivity.kt b/app/src/main/java/com/vanced/manager/ui/MainActivity.kt index 8289956f..801ef3d2 100644 --- a/app/src/main/java/com/vanced/manager/ui/MainActivity.kt +++ b/app/src/main/java/com/vanced/manager/ui/MainActivity.kt @@ -62,13 +62,18 @@ class MainActivity : ThemeActivity() { when (currfrag.id) { R.id.home_fragment, R.id.settings_fragment -> { - navBar.visibility = View.VISIBLE - navBar.startAnimation(navBarShow) + + if (navBar.visibility != View.VISIBLE) { + navBar.visibility = View.VISIBLE + navBar.startAnimation(navBarShow) + } } else -> { - navBar.startAnimation(navBarHide) - navBar.visibility = View.INVISIBLE + if (navBar.visibility != View.INVISIBLE) { + navBar.startAnimation(navBarHide) + navBar.visibility = View.INVISIBLE + } } } diff --git a/app/src/main/res/anim/fragment_enter_left.xml b/app/src/main/res/anim/fragment_enter_left.xml new file mode 100644 index 00000000..c8341f98 --- /dev/null +++ b/app/src/main/res/anim/fragment_enter_left.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/fragment_enter_right.xml b/app/src/main/res/anim/fragment_enter_right.xml new file mode 100644 index 00000000..39322b2f --- /dev/null +++ b/app/src/main/res/anim/fragment_enter_right.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/fragment_exit_left.xml b/app/src/main/res/anim/fragment_exit_left.xml new file mode 100644 index 00000000..3709e053 --- /dev/null +++ b/app/src/main/res/anim/fragment_exit_left.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/fragment_exit_right.xml b/app/src/main/res/anim/fragment_exit_right.xml new file mode 100644 index 00000000..cfce32dd --- /dev/null +++ b/app/src/main/res/anim/fragment_exit_right.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/navbar_enter.xml b/app/src/main/res/anim/navbar_enter.xml index 009a0d83..7ae0bf3c 100644 --- a/app/src/main/res/anim/navbar_enter.xml +++ b/app/src/main/res/anim/navbar_enter.xml @@ -2,8 +2,8 @@ \ No newline at end of file diff --git a/app/src/main/res/anim/navbar_exit.xml b/app/src/main/res/anim/navbar_exit.xml index b107298b..64da12cd 100644 --- a/app/src/main/res/anim/navbar_exit.xml +++ b/app/src/main/res/anim/navbar_exit.xml @@ -2,8 +2,8 @@ + android:toYDelta="100%p" /> \ No newline at end of file diff --git a/app/src/main/res/anim/view_enter.xml b/app/src/main/res/anim/view_enter.xml index c5f2bf6c..8afae77e 100644 --- a/app/src/main/res/anim/view_enter.xml +++ b/app/src/main/res/anim/view_enter.xml @@ -2,8 +2,8 @@ diff --git a/app/src/main/res/anim/view_exit.xml b/app/src/main/res/anim/view_exit.xml index 5ce4d0ee..d7a43d71 100644 --- a/app/src/main/res/anim/view_exit.xml +++ b/app/src/main/res/anim/view_exit.xml @@ -2,8 +2,8 @@ + android:toYDelta="-100%p" /> \ No newline at end of file diff --git a/app/src/main/res/animator/fragment_enter_left.xml b/app/src/main/res/animator/fragment_enter_left.xml deleted file mode 100644 index 2157e27c..00000000 --- a/app/src/main/res/animator/fragment_enter_left.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/animator/fragment_enter_right.xml b/app/src/main/res/animator/fragment_enter_right.xml deleted file mode 100644 index 0a2b2f41..00000000 --- a/app/src/main/res/animator/fragment_enter_right.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/animator/fragment_exit_left.xml b/app/src/main/res/animator/fragment_exit_left.xml deleted file mode 100644 index b4b73f57..00000000 --- a/app/src/main/res/animator/fragment_exit_left.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/animator/fragment_exit_right.xml b/app/src/main/res/animator/fragment_exit_right.xml deleted file mode 100644 index a203892b..00000000 --- a/app/src/main/res/animator/fragment_exit_right.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/animator/navbar_slide_in.xml b/app/src/main/res/animator/navbar_slide_in.xml deleted file mode 100644 index 443dc98b..00000000 --- a/app/src/main/res/animator/navbar_slide_in.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/animator/navbar_slide_out.xml b/app/src/main/res/animator/navbar_slide_out.xml deleted file mode 100644 index c39ca438..00000000 --- a/app/src/main/res/animator/navbar_slide_out.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/animator/network_slide_in.xml b/app/src/main/res/animator/network_slide_in.xml deleted file mode 100644 index a215c764..00000000 --- a/app/src/main/res/animator/network_slide_in.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/animator/network_slide_out.xml b/app/src/main/res/animator/network_slide_out.xml deleted file mode 100644 index 146141e8..00000000 --- a/app/src/main/res/animator/network_slide_out.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/navigation/mobile_navigation.xml b/app/src/main/res/navigation/mobile_navigation.xml index f5b3738b..01186f29 100644 --- a/app/src/main/res/navigation/mobile_navigation.xml +++ b/app/src/main/res/navigation/mobile_navigation.xml @@ -23,10 +23,10 @@ + app:enterAnim="@anim/fragment_enter_right" + app:exitAnim="@anim/fragment_exit_left" + app:popEnterAnim="@anim/fragment_enter_left" + app:popExitAnim="@anim/fragment_exit_right" /> @@ -60,10 +60,10 @@ + app:enterAnim="@anim/fragment_enter_right" + app:exitAnim="@anim/fragment_exit_left" + app:popEnterAnim="@anim/fragment_enter_left" + app:popExitAnim="@anim/fragment_exit_right" /> @@ -76,10 +76,10 @@ + app:enterAnim="@anim/fragment_enter_right" + app:exitAnim="@anim/fragment_exit_left" + app:popEnterAnim="@anim/fragment_enter_left" + app:popExitAnim="@anim/fragment_exit_right" /> @@ -92,10 +92,10 @@