Skip to content

Commit

Permalink
fix: adjust font size if overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Syn-McJ committed Sep 25, 2023
1 parent 282a1ec commit e1b02a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
5 changes: 2 additions & 3 deletions wallet/res/layout/home_content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,10 @@
<de.schildbach.wallet.ui.widget.ShortcutsPane
android:id="@+id/shortcuts_pane"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_height="92dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingHorizontal="2dp"
app:layout_anchor="@id/buttons_anchor"
app:layout_behavior="de.schildbach.wallet.ui.CollapsingImageBehavior" />

Expand Down
5 changes: 4 additions & 1 deletion wallet/res/layout/shortcut_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
android:lineSpacingMultiplier="0.9"
android:maxLines="2"
android:minLines="1"
tools:ignore="SmallSp"
android:autoSizeTextType="uniform"
android:autoSizeMinTextSize="10sp"
android:autoSizeMaxTextSize="12sp"
android:autoSizeStepGranularity="1sp"
tools:text="Send" />

</merge>
14 changes: 4 additions & 10 deletions wallet/src/de/schildbach/wallet/ui/widget/ShortcutsPane.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,6 @@ class ShortcutsPane(context: Context, attrs: AttributeSet) : FlexboxLayout(conte
this
)
}
val configButton: ShortcutButton by lazy {
ShortcutButton(
context,
R.drawable.ic_shortcut_add,
R.string.shortcut_add_shortcut,
this
)
}

val explore: ShortcutButton by lazy {
ShortcutButton(
context,
Expand Down Expand Up @@ -170,7 +161,10 @@ class ShortcutsPane(context: Context, attrs: AttributeSet) : FlexboxLayout(conte
private fun addShortcut(shortcut: ShortcutButton) {
if (!children.contains(shortcut)) {
val index = min(childCount, shortcuts.indexOf(shortcut))
val layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
val layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
addView(shortcut, index, layoutParams)
}
}
Expand Down

0 comments on commit e1b02a9

Please sign in to comment.