From 3524a67a7f14be61e92913ec749b3be36c351122 Mon Sep 17 00:00:00 2001 From: Conny Duck Date: Sat, 3 Feb 2018 13:24:12 +0100 Subject: [PATCH] simplify list_item layout --- .../com/keylesspalace/tusky/ListsActivity.kt | 9 +++---- app/src/main/res/layout/item_list.xml | 24 +++++++------------ 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/ListsActivity.kt b/app/src/main/java/com/keylesspalace/tusky/ListsActivity.kt index da4aefba..f14d717f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ListsActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/ListsActivity.kt @@ -169,13 +169,10 @@ class ListsActivity : BaseActivity(), ListsView { .let(this::ListViewHolder) .apply { val context = nameTextView.context - val icon = IconicsDrawable(context, GoogleMaterial.Icon.gmd_list) - val size = Utils.dpToPx(context, 20) + val icon = IconicsDrawable(context, GoogleMaterial.Icon.gmd_list).sizeDp(20) + ThemeUtils.setDrawableTint(context, icon, android.R.attr.textColorTertiary) - icon.setBounds(0, 0, size, size) - nameTextView.compoundDrawablePadding = Utils.dpToPx(context, 8) - TextViewCompat.setCompoundDrawablesRelative( - nameTextView, icon, null, null, null) + TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(nameTextView, icon, null, null, null) } } diff --git a/app/src/main/res/layout/item_list.xml b/app/src/main/res/layout/item_list.xml index b1ea23ba..1fdd8159 100644 --- a/app/src/main/res/layout/item_list.xml +++ b/app/src/main/res/layout/item_list.xml @@ -1,21 +1,13 @@ - - - - \ No newline at end of file + android:drawablePadding="8dp" + android:gravity="center_vertical" + android:textSize="?attr/status_text_medium" + tools:text="Example list" />