summaryrefslogtreecommitdiff
path: root/res/layout/blocked_number_fragment.xml
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2015-10-21 01:27:04 -0700
committerAndrew Lee <anwlee@google.com>2015-10-21 01:27:04 -0700
commitd625d28ec6cf22c128d0ef0b8e64a9fff4b64aec (patch)
tree107564f429b2d5211cca417d1dba9f5ee5f077c2 /res/layout/blocked_number_fragment.xml
parent9af1b36e999036f4045b07285962cfdb7bfbcca7 (diff)
Fix scrolling in blocked numbers list.
+ Add elements as header, so they scroll with the list. + Shuffle around some layouts to make this work correctly. + Replace default ListView divider with custom drawable, to achieve the desired effect of removing the divider on the first list item. + Override BlockedNumberAdapter to never report itself as empty. Otherwise, the header will disappear. + Tweak some padding. Bug: 25134186 Change-Id: I07711437fea2d3042d3987983667ab5316d51fcc
Diffstat (limited to 'res/layout/blocked_number_fragment.xml')
-rw-r--r--res/layout/blocked_number_fragment.xml68
1 files changed, 9 insertions, 59 deletions
diff --git a/res/layout/blocked_number_fragment.xml b/res/layout/blocked_number_fragment.xml
index e41d6bc80..b98b58fc5 100644
--- a/res/layout/blocked_number_fragment.xml
+++ b/res/layout/blocked_number_fragment.xml
@@ -14,7 +14,6 @@
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/blocked_number_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -22,67 +21,18 @@
android:paddingTop="?android:attr/actionBarSize"
android:background="@color/blocked_number_background">
- <android.support.v7.widget.CardView
- android:id="@+id/hide_blocked_calls_setting"
+ <ListView android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="8dp"
- card_view:cardCornerRadius="0dp">
+ android:divider="@null"
+ android:headerDividersEnabled="false" />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:gravity="center_vertical"
- android:padding="16dp"
- android:paddingEnd="8dp">
-
- <TextView
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="@string/blocked_call_settings_hide_setting"
- style="@style/BlockedNumbersDescriptionTextStyle" />
-
- <Switch android:id="@+id/hide_blocked_calls_switch"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="40dp" />
-
- </LinearLayout>
-
- </android.support.v7.widget.CardView>
-
- <android.support.v7.widget.CardView
+ <TextView android:id="@android:id/empty"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- card_view:cardCornerRadius="0dp">
-
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/background_dialer_white">
-
- <include layout="@layout/blocked_number_header" />
-
- <ListView android:id="@id/android:list"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"
- android:drawSelectorOnTop="false"
- android:headerDividersEnabled="false" />
-
- <TextView android:id="@android:id/empty"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingStart="@dimen/blocked_number_horizontal_margin"
- android:paddingTop="@dimen/blocked_number_top_margin"
- android:paddingBottom="@dimen/blocked_number_bottom_margin"
- android:text="@string/listNoBlockedNumbers" />
-
- </LinearLayout>
-
- </android.support.v7.widget.CardView>
+ android:layout_height="match_parent"
+ android:paddingStart="@dimen/blocked_number_horizontal_margin"
+ android:paddingTop="@dimen/blocked_number_top_margin"
+ android:paddingBottom="@dimen/blocked_number_bottom_margin"
+ android:text="@string/listNoBlockedNumbers" />
</LinearLayout>