Update AccountListItem.java

This commit is contained in:
Tungstend 2022-11-27 12:47:13 +08:00
parent 41e0bcfd7e
commit f8e095044a
1 changed files with 8 additions and 22 deletions

View File

@ -68,8 +68,7 @@ public class AccountListItem {
private final StringProperty title = new SimpleStringProperty(); private final StringProperty title = new SimpleStringProperty();
private final StringProperty subtitle = new SimpleStringProperty(); private final StringProperty subtitle = new SimpleStringProperty();
private final ObjectProperty<Drawable> image = new SimpleObjectProperty<>(); private final ObjectProperty<Drawable> image = new SimpleObjectProperty<>();
private final ObjectProperty<Bitmap> skin = new SimpleObjectProperty<>(); private final ObjectProperty<Bitmap[]> texture = new SimpleObjectProperty<>();
private final ObjectProperty<Bitmap> cape = new SimpleObjectProperty<>();
public AccountListItem(Context context, Account account) { public AccountListItem(Context context, Account account) {
this.context = context; this.context = context;
@ -95,8 +94,7 @@ public class AccountListItem {
} }
image.bind(TexturesLoader.avatarBinding(account, ConvertUtils.dip2px(context, 30f))); image.bind(TexturesLoader.avatarBinding(account, ConvertUtils.dip2px(context, 30f)));
skin.bind(TexturesLoader.skinBitmapBinding(account)); texture.bind(TexturesLoader.textureBinding(account));
cape.bind(TexturesLoader.capeBinding(account));
} }
public Task<?> refreshAsync() { public Task<?> refreshAsync() {
@ -281,27 +279,15 @@ public class AccountListItem {
return image; return image;
} }
public Bitmap getSkin() { public Bitmap[] getTexture() {
return skin.get(); return texture.get();
} }
public void setSkin(Bitmap skin) { public void setTexture(Bitmap[] texture) {
this.skin.set(skin); this.texture.set(texture);
} }
public ObjectProperty<Bitmap> skinProperty() { public ObjectProperty<Bitmap[]> textureProperty() {
return skin; return texture;
}
public Bitmap getCape() {
return cape.get();
}
public void setCape(Bitmap cape) {
this.cape.set(cape);
}
public ObjectProperty<Bitmap> capeProperty() {
return cape;
} }
} }