DataLayer: Updates Wear apps for migration to new devrel repo.

Bug: 129548613
Test: Manually tested.

Change-Id: I0c71750f79bd771dab8d7a9674e2af5422c0abf7
diff --git a/wearable/wear/DataLayer/Application/src/main/AndroidManifest.xml b/wearable/wear/DataLayer/Application/src/main/AndroidManifest.xml
index ed1cec3..33e7bdb 100644
--- a/wearable/wear/DataLayer/Application/src/main/AndroidManifest.xml
+++ b/wearable/wear/DataLayer/Application/src/main/AndroidManifest.xml
@@ -17,9 +17,6 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
         package="com.example.android.wearable.datalayer" >
 
-    <uses-sdk android:minSdkVersion="18"
-              android:targetSdkVersion="23" />
-
     <uses-feature android:name="android.hardware.camera" android:required="false" />
 
     <application
diff --git a/wearable/wear/DataLayer/Application/src/main/java/com/example/android/wearable/datalayer/MainActivity.java b/wearable/wear/DataLayer/Application/src/main/java/com/example/android/wearable/datalayer/MainActivity.java
index 7673d44..014a3b3 100644
--- a/wearable/wear/DataLayer/Application/src/main/java/com/example/android/wearable/datalayer/MainActivity.java
+++ b/wearable/wear/DataLayer/Application/src/main/java/com/example/android/wearable/datalayer/MainActivity.java
@@ -25,7 +25,6 @@
 import android.os.AsyncTask;
 import android.os.Bundle;
 import android.provider.MediaStore;
-import android.support.annotation.WorkerThread;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -36,6 +35,8 @@
 import android.widget.ListView;
 import android.widget.TextView;
 
+import androidx.annotation.WorkerThread;
+
 import com.google.android.gms.tasks.OnSuccessListener;
 import com.google.android.gms.tasks.Task;
 import com.google.android.gms.tasks.Tasks;
diff --git a/wearable/wear/DataLayer/Wearable/src/main/AndroidManifest.xml b/wearable/wear/DataLayer/Wearable/src/main/AndroidManifest.xml
index 5e967aa..94afe42 100644
--- a/wearable/wear/DataLayer/Wearable/src/main/AndroidManifest.xml
+++ b/wearable/wear/DataLayer/Wearable/src/main/AndroidManifest.xml
@@ -17,8 +17,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
         package="com.example.android.wearable.datalayer" >
 
-    <uses-sdk android:minSdkVersion="23"
-              android:targetSdkVersion="26" />
+    <uses-permission android:name="android.permission.WAKE_LOCK" />
 
     <uses-feature android:name="android.hardware.type.watch" />
 
diff --git a/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/CustomRecyclerAdapter.java b/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/CustomRecyclerAdapter.java
index 2e46eea..4672e07 100644
--- a/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/CustomRecyclerAdapter.java
+++ b/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/CustomRecyclerAdapter.java
@@ -20,10 +20,6 @@
 import static com.example.android.wearable.datalayer.DataLayerScreen.TYPE_IMAGE_ASSET;
 
 import android.graphics.Bitmap;
-import android.support.annotation.NonNull;
-import android.support.v7.widget.RecyclerView;
-import android.support.v7.widget.RecyclerView.ViewHolder;
-import android.support.wear.widget.WearableRecyclerView;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -31,6 +27,11 @@
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.recyclerview.widget.RecyclerView.ViewHolder;
+import androidx.wear.widget.WearableRecyclerView;
+
 import com.example.android.wearable.datalayer.DataLayerScreen.DataLayerScreenData;
 import com.example.android.wearable.datalayer.DataLayerScreen.EventLoggingData;
 import com.example.android.wearable.datalayer.DataLayerScreen.ImageAssetData;
diff --git a/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/DataLayerScreen.java b/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/DataLayerScreen.java
index 23f444e..ed6388c 100644
--- a/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/DataLayerScreen.java
+++ b/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/DataLayerScreen.java
@@ -16,7 +16,8 @@
 package com.example.android.wearable.datalayer;
 
 import android.graphics.Bitmap;
-import android.support.v7.widget.RecyclerView.ViewHolder;
+
+import androidx.recyclerview.widget.RecyclerView.ViewHolder;
 
 /**
  * Classes representing data used for each custom {@link ViewHolder} in {@link
diff --git a/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/MainActivity.java b/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/MainActivity.java
index d212e51..e275f2b 100644
--- a/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/MainActivity.java
+++ b/wearable/wear/DataLayer/Wearable/src/main/java/com/example/android/wearable/datalayer/MainActivity.java
@@ -22,17 +22,22 @@
 import android.net.Uri;
 import android.os.AsyncTask;
 import android.os.Bundle;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.content.res.ResourcesCompat;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.RecyclerView;
-import android.support.wear.ambient.AmbientModeSupport;
-import android.support.wear.widget.WearableRecyclerView;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
 import android.widget.Toast;
 
+import androidx.core.content.res.ResourcesCompat;
+import androidx.fragment.app.FragmentActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.wear.ambient.AmbientModeSupport;
+import androidx.wear.widget.WearableRecyclerView;
+
+import com.example.android.wearable.datalayer.DataLayerScreen.CapabilityDiscoveryData;
+import com.example.android.wearable.datalayer.DataLayerScreen.DataLayerScreenData;
+import com.example.android.wearable.datalayer.DataLayerScreen.EventLoggingData;
+import com.example.android.wearable.datalayer.DataLayerScreen.ImageAssetData;
 import com.google.android.gms.tasks.OnSuccessListener;
 import com.google.android.gms.tasks.Task;
 import com.google.android.gms.tasks.Tasks;
@@ -48,11 +53,6 @@
 import com.google.android.gms.wearable.Node;
 import com.google.android.gms.wearable.Wearable;
 
-import com.example.android.wearable.datalayer.DataLayerScreen.CapabilityDiscoveryData;
-import com.example.android.wearable.datalayer.DataLayerScreen.DataLayerScreenData;
-import com.example.android.wearable.datalayer.DataLayerScreen.EventLoggingData;
-import com.example.android.wearable.datalayer.DataLayerScreen.ImageAssetData;
-
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.HashSet;
diff --git a/wearable/wear/DataLayer/Wearable/src/main/res/layout/main_activity.xml b/wearable/wear/DataLayer/Wearable/src/main/res/layout/main_activity.xml
index a7a3430..57f176f 100644
--- a/wearable/wear/DataLayer/Wearable/src/main/res/layout/main_activity.xml
+++ b/wearable/wear/DataLayer/Wearable/src/main/res/layout/main_activity.xml
@@ -19,10 +19,10 @@
                 android:background="@color/white">
 
 
-    <android.support.wear.widget.WearableRecyclerView
+    <androidx.wear.widget.WearableRecyclerView
         android:id="@+id/recycler_view"
         android:layout_width="match_parent"
         android:layout_height="match_parent">
 
-    </android.support.wear.widget.WearableRecyclerView>
+    </androidx.wear.widget.WearableRecyclerView>
 </RelativeLayout>
diff --git a/wearable/wear/DataLayer/Wearable/src/main/res/layout/recycler_row_event_logging.xml b/wearable/wear/DataLayer/Wearable/src/main/res/layout/recycler_row_event_logging.xml
index e010d96..7cf2fa1 100644
--- a/wearable/wear/DataLayer/Wearable/src/main/res/layout/recycler_row_event_logging.xml
+++ b/wearable/wear/DataLayer/Wearable/src/main/res/layout/recycler_row_event_logging.xml
@@ -14,7 +14,7 @@
      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/layout"
@@ -42,4 +42,4 @@
             android:layout_height="match_parent"
             android:transcriptMode="alwaysScroll"/>
     </FrameLayout>
-</android.support.wear.widget.BoxInsetLayout>
+</androidx.wear.widget.BoxInsetLayout>
diff --git a/wearable/wear/DataLayer/gradle.properties b/wearable/wear/DataLayer/gradle.properties
index 0bc4294..94f8472 100644
--- a/wearable/wear/DataLayer/gradle.properties
+++ b/wearable/wear/DataLayer/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/DataLayer/template-params.xml b/wearable/wear/DataLayer/template-params.xml
index 8475001..9aee449 100644
--- a/wearable/wear/DataLayer/template-params.xml
+++ b/wearable/wear/DataLayer/template-params.xml
@@ -25,13 +25,21 @@
 
     <multiDexEnabled>true</multiDexEnabled>
 
-    <dependency>com.android.support:recyclerview-v7:27.1.1</dependency>
-    <dependency>com.android.support:percent:27.1.1</dependency>
+    <androidX>true</androidX>
 
-    <dependency_wearable>com.android.support:wear:27.1.1</dependency_wearable>
+    <dependency>androidx.legacy:legacy-support-v4:1.0.0</dependency>
+    <dependency>androidx.legacy:legacy-support-v13:1.0.0</dependency>
 
-    <dependency_wearable>com.android.support:recyclerview-v7:27.1.1</dependency_wearable>
-    <dependency_wearable>com.android.support:percent:27.1.1</dependency_wearable>
+    <dependency>androidx.cardview:cardview:1.0.0</dependency>
+    <dependency>androidx.appcompat:appcompat:1.0.2</dependency>
+    <dependency>androidx.recyclerview:recyclerview:1.0.0</dependency>
+    <dependency>androidx.percentlayout:percentlayout:1.0.0</dependency>
+
+    <dependency_wearable>androidx.wear:wear:1.0.0</dependency_wearable>
+    <dependency_wearable>androidx.recyclerview:recyclerview:1.0.0</dependency_wearable>
+    <dependency_wearable>androidx.percentlayout:percentlayout: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>