Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Created by .ignore support plugin (hsz.mobi)
### Android template
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/caches

# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

# Google Services (e.g. APIs or Firebase)
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml
.idea/runConfigurations.xml
.idea/vcs.xml
23 changes: 16 additions & 7 deletions 1-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@

apply plugin: 'com.android.application'


android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
compileSdkVersion 28

defaultConfig {
applicationId "com.android.example.watchface"
minSdkVersion 21
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
Expand All @@ -37,7 +35,18 @@ android {
}

dependencies {
provided 'com.google.android.wearable:wearable:2.0.0'
compile 'com.google.android.support:wearable:2.0.0'
compile 'com.google.android.gms:play-services-wearable:10.2.1'
compileOnly 'com.google.android.wearable:wearable:2.4.0'
implementation 'com.google.android.support:wearable:2.4.0'
implementation 'com.google.android.gms:play-services-wearable:16.0.1'
}

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.3.0'
}
}
}
}
26 changes: 13 additions & 13 deletions 1-base/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.android.example.watchface" >
<manifest package="com.android.example.watchface"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-feature android:name="android.hardware.type.watch" />
<uses-feature android:name="android.hardware.type.watch"/>

<!-- Required to act as a custom watch face. -->
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<application
android:allowBackup="true"
Expand All @@ -32,27 +32,27 @@
<service
android:name=".MyWatchFaceService"
android:label="@string/my_analog_name"
android:permission="android.permission.BIND_WALLPAPER" >
android:permission="android.permission.BIND_WALLPAPER">
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/watch_face" />
android:resource="@xml/watch_face"/>
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/preview_analog" />
android:resource="@drawable/preview_analog"/>
<meta-data
android:name="com.google.android.wearable.watchface.preview_circular"
android:resource="@drawable/preview_analog" />
android:resource="@drawable/preview_analog"/>

<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
<action android:name="android.service.wallpaper.WallpaperService"/>

<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE"/>
</intent-filter>
</service>

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
android:value="@integer/google_play_services_version"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ public void onVisibilityChanged(boolean visible) {
}

/*
* Whether the timer should be running depends on whether we're visible
* (as well as whether we're in ambient mode),
* so we may need to start or stop the timer.
*/
* Whether the timer should be running depends on whether we're visible
* (as well as whether we're in ambient mode),
* so we may need to start or stop the timer.
*/
updateTimer();
}

Expand Down
12 changes: 5 additions & 7 deletions 2-background/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@

apply plugin: 'com.android.application'


android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
compileSdkVersion 28

defaultConfig {
applicationId "com.android.example.watchface"
minSdkVersion 21
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
Expand All @@ -37,7 +35,7 @@ android {
}

dependencies {
provided 'com.google.android.wearable:wearable:2.0.0'
compile 'com.google.android.support:wearable:2.0.0'
compile 'com.google.android.gms:play-services-wearable:10.2.1'
compileOnly 'com.google.android.wearable:wearable:2.4.0'
implementation 'com.google.android.support:wearable:2.4.0'
implementation 'com.google.android.gms:play-services-wearable:16.0.1'
}
26 changes: 13 additions & 13 deletions 2-background/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
~ limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.android.example.watchface" >
<manifest package="com.android.example.watchface"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-feature android:name="android.hardware.type.watch" />
<uses-feature android:name="android.hardware.type.watch"/>

<!-- Required to act as a custom watch face. -->
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<application
android:allowBackup="true"
Expand All @@ -33,27 +33,27 @@
<service
android:name=".MyWatchFaceService"
android:label="@string/my_analog_name"
android:permission="android.permission.BIND_WALLPAPER" >
android:permission="android.permission.BIND_WALLPAPER">
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/watch_face" />
android:resource="@xml/watch_face"/>
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/preview_analog" />
android:resource="@drawable/preview_analog"/>
<meta-data
android:name="com.google.android.wearable.watchface.preview_circular"
android:resource="@drawable/preview_analog" />
android:resource="@drawable/preview_analog"/>

<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
<action android:name="android.service.wallpaper.WallpaperService"/>

<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE"/>
</intent-filter>
</service>

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
android:value="@integer/google_play_services_version"/>
</application>

</manifest>
14 changes: 6 additions & 8 deletions 3-hands/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@

apply plugin: 'com.android.application'


android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 28

defaultConfig {
applicationId "com.android.example.watchface"
minSdkVersion 21
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
Expand All @@ -37,7 +35,7 @@ android {
}

dependencies {
provided 'com.google.android.wearable:wearable:2.0.0'
compile 'com.google.android.support:wearable:2.0.0'
compile 'com.google.android.gms:play-services-wearable:10.2.1'
}
compileOnly 'com.google.android.wearable:wearable:2.4.0'
implementation 'com.google.android.support:wearable:2.4.0'
implementation 'com.google.android.gms:play-services-wearable:16.0.1'
}
26 changes: 13 additions & 13 deletions 3-hands/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
~ limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.android.example.watchface" >
<manifest package="com.android.example.watchface"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-feature android:name="android.hardware.type.watch" />
<uses-feature android:name="android.hardware.type.watch"/>

<!-- Required to act as a custom watch face. -->
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<application
android:allowBackup="true"
Expand All @@ -33,27 +33,27 @@
<service
android:name=".MyWatchFaceService"
android:label="@string/my_analog_name"
android:permission="android.permission.BIND_WALLPAPER" >
android:permission="android.permission.BIND_WALLPAPER">
<meta-data
android:name="android.service.wallpaper"
android:resource="@xml/watch_face" />
android:resource="@xml/watch_face"/>
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="@drawable/preview_analog" />
android:resource="@drawable/preview_analog"/>
<meta-data
android:name="com.google.android.wearable.watchface.preview_circular"
android:resource="@drawable/preview_analog" />
android:resource="@drawable/preview_analog"/>

<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" />
<action android:name="android.service.wallpaper.WallpaperService"/>

<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE" />
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE"/>
</intent-filter>
</service>

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
android:value="@integer/google_play_services_version"/>
</application>

</manifest>
14 changes: 6 additions & 8 deletions 4-ambient/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@

apply plugin: 'com.android.application'


android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 28

defaultConfig {
applicationId "com.android.example.watchface"
minSdkVersion 21
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
Expand All @@ -37,7 +35,7 @@ android {
}

dependencies {
provided 'com.google.android.wearable:wearable:2.0.0'
compile 'com.google.android.support:wearable:2.0.0'
compile 'com.google.android.gms:play-services-wearable:10.2.1'
}
compileOnly 'com.google.android.wearable:wearable:2.4.0'
implementation 'com.google.android.support:wearable:2.4.0'
implementation 'com.google.android.gms:play-services-wearable:16.0.1'
}
Loading