diff --git a/wear/src/main/AndroidManifest.xml b/wear/src/main/AndroidManifest.xml index d20c090aa4..19b1222e46 100644 --- a/wear/src/main/AndroidManifest.xml +++ b/wear/src/main/AndroidManifest.xml @@ -163,16 +163,16 @@ + android:resource="@drawable/watchface_digitalstyle" /> @@ -507,7 +507,7 @@ - + diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/configurationActivities/DigitalStyle01ConfigAct.java b/wear/src/main/java/info/nightscout/androidaps/interaction/configurationActivities/DigitalStyleConfigAct.java similarity index 92% rename from wear/src/main/java/info/nightscout/androidaps/interaction/configurationActivities/DigitalStyle01ConfigAct.java rename to wear/src/main/java/info/nightscout/androidaps/interaction/configurationActivities/DigitalStyleConfigAct.java index c0ced91076..e86c7a80d7 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/configurationActivities/DigitalStyle01ConfigAct.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/configurationActivities/DigitalStyleConfigAct.java @@ -7,13 +7,13 @@ import android.view.ViewGroup; import info.nightscout.androidaps.R; import preference.WearPreferenceActivity; -public class DigitalStyle01ConfigAct extends WearPreferenceActivity { +public class DigitalStyleConfigAct extends WearPreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTitle("watchface"); - addPreferencesFromResource(R.xml.watch_face_digitalstyle01_configuration); + addPreferencesFromResource(R.xml.watch_face_digitalstyle_configuration); ViewGroup view = (ViewGroup) getWindow().getDecorView(); removeBackgroundRecursively(view); view.setBackground(getResources().getDrawable(R.drawable.settings_background)); diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyle01.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyle.java similarity index 91% rename from wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyle01.java rename to wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyle.java index 6c1995d991..75043f8c94 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyle01.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyle.java @@ -2,7 +2,6 @@ package info.nightscout.androidaps.watchfaces; import android.content.Intent; import android.content.res.ColorStateList; -import android.os.Vibrator; import android.support.wearable.watchface.WatchFaceStyle; import android.util.Log; import android.view.LayoutInflater; @@ -12,16 +11,13 @@ import android.widget.TextView; import androidx.core.content.ContextCompat; -import com.ustwo.clockwise.common.WatchFaceTime; -import com.ustwo.clockwise.common.WatchMode; - import java.text.SimpleDateFormat; import java.util.Date; import info.nightscout.androidaps.R; import info.nightscout.androidaps.interaction.menus.MainMenuActivity; -public class DigitalStyle01 extends BaseWatchFace { +public class DigitalStyle extends BaseWatchFace { private static final long TIME_TAP_THRESHOLD = 800; private long chartTapTime = 0; private long sgvTapTime = 0; @@ -30,7 +26,7 @@ public class DigitalStyle01 extends BaseWatchFace { public void onCreate() { super.onCreate(); LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); - layoutView = inflater.inflate(R.layout.activity_digitalstyle01, null); + layoutView = inflater.inflate(R.layout.activity_digitalstyle, null); performViewSetup(); } @@ -103,17 +99,17 @@ public class DigitalStyle01 extends BaseWatchFace { LinearLayout mShapesElements = layoutView.findViewById(R.id.shapes_elements); if (mShapesElements != null) { String displayFormatType = (mShapesElements.getContentDescription().toString().startsWith("round") ? "round" : "rect"); - String displayStyle=sharedPrefs.getString("digitalstyle01_frameStyle", "full"); - String displayFrameColor=sharedPrefs.getString("digitalstyle01_frameColor", "red"); - String displayFrameColorSaturation=sharedPrefs.getString("digitalstyle01_frameColorSaturation", "500"); - String displayFrameColorOpacity=sharedPrefs.getString("digitalstyle01_frameColorOpacity", "1"); + String displayStyle=sharedPrefs.getString("digitalstyle_frameStyle", "full"); + String displayFrameColor=sharedPrefs.getString("digitalstyle_frameColor", "red"); + String displayFrameColorSaturation=sharedPrefs.getString("digitalstyle_frameColorSaturation", "500"); + String displayFrameColorOpacity=sharedPrefs.getString("digitalstyle_frameColorOpacity", "1"); // Load image with shapes - String styleDrawableName = "digitalstyle01_bg_" + displayStyle + "_" + displayFormatType; + String styleDrawableName = "digitalstyle_bg_" + displayStyle + "_" + displayFormatType; try { mShapesElements.setBackground(getResources().getDrawable(getResources().getIdentifier(styleDrawableName, "drawable", getApplicationContext().getPackageName()))); } catch (Exception e) { - Log.e("digitalstyle01_frameStyle", "RESOURCE NOT FOUND >> " + styleDrawableName); + Log.e("digitalstyle_frameStyle", "RESOURCE NOT FOUND >> " + styleDrawableName); } // set background-tint-color @@ -121,13 +117,13 @@ public class DigitalStyle01 extends BaseWatchFace { mShapesElements.setBackgroundTintList(null); } else { String strColorName =(( displayFrameColor.equals("white") || displayFrameColor.equals("black") )?displayFrameColor:displayFrameColor+"_"+displayFrameColorSaturation); - Log.v("digitalstyle01_strColorName",strColorName); + Log.v("digitalstyle_strColorName",strColorName); try { ColorStateList colorStateList = ContextCompat.getColorStateList(getApplicationContext(), getResources().getIdentifier(strColorName, "color", getApplicationContext().getPackageName())); mShapesElements.setBackgroundTintList(colorStateList); } catch (Exception e) { mShapesElements.setBackgroundTintList(null); - Log.e("digitalstyle01_colorName", "COLOR NOT FOUND >> " + strColorName); + Log.e("digitalstyle_colorName", "COLOR NOT FOUND >> " + strColorName); } } diff --git a/wear/src/main/res/drawable/digitalstyle01_bg_full_rect.png b/wear/src/main/res/drawable/digitalstyle_bg_full_rect.png similarity index 100% rename from wear/src/main/res/drawable/digitalstyle01_bg_full_rect.png rename to wear/src/main/res/drawable/digitalstyle_bg_full_rect.png diff --git a/wear/src/main/res/drawable/digitalstyle01_bg_full_round.png b/wear/src/main/res/drawable/digitalstyle_bg_full_round.png similarity index 100% rename from wear/src/main/res/drawable/digitalstyle01_bg_full_round.png rename to wear/src/main/res/drawable/digitalstyle_bg_full_round.png diff --git a/wear/src/main/res/drawable/digitalstyle01_bg_minimal_rect.png b/wear/src/main/res/drawable/digitalstyle_bg_minimal_rect.png similarity index 100% rename from wear/src/main/res/drawable/digitalstyle01_bg_minimal_rect.png rename to wear/src/main/res/drawable/digitalstyle_bg_minimal_rect.png diff --git a/wear/src/main/res/drawable/digitalstyle01_bg_minimal_round.png b/wear/src/main/res/drawable/digitalstyle_bg_minimal_round.png similarity index 100% rename from wear/src/main/res/drawable/digitalstyle01_bg_minimal_round.png rename to wear/src/main/res/drawable/digitalstyle_bg_minimal_round.png diff --git a/wear/src/main/res/drawable/digitalstyle01_bg_none_rect.png b/wear/src/main/res/drawable/digitalstyle_bg_none_rect.png similarity index 100% rename from wear/src/main/res/drawable/digitalstyle01_bg_none_rect.png rename to wear/src/main/res/drawable/digitalstyle_bg_none_rect.png diff --git a/wear/src/main/res/drawable/digitalstyle01_bg_none_round.png b/wear/src/main/res/drawable/digitalstyle_bg_none_round.png similarity index 100% rename from wear/src/main/res/drawable/digitalstyle01_bg_none_round.png rename to wear/src/main/res/drawable/digitalstyle_bg_none_round.png diff --git a/wear/src/main/res/drawable/digitalstyle01_bg_shape_rect.png b/wear/src/main/res/drawable/digitalstyle_bg_shape_rect.png similarity index 100% rename from wear/src/main/res/drawable/digitalstyle01_bg_shape_rect.png rename to wear/src/main/res/drawable/digitalstyle_bg_shape_rect.png diff --git a/wear/src/main/res/drawable/digitalstyle01_bg_shape_round.png b/wear/src/main/res/drawable/digitalstyle_bg_shape_round.png similarity index 100% rename from wear/src/main/res/drawable/digitalstyle01_bg_shape_round.png rename to wear/src/main/res/drawable/digitalstyle_bg_shape_round.png diff --git a/wear/src/main/res/drawable/watchface_digitalstyle01.png b/wear/src/main/res/drawable/watchface_digitalstyle.png similarity index 100% rename from wear/src/main/res/drawable/watchface_digitalstyle01.png rename to wear/src/main/res/drawable/watchface_digitalstyle.png diff --git a/wear/src/main/res/layout/activity_digitalstyle01.xml b/wear/src/main/res/layout/activity_digitalstyle.xml similarity index 78% rename from wear/src/main/res/layout/activity_digitalstyle01.xml rename to wear/src/main/res/layout/activity_digitalstyle.xml index da1fadf9b2..5fd23a86b7 100644 --- a/wear/src/main/res/layout/activity_digitalstyle01.xml +++ b/wear/src/main/res/layout/activity_digitalstyle.xml @@ -7,7 +7,7 @@ android:id="@+id/watch_view_stub" android:layout_width="match_parent" android:layout_height="match_parent" - app:rectLayout="@layout/rect_activity_digitalstyle01" - app:roundLayout="@layout/round_activity_digitalstyle01" + app:rectLayout="@layout/rect_activity_digitalstyle" + app:roundLayout="@layout/round_activity_digitalstyle" tools:context=".watchfaces.Home" tools:deviceIds="wear"/> \ No newline at end of file diff --git a/wear/src/main/res/layout/rect_activity_digitalstyle01.xml b/wear/src/main/res/layout/rect_activity_digitalstyle.xml similarity index 99% rename from wear/src/main/res/layout/rect_activity_digitalstyle01.xml rename to wear/src/main/res/layout/rect_activity_digitalstyle.xml index 00626650bd..8d22bc8e3d 100644 --- a/wear/src/main/res/layout/rect_activity_digitalstyle01.xml +++ b/wear/src/main/res/layout/rect_activity_digitalstyle.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/black" - tools:context=".watchfaces.DigitalStyle01" + tools:context=".watchfaces.DigitalStyle" tools:deviceIds="wear_square"> @@ -15,7 +15,7 @@ android:id="@+id/shapes_elements" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@drawable/digitalstyle01_bg_full_rect" + android:background="@drawable/digitalstyle_bg_full_rect" android:contentDescription="rect-shape-elements" android:orientation="horizontal" /> diff --git a/wear/src/main/res/layout/round_activity_digitalstyle01.xml b/wear/src/main/res/layout/round_activity_digitalstyle.xml similarity index 99% rename from wear/src/main/res/layout/round_activity_digitalstyle01.xml rename to wear/src/main/res/layout/round_activity_digitalstyle.xml index bede24e7d7..02a638d6ab 100644 --- a/wear/src/main/res/layout/round_activity_digitalstyle01.xml +++ b/wear/src/main/res/layout/round_activity_digitalstyle.xml @@ -6,7 +6,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/black" - tools:context=".watchfaces.DigitalStyle01" + tools:context=".watchfaces.DigitalStyle" tools:deviceIds="wear_round"> @@ -15,7 +15,7 @@ android:id="@+id/shapes_elements" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@drawable/digitalstyle01_bg_full_round" + android:background="@drawable/digitalstyle_bg_full_round" android:contentDescription="round-shape-elements" android:orientation="horizontal" /> diff --git a/wear/src/main/res/values/digitalstyle01_arrays.xml b/wear/src/main/res/values/digitalstyle_arrays.xml similarity index 80% rename from wear/src/main/res/values/digitalstyle01_arrays.xml rename to wear/src/main/res/values/digitalstyle_arrays.xml index 5ba2965286..25f16564fe 100644 --- a/wear/src/main/res/values/digitalstyle01_arrays.xml +++ b/wear/src/main/res/values/digitalstyle_arrays.xml @@ -1,19 +1,19 @@ - - @string/style_none - @string/style_minimal - @string/style_shape - @string/style_full + + @string/digitalstyle_style_none + @string/digitalstyle_style_minimal + @string/digitalstyle_style_shape + @string/digitalstyle_style_full - + none minimal shape full - + @string/color_name_red @string/color_name_pink @string/color_name_purple @@ -36,7 +36,7 @@ @string/color_name_white @string/color_name_multicolor - + red pink purple @@ -61,7 +61,7 @@ - + 100 500 700 @@ -69,7 +69,7 @@ - + 10% 20% 30% @@ -81,7 +81,7 @@ 90% 100% - + 0.1 0.2 0.3 diff --git a/wear/src/main/res/values/strings.xml b/wear/src/main/res/values/strings.xml index b3652447c0..f69f26f0a6 100644 --- a/wear/src/main/res/values/strings.xml +++ b/wear/src/main/res/values/strings.xml @@ -12,6 +12,7 @@ AAPSv2 AAPS(Cockpit) AAPS(Steampunk) + AAPS(DigitalStyle) No data! Old data! @@ -143,17 +144,19 @@ multicolor - Choose your style - no style - minimal style - shape style - full style - - - Choose your color - Choose your color saturation - Choose your color opacity Vibrate hourly Show Week number + Your style: + no style + minimal style + shape style + full style + + Your color: + Your color saturation: + Your color opacity: + + + diff --git a/wear/src/main/res/xml/watch_face_digitalstyle01_configuration.xml b/wear/src/main/res/xml/watch_face_digitalstyle_configuration.xml similarity index 54% rename from wear/src/main/res/xml/watch_face_digitalstyle01_configuration.xml rename to wear/src/main/res/xml/watch_face_digitalstyle_configuration.xml index 68725f1bd4..5a29f508fa 100644 --- a/wear/src/main/res/xml/watch_face_digitalstyle01_configuration.xml +++ b/wear/src/main/res/xml/watch_face_digitalstyle_configuration.xml @@ -4,31 +4,31 @@ + android:entries="@array/digitalstyle_styles_name" + android:entryValues="@array/digitalstyle_styles_values"/> + android:entries="@array/digitalstyle_color_name" + android:entryValues="@array/digitalstyle_color_values"/> + android:entries="@array/digitalstyle_color_saturation" + android:entryValues="@array/digitalstyle_color_saturation"/> + android:entries="@array/digitalstyle_color_opacity_name" + android:entryValues="@array/digitalstyle_color_opacity_value"/>