aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2023-10-01 14:41:33 +0000
committerDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2023-10-01 14:41:33 +0000
commitb465d11f1010e3820c2a59f86ca3ea259ae537f9 (patch)
treeef20a734ad5c074a2e77be61cce81748d6317b3d /app/src
parent12cbdc69f917186af9f2506c57e6ddecdd74b180 (diff)
downloadinfinity-for-reddit-b465d11f1010e3820c2a59f86ca3ea259ae537f9.tar
infinity-for-reddit-b465d11f1010e3820c2a59f86ca3ea259ae537f9.tar.gz
infinity-for-reddit-b465d11f1010e3820c2a59f86ca3ea259ae537f9.tar.bz2
infinity-for-reddit-b465d11f1010e3820c2a59f86ca3ea259ae537f9.tar.lz
infinity-for-reddit-b465d11f1010e3820c2a59f86ca3ea259ae537f9.tar.xz
infinity-for-reddit-b465d11f1010e3820c2a59f86ca3ea259ae537f9.tar.zst
infinity-for-reddit-b465d11f1010e3820c2a59f86ca3ea259ae537f9.zip
Fix video controller ui issues in ViewImgurVideoFragment, ViewRedditGalleryVideoFragment and ViewVideoActivity. Fix https://github.com/Docile-Alligator/Infinity-For-Reddit/issues/1552
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java25
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java17
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java10
3 files changed, 30 insertions, 22 deletions
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 9d4e4366..bd63dc9e 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java
@@ -23,7 +23,6 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.provider.Settings;
-import android.text.Html;
import android.view.Menu;
import android.view.MenuItem;
import android.view.OrientationEventListener;
@@ -301,6 +300,12 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe
ButterKnife.bind(this);
setVolumeControlStream(AudioManager.STREAM_MUSIC);
+ setTitle(" ");
+
+ if (typeface != null) {
+ titleTextView.setTypeface(typeface);
+ }
+
Resources resources = getResources();
getWindow().getDecorView().setSystemUiVisibility(
@@ -412,8 +417,6 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe
Post post = intent.getParcelableExtra(EXTRA_POST);
if (post != null) {
- //setSmallTitle(post.getTitle());
- setTitle(" ");
titleTextView.setText(post.getTitle());
}
@@ -606,20 +609,6 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe
}
}
- private void setSmallTitle(String title) {
- if (title != null) {
- if (useBottomAppBar) {
- titleTextView.setText(Html.fromHtml(String.format("<font color=\"#FFFFFF\"><small>%s</small></font>", title)));
- } else {
- setTitle(Utils.getTabTextWithCustomFont(typeface, Html.fromHtml(String.format("<font color=\"#FFFFFF\"><small>%s</small></font>", title))));
- }
- } else {
- if (!useBottomAppBar) {
- setTitle("");
- }
- }
- }
-
private void preparePlayer(Bundle savedInstanceState) {
if (mSharedPreferences.getBoolean(SharedPreferencesUtils.LOOP_VIDEO, true)) {
player.setRepeatMode(Player.REPEAT_MODE_ALL);
@@ -892,7 +881,7 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe
Toast.makeText(ViewVideoActivity.this, R.string.fetch_streamable_video_failed, Toast.LENGTH_SHORT).show();
return;
}
- setSmallTitle(streamableVideo.title);
+ titleTextView.setText(streamableVideo.title);
progressBar.setVisibility(View.GONE);
videoDownloadUrl = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile.url : streamableVideo.mp4.url;
mVideoUri = Uri.parse(videoDownloadUrl);
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java
index 67b6b74a..51850a90 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java
@@ -39,6 +39,7 @@ import com.google.android.exoplayer2.upstream.DefaultHttpDataSource;
import com.google.android.exoplayer2.upstream.cache.CacheDataSource;
import com.google.android.exoplayer2.upstream.cache.SimpleCache;
import com.google.android.material.bottomappbar.BottomAppBar;
+import com.google.android.material.button.MaterialButton;
import com.google.common.collect.ImmutableList;
import javax.inject.Inject;
@@ -73,6 +74,8 @@ public class ViewImgurVideoFragment extends Fragment {
BottomAppBar bottomAppBar;
@BindView(R.id.title_text_view_exo_playback_control_view)
TextView titleTextView;
+ @BindView(R.id.back_button_exo_playback_control_view)
+ MaterialButton backButton;
@BindView(R.id.download_image_view_exo_playback_control_view)
ImageView downloadImageView;
private ViewImgurMediaActivity activity;
@@ -105,6 +108,10 @@ public class ViewImgurVideoFragment extends Fragment {
setHasOptionsMenu(true);
+ if (activity.typeface != null) {
+ titleTextView.setTypeface(activity.typeface);
+ }
+
activity.setVolumeControlStream(AudioManager.STREAM_MUSIC);
imgurMedia = getArguments().getParcelable(EXTRA_IMGUR_VIDEO);
@@ -158,10 +165,16 @@ public class ViewImgurVideoFragment extends Fragment {
setPlaybackSpeed(Integer.parseInt(mSharedPreferences.getString(SharedPreferencesUtils.DEFAULT_PLAYBACK_SPEED, "100")));
preparePlayer(savedInstanceState);
+ titleTextView.setText(getString(R.string.view_imgur_media_activity_video_label,
+ getArguments().getInt(EXTRA_INDEX) + 1, getArguments().getInt(EXTRA_MEDIA_COUNT)));
+
if (activity.isUseBottomAppBar()) {
bottomAppBar.setVisibility(View.VISIBLE);
- titleTextView.setText(getString(R.string.view_imgur_media_activity_video_label,
- getArguments().getInt(EXTRA_INDEX) + 1, getArguments().getInt(EXTRA_MEDIA_COUNT)));
+
+ backButton.setOnClickListener(view -> {
+ activity.finish();
+ });
+
downloadImageView.setOnClickListener(view -> {
if (isDownloading) {
return;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java
index d58b139b..d41f9b37 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java
@@ -75,6 +75,8 @@ public class ViewRedditGalleryVideoFragment extends Fragment {
BottomAppBar bottomAppBar;
@BindView(R.id.title_text_view_exo_playback_control_view)
TextView titleTextView;
+ @BindView(R.id.back_button_exo_playback_control_view)
+ MaterialButton backButton;
@BindView(R.id.download_image_view_exo_playback_control_view)
ImageView downloadImageView;
private ViewRedditGalleryActivity activity;
@@ -168,10 +170,14 @@ public class ViewRedditGalleryVideoFragment extends Fragment {
Integer.parseInt(mSharedPreferences.getString(SharedPreferencesUtils.DEFAULT_PLAYBACK_SPEED, "100"));
preparePlayer(savedInstanceState);
+ titleTextView.setText(getString(R.string.view_reddit_gallery_activity_video_label,
+ getArguments().getInt(EXTRA_INDEX) + 1, getArguments().getInt(EXTRA_MEDIA_COUNT)));
+
if (activity.isUseBottomAppBar()) {
bottomAppBar.setVisibility(View.VISIBLE);
- titleTextView.setText(getString(R.string.view_reddit_gallery_activity_video_label,
- getArguments().getInt(EXTRA_INDEX) + 1, getArguments().getInt(EXTRA_MEDIA_COUNT)));
+ backButton.setOnClickListener(view -> {
+ activity.finish();
+ });
downloadImageView.setOnClickListener(view -> {
if (isDownloading) {
return;