From d625d28ec6cf22c128d0ef0b8e64a9fff4b64aec Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 21 Oct 2015 01:27:04 -0700 Subject: 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 --- res/drawable/blocked_number_item_background.xml | 29 ++++ res/layout/blocked_number_fragment.xml | 68 ++-------- res/layout/blocked_number_header.xml | 147 ++++++++++++++------- res/layout/blocked_number_item.xml | 2 +- res/layout/view_numbers_to_import_fragment.xml | 1 + .../filterednumber/BlockedNumberAdapter.java | 8 +- .../filterednumber/BlockedNumbersFragment.java | 4 + 7 files changed, 150 insertions(+), 109 deletions(-) create mode 100644 res/drawable/blocked_number_item_background.xml diff --git a/res/drawable/blocked_number_item_background.xml b/res/drawable/blocked_number_item_background.xml new file mode 100644 index 000000000..acfea20b8 --- /dev/null +++ b/res/drawable/blocked_number_item_background.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + 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. --> - + android:divider="@null" + android:headerDividersEnabled="false" /> - - - - - - - - - - - - - - - - - - - - - - - + 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" /> diff --git a/res/layout/blocked_number_header.xml b/res/layout/blocked_number_header.xml index e16efbcf4..3fcdf398b 100644 --- a/res/layout/blocked_number_header.xml +++ b/res/layout/blocked_number_header.xml @@ -13,63 +13,114 @@ See the License for the specific language governing permissions and limitations under the License. --> - + - + android:layout_marginBottom="8dp" + card_view:cardCornerRadius="0dp"> + + + + - + + + + + + + card_view:cardCornerRadius="0dp"> - - -