summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorJae Seo <jaeseo@google.com>2015-08-25 13:58:27 +0900
committerJae Seo <jaeseo@google.com>2015-08-25 13:59:20 +0900
commitb26f52f2c06ee64f4e154f560c93f65982817482 (patch)
treea6e0213439604d2264337c51c875b8cdae0e285f /samples
parent327fee84b57a902ee35f2dd7c5d2c4e65f790aac (diff)
downloadandroid_development-b26f52f2c06ee64f4e154f560c93f65982817482.tar.gz
android_development-b26f52f2c06ee64f4e154f560c93f65982817482.tar.bz2
android_development-b26f52f2c06ee64f4e154f560c93f65982817482.zip
MediaRouter: Add a sample for the custom route icon
Bug: 23116379 Change-Id: Ie744f40584e4f39cf17cd58d238f98059a8a88a3
Diffstat (limited to 'samples')
-rwxr-xr-xsamples/Support7Demos/res/drawable-hdpi/ic_android.pngbin0 -> 358 bytes
-rwxr-xr-xsamples/Support7Demos/res/drawable-mdpi/ic_android.pngbin0 -> 226 bytes
-rw-r--r--samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouteProvider.java13
3 files changed, 7 insertions, 6 deletions
diff --git a/samples/Support7Demos/res/drawable-hdpi/ic_android.png b/samples/Support7Demos/res/drawable-hdpi/ic_android.png
new file mode 100755
index 000000000..94b8fb1fa
--- /dev/null
+++ b/samples/Support7Demos/res/drawable-hdpi/ic_android.png
Binary files differ
diff --git a/samples/Support7Demos/res/drawable-mdpi/ic_android.png b/samples/Support7Demos/res/drawable-mdpi/ic_android.png
new file mode 100755
index 000000000..afc43dbdd
--- /dev/null
+++ b/samples/Support7Demos/res/drawable-mdpi/ic_android.png
Binary files differ
diff --git a/samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouteProvider.java b/samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouteProvider.java
index 7bd6e6f4d..8c5d2262b 100644
--- a/samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouteProvider.java
+++ b/samples/Support7Demos/src/com/example/android/supportv7/media/SampleMediaRouteProvider.java
@@ -133,18 +133,16 @@ final class SampleMediaRouteProvider extends MediaRouteProvider {
f6.addAction(MediaControlIntent.ACTION_GET_SESSION_STATUS);
f6.addAction(MediaControlIntent.ACTION_END_SESSION);
- CONTROL_FILTERS_BASIC = new ArrayList<IntentFilter>();
+ CONTROL_FILTERS_BASIC = new ArrayList<>();
CONTROL_FILTERS_BASIC.add(f1);
CONTROL_FILTERS_BASIC.add(f2);
CONTROL_FILTERS_BASIC.add(f3);
- CONTROL_FILTERS_QUEUING =
- new ArrayList<IntentFilter>(CONTROL_FILTERS_BASIC);
+ CONTROL_FILTERS_QUEUING = new ArrayList<>(CONTROL_FILTERS_BASIC);
CONTROL_FILTERS_QUEUING.add(f4);
CONTROL_FILTERS_QUEUING.add(f5);
- CONTROL_FILTERS_SESSION =
- new ArrayList<IntentFilter>(CONTROL_FILTERS_QUEUING);
+ CONTROL_FILTERS_SESSION = new ArrayList<>(CONTROL_FILTERS_QUEUING);
CONTROL_FILTERS_SESSION.add(f6);
}
@@ -157,7 +155,6 @@ final class SampleMediaRouteProvider extends MediaRouteProvider {
}
private int mVolume = 5;
- private int mEnqueueCount;
public SampleMediaRouteProvider(Context context) {
super(context);
@@ -243,6 +240,9 @@ final class SampleMediaRouteProvider extends MediaRouteProvider {
.setVolume(mVolume)
.build();
+ Uri iconUri = Uri.parse("android.resource://com.example.android.supportv7/"
+ + R.drawable.ic_android);
+
MediaRouteDescriptor routeDescriptor6 = new MediaRouteDescriptor.Builder(
MIXED_VOLUME_ROUTE_GROUP_ID,
r.getString(R.string.mixed_volume_route_group_name))
@@ -250,6 +250,7 @@ final class SampleMediaRouteProvider extends MediaRouteProvider {
.addChildId(VARIABLE_VOLUME_BASIC_ROUTE_ID)
.addChildId(VARIABLE_VOLUME_QUEUING_ROUTE_ID)
.setDescription(r.getString(R.string.sample_route_description))
+ .setIconUri(iconUri)
.addControlFilters(CONTROL_FILTERS_SESSION)
.setPlaybackStream(AudioManager.STREAM_MUSIC)
.setPlaybackType(MediaRouter.RouteInfo.PLAYBACK_TYPE_REMOTE)