New useragent switcher design
Uses a popup menu off of the globe on tablets or favicon on phones
Change-Id: Ia3634b5a218456127abb8b266a6cfc664836b037
diff --git a/res/drawable-mdpi/ic_ua_android.png b/res/drawable-mdpi/ic_ua_android.png
deleted file mode 100644
index 4f7aa45..0000000
--- a/res/drawable-mdpi/ic_ua_android.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_ua_desktop.png b/res/drawable-mdpi/ic_ua_desktop.png
deleted file mode 100644
index 4e2f5c2..0000000
--- a/res/drawable-mdpi/ic_ua_desktop.png
+++ /dev/null
Binary files differ
diff --git a/res/layout/help_dialog_useragent_switcher.xml b/res/layout/help_dialog_useragent_switcher.xml
deleted file mode 100644
index cc29a2d..0000000
--- a/res/layout/help_dialog_useragent_switcher.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2011 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="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/help_useragent_switcher" />
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/help_useragent_tablet" />
-
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/help_useragent_laptop" />
-
-</LinearLayout>
diff --git a/res/menu/ua_switcher.xml b/res/menu/ua_switcher.xml
new file mode 100644
index 0000000..5076fb2
--- /dev/null
+++ b/res/menu/ua_switcher.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/ua_mobile_menu_id"
+ android:checkable="true"
+ android:title="@string/ua_switcher_mobile" />
+ <item
+ android:id="@+id/ua_desktop_menu_id"
+ android:checkable="true"
+ android:title="@string/ua_switcher_desktop" />
+</menu>
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e51538c..b86edb5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -665,13 +665,6 @@
<!-- Summary for the fullscreen lab feature [CHAR LIMIT=120] -->
<string name="pref_lab_fullscreen_summary">
Use fullscreen mode to hide the status bar.</string>
- <!-- Title for the useragent switcher lab feature [CHAR LIMIT=40] -->
- <string name="pref_enable_useragent_switcher">Useragent Switcher</string>
- <!-- Summary for the useragent switcher lab feature [CHAR LIMIT=120] -->
- <string name="pref_enable_useragent_switcher_summary">Toggle between the tablet and desktop versions of a site</string>
- <!-- Text explaining how to use the useragent switcher lab feature [CHAR LIMIT=none] -->
- <string name="help_useragent_switcher">Tap on the Android or laptop icon to toggle between the tablet and desktop versions of a site.</string>
-
<!-- Title for a dialog displayed when the browser has a data connectivity
problem -->
<string name="browserFrameNetworkErrorLabel">Data connectivity problem</string>
@@ -1016,4 +1009,8 @@
<string name="preview">Preview:</string>
<!-- Name for the user's unsynced, local bookmarks [CHAR LIMIT=50] -->
<string name="local_bookmarks">Local</string>
+ <!-- Popup menu option that allows the user to select the mobile version of a webpage [CHAR LIMIT=50] -->
+ <string name="ua_switcher_mobile">Mobile</string>
+ <!-- Popup menu option that allows the user to select the desktop version of a webpage [CHAR LIMIT=50] -->
+ <string name="ua_switcher_desktop">Desktop</string>
</resources>
diff --git a/res/xml-sw600dp/lab_preferences.xml b/res/xml-sw600dp/lab_preferences.xml
index c858c38..705f740 100644
--- a/res/xml-sw600dp/lab_preferences.xml
+++ b/res/xml-sw600dp/lab_preferences.xml
@@ -35,9 +35,4 @@
android:title="@string/pref_use_instant_search"
android:summary="@string/pref_use_instant_search_summary" />
- <CheckBoxPreference
- android:key="enable_useragent_switcher"
- android:defaultValue="false"
- android:title="@string/pref_enable_useragent_switcher"
- android:summary="@string/pref_enable_useragent_switcher_summary" />
</PreferenceScreen>