Revert "MediaRouterV2: MediaRouteChooserDialog layout"

This reverts commit 8e3673d6d77a2e223942884ba83a939266a11972.

Change-Id: I348508800cc7d7b575a7768e3e5975b1ebcbd8a3
diff --git a/v7/mediarouter/res/layout-v17/mr_media_route_list_item.xml b/v7/mediarouter/res/layout-v17/mr_media_route_list_item.xml
index 708f342..1b798ee 100644
--- a/v7/mediarouter/res/layout-v17/mr_media_route_list_item.xml
+++ b/v7/mediarouter/res/layout-v17/mr_media_route_list_item.xml
@@ -16,26 +16,21 @@
 
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               android:layout_width="match_parent"
-              android:layout_height="wrap_content"
-              android:orientation="horizontal"
+              android:layout_height="?android:attr/listPreferredItemHeight"
               android:gravity="center_vertical">
 
-    <ImageView android:id="@+id/routeIcon"
-               android:layout_width="24dp"
-               android:layout_height="24dp"
-               android:layout_marginRight="24dp"
-               android:src="?attr/mediaRouteOnDrawable"/>
-
     <LinearLayout android:layout_width="0dp"
-                  android:layout_height="wrap_content"
+                  android:layout_height="match_parent"
                   android:layout_weight="1"
                   android:orientation="vertical"
                   android:gravity="start|center_vertical"
+                  android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+                  android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
                   android:duplicateParentState="true">
 
         <TextView android:id="@android:id/text1"
                   android:layout_width="match_parent"
-                  android:layout_height="32dp"
+                  android:layout_height="wrap_content"
                   android:singleLine="true"
                   android:ellipsize="marquee"
                   android:textAppearance="?android:attr/textAppearanceMedium"
@@ -43,7 +38,7 @@
 
         <TextView android:id="@android:id/text2"
                   android:layout_width="match_parent"
-                  android:layout_height="24dp"
+                  android:layout_height="wrap_content"
                   android:singleLine="true"
                   android:ellipsize="marquee"
                   android:textAppearance="?android:attr/textAppearanceSmall"
diff --git a/v7/mediarouter/res/layout/mr_media_route_chooser_dialog.xml b/v7/mediarouter/res/layout/mr_media_route_chooser_dialog.xml
index d130afe..afdad71 100644
--- a/v7/mediarouter/res/layout/mr_media_route_chooser_dialog.xml
+++ b/v7/mediarouter/res/layout/mr_media_route_chooser_dialog.xml
@@ -17,14 +17,10 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
-              android:orientation="vertical"
-              android:padding="24dp">
-
+              android:orientation="vertical">
     <ListView android:id="@+id/media_route_list"
               android:layout_width="fill_parent"
-              android:layout_height="wrap_content"
-              android:divider="@android:color/transparent"
-              android:dividerHeight="@dimen/mr_list_item_margin"/>
+              android:layout_height="wrap_content" />
 
     <LinearLayout android:id="@android:id/empty"
               android:layout_width="fill_parent"
diff --git a/v7/mediarouter/res/values-v17/dimens.xml b/v7/mediarouter/res/values-v17/dimens.xml
deleted file mode 100644
index 41b5479..0000000
--- a/v7/mediarouter/res/values-v17/dimens.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2015 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.
--->
-
-<resources>
-    <dimen name="mr_list_item_margin">24dp</dimen>
-</resources>
\ No newline at end of file
diff --git a/v7/mediarouter/res/values/dimens.xml b/v7/mediarouter/res/values/dimens.xml
index b6c3058..e687c82 100644
--- a/v7/mediarouter/res/values/dimens.xml
+++ b/v7/mediarouter/res/values/dimens.xml
@@ -16,5 +16,4 @@
 
 <resources>
     <dimen name="mr_media_route_controller_art_max_height">320dp</dimen>
-    <dimen name="mr_list_item_margin">0dp</dimen>
 </resources>
\ No newline at end of file
diff --git a/v7/mediarouter/res/values/strings.xml b/v7/mediarouter/res/values/strings.xml
index 70df280..a87ce4f 100644
--- a/v7/mediarouter/res/values/strings.xml
+++ b/v7/mediarouter/res/values/strings.xml
@@ -26,7 +26,7 @@
     <string name="mr_media_route_button_content_description">Cast</string>
 
     <!-- Title of the media route chooser dialog. [CHAR LIMIT=30] -->
-    <string name="mr_media_route_chooser_title">Cast to</string>
+    <string name="mr_media_route_chooser_title">Connect to device</string>
 
     <!-- Placeholder text to show when no devices have been found. [CHAR LIMIT=50] -->
     <string name="mr_media_route_chooser_searching">Searching for devices\u2026</string>
diff --git a/v7/mediarouter/src/android/support/v7/app/MediaRouteChooserDialog.java b/v7/mediarouter/src/android/support/v7/app/MediaRouteChooserDialog.java
index 7746745..9dea547 100644
--- a/v7/mediarouter/src/android/support/v7/app/MediaRouteChooserDialog.java
+++ b/v7/mediarouter/src/android/support/v7/app/MediaRouteChooserDialog.java
@@ -18,8 +18,6 @@
 
 import android.app.Dialog;
 import android.content.Context;
-import android.graphics.Color;
-import android.graphics.drawable.ColorDrawable;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.v7.media.MediaControlIntent;
@@ -141,9 +139,16 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
+        getWindow().requestFeature(Window.FEATURE_LEFT_ICON);
+
         setContentView(R.layout.mr_media_route_chooser_dialog);
         setTitle(R.string.mr_media_route_chooser_title);
 
+        // Must be called after setContentView.
+        getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,
+                MediaRouterThemeHelper.getThemeResource(
+                        getContext(), R.attr.mediaRouteOffDrawable));
+
         mRoutes = new ArrayList<MediaRouter.RouteInfo>();
         mAdapter = new RouteAdapter(getContext(), mRoutes);
         mListView = (ListView)findViewById(R.id.media_route_list);