unequip gear

This commit is contained in:
Saran Lertpradit 2016-03-24 23:40:52 +07:00
parent 3a8b08fcd6
commit ff5c8f0179
2 changed files with 7 additions and 1 deletions

View file

@ -27,6 +27,7 @@ private List<ItemData> gearList;
public String equippedGear;
public Boolean isCostume;
public String userSize;
public String type;
public void setGearList(List<ItemData> gearList) {
this.gearList = gearList;
@ -111,7 +112,11 @@ class GearViewHolder extends RecyclerView.ViewHolder implements View.OnClickList
command.gear = this.gear;
command.asCostume = isCostume;
EventBus.getDefault().post(command);
equippedGear = this.gear.key;
if (this.gear.key.equals(equippedGear)) {
equippedGear = type + "_base_0";
} else {
equippedGear = this.gear.key;
}
notifyDataSetChanged();
}
}

View file

@ -44,6 +44,7 @@ public class EquipmentDetailFragment extends BaseMainFragment {
this.adapter.equippedGear = this.equippedGear;
this.adapter.isCostume = this.isCostume;
this.adapter.userSize = this.user.getPreferences().getSize();
this.adapter.type = this.type;
this.recyclerView.setLayoutManager(new LinearLayoutManager(activity));
this.recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));