mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
Improve armoire display
This commit is contained in:
parent
e8c3d289ee
commit
765204821a
5 changed files with 12 additions and 7 deletions
|
|
@ -32,7 +32,7 @@
|
|||
android:value="true" />
|
||||
<meta-data
|
||||
android:name="com.google.android.gms.ads.APPLICATION_ID"
|
||||
android:value="ca-app-pub-3940256099942544~3347511713"/>
|
||||
android:value="@string/application_ad_id"/>
|
||||
<activity
|
||||
android:name=".ui.activities.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
|
|
|
|||
|
|
@ -160,6 +160,9 @@
|
|||
<argument
|
||||
android:name="key"
|
||||
app:argType="string" />
|
||||
<argument
|
||||
android:name="value"
|
||||
app:argType="string" />
|
||||
</activity>
|
||||
<activity
|
||||
android:id="@+id/subscriptionPurchaseActivity"
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@
|
|||
<string name="quest_items_found">You\'ve found %d quest items</string>
|
||||
<string name="armoireEquipment_new">You find a piece of rare Equipment in the Armoire!</string>
|
||||
<string name="armoireFood_new">You rummage in the Armoire and find food. What\'s that doing in here?</string>
|
||||
<string name="armoireExp">You wrestle with the Armoire and gain Experience. Take that!</string>
|
||||
<string name="armoireExp_new">You wrestle with the Armoire and gain %s Experience. Take that!</string>
|
||||
<string name="sell">Sell (%d Gold)</string>
|
||||
<string name="hatch_with_potion">Hatch with potion</string>
|
||||
<string name="hatch_egg">Hatch with egg</string>
|
||||
|
|
|
|||
|
|
@ -78,7 +78,8 @@ class ArmoireActivity: BaseActivity() {
|
|||
.subscribe({
|
||||
configure(it.armoire["type"] ?: "",
|
||||
it.armoire["dropKey"] ?: "",
|
||||
it.armoire["dropText"] ?: "")
|
||||
it.armoire["dropText"] ?: "",
|
||||
it.armoire["value"] ?: "")
|
||||
binding.adButton.updateForAdType(AdType.ARMOIRE, lifecycleScope)
|
||||
hasAnimatedChanges = false
|
||||
gold = null
|
||||
|
|
@ -113,7 +114,7 @@ class ArmoireActivity: BaseActivity() {
|
|||
intent.extras?.let {
|
||||
val args = ArmoireActivityArgs.fromBundle(it)
|
||||
equipmentKey = args.key
|
||||
configure(args.type, args.key, args.text)
|
||||
configure(args.type, args.key, args.text, args.value)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -157,7 +158,7 @@ class ArmoireActivity: BaseActivity() {
|
|||
.emitWithGravity(binding.confettiAnchor, Gravity.TOP, 15, 2000)
|
||||
}
|
||||
|
||||
fun configure(type: String, key: String, text: String) {
|
||||
fun configure(type: String, key: String, text: String, value: String? = "") {
|
||||
binding.titleView.text = text
|
||||
binding.equipButton.visibility = if (type == "gear") View.VISIBLE else View.GONE
|
||||
when (type) {
|
||||
|
|
@ -170,7 +171,7 @@ class ArmoireActivity: BaseActivity() {
|
|||
binding.iconView.loadImage("Pet_Food_$key")
|
||||
}
|
||||
else -> {
|
||||
binding.subtitleView.text = getString(R.string.armoireExp)
|
||||
binding.subtitleView.text = getString(R.string.armoireExp, value)
|
||||
binding.iconView.setImageResource(R.drawable.armoire_experience)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -374,7 +374,8 @@ class PurchaseDialog(context: Context, component: UserComponent?, val item: Shop
|
|||
if (shopItem.key == "armoire" && configManager.enableNewArmoire()) {
|
||||
MainNavigationController.navigate(R.id.armoireActivity, ArmoireActivityDirections.openArmoireActivity(buyResponse.armoire["type"] ?: "",
|
||||
buyResponse.armoire["dropText"] ?: "",
|
||||
buyResponse.armoire["dropKey"] ?: "").arguments)
|
||||
buyResponse.armoire["dropKey"] ?: "",
|
||||
buyResponse.armoire["value"] ?: "").arguments)
|
||||
}
|
||||
buyResponse
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue