2016-06-14 20:04:54 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.activities.appmanager;
|
|
|
|
|
2016-06-17 22:43:06 +02:00
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceApp;
|
|
|
|
|
2016-06-14 20:04:54 +02:00
|
|
|
public class AppManagerFragmentInstalledApps extends AbstractAppManagerFragment {
|
|
|
|
@Override
|
2016-06-17 22:43:06 +02:00
|
|
|
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));
|
|
|
|
}
|
2016-06-14 20:04:54 +02:00
|
|
|
}
|
2016-06-15 19:56:34 +02:00
|
|
|
|
2016-06-17 22:43:06 +02:00
|
|
|
@Override
|
|
|
|
protected String getSortFilename() {
|
2016-06-15 19:56:34 +02:00
|
|
|
return mGBDevice.getAddress() + ".watchapps";
|
|
|
|
}
|
2016-06-17 22:43:06 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onChangedAppOrder() {
|
|
|
|
super.onChangedAppOrder();
|
|
|
|
sendOrderToDevice(mGBDevice.getAddress() + ".watchfaces");
|
|
|
|
}
|
2016-06-14 20:04:54 +02:00
|
|
|
}
|