Delete v13 library.
Test: ./gradlew tasks
Change-Id: I84a53ba9aab6a22d296a6dc418a4d231eb9489e8
diff --git a/jetifier/jetifier/migration.config b/jetifier/jetifier/migration.config
index 3e5b191..ce3bc1c 100644
--- a/jetifier/jetifier/migration.config
+++ b/jetifier/jetifier/migration.config
@@ -1056,10 +1056,6 @@
"to": "androidx/gridlayout"
},
{
- "from": "androidx/legacy/v13",
- "to": "androidx/legacy/v13"
- },
- {
"from": "androidx/navigation",
"to": "androidx/navigation"
},
@@ -1891,18 +1887,6 @@
},
{
"from": {
- "groupId": "androidx.legacy",
- "artifactId": "legacy-support-v13",
- "version": "{newSlVersion}"
- },
- "to": {
- "groupId": "androidx.legacy",
- "artifactId": "legacy-support-v13",
- "version": "{newSlVersion}"
- }
- },
- {
- "from": {
"groupId": "com.android.support",
"artifactId": "support-v4",
"version": "{oldSlVersion}"
diff --git a/legacy/v13/api/1.0.0.txt b/legacy/v13/api/1.0.0.txt
deleted file mode 100644
index 87015e1..0000000
--- a/legacy/v13/api/1.0.0.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-// Signature format: 3.0
-package androidx.legacy.app {
-
- @Deprecated public class ActivityCompat extends androidx.core.app.ActivityCompat {
- ctor @Deprecated protected ActivityCompat();
- }
-
- @Deprecated public class FragmentCompat {
- ctor @Deprecated public FragmentCompat();
- method @Deprecated public static void requestPermissions(android.app.Fragment, String[], int);
- method @Deprecated public static void setMenuVisibility(android.app.Fragment!, boolean);
- method @Deprecated public static void setPermissionCompatDelegate(androidx.legacy.app.FragmentCompat.PermissionCompatDelegate!);
- method @Deprecated public static void setUserVisibleHint(android.app.Fragment!, boolean);
- method @Deprecated public static boolean shouldShowRequestPermissionRationale(android.app.Fragment, String);
- }
-
- @Deprecated public static interface FragmentCompat.OnRequestPermissionsResultCallback {
- method @Deprecated public void onRequestPermissionsResult(int, String[], int[]);
- }
-
- @Deprecated public static interface FragmentCompat.PermissionCompatDelegate {
- method @Deprecated public boolean requestPermissions(android.app.Fragment!, String[]!, int);
- }
-
- @Deprecated public abstract class FragmentPagerAdapter extends androidx.viewpager.widget.PagerAdapter {
- ctor @Deprecated public FragmentPagerAdapter(android.app.FragmentManager!);
- method @Deprecated public abstract android.app.Fragment! getItem(int);
- method @Deprecated public long getItemId(int);
- method @Deprecated public boolean isViewFromObject(android.view.View!, Object!);
- }
-
- @Deprecated public abstract class FragmentStatePagerAdapter extends androidx.viewpager.widget.PagerAdapter {
- ctor @Deprecated public FragmentStatePagerAdapter(android.app.FragmentManager!);
- method @Deprecated public abstract android.app.Fragment! getItem(int);
- method @Deprecated public boolean isViewFromObject(android.view.View!, Object!);
- }
-
- @Deprecated public class FragmentTabHost extends android.widget.TabHost implements android.widget.TabHost.OnTabChangeListener {
- ctor @Deprecated public FragmentTabHost(android.content.Context!);
- ctor @Deprecated public FragmentTabHost(android.content.Context!, android.util.AttributeSet!);
- method @Deprecated public void addTab(android.widget.TabHost.TabSpec!, Class<?>!, android.os.Bundle!);
- method @Deprecated public void onTabChanged(String!);
- method @Deprecated public void setup(android.content.Context!, android.app.FragmentManager!);
- method @Deprecated public void setup(android.content.Context!, android.app.FragmentManager!, int);
- }
-
-}
-
-package androidx.legacy.view {
-
- @Deprecated public class ViewCompat extends androidx.core.view.ViewCompat {
- }
-
-}
-
diff --git a/legacy/v13/api/1.1.0-alpha01.txt b/legacy/v13/api/1.1.0-alpha01.txt
deleted file mode 100644
index 87015e1..0000000
--- a/legacy/v13/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-// Signature format: 3.0
-package androidx.legacy.app {
-
- @Deprecated public class ActivityCompat extends androidx.core.app.ActivityCompat {
- ctor @Deprecated protected ActivityCompat();
- }
-
- @Deprecated public class FragmentCompat {
- ctor @Deprecated public FragmentCompat();
- method @Deprecated public static void requestPermissions(android.app.Fragment, String[], int);
- method @Deprecated public static void setMenuVisibility(android.app.Fragment!, boolean);
- method @Deprecated public static void setPermissionCompatDelegate(androidx.legacy.app.FragmentCompat.PermissionCompatDelegate!);
- method @Deprecated public static void setUserVisibleHint(android.app.Fragment!, boolean);
- method @Deprecated public static boolean shouldShowRequestPermissionRationale(android.app.Fragment, String);
- }
-
- @Deprecated public static interface FragmentCompat.OnRequestPermissionsResultCallback {
- method @Deprecated public void onRequestPermissionsResult(int, String[], int[]);
- }
-
- @Deprecated public static interface FragmentCompat.PermissionCompatDelegate {
- method @Deprecated public boolean requestPermissions(android.app.Fragment!, String[]!, int);
- }
-
- @Deprecated public abstract class FragmentPagerAdapter extends androidx.viewpager.widget.PagerAdapter {
- ctor @Deprecated public FragmentPagerAdapter(android.app.FragmentManager!);
- method @Deprecated public abstract android.app.Fragment! getItem(int);
- method @Deprecated public long getItemId(int);
- method @Deprecated public boolean isViewFromObject(android.view.View!, Object!);
- }
-
- @Deprecated public abstract class FragmentStatePagerAdapter extends androidx.viewpager.widget.PagerAdapter {
- ctor @Deprecated public FragmentStatePagerAdapter(android.app.FragmentManager!);
- method @Deprecated public abstract android.app.Fragment! getItem(int);
- method @Deprecated public boolean isViewFromObject(android.view.View!, Object!);
- }
-
- @Deprecated public class FragmentTabHost extends android.widget.TabHost implements android.widget.TabHost.OnTabChangeListener {
- ctor @Deprecated public FragmentTabHost(android.content.Context!);
- ctor @Deprecated public FragmentTabHost(android.content.Context!, android.util.AttributeSet!);
- method @Deprecated public void addTab(android.widget.TabHost.TabSpec!, Class<?>!, android.os.Bundle!);
- method @Deprecated public void onTabChanged(String!);
- method @Deprecated public void setup(android.content.Context!, android.app.FragmentManager!);
- method @Deprecated public void setup(android.content.Context!, android.app.FragmentManager!, int);
- }
-
-}
-
-package androidx.legacy.view {
-
- @Deprecated public class ViewCompat extends androidx.core.view.ViewCompat {
- }
-
-}
-
diff --git a/legacy/v13/api/current.txt b/legacy/v13/api/current.txt
deleted file mode 100644
index 87015e1..0000000
--- a/legacy/v13/api/current.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-// Signature format: 3.0
-package androidx.legacy.app {
-
- @Deprecated public class ActivityCompat extends androidx.core.app.ActivityCompat {
- ctor @Deprecated protected ActivityCompat();
- }
-
- @Deprecated public class FragmentCompat {
- ctor @Deprecated public FragmentCompat();
- method @Deprecated public static void requestPermissions(android.app.Fragment, String[], int);
- method @Deprecated public static void setMenuVisibility(android.app.Fragment!, boolean);
- method @Deprecated public static void setPermissionCompatDelegate(androidx.legacy.app.FragmentCompat.PermissionCompatDelegate!);
- method @Deprecated public static void setUserVisibleHint(android.app.Fragment!, boolean);
- method @Deprecated public static boolean shouldShowRequestPermissionRationale(android.app.Fragment, String);
- }
-
- @Deprecated public static interface FragmentCompat.OnRequestPermissionsResultCallback {
- method @Deprecated public void onRequestPermissionsResult(int, String[], int[]);
- }
-
- @Deprecated public static interface FragmentCompat.PermissionCompatDelegate {
- method @Deprecated public boolean requestPermissions(android.app.Fragment!, String[]!, int);
- }
-
- @Deprecated public abstract class FragmentPagerAdapter extends androidx.viewpager.widget.PagerAdapter {
- ctor @Deprecated public FragmentPagerAdapter(android.app.FragmentManager!);
- method @Deprecated public abstract android.app.Fragment! getItem(int);
- method @Deprecated public long getItemId(int);
- method @Deprecated public boolean isViewFromObject(android.view.View!, Object!);
- }
-
- @Deprecated public abstract class FragmentStatePagerAdapter extends androidx.viewpager.widget.PagerAdapter {
- ctor @Deprecated public FragmentStatePagerAdapter(android.app.FragmentManager!);
- method @Deprecated public abstract android.app.Fragment! getItem(int);
- method @Deprecated public boolean isViewFromObject(android.view.View!, Object!);
- }
-
- @Deprecated public class FragmentTabHost extends android.widget.TabHost implements android.widget.TabHost.OnTabChangeListener {
- ctor @Deprecated public FragmentTabHost(android.content.Context!);
- ctor @Deprecated public FragmentTabHost(android.content.Context!, android.util.AttributeSet!);
- method @Deprecated public void addTab(android.widget.TabHost.TabSpec!, Class<?>!, android.os.Bundle!);
- method @Deprecated public void onTabChanged(String!);
- method @Deprecated public void setup(android.content.Context!, android.app.FragmentManager!);
- method @Deprecated public void setup(android.content.Context!, android.app.FragmentManager!, int);
- }
-
-}
-
-package androidx.legacy.view {
-
- @Deprecated public class ViewCompat extends androidx.core.view.ViewCompat {
- }
-
-}
-
diff --git a/legacy/v13/api/res-1.0.0.txt b/legacy/v13/api/res-1.0.0.txt
deleted file mode 100644
index e69de29..0000000
--- a/legacy/v13/api/res-1.0.0.txt
+++ /dev/null
diff --git a/legacy/v13/api/res-1.1.0-alpha01.txt b/legacy/v13/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/legacy/v13/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/legacy/v13/api/restricted_1.0.0.txt b/legacy/v13/api/restricted_1.0.0.txt
deleted file mode 100644
index 0353d68..0000000
--- a/legacy/v13/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.legacy.app {
-
- @Deprecated public class FragmentCompat {
- method @Deprecated @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.legacy.app.FragmentCompat.PermissionCompatDelegate! getPermissionCompatDelegate();
- }
-
-}
-
diff --git a/legacy/v13/api/restricted_1.1.0-alpha01.txt b/legacy/v13/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index c11f6d1..0000000
--- a/legacy/v13/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.legacy.app {
-
- @Deprecated public class FragmentCompat {
- method @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.legacy.app.FragmentCompat.PermissionCompatDelegate! getPermissionCompatDelegate();
- }
-
-}
-
diff --git a/legacy/v13/api/restricted_current.txt b/legacy/v13/api/restricted_current.txt
deleted file mode 100644
index c11f6d1..0000000
--- a/legacy/v13/api/restricted_current.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.legacy.app {
-
- @Deprecated public class FragmentCompat {
- method @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.legacy.app.FragmentCompat.PermissionCompatDelegate! getPermissionCompatDelegate();
- }
-
-}
-
diff --git a/legacy/v13/build.gradle b/legacy/v13/build.gradle
deleted file mode 100644
index 88c432d..0000000
--- a/legacy/v13/build.gradle
+++ /dev/null
@@ -1,23 +0,0 @@
-import androidx.build.LibraryGroups
-import androidx.build.LibraryVersions
-
-plugins {
- id("AndroidXPlugin")
- id("com.android.library")
-}
-
-dependencies {
- api(project(":core"))
- api(project(":fragment"))
- api(project(":viewpager"))
-}
-
-androidx {
- name = "Android Support Library v13"
- publish = true
- mavenVersion = LibraryVersions.LEGACY
- mavenGroup = LibraryGroups.LEGACY
- inceptionYear = "2011"
- description = "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 14 or later."
- failOnDeprecationWarnings = false
-}
diff --git a/legacy/v13/src/main/AndroidManifest.xml b/legacy/v13/src/main/AndroidManifest.xml
deleted file mode 100644
index 8dae5af..0000000
--- a/legacy/v13/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<manifest package="androidx.legacy.v13"/>
\ No newline at end of file
diff --git a/legacy/v13/src/main/java/androidx/legacy/app/ActivityCompat.java b/legacy/v13/src/main/java/androidx/legacy/app/ActivityCompat.java
deleted file mode 100644
index 4efda58..0000000
--- a/legacy/v13/src/main/java/androidx/legacy/app/ActivityCompat.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.legacy.app;
-
-/**
- * Helper for accessing features in {@link android.app.Activity} in a backwards compatible fashion.
- *
- * @deprecated Use {@link androidx.core.app.ActivityCompat
- * androidx.core.app.ActivityCompat}.
- */
-@Deprecated
-public class ActivityCompat extends androidx.core.app.ActivityCompat {
- /**
- * This class should not be instantiated, but the constructor must be
- * visible for the class to be extended.
- *
- * @deprecated Use {@link androidx.core.app.ActivityCompat
- * androidx.core.app.ActivityCompat}.
- */
- @Deprecated
- protected ActivityCompat() {
- // Not publicly instantiable, but may be extended.
- }
-}
diff --git a/legacy/v13/src/main/java/androidx/legacy/app/FragmentCompat.java b/legacy/v13/src/main/java/androidx/legacy/app/FragmentCompat.java
deleted file mode 100644
index ac182f5..0000000
--- a/legacy/v13/src/main/java/androidx/legacy/app/FragmentCompat.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.legacy.app;
-
-import android.app.Fragment;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.os.Build;
-import android.os.Handler;
-import android.os.Looper;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RequiresApi;
-import androidx.annotation.RestrictTo;
-
-import java.util.Arrays;
-
-/**
- * Helper for accessing features in {@link Fragment} in a backwards compatible fashion.
- *
- * @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework fragment.
- */
-@Deprecated
-public class FragmentCompat {
-
- /**
- * @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework fragment.
- */
- @Deprecated
- public FragmentCompat() {
- }
-
- interface FragmentCompatImpl {
- void setUserVisibleHint(Fragment f, boolean deferStart);
- void requestPermissions(Fragment fragment, String[] permissions, int requestCode);
- boolean shouldShowRequestPermissionRationale(Fragment fragment, String permission);
- }
-
- /**
- * Customizable delegate that allows delegating permission related compatibility methods
- * to a custom implementation.
- *
- * <p>
- * To delegate fragment compatibility methods to a custom class, implement this interface,
- * and call {@code FragmentCompat.setPermissionCompatDelegate(delegate);}. All future calls
- * to the compatibility methods in this class will first check whether the delegate can
- * handle the method call, and invoke the corresponding method if it can.
- * </p>
- *
- * @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework
- * {@link Fragment}.
- */
- @Deprecated
- public interface PermissionCompatDelegate {
-
- /**
- * Determines whether the delegate should handle
- * {@link FragmentCompat#requestPermissions(Fragment, String[], int)}, and request
- * permissions if applicable. If this method returns true, it means that permission
- * request is successfully handled by the delegate, and platform should not perform any
- * further requests for permission.
- *
- * @param fragment The target fragment.
- * @param permissions The requested permissions.
- * @param requestCode Application specific request code to match with a result
- * reported to {@link OnRequestPermissionsResultCallback#onRequestPermissionsResult(
- * int, String[], int[])}.
- *
- * @return Whether the delegate has handled the permission request.
- * @see FragmentCompat#requestPermissions(Fragment, String[], int)
- *
- * @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework
- * {@link Fragment}.
- */
- @Deprecated
- boolean requestPermissions(Fragment fragment, String[] permissions, int requestCode);
- }
-
- static class FragmentCompatBaseImpl implements FragmentCompatImpl {
- @Override
- public void setUserVisibleHint(Fragment f, boolean deferStart) {
- }
- @Override
- public void requestPermissions(final Fragment fragment, final String[] permissions,
- final int requestCode) {
- Handler handler = new Handler(Looper.getMainLooper());
- handler.post(new Runnable() {
- @Override
- public void run() {
- final int[] grantResults = new int[permissions.length];
-
- Context context = fragment.getActivity();
- if (context != null) {
- PackageManager packageManager = context.getPackageManager();
- String packageName = context.getPackageName();
-
- final int permissionCount = permissions.length;
- for (int i = 0; i < permissionCount; i++) {
- grantResults[i] = packageManager.checkPermission(
- permissions[i], packageName);
- }
- } else {
- Arrays.fill(grantResults, PackageManager.PERMISSION_DENIED);
- }
-
- ((OnRequestPermissionsResultCallback) fragment).onRequestPermissionsResult(
- requestCode, permissions, grantResults);
- }
- });
- }
- @Override
- public boolean shouldShowRequestPermissionRationale(Fragment fragment, String permission) {
- return false;
- }
- }
-
- @RequiresApi(15)
- static class FragmentCompatApi15Impl extends FragmentCompatBaseImpl {
- @Override
- public void setUserVisibleHint(Fragment f, boolean deferStart) {
- f.setUserVisibleHint(deferStart);
- }
- }
-
- @RequiresApi(23)
- static class FragmentCompatApi23Impl extends FragmentCompatApi15Impl {
- @Override
- public void requestPermissions(Fragment fragment, String[] permissions, int requestCode) {
- fragment.requestPermissions(permissions, requestCode);
- }
-
- @Override
- public boolean shouldShowRequestPermissionRationale(Fragment fragment, String permission) {
- return fragment.shouldShowRequestPermissionRationale(permission);
- }
- }
-
- @RequiresApi(24)
- static class FragmentCompatApi24Impl extends FragmentCompatApi23Impl {
- @Override
- public void setUserVisibleHint(Fragment f, boolean deferStart) {
- f.setUserVisibleHint(deferStart);
- }
- }
-
- static final FragmentCompatImpl IMPL;
- static {
- if (Build.VERSION.SDK_INT >= 24) {
- IMPL = new FragmentCompatApi24Impl();
- } else if (Build.VERSION.SDK_INT >= 23) {
- IMPL = new FragmentCompatApi23Impl();
- } else if (android.os.Build.VERSION.SDK_INT >= 15) {
- IMPL = new FragmentCompatApi15Impl();
- } else {
- IMPL = new FragmentCompatBaseImpl();
- }
- }
-
- private static PermissionCompatDelegate sDelegate;
-
- /**
- * Sets the permission delegate for {@code FragmentCompat}. Replaces the previously set
- * delegate.
- *
- * @param delegate The delegate to be set. {@code null} to clear the set delegate.
- *
- * @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework
- * {@link Fragment}.
- */
- @Deprecated
- public static void setPermissionCompatDelegate(PermissionCompatDelegate delegate) {
- sDelegate = delegate;
- }
-
- /**
- * @hide
- *
- * @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework
- * {@link Fragment}.
- */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
- @Deprecated
- public static PermissionCompatDelegate getPermissionCompatDelegate() {
- return sDelegate;
- }
-
- /**
- * This interface is the contract for receiving the results for permission requests.
- *
- * @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework
- * {@link Fragment}.
- */
- @Deprecated
- public interface OnRequestPermissionsResultCallback {
-
- /**
- * Callback for the result from requesting permissions. This method
- * is invoked for every call on {@link #requestPermissions(android.app.Fragment,
- * String[], int)}
- *
- * @param requestCode The request code passed in {@link #requestPermissions(
- * android.app.Fragment, String[], int)}
- * @param permissions The requested permissions. Never null.
- * @param grantResults The grant results for the corresponding permissions
- * which is either {@link android.content.pm.PackageManager#PERMISSION_GRANTED}
- * or {@link android.content.pm.PackageManager#PERMISSION_DENIED}. Never null.
- *
- * @see #requestPermissions(android.app.Fragment, String[], int)
- *
- * @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework
- * {@link Fragment}.
- */
- @Deprecated
- public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
- @NonNull int[] grantResults);
- }
-
- /**
- * Call {@link Fragment#setMenuVisibility(boolean) Fragment.setMenuVisibility(boolean)}
- * if running on an appropriate version of the platform.
- *
- * @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework
- * {@link Fragment}.
- */
- @Deprecated
- public static void setMenuVisibility(Fragment f, boolean visible) {
- f.setMenuVisibility(visible);
- }
-
- /**
- * Call {@link Fragment#setUserVisibleHint(boolean) setUserVisibleHint(boolean)}
- * if running on an appropriate version of the platform.
- *
- * @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework
- * {@link Fragment}.
- */
- @Deprecated
- public static void setUserVisibleHint(Fragment f, boolean deferStart) {
- IMPL.setUserVisibleHint(f, deferStart);
- }
-
- /**
- * Requests permissions to be granted to this application. These permissions
- * must be requested in your manifest, they should not be granted to your app,
- * and they should have protection level {@link android.content.pm.PermissionInfo
- * #PROTECTION_DANGEROUS dangerous}, regardless whether they are declared by
- * the platform or a third-party app.
- * <p>
- * Normal permissions {@link android.content.pm.PermissionInfo#PROTECTION_NORMAL}
- * are granted at install time if requested in the manifest. Signature permissions
- * {@link android.content.pm.PermissionInfo#PROTECTION_SIGNATURE} are granted at
- * install time if requested in the manifest and the signature of your app matches
- * the signature of the app declaring the permissions.
- * </p>
- * <p>
- * If your app does not have the requested permissions the user will be presented
- * with UI for accepting them. After the user has accepted or rejected the
- * requested permissions you will receive a callback reporting whether the
- * permissions were granted or not. Your fragment has to implement {@link
- * OnRequestPermissionsResultCallback}
- * and the results of permission requests will be delivered to its
- * {@link OnRequestPermissionsResultCallback#onRequestPermissionsResult(
- * int, String[], int[])}.
- * </p>
- * <p>
- * Note that requesting a permission does not guarantee it will be granted and
- * your app should be able to run without having this permission.
- * </p>
- * <p>
- * This method may start an activity allowing the user to choose which permissions
- * to grant and which to reject. Hence, you should be prepared that your activity
- * may be paused and resumed. Further, granting some permissions may require
- * a restart of you application. In such a case, the system will recreate the
- * activity stack before delivering the result to your onRequestPermissionsResult(
- * int, String[], int[]).
- * </p>
- * <p>
- * When checking whether you have a permission you should use {@link
- * androidx.core.content.ContextCompat#checkSelfPermission(
- * android.content.Context, String)}.
- * </p>
- *
- * @param fragment The target fragment.
- * @param permissions The requested permissions.
- * @param requestCode Application specific request code to match with a result
- * reported to {@link OnRequestPermissionsResultCallback#onRequestPermissionsResult(
- * int, String[], int[])}.
- *
- * @see androidx.core.content.ContextCompat#checkSelfPermission(
- * android.content.Context, String)
- * @see #shouldShowRequestPermissionRationale(android.app.Fragment, String)
- *
- * @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework
- * {@link Fragment}.
- */
- @Deprecated
- public static void requestPermissions(@NonNull Fragment fragment,
- @NonNull String[] permissions, int requestCode) {
- if (sDelegate != null && sDelegate.requestPermissions(fragment, permissions, requestCode)) {
- // Delegate has handled the request.
- return;
- }
-
- IMPL.requestPermissions(fragment, permissions, requestCode);
- }
-
- /**
- * Gets whether you should show UI with rationale for requesting a permission.
- * You should do this only if you do not have the permission and the context in
- * which the permission is requested does not clearly communicate to the user
- * what would be the benefit from granting this permission.
- * <p>
- * For example, if you write a camera app, requesting the camera permission
- * would be expected by the user and no rationale for why it is requested is
- * needed. If however, the app needs location for tagging photos then a non-tech
- * savvy user may wonder how location is related to taking photos. In this case
- * you may choose to show UI with rationale of requesting this permission.
- * </p>
- *
- * @param fragment The target fragment.
- * @param permission A permission your app wants to request.
- * @return Whether you can show permission rationale UI.
- *
- * @see androidx.core.content.ContextCompat#checkSelfPermission(
- * android.content.Context, String)
- * @see #requestPermissions(android.app.Fragment, String[], int)
- *
- * @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework
- * {@link Fragment}.
- */
- @Deprecated
- public static boolean shouldShowRequestPermissionRationale(@NonNull Fragment fragment,
- @NonNull String permission) {
- return IMPL.shouldShowRequestPermissionRationale(fragment, permission);
- }
-}
diff --git a/legacy/v13/src/main/java/androidx/legacy/app/FragmentPagerAdapter.java b/legacy/v13/src/main/java/androidx/legacy/app/FragmentPagerAdapter.java
deleted file mode 100644
index 5f31245..0000000
--- a/legacy/v13/src/main/java/androidx/legacy/app/FragmentPagerAdapter.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.legacy.app;
-
-import android.app.Fragment;
-import android.app.FragmentManager;
-import android.app.FragmentTransaction;
-import android.os.Parcelable;
-import android.util.Log;
-import android.view.View;
-import android.view.ViewGroup;
-
-import androidx.fragment.app.FragmentStatePagerAdapter;
-import androidx.viewpager.widget.PagerAdapter;
-
-/**
- * Implementation of {@link PagerAdapter} that
- * represents each page as a {@link android.app.Fragment} that is persistently
- * kept in the fragment manager as long as the user can return to the page.
- *
- * <p>This version of the pager is best for use when there are a handful of
- * typically more static fragments to be paged through, such as a set of tabs.
- * The fragment of each page the user visits will be kept in memory, though its
- * view hierarchy may be destroyed when not visible. This can result in using
- * a significant amount of memory since fragment instances can hold on to an
- * arbitrary amount of state. For larger sets of pages, consider
- * {@link FragmentStatePagerAdapter}.
- *
- * <p>When using FragmentPagerAdapter the host ViewPager must have a
- * valid ID set.</p>
- *
- * <p>Subclasses only need to implement {@link #getItem(int)}
- * and {@link #getCount()} to have a working adapter.
- *
- * @deprecated Use {@link androidx.fragment.app.FragmentPagerAdapter} instead.
- */
-@Deprecated
-public abstract class FragmentPagerAdapter extends PagerAdapter {
- private static final String TAG = "FragmentPagerAdapter";
- private static final boolean DEBUG = false;
-
- private final FragmentManager mFragmentManager;
- private FragmentTransaction mCurTransaction = null;
- private Fragment mCurrentPrimaryItem = null;
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentPagerAdapter} instead.
- */
- @Deprecated
- public FragmentPagerAdapter(FragmentManager fm) {
- mFragmentManager = fm;
- }
-
- /**
- * Return the Fragment associated with a specified position.
- *
- * @deprecated Use {@link androidx.fragment.app.FragmentPagerAdapter} instead.
- */
- @Deprecated
- public abstract Fragment getItem(int position);
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentPagerAdapter} instead.
- */
- @Deprecated
- @Override
- public void startUpdate(ViewGroup container) {
- if (container.getId() == View.NO_ID) {
- throw new IllegalStateException("ViewPager with adapter " + this
- + " requires a view id");
- }
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentPagerAdapter} instead.
- */
- @Deprecated
- @SuppressWarnings("ReferenceEquality")
- @Override
- public Object instantiateItem(ViewGroup container, int position) {
- if (mCurTransaction == null) {
- mCurTransaction = mFragmentManager.beginTransaction();
- }
-
- final long itemId = getItemId(position);
-
- // Do we already have this fragment?
- String name = makeFragmentName(container.getId(), itemId);
- Fragment fragment = mFragmentManager.findFragmentByTag(name);
- if (fragment != null) {
- if (DEBUG) Log.v(TAG, "Attaching item #" + itemId + ": f=" + fragment);
- mCurTransaction.attach(fragment);
- } else {
- fragment = getItem(position);
- if (DEBUG) Log.v(TAG, "Adding item #" + itemId + ": f=" + fragment);
- mCurTransaction.add(container.getId(), fragment,
- makeFragmentName(container.getId(), itemId));
- }
- if (fragment != mCurrentPrimaryItem) {
- fragment.setMenuVisibility(false);
- FragmentCompat.setUserVisibleHint(fragment, false);
- }
-
- return fragment;
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentPagerAdapter} instead.
- */
- @Deprecated
- @Override
- public void destroyItem(ViewGroup container, int position, Object object) {
- if (mCurTransaction == null) {
- mCurTransaction = mFragmentManager.beginTransaction();
- }
- if (DEBUG) Log.v(TAG, "Detaching item #" + getItemId(position) + ": f=" + object
- + " v=" + ((Fragment)object).getView());
- mCurTransaction.detach((Fragment)object);
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentPagerAdapter} instead.
- */
- @Deprecated
- @SuppressWarnings("ReferenceEquality")
- @Override
- public void setPrimaryItem(ViewGroup container, int position, Object object) {
- Fragment fragment = (Fragment)object;
- if (fragment != mCurrentPrimaryItem) {
- if (mCurrentPrimaryItem != null) {
- mCurrentPrimaryItem.setMenuVisibility(false);
- FragmentCompat.setUserVisibleHint(mCurrentPrimaryItem, false);
- }
- if (fragment != null) {
- fragment.setMenuVisibility(true);
- FragmentCompat.setUserVisibleHint(fragment, true);
- }
- mCurrentPrimaryItem = fragment;
- }
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentPagerAdapter} instead.
- */
- @Deprecated
- @Override
- public void finishUpdate(ViewGroup container) {
- if (mCurTransaction != null) {
- mCurTransaction.commitAllowingStateLoss();
- mCurTransaction = null;
- mFragmentManager.executePendingTransactions();
- }
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentPagerAdapter} instead.
- */
- @Deprecated
- @Override
- public boolean isViewFromObject(View view, Object object) {
- return ((Fragment)object).getView() == view;
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentPagerAdapter} instead.
- */
- @Deprecated
- @Override
- public Parcelable saveState() {
- return null;
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentPagerAdapter} instead.
- */
- @Deprecated
- @Override
- public void restoreState(Parcelable state, ClassLoader loader) {
- }
-
- /**
- * Return a unique identifier for the item at the given position.
- *
- * <p>The default implementation returns the given position.
- * Subclasses should override this method if the positions of items can change.</p>
- *
- * @param position Position within this adapter
- * @return Unique identifier for the item at position
- *
- * @deprecated Use {@link androidx.fragment.app.FragmentPagerAdapter} instead.
- */
- @Deprecated
- public long getItemId(int position) {
- return position;
- }
-
- private static String makeFragmentName(int viewId, long id) {
- return "android:switcher:" + viewId + ":" + id;
- }
-}
\ No newline at end of file
diff --git a/legacy/v13/src/main/java/androidx/legacy/app/FragmentStatePagerAdapter.java b/legacy/v13/src/main/java/androidx/legacy/app/FragmentStatePagerAdapter.java
deleted file mode 100644
index e466592..0000000
--- a/legacy/v13/src/main/java/androidx/legacy/app/FragmentStatePagerAdapter.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.legacy.app;
-
-import android.app.Fragment;
-import android.app.FragmentManager;
-import android.app.FragmentTransaction;
-import android.os.Bundle;
-import android.os.Parcelable;
-import android.util.Log;
-import android.view.View;
-import android.view.ViewGroup;
-
-import androidx.fragment.app.FragmentPagerAdapter;
-import androidx.viewpager.widget.PagerAdapter;
-
-import java.util.ArrayList;
-
-/**
- * Implementation of {@link PagerAdapter} that
- * uses a {@link Fragment} to manage each page. This class also handles
- * saving and restoring of fragment's state.
- *
- * <p>This version of the pager is more useful when there are a large number
- * of pages, working more like a list view. When pages are not visible to
- * the user, their entire fragment may be destroyed, only keeping the saved
- * state of that fragment. This allows the pager to hold on to much less
- * memory associated with each visited page as compared to
- * {@link FragmentPagerAdapter} at the cost of potentially more overhead when
- * switching between pages.
- *
- * <p>When using FragmentPagerAdapter the host ViewPager must have a
- * valid ID set.</p>
- *
- * <p>Subclasses only need to implement {@link #getItem(int)}
- * and {@link #getCount()} to have a working adapter.
- *
- * @deprecated Use {@link androidx.fragment.app.FragmentStatePagerAdapter} instead.
- */
-@Deprecated
-public abstract class FragmentStatePagerAdapter extends PagerAdapter {
- private static final String TAG = "FragStatePagerAdapter";
- private static final boolean DEBUG = false;
-
- private final FragmentManager mFragmentManager;
- private FragmentTransaction mCurTransaction = null;
-
- private ArrayList<Fragment.SavedState> mSavedState = new ArrayList<Fragment.SavedState>();
- private ArrayList<Fragment> mFragments = new ArrayList<Fragment>();
- private Fragment mCurrentPrimaryItem = null;
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentStatePagerAdapter} instead.
- */
- @Deprecated
- public FragmentStatePagerAdapter(FragmentManager fm) {
- mFragmentManager = fm;
- }
-
- /**
- * Return the Fragment associated with a specified position.
- *
- * @deprecated Use {@link androidx.fragment.app.FragmentStatePagerAdapter} instead.
- */
- @Deprecated
- public abstract Fragment getItem(int position);
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentStatePagerAdapter} instead.
- */
- @Deprecated
- @Override
- public void startUpdate(ViewGroup container) {
- if (container.getId() == View.NO_ID) {
- throw new IllegalStateException("ViewPager with adapter " + this
- + " requires a view id");
- }
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentStatePagerAdapter} instead.
- */
- @Deprecated
- @Override
- public Object instantiateItem(ViewGroup container, int position) {
- // If we already have this item instantiated, there is nothing
- // to do. This can happen when we are restoring the entire pager
- // from its saved state, where the fragment manager has already
- // taken care of restoring the fragments we previously had instantiated.
- if (mFragments.size() > position) {
- Fragment f = mFragments.get(position);
- if (f != null) {
- return f;
- }
- }
-
- if (mCurTransaction == null) {
- mCurTransaction = mFragmentManager.beginTransaction();
- }
-
- Fragment fragment = getItem(position);
- if (DEBUG) Log.v(TAG, "Adding item #" + position + ": f=" + fragment);
- if (mSavedState.size() > position) {
- Fragment.SavedState fss = mSavedState.get(position);
- if (fss != null) {
- fragment.setInitialSavedState(fss);
- }
- }
- while (mFragments.size() <= position) {
- mFragments.add(null);
- }
- fragment.setMenuVisibility(false);
- FragmentCompat.setUserVisibleHint(fragment, false);
- mFragments.set(position, fragment);
- mCurTransaction.add(container.getId(), fragment);
-
- return fragment;
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentStatePagerAdapter} instead.
- */
- @Deprecated
- @Override
- public void destroyItem(ViewGroup container, int position, Object object) {
- Fragment fragment = (Fragment) object;
-
- if (mCurTransaction == null) {
- mCurTransaction = mFragmentManager.beginTransaction();
- }
- if (DEBUG) Log.v(TAG, "Removing item #" + position + ": f=" + object
- + " v=" + ((Fragment)object).getView());
- while (mSavedState.size() <= position) {
- mSavedState.add(null);
- }
- mSavedState.set(position, fragment.isAdded()
- ? mFragmentManager.saveFragmentInstanceState(fragment) : null);
- mFragments.set(position, null);
-
- mCurTransaction.remove(fragment);
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentStatePagerAdapter} instead.
- */
- @Deprecated
- @SuppressWarnings("ReferenceEquality")
- @Override
- public void setPrimaryItem(ViewGroup container, int position, Object object) {
- Fragment fragment = (Fragment)object;
- if (fragment != mCurrentPrimaryItem) {
- if (mCurrentPrimaryItem != null) {
- mCurrentPrimaryItem.setMenuVisibility(false);
- FragmentCompat.setUserVisibleHint(mCurrentPrimaryItem, false);
- }
- if (fragment != null) {
- fragment.setMenuVisibility(true);
- FragmentCompat.setUserVisibleHint(fragment, true);
- }
- mCurrentPrimaryItem = fragment;
- }
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentStatePagerAdapter} instead.
- */
- @Deprecated
- @Override
- public void finishUpdate(ViewGroup container) {
- if (mCurTransaction != null) {
- mCurTransaction.commitAllowingStateLoss();
- mCurTransaction = null;
- mFragmentManager.executePendingTransactions();
- }
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentStatePagerAdapter} instead.
- */
- @Deprecated
- @Override
- public boolean isViewFromObject(View view, Object object) {
- return ((Fragment)object).getView() == view;
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentStatePagerAdapter} instead.
- */
- @Deprecated
- @Override
- public Parcelable saveState() {
- Bundle state = null;
- if (mSavedState.size() > 0) {
- state = new Bundle();
- Fragment.SavedState[] fss = new Fragment.SavedState[mSavedState.size()];
- mSavedState.toArray(fss);
- state.putParcelableArray("states", fss);
- }
- for (int i=0; i<mFragments.size(); i++) {
- Fragment f = mFragments.get(i);
- if (f != null && f.isAdded()) {
- if (state == null) {
- state = new Bundle();
- }
- String key = "f" + i;
- mFragmentManager.putFragment(state, key, f);
- }
- }
- return state;
- }
-
- /**
- * @deprecated Use {@link androidx.fragment.app.FragmentStatePagerAdapter} instead.
- */
- @Deprecated
- @Override
- public void restoreState(Parcelable state, ClassLoader loader) {
- if (state != null) {
- Bundle bundle = (Bundle)state;
- bundle.setClassLoader(loader);
- Parcelable[] fss = bundle.getParcelableArray("states");
- mSavedState.clear();
- mFragments.clear();
- if (fss != null) {
- for (int i=0; i<fss.length; i++) {
- mSavedState.add((Fragment.SavedState)fss[i]);
- }
- }
- Iterable<String> keys = bundle.keySet();
- for (String key: keys) {
- if (key.startsWith("f")) {
- int index = Integer.parseInt(key.substring(1));
- Fragment f = mFragmentManager.getFragment(bundle, key);
- if (f != null) {
- while (mFragments.size() <= index) {
- mFragments.add(null);
- }
- FragmentCompat.setMenuVisibility(f, false);
- mFragments.set(index, f);
- } else {
- Log.w(TAG, "Bad fragment at key " + key);
- }
- }
- }
- }
- }
-}
diff --git a/legacy/v13/src/main/java/androidx/legacy/app/FragmentTabHost.java b/legacy/v13/src/main/java/androidx/legacy/app/FragmentTabHost.java
deleted file mode 100644
index 09f23eb..0000000
--- a/legacy/v13/src/main/java/androidx/legacy/app/FragmentTabHost.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.legacy.app;
-
-import android.app.Fragment;
-import android.app.FragmentManager;
-import android.app.FragmentTransaction;
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.os.Bundle;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.util.AttributeSet;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.FrameLayout;
-import android.widget.LinearLayout;
-import android.widget.TabHost;
-import android.widget.TabWidget;
-
-import java.util.ArrayList;
-
-/**
- * Version of {@link androidx.fragment.app.FragmentTabHost} that can be
- * used with the platform {@link android.app.Fragment} APIs. You will not
- * normally use this, instead using action bar tabs.
- *
- * @deprecated Use <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
-@Deprecated
-public class FragmentTabHost extends TabHost implements TabHost.OnTabChangeListener {
- private final ArrayList<TabInfo> mTabs = new ArrayList<TabInfo>();
- private FrameLayout mRealTabContent;
- private Context mContext;
- private FragmentManager mFragmentManager;
- private int mContainerId;
- private TabHost.OnTabChangeListener mOnTabChangeListener;
- private TabInfo mLastTab;
- private boolean mAttached;
-
- static final class TabInfo {
- final String tag;
- final Class<?> clss;
- final Bundle args;
- Fragment fragment;
-
- TabInfo(String _tag, Class<?> _class, Bundle _args) {
- tag = _tag;
- clss = _class;
- args = _args;
- }
- }
-
- static class DummyTabFactory implements TabHost.TabContentFactory {
- private final Context mContext;
-
- public DummyTabFactory(Context context) {
- mContext = context;
- }
-
- @Override
- public View createTabContent(String tag) {
- View v = new View(mContext);
- v.setMinimumWidth(0);
- v.setMinimumHeight(0);
- return v;
- }
- }
-
- static class SavedState extends BaseSavedState {
- String curTab;
-
- SavedState(Parcelable superState) {
- super(superState);
- }
-
- SavedState(Parcel in) {
- super(in);
- curTab = in.readString();
- }
-
- @Override
- public void writeToParcel(Parcel out, int flags) {
- super.writeToParcel(out, flags);
- out.writeString(curTab);
- }
-
- @Override
- public String toString() {
- return "FragmentTabHost.SavedState{"
- + Integer.toHexString(System.identityHashCode(this))
- + " curTab=" + curTab + "}";
- }
-
- public static final Parcelable.Creator<SavedState> CREATOR
- = new Parcelable.Creator<SavedState>() {
- @Override
- public SavedState createFromParcel(Parcel in) {
- return new SavedState(in);
- }
-
- @Override
- public SavedState[] newArray(int size) {
- return new SavedState[size];
- }
- };
- }
-
- /**
- * @deprecated Use
- * <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
- @Deprecated
- public FragmentTabHost(Context context) {
- // Note that we call through to the version that takes an AttributeSet,
- // because the simple Context construct can result in a broken object!
- super(context, null);
- initFragmentTabHost(context, null);
- }
-
- /**
- * @deprecated Use
- * <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
- @Deprecated
- public FragmentTabHost(Context context, AttributeSet attrs) {
- super(context, attrs);
- initFragmentTabHost(context, attrs);
- }
-
- private void initFragmentTabHost(Context context, AttributeSet attrs) {
- TypedArray a = context.obtainStyledAttributes(attrs,
- new int[] { android.R.attr.inflatedId }, 0, 0);
- mContainerId = a.getResourceId(0, 0);
- a.recycle();
-
- super.setOnTabChangedListener(this);
- }
-
- private void ensureHierarchy(Context context) {
- // If owner hasn't made its own view hierarchy, then as a convenience
- // we will construct a standard one here.
- if (findViewById(android.R.id.tabs) == null) {
- LinearLayout ll = new LinearLayout(context);
- ll.setOrientation(LinearLayout.VERTICAL);
- addView(ll, new FrameLayout.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT));
-
- TabWidget tw = new TabWidget(context);
- tw.setId(android.R.id.tabs);
- tw.setOrientation(TabWidget.HORIZONTAL);
- ll.addView(tw, new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT, 0));
-
- FrameLayout fl = new FrameLayout(context);
- fl.setId(android.R.id.tabcontent);
- ll.addView(fl, new LinearLayout.LayoutParams(0, 0, 0));
-
- mRealTabContent = fl = new FrameLayout(context);
- mRealTabContent.setId(mContainerId);
- ll.addView(fl, new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.MATCH_PARENT, 0, 1));
- }
- }
-
- /**
- * @deprecated Use
- * <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
- @Override
- @Deprecated
- public void setup() {
- throw new IllegalStateException(
- "Must call setup() that takes a Context and FragmentManager");
- }
-
- /**
- * @deprecated Use
- * <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
- @Deprecated
- public void setup(Context context, FragmentManager manager) {
- ensureHierarchy(context); // Ensure views required by super.setup()
- super.setup();
- mContext = context;
- mFragmentManager = manager;
- ensureContent();
- }
-
- /**
- * @deprecated Use
- * <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
- @Deprecated
- public void setup(Context context, FragmentManager manager, int containerId) {
- ensureHierarchy(context); // Ensure views required by super.setup()
- super.setup();
- mContext = context;
- mFragmentManager = manager;
- mContainerId = containerId;
- ensureContent();
- mRealTabContent.setId(containerId);
-
- // We must have an ID to be able to save/restore our state. If
- // the owner hasn't set one at this point, we will set it ourselves.
- if (getId() == View.NO_ID) {
- setId(android.R.id.tabhost);
- }
- }
-
- private void ensureContent() {
- if (mRealTabContent == null) {
- mRealTabContent = (FrameLayout)findViewById(mContainerId);
- if (mRealTabContent == null) {
- throw new IllegalStateException(
- "No tab content FrameLayout found for id " + mContainerId);
- }
- }
- }
-
- /**
- * @deprecated Use
- * <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
- @Deprecated
- @Override
- public void setOnTabChangedListener(OnTabChangeListener l) {
- mOnTabChangeListener = l;
- }
-
- /**
- * @deprecated Use
- * <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
- @Deprecated
- public void addTab(TabHost.TabSpec tabSpec, Class<?> clss, Bundle args) {
- tabSpec.setContent(new DummyTabFactory(mContext));
- String tag = tabSpec.getTag();
-
- TabInfo info = new TabInfo(tag, clss, args);
-
- if (mAttached) {
- // If we are already attached to the window, then check to make
- // sure this tab's fragment is inactive if it exists. This shouldn't
- // normally happen.
- info.fragment = mFragmentManager.findFragmentByTag(tag);
- if (info.fragment != null && !info.fragment.isDetached()) {
- FragmentTransaction ft = mFragmentManager.beginTransaction();
- ft.detach(info.fragment);
- ft.commit();
- }
- }
-
- mTabs.add(info);
- addTab(tabSpec);
- }
-
- /**
- * @deprecated Use
- * <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
- @Deprecated
- @Override
- protected void onAttachedToWindow() {
- super.onAttachedToWindow();
-
- String currentTab = getCurrentTabTag();
-
- // Go through all tabs and make sure their fragments match
- // the correct state.
- FragmentTransaction ft = null;
- for (int i=0; i<mTabs.size(); i++) {
- TabInfo tab = mTabs.get(i);
- tab.fragment = mFragmentManager.findFragmentByTag(tab.tag);
- if (tab.fragment != null && !tab.fragment.isDetached()) {
- if (tab.tag.equals(currentTab)) {
- // The fragment for this tab is already there and
- // active, and it is what we really want to have
- // as the current tab. Nothing to do.
- mLastTab = tab;
- } else {
- // This fragment was restored in the active state,
- // but is not the current tab. Deactivate it.
- if (ft == null) {
- ft = mFragmentManager.beginTransaction();
- }
- ft.detach(tab.fragment);
- }
- }
- }
-
- // We are now ready to go. Make sure we are switched to the
- // correct tab.
- mAttached = true;
- ft = doTabChanged(currentTab, ft);
- if (ft != null) {
- ft.commit();
- mFragmentManager.executePendingTransactions();
- }
- }
-
- /**
- * @deprecated Use
- * <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
- @Deprecated
- @Override
- protected void onDetachedFromWindow() {
- super.onDetachedFromWindow();
- mAttached = false;
- }
-
- /**
- * @deprecated Use
- * <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
- @Deprecated
- @Override
- protected Parcelable onSaveInstanceState() {
- Parcelable superState = super.onSaveInstanceState();
- SavedState ss = new SavedState(superState);
- ss.curTab = getCurrentTabTag();
- return ss;
- }
-
- /**
- * @deprecated Use
- * <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
- @Deprecated
- @Override
- protected void onRestoreInstanceState(Parcelable state) {
- if (!(state instanceof SavedState)) {
- super.onRestoreInstanceState(state);
- return;
- }
- SavedState ss = (SavedState) state;
- super.onRestoreInstanceState(ss.getSuperState());
- setCurrentTabByTag(ss.curTab);
- }
-
- /**
- * @deprecated Use
- * <a href="https://developer.android.com/guide/navigation/navigation-swipe-view ">
- * TabLayout and ViewPager</a> instead.
- */
- @Deprecated
- @Override
- public void onTabChanged(String tabId) {
- if (mAttached) {
- FragmentTransaction ft = doTabChanged(tabId, null);
- if (ft != null) {
- ft.commit();
- }
- }
- if (mOnTabChangeListener != null) {
- mOnTabChangeListener.onTabChanged(tabId);
- }
- }
-
- private FragmentTransaction doTabChanged(String tabId, FragmentTransaction ft) {
- TabInfo newTab = null;
- for (int i=0; i<mTabs.size(); i++) {
- TabInfo tab = mTabs.get(i);
- if (tab.tag.equals(tabId)) {
- newTab = tab;
- }
- }
- if (newTab == null) {
- throw new IllegalStateException("No tab known for tag " + tabId);
- }
- if (mLastTab != newTab) {
- if (ft == null) {
- ft = mFragmentManager.beginTransaction();
- }
- if (mLastTab != null) {
- if (mLastTab.fragment != null) {
- ft.detach(mLastTab.fragment);
- }
- }
- if (newTab != null) {
- if (newTab.fragment == null) {
- newTab.fragment = Fragment.instantiate(mContext,
- newTab.clss.getName(), newTab.args);
- ft.add(mContainerId, newTab.fragment, newTab.tag);
- } else {
- ft.attach(newTab.fragment);
- }
- }
-
- mLastTab = newTab;
- }
- return ft;
- }
-}
diff --git a/legacy/v13/src/main/java/androidx/legacy/view/ViewCompat.java b/legacy/v13/src/main/java/androidx/legacy/view/ViewCompat.java
deleted file mode 100644
index a378264..0000000
--- a/legacy/v13/src/main/java/androidx/legacy/view/ViewCompat.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.legacy.view;
-
-import android.view.View;
-
-/**
- * Helper for accessing features in {@link View} introduced after API
- * level 13 in a backwards compatible fashion.
- *
- * @deprecated Use {@link androidx.core.view.ViewCompat} instead.
- */
-@Deprecated
-public class ViewCompat extends androidx.core.view.ViewCompat {
- private ViewCompat() {
- }
-}
diff --git a/settings.gradle b/settings.gradle
index bd8bb58..c127bdc 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -216,7 +216,6 @@
includeProject(":legacy-support-core-ui", "legacy/core-ui")
includeProject(":legacy-support-core-utils", "legacy/core-utils")
-includeProject(":legacy-support-v13", "legacy/v13")
/////////////////////////////
//