Skip to content

Commit ef5f6ff

Browse files
committed
Fix crash on pre-21 devices.
Change-Id: Ic5ff46c99210362b28d1dd56dc0f275d94431e5c
1 parent 96a57f3 commit ef5f6ff

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

mediacontroller/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ android {
2727
versionCode 1
2828
versionName "1.0"
2929

30+
vectorDrawables.useSupportLibrary = true
3031
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
3132

3233
}

mediacontroller/src/main/res/layout/activity_launch.xml

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
limitations under the License.
1616
-->
1717
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
18-
xmlns:app="http://schemas.android.com/apk/res-auto"
19-
xmlns:tools="http://schemas.android.com/tools"
20-
android:layout_width="match_parent"
21-
android:layout_height="match_parent"
22-
android:orientation="vertical"
23-
tools:context="com.example.android.mediacontroller.LaunchActivity">
18+
xmlns:app="http://schemas.android.com/apk/res-auto"
19+
xmlns:tools="http://schemas.android.com/tools"
20+
android:layout_width="match_parent"
21+
android:layout_height="match_parent"
22+
android:orientation="vertical"
23+
tools:context="com.example.android.mediacontroller.LaunchActivity">
2424

2525
<android.support.design.widget.AppBarLayout
2626
android:layout_width="match_parent"
@@ -32,7 +32,7 @@
3232
android:layout_width="match_parent"
3333
android:layout_height="?attr/actionBarSize"
3434
android:background="?attr/colorPrimary"
35-
app:popupTheme="@style/AppTheme.PopupOverlay" />
35+
app:popupTheme="@style/AppTheme.PopupOverlay"/>
3636

3737
android.support.design.widget.AppBarLayout>
3838

@@ -41,30 +41,31 @@
4141
android:layout_width="match_parent"
4242
android:layout_height="match_parent"
4343
app:layoutManager=""
44-
tools:visibility="gone" />
44+
tools:visibility="gone"/>
4545

46-
<FrameLayout
46+
<LinearLayout
4747
android:id="@+id/no_apps_found"
4848
android:layout_width="match_parent"
49-
android:layout_height="match_parent">
49+
android:layout_height="match_parent"
50+
android:gravity="center_vertical"
51+
android:orientation="vertical">
5052

51-
<LinearLayout
52-
android:orientation="vertical"
53-
android:layout_gravity="center"
53+
<ImageView
5454
android:layout_width="match_parent"
55-
android:layout_height="wrap_content">
55+
android:layout_height="wrap_content"
56+
android:layout_gravity="center_horizontal"
57+
app:srcCompat="@drawable/ic_no_apps_black_24dp"
58+
tools:ignore="contentDescription"/>
5659

57-
<TextView
58-
android:layout_width="match_parent"
59-
android:layout_height="wrap_content"
60-
android:drawableTop="@drawable/ic_no_apps_black_24dp"
61-
android:gravity="center"
62-
android:textSize="@dimen/error_text_size"
63-
android:text="@string/no_apps_found" />
60+
<TextView
61+
android:layout_width="match_parent"
62+
android:layout_height="wrap_content"
63+
android:gravity="center"
64+
android:text="@string/no_apps_found"
65+
android:textSize="@dimen/error_text_size"/>
6466

65-
<TextView
66-
android:layout_width="match_parent"
67-
android:layout_height="wrap_content" />
68-
LinearLayout>
69-
FrameLayout>
67+
<TextView
68+
android:layout_width="match_parent"
69+
android:layout_height="wrap_content"/>
70+
LinearLayout>
7071
LinearLayout>

0 commit comments

Comments
 (0)