mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-11 20:49:25 +01:00
Add strings for activate and deactivate pebble Health
This commit is contained in:
parent
a451b37ceb
commit
ba9e00d2e4
@ -157,24 +157,26 @@ public class AppManagerActivity extends Activity {
|
|||||||
AdapterView.AdapterContextMenuInfo acmi = (AdapterView.AdapterContextMenuInfo) menuInfo;
|
AdapterView.AdapterContextMenuInfo acmi = (AdapterView.AdapterContextMenuInfo) menuInfo;
|
||||||
selectedApp = appList.get(acmi.position);
|
selectedApp = appList.get(acmi.position);
|
||||||
|
|
||||||
if (!selectedApp.isInCache() && !PebbleProtocol.UUID_PEBBLE_HEALTH.equals(selectedApp.getUUID())) {
|
if (!selectedApp.isInCache()) {
|
||||||
menu.removeItem(R.id.appmanager_app_reinstall);
|
menu.removeItem(R.id.appmanager_app_reinstall);
|
||||||
}
|
}
|
||||||
|
if (!PebbleProtocol.UUID_PEBBLE_HEALTH.equals(selectedApp.getUUID())) {
|
||||||
|
menu.removeItem(R.id.appmanager_health_activate);
|
||||||
|
menu.removeItem(R.id.appmanager_health_deactivate);
|
||||||
|
} else if (PebbleProtocol.UUID_PEBBLE_HEALTH.equals(selectedApp.getUUID())) {
|
||||||
|
menu.removeItem(R.id.appmanager_app_delete);
|
||||||
|
}
|
||||||
menu.setHeaderTitle(selectedApp.getName());
|
menu.setHeaderTitle(selectedApp.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextItemSelected(MenuItem item) {
|
public boolean onContextItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
|
case R.id.appmanager_health_deactivate:
|
||||||
case R.id.appmanager_app_delete:
|
case R.id.appmanager_app_delete:
|
||||||
GBApplication.deviceService().onAppDelete(selectedApp.getUUID());
|
GBApplication.deviceService().onAppDelete(selectedApp.getUUID());
|
||||||
return true;
|
return true;
|
||||||
case R.id.appmanager_app_reinstall:
|
case R.id.appmanager_app_reinstall:
|
||||||
if (PebbleProtocol.UUID_PEBBLE_HEALTH.equals(selectedApp.getUUID())) {
|
|
||||||
GBApplication.deviceService().onInstallApp(Uri.parse("fake://health"));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
File cachePath;
|
File cachePath;
|
||||||
try {
|
try {
|
||||||
cachePath = new File(FileUtils.getExternalFilesDir().getPath() + "/pbw-cache/" + selectedApp.getUUID() + ".pbw");
|
cachePath = new File(FileUtils.getExternalFilesDir().getPath() + "/pbw-cache/" + selectedApp.getUUID() + ".pbw");
|
||||||
@ -184,6 +186,9 @@ public class AppManagerActivity extends Activity {
|
|||||||
}
|
}
|
||||||
GBApplication.deviceService().onInstallApp(Uri.fromFile(cachePath));
|
GBApplication.deviceService().onInstallApp(Uri.fromFile(cachePath));
|
||||||
return true;
|
return true;
|
||||||
|
case R.id.appmanager_health_activate:
|
||||||
|
GBApplication.deviceService().onInstallApp(Uri.parse("fake://health"));
|
||||||
|
return true;
|
||||||
default:
|
default:
|
||||||
return super.onContextItemSelected(item);
|
return super.onContextItemSelected(item);
|
||||||
}
|
}
|
||||||
|
@ -6,4 +6,11 @@
|
|||||||
<item
|
<item
|
||||||
android:id="@+id/appmanager_app_delete"
|
android:id="@+id/appmanager_app_delete"
|
||||||
android:title="@string/appmananger_app_delete"/>
|
android:title="@string/appmananger_app_delete"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/appmanager_health_activate"
|
||||||
|
android:title="@string/appmanager_health_activate"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/appmanager_health_deactivate"
|
||||||
|
android:title="@string/appmanager_health_deactivate"/>
|
||||||
|
|
||||||
</menu>
|
</menu>
|
@ -219,5 +219,7 @@
|
|||||||
<string name="activity_prefs_gender">Gender</string>
|
<string name="activity_prefs_gender">Gender</string>
|
||||||
<string name="activity_prefs_height_cm">Height in cm</string>
|
<string name="activity_prefs_height_cm">Height in cm</string>
|
||||||
<string name="activity_prefs_weight_kg">Weight in kg</string>
|
<string name="activity_prefs_weight_kg">Weight in kg</string>
|
||||||
|
<string name="appmanager_health_activate">Activate</string>
|
||||||
|
<string name="appmanager_health_deactivate">Deactivate</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user