Separate the leave-behind item into an include
We want to use this in the ad in Gmail
Change-Id: I8f8628d924b24435ccafb6b1e46c4dd6fb256366
diff --git a/res/layout/swipe_leavebehind.xml b/res/layout/swipe_leavebehind.xml
index a0bb4f6..9d0a50d 100644
--- a/res/layout/swipe_leavebehind.xml
+++ b/res/layout/swipe_leavebehind.xml
@@ -19,55 +19,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/swiped_bg_color">
- <LinearLayout
+
+ <include
android:id="@+id/swipeable_content"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:clickable="true"
- android:orientation="horizontal">
- <TextView
- android:id="@+id/undo_descriptionview"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:ellipsize="end"
- android:singleLine="true"
- android:text="@string/no_conversations"
- android:textColor="@android:color/white"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:paddingLeft="16dip"
- android:clickable="true"
- android:gravity="center_vertical"/>
+ layout="@layout/swipe_leavebehind_body" />
- <View
- android:id="@+id/undo_separator"
- android:layout_width="1dip"
- android:layout_height="match_parent"
- android:background="@android:color/white"
- android:layout_marginTop="16dp"
- android:layout_marginBottom="16dp" />
-
- <ImageView
- android:id="@+id/undo_icon"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:paddingLeft="12dip"
- android:paddingRight="8dip"
- android:src="@drawable/ic_menu_revert_holo_dark"
- android:background="?android:attr/selectableItemBackground"
- android:duplicateParentState="true" />
-
- <TextView
- android:id="@+id/undo_text"
- style="@style/UndoTextStyle"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:paddingRight="16dip"
- android:text="@string/undo"
- android:textAllCaps="true"
- android:gravity="center_vertical"
- android:textColor="@android:color/white"
- android:background="?android:attr/selectableItemBackground"
- android:duplicateParentState="true"/>
- </LinearLayout>
</com.android.mail.ui.LeaveBehindItem>
diff --git a/res/layout/swipe_leavebehind_body.xml b/res/layout/swipe_leavebehind_body.xml
new file mode 100644
index 0000000..027d33c
--- /dev/null
+++ b/res/layout/swipe_leavebehind_body.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 Google Inc.
+ Licensed to 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="match_parent"
+ android:clickable="true"
+ android:orientation="horizontal">
+ <TextView
+ android:id="@+id/undo_descriptionview"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:ellipsize="end"
+ android:singleLine="true"
+ android:text="@string/no_conversations"
+ android:textColor="@android:color/white"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:paddingLeft="16dip"
+ android:clickable="true"
+ android:gravity="center_vertical"/>
+
+ <View
+ android:id="@+id/undo_separator"
+ android:layout_width="1dip"
+ android:layout_height="match_parent"
+ android:background="@android:color/white"
+ android:layout_marginTop="16dp"
+ android:layout_marginBottom="16dp" />
+
+ <ImageView
+ android:id="@+id/undo_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:paddingLeft="12dip"
+ android:paddingRight="8dip"
+ android:src="@drawable/ic_menu_revert_holo_dark"
+ android:background="?android:attr/selectableItemBackground"
+ android:duplicateParentState="true" />
+
+ <TextView
+ android:id="@+id/undo_text"
+ style="@style/UndoTextStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:paddingRight="16dip"
+ android:text="@string/undo"
+ android:textAllCaps="true"
+ android:gravity="center_vertical"
+ android:textColor="@android:color/white"
+ android:background="?android:attr/selectableItemBackground"
+ android:duplicateParentState="true"/>
+</LinearLayout>