From a92969a47fd4c7e8823f6469a87aa38b73300ce0 Mon Sep 17 00:00:00 2001 From: M M Arif Date: Sun, 9 Aug 2020 10:23:19 +0200 Subject: [PATCH] Fix jumps in drawer when open for all items(icons, user data) (#639) Fix drawer jumps when open for all items Co-authored-by: M M Arif Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/639 --- .../mian/gitnex/activities/MainActivity.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/mian/gitnex/activities/MainActivity.java b/app/src/main/java/org/mian/gitnex/activities/MainActivity.java index 043dda16..da65e6f9 100644 --- a/app/src/main/java/org/mian/gitnex/activities/MainActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/MainActivity.java @@ -197,6 +197,11 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig @Override public void onDrawerOpened(@NonNull View drawerView) { + } + + @Override + public void onDrawerSlide(@NonNull View drawerView, float slideOffset) { + if(tinyDb.getBoolean("noConnection")) { Toasty.error(ctx, getResources().getString(R.string.checkNetConnection)); tinyDb.putBoolean("noConnection", false); @@ -216,11 +221,6 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig userEmail.setTypeface(myTypeface); userFullName.setTypeface(myTypeface); - String currentVersion = tinyDb.getString("giteaVersion"); - - navigationView.getMenu().findItem(R.id.nav_administration).setVisible(tinyDb.getBoolean("userIsAdmin")); - navigationView.getMenu().findItem(R.id.nav_notifications).setVisible(new Version(currentVersion).higherOrEqual("1.12.3")); - if(!userEmailNav.equals("")) { userEmail.setText(userEmailNav); } @@ -271,10 +271,11 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig drawer.closeDrawers(); }); - } + String currentVersion = tinyDb.getString("giteaVersion"); - @Override - public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {} + navigationView.getMenu().findItem(R.id.nav_administration).setVisible(tinyDb.getBoolean("userIsAdmin")); + navigationView.getMenu().findItem(R.id.nav_notifications).setVisible(new Version(currentVersion).higherOrEqual("1.12.3")); + } @Override public void onDrawerClosed(@NonNull View drawerView) {}