aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-02-06 04:05:56 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-02-06 04:05:56 +0000
commitcb517f82e33fdb96ebd77483af1fee872b7b06aa (patch)
tree9f1ec02ed03b19330ebf0d597e0febdcbd5ef207
parentab46ef735237457d3b270ddf261189e52bd14a09 (diff)
parent20c3fc7861ecb649f0b2b3ebf3af1e1370f927b6 (diff)
downloadandroid-pie-qpr3-release.tar.gz
Change-Id: I8ddcdca6f20909a932ca2fd953aa912ac06fd08d
-rw-r--r--wearable/wear/WearNotifications/Application/src/main/java/com/example/android/wearable/wear/wearnotifications/handlers/BigTextIntentService.java43
-rw-r--r--wearable/wear/WearNotifications/Shared/build.gradle2
-rw-r--r--wearable/wear/WearNotifications/gradle.properties4
-rw-r--r--wearable/wear/WearNotifications/template-params.xml18
-rw-r--r--wearable/wear/WearVerifyRemoteApp/.gitignore33
-rw-r--r--wearable/wear/WearVerifyRemoteApp/Wearable/build.gradle4
-rw-r--r--wearable/wear/WearVerifyRemoteApp/gradle.properties20
-rw-r--r--wearable/wear/WearVerifyRemoteApp/template-params.xml8
-rw-r--r--wearable/wear/XYZTouristAttractions/gradle.properties20
-rw-r--r--wearable/wear/XYZTouristAttractions/template-params.xml24
10 files changed, 130 insertions, 46 deletions
diff --git a/wearable/wear/WearNotifications/Application/src/main/java/com/example/android/wearable/wear/wearnotifications/handlers/BigTextIntentService.java b/wearable/wear/WearNotifications/Application/src/main/java/com/example/android/wearable/wear/wearnotifications/handlers/BigTextIntentService.java
index 089a0d9c..b54d748f 100644
--- a/wearable/wear/WearNotifications/Application/src/main/java/com/example/android/wearable/wear/wearnotifications/handlers/BigTextIntentService.java
+++ b/wearable/wear/WearNotifications/Application/src/main/java/com/example/android/wearable/wear/wearnotifications/handlers/BigTextIntentService.java
@@ -25,11 +25,12 @@ import android.util.Log;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationCompat.BigTextStyle;
import androidx.core.app.NotificationManagerCompat;
+import androidx.core.content.ContextCompat;
+import com.example.android.wearable.wear.common.mock.MockDatabase;
import com.example.android.wearable.wear.wearnotifications.GlobalNotificationBuilder;
import com.example.android.wearable.wear.wearnotifications.MainActivity;
import com.example.android.wearable.wear.wearnotifications.R;
-import com.example.android.wearable.wear.common.mock.MockDatabase;
import java.util.concurrent.TimeUnit;
@@ -130,17 +131,23 @@ public class BigTextIntentService extends IntentService {
// 3. Create additional Actions for the Notification
// 4. Build and issue the notification
- // 0. Get your data
- MockDatabase.BigTextStyleReminderAppData bigTextData = MockDatabase.getBigTextStyleData();
+ // 0. Get your data (everything unique per Notification).
+ MockDatabase.BigTextStyleReminderAppData bigTextStyleReminderAppData =
+ MockDatabase.getBigTextStyleData();
+
+ // 1. Retrieve Notification Channel for O and beyond devices (26+). We don't need to create
+ // the NotificationChannel, since it was created the first time this Notification was
+ // created.
+ String notificationChannelId = bigTextStyleReminderAppData.getChannelId();
- // 1. Build the BIG_TEXT_STYLE
+ // 2. Build the BIG_TEXT_STYLE.
BigTextStyle bigTextStyle = new NotificationCompat.BigTextStyle()
- .bigText(bigTextData.getBigText())
- .setBigContentTitle(bigTextData.getBigContentTitle())
- .setSummaryText(bigTextData.getSummaryText());
+ .bigText(bigTextStyleReminderAppData.getBigText())
+ .setBigContentTitle(bigTextStyleReminderAppData.getBigContentTitle())
+ .setSummaryText(bigTextStyleReminderAppData.getSummaryText());
- // 2. Set up main Intent for notification
+ // 3. Set up main Intent for notification
Intent notifyIntent = new Intent(this, BigTextMainActivity.class);
notifyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
@@ -153,7 +160,7 @@ public class BigTextIntentService extends IntentService {
);
- // 3. Create additional Actions (Intents) for the Notification
+ // 4. Create additional Actions (Intents) for the Notification
// Snooze Action
Intent snoozeIntent = new Intent(this, BigTextIntentService.class);
@@ -180,25 +187,29 @@ public class BigTextIntentService extends IntentService {
dismissPendingIntent)
.build();
- // 4. Build and issue the notification
+
+ // 5. Build and issue the notification.
+
+ // Notification Channel Id is ignored for Android pre O (26).
NotificationCompat.Builder notificationCompatBuilder =
- new NotificationCompat.Builder(getApplicationContext());
+ new NotificationCompat.Builder(
+ getApplicationContext(), notificationChannelId);
GlobalNotificationBuilder.setNotificationCompatBuilderInstance(notificationCompatBuilder);
notificationCompatBuilder
.setStyle(bigTextStyle)
- .setContentTitle(bigTextData.getContentTitle())
- .setContentText(bigTextData.getContentText())
+ .setContentTitle(bigTextStyleReminderAppData.getContentTitle())
+ .setContentText(bigTextStyleReminderAppData.getContentText())
.setSmallIcon(R.drawable.ic_launcher)
.setLargeIcon(BitmapFactory.decodeResource(
getResources(),
R.drawable.ic_alarm_white_48dp))
.setContentIntent(notifyPendingIntent)
- .setColor(getResources().getColor(R.color.colorPrimary))
+ .setColor(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimary))
.setCategory(Notification.CATEGORY_REMINDER)
- .setPriority(Notification.PRIORITY_HIGH)
- .setVisibility(Notification.VISIBILITY_PUBLIC)
+ .setPriority(bigTextStyleReminderAppData.getPriority())
+ .setVisibility(bigTextStyleReminderAppData.getChannelLockscreenVisibility())
.addAction(snoozeAction)
.addAction(dismissAction);
diff --git a/wearable/wear/WearNotifications/Shared/build.gradle b/wearable/wear/WearNotifications/Shared/build.gradle
index 5bef7a80..582d65db 100644
--- a/wearable/wear/WearNotifications/Shared/build.gradle
+++ b/wearable/wear/WearNotifications/Shared/build.gradle
@@ -18,7 +18,7 @@ repositories {
}
dependencies {
- implementation 'androidx.legacy:legacy-support-v4:1.0.0-alpha3'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}
// The sample build uses multiple directories to
diff --git a/wearable/wear/WearNotifications/gradle.properties b/wearable/wear/WearNotifications/gradle.properties
index 6511fc12..94f84728 100644
--- a/wearable/wear/WearNotifications/gradle.properties
+++ b/wearable/wear/WearNotifications/gradle.properties
@@ -18,5 +18,5 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
-android.useAndroidX = true
-android.enableJetifier = true
+android.useAndroidX=true
+android.enableJetifier=true
diff --git a/wearable/wear/WearNotifications/template-params.xml b/wearable/wear/WearNotifications/template-params.xml
index 26396118..434b3659 100644
--- a/wearable/wear/WearNotifications/template-params.xml
+++ b/wearable/wear/WearNotifications/template-params.xml
@@ -34,17 +34,17 @@
<androidX>true</androidX>
- <dependency>androidx.appcompat:appcompat:1.0.0-alpha3</dependency>
- <dependency>androidx.cardview:cardview:1.0.0-alpha3</dependency>
- <dependency>com.google.android.material:material:1.0.0-alpha3</dependency>
- <dependency>androidx.legacy:legacy-support-v13:1.0.0-alpha3</dependency>
+ <dependency>androidx.appcompat:appcompat:1.0.2</dependency>
+ <dependency>androidx.cardview:cardview:1.0.0</dependency>
+ <dependency>com.google.android.material:material:1.0.0</dependency>
+ <dependency>androidx.legacy:legacy-support-v13:1.0.0</dependency>
- <dependency_shared>androidx.legacy:legacy-support-v4:1.0.0-alpha3</dependency_shared>
+ <dependency_shared>androidx.legacy:legacy-support-v4:1.0.0</dependency_shared>
- <dependency_wearable>androidx.appcompat:appcompat:1.0.0-alpha3</dependency_wearable>
- <dependency_wearable>androidx.wear:wear:1.0.0-alpha3</dependency_wearable>
- <dependency_wearable>com.google.android.material:material:1.0.0-alpha3</dependency_wearable>
- <dependency_wearable>androidx.legacy:legacy-support-v13:1.0.0-alpha3</dependency_wearable>
+ <dependency_wearable>androidx.appcompat:appcompat:1.0.2</dependency_wearable>
+ <dependency_wearable>androidx.wear:wear:1.0.0</dependency_wearable>
+ <dependency_wearable>com.google.android.material:material:1.0.0</dependency_wearable>
+ <dependency_wearable>androidx.legacy:legacy-support-v13:1.0.0</dependency_wearable>
<!-- Include additional dependencies here.-->
<!-- dependency>com.google.android.gms:play-services:5.0.+</dependency -->
diff --git a/wearable/wear/WearVerifyRemoteApp/.gitignore b/wearable/wear/WearVerifyRemoteApp/.gitignore
new file mode 100644
index 00000000..b90e7562
--- /dev/null
+++ b/wearable/wear/WearVerifyRemoteApp/.gitignore
@@ -0,0 +1,33 @@
+# built application files
+*.apk
+*.ap_
+
+# files for the dex VM
+*.dex
+
+# Java class files
+*.class
+
+# generated files
+bin/
+gen/
+
+# Ignore gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+proguard-project.txt
+
+# Eclipse files
+.project
+.classpath
+.settings/
+
+# Android Studio/IDEA
+*.iml
+.idea
diff --git a/wearable/wear/WearVerifyRemoteApp/Wearable/build.gradle b/wearable/wear/WearVerifyRemoteApp/Wearable/build.gradle
index 94056696..78330994 100644
--- a/wearable/wear/WearVerifyRemoteApp/Wearable/build.gradle
+++ b/wearable/wear/WearVerifyRemoteApp/Wearable/build.gradle
@@ -21,7 +21,7 @@ repositories {
dependencies {
- implementation 'com.android.support:wear:27.1.1'
+ implementation 'com.android.support:wear:28.0.0'
implementation 'com.google.android.gms:play-services-wearable:15.0.1'
@@ -54,7 +54,7 @@ android {
minSdkVersion 23
- targetSdkVersion 26
+ targetSdkVersion 28
}
diff --git a/wearable/wear/WearVerifyRemoteApp/gradle.properties b/wearable/wear/WearVerifyRemoteApp/gradle.properties
new file mode 100644
index 00000000..0bc4294e
--- /dev/null
+++ b/wearable/wear/WearVerifyRemoteApp/gradle.properties
@@ -0,0 +1,20 @@
+
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Settings specified in this file will override any Gradle settings
+# configured through the IDE.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+
diff --git a/wearable/wear/WearVerifyRemoteApp/template-params.xml b/wearable/wear/WearVerifyRemoteApp/template-params.xml
index 5e93583b..c1a8420c 100644
--- a/wearable/wear/WearVerifyRemoteApp/template-params.xml
+++ b/wearable/wear/WearVerifyRemoteApp/template-params.xml
@@ -23,17 +23,17 @@
<!-- change minSdk if needed-->
<minSdk>23</minSdk>
<minSdkVersionWear>23</minSdkVersionWear>
- <targetSdkVersion>27</targetSdkVersion>
- <targetSdkVersionWear>26</targetSdkVersionWear>
+ <targetSdkVersion>28</targetSdkVersion>
+ <targetSdkVersionWear>28</targetSdkVersionWear>
<wearable>
<has_handheld_app>true</has_handheld_app>
</wearable>
- <dependency>com.google.android.support:wearable:2.3.0</dependency>
+ <dependency>com.google.android.support:wearable:2.4.0</dependency>
- <dependency_wearable>com.android.support:wear:27.1.1</dependency_wearable>
+ <dependency_wearable>com.android.support:wear:28.0.0</dependency_wearable>
<!-- Include additional dependencies here.-->
<!-- dependency>com.google.android.gms:play-services:5.0.+</dependency -->
diff --git a/wearable/wear/XYZTouristAttractions/gradle.properties b/wearable/wear/XYZTouristAttractions/gradle.properties
new file mode 100644
index 00000000..0bc4294e
--- /dev/null
+++ b/wearable/wear/XYZTouristAttractions/gradle.properties
@@ -0,0 +1,20 @@
+
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Settings specified in this file will override any Gradle settings
+# configured through the IDE.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+
diff --git a/wearable/wear/XYZTouristAttractions/template-params.xml b/wearable/wear/XYZTouristAttractions/template-params.xml
index 0e074b7b..d505fe82 100644
--- a/wearable/wear/XYZTouristAttractions/template-params.xml
+++ b/wearable/wear/XYZTouristAttractions/template-params.xml
@@ -19,8 +19,8 @@
<group>Wearable</group>
<package>com.example.android.xyztouristattractions</package>
<minSdk>18</minSdk>
- <targetSdkVersion>26</targetSdkVersion>
- <targetSdkVersionWear>26</targetSdkVersionWear>
+ <targetSdkVersion>28</targetSdkVersion>
+ <targetSdkVersionWear>28</targetSdkVersionWear>
<minSdkVersionWear>23</minSdkVersionWear>
@@ -31,18 +31,18 @@
<dependency>com.google.maps.android:android-maps-utils:0.5</dependency>
<dependency>com.github.bumptech.glide:glide:3.7.0</dependency>
- <dependency>com.android.support:appcompat-v7:27.1.0</dependency>
- <dependency>com.android.support:recyclerview-v7:27.1.0</dependency>
- <dependency>com.android.support:design:27.1.0</dependency>
-
- <dependency>com.google.android.gms:play-services-maps:15.0.1</dependency>
- <dependency>com.google.android.gms:play-services-location:15.0.1</dependency>
- <dependency_wearable>com.google.android.gms:play-services-maps:15.0.1</dependency_wearable>
- <dependency_shared>com.android.support:support-v13:27.1.0</dependency_shared>
- <dependency_shared>com.google.android.gms:play-services-wearable</dependency_shared>
- <dependency_shared>com.google.android.gms:play-services-maps:15.0.1</dependency_shared>
+ <dependency>com.android.support:appcompat-v7:28.0.0</dependency>
+ <dependency>com.android.support:recyclerview-v7:28.0.0</dependency>
+ <dependency>com.android.support:design:28.0.0</dependency>
+ <dependency>com.google.android.gms:play-services-maps:16.0.0</dependency>
+ <dependency>com.google.android.gms:play-services-location:16.0.0</dependency>
+
+ <dependency_shared>com.android.support:support-v13:28.0.0</dependency_shared>
+ <dependency_shared>com.google.android.gms:play-services-wearable:15.0.1</dependency_shared>
+ <dependency_shared>com.google.android.gms:play-services-maps:16.0.0</dependency_shared>
<dependency_shared>com.google.maps.android:android-maps-utils:0.5</dependency_shared>
+ <dependency_wearable>com.google.android.gms:play-services-maps:16.0.0</dependency_wearable>
<strings>