Gadgetbridge/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/appmanager/AppManagerFragmentInstalled...

34 lines
1.0 KiB
Java

package nodomain.freeyourgadget.gadgetbridge.activities.appmanager;
import java.util.ArrayList;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceApp;
public class AppManagerFragmentInstalledApps extends AbstractAppManagerFragment {
@Override
protected void refreshList() {
appList.clear();
ArrayList uuids = AppManagerActivity.getUuidsFromFile(getSortFilename());
if (uuids.isEmpty()) {
appList.addAll(getSystemApps());
for (GBDeviceApp gbDeviceApp : appList) {
uuids.add(gbDeviceApp.getUUID());
}
AppManagerActivity.rewriteAppOrderFile(getSortFilename(), uuids);
} else {
appList.addAll(getCachedApps(uuids));
}
}
@Override
protected String getSortFilename() {
return mGBDevice.getAddress() + ".watchapps";
}
@Override
protected void onChangedAppOrder() {
super.onChangedAppOrder();
sendOrderToDevice(mGBDevice.getAddress() + ".watchfaces");
}
}