1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-20 12:00:51 +02:00

App manager: refresh list when returning from watchface editor

This commit is contained in:
Arjan Schrijver 2022-07-25 14:25:27 +02:00
parent 7d5fe20b55
commit 6d92af5794
2 changed files with 10 additions and 1 deletions

View File

@ -74,6 +74,7 @@ public abstract class AbstractAppManagerFragment extends Fragment {
public static final String ACTION_REFRESH_APPLIST
= "nodomain.freeyourgadget.gadgetbridge.appmanager.action.refresh_applist";
private static final Logger LOG = LoggerFactory.getLogger(AbstractAppManagerFragment.class);
private static final int CHILD_ACTIVITY_WATCHFACE_EDITOR = 0;
private ItemTouchHelper appManagementTouchHelper;
@ -374,6 +375,13 @@ public abstract class AbstractAppManagerFragment extends Fragment {
return rootView;
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent resultData) {
if (requestCode == CHILD_ACTIVITY_WATCHFACE_EDITOR) {
refreshList();
}
}
protected void sendOrderToDevice(String concatFilename) {
ArrayList<UUID> uuids = new ArrayList<>();
for (GBDeviceApp gbDeviceApp : mGBDeviceAppAdapter.getAppList()) {
@ -560,7 +568,7 @@ public abstract class AbstractAppManagerFragment extends Fragment {
Intent editWatchfaceIntent = new Intent(getContext(), watchfaceDesignerActivity);
editWatchfaceIntent.putExtra(GBDevice.EXTRA_DEVICE, mGBDevice);
editWatchfaceIntent.putExtra(GBDevice.EXTRA_UUID, selectedApp.getUUID().toString());
getContext().startActivity(editWatchfaceIntent);
startActivityForResult(editWatchfaceIntent, CHILD_ACTIVITY_WATCHFACE_EDITOR);
return true;
default:
return super.onContextItemSelected(item);

View File

@ -190,6 +190,7 @@ public class AppManagerActivity extends AbstractGBFragmentActivity {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent resultData) {
super.onActivityResult(requestCode, resultCode, resultData);
if (requestCode == READ_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
Intent startIntent = new Intent(AppManagerActivity.this, FwAppInstallerActivity.class);
startIntent.setAction(Intent.ACTION_VIEW);