aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-12-26 11:49:21 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-12-26 11:49:21 +0000
commit196219ba010c01eeaeb936d6680b4f4e085d1d3c (patch)
tree9f0286b2fad16a01aba045cf29d400cd68ebcee2 /app/src/main/java
parent44c758204cff2b7b7b41fc5ccef7727457941d48 (diff)
downloadinfinity-for-reddit-196219ba010c01eeaeb936d6680b4f4e085d1d3c.tar
infinity-for-reddit-196219ba010c01eeaeb936d6680b4f4e085d1d3c.tar.gz
infinity-for-reddit-196219ba010c01eeaeb936d6680b4f4e085d1d3c.tar.bz2
infinity-for-reddit-196219ba010c01eeaeb936d6680b4f4e085d1d3c.tar.lz
infinity-for-reddit-196219ba010c01eeaeb936d6680b4f4e085d1d3c.tar.xz
infinity-for-reddit-196219ba010c01eeaeb936d6680b4f4e085d1d3c.tar.zst
infinity-for-reddit-196219ba010c01eeaeb936d6680b4f4e085d1d3c.zip
Fix layout issues in some bottom app bars and fabs.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java18
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java18
3 files changed, 3 insertions, 35 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java
index 9a6f765a..43462cc5 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewPostDetailActivity.java
@@ -281,7 +281,7 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
int navBarHeight = getNavBarHeight();
if (navBarHeight > 0) {
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
- params.bottomMargin = navBarHeight;
+ params.bottomMargin += navBarHeight;
fab.setLayoutParams(params);
mRecyclerView.setPadding(0, 0, 0, navBarHeight + mRecyclerView.getPaddingBottom());
showToast = true;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java
index c23e310e..1316dfc1 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java
@@ -4,16 +4,13 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
-import android.graphics.Point;
import android.os.Build;
import android.os.Bundle;
-import android.view.Display;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
-import android.view.ViewTreeObserver;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
@@ -265,20 +262,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
params.bottomMargin += navBarHeight;
fab.setLayoutParams(params);
- coordinatorLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
- @Override
- public void onGlobalLayout() {
- coordinatorLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
-
- Display display = getWindowManager().getDefaultDisplay();
- Point size = new Point();
- display.getRealSize(size);
- if (size.y == coordinatorLayout.getHeight()) {
- linearLayoutBottomAppBar.setPadding(0,
- linearLayoutBottomAppBar.getPaddingTop(), 0, navBarHeight);
- }
- }
- });
+ bottomNavigationView.setPadding(0, 0, 0, navBarHeight);
}
showToast = true;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
index 53c5ace1..579afc03 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
@@ -5,18 +5,15 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.content.res.Resources;
-import android.graphics.Point;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
-import android.view.Display;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
-import android.view.ViewTreeObserver;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
@@ -304,20 +301,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
params.bottomMargin += navBarHeight;
fab.setLayoutParams(params);
- coordinatorLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
- @Override
- public void onGlobalLayout() {
- coordinatorLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
-
- Display display = getWindowManager().getDefaultDisplay();
- Point size = new Point();
- display.getRealSize(size);
- if (size.y == coordinatorLayout.getHeight()) {
- linearLayoutBottomAppBar.setPadding(0,
- linearLayoutBottomAppBar.getPaddingTop(), 0, navBarHeight);
- }
- }
- });
+ bottomNavigationView.setPadding(0, 0, 0, navBarHeight);
}
showToast = true;
}