aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-11-22 11:27:45 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-11-22 11:27:45 +0000
commit841fec87dc81eb8559beaf605f0ef06cf0ca90c5 (patch)
tree8493740c6ea5ccf6b7c17d675638e24743cb3171
parent50a2db2a398e257e236505cb222c289cb0d5331f (diff)
downloadinfinity-for-reddit-841fec87dc81eb8559beaf605f0ef06cf0ca90c5.tar
infinity-for-reddit-841fec87dc81eb8559beaf605f0ef06cf0ca90c5.tar.gz
infinity-for-reddit-841fec87dc81eb8559beaf605f0ef06cf0ca90c5.tar.bz2
infinity-for-reddit-841fec87dc81eb8559beaf605f0ef06cf0ca90c5.tar.lz
infinity-for-reddit-841fec87dc81eb8559beaf605f0ef06cf0ca90c5.tar.xz
infinity-for-reddit-841fec87dc81eb8559beaf605f0ef06cf0ca90c5.tar.zst
infinity-for-reddit-841fec87dc81eb8559beaf605f0ef06cf0ca90c5.zip
Fix TrackSelectionDialog button color. Do not automatically show control view in autoplaying videos.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java16
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRPANBroadcastFragment.java12
-rw-r--r--app/src/main/res/layout/item_post_card_2_video_autoplay.xml1
-rw-r--r--app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml1
-rw-r--r--app/src/main/res/layout/item_post_detail_video_autoplay.xml1
-rw-r--r--app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml1
-rw-r--r--app/src/main/res/layout/item_post_video_type_autoplay.xml1
-rw-r--r--app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml1
8 files changed, 26 insertions, 8 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 50e756ed..d70aaa68 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java
@@ -6,6 +6,7 @@ import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO;
import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES;
import android.Manifest;
+import android.app.AlertDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
@@ -85,6 +86,7 @@ import ml.docilealligator.infinityforreddit.Infinity;
import ml.docilealligator.infinityforreddit.R;
import ml.docilealligator.infinityforreddit.apis.VReddIt;
import ml.docilealligator.infinityforreddit.bottomsheetfragments.PlaybackSpeedBottomSheetFragment;
+import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
import ml.docilealligator.infinityforreddit.font.ContentFontFamily;
import ml.docilealligator.infinityforreddit.font.ContentFontStyle;
import ml.docilealligator.infinityforreddit.font.FontFamily;
@@ -203,6 +205,9 @@ public class ViewVideoActivity extends AppCompatActivity {
SharedPreferences mSharedPreferences;
@Inject
+ CustomThemeWrapper mCustomThemeWrapper;
+
+ @Inject
Executor mExecutor;
@Inject
@@ -566,10 +571,13 @@ public class ViewVideoActivity extends AppCompatActivity {
hdButton.setVisibility(View.VISIBLE);
hdButton.setOnClickListener(view -> {
- TrackSelectionDialogBuilder build = new TrackSelectionDialogBuilder(ViewVideoActivity.this, getString(R.string.select_video_quality), trackSelector, 0);
- build.setShowDisableOption(true);
- build.setAllowAdaptiveSelections(false);
- build.build().show();
+ TrackSelectionDialogBuilder builder = new TrackSelectionDialogBuilder(ViewVideoActivity.this, getString(R.string.select_video_quality), trackSelector, 0);
+ builder.setShowDisableOption(true);
+ builder.setAllowAdaptiveSelections(false);
+ AlertDialog alertDialog = builder.build();
+ alertDialog.show();
+ alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
+ alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
});
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRPANBroadcastFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRPANBroadcastFragment.java
index 66921637..5b7dcb2c 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRPANBroadcastFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRPANBroadcastFragment.java
@@ -1,5 +1,6 @@
package ml.docilealligator.infinityforreddit.fragments;
+import android.app.AlertDialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
@@ -207,11 +208,14 @@ public class ViewRPANBroadcastFragment extends Fragment {
hdButton.setVisibility(View.VISIBLE);
hdButton.setOnClickListener(view -> {
- TrackSelectionDialogBuilder build = new TrackSelectionDialogBuilder(mActivity,
+ TrackSelectionDialogBuilder builder = new TrackSelectionDialogBuilder(mActivity,
getString(R.string.select_video_quality), trackSelector, 0);
- build.setShowDisableOption(true);
- build.setAllowAdaptiveSelections(false);
- build.build().show();
+ builder.setShowDisableOption(true);
+ builder.setAllowAdaptiveSelections(false);
+ AlertDialog alertDialog = builder.build();
+ alertDialog.show();
+ alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
+ alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setTextColor(mCustomThemeWrapper.getPrimaryTextColor());
});
for (int i = 0; i < trackGroups.length; i++) {
diff --git a/app/src/main/res/layout/item_post_card_2_video_autoplay.xml b/app/src/main/res/layout/item_post_card_2_video_autoplay.xml
index 62f68bb2..3f3cf37c 100644
--- a/app/src/main/res/layout/item_post_card_2_video_autoplay.xml
+++ b/app/src/main/res/layout/item_post_card_2_video_autoplay.xml
@@ -31,6 +31,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:show_timeout="1500"
+ app:auto_show="false"
app:controller_layout_id="@layout/exo_autoplay_playback_control_view" />
<pl.droidsonroids.gif.GifImageView
diff --git a/app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml b/app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml
index 458630ef..002afb56 100644
--- a/app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml
+++ b/app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml
@@ -31,6 +31,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:show_timeout="1500"
+ app:auto_show="false"
app:controller_layout_id="@layout/exo_autoplay_playback_control_view_legacy" />
<pl.droidsonroids.gif.GifImageView
diff --git a/app/src/main/res/layout/item_post_detail_video_autoplay.xml b/app/src/main/res/layout/item_post_detail_video_autoplay.xml
index ff03dacc..aa3a3662 100644
--- a/app/src/main/res/layout/item_post_detail_video_autoplay.xml
+++ b/app/src/main/res/layout/item_post_detail_video_autoplay.xml
@@ -214,6 +214,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:show_timeout="1500"
+ app:auto_show="false"
app:controller_layout_id="@layout/exo_autoplay_playback_control_view" />
<pl.droidsonroids.gif.GifImageView
diff --git a/app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml b/app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml
index 56784af0..8e1b67ac 100644
--- a/app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml
+++ b/app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml
@@ -214,6 +214,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:show_timeout="1500"
+ app:auto_show="false"
app:controller_layout_id="@layout/exo_autoplay_playback_control_view_legacy" />
<pl.droidsonroids.gif.GifImageView
diff --git a/app/src/main/res/layout/item_post_video_type_autoplay.xml b/app/src/main/res/layout/item_post_video_type_autoplay.xml
index 3ea2d41a..b63b608e 100644
--- a/app/src/main/res/layout/item_post_video_type_autoplay.xml
+++ b/app/src/main/res/layout/item_post_video_type_autoplay.xml
@@ -208,6 +208,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:show_timeout="1500"
+ app:auto_show="false"
app:controller_layout_id="@layout/exo_autoplay_playback_control_view" />
<pl.droidsonroids.gif.GifImageView
diff --git a/app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml b/app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml
index 12369cd3..6dc38374 100644
--- a/app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml
+++ b/app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml
@@ -208,6 +208,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:show_timeout="1500"
+ app:auto_show="false"
app:controller_layout_id="@layout/exo_autoplay_playback_control_view_legacy" />
<pl.droidsonroids.gif.GifImageView