aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-12-18 13:33:03 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-12-18 13:33:03 +0000
commite3445373d9f57b45c020170a0aa93116be4c4b6b (patch)
tree888e81da6fd70838bc07bb929689a4d636ed1359
parentdafd0796e914a5b540c2edb272b62a3afd468c2d (diff)
downloadinfinity-for-reddit-e3445373d9f57b45c020170a0aa93116be4c4b6b.tar
infinity-for-reddit-e3445373d9f57b45c020170a0aa93116be4c4b6b.tar.gz
infinity-for-reddit-e3445373d9f57b45c020170a0aa93116be4c4b6b.tar.bz2
infinity-for-reddit-e3445373d9f57b45c020170a0aa93116be4c4b6b.tar.lz
infinity-for-reddit-e3445373d9f57b45c020170a0aa93116be4c4b6b.tar.xz
infinity-for-reddit-e3445373d9f57b45c020170a0aa93116be4c4b6b.tar.zst
infinity-for-reddit-e3445373d9f57b45c020170a0aa93116be4c4b6b.zip
Fix bottom app bar is under navbar in immersive mode.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java9
-rw-r--r--app/src/main/res/layout/app_bar_main.xml4
2 files changed, 6 insertions, 7 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
index 525d8273..240f4b4a 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/MainActivity.java
@@ -165,6 +165,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
FloatingActionButton fab;
@BindView(R.id.bottom_navigation_main_activity)
BottomAppBar bottomNavigationView;
+ @BindView(R.id.linear_layout_bottom_app_bar_main_activity)
+ LinearLayout linearLayoutBottomAppBar;
@BindView(R.id.subscriptions_bottom_app_bar_main_activity)
TextView subscriptionsBottomAppBar;
@BindView(R.id.multi_reddit_bottom_app_bar_main_activity)
@@ -269,10 +271,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
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 = navBarHeight;
- fab.setLayoutParams(params);
-
+ linearLayoutBottomAppBar.setPadding(0,
+ (int) (6 * resources.getDisplayMetrics().density), 0, navBarHeight);
nestedScrollView.setPadding(0, 0, 0, navBarHeight);
}
}
@@ -473,6 +473,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
@Override
public void onPageSelected(int position) {
+ bottomNavigationView.performShow();
fab.show();
if (isInLazyMode) {
if (position == sectionsPagerAdapter.getCurrentLazyModeFragmentPosition()) {
diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml
index 78636065..ef23de4f 100644
--- a/app/src/main/res/layout/app_bar_main.xml
+++ b/app/src/main/res/layout/app_bar_main.xml
@@ -61,14 +61,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
- android:gravity="center"
android:visibility="gone"
app:backgroundTint="?attr/backgroundColor"
- app:layout_anchorGravity="start"
- app:fabAnimationMode="scale"
app:fabAlignmentMode="center">
<LinearLayout
+ android:id="@+id/linear_layout_bottom_app_bar_main_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="3"