diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-02-18 12:57:39 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-02-18 12:57:39 +0000 |
commit | 8c454d52c7c55af04c52d07bab5d16355d159406 (patch) | |
tree | 24c8f6a049d4f1d5bd0c2b06d1140df9ff4bc6e3 /app/src/main/java/ml | |
parent | d4d3db83437c97c17aaed1fccf0939c91ed4abdd (diff) | |
download | infinity-for-reddit-8c454d52c7c55af04c52d07bab5d16355d159406.tar infinity-for-reddit-8c454d52c7c55af04c52d07bab5d16355d159406.tar.gz infinity-for-reddit-8c454d52c7c55af04c52d07bab5d16355d159406.tar.bz2 infinity-for-reddit-8c454d52c7c55af04c52d07bab5d16355d159406.tar.lz infinity-for-reddit-8c454d52c7c55af04c52d07bab5d16355d159406.tar.xz infinity-for-reddit-8c454d52c7c55af04c52d07bab5d16355d159406.tar.zst infinity-for-reddit-8c454d52c7c55af04c52d07bab5d16355d159406.zip |
Fix the bottom app bar shows under the nav bar. Fix the bottom app bar vanishes after orientation change.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSubredditDetailActivity.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSubredditDetailActivity.java index cbec2aba..72e90cd7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSubredditDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSubredditDetailActivity.java @@ -202,15 +202,21 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp int navBarResourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); if (navBarResourceId > 0) { + int navBarHeight = resources.getDimensionPixelSize(navBarResourceId); CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) fab.getLayoutParams(); - params.bottomMargin = resources.getDimensionPixelSize(navBarResourceId); + params.bottomMargin = navBarHeight; fab.setLayoutParams(params); + linearLayoutBottomAppBar.setPadding(0, + (int) (6 * resources.getDisplayMetrics().density), 0, navBarHeight); showToast = true; } } } + showBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.BOTTOM_APP_BAR_KEY, false); + lockBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.LOCK_BOTTOM_APP_BAR, false); + subredditName = getIntent().getStringExtra(EXTRA_SUBREDDIT_NAME_KEY); if (savedInstanceState == null) { @@ -272,9 +278,6 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp toolbar.setLayoutParams(toolbarParams); setSupportActionBar(toolbar); - showBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.BOTTOM_APP_BAR_KEY, false); - lockBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.LOCK_BOTTOM_APP_BAR, false); - glide = Glide.with(this); mSubredditViewModel = new ViewModelProvider(this, |