show stat points on correct menu item. Fixes #869

This commit is contained in:
Phillip Thelen 2017-11-14 17:35:16 +01:00
parent 055142e0f3
commit 2c867544aa
4 changed files with 14 additions and 8 deletions

View file

@ -66,10 +66,10 @@ dependencies {
implementation('com.mikepenz:materialdrawer:5.8.3@aar') {
transitive = true
}
implementation 'com.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support:design:27.0.0'
implementation 'com.android.support:recyclerview-v7:27.0.0'
implementation 'com.android.support:preference-v14:27.0.0'
implementation 'com.android.support:appcompat-v7:27.0.1'
implementation 'com.android.support:design:27.0.1'
implementation 'com.android.support:recyclerview-v7:27.0.1'
implementation 'com.android.support:preference-v14:27.0.1'
//QR Code
implementation 'com.github.kenglxn.QRGen:android:2.2.0'
// Emojis

View file

@ -1,9 +1,15 @@
package com.habitrpg.android.habitica.extensions
import android.content.Context
import android.support.annotation.IdRes
import android.view.View
public fun View.setScaledPadding(context: Context?, left: Int, top: Int, right: Int, bottom: Int) {
fun View.setScaledPadding(context: Context?, left: Int, top: Int, right: Int, bottom: Int) {
this.setPadding(left.dpToPx(context), top.dpToPx(context), right.dpToPx(context), bottom.dpToPx(context))
}
fun <T : View> View.bindView(@IdRes res: Int) : Lazy<T> {
@Suppress("UNCHECKED_CAST")
return lazy(LazyThreadSafetyMode.NONE) { findViewById<T>(res) }
}

View file

@ -491,8 +491,8 @@ public class MainActivity extends BaseActivity implements TutorialView.OnTutoria
}
IDrawerItem statsItem = drawer.getDrawerItem(MainDrawerBuilder.INSTANCE.getSIDEBAR_STATS());
PrimaryDrawerItem newStatsItem = new PrimaryDrawerItem()
.withName(this.getString(R.string.sidebar_skills))
.withIdentifier(MainDrawerBuilder.INSTANCE.getSIDEBAR_SKILLS());
.withName(this.getString(R.string.sidebar_stats))
.withIdentifier(MainDrawerBuilder.INSTANCE.getSIDEBAR_STATS());
if (user.getStats() != null && user.getStats().lvl >= 0 && user.getStats().points > 0) {
newStatsItem = newStatsItem.withBadge(this.getString(R.string.available_stats, user.getStats().points));
}

View file

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.51'
ext.kotlin_version = '1.1.60'
ext.build_tools_version = '26.0.2'
ext.sdk_version = 26