diff options
author | Docile-Alligator <chineseperson5@gmail.com> | 2020-06-24 08:02:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-24 08:02:11 +0000 |
commit | f9884167694f94e906860757b51d6600ee5143d4 (patch) | |
tree | 63b954b580711f765ffed35fc590371108506bcb /app/src | |
parent | dc16f83d72d6f5086771194c34d0e472c140b298 (diff) | |
parent | 7bb9d14f1db584608d6eacf948fc5b561b491e32 (diff) | |
download | infinity-for-reddit-f9884167694f94e906860757b51d6600ee5143d4.tar infinity-for-reddit-f9884167694f94e906860757b51d6600ee5143d4.tar.gz infinity-for-reddit-f9884167694f94e906860757b51d6600ee5143d4.tar.bz2 infinity-for-reddit-f9884167694f94e906860757b51d6600ee5143d4.tar.lz infinity-for-reddit-f9884167694f94e906860757b51d6600ee5143d4.tar.xz infinity-for-reddit-f9884167694f94e906860757b51d6600ee5143d4.tar.zst infinity-for-reddit-f9884167694f94e906860757b51d6600ee5143d4.zip |
Merge pull request #145 from OHermesJunior/hide-actionbar
Hide actionbar on imgur images too.
Diffstat (limited to '')
2 files changed, 20 insertions, 3 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImgurMediaActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImgurMediaActivity.java index 0e073b70..5beb5cfd 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImgurMediaActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewImgurMediaActivity.java @@ -81,7 +81,6 @@ public class ViewImgurMediaActivity extends AppCompatActivity implements SetAsWa @Inject @Named("default") SharedPreferences sharedPreferences; - private WallpaperSetter wallpaperSetter; @Override protected void onCreate(Bundle savedInstanceState) { @@ -118,8 +117,6 @@ public class ViewImgurMediaActivity extends AppCompatActivity implements SetAsWa actionBar.setHomeAsUpIndicator(upArrow); actionBar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.transparentActionBarAndExoPlayerControllerColor))); - wallpaperSetter = new WallpaperSetter(); - setTitle(" "); String imgurId = getIntent().getStringExtra(EXTRA_IMGUR_ID); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/ViewImgurImageFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/ViewImgurImageFragment.java index 8d761757..51c48d26 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/ViewImgurImageFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/ViewImgurImageFragment.java @@ -67,6 +67,7 @@ public class ViewImgurImageFragment extends Fragment { private MediaDownloader mediaDownloader; private ImgurMedia imgurMedia; private boolean isDownloading = false; + private boolean isActionBarHidden = false; public ViewImgurImageFragment() { // Required empty public constructor @@ -86,6 +87,25 @@ public class ViewImgurImageFragment extends Fragment { mediaDownloader = new MediaDownloaderImpl(); loadImage(); + imageView.setOnClickListener(view -> { + if (isActionBarHidden) { + activity.getWindow().getDecorView().setSystemUiVisibility( + View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); + isActionBarHidden = false; + } else { + activity.getWindow().getDecorView().setSystemUiVisibility( + View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_IMMERSIVE); + isActionBarHidden = true; + } + }); + return rootView; } |