diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index e8f327e66..eba2cdf40 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -924,6 +924,7 @@ public class StatusAdapter extends RecyclerView.Adapter } //final float scale = context.getResources().getDisplayMetrics().density; final float scale = sharedpreferences.getFloat(context.getString(R.string.SET_FONT_SCALE), 1.1f); + final float scaleIcon = sharedpreferences.getFloat(context.getString(R.string.SET_FONT_SCALE_ICON), 1.1f); if (statusToDeal.account.locked) { Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_baseline_lock_24); assert img != null; @@ -934,22 +935,22 @@ public class StatusAdapter extends RecyclerView.Adapter } //Button sizes depending of the defined scale float normalSize = Helper.convertDpToPixel(28, context); - holder.binding.actionButtonReply.getLayoutParams().width = (int) (normalSize * scale); - holder.binding.actionButtonReply.getLayoutParams().height = (int) (normalSize * scale); + holder.binding.actionButtonReply.getLayoutParams().width = (int) (normalSize * scaleIcon); + holder.binding.actionButtonReply.getLayoutParams().height = (int) (normalSize * scaleIcon); holder.binding.actionButtonReply.requestLayout(); - holder.binding.actionButtonBoost.setImageSize((int) (normalSize * scale)); - holder.binding.actionButtonFavorite.setImageSize((int) (normalSize * scale)); - holder.binding.actionButtonBookmark.setImageSize((int) (normalSize * scale)); - holder.binding.statusAddCustomEmoji.getLayoutParams().width = (int) (normalSize * scale); - holder.binding.statusAddCustomEmoji.getLayoutParams().height = (int) (normalSize * scale); + holder.binding.actionButtonBoost.setImageSize((int) (normalSize * scaleIcon)); + holder.binding.actionButtonFavorite.setImageSize((int) (normalSize * scaleIcon)); + holder.binding.actionButtonBookmark.setImageSize((int) (normalSize * scaleIcon)); + holder.binding.statusAddCustomEmoji.getLayoutParams().width = (int) (normalSize * scaleIcon); + holder.binding.statusAddCustomEmoji.getLayoutParams().height = (int) (normalSize * scaleIcon); holder.binding.statusAddCustomEmoji.requestLayout(); - holder.binding.statusEmoji.getLayoutParams().width = (int) (normalSize * scale); - holder.binding.statusEmoji.getLayoutParams().height = (int) (normalSize * scale); - holder.binding.actionButtonMore.getLayoutParams().width = (int) (normalSize * scale); - holder.binding.actionButtonMore.getLayoutParams().height = (int) (normalSize * scale); + holder.binding.statusEmoji.getLayoutParams().width = (int) (normalSize * scaleIcon); + holder.binding.statusEmoji.getLayoutParams().height = (int) (normalSize * scaleIcon); + holder.binding.actionButtonMore.getLayoutParams().width = (int) (normalSize * scaleIcon); + holder.binding.actionButtonMore.getLayoutParams().height = (int) (normalSize * scaleIcon); holder.binding.actionButtonMore.requestLayout(); - holder.binding.actionShare.getLayoutParams().width = (int) (normalSize * scale); - holder.binding.actionShare.getLayoutParams().height = (int) (normalSize * scale); + holder.binding.actionShare.getLayoutParams().width = (int) (normalSize * scaleIcon); + holder.binding.actionShare.getLayoutParams().height = (int) (normalSize * scaleIcon); holder.binding.actionShare.requestLayout(); if (statusToDeal.account.bot) { diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentInterfaceSettings.java b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentInterfaceSettings.java index 8eda3aa3e..1fc5545f9 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentInterfaceSettings.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentInterfaceSettings.java @@ -49,6 +49,11 @@ public class FragmentInterfaceSettings extends PreferenceFragmentCompat implemen SET_FONT_SCALE.setMax(180); SET_FONT_SCALE.setMin(80); } + SeekBarPreference SET_FONT_SCALE_ICON = findPreference(getString(R.string.SET_FONT_SCALE_ICON_INT)); + if (SET_FONT_SCALE_ICON != null) { + SET_FONT_SCALE_ICON.setMax(180); + SET_FONT_SCALE_ICON.setMin(80); + } recreate = false; } @@ -63,6 +68,12 @@ public class FragmentInterfaceSettings extends PreferenceFragmentCompat implemen editor.putFloat(getString(R.string.SET_FONT_SCALE), scale); recreate = true; } + if (key.compareToIgnoreCase(getString(R.string.SET_FONT_SCALE_ICON_INT)) == 0) { + int progress = sharedPreferences.getInt(getString(R.string.SET_FONT_SCALE_ICON_INT), 110); + float scale = (float) (progress) / 100.0f; + editor.putFloat(getString(R.string.SET_FONT_SCALE_ICON), scale); + recreate = true; + } if (key.compareToIgnoreCase(getString(R.string.SET_USE_SINGLE_TOPBAR)) == 0) { recreate = true; } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b74c404ed..9c872089d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -31,7 +31,8 @@ Camera Delete all Schedule - Text and icon sizes + Text sizes + Icon sizes Next Previous Open with @@ -915,6 +916,9 @@ SET_NOTIF_STATUS SET_FONT_SCALE SET_FONT_SCALE_INT + SET_FONT_SCALE_ICON + SET_FONT_SCALE_ICON_INT + SET_FILTER_REGEX_HOME SET_FILTER_REGEX_LOCAL SET_FILTER_REGEX_PUBLIC diff --git a/app/src/main/res/xml/pref_compose.xml b/app/src/main/res/xml/pref_compose.xml index 19fcdf4dd..f1bbccb7d 100644 --- a/app/src/main/res/xml/pref_compose.xml +++ b/app/src/main/res/xml/pref_compose.xml @@ -61,6 +61,7 @@ @@ -68,6 +69,7 @@ @@ -79,6 +81,7 @@ app:useSimpleSummaryProvider="true" /> diff --git a/app/src/main/res/xml/pref_interface.xml b/app/src/main/res/xml/pref_interface.xml index 1691ff1d2..3e988e113 100644 --- a/app/src/main/res/xml/pref_interface.xml +++ b/app/src/main/res/xml/pref_interface.xml @@ -70,14 +70,26 @@ + + +