Make watchface configuration available for each watchface...
This commit is contained in:
parent
f87193c7fe
commit
34ec0e92db
11 changed files with 159 additions and 9 deletions
|
@ -30,6 +30,9 @@
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.wearable.watchface.preview"
|
android:name="com.google.android.wearable.watchface.preview"
|
||||||
android:resource="@drawable/watchface_bigchart" />
|
android:resource="@drawable/watchface_bigchart" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
|
||||||
|
android:value="watch_face_configuration_bigchart" />
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||||
|
@ -48,6 +51,9 @@
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.wearable.watchface.preview"
|
android:name="com.google.android.wearable.watchface.preview"
|
||||||
android:resource="@drawable/watchface_nochart" />
|
android:resource="@drawable/watchface_nochart" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
|
||||||
|
android:value="watch_face_configuration_nochart" />
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||||
|
@ -66,6 +72,9 @@
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.wearable.watchface.preview"
|
android:name="com.google.android.wearable.watchface.preview"
|
||||||
android:resource="@drawable/watchface_graph" />
|
android:resource="@drawable/watchface_graph" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
|
||||||
|
android:value="watch_face_configuration_home" />
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||||
|
@ -84,6 +93,9 @@
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.wearable.watchface.preview"
|
android:name="com.google.android.wearable.watchface.preview"
|
||||||
android:resource="@drawable/watchface_graph_2" />
|
android:resource="@drawable/watchface_graph_2" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
|
||||||
|
android:value="watch_face_configuration_home2" />
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||||
|
@ -102,6 +114,9 @@
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.wearable.watchface.preview"
|
android:name="com.google.android.wearable.watchface.preview"
|
||||||
android:resource="@drawable/watchface_cockpit" />
|
android:resource="@drawable/watchface_cockpit" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
|
||||||
|
android:value="watch_face_configuration_cockpit" />
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||||
|
@ -120,6 +135,9 @@
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.wearable.watchface.preview"
|
android:name="com.google.android.wearable.watchface.preview"
|
||||||
android:resource="@drawable/watchface_steampunk" />
|
android:resource="@drawable/watchface_steampunk" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
|
||||||
|
android:value="watch_face_configuration_steampunk" />
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||||
|
@ -138,6 +156,9 @@
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.wearable.watchface.preview"
|
android:name="com.google.android.wearable.watchface.preview"
|
||||||
android:resource="@drawable/watchface_dark" />
|
android:resource="@drawable/watchface_dark" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
|
||||||
|
android:value="watch_face_configuration_largehome" />
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||||
|
@ -155,6 +176,9 @@
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.wearable.watchface.preview"
|
android:name="com.google.android.wearable.watchface.preview"
|
||||||
android:resource="@drawable/watchface_circle" />
|
android:resource="@drawable/watchface_circle" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
|
||||||
|
android:value="watch_face_configuration_circle" />
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||||
|
@ -175,7 +199,7 @@
|
||||||
android:resource="@drawable/watchface_digitalstyle" />
|
android:resource="@drawable/watchface_digitalstyle" />
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
|
android:name="com.google.android.wearable.watchface.wearableConfigurationAction"
|
||||||
android:value="info.nightscout.androidaps.interaction.configurationActivities.DigitalStyleConfigAct" />
|
android:value="watch_face_configuration_digitalstyle" />
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.service.wallpaper.WallpaperService" />
|
<action android:name="android.service.wallpaper.WallpaperService" />
|
||||||
|
@ -507,10 +531,19 @@
|
||||||
<activity
|
<activity
|
||||||
android:name=".interaction.actions.TempTargetActivity"
|
android:name=".interaction.actions.TempTargetActivity"
|
||||||
android:label="@string/menu_tempt" />
|
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="com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
|
@ -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.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
import preference.WearPreferenceActivity;
|
import preference.WearPreferenceActivity;
|
||||||
|
|
||||||
public class DigitalStyleConfigAct extends WearPreferenceActivity {
|
public class ConfigurationActivity extends WearPreferenceActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setTitle("watchface");
|
setTitle("Watchface");
|
||||||
addPreferencesFromResource(R.xml.watch_face_digitalstyle_configuration);
|
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();
|
ViewGroup view = (ViewGroup) getWindow().getDecorView();
|
||||||
removeBackgroundRecursively(view);
|
removeBackgroundRecursively(view);
|
||||||
view.setBackground(getResources().getDrawable(R.drawable.settings_background));
|
view.setBackground(getResources().getDrawable(R.drawable.settings_background));
|
14
wear/src/main/res/xml/watch_face_configuration_bigchart.xml
Normal file
14
wear/src/main/res/xml/watch_face_configuration_bigchart.xml
Normal 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>
|
14
wear/src/main/res/xml/watch_face_configuration_circle.xml
Normal file
14
wear/src/main/res/xml/watch_face_configuration_circle.xml
Normal 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>
|
14
wear/src/main/res/xml/watch_face_configuration_cockpit.xml
Normal file
14
wear/src/main/res/xml/watch_face_configuration_cockpit.xml
Normal 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>
|
14
wear/src/main/res/xml/watch_face_configuration_home.xml
Normal file
14
wear/src/main/res/xml/watch_face_configuration_home.xml
Normal 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>
|
14
wear/src/main/res/xml/watch_face_configuration_home2.xml
Normal file
14
wear/src/main/res/xml/watch_face_configuration_home2.xml
Normal 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>
|
14
wear/src/main/res/xml/watch_face_configuration_largehome.xml
Normal file
14
wear/src/main/res/xml/watch_face_configuration_largehome.xml
Normal 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>
|
14
wear/src/main/res/xml/watch_face_configuration_nochart.xml
Normal file
14
wear/src/main/res/xml/watch_face_configuration_nochart.xml
Normal 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>
|
14
wear/src/main/res/xml/watch_face_configuration_steampunk.xml
Normal file
14
wear/src/main/res/xml/watch_face_configuration_steampunk.xml
Normal 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>
|
Loading…
Reference in a new issue