nicer customization display

This commit is contained in:
Phillip Thelen 2022-07-28 13:31:07 +02:00
parent 57b780bece
commit 72d4c8742c
4 changed files with 11 additions and 7 deletions

View file

@ -13,10 +13,9 @@
android:layout_height="76dp">
<com.habitrpg.common.habitica.views.PixelArtView
android:id="@+id/imageView"
android:layout_width="60dp"
android:layout_width="68dp"
android:layout_height="68dp"
android:layout_gravity="start"
android:scaleType="fitCenter" />
android:layout_gravity="center" />
</FrameLayout>
<FrameLayout
android:id="@+id/buy_button"

View file

@ -2,7 +2,7 @@
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_height="wrap_content"
style="@style/Pill.Content"
android:textSize="12sp"
android:gravity="center"

View file

@ -50,7 +50,7 @@ open class Customization : RealmObject(), BaseObject {
return if (type == "background") {
"icon_background_$identifier"
} else {
getImageName(userSize, hairColor)
"icon_" + getImageName(userSize, hairColor)
}
}

View file

@ -167,8 +167,13 @@ open class ShopItem : RealmObject(), BaseObject {
item.path = customization.path
item.unlockPath = customization.unlockPath
item.pinType = customization.type
item.purchaseType = if (customization.type == "background") "background" else "customization"
item.imageName = customization.getImageName(userSize, hairColor)
if (customization.type == "background") {
item.purchaseType = "background"
item.imageName = customization.getImageName(userSize, hairColor)
} else {
item.purchaseType = "customization"
item.imageName = customization.getIconName(userSize, hairColor)
}
return item
}