aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-07-26 22:01:03 -0700
committerScott Jackson <daneren2005@gmail.com>2016-07-26 22:01:03 -0700
commitaeb5cf0c40a177e6a4ecfbbf0f4e059618311242 (patch)
tree807bf245da5c0aabb5bd64b21d2ba3bccfeec4fd
parent48ea6cd175f4e620c668ce94c2b1a0e3e2c906c6 (diff)
downloaddsub-aeb5cf0c40a177e6a4ecfbbf0f4e059618311242.tar.gz
dsub-aeb5cf0c40a177e6a4ecfbbf0f4e059618311242.tar.bz2
dsub-aeb5cf0c40a177e6a4ecfbbf0f4e059618311242.zip
Fix the cast dialog theme not matching
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java3
-rw-r--r--app/src/main/java/github/daneren2005/dsub/view/compat/CustomMediaRouteChooserDialogFragment.java15
-rw-r--r--app/src/main/java/github/daneren2005/dsub/view/compat/CustomMediaRouteControllerDialogFragment.java15
-rw-r--r--app/src/main/java/github/daneren2005/dsub/view/compat/CustomMediaRouteDialogFactory.java17
4 files changed, 49 insertions, 1 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
index 530c03b6..7c20dc28 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java
@@ -60,7 +60,6 @@ import github.daneren2005.dsub.activity.SubsonicFragmentActivity;
import github.daneren2005.dsub.adapter.SectionAdapter;
import github.daneren2005.dsub.audiofx.EqualizerController;
import github.daneren2005.dsub.domain.Bookmark;
-import github.daneren2005.dsub.domain.MusicDirectory;
import github.daneren2005.dsub.domain.PlayerState;
import github.daneren2005.dsub.domain.RepeatMode;
import github.daneren2005.dsub.domain.ServerInfo;
@@ -74,6 +73,7 @@ import github.daneren2005.dsub.service.ServerTooOldException;
import github.daneren2005.dsub.util.Constants;
import github.daneren2005.dsub.util.SilentBackgroundTask;
import github.daneren2005.dsub.adapter.DownloadFileAdapter;
+import github.daneren2005.dsub.view.compat.CustomMediaRouteDialogFactory;
import github.daneren2005.dsub.view.FadeOutAnimation;
import github.daneren2005.dsub.view.FastScroller;
import github.daneren2005.dsub.view.UpdateView;
@@ -535,6 +535,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
MenuItem mediaRouteItem = menu.findItem(R.id.menu_mediaroute);
if(mediaRouteItem != null) {
MediaRouteButton mediaRouteButton = (MediaRouteButton) MenuItemCompat.getActionView(mediaRouteItem);
+ mediaRouteButton.setDialogFactory(new CustomMediaRouteDialogFactory());
mediaRouteButton.setRouteSelector(downloadService.getRemoteSelector());
}
}
diff --git a/app/src/main/java/github/daneren2005/dsub/view/compat/CustomMediaRouteChooserDialogFragment.java b/app/src/main/java/github/daneren2005/dsub/view/compat/CustomMediaRouteChooserDialogFragment.java
new file mode 100644
index 00000000..da9b135f
--- /dev/null
+++ b/app/src/main/java/github/daneren2005/dsub/view/compat/CustomMediaRouteChooserDialogFragment.java
@@ -0,0 +1,15 @@
+package github.daneren2005.dsub.view.compat;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.v7.app.MediaRouteChooserDialog;
+import android.support.v7.app.MediaRouteChooserDialogFragment;
+
+import github.daneren2005.dsub.util.Util;
+
+public class CustomMediaRouteChooserDialogFragment extends MediaRouteChooserDialogFragment {
+ @Override
+ public MediaRouteChooserDialog onCreateChooserDialog(Context context, Bundle savedInstanceState) {
+ return new MediaRouteChooserDialog(context, Util.getThemeRes(context));
+ }
+}
diff --git a/app/src/main/java/github/daneren2005/dsub/view/compat/CustomMediaRouteControllerDialogFragment.java b/app/src/main/java/github/daneren2005/dsub/view/compat/CustomMediaRouteControllerDialogFragment.java
new file mode 100644
index 00000000..7fd54142
--- /dev/null
+++ b/app/src/main/java/github/daneren2005/dsub/view/compat/CustomMediaRouteControllerDialogFragment.java
@@ -0,0 +1,15 @@
+package github.daneren2005.dsub.view.compat;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.v7.app.MediaRouteControllerDialog;
+import android.support.v7.app.MediaRouteControllerDialogFragment;
+
+import github.daneren2005.dsub.util.Util;
+
+public class CustomMediaRouteControllerDialogFragment extends MediaRouteControllerDialogFragment {
+ @Override
+ public MediaRouteControllerDialog onCreateControllerDialog(Context context, Bundle savedInstanceState) {
+ return new MediaRouteControllerDialog(context, Util.getThemeRes(context));
+ }
+}
diff --git a/app/src/main/java/github/daneren2005/dsub/view/compat/CustomMediaRouteDialogFactory.java b/app/src/main/java/github/daneren2005/dsub/view/compat/CustomMediaRouteDialogFactory.java
new file mode 100644
index 00000000..8bc890cb
--- /dev/null
+++ b/app/src/main/java/github/daneren2005/dsub/view/compat/CustomMediaRouteDialogFactory.java
@@ -0,0 +1,17 @@
+package github.daneren2005.dsub.view.compat;
+
+import android.support.v7.app.MediaRouteChooserDialogFragment;
+import android.support.v7.app.MediaRouteControllerDialogFragment;
+import android.support.v7.app.MediaRouteDialogFactory;
+
+public class CustomMediaRouteDialogFactory extends MediaRouteDialogFactory {
+ @Override
+ public MediaRouteChooserDialogFragment onCreateChooserDialogFragment() {
+ return new CustomMediaRouteChooserDialogFragment();
+ }
+
+ @Override
+ public MediaRouteControllerDialogFragment onCreateControllerDialogFragment() {
+ return new CustomMediaRouteControllerDialogFragment();
+ }
+}