Bug 1084098 - Add Android tools tags to some Remote Tabs home panel views. r=mcomella
authorNick Alexander <nalexander@mozilla.com>
Mon, 08 Dec 2014 19:32:51 -0800
changeset 218747 24f1cc4e2e329403d536b467fe2f6e0bd2b30d5d
parent 218746 ddb6ffa2c017b2f5727ae31b1851f87a6c8b0a39
child 218748 b46dc702c59c020bd5e1d2ed238e726affa4f053
push id10301
push usernalexander@mozilla.com
push dateTue, 09 Dec 2014 03:32:57 +0000
treeherderfx-team@24f1cc4e2e32 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1084098
milestone37.0a1
Bug 1084098 - Add Android tools tags to some Remote Tabs home panel views. r=mcomella These tags are used by Android tools (including IntelliJ) at design-time to show "sample data". They're stripped entirely at build time.
mobile/android/base/resources/layout/home_remote_tabs_group.xml
mobile/android/base/resources/layout/two_line_page_row.xml
--- a/mobile/android/base/resources/layout/home_remote_tabs_group.xml
+++ b/mobile/android/base/resources/layout/home_remote_tabs_group.xml
@@ -1,54 +1,59 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
    This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/.
 -->
 
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
     xmlns:gecko="http://schemas.android.com/apk/res-auto"
     style="@style/Widget.RemoteTabsClientView"
     android:gravity="center_vertical"
     android:layout_width="match_parent"
     android:layout_height="@dimen/page_group_height"
     android:minHeight="@dimen/page_group_height">
 
     <ImageView
         android:id="@+id/device_type"
         android:layout_width="50dp"
         android:layout_height="50dp"
         android:layout_marginLeft="5dp"
         android:layout_gravity="center_vertical"
-        android:scaleType="center"/>
+        android:scaleType="center"
+        tools:src="@drawable/sync_mobile"/>
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_weight="1"
         android:orientation="vertical">
 
         <org.mozilla.gecko.widget.FadedTextView
             android:id="@+id/client"
             style="@style/Widget.TwoLinePageRow.Title"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            gecko:fadeWidth="30dp"/>
+            gecko:fadeWidth="30dp"
+            tools:text="Firefox on Nexus 5"/>
 
         <TextView
             android:id="@+id/last_synced"
             style="@style/Widget.TwoLinePageRow.Url"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginTop="4dp"
-            android:maxLength="1024"/>
+            android:maxLength="1024"
+            tools:text="Last synced: 5 minutes ago"/>
     </LinearLayout>
 
     <ImageView
         android:id="@+id/device_expanded"
         android:layout_height="wrap_content"
         android:layout_width="wrap_content"
         android:layout_marginLeft="15dip"
         android:layout_marginRight="15dip"
-        android:scaleType="center"/>
+        android:scaleType="center"
+        tools:src="@drawable/home_group_expanded"/>
 
 </LinearLayout>
--- a/mobile/android/base/resources/layout/two_line_page_row.xml
+++ b/mobile/android/base/resources/layout/two_line_page_row.xml
@@ -1,35 +1,42 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <merge xmlns:android="http://schemas.android.com/apk/res/android"
-       xmlns:gecko="http://schemas.android.com/apk/res-auto">
+       xmlns:tools="http://schemas.android.com/tools"
+       xmlns:gecko="http://schemas.android.com/apk/res-auto"
+       tools:context=".BrowserApp">
 
     <org.mozilla.gecko.widget.FaviconView android:id="@+id/icon"
                                           android:layout_width="@dimen/favicon_bg"
                                           android:layout_height="@dimen/favicon_bg"
-                                          android:layout_margin="16dp"/>
+                                          android:layout_margin="16dp"
+                                          tools:background="@drawable/favicon"/>
 
     <LinearLayout android:layout_width="match_parent"
                   android:layout_height="wrap_content"
                   android:layout_gravity="center_vertical"
                   android:orientation="vertical"
                   android:paddingRight="25dp">
 
         <org.mozilla.gecko.widget.FadedTextView
                 android:id="@+id/title"
                 style="@style/Widget.TwoLinePageRow.Title"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                gecko:fadeWidth="30dp"/>
+                gecko:fadeWidth="30dp"
+                tools:text="This is a long test title"/>
 
         <TextView android:id="@+id/url"
                   style="@style/Widget.TwoLinePageRow.Url"
                   android:layout_width="match_parent"
                   android:layout_height="wrap_content"
                   android:drawablePadding="5dp"
-                  android:maxLength="1024"/>
+                  android:maxLength="1024"
+                  tools:text="http://test.com/test"
+                  tools:drawableLeft="@drawable/ic_url_bar_tab"
+                  tools:drawableRight="@drawable/ic_url_bar_star"/>
 
     </LinearLayout>
 </merge>