diff options
author | Alexey 'Cluster' Avdyukhin <a.avdyukhin@norsi-trans.ru> | 2022-03-14 13:51:28 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <a.avdyukhin@norsi-trans.ru> | 2022-03-14 13:51:28 +0300 |
commit | 26fb4aadd6fba55dd23956c06bf2756351eaf164 (patch) | |
tree | d2fc25018c8351751a9cb95899c4cb295ec510e2 | |
parent | a9f64ee1f80f3f1bf376310ff65950fdd666ad75 (diff) |
Refactoring
-rw-r--r-- | app/src/main/AndroidManifest.xml | 4 | ||||
-rw-r--r-- | app/src/main/java/com/clusterrr/hexeditorwatchface/HexWatchFace.java | 23 | ||||
-rw-r--r-- | app/src/main/res/values/styles.xml | 5 |
3 files changed, 11 insertions, 21 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c1f3026..24199ff 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -48,7 +48,6 @@ <intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
-
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
</intent-filter>
</service>
@@ -56,7 +55,8 @@ <activity
android:name=".SettingsActivity"
android:label="Settings"
- android:exported="true">
+ android:exported="true"
+ android:theme="@style/MyMaterialTheme">
<intent-filter>
<action android:name="androidx.wear.watchface.editor.action.WATCH_FACE_EDITOR" />
diff --git a/app/src/main/java/com/clusterrr/hexeditorwatchface/HexWatchFace.java b/app/src/main/java/com/clusterrr/hexeditorwatchface/HexWatchFace.java index 6e077a6..9194d86 100644 --- a/app/src/main/java/com/clusterrr/hexeditorwatchface/HexWatchFace.java +++ b/app/src/main/java/com/clusterrr/hexeditorwatchface/HexWatchFace.java @@ -30,18 +30,6 @@ import java.util.Calendar; import java.util.TimeZone; import java.util.concurrent.TimeUnit; -/** - * Analog watch face with a ticking second hand. In ambient mode, the second hand isn"t - * shown. On devices with low-bit ambient mode, the hands are drawn without anti-aliasing in ambient - * mode. The watch face is drawn with less contrast in mute mode. - * <p> - * Important Note: Because watch face apps do not have a default Activity in - * their project, you will need to set your Configurations to - * "Do not launch Activity" for both the Wear and/or Application modules. If you - * are unsure how to do this, please review the "Run Starter project" section - * in the Google Watch Face Code Lab: - * https://codelabs.developers.google.com/codelabs/watchface/index.html#0 - */ public class HexWatchFace extends CanvasWatchFaceService { /* * Updates rate in milliseconds for interactive mode. We update once a second to advance the @@ -51,6 +39,11 @@ public class HexWatchFace extends CanvasWatchFaceService { private static final long INTERACTIVE_UPDATE_RATE = TimeUnit.SECONDS.toMillis(1); private static final long MAX_HEART_RATE_AGE = TimeUnit.SECONDS.toMillis(15); private static final long TOUCH_TIME = TimeUnit.SECONDS.toMillis(3); + private static final int NUMBER_WIDTH = 78; + private static final int NUMBER_V_INTERVAL = 56; + private static final int ENDIANNESS_LITTLE_ENDIAN = 0; + private static final int ENDIANNESS_BIG_ENDIAN = 1; + private static final int ENDIANNESS_FAKE_HEX = 2; /** * Handler message id for updating the time periodically in interactive mode. @@ -83,12 +76,6 @@ public class HexWatchFace extends CanvasWatchFaceService { } private class Engine extends CanvasWatchFaceService.Engine implements SensorEventListener { - private static final int NUMBER_WIDTH = 78; - private static final int NUMBER_V_INTERVAL = 56; - private static final int ENDIANNESS_LITTLE_ENDIAN = 0; - private static final int ENDIANNESS_BIG_ENDIAN = 1; - private static final int ENDIANNESS_FAKE_HEX = 2; - /* Handler to update the time once a second in interactive mode. */ private final Handler mUpdateTimeHandler = new EngineHandler(this); private Calendar mCalendar; diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index e8bf33d..83a85dc 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,4 +1,7 @@ <?xml version="1.0" encoding="utf-8"?>
<resources>
-
+ <style name="MyMaterialTheme" parent="Theme.AppCompat.NoActionBar">
+ <item name="android:windowNoTitle">true</item>
+ <item name="android:windowActionBar">false</item>
+ </style>
</resources>
|