mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-16 03:01:59 +00:00
Add A/B test related to subscriptions
This commit is contained in:
parent
9064382775
commit
9dedc9d3be
5 changed files with 25 additions and 3 deletions
|
|
@ -149,7 +149,7 @@ android {
|
|||
multiDexEnabled true
|
||||
resConfigs "en", "bg", "de", "en-rGB", "es", "fr", "hr-rHR", "in", "it", "iw", "ja", "ko", "lt", "nl", "pl", "pt-rBR", "pt-rPT", "ru", "tr", "zh", "zh-rTW"
|
||||
|
||||
versionCode 2250
|
||||
versionCode 2253
|
||||
versionName "2.1.1"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -251,6 +251,10 @@
|
|||
<argument
|
||||
android:name="group"
|
||||
app:argType="string" />
|
||||
<argument
|
||||
android:name="color"
|
||||
app:argType="string"
|
||||
app:nullable="true" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/mountDetailRecyclerFragment"
|
||||
|
|
@ -262,6 +266,10 @@
|
|||
<argument
|
||||
android:name="group"
|
||||
app:argType="string" />
|
||||
<argument
|
||||
android:name="color"
|
||||
app:argType="string"
|
||||
app:nullable="true" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/challengeDetailFragment"
|
||||
|
|
|
|||
|
|
@ -52,5 +52,9 @@
|
|||
<key>insufficientGemPurchase</key>
|
||||
<value>false</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>showSubscriptionBanner</key>
|
||||
<value>false</value>
|
||||
</entry>
|
||||
</defaultsMap>
|
||||
<!-- END xml_defaults -->
|
||||
|
|
@ -70,4 +70,8 @@ class AppConfigManager {
|
|||
fun insufficientGemPurchase(): Boolean {
|
||||
return remoteConfig.getBoolean("insufficientGemPurchase")
|
||||
}
|
||||
|
||||
fun showSubscriptionBanner(): Boolean {
|
||||
return remoteConfig.getBoolean("showSubscriptionBanner")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.habitrpg.android.habitica.data.SocialRepository
|
|||
import com.habitrpg.android.habitica.data.UserRepository
|
||||
import com.habitrpg.android.habitica.extensions.getThemeColor
|
||||
import com.habitrpg.android.habitica.extensions.subscribeWithErrorHandler
|
||||
import com.habitrpg.android.habitica.helpers.AppConfigManager
|
||||
import com.habitrpg.android.habitica.helpers.RxErrorHandler
|
||||
import com.habitrpg.android.habitica.models.inventory.Quest
|
||||
import com.habitrpg.android.habitica.models.inventory.QuestContent
|
||||
|
|
@ -50,6 +51,8 @@ class NavigationDrawerFragment : DialogFragment() {
|
|||
lateinit var inventoryRepository: InventoryRepository
|
||||
@Inject
|
||||
lateinit var userRepository: UserRepository
|
||||
@Inject
|
||||
lateinit var configManager: AppConfigManager
|
||||
|
||||
private var drawerLayout: androidx.drawerlayout.widget.DrawerLayout? = null
|
||||
private var fragmentContainerView: View? = null
|
||||
|
|
@ -271,9 +274,12 @@ class NavigationDrawerFragment : DialogFragment() {
|
|||
items.add(HabiticaDrawerItem(R.id.newsFragment, SIDEBAR_NEWS, context.getString(R.string.sidebar_news)))
|
||||
items.add(HabiticaDrawerItem(R.id.FAQOverviewFragment, SIDEBAR_HELP, context.getString(R.string.sidebar_help)))
|
||||
items.add(HabiticaDrawerItem(R.id.aboutFragment, SIDEBAR_ABOUT, context.getString(R.string.sidebar_about)))
|
||||
items.add(HabiticaDrawerItem(R.id.subscriptionPurchaseActivity, SIDEBAR_SUBSCRIPTION_PROMO))
|
||||
}
|
||||
items.last().isPromo = true
|
||||
if (configManager.showSubscriptionBanner()) {
|
||||
val item = HabiticaDrawerItem(R.id.subscriptionPurchaseActivity, SIDEBAR_SUBSCRIPTION_PROMO)
|
||||
item.isPromo = true
|
||||
items.add(item)
|
||||
}
|
||||
adapter.updateItems(items)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue