mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-14 18:21:57 +00:00
better display for classless users.
This commit is contained in:
parent
2ce1269e6a
commit
7e44e5f85e
2 changed files with 30 additions and 24 deletions
|
|
@ -312,5 +312,6 @@ To start, which parts of your life do you want to improve?</string>
|
|||
<string name="world_quest">World Quest</string>
|
||||
<string name="inn_description">Rest in the Inn to prevent your undone Dailies from hurting you overnight! (Note: does not prevent you from receiving Boss damage.)</string>
|
||||
<string name="empty_items" formatted="false">You don\'t have any %s</string>
|
||||
<string name="user_level">LVL</string>
|
||||
<string name="user_level" formatted="false">LVL %s</string>
|
||||
<string name="user_level_with_class" formatted="false">LVL %1$s - %2$s</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -96,34 +96,39 @@ public class AvatarWithBarsViewModel implements View.OnClickListener {
|
|||
|
||||
mpBar.valueBarLayout.setVisibility((stats.get_class() == null || stats.getLvl() < 10 || user.getPreferences().getDisableClasses()) ? View.GONE : View.VISIBLE);
|
||||
|
||||
lvlText.setText("Lvl " + user.getStats().getLvl() + " - " + userClass);
|
||||
Drawable drawable;
|
||||
switch (stats.get_class()) {
|
||||
case warrior:
|
||||
drawable = ResourcesCompat.getDrawable(res, R.drawable.ic_header_warrior, null);
|
||||
if (user.getPreferences().getDisableClasses()) {
|
||||
lvlText.setText(context.getString(R.string.user_level, user.getStats().getLvl()));
|
||||
lvlText.setCompoundDrawables(null, null, null, null);
|
||||
} else {
|
||||
lvlText.setText(context.getString(R.string.user_level_with_class, user.getStats().getLvl(), userClass));
|
||||
Drawable drawable;
|
||||
switch (stats.get_class()) {
|
||||
case warrior:
|
||||
drawable = ResourcesCompat.getDrawable(res, R.drawable.ic_header_warrior, null);
|
||||
|
||||
break;
|
||||
case rogue:
|
||||
drawable = ResourcesCompat.getDrawable(res, R.drawable.ic_header_rogue, null);
|
||||
break;
|
||||
case wizard:
|
||||
drawable = ResourcesCompat.getDrawable(res, R.drawable.ic_header_mage, null);
|
||||
break;
|
||||
case rogue:
|
||||
drawable = ResourcesCompat.getDrawable(res, R.drawable.ic_header_rogue, null);
|
||||
break;
|
||||
case wizard:
|
||||
drawable = ResourcesCompat.getDrawable(res, R.drawable.ic_header_mage, null);
|
||||
|
||||
break;
|
||||
case healer:
|
||||
drawable = ResourcesCompat.getDrawable(res, R.drawable.ic_header_healer, null);
|
||||
break;
|
||||
case healer:
|
||||
drawable = ResourcesCompat.getDrawable(res, R.drawable.ic_header_healer, null);
|
||||
|
||||
break;
|
||||
case base:
|
||||
default:
|
||||
drawable = ResourcesCompat.getDrawable(res, R.drawable.ic_header_warrior, null);
|
||||
break;
|
||||
case base:
|
||||
default:
|
||||
drawable = ResourcesCompat.getDrawable(res, R.drawable.ic_header_warrior, null);
|
||||
|
||||
}
|
||||
if (drawable != null) {
|
||||
drawable.setBounds(0, 0, drawable.getMinimumWidth(),
|
||||
drawable.getMinimumHeight());
|
||||
}
|
||||
lvlText.setCompoundDrawables(drawable, null, null, null);
|
||||
}
|
||||
if (drawable != null) {
|
||||
drawable.setBounds(0, 0, drawable.getMinimumWidth(),
|
||||
drawable.getMinimumHeight());
|
||||
}
|
||||
lvlText.setCompoundDrawables(drawable, null, null, null);
|
||||
|
||||
goldText.setText(String.valueOf(gp));
|
||||
silverText.setText(String.valueOf(sp));
|
||||
|
|
|
|||
Loading…
Reference in a new issue