mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 11:03:01 +00:00
Display the running app first on the app grid
This commit is contained in:
parent
55b9645651
commit
36f8cc02cb
@ -66,6 +66,14 @@ public class AppGridAdapter extends GenericGridAdapter<AppView.AppObject> {
|
||||
Collections.sort(itemList, new Comparator<AppView.AppObject>() {
|
||||
@Override
|
||||
public int compare(AppView.AppObject lhs, AppView.AppObject rhs) {
|
||||
// Bubble the running app up to the top of the list
|
||||
if (lhs.app.getIsRunning() && !rhs.app.getIsRunning()) {
|
||||
return -1;
|
||||
}
|
||||
else if (!lhs.app.getIsRunning() && rhs.app.getIsRunning()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return lhs.app.getAppName().compareTo(rhs.app.getAppName());
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user