Make watchface configuration available for each watchface...

This commit is contained in:
rICTx-T1D 2020-11-13 20:05:33 +01:00 committed by mh
parent f87193c7fe
commit 34ec0e92db
11 changed files with 159 additions and 9 deletions

View file

@ -30,6 +30,9 @@
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/watchface_bigchart" />
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="watch_face_configuration_bigchart" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
@ -48,6 +51,9 @@
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/watchface_nochart" />
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="watch_face_configuration_nochart" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
@ -66,6 +72,9 @@
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/watchface_graph" />
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="watch_face_configuration_home" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
@ -84,6 +93,9 @@
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/watchface_graph_2" />
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="watch_face_configuration_home2" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
@ -102,6 +114,9 @@
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/watchface_cockpit" />
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="watch_face_configuration_cockpit" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
@ -120,6 +135,9 @@
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/watchface_steampunk" />
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="watch_face_configuration_steampunk" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
@ -138,6 +156,9 @@
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/watchface_dark" />
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="watch_face_configuration_largehome" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
@ -155,6 +176,9 @@
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/watchface_circle" />
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="watch_face_configuration_circle" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
@ -175,7 +199,7 @@
android:resource="@drawable/watchface_digitalstyle" />
<meta-data
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
android:value="info.nightscout.androidaps.interaction.configurationActivities.DigitalStyleConfigAct" />
android:value="watch_face_configuration_digitalstyle" />
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
@ -507,10 +531,19 @@
<activity
android:name=".interaction.actions.TempTargetActivity"
android:label="@string/menu_tempt" />
<activity android:name=".interaction.configurationActivities.DigitalStyleConfigAct">
<intent-filter>
<action android:name="info.nightscout.androidaps.interaction.configurationActivities.DigitalStyleConfigAct" />
<activity android:name=".interaction.ConfigurationActivity">
<intent-filter>
<!-- action-name must be equal with name of xml-ressource where the configuration is describe -->
<action android:name="watch_face_configuration_bigchart" />
<action android:name="watch_face_configuration_circle" />
<action android:name="watch_face_configuration_cockpit" />
<action android:name="watch_face_configuration_digitalstyle" />
<action android:name="watch_face_configuration_home" />
<action android:name="watch_face_configuration_home2" />
<action android:name="watch_face_configuration_largehome" />
<action android:name="watch_face_configuration_nochart" />
<action android:name="watch_face_configuration_steampunk" />
<category android:name="com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

View file

@ -1,19 +1,24 @@
package info.nightscout.androidaps.interaction.configurationActivities;
package info.nightscout.androidaps.interaction;
import android.content.res.XmlResourceParser;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import info.nightscout.androidaps.R;
import preference.WearPreferenceActivity;
public class DigitalStyleConfigAct extends WearPreferenceActivity {
public class ConfigurationActivity extends WearPreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle("watchface");
addPreferencesFromResource(R.xml.watch_face_digitalstyle_configuration);
setTitle("Watchface");
String configFileName=getIntent().getAction();
int resXmlId = getResources().getIdentifier(configFileName, "xml", getApplicationContext().getPackageName());
Log.d("ConfigurationActivity::onCreate --->> getIntent().getAction()",configFileName);
Log.d("ConfigurationActivity::onCreate --->> resXmlId",String.valueOf(resXmlId));
addPreferencesFromResource(resXmlId);
ViewGroup view = (ViewGroup) getWindow().getDecorView();
removeBackgroundRecursively(view);
view.setBackground(getResources().getDrawable(R.drawable.settings_background));

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<CheckBoxPreference
android:key="vibrate_Hourly"
android:title="@string/pref_vibrate_hourly"
android:defaultValue="false"
app:wear_iconOff="@drawable/settings_off"
app:wear_iconOn="@drawable/settings_on" />
</PreferenceScreen>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<CheckBoxPreference
android:key="vibrate_Hourly"
android:title="@string/pref_vibrate_hourly"
android:defaultValue="false"
app:wear_iconOff="@drawable/settings_off"
app:wear_iconOn="@drawable/settings_on" />
</PreferenceScreen>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<CheckBoxPreference
android:key="vibrate_Hourly"
android:title="@string/pref_vibrate_hourly"
android:defaultValue="false"
app:wear_iconOff="@drawable/settings_off"
app:wear_iconOn="@drawable/settings_on" />
</PreferenceScreen>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<CheckBoxPreference
android:key="vibrate_Hourly"
android:title="@string/pref_vibrate_hourly"
android:defaultValue="false"
app:wear_iconOff="@drawable/settings_off"
app:wear_iconOn="@drawable/settings_on" />
</PreferenceScreen>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<CheckBoxPreference
android:key="vibrate_Hourly"
android:title="@string/pref_vibrate_hourly"
android:defaultValue="false"
app:wear_iconOff="@drawable/settings_off"
app:wear_iconOn="@drawable/settings_on" />
</PreferenceScreen>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<CheckBoxPreference
android:key="vibrate_Hourly"
android:title="@string/pref_vibrate_hourly"
android:defaultValue="false"
app:wear_iconOff="@drawable/settings_off"
app:wear_iconOn="@drawable/settings_on" />
</PreferenceScreen>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<CheckBoxPreference
android:key="vibrate_Hourly"
android:title="@string/pref_vibrate_hourly"
android:defaultValue="false"
app:wear_iconOff="@drawable/settings_off"
app:wear_iconOn="@drawable/settings_on" />
</PreferenceScreen>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<CheckBoxPreference
android:key="vibrate_Hourly"
android:title="@string/pref_vibrate_hourly"
android:defaultValue="false"
app:wear_iconOff="@drawable/settings_off"
app:wear_iconOn="@drawable/settings_on" />
</PreferenceScreen>