Loading core/java/com/android/internal/app/MediaRouteChooserDialog.java +9 −1 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.media.MediaRouter; import android.media.MediaRouter.RouteInfo; import android.media.MediaRouter.RouteInfo; import android.os.Bundle; import android.os.Bundle; import android.text.TextUtils; import android.text.TextUtils; import android.util.TypedValue; import android.view.LayoutInflater; import android.view.LayoutInflater; import android.view.View; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup; Loading Loading @@ -130,7 +131,8 @@ public class MediaRouteChooserDialog extends Dialog { // Must be called after setContentView. // Must be called after setContentView. getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_media_route_off_holo_dark); isLightTheme(getContext()) ? R.drawable.ic_media_route_off_holo_light : R.drawable.ic_media_route_off_holo_dark); mAdapter = new RouteAdapter(getContext()); mAdapter = new RouteAdapter(getContext()); mListView = (ListView)findViewById(R.id.media_route_list); mListView = (ListView)findViewById(R.id.media_route_list); Loading Loading @@ -176,6 +178,12 @@ public class MediaRouteChooserDialog extends Dialog { } } } } static boolean isLightTheme(Context context) { TypedValue value = new TypedValue(); return context.getTheme().resolveAttribute(R.attr.isLightTheme, value, true) && value.data != 0; } private final class RouteAdapter extends ArrayAdapter<MediaRouter.RouteInfo> private final class RouteAdapter extends ArrayAdapter<MediaRouter.RouteInfo> implements ListView.OnItemClickListener { implements ListView.OnItemClickListener { private final LayoutInflater mInflater; private final LayoutInflater mInflater; Loading core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -43,8 +43,12 @@ public class MediaRouteChooserDialogFragment extends DialogFragment { * </p> * </p> */ */ public MediaRouteChooserDialogFragment() { public MediaRouteChooserDialogFragment() { int theme = MediaRouteChooserDialog.isLightTheme(getContext()) ? android.R.style.Theme_DeviceDefault_Light_Dialog : android.R.style.Theme_DeviceDefault_Dialog; setCancelable(true); setCancelable(true); setStyle(STYLE_NORMAL, android.R.style.Theme_DeviceDefault_Dialog); setStyle(STYLE_NORMAL, theme); } } public int getRouteTypes() { public int getRouteTypes() { Loading core/java/com/android/internal/app/MediaRouteDialogPresenter.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -71,16 +71,18 @@ public abstract class MediaRouteDialogPresenter { final MediaRouter router = (MediaRouter)context.getSystemService( final MediaRouter router = (MediaRouter)context.getSystemService( Context.MEDIA_ROUTER_SERVICE); Context.MEDIA_ROUTER_SERVICE); int theme = MediaRouteChooserDialog.isLightTheme(context) ? android.R.style.Theme_DeviceDefault_Light_Dialog : android.R.style.Theme_DeviceDefault_Dialog; MediaRouter.RouteInfo route = router.getSelectedRoute(); MediaRouter.RouteInfo route = router.getSelectedRoute(); if (route.isDefault() || !route.matchesTypes(routeTypes)) { if (route.isDefault() || !route.matchesTypes(routeTypes)) { final MediaRouteChooserDialog d = new MediaRouteChooserDialog( final MediaRouteChooserDialog d = new MediaRouteChooserDialog(context, theme); context, android.R.style.Theme_DeviceDefault_Dialog); d.setRouteTypes(routeTypes); d.setRouteTypes(routeTypes); d.setExtendedSettingsClickListener(extendedSettingsClickListener); d.setExtendedSettingsClickListener(extendedSettingsClickListener); return d; return d; } else { } else { MediaRouteControllerDialog d = new MediaRouteControllerDialog( MediaRouteControllerDialog d = new MediaRouteControllerDialog(context, theme); context, android.R.style.Theme_DeviceDefault_Dialog); return d; return d; } } } } Loading core/res/res/values/arrays.xml +4 −0 Original line number Original line Diff line number Diff line Loading @@ -47,6 +47,10 @@ <item>@drawable/ic_clear_material</item> <item>@drawable/ic_clear_material</item> <item>@drawable/ic_dialog_alert_material</item> <item>@drawable/ic_dialog_alert_material</item> <item>@drawable/ic_go_search_api_material</item> <item>@drawable/ic_go_search_api_material</item> <item>@drawable/ic_media_route_connecting_dark_material</item> <item>@drawable/ic_media_route_connecting_light_material</item> <item>@drawable/ic_media_route_dark_material</item> <item>@drawable/ic_media_route_light_material</item> <item>@drawable/ic_menu_copy_material</item> <item>@drawable/ic_menu_copy_material</item> <item>@drawable/ic_menu_cut_material</item> <item>@drawable/ic_menu_cut_material</item> <item>@drawable/ic_menu_moreoverflow_material</item> <item>@drawable/ic_menu_moreoverflow_material</item> Loading core/res/res/values/symbols.xml +1 −3 Original line number Original line Diff line number Diff line Loading @@ -1306,10 +1306,8 @@ <java-symbol type="drawable" name="unlock_wave" /> <java-symbol type="drawable" name="unlock_wave" /> <java-symbol type="drawable" name="notification_template_icon_bg" /> <java-symbol type="drawable" name="notification_template_icon_bg" /> <java-symbol type="drawable" name="notification_template_icon_low_bg" /> <java-symbol type="drawable" name="notification_template_icon_low_bg" /> <java-symbol type="drawable" name="ic_media_route_on_holo_dark" /> <java-symbol type="drawable" name="ic_media_route_off_holo_dark" /> <java-symbol type="drawable" name="ic_media_route_off_holo_dark" /> <java-symbol type="drawable" name="ic_media_route_connecting_holo_dark" /> <java-symbol type="drawable" name="ic_media_route_off_holo_light" /> <java-symbol type="drawable" name="ic_media_route_disabled_holo_dark" /> <java-symbol type="drawable" name="cling_button" /> <java-symbol type="drawable" name="cling_button" /> <java-symbol type="drawable" name="cling_arrow_up" /> <java-symbol type="drawable" name="cling_arrow_up" /> <java-symbol type="drawable" name="cling_bg" /> <java-symbol type="drawable" name="cling_bg" /> Loading Loading
core/java/com/android/internal/app/MediaRouteChooserDialog.java +9 −1 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.media.MediaRouter; import android.media.MediaRouter.RouteInfo; import android.media.MediaRouter.RouteInfo; import android.os.Bundle; import android.os.Bundle; import android.text.TextUtils; import android.text.TextUtils; import android.util.TypedValue; import android.view.LayoutInflater; import android.view.LayoutInflater; import android.view.View; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup; Loading Loading @@ -130,7 +131,8 @@ public class MediaRouteChooserDialog extends Dialog { // Must be called after setContentView. // Must be called after setContentView. getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.ic_media_route_off_holo_dark); isLightTheme(getContext()) ? R.drawable.ic_media_route_off_holo_light : R.drawable.ic_media_route_off_holo_dark); mAdapter = new RouteAdapter(getContext()); mAdapter = new RouteAdapter(getContext()); mListView = (ListView)findViewById(R.id.media_route_list); mListView = (ListView)findViewById(R.id.media_route_list); Loading Loading @@ -176,6 +178,12 @@ public class MediaRouteChooserDialog extends Dialog { } } } } static boolean isLightTheme(Context context) { TypedValue value = new TypedValue(); return context.getTheme().resolveAttribute(R.attr.isLightTheme, value, true) && value.data != 0; } private final class RouteAdapter extends ArrayAdapter<MediaRouter.RouteInfo> private final class RouteAdapter extends ArrayAdapter<MediaRouter.RouteInfo> implements ListView.OnItemClickListener { implements ListView.OnItemClickListener { private final LayoutInflater mInflater; private final LayoutInflater mInflater; Loading
core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -43,8 +43,12 @@ public class MediaRouteChooserDialogFragment extends DialogFragment { * </p> * </p> */ */ public MediaRouteChooserDialogFragment() { public MediaRouteChooserDialogFragment() { int theme = MediaRouteChooserDialog.isLightTheme(getContext()) ? android.R.style.Theme_DeviceDefault_Light_Dialog : android.R.style.Theme_DeviceDefault_Dialog; setCancelable(true); setCancelable(true); setStyle(STYLE_NORMAL, android.R.style.Theme_DeviceDefault_Dialog); setStyle(STYLE_NORMAL, theme); } } public int getRouteTypes() { public int getRouteTypes() { Loading
core/java/com/android/internal/app/MediaRouteDialogPresenter.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -71,16 +71,18 @@ public abstract class MediaRouteDialogPresenter { final MediaRouter router = (MediaRouter)context.getSystemService( final MediaRouter router = (MediaRouter)context.getSystemService( Context.MEDIA_ROUTER_SERVICE); Context.MEDIA_ROUTER_SERVICE); int theme = MediaRouteChooserDialog.isLightTheme(context) ? android.R.style.Theme_DeviceDefault_Light_Dialog : android.R.style.Theme_DeviceDefault_Dialog; MediaRouter.RouteInfo route = router.getSelectedRoute(); MediaRouter.RouteInfo route = router.getSelectedRoute(); if (route.isDefault() || !route.matchesTypes(routeTypes)) { if (route.isDefault() || !route.matchesTypes(routeTypes)) { final MediaRouteChooserDialog d = new MediaRouteChooserDialog( final MediaRouteChooserDialog d = new MediaRouteChooserDialog(context, theme); context, android.R.style.Theme_DeviceDefault_Dialog); d.setRouteTypes(routeTypes); d.setRouteTypes(routeTypes); d.setExtendedSettingsClickListener(extendedSettingsClickListener); d.setExtendedSettingsClickListener(extendedSettingsClickListener); return d; return d; } else { } else { MediaRouteControllerDialog d = new MediaRouteControllerDialog( MediaRouteControllerDialog d = new MediaRouteControllerDialog(context, theme); context, android.R.style.Theme_DeviceDefault_Dialog); return d; return d; } } } } Loading
core/res/res/values/arrays.xml +4 −0 Original line number Original line Diff line number Diff line Loading @@ -47,6 +47,10 @@ <item>@drawable/ic_clear_material</item> <item>@drawable/ic_clear_material</item> <item>@drawable/ic_dialog_alert_material</item> <item>@drawable/ic_dialog_alert_material</item> <item>@drawable/ic_go_search_api_material</item> <item>@drawable/ic_go_search_api_material</item> <item>@drawable/ic_media_route_connecting_dark_material</item> <item>@drawable/ic_media_route_connecting_light_material</item> <item>@drawable/ic_media_route_dark_material</item> <item>@drawable/ic_media_route_light_material</item> <item>@drawable/ic_menu_copy_material</item> <item>@drawable/ic_menu_copy_material</item> <item>@drawable/ic_menu_cut_material</item> <item>@drawable/ic_menu_cut_material</item> <item>@drawable/ic_menu_moreoverflow_material</item> <item>@drawable/ic_menu_moreoverflow_material</item> Loading
core/res/res/values/symbols.xml +1 −3 Original line number Original line Diff line number Diff line Loading @@ -1306,10 +1306,8 @@ <java-symbol type="drawable" name="unlock_wave" /> <java-symbol type="drawable" name="unlock_wave" /> <java-symbol type="drawable" name="notification_template_icon_bg" /> <java-symbol type="drawable" name="notification_template_icon_bg" /> <java-symbol type="drawable" name="notification_template_icon_low_bg" /> <java-symbol type="drawable" name="notification_template_icon_low_bg" /> <java-symbol type="drawable" name="ic_media_route_on_holo_dark" /> <java-symbol type="drawable" name="ic_media_route_off_holo_dark" /> <java-symbol type="drawable" name="ic_media_route_off_holo_dark" /> <java-symbol type="drawable" name="ic_media_route_connecting_holo_dark" /> <java-symbol type="drawable" name="ic_media_route_off_holo_light" /> <java-symbol type="drawable" name="ic_media_route_disabled_holo_dark" /> <java-symbol type="drawable" name="cling_button" /> <java-symbol type="drawable" name="cling_button" /> <java-symbol type="drawable" name="cling_arrow_up" /> <java-symbol type="drawable" name="cling_arrow_up" /> <java-symbol type="drawable" name="cling_bg" /> <java-symbol type="drawable" name="cling_bg" /> Loading