Only show expansion when necessary

This commit is contained in:
topjohnwu 2019-03-13 08:15:02 -04:00
parent 15ddd0e284
commit ecf3d30349

View File

@ -124,9 +124,14 @@ public class ApplicationAdapter extends SectionedAdapter
Shell.su(cmd).submit(); Shell.su(cmd).submit();
p.hidden = status; p.hidden = status;
} }
if (app.expanded)
notifyItemRangeChanged(index, app.processList.size()); notifyItemRangeChanged(index, app.processList.size());
} }
}); });
if (app.processList.size() > 1) {
holder.arrow.setVisibility(View.VISIBLE);
holder.trigger.setOnClickListener((v) -> { holder.trigger.setOnClickListener((v) -> {
if (app.expanded) { if (app.expanded) {
app.expanded = false; app.expanded = false;
@ -138,6 +143,11 @@ public class ApplicationAdapter extends SectionedAdapter
holder.ex.expand(); holder.ex.expand();
} }
}); });
} else {
holder.arrow.setVisibility(View.GONE);
holder.trigger.setOnClickListener(null);
}
} }
@Override @Override