mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-02 14:27:10 +01:00
Get actual screen height in ViewSubredditDetailActivity.
This commit is contained in:
parent
101690f75d
commit
f9834f644c
@ -4,9 +4,10 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
|
import android.graphics.Point;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.DisplayMetrics;
|
import android.view.Display;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
@ -262,9 +263,10 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
|||||||
public void onGlobalLayout() {
|
public void onGlobalLayout() {
|
||||||
coordinatorLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
coordinatorLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||||
|
|
||||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
Display display = getWindowManager().getDefaultDisplay();
|
||||||
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
Point size = new Point();
|
||||||
if (displayMetrics.heightPixels == coordinatorLayout.getHeight()) {
|
display.getRealSize(size);
|
||||||
|
if (size.y == coordinatorLayout.getHeight()) {
|
||||||
linearLayoutBottomAppBar.setPadding(0,
|
linearLayoutBottomAppBar.setPadding(0,
|
||||||
linearLayoutBottomAppBar.getPaddingTop(), 0, navBarHeight);
|
linearLayoutBottomAppBar.getPaddingTop(), 0, navBarHeight);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user