mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-04-14 19:56:32 +00:00
Don’t show points to allocate below level 10. Fixes #1025
This commit is contained in:
parent
e6876acea0
commit
d1b579efb3
5 changed files with 12 additions and 1 deletions
|
|
@ -40,6 +40,14 @@
|
|||
android:layout_height="24dp"
|
||||
android:scaleType="fitCenter"/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/unlock_at_level"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/unlock_attribute_points"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/spacing_large"
|
||||
style="@style/Caption4"/>
|
||||
<com.habitrpg.android.habitica.ui.views.stats.StatsView
|
||||
android:id="@+id/strengthStatsView"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -788,4 +788,5 @@
|
|||
<string name="joined">Joined</string>
|
||||
<string name="public_challenge">Public Challenge</string>
|
||||
<string name="short_name">Short Name</string>
|
||||
<string name="unlock_attribute_points">Attribute point allocation unlocks at level 10</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ class ApiClientImpl//private OnHabitsAPIResult mResultListener;
|
|||
val request = builder.method(original.method(), original.body())
|
||||
.build()
|
||||
lastAPICallURL = original.url().toString()
|
||||
Log.d("NETWORK", lastAPICallURL)
|
||||
chain.proceed(request)
|
||||
}
|
||||
.readTimeout(120, TimeUnit.SECONDS)
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ open class MainActivity : BaseActivity(), TutorialView.OnTutorialReaction {
|
|||
}
|
||||
val statsItem = drawerFragment?.getItemWithIdentifier(NavigationDrawerFragment.SIDEBAR_STATS)
|
||||
if (statsItem != null) {
|
||||
if (user?.stats?.lvl ?: 0 >= 0 && user?.stats?.points ?: 0 > 0) {
|
||||
if (user?.stats?.lvl ?: 0 >= 10 && user?.stats?.points ?: 0 > 0) {
|
||||
statsItem.additionalInfo = user?.stats?.points.toString()
|
||||
} else {
|
||||
statsItem.additionalInfo = null
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ class StatsFragment: BaseMainFragment() {
|
|||
|
||||
compositeSubscription.add(userRepository.getUser(userId).subscribe(Consumer {
|
||||
user = it
|
||||
unlock_at_level.visibility = if (user?.stats?.lvl ?: 0 < 10) View.VISIBLE else View.GONE
|
||||
updateStats()
|
||||
updateAttributePoints()
|
||||
}, RxErrorHandler.handleEmptyError()))
|
||||
|
|
|
|||
Loading…
Reference in a new issue