mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-30 21:07:11 +01:00
Fix bottom app bar in ViewSubredditDetailActivity displaying under nav bar.
This commit is contained in:
parent
aa8d0c49c1
commit
101690f75d
@ -239,7 +239,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
public int getNavBarHeight() {
|
||||
if (getDefaultSharedPreferences().getBoolean(SharedPreferencesUtils.IMMERSIVE_INTERFACE_IGNORE_NAV_BAR_KEY, false)) {
|
||||
if (isImmersiveInterfaceApplicable && immersiveInterface && getDefaultSharedPreferences().getBoolean(SharedPreferencesUtils.IMMERSIVE_INTERFACE_IGNORE_NAV_BAR_KEY, false)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -6,11 +6,13 @@ import android.content.SharedPreferences;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
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;
|
||||
@ -255,6 +257,19 @@ 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);
|
||||
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
||||
if (displayMetrics.heightPixels == coordinatorLayout.getHeight()) {
|
||||
linearLayoutBottomAppBar.setPadding(0,
|
||||
linearLayoutBottomAppBar.getPaddingTop(), 0, navBarHeight);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
showToast = true;
|
||||
}
|
||||
|
@ -239,6 +239,7 @@
|
||||
android:background="?attr/selectableItemBackgroundBorderless" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.bottomappbar.BottomAppBar>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
|
Loading…
Reference in New Issue
Block a user