aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml/docilealligator
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-10-23 14:56:15 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-10-23 14:56:15 +0000
commit9b65b27d56b6c0b9ab16f4bd801fb856f13ae213 (patch)
tree3d422681c2bba607489d5c52595618b944d1d035 /app/src/main/java/ml/docilealligator
parentd090a21f9d197cc299fa2ffb0da7941ac5bed5aa (diff)
downloadinfinity-for-reddit-9b65b27d56b6c0b9ab16f4bd801fb856f13ae213.tar
infinity-for-reddit-9b65b27d56b6c0b9ab16f4bd801fb856f13ae213.tar.gz
infinity-for-reddit-9b65b27d56b6c0b9ab16f4bd801fb856f13ae213.tar.bz2
infinity-for-reddit-9b65b27d56b6c0b9ab16f4bd801fb856f13ae213.tar.lz
infinity-for-reddit-9b65b27d56b6c0b9ab16f4bd801fb856f13ae213.tar.xz
infinity-for-reddit-9b65b27d56b6c0b9ab16f4bd801fb856f13ae213.tar.zst
infinity-for-reddit-9b65b27d56b6c0b9ab16f4bd801fb856f13ae213.zip
Fix immersive interface in ViewMultiRedditDetailActivity on Android 11.
Diffstat (limited to 'app/src/main/java/ml/docilealligator')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMultiRedditDetailActivity.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMultiRedditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMultiRedditDetailActivity.java
index b2280232..1af66861 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMultiRedditDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewMultiRedditDetailActivity.java
@@ -6,6 +6,7 @@ import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
+import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;
@@ -121,7 +122,13 @@ public class ViewMultiRedditDetailActivity extends BaseActivity implements SortT
}
if (isImmersiveInterface()) {
- window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
+ coordinatorLayout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
+ View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
+ View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
+ } else {
+ window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
+ }
adjustToolbar(toolbar);
}
}