WatchFace: Updates to latest androidx support libraries.

Bug: 129548613
Test: Manually tested.
Change-Id: If1811b3a31b328c9e6445174f41ca6feb0032af2
diff --git a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/AnalogComplicationConfigActivity.java b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/AnalogComplicationConfigActivity.java
index 19e469a..48c6751 100644
--- a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/AnalogComplicationConfigActivity.java
+++ b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/AnalogComplicationConfigActivity.java
@@ -18,12 +18,13 @@
 import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.wear.widget.WearableRecyclerView;
 import android.support.wearable.complications.ComplicationProviderInfo;
 import android.support.wearable.complications.ProviderChooserIntent;
 import android.util.Log;
 
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.wear.widget.WearableRecyclerView;
+
 import com.example.android.wearable.watchface.R;
 import com.example.android.wearable.watchface.model.AnalogComplicationConfigData;
 import com.example.android.wearable.watchface.watchface.AnalogComplicationWatchFaceService;
diff --git a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/AnalogComplicationConfigRecyclerViewAdapter.java b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/AnalogComplicationConfigRecyclerViewAdapter.java
index 4ee10b5..cabaaca 100644
--- a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/AnalogComplicationConfigRecyclerViewAdapter.java
+++ b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/AnalogComplicationConfigRecyclerViewAdapter.java
@@ -27,8 +27,6 @@
 import android.graphics.PorterDuff;
 import android.graphics.PorterDuffColorFilter;
 import android.graphics.drawable.Drawable;
-import android.support.annotation.Nullable;
-import android.support.v7.widget.RecyclerView;
 import android.support.wearable.complications.ComplicationHelperActivity;
 import android.support.wearable.complications.ComplicationProviderInfo;
 import android.support.wearable.complications.ProviderInfoRetriever;
@@ -45,6 +43,9 @@
 import android.widget.Switch;
 import android.widget.Toast;
 
+import androidx.annotation.Nullable;
+import androidx.recyclerview.widget.RecyclerView;
+
 import com.example.android.wearable.watchface.R;
 import com.example.android.wearable.watchface.model.AnalogComplicationConfigData.BackgroundComplicationConfigItem;
 import com.example.android.wearable.watchface.model.AnalogComplicationConfigData.ColorConfigItem;
diff --git a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/ColorSelectionActivity.java b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/ColorSelectionActivity.java
index 3bbfeec..68cd088 100644
--- a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/ColorSelectionActivity.java
+++ b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/ColorSelectionActivity.java
@@ -17,16 +17,16 @@
 
 import android.app.Activity;
 import android.os.Bundle;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.wear.widget.WearableRecyclerView;
+
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.wear.widget.WearableRecyclerView;
 
 import com.example.android.wearable.watchface.R;
 import com.example.android.wearable.watchface.model.AnalogComplicationConfigData;
 
 /**
  * Allows user to select color for something on the watch face (background, highlight,etc.) and
- * saves it to {@link android.content.SharedPreferences} in
- * {@link android.support.v7.widget.RecyclerView.Adapter}.
+ * saves it to {@link android.content.SharedPreferences} in RecyclerView.Adapter.
  */
 public class ColorSelectionActivity extends Activity {
 
diff --git a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/ColorSelectionRecyclerViewAdapter.java b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/ColorSelectionRecyclerViewAdapter.java
index 0c7fa51..1aba859 100644
--- a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/ColorSelectionRecyclerViewAdapter.java
+++ b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/ColorSelectionRecyclerViewAdapter.java
@@ -18,13 +18,14 @@
 import android.app.Activity;
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.support.v7.widget.RecyclerView;
 import android.support.wearable.view.CircledImageView;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 
+import androidx.recyclerview.widget.RecyclerView;
+
 import com.example.android.wearable.watchface.R;
 
 import java.util.ArrayList;
diff --git a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/DigitalWatchFaceWearableConfigActivity.java b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/DigitalWatchFaceWearableConfigActivity.java
index 274a826..23f795d 100644
--- a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/DigitalWatchFaceWearableConfigActivity.java
+++ b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/config/DigitalWatchFaceWearableConfigActivity.java
@@ -22,8 +22,6 @@
 import android.content.Context;
 import android.graphics.Color;
 import android.os.Bundle;
-import android.support.v7.widget.RecyclerView;
-import android.support.wear.widget.BoxInsetLayout;
 import android.support.wearable.view.CircledImageView;
 import android.support.wearable.view.WearableListView;
 import android.util.Log;
@@ -33,15 +31,17 @@
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.wear.widget.BoxInsetLayout;
+
+import com.example.android.wearable.watchface.R;
+import com.example.android.wearable.watchface.util.DigitalWatchFaceUtil;
+import com.example.android.wearable.watchface.watchface.DigitalWatchFaceService;
 import com.google.android.gms.common.ConnectionResult;
 import com.google.android.gms.common.api.GoogleApiClient;
 import com.google.android.gms.wearable.DataMap;
 import com.google.android.gms.wearable.Wearable;
 
-import com.example.android.wearable.watchface.watchface.DigitalWatchFaceService;
-import com.example.android.wearable.watchface.util.DigitalWatchFaceUtil;
-import com.example.android.wearable.watchface.R;
-
 /**
  * The watch-side config activity for {@link DigitalWatchFaceService}, which allows for setting the
  * background color.
diff --git a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/model/AnalogComplicationConfigData.java b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/model/AnalogComplicationConfigData.java
index 067a3cd..324fe82 100644
--- a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/model/AnalogComplicationConfigData.java
+++ b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/model/AnalogComplicationConfigData.java
@@ -17,13 +17,14 @@
 
 import android.content.Context;
 import android.graphics.Color;
-import android.support.v7.widget.RecyclerView.ViewHolder;
-import android.support.v7.widget.RecyclerView;
+
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.recyclerview.widget.RecyclerView.ViewHolder;
 
 import com.example.android.wearable.watchface.R;
+import com.example.android.wearable.watchface.config.AnalogComplicationConfigActivity;
 import com.example.android.wearable.watchface.config.AnalogComplicationConfigRecyclerViewAdapter;
 import com.example.android.wearable.watchface.config.ColorSelectionActivity;
-import com.example.android.wearable.watchface.config.AnalogComplicationConfigActivity;
 import com.example.android.wearable.watchface.watchface.AnalogComplicationWatchFaceService;
 
 import java.util.ArrayList;
diff --git a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/watchface/DigitalWatchFaceService.java b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/watchface/DigitalWatchFaceService.java
index 6392b5a..5b9472f 100644
--- a/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/watchface/DigitalWatchFaceService.java
+++ b/wearable/wear/WatchFace/Wearable/src/main/java/com/example/android/wearable/watchface/watchface/DigitalWatchFaceService.java
@@ -28,7 +28,6 @@
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
-import android.support.v4.content.ContextCompat;
 import android.support.wearable.watchface.CanvasWatchFaceService;
 import android.support.wearable.watchface.WatchFaceService;
 import android.support.wearable.watchface.WatchFaceStyle;
@@ -37,6 +36,10 @@
 import android.view.SurfaceHolder;
 import android.view.WindowInsets;
 
+import androidx.core.content.ContextCompat;
+
+import com.example.android.wearable.watchface.R;
+import com.example.android.wearable.watchface.util.DigitalWatchFaceUtil;
 import com.google.android.gms.common.ConnectionResult;
 import com.google.android.gms.common.api.GoogleApiClient;
 import com.google.android.gms.wearable.DataApi;
@@ -47,9 +50,6 @@
 import com.google.android.gms.wearable.DataMapItem;
 import com.google.android.gms.wearable.Wearable;
 
-import com.example.android.wearable.watchface.util.DigitalWatchFaceUtil;
-import com.example.android.wearable.watchface.R;
-
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
diff --git a/wearable/wear/WatchFace/Wearable/src/main/res/layout/activity_analog_complication_config.xml b/wearable/wear/WatchFace/Wearable/src/main/res/layout/activity_analog_complication_config.xml
index dea517e..708af82 100644
--- a/wearable/wear/WatchFace/Wearable/src/main/res/layout/activity_analog_complication_config.xml
+++ b/wearable/wear/WatchFace/Wearable/src/main/res/layout/activity_analog_complication_config.xml
@@ -21,7 +21,7 @@
     android:background="@color/dark_grey"
     android:paddingStart="@dimen/activity_config_padding"
     android:paddingEnd="@dimen/activity_config_padding">
-    <android.support.wear.widget.WearableRecyclerView
+    <androidx.wear.widget.WearableRecyclerView
         android:id="@+id/wearable_recycler_view"
         android:layout_height="wrap_content"
         android:layout_width="match_parent" />
diff --git a/wearable/wear/WatchFace/Wearable/src/main/res/layout/activity_color_selection_config.xml b/wearable/wear/WatchFace/Wearable/src/main/res/layout/activity_color_selection_config.xml
index 8780ca3..0ec2406 100644
--- a/wearable/wear/WatchFace/Wearable/src/main/res/layout/activity_color_selection_config.xml
+++ b/wearable/wear/WatchFace/Wearable/src/main/res/layout/activity_color_selection_config.xml
@@ -23,7 +23,7 @@
     android:paddingLeft="@dimen/activity_horizontal_margin"
     android:paddingRight="@dimen/activity_horizontal_margin"
     tools:context="com.example.android.wearable.watchface.config.ColorSelectionActivity">
-    <android.support.wear.widget.WearableRecyclerView
+    <androidx.wear.widget.WearableRecyclerView
         android:id="@+id/wearable_recycler_view"
         android:layout_height="wrap_content"
         android:layout_width="match_parent" />
diff --git a/wearable/wear/WatchFace/Wearable/src/main/res/layout/activity_digital_config.xml b/wearable/wear/WatchFace/Wearable/src/main/res/layout/activity_digital_config.xml
index 9ec9949..e32839c 100644
--- a/wearable/wear/WatchFace/Wearable/src/main/res/layout/activity_digital_config.xml
+++ b/wearable/wear/WatchFace/Wearable/src/main/res/layout/activity_digital_config.xml
@@ -13,7 +13,7 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-<android.support.wear.widget.BoxInsetLayout
+<androidx.wear.widget.BoxInsetLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:id="@+id/content"
@@ -37,4 +37,4 @@
         android:layout_height="match_parent"
         android:background="@android:color/transparent"
         app:boxedEdges="left|right"/>
-</android.support.wear.widget.BoxInsetLayout>
+</androidx.wear.widget.BoxInsetLayout>
diff --git a/wearable/wear/WatchFace/gradle.properties b/wearable/wear/WatchFace/gradle.properties
index 0bc4294..94f8472 100644
--- a/wearable/wear/WatchFace/gradle.properties
+++ b/wearable/wear/WatchFace/gradle.properties
@@ -18,3 +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
diff --git a/wearable/wear/WatchFace/template-params.xml b/wearable/wear/WatchFace/template-params.xml
index 981bd16..8bf7761 100644
--- a/wearable/wear/WatchFace/template-params.xml
+++ b/wearable/wear/WatchFace/template-params.xml
@@ -31,11 +31,17 @@
 
     <multiDexEnabled>true</multiDexEnabled>
 
+    <androidX>true</androidX>
 
+    <dependency>androidx.legacy:legacy-support-v4:1.0.0</dependency>
+    <dependency>androidx.legacy:legacy-support-v13:1.0.0</dependency>
+    <dependency>androidx.cardview:cardview:1.0.0</dependency>
+    <dependency>androidx.appcompat:appcompat:1.0.2</dependency>
     <dependency>com.google.android.support:wearable:2.4.0</dependency>
-    <dependency_wearable>com.android.support:palette-v7:28.0.0</dependency_wearable>
-    <dependency_wearable>com.android.support:wear:28.0.0</dependency_wearable>
 
+    <dependency_wearable>androidx.palette:palette:1.0.0</dependency_wearable>
+    <dependency_wearable>androidx.wear:wear:1.0.0</dependency_wearable>
+    <dependency_wearable>androidx.legacy:legacy-support-v13:1.0.0</dependency_wearable>
 
     <wearable>
         <has_handheld_app>true</has_handheld_app>