mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 19:42:45 +00:00
Fix removal of apps in app list updates
This commit is contained in:
parent
59df38ae8a
commit
bf795ab7a5
@ -366,6 +366,7 @@ public class AppView extends Activity implements AdapterFragmentCallbacks {
|
|||||||
public void run() {
|
public void run() {
|
||||||
boolean updated = false;
|
boolean updated = false;
|
||||||
|
|
||||||
|
// First handle app updates and additions
|
||||||
for (NvApp app : appList) {
|
for (NvApp app : appList) {
|
||||||
boolean foundExistingApp = false;
|
boolean foundExistingApp = false;
|
||||||
|
|
||||||
@ -395,6 +396,26 @@ public class AppView extends Activity implements AdapterFragmentCallbacks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Next handle app removals
|
||||||
|
for (int i = 0; i < appGridAdapter.getCount(); i++) {
|
||||||
|
boolean foundExistingApp = false;
|
||||||
|
AppObject existingApp = (AppObject) appGridAdapter.getItem(i);
|
||||||
|
|
||||||
|
// Check if this app is in the latest list
|
||||||
|
for (NvApp app : appList) {
|
||||||
|
if (existingApp.app.getAppId() == app.getAppId()) {
|
||||||
|
foundExistingApp = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This app was removed in the latest app list
|
||||||
|
if (!foundExistingApp) {
|
||||||
|
appGridAdapter.removeApp(existingApp);
|
||||||
|
updated = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (updated) {
|
if (updated) {
|
||||||
appGridAdapter.notifyDataSetChanged();
|
appGridAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,10 @@ public class AppGridAdapter extends GenericGridAdapter<AppView.AppObject> {
|
|||||||
sortList();
|
sortList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeApp(AppView.AppObject app) {
|
||||||
|
itemList.remove(app);
|
||||||
|
}
|
||||||
|
|
||||||
public void abortPendingRequests() {
|
public void abortPendingRequests() {
|
||||||
HashMap<ImageView, Future> tempMap;
|
HashMap<ImageView, Future> tempMap;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user