diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-12-01 13:33:46 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-12-01 13:33:46 +0000 |
commit | f39f608cde18a434a907a55cf5985bc18e0f2950 (patch) | |
tree | 010f3130e8ba4345dfe797fcbc4fd38924e2e7d7 /app/src/main/java/ml/docilealligator/infinityforreddit | |
parent | e2964893da08196df2786def9677f68ece6a43d0 (diff) | |
download | infinity-for-reddit-f39f608cde18a434a907a55cf5985bc18e0f2950.tar infinity-for-reddit-f39f608cde18a434a907a55cf5985bc18e0f2950.tar.gz infinity-for-reddit-f39f608cde18a434a907a55cf5985bc18e0f2950.tar.bz2 infinity-for-reddit-f39f608cde18a434a907a55cf5985bc18e0f2950.tar.lz infinity-for-reddit-f39f608cde18a434a907a55cf5985bc18e0f2950.tar.xz infinity-for-reddit-f39f608cde18a434a907a55cf5985bc18e0f2950.tar.zst infinity-for-reddit-f39f608cde18a434a907a55cf5985bc18e0f2950.zip |
Minor layout tweaks.
Diffstat (limited to 'app/src/main/java/ml/docilealligator/infinityforreddit')
5 files changed, 26 insertions, 9 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java index a8d13ed7..4e303c29 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java @@ -145,6 +145,11 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa ButterKnife.bind(this); + getWindow().getDecorView().setSystemUiVisibility( + View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); + if (mSharedPreferences.getBoolean(SharedPreferencesUtils.SWIPE_VERTICALLY_TO_GO_BACK_FROM_MEDIA, true)) { Slidr.attach(this, new SlidrConfig.Builder().position(SlidrPosition.VERTICAL).distanceThreshold(0.125f).build()); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImgurMediaActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImgurMediaActivity.java index 20d3440f..43e8cc0d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImgurMediaActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImgurMediaActivity.java @@ -6,6 +6,7 @@ import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.os.Bundle; import android.os.Handler; +import android.text.Html; import android.view.Menu; import android.view.MenuItem; import android.view.View; @@ -21,9 +22,6 @@ import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentStatePagerAdapter; import androidx.viewpager.widget.ViewPager; -import app.futured.hauler.DragDirection; -import app.futured.hauler.HaulerView; - import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -34,6 +32,8 @@ import java.util.concurrent.Executor; import javax.inject.Inject; import javax.inject.Named; +import app.futured.hauler.DragDirection; +import app.futured.hauler.HaulerView; import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.ImgurMedia; @@ -118,6 +118,11 @@ public class ViewImgurMediaActivity extends AppCompatActivity implements SetAsWa ButterKnife.bind(this); + getWindow().getDecorView().setSystemUiVisibility( + View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); + useBottomAppBar = sharedPreferences.getBoolean(SharedPreferencesUtils.USE_BOTTOM_TOOLBAR_IN_MEDIA_VIEWER, false); if (!useBottomAppBar) { @@ -292,9 +297,9 @@ public class ViewImgurMediaActivity extends AppCompatActivity implements SetAsWa private void setToolbarTitle(int position) { if (images != null && position >= 0 && position < images.size()) { if (images.get(position).getType() == ImgurMedia.TYPE_VIDEO) { - setTitle(getString(R.string.view_imgur_media_activity_video_label, position + 1, images.size())); + setTitle(Html.fromHtml("<font color=\"#FFFFFF\">" + getString(R.string.view_imgur_media_activity_video_label, position + 1, images.size()) + "</font>")); } else { - setTitle(getString(R.string.view_imgur_media_activity_image_label, position + 1, images.size())); + setTitle(Html.fromHtml("<font color=\"#FFFFFF\">" + getString(R.string.view_imgur_media_activity_image_label, position + 1, images.size()) + "</font>")); } } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewRedditGalleryActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewRedditGalleryActivity.java index aadf344d..753c2767 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewRedditGalleryActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewRedditGalleryActivity.java @@ -15,6 +15,7 @@ import android.os.Handler; import android.text.Html; import android.view.Menu; import android.view.MenuItem; +import android.view.View; import android.widget.Toast; import androidx.annotation.NonNull; @@ -40,7 +41,6 @@ import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.SetAsWallpaperCallback; import ml.docilealligator.infinityforreddit.WallpaperSetter; -import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.customviews.ViewPagerBugFixed; import ml.docilealligator.infinityforreddit.font.ContentFontFamily; import ml.docilealligator.infinityforreddit.font.ContentFontStyle; @@ -132,6 +132,11 @@ public class ViewRedditGalleryActivity extends AppCompatActivity implements SetA ButterKnife.bind(this); + getWindow().getDecorView().setSystemUiVisibility( + View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); + useBottomAppBar = sharedPreferences.getBoolean(SharedPreferencesUtils.USE_BOTTOM_TOOLBAR_IN_MEDIA_VIEWER, false); if (!useBottomAppBar) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java index d70aaa68..8fd09be5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java @@ -276,6 +276,11 @@ public class ViewVideoActivity extends AppCompatActivity { Resources resources = getResources(); + getWindow().getDecorView().setSystemUiVisibility( + View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); + boolean useBottomAppBar = mSharedPreferences.getBoolean(SharedPreferencesUtils.USE_BOTTOM_TOOLBAR_IN_MEDIA_VIEWER, false); if (useBottomAppBar) { getSupportActionBar().hide(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java index df3d88ae..942a90e4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java @@ -67,7 +67,6 @@ import ml.docilealligator.infinityforreddit.bottomsheetfragments.SetAsWallpaperB import ml.docilealligator.infinityforreddit.bottomsheetfragments.UrlMenuBottomSheetFragment; import ml.docilealligator.infinityforreddit.post.Post; import ml.docilealligator.infinityforreddit.services.DownloadMediaService; -import ml.docilealligator.infinityforreddit.utils.Utils; public class ViewRedditGalleryImageOrGifFragment extends Fragment { @@ -251,8 +250,6 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { if (!activity.isUseBottomAppBar()) { bottomAppBar.setVisibility(View.VISIBLE); bottomAppBarMenu.setVisibility(View.GONE); - - captionLayout.setPadding(0, captionLayout.getPaddingTop(), 0, (int) Utils.convertDpToPixel(16, activity)); } captionLayout.setVisibility(View.VISIBLE); |