mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-21 21:29:00 +00:00
[#35] - Enable option for UserPicture choose if there is background, pets and mount
This commit is contained in:
parent
c876ac27d8
commit
65466b7dd4
2 changed files with 16 additions and 5 deletions
|
|
@ -90,7 +90,7 @@ public class PartyMemberRecyclerViewAdapter extends RecyclerView.Adapter<PartyMe
|
|||
public void bind(HabitRPGUser user) {
|
||||
android.content.Context ctx = itemView.getContext();
|
||||
|
||||
UserPicture userPicture = new UserPicture(user, ctx);
|
||||
UserPicture userPicture = new UserPicture(user, ctx, false, false, false);
|
||||
userPicture.setPictureOn(imageView);
|
||||
|
||||
AvatarWithBarsViewModel.setHpBarData(hpBar, user.getStats(), ctx);
|
||||
|
|
|
|||
|
|
@ -39,6 +39,17 @@ public class UserPicture {
|
|||
public UserPicture(HabitRPGUser user, Context context) {
|
||||
this.user = user;
|
||||
this.context = context;
|
||||
this.hasBackground = true;
|
||||
this.hasPet = true;
|
||||
this.hasMount = true;
|
||||
}
|
||||
|
||||
public UserPicture(HabitRPGUser user, Context context, boolean hasBackground, boolean hasPet, boolean hasMount) {
|
||||
this.user = user;
|
||||
this.context = context;
|
||||
this.hasBackground = hasBackground;
|
||||
this.hasPet = hasPet;
|
||||
this.hasMount = hasMount;
|
||||
}
|
||||
|
||||
public void removeTask(){
|
||||
|
|
@ -72,26 +83,26 @@ public class UserPicture {
|
|||
|
||||
String mountName = this.user.getItems().getCurrentMount();
|
||||
|
||||
if (mountName != null && !mountName.isEmpty()) {
|
||||
if (mountName != null && !mountName.isEmpty() && hasMount) {
|
||||
layerNames.add(0, "Mount_Body_" + mountName);
|
||||
layerNames.add("Mount_Head_" + mountName);
|
||||
this.hasMount = true;
|
||||
}
|
||||
|
||||
String petName = this.user.getItems().getCurrentPet();
|
||||
|
||||
if (petName != null && !petName.isEmpty()) {
|
||||
if (petName != null && !petName.isEmpty() && hasPet) {
|
||||
layerNames.add("Pet-" + petName);
|
||||
this.hasPet = true;
|
||||
}
|
||||
|
||||
String backgroundName = this.user.getPreferences().getBackground();
|
||||
|
||||
if (backgroundName != null && !backgroundName.isEmpty()) {
|
||||
if (backgroundName != null && !backgroundName.isEmpty() && hasBackground) {
|
||||
layerNames.add(0, "background_" + backgroundName);
|
||||
this.hasBackground = true;
|
||||
}
|
||||
|
||||
|
||||
// get layer hash value
|
||||
String fullLayerString = "";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue