mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-23 06:07:16 +00:00
Truncate stat text with larger values
This commit is contained in:
parent
a2c5b6c3ca
commit
a34d9757b5
3 changed files with 21 additions and 10 deletions
|
|
@ -61,13 +61,13 @@ class StatsActivity : BaseActivity<ActivityStatsBinding, StatsViewModel>() {
|
|||
}
|
||||
|
||||
private fun updateStatViews(stats: Stats) {
|
||||
binding.hpStatValue.setStatValue(stats.maxHealth ?: 0, stats.hp?.toInt() ?: 0, HabiticaIconsHelper.imageOfHeartLightBg(), R.color.hpColor)
|
||||
binding.expStatValue.setStatValue(stats.toNextLevel ?: 0, stats.exp?.toInt() ?: 0, HabiticaIconsHelper.imageOfExperience(), R.color.xpColor)
|
||||
if (stats.lvl ?: 0 < 10) {
|
||||
binding.mpStatValue.visibility = View.GONE
|
||||
} else {
|
||||
binding.mpStatValue.setStatValue(stats.maxMP ?: 0, stats.mp?.toInt() ?: 0, HabiticaIconsHelper.imageOfMagic(), R.color.mpColor)
|
||||
}
|
||||
// binding.hpStatValue.setStatValue(stats.maxHealth ?: 0, stats.hp?.toInt() ?: 0, HabiticaIconsHelper.imageOfHeartLightBg(), R.color.hpColor)
|
||||
// binding.expStatValue.setStatValue(stats.toNextLevel ?: 0, stats.exp?.toInt() ?: 0, HabiticaIconsHelper.imageOfExperience(), R.color.xpColor)
|
||||
// if (stats.lvl ?: 0 < 10) {
|
||||
// binding.mpStatValue.visibility = View.GONE
|
||||
// } else {
|
||||
// binding.mpStatValue.setStatValue(stats.maxMP ?: 0, stats.mp?.toInt() ?: 0, HabiticaIconsHelper.imageOfMagic(), R.color.mpColor)
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_height="40dp">
|
||||
|
||||
<ImageView
|
||||
|
|
@ -17,7 +19,11 @@
|
|||
android:layout_centerInParent="true"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:fontFamily="@font/press_start_reg"
|
||||
android:text="00"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:autoSizeMinTextSize="12sp"
|
||||
android:autoSizeMaxTextSize="18sp"
|
||||
android:autoSizeStepGranularity="2sp"
|
||||
android:text="0000"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
|
|
@ -25,12 +31,15 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:textColor="@color/white"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_toEndOf="@id/current_value"
|
||||
android:fontFamily="@font/press_start_reg"
|
||||
android:text="/000"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:autoSizeMinTextSize="4sp"
|
||||
android:autoSizeMaxTextSize="6sp"
|
||||
android:text="/0000"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="6sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
Loading…
Reference in a new issue