diff options
author | Nagesh Susarla <nageshs@google.com> | 2014-11-07 16:18:29 -0800 |
---|---|---|
committer | Nagesh Susarla <nageshs@google.com> | 2014-11-07 16:34:28 -0800 |
commit | 372eb5f8210ae554e2e4c08efae429b2f03b994f (patch) | |
tree | b673664505367838c492774b955288ae47ee3808 /MusicDemo/src/main/res/layout | |
parent | 48082ec84e063d07f6ff3cf7de53f84b5e6b4775 (diff) | |
download | demos-372eb5f8210ae554e2e4c08efae429b2f03b994f.tar.gz |
Add a client for the MediaBrowserService.
1. Add a simple UI that shows
a) using MediaBrowser to connect/browse to a MediaBrowserService exported by the same app.
b) Use the MediaController callbacks to show and list the QueueItem objects.
2. Update the MusicService to add the activeQueueItemId to the PlaybackState.Builder. This
is used for marking/selecting the item being played.
Change-Id: I33b18804b571cd6e46f3f56bb534aa8b831e8acb
Diffstat (limited to 'MusicDemo/src/main/res/layout')
-rw-r--r-- | MusicDemo/src/main/res/layout/activity_player.xml | 22 | ||||
-rw-r--r-- | MusicDemo/src/main/res/layout/fragment_list.xml | 60 | ||||
-rw-r--r-- | MusicDemo/src/main/res/layout/list_item.xml | 55 |
3 files changed, 137 insertions, 0 deletions
diff --git a/MusicDemo/src/main/res/layout/activity_player.xml b/MusicDemo/src/main/res/layout/activity_player.xml new file mode 100644 index 0000000..21cdbbd --- /dev/null +++ b/MusicDemo/src/main/res/layout/activity_player.xml @@ -0,0 +1,22 @@ +<!-- + Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/container" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".MusicPlayerActivity" + tools:ignore="MergeRootFrame" /> diff --git a/MusicDemo/src/main/res/layout/fragment_list.xml b/MusicDemo/src/main/res/layout/fragment_list.xml new file mode 100644 index 0000000..a40240f --- /dev/null +++ b/MusicDemo/src/main/res/layout/fragment_list.xml @@ -0,0 +1,60 @@ +<!-- + Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:padding="16dp"> + + <LinearLayout + android:id="@+id/controls" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + + <ImageButton + android:id="@+id/skip_previous" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:src="@drawable/ic_skip_previous_white_24dp" + android:contentDescription="@string/skip_previous"/> + + <ImageButton + android:id="@+id/play_pause" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:src="@drawable/ic_play_arrow_white_24dp" + android:contentDescription="@string/play_pause"/> + + <ImageButton + android:id="@+id/skip_next" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:src="@drawable/ic_skip_next_white_24dp" + android:contentDescription="@string/skip_next"/> + + </LinearLayout> + + <ListView + android:id="@+id/list_view" + android:layout_width="match_parent" + android:layout_height="match_parent"> + </ListView> + +</LinearLayout> diff --git a/MusicDemo/src/main/res/layout/list_item.xml b/MusicDemo/src/main/res/layout/list_item.xml new file mode 100644 index 0000000..729628f --- /dev/null +++ b/MusicDemo/src/main/res/layout/list_item.xml @@ -0,0 +1,55 @@ +<!-- + Copyright (C) 2014 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?android:listPreferredItemHeight" + android:orientation="horizontal"> + + <ImageView + android:id="@+id/play_eq" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:contentDescription="@string/play_item" + android:src="@drawable/ic_play_arrow_white_24dp"/> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?android:attr/listPreferredItemHeight" + android:mode="twoLine" + android:padding="4dp" + android:orientation="vertical"> + + <TextView + android:id="@+id/title" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/margin_text_view" + android:layout_marginTop="@dimen/margin_text_view" + android:textAppearance="?android:attr/textAppearanceMedium"/> + + <TextView + android:id="@+id/description" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/margin_text_view" + android:layout_marginTop="@dimen/margin_text_view" + android:textAppearance="?android:attr/textAppearanceSmall"/> + + </LinearLayout> + +</LinearLayout> |