From 6d47f220b9ce7b4e3fa7130908af23cbc69383a3 Mon Sep 17 00:00:00 2001 From: Jakob Nixdorf Date: Mon, 27 Nov 2017 14:26:40 +0100 Subject: [PATCH] Use sp for the label font size Make it scalable (e.g. with the font size defined in the Accessibility settings) --- .../org/shadowice/flocke/andotp/View/EntryViewHolder.java | 5 ++--- app/src/main/res/layout/component_card.xml | 4 ++-- app/src/main/res/values/settings.xml | 8 ++++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/shadowice/flocke/andotp/View/EntryViewHolder.java b/app/src/main/java/org/shadowice/flocke/andotp/View/EntryViewHolder.java index 9f9f4370..ca782fb2 100644 --- a/app/src/main/java/org/shadowice/flocke/andotp/View/EntryViewHolder.java +++ b/app/src/main/java/org/shadowice/flocke/andotp/View/EntryViewHolder.java @@ -27,7 +27,6 @@ import android.graphics.ColorFilter; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; -import android.util.TypedValue; import android.view.View; import android.widget.ImageButton; import android.widget.ImageView; @@ -133,8 +132,8 @@ public class EntryViewHolder extends RecyclerView.ViewHolder } public void setLabelSize(int size) { - label.setTextSize(TypedValue.COMPLEX_UNIT_PT, size); - tags.setTextSize(TypedValue.COMPLEX_UNIT_PT, size - 2); + label.setTextSize(size); + tags.setTextSize(0.75f * size); } public void setLabelScroll(boolean active) { diff --git a/app/src/main/res/layout/component_card.xml b/app/src/main/res/layout/component_card.xml index 5ef14874..290a3498 100644 --- a/app/src/main/res/layout/component_card.xml +++ b/app/src/main/res/layout/component_card.xml @@ -77,7 +77,7 @@ android:layout_height="wrap_content" android:maxLines="1" android:ellipsize="end" - android:textSize="8pt" /> + android:textSize="18sp" /> + android:textSize="13.5sp" /> diff --git a/app/src/main/res/values/settings.xml b/app/src/main/res/values/settings.xml index da712e4b..d5c66c4d 100644 --- a/app/src/main/res/values/settings.xml +++ b/app/src/main/res/values/settings.xml @@ -13,7 +13,7 @@ pref_lang pref_theme - pref_label_size + pref_label_size_sp pref_label_scroll pref_backup_ask @@ -36,7 +36,7 @@ none system light - 8 + 18 @@ -75,6 +75,6 @@ - 4 - 12 + 12 + 24 \ No newline at end of file