Skip to content

Commit

Permalink
AppAdapter: improved switch & sort
Browse files Browse the repository at this point in the history
Signed-off-by: DHD2280 <[email protected]>
  • Loading branch information
DHD2280 committed Nov 14, 2024
1 parent ff1d6e0 commit 49362b2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public void onBindViewHolder(@NonNull AppAdapter.ViewHolder holder, int position
if (position == 0) {
holder.binding.appSwitch.forcePosition(filteredApps.size() == 1 ? "full" : "top");
} else if (position == filteredApps.size() - 1) {
holder.binding.appSwitch.forcePosition("middle");
holder.binding.appSwitch.forcePosition(hasSlider && model.isEnabled() ?
"middle" : "bottom");
holder.binding.appSlider.forcePosition("bottom");
} else {
holder.binding.appSwitch.forcePosition("middle");
Expand Down Expand Up @@ -117,7 +118,7 @@ public void showSystem(boolean show) {
private void checkChange() {
filteredApps.sort((app1, app2) -> {
if (app1.isEnabled() == app2.isEnabled()) {
return app1.getAppName().compareTo(app2.getAppName());
return app1.getAppName().toLowerCase().compareTo(app2.getAppName().toLowerCase());
}
return app1.isEnabled() ? -1 : 1;
});
Expand Down

0 comments on commit 49362b2

Please sign in to comment.