XYZ Upgrades to androidx.

Bug: 129548613
Test: Manually tested.
Change-Id: I7316fd2b37fed902a2d9dfa91d7f5152d2814164
diff --git a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/service/ListenerService.java b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/service/ListenerService.java
index c8a5790..5ca339d 100644
--- a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/service/ListenerService.java
+++ b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/service/ListenerService.java
@@ -20,10 +20,10 @@
 import android.net.Uri;
 import android.util.Log;
 
+import com.example.android.xyztouristattractions.common.Constants;
 import com.example.android.xyztouristattractions.ui.DetailActivity;
 import com.google.android.gms.wearable.MessageEvent;
 import com.google.android.gms.wearable.WearableListenerService;
-import com.example.android.xyztouristattractions.common.Constants;
 
 /**
  * A Wear listener service, used to receive inbound messages from
diff --git a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/service/UtilityReceiver.java b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/service/UtilityReceiver.java
index 0a10ba2..ca673a9 100644
--- a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/service/UtilityReceiver.java
+++ b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/service/UtilityReceiver.java
@@ -18,7 +18,8 @@
 
 import android.content.Context;
 import android.content.Intent;
-import android.support.v4.content.WakefulBroadcastReceiver;
+
+import androidx.legacy.content.WakefulBroadcastReceiver;
 
 /**
  * A simply utility receiver used to ensure the device stays awake for the
diff --git a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/service/UtilityService.java b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/service/UtilityService.java
index 07e36f7..05337e9 100644
--- a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/service/UtilityService.java
+++ b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/service/UtilityService.java
@@ -24,12 +24,17 @@
 import android.content.IntentFilter;
 import android.graphics.Bitmap;
 import android.location.Location;
-import android.support.v4.app.NotificationCompat;
-import android.support.v4.app.NotificationManagerCompat;
-import android.support.v4.content.ContextCompat;
-import android.support.v4.content.LocalBroadcastManager;
 import android.util.Log;
 
+import androidx.core.app.NotificationCompat;
+import androidx.core.app.NotificationManagerCompat;
+import androidx.core.content.ContextCompat;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
+
+import static com.example.android.xyztouristattractions.provider.TouristAttractions.ATTRACTIONS;
+import static com.google.android.gms.location.LocationServices.FusedLocationApi;
+import static com.google.android.gms.location.LocationServices.GeofencingApi;
+
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.engine.DiskCacheStrategy;
 import com.example.android.xyztouristattractions.R;
@@ -60,10 +65,6 @@
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 
-import static com.example.android.xyztouristattractions.provider.TouristAttractions.ATTRACTIONS;
-import static com.google.android.gms.location.LocationServices.FusedLocationApi;
-import static com.google.android.gms.location.LocationServices.GeofencingApi;
-
 /**
  * A utility IntentService, used for a variety of asynchronous background
  * operations that do not necessarily need to be tied to a UI.
diff --git a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/AttractionListActivity.java b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/AttractionListActivity.java
index 8c23f3d..5a9df8f 100644
--- a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/AttractionListActivity.java
+++ b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/AttractionListActivity.java
@@ -19,18 +19,19 @@
 import android.Manifest;
 import android.content.pm.PackageManager;
 import android.os.Bundle;
-import android.support.design.widget.Snackbar;
-import android.support.v4.app.ActivityCompat;
-import android.support.v7.app.AlertDialog;
-import android.support.v7.app.AppCompatActivity;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
 import android.widget.Toast;
 
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.app.ActivityCompat;
+
 import com.example.android.xyztouristattractions.R;
 import com.example.android.xyztouristattractions.common.Utils;
 import com.example.android.xyztouristattractions.service.UtilityService;
+import com.google.android.material.snackbar.Snackbar;
 
 /**
  * The main tourist attraction activity screen which contains a list of
diff --git a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/AttractionListFragment.java b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/AttractionListFragment.java
index 71439b1..240bab2 100644
--- a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/AttractionListFragment.java
+++ b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/AttractionListFragment.java
@@ -21,9 +21,6 @@
 import android.content.Intent;
 import android.location.Location;
 import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v4.content.LocalBroadcastManager;
-import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -31,6 +28,12 @@
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import androidx.fragment.app.Fragment;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import static com.example.android.xyztouristattractions.provider.TouristAttractions.ATTRACTIONS;
+
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.engine.DiskCacheStrategy;
 import com.example.android.xyztouristattractions.R;
@@ -47,8 +50,6 @@
 import java.util.Comparator;
 import java.util.List;
 
-import static com.example.android.xyztouristattractions.provider.TouristAttractions.ATTRACTIONS;
-
 /**
  * The main tourist attraction fragment which contains a list of attractions
  * sorted by distance (contained inside
diff --git a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/AttractionsRecyclerView.java b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/AttractionsRecyclerView.java
index cca3bf1..67516f3 100644
--- a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/AttractionsRecyclerView.java
+++ b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/AttractionsRecyclerView.java
@@ -17,10 +17,11 @@
 package com.example.android.xyztouristattractions.ui;
 
 import android.content.Context;
-import android.support.v7.widget.RecyclerView;
 import android.util.AttributeSet;
 import android.view.View;
 
+import androidx.recyclerview.widget.RecyclerView;
+
 /**
  * Simple RecyclerView subclass that supports providing an empty view (which
  * is displayed when the adapter has no data and hidden otherwise).
diff --git a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/DetailActivity.java b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/DetailActivity.java
index 3950785..612002a 100644
--- a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/DetailActivity.java
+++ b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/DetailActivity.java
@@ -22,11 +22,12 @@
 import android.content.Intent;
 import android.os.Build;
 import android.os.Bundle;
-import android.support.v4.app.ActivityCompat;
-import android.support.v4.app.ActivityOptionsCompat;
-import android.support.v7.app.AppCompatActivity;
 import android.view.View;
 
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.app.ActivityCompat;
+import androidx.core.app.ActivityOptionsCompat;
+
 import com.example.android.xyztouristattractions.R;
 
 /**
diff --git a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/DetailFragment.java b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/DetailFragment.java
index 1ab7326..d5adb20 100644
--- a/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/DetailFragment.java
+++ b/wearable/wear/XYZTouristAttractions/Application/src/main/java/com/example/android/xyztouristattractions/ui/DetailFragment.java
@@ -21,9 +21,6 @@
 import android.net.Uri;
 import android.os.Build;
 import android.os.Bundle;
-import android.support.design.widget.FloatingActionButton;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.NavUtils;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.MenuItem;
@@ -32,6 +29,11 @@
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import androidx.core.app.NavUtils;
+import androidx.fragment.app.Fragment;
+
+import static com.example.android.xyztouristattractions.provider.TouristAttractions.ATTRACTIONS;
+
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.load.engine.DiskCacheStrategy;
 import com.example.android.xyztouristattractions.R;
@@ -39,12 +41,11 @@
 import com.example.android.xyztouristattractions.common.Constants;
 import com.example.android.xyztouristattractions.common.Utils;
 import com.google.android.gms.maps.model.LatLng;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
 
 import java.util.List;
 import java.util.Map;
 
-import static com.example.android.xyztouristattractions.provider.TouristAttractions.ATTRACTIONS;
-
 /**
  * The tourist attraction detail fragment which contains the details of a
  * a single attraction (contained inside
diff --git a/wearable/wear/XYZTouristAttractions/Application/src/main/res/layout/activity_main.xml b/wearable/wear/XYZTouristAttractions/Application/src/main/res/layout/activity_main.xml
index 17c9f66..0406eeb 100644
--- a/wearable/wear/XYZTouristAttractions/Application/src/main/res/layout/activity_main.xml
+++ b/wearable/wear/XYZTouristAttractions/Application/src/main/res/layout/activity_main.xml
@@ -14,7 +14,7 @@
   limitations under the License.
   -->
 
-<android.support.design.widget.CoordinatorLayout
+<androidx.coordinatorlayout.widget.CoordinatorLayout
 
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
@@ -23,4 +23,4 @@
     android:layout_height="match_parent"
     tools:context=".MainActivity">
 
-</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
diff --git a/wearable/wear/XYZTouristAttractions/Application/src/main/res/layout/fragment_detail.xml b/wearable/wear/XYZTouristAttractions/Application/src/main/res/layout/fragment_detail.xml
index 6e280fd..0cbc1fd 100644
--- a/wearable/wear/XYZTouristAttractions/Application/src/main/res/layout/fragment_detail.xml
+++ b/wearable/wear/XYZTouristAttractions/Application/src/main/res/layout/fragment_detail.xml
@@ -16,7 +16,7 @@
   limitations under the License.
   -->
 
-<android.support.design.widget.CoordinatorLayout
+<androidx.coordinatorlayout.widget.CoordinatorLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
@@ -87,7 +87,7 @@
 
     </LinearLayout>
 
-    <android.support.design.widget.FloatingActionButton
+    <com.google.android.material.floatingactionbutton.FloatingActionButton
         android:id="@+id/mapFab"
         android:layout_height="wrap_content"
         android:layout_width="wrap_content"
@@ -98,4 +98,4 @@
         android:layout_marginStart="@dimen/fab_margin"
         android:clickable="true" />
 
-</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
diff --git a/wearable/wear/XYZTouristAttractions/Shared/src/main/java/com/example/android/xyztouristattractions/common/Utils.java b/wearable/wear/XYZTouristAttractions/Shared/src/main/java/com/example/android/xyztouristattractions/common/Utils.java
index 6fa5129..f11abec 100644
--- a/wearable/wear/XYZTouristAttractions/Shared/src/main/java/com/example/android/xyztouristattractions/common/Utils.java
+++ b/wearable/wear/XYZTouristAttractions/Shared/src/main/java/com/example/android/xyztouristattractions/common/Utils.java
@@ -25,10 +25,11 @@
 import android.graphics.Point;
 import android.graphics.Rect;
 import android.preference.PreferenceManager;
-import android.support.v4.content.ContextCompat;
 import android.util.Log;
 import android.view.Display;
 
+import androidx.core.content.ContextCompat;
+
 import com.google.android.gms.common.api.GoogleApiClient;
 import com.google.android.gms.maps.model.LatLng;
 import com.google.android.gms.wearable.Asset;
diff --git a/wearable/wear/XYZTouristAttractions/Wearable/src/main/java/com/example/android/xyztouristattractions/service/ListenerService.java b/wearable/wear/XYZTouristAttractions/Wearable/src/main/java/com/example/android/xyztouristattractions/service/ListenerService.java
index ea071f0..f629781 100644
--- a/wearable/wear/XYZTouristAttractions/Wearable/src/main/java/com/example/android/xyztouristattractions/service/ListenerService.java
+++ b/wearable/wear/XYZTouristAttractions/Wearable/src/main/java/com/example/android/xyztouristattractions/service/ListenerService.java
@@ -21,10 +21,11 @@
 import android.content.Intent;
 import android.graphics.Bitmap;
 import android.net.Uri;
-import android.support.v4.app.NotificationCompat;
-import android.support.v4.app.NotificationManagerCompat;
 import android.util.Log;
 
+import androidx.core.app.NotificationCompat;
+import androidx.core.app.NotificationManagerCompat;
+
 import com.example.android.xyztouristattractions.R;
 import com.example.android.xyztouristattractions.common.Constants;
 import com.example.android.xyztouristattractions.common.Utils;
diff --git a/wearable/wear/XYZTouristAttractions/Wearable/src/main/java/com/example/android/xyztouristattractions/ui/AttractionsActivity.java b/wearable/wear/XYZTouristAttractions/Wearable/src/main/java/com/example/android/xyztouristattractions/ui/AttractionsActivity.java
index 64d28bc..8642226 100644
--- a/wearable/wear/XYZTouristAttractions/Wearable/src/main/java/com/example/android/xyztouristattractions/ui/AttractionsActivity.java
+++ b/wearable/wear/XYZTouristAttractions/Wearable/src/main/java/com/example/android/xyztouristattractions/ui/AttractionsActivity.java
@@ -22,7 +22,6 @@
 import android.net.Uri;
 import android.os.AsyncTask;
 import android.os.Bundle;
-import android.support.v4.view.GestureDetectorCompat;
 import android.support.wearable.view.DismissOverlayView;
 import android.support.wearable.view.DotsPageIndicator;
 import android.support.wearable.view.GridViewPager;
@@ -34,6 +33,8 @@
 import android.widget.FrameLayout;
 import android.widget.ProgressBar;
 
+import androidx.core.view.GestureDetectorCompat;
+
 import com.example.android.xyztouristattractions.R;
 import com.example.android.xyztouristattractions.common.Attraction;
 import com.example.android.xyztouristattractions.common.Constants;
diff --git a/wearable/wear/XYZTouristAttractions/gradle.properties b/wearable/wear/XYZTouristAttractions/gradle.properties
index 0bc4294..94f8472 100644
--- a/wearable/wear/XYZTouristAttractions/gradle.properties
+++ b/wearable/wear/XYZTouristAttractions/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/XYZTouristAttractions/template-params.xml b/wearable/wear/XYZTouristAttractions/template-params.xml
index d505fe8..801b839 100644
--- a/wearable/wear/XYZTouristAttractions/template-params.xml
+++ b/wearable/wear/XYZTouristAttractions/template-params.xml
@@ -28,21 +28,28 @@
         <has_handheld_app>true</has_handheld_app>
     </wearable>
 
+    <androidX>true</androidX>
 
     <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: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>androidx.appcompat:appcompat:1.0.2</dependency>
+    <dependency>androidx.legacy:legacy-support-v13:1.0.0</dependency>
+    <dependency>androidx.recyclerview:recyclerview:1.0.0</dependency>
+    <dependency>com.google.android.material:material:1.0.0</dependency>
+
+    <dependency>com.google.android.gms:play-services-maps:16.1.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>androidx.legacy:legacy-support-v13:1.0.0</dependency_shared>
+    <dependency_shared>com.google.android.gms:play-services-wearable:16.0.1</dependency_shared>
+    <dependency_shared>com.google.android.gms:play-services-maps:16.1.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>
+
+    <dependency_wearable>androidx.wear:wear:1.0.0</dependency_wearable>
+    <dependency_wearable>androidx.legacy:legacy-support-v13:1.0.0</dependency_wearable>
+    <dependency_wearable>com.google.android.gms:play-services-maps:16.1.0</dependency_wearable>
 
 
     <strings>