Move Gallery2 to androidx.

Bug: 76692459
Test: make -j Gallery2 and run on emulator
Change-Id: Ife6a5649c21464f404db3198bd6a4ba8aa901ee8
diff --git a/Android.mk b/Android.mk
index 9519c72..531a423 100644
--- a/Android.mk
+++ b/Android.mk
@@ -8,11 +8,11 @@
 
 LOCAL_STATIC_ANDROID_LIBRARIES := \
     $(ANDROID_SUPPORT_DESIGN_TARGETS) \
+    androidx.fragment_fragment \
     androidx.heifwriter_heifwriter \
-    android-support-fragment \
-    android-support-core-ui \
-    android-support-compat \
-    android-support-v13
+    androidx.legacy_legacy-support-core-ui \
+    androidx.core_core \
+    androidx.legacy_legacy-support-v13
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     org.codeaurora.gallery.common \
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index c79d976..18b83ca 100755
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -329,7 +329,7 @@
                 android:syncable="false"
                 android:exported="false"/>
         <provider
-            android:name="android.support.v4.content.FileProvider"
+            android:name="androidx.core.content.FileProvider"
             android:authorities="com.android.gallery3d.fileprovider"
             android:exported="false"
             android:grantUriPermissions="true">
diff --git a/res/layout/ingest_activity_item_list.xml b/res/layout/ingest_activity_item_list.xml
index b91f0ce..2d14684 100644
--- a/res/layout/ingest_activity_item_list.xml
+++ b/res/layout/ingest_activity_item_list.xml
@@ -25,7 +25,7 @@
         android:choiceMode="multipleChoiceModal"
         android:stretchMode="columnWidth"  />
 
-    <android.support.v4.view.ViewPager
+    <androidx.viewpager.widget.ViewPager
         android:id="@+id/ingest_view_pager"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
diff --git a/src/com/android/gallery3d/app/AbstractGalleryActivity.java b/src/com/android/gallery3d/app/AbstractGalleryActivity.java
index 4c085f2..ef9e600 100755
--- a/src/com/android/gallery3d/app/AbstractGalleryActivity.java
+++ b/src/com/android/gallery3d/app/AbstractGalleryActivity.java
@@ -32,7 +32,7 @@
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.IBinder;
-import android.support.v4.print.PrintHelper;
+import androidx.print.PrintHelper;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.WindowManager;
diff --git a/src/com/android/gallery3d/app/AbstractPermissionActivity.java b/src/com/android/gallery3d/app/AbstractPermissionActivity.java
index f193e7f..9e7e5ca 100644
--- a/src/com/android/gallery3d/app/AbstractPermissionActivity.java
+++ b/src/com/android/gallery3d/app/AbstractPermissionActivity.java
@@ -33,7 +33,7 @@
 import android.content.pm.PackageManager;
 import android.os.Build;
 import android.os.Bundle;
-import android.support.v4.app.FragmentActivity;
+import androidx.fragment.app.FragmentActivity;
 
 import java.util.ArrayList;
 
diff --git a/src/com/android/gallery3d/app/GalleryActivity.java b/src/com/android/gallery3d/app/GalleryActivity.java
index 0489237..57c0db3 100755
--- a/src/com/android/gallery3d/app/GalleryActivity.java
+++ b/src/com/android/gallery3d/app/GalleryActivity.java
@@ -31,8 +31,7 @@
 import android.net.Uri;
 import android.os.Bundle;
 import android.support.design.widget.BottomNavigationView;
-import android.support.v4.widget.DrawerLayout;
-import android.support.v4.widget.DrawerLayout.DrawerListener;
+import androidx.drawerlayout.widget.DrawerLayout;
 import android.text.TextUtils;
 import android.util.Log;
 import android.view.Gravity;
diff --git a/src/com/android/gallery3d/app/MuteVideo.java b/src/com/android/gallery3d/app/MuteVideo.java
index 3b42267..7f50c9c 100755
--- a/src/com/android/gallery3d/app/MuteVideo.java
+++ b/src/com/android/gallery3d/app/MuteVideo.java
@@ -30,7 +30,7 @@
 import com.android.gallery3d.data.MediaItem;
 import com.android.gallery3d.util.SaveVideoFileInfo;
 import com.android.gallery3d.util.SaveVideoFileUtils;
-import android.support.v4.content.FileProvider;
+import androidx.core.content.FileProvider;
 
 import java.io.IOException;
 
diff --git a/src/com/android/gallery3d/app/TrimVideo.java b/src/com/android/gallery3d/app/TrimVideo.java
index 8daf398..527f6cf 100755
--- a/src/com/android/gallery3d/app/TrimVideo.java
+++ b/src/com/android/gallery3d/app/TrimVideo.java
@@ -35,7 +35,7 @@
 import android.widget.TextView;
 import android.widget.Toast;
 import android.widget.VideoView;
-import android.support.v4.content.FileProvider;
+import androidx.core.content.FileProvider;
 
 import org.codeaurora.gallery.R;
 import com.android.gallery3d.util.SaveVideoFileInfo;
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index 5b1aa84..143a546 100755
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -54,10 +54,10 @@
 import android.os.IBinder;
 import android.os.Message;
 import android.provider.MediaStore;
-import android.support.v4.app.DialogFragment;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentTransaction;
-import android.support.v4.print.PrintHelper;
+import androidx.fragment.app.DialogFragment;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentTransaction;
+import androidx.print.PrintHelper;
 import android.util.DisplayMetrics;
 import android.util.Log;
 import android.util.TypedValue;
diff --git a/src/com/android/gallery3d/filtershow/category/BasicGeometryPanel.java b/src/com/android/gallery3d/filtershow/category/BasicGeometryPanel.java
index 466ecd8..d27954b 100644
--- a/src/com/android/gallery3d/filtershow/category/BasicGeometryPanel.java
+++ b/src/com/android/gallery3d/filtershow/category/BasicGeometryPanel.java
@@ -32,7 +32,7 @@
 
 import android.content.res.Configuration;
 import android.os.Bundle;
-import android.support.v4.app.Fragment;
+import androidx.fragment.app.Fragment;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
diff --git a/src/com/android/gallery3d/filtershow/category/BottomPanel.java b/src/com/android/gallery3d/filtershow/category/BottomPanel.java
index cd4f657..5886cc9 100644
--- a/src/com/android/gallery3d/filtershow/category/BottomPanel.java
+++ b/src/com/android/gallery3d/filtershow/category/BottomPanel.java
@@ -30,7 +30,7 @@
 package com.android.gallery3d.filtershow.category;
 
 import android.os.Bundle;
-import android.support.v4.app.Fragment;
+import androidx.fragment.app.Fragment;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
diff --git a/src/com/android/gallery3d/filtershow/category/CategoryPanel.java b/src/com/android/gallery3d/filtershow/category/CategoryPanel.java
index 26c1dc3..f8669dc 100644
--- a/src/com/android/gallery3d/filtershow/category/CategoryPanel.java
+++ b/src/com/android/gallery3d/filtershow/category/CategoryPanel.java
@@ -19,7 +19,7 @@
 import android.app.Activity;
 import android.graphics.Rect;
 import android.os.Bundle;
-import android.support.v4.app.Fragment;
+import androidx.fragment.app.Fragment;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
diff --git a/src/com/android/gallery3d/filtershow/category/MainPanel.java b/src/com/android/gallery3d/filtershow/category/MainPanel.java
index cf5d2ed..505f556 100755
--- a/src/com/android/gallery3d/filtershow/category/MainPanel.java
+++ b/src/com/android/gallery3d/filtershow/category/MainPanel.java
@@ -21,8 +21,8 @@
 import android.content.DialogInterface;
 import android.os.AsyncTask;
 import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentTransaction;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentTransaction;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
diff --git a/src/com/android/gallery3d/filtershow/category/TruePortraitMaskEditorPanel.java b/src/com/android/gallery3d/filtershow/category/TruePortraitMaskEditorPanel.java
index b117e21..891966c 100644
--- a/src/com/android/gallery3d/filtershow/category/TruePortraitMaskEditorPanel.java
+++ b/src/com/android/gallery3d/filtershow/category/TruePortraitMaskEditorPanel.java
@@ -32,9 +32,9 @@
 
 import android.content.Context;
 import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -101,4 +101,4 @@
         }
         super.onDetach();
     }
-}
\ No newline at end of file
+}
diff --git a/src/com/android/gallery3d/filtershow/editors/EditorDualCamFusion.java b/src/com/android/gallery3d/filtershow/editors/EditorDualCamFusion.java
index f298b75..ec6c8ae 100644
--- a/src/com/android/gallery3d/filtershow/editors/EditorDualCamFusion.java
+++ b/src/com/android/gallery3d/filtershow/editors/EditorDualCamFusion.java
@@ -32,8 +32,8 @@
 import android.content.Context;
 import android.content.DialogInterface;
 import android.net.Uri;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.View;
diff --git a/src/com/android/gallery3d/filtershow/editors/EditorPanel.java b/src/com/android/gallery3d/filtershow/editors/EditorPanel.java
index 00c0aa7..a604e02 100644
--- a/src/com/android/gallery3d/filtershow/editors/EditorPanel.java
+++ b/src/com/android/gallery3d/filtershow/editors/EditorPanel.java
@@ -18,8 +18,8 @@
 
 import android.app.Activity;
 import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentTransaction;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentTransaction;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.Menu;
diff --git a/src/com/android/gallery3d/filtershow/editors/EditorTruePortraitFusion.java b/src/com/android/gallery3d/filtershow/editors/EditorTruePortraitFusion.java
index 357c6c4..20ff331 100644
--- a/src/com/android/gallery3d/filtershow/editors/EditorTruePortraitFusion.java
+++ b/src/com/android/gallery3d/filtershow/editors/EditorTruePortraitFusion.java
@@ -36,8 +36,8 @@
 import android.content.Context;
 import android.content.DialogInterface;
 import android.net.Uri;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.View;
diff --git a/src/com/android/gallery3d/filtershow/editors/EditorTruePortraitMask.java b/src/com/android/gallery3d/filtershow/editors/EditorTruePortraitMask.java
index 75f84ef..c4a0f94 100644
--- a/src/com/android/gallery3d/filtershow/editors/EditorTruePortraitMask.java
+++ b/src/com/android/gallery3d/filtershow/editors/EditorTruePortraitMask.java
@@ -31,7 +31,7 @@
 
 
 import android.content.Context;
-import android.support.v4.app.FragmentManager;
+import androidx.fragment.app.FragmentManager;
 import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.View;
diff --git a/src/com/android/gallery3d/filtershow/imageshow/ImageShow.java b/src/com/android/gallery3d/filtershow/imageshow/ImageShow.java
index f000fed..02a50b4 100755
--- a/src/com/android/gallery3d/filtershow/imageshow/ImageShow.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/ImageShow.java
@@ -35,7 +35,7 @@
 import android.graphics.Region;
 import android.graphics.Shader;
 import android.graphics.drawable.NinePatchDrawable;
-import android.support.v4.widget.EdgeEffectCompat;
+import androidx.core.widget.EdgeEffectCompat;
 import android.util.AttributeSet;
 import android.view.GestureDetector;
 import android.view.GestureDetector.OnDoubleTapListener;
diff --git a/src/com/android/gallery3d/filtershow/mediapicker/MediaAdapter.java b/src/com/android/gallery3d/filtershow/mediapicker/MediaAdapter.java
index 380fa11..9a53a93 100644
--- a/src/com/android/gallery3d/filtershow/mediapicker/MediaAdapter.java
+++ b/src/com/android/gallery3d/filtershow/mediapicker/MediaAdapter.java
@@ -33,7 +33,7 @@
 import android.database.Cursor;
 import android.net.Uri;
 import android.provider.MediaStore;
-import android.support.v4.widget.CursorAdapter;
+import androidx.cursoradapter.widget.CursorAdapter;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewGroup.LayoutParams;
diff --git a/src/com/android/gallery3d/filtershow/mediapicker/MediaPickerFragment.java b/src/com/android/gallery3d/filtershow/mediapicker/MediaPickerFragment.java
index 68e76fc..42a0fb9 100644
--- a/src/com/android/gallery3d/filtershow/mediapicker/MediaPickerFragment.java
+++ b/src/com/android/gallery3d/filtershow/mediapicker/MediaPickerFragment.java
@@ -38,10 +38,10 @@
 import android.provider.MediaStore;
 import android.provider.MediaStore.Images;
 import android.provider.MediaStore.MediaColumns;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.LoaderManager;
-import android.support.v4.content.CursorLoader;
-import android.support.v4.content.Loader;
+import androidx.fragment.app.Fragment;
+import androidx.loader.app.LoaderManager;
+import androidx.loader.content.CursorLoader;
+import androidx.loader.content.Loader;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
diff --git a/src/com/android/gallery3d/filtershow/state/StatePanel.java b/src/com/android/gallery3d/filtershow/state/StatePanel.java
index e7ea92b..7a4040b 100644
--- a/src/com/android/gallery3d/filtershow/state/StatePanel.java
+++ b/src/com/android/gallery3d/filtershow/state/StatePanel.java
@@ -17,7 +17,7 @@
 package com.android.gallery3d.filtershow.state;
 
 import android.os.Bundle;
-import android.support.v4.app.Fragment;
+import androidx.fragment.app.Fragment;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
diff --git a/src/com/android/gallery3d/filtershow/tools/TruePortraitNativeEngine.java b/src/com/android/gallery3d/filtershow/tools/TruePortraitNativeEngine.java
index 47f9179..4322bb9 100644
--- a/src/com/android/gallery3d/filtershow/tools/TruePortraitNativeEngine.java
+++ b/src/com/android/gallery3d/filtershow/tools/TruePortraitNativeEngine.java
@@ -41,7 +41,7 @@
 import android.graphics.Paint.Style;
 import android.graphics.Point;
 import android.graphics.Rect;
-import android.support.v4.app.FragmentManager;
+import androidx.fragment.app.FragmentManager;
 import android.util.Log;
 
 import org.codeaurora.gallery.R;
diff --git a/src/com/android/gallery3d/ingest/IngestActivity.java b/src/com/android/gallery3d/ingest/IngestActivity.java
index 9cdacb8..be9f05c 100644
--- a/src/com/android/gallery3d/ingest/IngestActivity.java
+++ b/src/com/android/gallery3d/ingest/IngestActivity.java
@@ -42,7 +42,7 @@
 import android.os.Handler;
 import android.os.IBinder;
 import android.os.Message;
-import android.support.v4.view.ViewPager;
+import androidx.viewpager.widget.ViewPager;
 import android.util.SparseBooleanArray;
 import android.view.ActionMode;
 import android.view.Menu;
diff --git a/src/com/android/gallery3d/ingest/IngestService.java b/src/com/android/gallery3d/ingest/IngestService.java
index 361fb80..3927cd7 100644
--- a/src/com/android/gallery3d/ingest/IngestService.java
+++ b/src/com/android/gallery3d/ingest/IngestService.java
@@ -37,7 +37,7 @@
 import android.os.Build;
 import android.os.IBinder;
 import android.os.SystemClock;
-import android.support.v4.app.NotificationCompat;
+import androidx.core.app.NotificationCompat;
 import android.util.SparseBooleanArray;
 import android.widget.Adapter;
 
diff --git a/src/com/android/gallery3d/ingest/adapter/MtpPagerAdapter.java b/src/com/android/gallery3d/ingest/adapter/MtpPagerAdapter.java
index 889e3dd..241e595 100644
--- a/src/com/android/gallery3d/ingest/adapter/MtpPagerAdapter.java
+++ b/src/com/android/gallery3d/ingest/adapter/MtpPagerAdapter.java
@@ -25,7 +25,7 @@
 import android.annotation.TargetApi;
 import android.content.Context;
 import android.os.Build;
-import android.support.v4.view.PagerAdapter;
+import androidx.viewpager.widget.PagerAdapter;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
diff --git a/src/com/android/gallery3d/ui/BaseDialogFragment.java b/src/com/android/gallery3d/ui/BaseDialogFragment.java
index 4fa9f23..a421578 100644
--- a/src/com/android/gallery3d/ui/BaseDialogFragment.java
+++ b/src/com/android/gallery3d/ui/BaseDialogFragment.java
@@ -28,9 +28,9 @@
  */
 package com.android.gallery3d.ui;
 
-import android.support.v4.app.DialogFragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
+import androidx.fragment.app.DialogFragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentTransaction;
 
 public class BaseDialogFragment extends DialogFragment {
 
diff --git a/src/com/android/gallery3d/ui/MenuExecutor.java b/src/com/android/gallery3d/ui/MenuExecutor.java
index 673ba66..bb8f1b1 100644
--- a/src/com/android/gallery3d/ui/MenuExecutor.java
+++ b/src/com/android/gallery3d/ui/MenuExecutor.java
@@ -30,7 +30,7 @@
 import android.net.Uri;
 import android.os.Handler;
 import android.os.Message;
-import android.support.v4.print.PrintHelper;
+import androidx.print.PrintHelper;
 import android.view.Menu;
 import android.view.MenuItem;
 
diff --git a/src/com/android/gallery3d/ui/TileImageView.java b/src/com/android/gallery3d/ui/TileImageView.java
index 5edd9d7..5c3df5f 100644
--- a/src/com/android/gallery3d/ui/TileImageView.java
+++ b/src/com/android/gallery3d/ui/TileImageView.java
@@ -21,7 +21,7 @@
 import android.graphics.Point;
 import android.graphics.Rect;
 import android.graphics.RectF;
-import android.support.v4.util.LongSparseArray;
+import androidx.collection.LongSparseArray;
 import android.util.DisplayMetrics;
 import android.view.WindowManager;
 
diff --git a/src/com/android/gallery3d/util/AccessibilityUtils.java b/src/com/android/gallery3d/util/AccessibilityUtils.java
index 9df8e4e..80244d3 100644
--- a/src/com/android/gallery3d/util/AccessibilityUtils.java
+++ b/src/com/android/gallery3d/util/AccessibilityUtils.java
@@ -17,7 +17,7 @@
 package com.android.gallery3d.util;
 
 import android.content.Context;
-import android.support.v4.view.accessibility.AccessibilityRecordCompat;
+import androidx.core.view.accessibility.AccessibilityRecordCompat;
 import android.view.View;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityManager;
diff --git a/src/com/android/photos/GalleryActivity.java b/src/com/android/photos/GalleryActivity.java
index 490289f..a02adac 100644
--- a/src/com/android/photos/GalleryActivity.java
+++ b/src/com/android/photos/GalleryActivity.java
@@ -23,8 +23,8 @@
 import android.app.FragmentTransaction;
 import android.content.Intent;
 import android.os.Bundle;
-import android.support.v13.app.FragmentPagerAdapter;
-import android.support.v4.view.ViewPager;
+import androidx.legacy.app.FragmentPagerAdapter;
+import androidx.viewpager.widget.ViewPager;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.ViewGroup;
diff --git a/src/com/android/photos/views/GalleryThumbnailView.java b/src/com/android/photos/views/GalleryThumbnailView.java
index e5dd6f2..2515685 100644
--- a/src/com/android/photos/views/GalleryThumbnailView.java
+++ b/src/com/android/photos/views/GalleryThumbnailView.java
@@ -20,10 +20,10 @@
 import android.content.res.TypedArray;
 import android.database.DataSetObserver;
 import android.graphics.Canvas;
-import android.support.v4.view.MotionEventCompat;
-import android.support.v4.view.VelocityTrackerCompat;
-import android.support.v4.view.ViewCompat;
-import android.support.v4.widget.EdgeEffectCompat;
+import androidx.core.view.MotionEventCompat;
+import androidx.core.view.VelocityTrackerCompat;
+import androidx.core.view.ViewCompat;
+import androidx.core.widget.EdgeEffectCompat;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.util.SparseArray;
diff --git a/src/com/android/photos/views/TiledImageRenderer.java b/src/com/android/photos/views/TiledImageRenderer.java
index 58bfdbb..a4a8d48 100644
--- a/src/com/android/photos/views/TiledImageRenderer.java
+++ b/src/com/android/photos/views/TiledImageRenderer.java
@@ -20,7 +20,7 @@
 import android.graphics.Bitmap;
 import android.graphics.Rect;
 import android.graphics.RectF;
-import android.support.v4.util.LongSparseArray;
+import androidx.collection.LongSparseArray;
 import android.util.DisplayMetrics;
 import android.util.Log;
 import android.util.Pools.Pool;