mirror of
https://github.com/whyorean/AuroraStore.git
synced 2026-06-18 20:48:35 -04:00
Merge branch 'master' into 'master'
Fix UpdateItems are randomly expanding during scrolling due to view rebinding See merge request AuroraOSS/AuroraStore!23
This commit is contained in:
@@ -46,6 +46,7 @@ public class UpdatesItem extends AbstractItem<UpdatesItem.ViewHolder> {
|
||||
private String packageName;
|
||||
|
||||
private boolean checked;
|
||||
private boolean expanded;
|
||||
|
||||
public UpdatesItem(App app) {
|
||||
this.app = app;
|
||||
@@ -118,15 +119,23 @@ public class UpdatesItem extends AbstractItem<UpdatesItem.ViewHolder> {
|
||||
.into(imgIcon);
|
||||
|
||||
imgExpand.setOnClickListener(v -> {
|
||||
boolean isVisible = layoutChanges.getVisibility() == View.VISIBLE;
|
||||
if (isVisible) {
|
||||
if (item.expanded) {
|
||||
ViewUtil.collapse(layoutChanges);
|
||||
ViewUtil.rotateView(imgExpand, true);
|
||||
item.expanded = false;
|
||||
} else {
|
||||
ViewUtil.rotateView(imgExpand, false);
|
||||
ViewUtil.expand(layoutChanges);
|
||||
item.expanded = true;
|
||||
}
|
||||
});
|
||||
if (item.expanded) {
|
||||
imgExpand.setRotation(180);
|
||||
layoutChanges.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
imgExpand.setRotation(0);
|
||||
layoutChanges.setVisibility(View.GONE);
|
||||
}
|
||||
checkBox.setChecked(item.checked);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user