Merge "Snap for 5261097 from 7ad73370508a6deeee8393e2061a5deaa1115179 to androidx-g3-release" into androidx-g3-release
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 7fbba4c..be9a0d8 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -1,9 +1,6 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="RIGHT_MARGIN" value="100" />
- <AndroidXmlCodeStyleSettings>
- <option name="USE_CUSTOM_SETTINGS" value="true" />
- </AndroidXmlCodeStyleSettings>
<JavaCodeStyleSettings>
<option name="FIELD_NAME_PREFIX" value="m" />
<option name="STATIC_FIELD_NAME_PREFIX" value="s" />
@@ -79,10 +76,31 @@
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="2147483647" />
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
- <XML>
- <option name="XML_ALIGN_ATTRIBUTES" value="false" />
- <option name="XML_SPACE_INSIDE_EMPTY_TAG" value="true" />
- </XML>
+ <Objective-C-extensions>
+ <file>
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
+ </file>
+ <class>
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
+ </class>
+ <extensions>
+ <pair source="cpp" header="h" fileNamingConvention="NONE" />
+ <pair source="c" header="h" fileNamingConvention="NONE" />
+ </extensions>
+ </Objective-C-extensions>
<codeStyleSettings language="JAVA">
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
@@ -106,163 +124,6 @@
<option name="FOR_BRACE_FORCE" value="1" />
<option name="WRAP_LONG_LINES" value="true" />
</codeStyleSettings>
- <codeStyleSettings language="XML">
- <option name="FORCE_REARRANGE_MODE" value="1" />
- <indentOptions>
- <option name="CONTINUATION_INDENT_SIZE" value="4" />
- </indentOptions>
- <arrangement>
- <rules>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>xmlns:android</NAME>
- <XML_NAMESPACE>^$</XML_NAMESPACE>
- </AND>
- </match>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>xmlns:.*</NAME>
- <XML_NAMESPACE>^$</XML_NAMESPACE>
- </AND>
- </match>
- <order>BY_NAME</order>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>.*:id</NAME>
- <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
- </AND>
- </match>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>.*:name</NAME>
- <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
- </AND>
- </match>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>name</NAME>
- <XML_NAMESPACE>^$</XML_NAMESPACE>
- </AND>
- </match>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>style</NAME>
- <XML_NAMESPACE>^$</XML_NAMESPACE>
- </AND>
- </match>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>.*</NAME>
- <XML_NAMESPACE>^$</XML_NAMESPACE>
- </AND>
- </match>
- <order>BY_NAME</order>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>.*:layout_width</NAME>
- <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
- </AND>
- </match>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>.*:layout_height</NAME>
- <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
- </AND>
- </match>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>.*:layout_.*</NAME>
- <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
- </AND>
- </match>
- <order>BY_NAME</order>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>.*:width</NAME>
- <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
- </AND>
- </match>
- <order>BY_NAME</order>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>.*:height</NAME>
- <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
- </AND>
- </match>
- <order>BY_NAME</order>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>.*</NAME>
- <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
- </AND>
- </match>
- <order>BY_NAME</order>
- </rule>
- </section>
- <section>
- <rule>
- <match>
- <AND>
- <NAME>.*</NAME>
- <XML_NAMESPACE>.*</XML_NAMESPACE>
- </AND>
- </match>
- <order>BY_NAME</order>
- </rule>
- </section>
- </rules>
- </arrangement>
- </codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
index 03661d9..a510212 100644
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -1,6 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
<option name="PREFERRED_PROJECT_CODE_STYLE" value="AndroidStyle" />
</state>
</component>
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index c0b1b7f7..a665eae 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -33,6 +33,5 @@
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="hide" />
</inspection_tool>
- <inspection_tool class="MissingDeprecatedAnnotation" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>
\ No newline at end of file
diff --git a/OWNERS b/OWNERS
index e4a4a30..11887f0 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,14 +1,15 @@
adamp@google.com
alanv@google.com
aurimas@google.com
+chet@google.com
ccraik@google.com
clarabayarri@google.com
ilake@google.com
jeffrygaston@google.com
kirillg@google.com
+kkam@google.com
mount@google.com
pavlis@google.com
-romainguy@android.com
sergeyv@google.com
shepshapard@google.com
sumir@google.com
diff --git a/activity/api/1.0.0-alpha01.txt b/activity/api/1.0.0-alpha01.txt
index d6d1853..4f1f238 100644
--- a/activity/api/1.0.0-alpha01.txt
+++ b/activity/api/1.0.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.activity {
public class ComponentActivity extends androidx.core.app.ComponentActivity implements androidx.lifecycle.LifecycleOwner androidx.lifecycle.ViewModelStoreOwner {
diff --git a/activity/api/1.0.0-alpha02.txt b/activity/api/1.0.0-alpha02.txt
index d6d1853..4f1f238 100644
--- a/activity/api/1.0.0-alpha02.txt
+++ b/activity/api/1.0.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.activity {
public class ComponentActivity extends androidx.core.app.ComponentActivity implements androidx.lifecycle.LifecycleOwner androidx.lifecycle.ViewModelStoreOwner {
diff --git a/activity/api/1.0.0-alpha03.txt b/activity/api/1.0.0-alpha03.txt
index 6907f23..2e65567 100644
--- a/activity/api/1.0.0-alpha03.txt
+++ b/activity/api/1.0.0-alpha03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.activity {
public class ComponentActivity extends androidx.core.app.ComponentActivity implements androidx.savedstate.bundle.BundleSavedStateRegistryOwner androidx.lifecycle.LifecycleOwner androidx.lifecycle.ViewModelStoreOwner {
diff --git a/activity/api/1.0.0-alpha04.txt b/activity/api/1.0.0-alpha04.txt
index 6907f23..2e65567 100644
--- a/activity/api/1.0.0-alpha04.txt
+++ b/activity/api/1.0.0-alpha04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.activity {
public class ComponentActivity extends androidx.core.app.ComponentActivity implements androidx.savedstate.bundle.BundleSavedStateRegistryOwner androidx.lifecycle.LifecycleOwner androidx.lifecycle.ViewModelStoreOwner {
diff --git a/activity/api/1.0.0-alpha05.txt b/activity/api/1.0.0-alpha05.txt
deleted file mode 100644
index 1d5064e..0000000
--- a/activity/api/1.0.0-alpha05.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-// Signature format: 3.0
-package androidx.activity {
-
- public class ComponentActivity extends androidx.core.app.ComponentActivity implements androidx.lifecycle.LifecycleOwner androidx.savedstate.SavedStateRegistryOwner androidx.lifecycle.ViewModelStoreOwner {
- ctor public ComponentActivity();
- method public void addOnBackPressedCallback(androidx.activity.OnBackPressedCallback);
- method public void addOnBackPressedCallback(androidx.lifecycle.LifecycleOwner, androidx.activity.OnBackPressedCallback);
- method @Deprecated public Object? getLastCustomNonConfigurationInstance();
- method public androidx.lifecycle.Lifecycle getLifecycle();
- method public final androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
- method public androidx.lifecycle.ViewModelStore getViewModelStore();
- method @Deprecated public Object? onRetainCustomNonConfigurationInstance();
- method public final Object? onRetainNonConfigurationInstance();
- method public void removeOnBackPressedCallback(androidx.activity.OnBackPressedCallback);
- }
-
- public interface OnBackPressedCallback {
- method public boolean handleOnBackPressed();
- }
-
-}
-
diff --git a/activity/api/current.txt b/activity/api/current.txt
index 1d5064e..2e65567 100644
--- a/activity/api/current.txt
+++ b/activity/api/current.txt
@@ -1,13 +1,12 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.activity {
- public class ComponentActivity extends androidx.core.app.ComponentActivity implements androidx.lifecycle.LifecycleOwner androidx.savedstate.SavedStateRegistryOwner androidx.lifecycle.ViewModelStoreOwner {
+ public class ComponentActivity extends androidx.core.app.ComponentActivity implements androidx.savedstate.bundle.BundleSavedStateRegistryOwner androidx.lifecycle.LifecycleOwner androidx.lifecycle.ViewModelStoreOwner {
ctor public ComponentActivity();
method public void addOnBackPressedCallback(androidx.activity.OnBackPressedCallback);
method public void addOnBackPressedCallback(androidx.lifecycle.LifecycleOwner, androidx.activity.OnBackPressedCallback);
+ method public final androidx.savedstate.SavedStateRegistry<android.os.Bundle> getBundleSavedStateRegistry();
method @Deprecated public Object? getLastCustomNonConfigurationInstance();
- method public androidx.lifecycle.Lifecycle getLifecycle();
- method public final androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
method public androidx.lifecycle.ViewModelStore getViewModelStore();
method @Deprecated public Object? onRetainCustomNonConfigurationInstance();
method public final Object? onRetainNonConfigurationInstance();
diff --git a/activity/api/res-1.0.0-alpha05.txt b/activity/api/res-1.0.0-alpha05.txt
deleted file mode 100644
index e69de29..0000000
--- a/activity/api/res-1.0.0-alpha05.txt
+++ /dev/null
diff --git a/activity/api/restricted_1.0.0-alpha05.txt b/activity/api/restricted_1.0.0-alpha05.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/activity/api/restricted_1.0.0-alpha05.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/activity/api/restricted_current.txt b/activity/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/activity/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/activity/build.gradle b/activity/build.gradle
index f687bc8..a2fd3cb 100644
--- a/activity/build.gradle
+++ b/activity/build.gradle
@@ -15,13 +15,13 @@
dependencies {
api(project(":annotation"))
- api(project(":core")) {
+ api("androidx.core:core:1.0.0") {
exclude group: 'androidx.annotation'
exclude group: 'com.google.guava', module: 'listenablefuture'
}
- api(project(":lifecycle:lifecycle-runtime"), libs.exclude_annotations_transitive)
+ api(ARCH_LIFECYCLE_RUNTIME, libs.exclude_annotations_transitive)
api(project(":lifecycle:lifecycle-viewmodel"), libs.exclude_annotations_transitive)
- api(project(":savedstate"))
+ api(project(":savedstate:savedstate-bundle"))
androidTestImplementation(KOTLIN_STDLIB)
androidTestImplementation(TEST_EXT_JUNIT)
diff --git a/activity/ktx/api/1.0.0-alpha01.txt b/activity/ktx/api/1.0.0-alpha01.txt
index e100a2f..09242be 100644
--- a/activity/ktx/api/1.0.0-alpha01.txt
+++ b/activity/ktx/api/1.0.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.activity {
public final class ActivityViewModelLazy<VM extends androidx.lifecycle.ViewModel> implements kotlin.Lazy<VM> {
diff --git a/activity/ktx/api/1.0.0-alpha02.txt b/activity/ktx/api/1.0.0-alpha02.txt
index e100a2f..09242be 100644
--- a/activity/ktx/api/1.0.0-alpha02.txt
+++ b/activity/ktx/api/1.0.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.activity {
public final class ActivityViewModelLazy<VM extends androidx.lifecycle.ViewModel> implements kotlin.Lazy<VM> {
diff --git a/activity/ktx/api/1.0.0-alpha03.txt b/activity/ktx/api/1.0.0-alpha03.txt
index 335efc36..7ca91fa 100644
--- a/activity/ktx/api/1.0.0-alpha03.txt
+++ b/activity/ktx/api/1.0.0-alpha03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.activity {
public final class ActivityViewModelLazyKt {
diff --git a/activity/ktx/api/1.0.0-alpha04.txt b/activity/ktx/api/1.0.0-alpha04.txt
index be35c63..7ca91fa 100644
--- a/activity/ktx/api/1.0.0-alpha04.txt
+++ b/activity/ktx/api/1.0.0-alpha04.txt
@@ -1,9 +1,8 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.activity {
public final class ActivityViewModelLazyKt {
ctor public ActivityViewModelLazyKt();
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM>! viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>! factoryProducer = null);
}
}
diff --git a/activity/ktx/api/1.0.0-alpha05.txt b/activity/ktx/api/1.0.0-alpha05.txt
deleted file mode 100644
index be35c63..0000000
--- a/activity/ktx/api/1.0.0-alpha05.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-// Signature format: 3.0
-package androidx.activity {
-
- public final class ActivityViewModelLazyKt {
- ctor public ActivityViewModelLazyKt();
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM>! viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>! factoryProducer = null);
- }
-
-}
-
diff --git a/activity/ktx/api/current.txt b/activity/ktx/api/current.txt
index be35c63..7ca91fa 100644
--- a/activity/ktx/api/current.txt
+++ b/activity/ktx/api/current.txt
@@ -1,9 +1,8 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.activity {
public final class ActivityViewModelLazyKt {
ctor public ActivityViewModelLazyKt();
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM>! viewModels(androidx.activity.ComponentActivity, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>! factoryProducer = null);
}
}
diff --git a/activity/ktx/api/res-1.0.0-alpha05.txt b/activity/ktx/api/res-1.0.0-alpha05.txt
deleted file mode 100644
index e69de29..0000000
--- a/activity/ktx/api/res-1.0.0-alpha05.txt
+++ /dev/null
diff --git a/activity/ktx/api/restricted_1.0.0-alpha05.txt b/activity/ktx/api/restricted_1.0.0-alpha05.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/activity/ktx/api/restricted_1.0.0-alpha05.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/activity/ktx/api/restricted_current.txt b/activity/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/activity/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/activity/src/androidTest/AndroidManifest.xml b/activity/src/androidTest/AndroidManifest.xml
index 9eb99d5..db5c6f8 100644
--- a/activity/src/androidTest/AndroidManifest.xml
+++ b/activity/src/androidTest/AndroidManifest.xml
@@ -26,7 +26,6 @@
<activity android:name="androidx.activity.OnBackPressedComponentActivity"/>
<activity android:name="androidx.activity.SavedStateActivity"/>
<activity android:name="androidx.activity.ContentViewActivity"/>
- <activity android:name="androidx.activity.AutoRestarterActivity"/>
</application>
</manifest>
diff --git a/activity/src/androidTest/java/androidx/activity/ComponentActivityLifecycleTest.kt b/activity/src/androidTest/java/androidx/activity/ComponentActivityLifecycleTest.kt
index c0769bb..229ab2f 100644
--- a/activity/src/androidTest/java/androidx/activity/ComponentActivityLifecycleTest.kt
+++ b/activity/src/androidTest/java/androidx/activity/ComponentActivityLifecycleTest.kt
@@ -21,7 +21,7 @@
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.MediumTest
import androidx.test.rule.ActivityTestRule
import org.junit.Rule
import org.junit.Test
@@ -32,7 +32,7 @@
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4::class)
class ComponentActivityLifecycleTest {
diff --git a/activity/src/androidTest/java/androidx/activity/ComponentActivityOnBackPressedTest.kt b/activity/src/androidTest/java/androidx/activity/ComponentActivityOnBackPressedTest.kt
index 396947f..c6f7550 100644
--- a/activity/src/androidTest/java/androidx/activity/ComponentActivityOnBackPressedTest.kt
+++ b/activity/src/androidTest/java/androidx/activity/ComponentActivityOnBackPressedTest.kt
@@ -22,7 +22,7 @@
import androidx.lifecycle.LifecycleRegistry
import androidx.test.annotation.UiThreadTest
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
+import androidx.test.filters.MediumTest
import androidx.test.rule.ActivityTestRule
import com.google.common.truth.Truth.assertWithMessage
import org.junit.Rule
@@ -31,7 +31,7 @@
import org.mockito.Mockito.mock
import java.util.concurrent.CountDownLatch
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4::class)
class ComponentActivityOnBackPressedTest {
diff --git a/activity/src/androidTest/java/androidx/activity/ComponentActivityOverrideLifecycleTest.kt b/activity/src/androidTest/java/androidx/activity/ComponentActivityOverrideLifecycleTest.kt
index 09bd000..ea69c00 100644
--- a/activity/src/androidTest/java/androidx/activity/ComponentActivityOverrideLifecycleTest.kt
+++ b/activity/src/androidTest/java/androidx/activity/ComponentActivityOverrideLifecycleTest.kt
@@ -20,7 +20,7 @@
import androidx.lifecycle.LifecycleRegistry
import androidx.test.annotation.UiThreadTest
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
+import androidx.test.filters.MediumTest
import androidx.test.rule.ActivityTestRule
import com.google.common.truth.Truth.assertThat
import org.junit.Assert.fail
@@ -28,7 +28,7 @@
import org.junit.Test
import org.junit.runner.RunWith
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4::class)
class ComponentActivityOverrideLifecycleTest {
diff --git a/activity/src/androidTest/java/androidx/activity/ComponentActivityRunOnNextRecreateTest.kt b/activity/src/androidTest/java/androidx/activity/ComponentActivityRunOnNextRecreateTest.kt
deleted file mode 100644
index 59ace66..0000000
--- a/activity/src/androidTest/java/androidx/activity/ComponentActivityRunOnNextRecreateTest.kt
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2019 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.activity
-
-import android.os.Bundle
-import androidx.lifecycle.GenericLifecycleObserver
-import androidx.savedstate.SavedStateRegistry
-import androidx.savedstate.SavedStateRegistryOwner
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
-import androidx.test.rule.ActivityTestRule
-import com.google.common.truth.Truth
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@LargeTest
-@RunWith(AndroidJUnit4::class)
-class ComponentActivityRunOnNextRecreateTest {
-
- @get:Rule
- val activityRule = ActivityTestRule<AutoRestarterActivity>(AutoRestarterActivity::class.java)
-
- private class Restarted2 : SavedStateRegistry.AutoRecreated {
- override fun onRecreated(owner: SavedStateRegistryOwner) {
- (owner as? AutoRestarterActivity)?.restartedValue = "restarted"
- }
- }
-
- @Test
- fun test() {
- activityRule.runOnUiThread {
- activityRule.activity.savedStateRegistry
- .runOnNextRecreation(Restarted2::class.java)
- }
- val newActivity = recreateActivity(activityRule)
- newActivity.runOnUiThread {
- Truth.assertThat(newActivity.observerExecuted).isTrue()
- }
- }
-}
-
-class AutoRestarterActivity : ComponentActivity() {
- var restartedValue: String? = null
- var observerExecuted = false
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- if (savedInstanceState != null) {
- lifecycle.addObserver(GenericLifecycleObserver { _, _ ->
- Truth.assertThat(restartedValue).isEqualTo("restarted")
- observerExecuted = true
- })
- }
- }
-}
\ No newline at end of file
diff --git a/activity/src/androidTest/java/androidx/activity/ComponentActivitySavedStateTest.kt b/activity/src/androidTest/java/androidx/activity/ComponentActivitySavedStateTest.kt
index 3c2c78a..a46b155 100644
--- a/activity/src/androidTest/java/androidx/activity/ComponentActivitySavedStateTest.kt
+++ b/activity/src/androidTest/java/androidx/activity/ComponentActivitySavedStateTest.kt
@@ -47,7 +47,7 @@
val activity = activityRule.activity
activityRule.runOnUiThread {
assertThat(activity.lifecycle.currentState.isAtLeast(Lifecycle.State.CREATED)).isTrue()
- val registry = activity.savedStateRegistry
+ val registry = activity.bundleSavedStateRegistry
val savedState = registry.consumeRestoredStateForKey(CALLBACK_KEY)
assertThat(savedState).isNull()
registry.registerSavedStateProvider(CALLBACK_KEY, DefaultProvider())
@@ -62,7 +62,7 @@
val recreated = recreateActivity(activityRule)
activityRule.runOnUiThread {
assertThat(recreated.lifecycle.currentState.isAtLeast(Lifecycle.State.CREATED)).isTrue()
- checkDefaultSavedState(recreated.savedStateRegistry)
+ checkDefaultSavedState(recreated.bundleSavedStateRegistry)
}
}
@@ -75,7 +75,7 @@
recreated.lifecycle.addObserver(object : LifecycleObserver {
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
fun onResume() {
- checkDefaultSavedState(recreated.savedStateRegistry)
+ checkDefaultSavedState(recreated.bundleSavedStateRegistry)
}
})
}
@@ -90,7 +90,7 @@
}
}
-private class DefaultProvider : SavedStateRegistry.SavedStateProvider {
+private class DefaultProvider : SavedStateRegistry.SavedStateProvider<Bundle> {
override fun saveState() = Bundle().apply { putString(KEY, VALUE) }
}
@@ -98,7 +98,7 @@
private const val VALUE = "value"
private const val CALLBACK_KEY = "foo"
-private fun checkDefaultSavedState(store: SavedStateRegistry) {
+private fun checkDefaultSavedState(store: SavedStateRegistry<Bundle>) {
val savedState = store.consumeRestoredStateForKey(CALLBACK_KEY)
assertThat(savedState).isNotNull()
assertThat(savedState!!.getString(KEY)).isEqualTo(VALUE)
@@ -109,7 +109,7 @@
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (checkEnabledInOnCreate) {
- checkDefaultSavedState(savedStateRegistry)
+ checkDefaultSavedState(bundleSavedStateRegistry)
checkEnabledInOnCreate = false
}
}
diff --git a/activity/src/androidTest/java/androidx/activity/ComponentActivityViewModelTest.kt b/activity/src/androidTest/java/androidx/activity/ComponentActivityViewModelTest.kt
index c097c1f..5e6d6dc 100644
--- a/activity/src/androidTest/java/androidx/activity/ComponentActivityViewModelTest.kt
+++ b/activity/src/androidTest/java/androidx/activity/ComponentActivityViewModelTest.kt
@@ -24,7 +24,7 @@
import androidx.lifecycle.ViewModelStore
import androidx.test.annotation.UiThreadTest
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.MediumTest
import androidx.test.rule.ActivityTestRule
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
@@ -34,7 +34,7 @@
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4::class)
class ComponentActivityViewModelTest {
diff --git a/activity/src/main/java/androidx/activity/ComponentActivity.java b/activity/src/main/java/androidx/activity/ComponentActivity.java
index a3bbef7..9f4f2ba 100644
--- a/activity/src/main/java/androidx/activity/ComponentActivity.java
+++ b/activity/src/main/java/androidx/activity/ComponentActivity.java
@@ -18,6 +18,7 @@
import static android.os.Build.VERSION.SDK_INT;
+import android.annotation.SuppressLint;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
@@ -35,10 +36,9 @@
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.savedstate.SavedStateRegistry;
-import androidx.savedstate.SavedStateRegistryController;
-import androidx.savedstate.SavedStateRegistryOwner;
+import androidx.savedstate.bundle.BundleSavedStateRegistry;
+import androidx.savedstate.bundle.BundleSavedStateRegistryOwner;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -52,7 +52,7 @@
public class ComponentActivity extends androidx.core.app.ComponentActivity implements
LifecycleOwner,
ViewModelStoreOwner,
- SavedStateRegistryOwner {
+ BundleSavedStateRegistryOwner {
static final class NonConfigurationInstances {
Object custom;
@@ -60,8 +60,7 @@
}
private final LifecycleRegistry mLifecycleRegistry = new LifecycleRegistry(this);
- private final SavedStateRegistryController mSavedStateRegistryController =
- SavedStateRegistryController.create(this);
+ private final BundleSavedStateRegistry mSavedStateRegistry = new BundleSavedStateRegistry();
// Lazily recreated from NonConfigurationInstances by getViewModelStore()
private ViewModelStore mViewModelStore;
@@ -70,9 +69,6 @@
final CopyOnWriteArrayList<LifecycleAwareOnBackPressedCallback> mOnBackPressedCallbacks =
new CopyOnWriteArrayList<>();
- // Cache the ContentView layoutIds for Activities.
- private static final HashMap<Class, Integer> sAnnotationIds = new HashMap<>();
-
public ComponentActivity() {
Lifecycle lifecycle = getLifecycle();
//noinspection ConstantConditions
@@ -119,25 +115,21 @@
* call {@link #setContentView(int)} for you.
*/
@Override
+ @SuppressWarnings("RestrictedApi")
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- mSavedStateRegistryController.performRestore(savedInstanceState);
+ mSavedStateRegistry.performRestore(savedInstanceState);
ReportFragment.injectIfNeededIn(this);
- Class<? extends ComponentActivity> clazz = getClass();
- if (!sAnnotationIds.containsKey(clazz)) {
- ContentView annotation = clazz.getAnnotation(ContentView.class);
- if (annotation != null) {
- sAnnotationIds.put(clazz, annotation.value());
- } else {
- sAnnotationIds.put(clazz, null);
+ ContentView annotation = getClass().getAnnotation(ContentView.class);
+ if (annotation != null) {
+ int layoutId = annotation.value();
+ if (layoutId != 0) {
+ setContentView(layoutId);
}
}
- Integer layoutId = sAnnotationIds.get(clazz);
- if (layoutId != null && layoutId != 0) {
- setContentView(layoutId);
- }
}
+ @SuppressLint("RestrictedApi")
@CallSuper
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
@@ -146,7 +138,7 @@
((LifecycleRegistry) lifecycle).markState(Lifecycle.State.CREATED);
}
super.onSaveInstanceState(outState);
- mSavedStateRegistryController.performSave(outState);
+ mSavedStateRegistry.performSave(outState);
}
/**
@@ -365,8 +357,8 @@
@NonNull
@Override
- public final SavedStateRegistry getSavedStateRegistry() {
- return mSavedStateRegistryController.getSavedStateRegistry();
+ public final SavedStateRegistry<Bundle> getBundleSavedStateRegistry() {
+ return mSavedStateRegistry;
}
private class LifecycleAwareOnBackPressedCallback implements
diff --git a/animation/build.gradle b/animation/build.gradle
index 63a343f..ffacab8 100644
--- a/animation/build.gradle
+++ b/animation/build.gradle
@@ -25,7 +25,6 @@
dependencies {
implementation(project(":annotation"))
implementation(project(":core"))
- implementation(project(":collection"))
androidTestImplementation(TEST_EXT_JUNIT, libs.exclude_for_espresso)
androidTestImplementation(TEST_RULES, libs.exclude_for_espresso)
diff --git a/animation/integration-tests/testapp/src/androidTest/java/androidx/animation/AnimatorSetTest.java b/animation/integration-tests/testapp/src/androidTest/java/androidx/animation/AnimatorSetTest.java
index bce9743..9ad4a8bb 100644
--- a/animation/integration-tests/testapp/src/androidTest/java/androidx/animation/AnimatorSetTest.java
+++ b/animation/integration-tests/testapp/src/androidTest/java/androidx/animation/AnimatorSetTest.java
@@ -26,7 +26,7 @@
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.After;
import org.junit.Before;
@@ -37,7 +37,7 @@
import java.util.ArrayList;
import java.util.List;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class AnimatorSetTest {
private AnimatorSet mAnimatorSet;
diff --git a/animation/integration-tests/testapp/src/androidTest/java/androidx/animation/ObjectAnimatorTest.java b/animation/integration-tests/testapp/src/androidTest/java/androidx/animation/ObjectAnimatorTest.java
index 8997d92..d222dd5 100644
--- a/animation/integration-tests/testapp/src/androidTest/java/androidx/animation/ObjectAnimatorTest.java
+++ b/animation/integration-tests/testapp/src/androidTest/java/androidx/animation/ObjectAnimatorTest.java
@@ -27,7 +27,7 @@
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.After;
import org.junit.Before;
@@ -35,7 +35,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class ObjectAnimatorTest {
private static final float LINE1_START = -32f;
diff --git a/annotations/api/1.0.0.txt b/annotations/api/1.0.0.txt
index dc1c3ce..483b9e2 100644
--- a/annotations/api/1.0.0.txt
+++ b/annotations/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.annotation {
@java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnimRes {
diff --git a/annotations/api/1.1.0-alpha01.txt b/annotations/api/1.1.0-alpha01.txt
index d66f9f5..30c0941 100644
--- a/annotations/api/1.1.0-alpha01.txt
+++ b/annotations/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.annotation {
@java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnimRes {
@@ -41,7 +41,7 @@
@java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface ColorRes {
}
- @java.lang.annotation.Inherited @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public @interface ContentView {
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) @java.lang.annotation.Inherited public @interface ContentView {
method @LayoutRes public abstract int value();
}
@@ -128,7 +128,7 @@
@java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface PluralsRes {
}
- @Dimension(unit=androidx.annotation.Dimension.PX) @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface Px {
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) @Dimension(unit=androidx.annotation.Dimension.PX) public @interface Px {
}
@java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface RawRes {
@@ -163,7 +163,7 @@
method public abstract androidx.annotation.RestrictTo.Scope[] value();
}
- public enum RestrictTo.Scope {
+ public static enum RestrictTo.Scope {
enum_constant @Deprecated public static final androidx.annotation.RestrictTo.Scope GROUP_ID;
enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY;
enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP;
diff --git a/annotations/api/1.1.0-alpha02.txt b/annotations/api/1.1.0-alpha02.txt
deleted file mode 100644
index 7226b13..0000000
--- a/annotations/api/1.1.0-alpha02.txt
+++ /dev/null
@@ -1,246 +0,0 @@
-// Signature format: 3.0
-package androidx.annotation {
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnimRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnimatorRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnyRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface AnyThread {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface ArrayRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AttrRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface BinderThread {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface BoolRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface CallSuper {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) public @interface CheckResult {
- method public abstract String suggest() default "";
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface ColorInt {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface ColorLong {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface ColorRes {
- }
-
- @java.lang.annotation.Inherited @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public @interface ContentView {
- method @LayoutRes public abstract int value();
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface DimenRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface Dimension {
- method @DimensionUnit public abstract int unit() default androidx.annotation.Dimension.PX;
- field public static final int DP = 0; // 0x0
- field public static final int PX = 1; // 0x1
- field public static final int SP = 2; // 0x2
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface DrawableRes {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface FloatRange {
- method public abstract double from() default java.lang.Double.NEGATIVE_INFINITY;
- method public abstract boolean fromInclusive() default true;
- method public abstract double to() default java.lang.Double.POSITIVE_INFINITY;
- method public abstract boolean toInclusive() default true;
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface FontRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface FractionRes {
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface GuardedBy {
- method public abstract String value();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.FIELD}) public @interface HalfFloat {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface IdRes {
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public @interface InspectableProperty {
- method public abstract int attributeId() default 0;
- method public abstract androidx.annotation.InspectableProperty.EnumMap[] enumMapping() default {};
- method public abstract androidx.annotation.InspectableProperty.FlagMap[] flagMapping() default {};
- method public abstract boolean hasAttributeId() default true;
- method public abstract String name() default "";
- method public abstract androidx.annotation.InspectableProperty.ValueType valueType() default androidx.annotation.InspectableProperty.ValueType.INFERRED;
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface InspectableProperty.EnumMap {
- method public abstract String name();
- method public abstract int value();
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface InspectableProperty.FlagMap {
- method public abstract int mask() default 0;
- method public abstract String name();
- method public abstract int target();
- }
-
- public enum InspectableProperty.ValueType {
- enum_constant public static final androidx.annotation.InspectableProperty.ValueType COLOR;
- enum_constant public static final androidx.annotation.InspectableProperty.ValueType GRAVITY;
- enum_constant public static final androidx.annotation.InspectableProperty.ValueType INFERRED;
- enum_constant public static final androidx.annotation.InspectableProperty.ValueType INT_ENUM;
- enum_constant public static final androidx.annotation.InspectableProperty.ValueType INT_FLAG;
- enum_constant public static final androidx.annotation.InspectableProperty.ValueType NONE;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface IntDef {
- method public abstract boolean flag() default false;
- method public abstract boolean open() default false;
- method public abstract int[] value() default {};
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface IntRange {
- method public abstract long from() default java.lang.Long.MIN_VALUE;
- method public abstract long to() default java.lang.Long.MAX_VALUE;
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface IntegerRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface InterpolatorRes {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PACKAGE, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD}) public @interface Keep {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface LayoutRes {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface LongDef {
- method public abstract boolean flag() default false;
- method public abstract boolean open() default false;
- method public abstract long[] value() default {};
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface MainThread {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface MenuRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface NavigationRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.PACKAGE}) public @interface NonNull {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.PACKAGE}) public @interface Nullable {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface PluralsRes {
- }
-
- @Dimension(unit=androidx.annotation.Dimension.PX) @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface Px {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface RawRes {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.PACKAGE}) public @interface RequiresApi {
- method @IntRange(from=1) public abstract int api() default 1;
- method @IntRange(from=1) public abstract int value() default 1;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR}) public @interface RequiresFeature {
- method public abstract String enforcement();
- method public abstract String name();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.PARAMETER}) public @interface RequiresPermission {
- method public abstract String[] allOf() default {};
- method public abstract String[] anyOf() default {};
- method public abstract boolean conditional() default false;
- method public abstract String value() default "";
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public static @interface RequiresPermission.Read {
- method public abstract androidx.annotation.RequiresPermission value() default @androidx.annotation.RequiresPermission;
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public static @interface RequiresPermission.Write {
- method public abstract androidx.annotation.RequiresPermission value() default @androidx.annotation.RequiresPermission;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.PACKAGE}) public @interface RestrictTo {
- method public abstract androidx.annotation.RestrictTo.Scope[] value();
- }
-
- public enum RestrictTo.Scope {
- enum_constant @Deprecated public static final androidx.annotation.RestrictTo.Scope GROUP_ID;
- enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY;
- enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP;
- enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP_PREFIX;
- enum_constant public static final androidx.annotation.RestrictTo.Scope SUBCLASSES;
- enum_constant public static final androidx.annotation.RestrictTo.Scope TESTS;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.LOCAL_VARIABLE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface Size {
- method public abstract long max() default java.lang.Long.MAX_VALUE;
- method public abstract long min() default java.lang.Long.MIN_VALUE;
- method public abstract long multiple() default 1;
- method public abstract long value() default -1;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface StringDef {
- method public abstract boolean open() default false;
- method public abstract String[] value() default {};
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface StringRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface StyleRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface StyleableRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public @interface TransitionRes {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface UiThread {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface VisibleForTesting {
- method @ProductionVisibility public abstract int otherwise() default androidx.annotation.VisibleForTesting.PRIVATE;
- field public static final int NONE = 5; // 0x5
- field public static final int PACKAGE_PRIVATE = 3; // 0x3
- field public static final int PRIVATE = 2; // 0x2
- field public static final int PROTECTED = 4; // 0x4
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.CONSTRUCTOR, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.PARAMETER}) public @interface WorkerThread {
- }
-
- @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface XmlRes {
- }
-
-}
-
diff --git a/annotations/api/current.txt b/annotations/api/current.txt
index 7226b13..30c0941 100644
--- a/annotations/api/current.txt
+++ b/annotations/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.annotation {
@java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface AnimRes {
@@ -41,7 +41,7 @@
@java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface ColorRes {
}
- @java.lang.annotation.Inherited @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public @interface ContentView {
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) @java.lang.annotation.Inherited public @interface ContentView {
method @LayoutRes public abstract int value();
}
@@ -81,35 +81,6 @@
@java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface IdRes {
}
- @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public @interface InspectableProperty {
- method public abstract int attributeId() default 0;
- method public abstract androidx.annotation.InspectableProperty.EnumMap[] enumMapping() default {};
- method public abstract androidx.annotation.InspectableProperty.FlagMap[] flagMapping() default {};
- method public abstract boolean hasAttributeId() default true;
- method public abstract String name() default "";
- method public abstract androidx.annotation.InspectableProperty.ValueType valueType() default androidx.annotation.InspectableProperty.ValueType.INFERRED;
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface InspectableProperty.EnumMap {
- method public abstract String name();
- method public abstract int value();
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface InspectableProperty.FlagMap {
- method public abstract int mask() default 0;
- method public abstract String name();
- method public abstract int target();
- }
-
- public enum InspectableProperty.ValueType {
- enum_constant public static final androidx.annotation.InspectableProperty.ValueType COLOR;
- enum_constant public static final androidx.annotation.InspectableProperty.ValueType GRAVITY;
- enum_constant public static final androidx.annotation.InspectableProperty.ValueType INFERRED;
- enum_constant public static final androidx.annotation.InspectableProperty.ValueType INT_ENUM;
- enum_constant public static final androidx.annotation.InspectableProperty.ValueType INT_FLAG;
- enum_constant public static final androidx.annotation.InspectableProperty.ValueType NONE;
- }
-
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.ANNOTATION_TYPE}) public @interface IntDef {
method public abstract boolean flag() default false;
method public abstract boolean open() default false;
@@ -157,7 +128,7 @@
@java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface PluralsRes {
}
- @Dimension(unit=androidx.annotation.Dimension.PX) @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface Px {
+ @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) @Dimension(unit=androidx.annotation.Dimension.PX) public @interface Px {
}
@java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface RawRes {
@@ -192,7 +163,7 @@
method public abstract androidx.annotation.RestrictTo.Scope[] value();
}
- public enum RestrictTo.Scope {
+ public static enum RestrictTo.Scope {
enum_constant @Deprecated public static final androidx.annotation.RestrictTo.Scope GROUP_ID;
enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY;
enum_constant public static final androidx.annotation.RestrictTo.Scope LIBRARY_GROUP;
diff --git a/annotations/api/restricted_1.0.0.txt b/annotations/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/annotations/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/annotations/api/restricted_1.1.0-alpha02.txt b/annotations/api/restricted_1.1.0-alpha02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/annotations/api/restricted_1.1.0-alpha02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/annotations/api/restricted_current.txt b/annotations/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/annotations/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/annotations/src/main/java/androidx/annotation/InspectableProperty.java b/annotations/src/main/java/androidx/annotation/InspectableProperty.java
deleted file mode 100644
index 634210f..0000000
--- a/annotations/src/main/java/androidx/annotation/InspectableProperty.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright 2019 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.annotation;
-
-
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.SOURCE;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-/**
- * Denotes that the annotated method is the getter for a resources-backed property that should be
- * shown in Android Studio's inspection tools.
- */
-@Target({METHOD})
-@Retention(SOURCE)
-public @interface InspectableProperty {
- /**
- * The name of the property.
- *
- * If left empty (the default), the property name will be inferred from the name of the getter
- * method.
- *
- * @return The name of the property.
- */
- String name() default "";
-
- /**
- * If the property is inflated from XML, the resource ID of its XML attribute.
- *
- * If left as the default, and {@link #hasAttributeId()} is true, the attribute ID will be
- * inferred from {@link #name()}.
- *
- * @return The attribute ID of the property or the default null resource ID
- */
- int attributeId() default 0;
-
- /**
- * If this property has an attribute ID.
- *
- * Set to false if the annotated property does not have an attribute ID, that is, it is not
- * inflated from an XML attribute. This will prevent the automatic inference of the attribute.
- *
- * @return Whether to infer an attribute ID if not supplied
- */
- boolean hasAttributeId() default true;
-
- /**
- * Specify how to interpret a value type packed into a primitive integer.
- *
- * @return A {@link ValueType}
- */
- ValueType valueType() default ValueType.INFERRED;
-
- /**
- * For enumerations packed into primitive {int} properties, map the values to string names.
- *
- * Note that {@code #enumMapping()} cannot be used simultaneously with {@link #flagMapping()}.
- *
- * @return An array of {@link EnumMap}, empty if not applicable
- */
- EnumMap[] enumMapping() default {};
-
- /**
- * For flags packed into primitive {int} properties, model the string names of the flags.
- *
- * Note that {@code #flagMapping()} cannot be used simultaneously with {@link #enumMapping()}.
- *
- * @return An array of {@link FlagMap}, empty if not applicable
- */
- FlagMap[] flagMapping() default {};
-
-
- /**
- * One entry in an enumeration packed into a primitive {int}.
- */
- @Target({TYPE})
- @Retention(SOURCE)
- @interface EnumMap {
- /**
- * The string name of this enumeration value.
- *
- * @return A string name
- */
- String name();
-
- /**
- * The integer value of this enumeration value.
- *
- * @return An integer value
- */
- int value();
- }
-
- /**
- * One flag value of many that may be packed into a primitive {int}.
- */
- @Target({TYPE})
- @Retention(SOURCE)
- @interface FlagMap {
- /**
- * The string name of this flag.
- *
- * @return A string name
- */
- String name();
-
- /**
- * A target value that the property's value must equal after masking.
- *
- * If a mask is not supplied (i.e., {@link #mask()} is 0), the target will be reused as the
- * mask. This handles the common case where no flags mutually exclude each other.
- *
- * @return The target value to compare against
- */
- int target();
-
- /**
- * A mask that the property will be bitwise anded with before comparing to the target.
- *
- * If set to 0 (the default), the value of {@link #target()} will be used as a mask. Zero
- * was chosen as the default since bitwise and with zero is always zero.
- *
- * @return A mask, or 0 to use the target as a mask
- */
- int mask() default 0;
- }
-
- /**
- * The type of value packed into a primitive {int}.
- */
- enum ValueType {
- /**
- * No special handling, property is considered to be a numeric value.
- */
- NONE,
-
- /**
- * The default the annotation processor infers the value type from context.
- */
- INFERRED,
-
- /**
- * Value packs an enumeration.
- *
- * This is inferred if {@link #enumMapping()} is specified.
- *
- * @see EnumMap
- */
- INT_ENUM,
-
- /**
- * Value packs flags, of which many may be enabled at once.
- *
- * This is inferred if {@link #flagMapping()} is specified.
- *
- * @see FlagMap
- */
- INT_FLAG,
-
- /**
- * Value packs color information.
- *
- * This is inferred from {@link ColorInt}, or {@link ColorLong} on the getter method.
- */
- COLOR,
-
- /**
- * Value packs gravity information.
- *
- * This type is not inferred and is non-trivial to represent using {@link FlagMap}.
- */
- GRAVITY
- }
-}
diff --git a/annotations/src/main/java/androidx/annotation/RestrictTo.java b/annotations/src/main/java/androidx/annotation/RestrictTo.java
index 461e1a4..ef7b243 100644
--- a/annotations/src/main/java/androidx/annotation/RestrictTo.java
+++ b/annotations/src/main/java/androidx/annotation/RestrictTo.java
@@ -77,16 +77,16 @@
* com.foo.bar:lib1 and com.foo.baz:lib2 where they share
* "com.foo.". Library com.bar.qux:lib3 however will not
* be able to use the restricted api because it only
- * shares the prefix "com." and not all the way until the
+ * shares the prefix "foo." and not all the way until the
* last ".".
*/
LIBRARY_GROUP_PREFIX,
/**
* Restrict usage to code within the same group ID (based on gradle
- * group ID). This is an alias for {@link #LIBRARY_GROUP_PREFIX}.
+ * group ID). This is an alias for {@link #LIBRARY_GROUP}.
*
- * @deprecated Use {@link #LIBRARY_GROUP_PREFIX} instead
+ * @deprecated Use {@link #LIBRARY_GROUP} instead
*/
@Deprecated
GROUP_ID,
diff --git a/annotations/src/main/resources/META-INF/proguard/androidx-annotations.pro b/annotations/src/main/resources/META-INF/proguard/androidx-annotations.pro
index cd1cd53..9f80a85 100644
--- a/annotations/src/main/resources/META-INF/proguard/androidx-annotations.pro
+++ b/annotations/src/main/resources/META-INF/proguard/androidx-annotations.pro
@@ -1,14 +1,13 @@
--keep,allowobfuscation @interface androidx.annotation.Keep
--keep @androidx.annotation.Keep class * {*;}
+-keep @android.support.annotation.Keep class * {*;}
-keepclasseswithmembers class * {
- @androidx.annotation.Keep <methods>;
+ @android.support.annotation.Keep <methods>;
}
-keepclasseswithmembers class * {
- @androidx.annotation.Keep <fields>;
+ @android.support.annotation.Keep <fields>;
}
-keepclasseswithmembers class * {
- @androidx.annotation.Keep <init>(...);
+ @android.support.annotation.Keep <init>(...);
}
diff --git a/appcompat/api/1.0.0.txt b/appcompat/api/1.0.0.txt
index 88b92ef..6993caa 100644
--- a/appcompat/api/1.0.0.txt
+++ b/appcompat/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.appcompat.app {
public abstract class ActionBar {
@@ -340,6 +340,16 @@
package androidx.appcompat.graphics.drawable {
+ public class AnimatedStateListDrawableCompat extends android.graphics.drawable.Drawable {
+ ctor public AnimatedStateListDrawableCompat();
+ method public void addState(int[], android.graphics.drawable.Drawable, int);
+ method public <T extends android.graphics.drawable.Drawable & android.graphics.drawable.Animatable> void addTransition(int, int, T, boolean);
+ method public static androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat? create(android.content.Context, @DrawableRes int, android.content.res.Resources.Theme?);
+ method public static androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat! createFromXmlInner(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method public void inflate(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method protected void setConstantState(androidx.appcompat.graphics.drawable.DrawableContainer.DrawableContainerState);
+ }
+
public class DrawerArrowDrawable extends android.graphics.drawable.Drawable {
ctor public DrawerArrowDrawable(android.content.Context!);
method public void draw(android.graphics.Canvas!);
diff --git a/appcompat/api/1.1.0-alpha01.txt b/appcompat/api/1.1.0-alpha01.txt
index fc197c6..ef5fed6 100644
--- a/appcompat/api/1.1.0-alpha01.txt
+++ b/appcompat/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.appcompat.app {
public abstract class ActionBar {
diff --git a/appcompat/api/1.1.0-alpha02.ignore b/appcompat/api/1.1.0-alpha02.ignore
deleted file mode 100644
index a6419a0..0000000
--- a/appcompat/api/1.1.0-alpha02.ignore
+++ /dev/null
@@ -1,5 +0,0 @@
-// Baseline format: 1.0
-HiddenSuperclass: androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat:
- Public class androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat stripped of unavailable superclass androidx.appcompat.graphics.drawable.StateListDrawable
-
-
diff --git a/appcompat/api/1.1.0-alpha02.txt b/appcompat/api/1.1.0-alpha02.txt
index ad4ae2a..e628e3f 100644
--- a/appcompat/api/1.1.0-alpha02.txt
+++ b/appcompat/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.appcompat.app {
public abstract class ActionBar {
@@ -343,25 +343,13 @@
package androidx.appcompat.graphics.drawable {
- public class AnimatedStateListDrawableCompat extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback androidx.core.graphics.drawable.TintAwareDrawable {
+ public class AnimatedStateListDrawableCompat extends android.graphics.drawable.Drawable implements androidx.core.graphics.drawable.TintAwareDrawable {
ctor public AnimatedStateListDrawableCompat();
method public void addState(int[], android.graphics.drawable.Drawable, int);
- method public void addState(int[]!, android.graphics.drawable.Drawable!);
method public <T extends android.graphics.drawable.Drawable & android.graphics.drawable.Animatable> void addTransition(int, int, T, boolean);
method public static androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat? create(android.content.Context, @DrawableRes int, android.content.res.Resources.Theme?);
method public static androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat! createFromXmlInner(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public void draw(android.graphics.Canvas);
- method public final android.graphics.drawable.Drawable.ConstantState! getConstantState();
- method public int getOpacity();
method public void inflate(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public void invalidateDrawable(android.graphics.drawable.Drawable);
- method public void scheduleDrawable(android.graphics.drawable.Drawable, Runnable, long);
- method public void setAlpha(int);
- method public void setColorFilter(android.graphics.ColorFilter!);
- method public void setDither(boolean);
- method public void setEnterFadeDuration(int);
- method public void setExitFadeDuration(int);
- method public void unscheduleDrawable(android.graphics.drawable.Drawable, Runnable);
}
public class DrawerArrowDrawable extends android.graphics.drawable.Drawable {
diff --git a/appcompat/api/1.1.0-alpha03.ignore b/appcompat/api/1.1.0-alpha03.ignore
deleted file mode 100644
index f8fc8c9..0000000
--- a/appcompat/api/1.1.0-alpha03.ignore
+++ /dev/null
@@ -1,5 +0,0 @@
-// Baseline format: 1.0
-RemovedPackage: androidx.appcompat.content.res:
- Removed package androidx.appcompat.content.res
-
-
diff --git a/appcompat/api/1.1.0-alpha03.txt b/appcompat/api/1.1.0-alpha03.txt
deleted file mode 100644
index 0b1a7fa..0000000
--- a/appcompat/api/1.1.0-alpha03.txt
+++ /dev/null
@@ -1,980 +0,0 @@
-// Signature format: 3.0
-package androidx.appcompat.app {
-
- public abstract class ActionBar {
- ctor public ActionBar();
- method public abstract void addOnMenuVisibilityListener(androidx.appcompat.app.ActionBar.OnMenuVisibilityListener!);
- method @Deprecated public abstract void addTab(androidx.appcompat.app.ActionBar.Tab!);
- method @Deprecated public abstract void addTab(androidx.appcompat.app.ActionBar.Tab!, boolean);
- method @Deprecated public abstract void addTab(androidx.appcompat.app.ActionBar.Tab!, int);
- method @Deprecated public abstract void addTab(androidx.appcompat.app.ActionBar.Tab!, int, boolean);
- method public abstract android.view.View! getCustomView();
- method public abstract int getDisplayOptions();
- method public float getElevation();
- method public abstract int getHeight();
- method public int getHideOffset();
- method @Deprecated public abstract int getNavigationItemCount();
- method @Deprecated public abstract int getNavigationMode();
- method @Deprecated public abstract int getSelectedNavigationIndex();
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab? getSelectedTab();
- method public abstract CharSequence? getSubtitle();
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! getTabAt(int);
- method @Deprecated public abstract int getTabCount();
- method public android.content.Context! getThemedContext();
- method public abstract CharSequence? getTitle();
- method public abstract void hide();
- method public boolean isHideOnContentScrollEnabled();
- method public abstract boolean isShowing();
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! newTab();
- method @Deprecated public abstract void removeAllTabs();
- method public abstract void removeOnMenuVisibilityListener(androidx.appcompat.app.ActionBar.OnMenuVisibilityListener!);
- method @Deprecated public abstract void removeTab(androidx.appcompat.app.ActionBar.Tab!);
- method @Deprecated public abstract void removeTabAt(int);
- method @Deprecated public abstract void selectTab(androidx.appcompat.app.ActionBar.Tab!);
- method public abstract void setBackgroundDrawable(android.graphics.drawable.Drawable?);
- method public abstract void setCustomView(android.view.View!);
- method public abstract void setCustomView(android.view.View!, androidx.appcompat.app.ActionBar.LayoutParams!);
- method public abstract void setCustomView(int);
- method public abstract void setDisplayHomeAsUpEnabled(boolean);
- method public abstract void setDisplayOptions(int);
- method public abstract void setDisplayOptions(int, int);
- method public abstract void setDisplayShowCustomEnabled(boolean);
- method public abstract void setDisplayShowHomeEnabled(boolean);
- method public abstract void setDisplayShowTitleEnabled(boolean);
- method public abstract void setDisplayUseLogoEnabled(boolean);
- method public void setElevation(float);
- method public void setHideOffset(int);
- method public void setHideOnContentScrollEnabled(boolean);
- method public void setHomeActionContentDescription(CharSequence?);
- method public void setHomeActionContentDescription(@StringRes int);
- method public void setHomeAsUpIndicator(android.graphics.drawable.Drawable?);
- method public void setHomeAsUpIndicator(@DrawableRes int);
- method public void setHomeButtonEnabled(boolean);
- method public abstract void setIcon(@DrawableRes int);
- method public abstract void setIcon(android.graphics.drawable.Drawable!);
- method @Deprecated public abstract void setListNavigationCallbacks(android.widget.SpinnerAdapter!, androidx.appcompat.app.ActionBar.OnNavigationListener!);
- method public abstract void setLogo(@DrawableRes int);
- method public abstract void setLogo(android.graphics.drawable.Drawable!);
- method @Deprecated public abstract void setNavigationMode(int);
- method @Deprecated public abstract void setSelectedNavigationItem(int);
- method public void setSplitBackgroundDrawable(android.graphics.drawable.Drawable!);
- method public void setStackedBackgroundDrawable(android.graphics.drawable.Drawable!);
- method public abstract void setSubtitle(CharSequence!);
- method public abstract void setSubtitle(int);
- method public abstract void setTitle(CharSequence!);
- method public abstract void setTitle(@StringRes int);
- method public abstract void show();
- field public static final int DISPLAY_HOME_AS_UP = 4; // 0x4
- field public static final int DISPLAY_SHOW_CUSTOM = 16; // 0x10
- field public static final int DISPLAY_SHOW_HOME = 2; // 0x2
- field public static final int DISPLAY_SHOW_TITLE = 8; // 0x8
- field public static final int DISPLAY_USE_LOGO = 1; // 0x1
- field @Deprecated public static final int NAVIGATION_MODE_LIST = 1; // 0x1
- field @Deprecated public static final int NAVIGATION_MODE_STANDARD = 0; // 0x0
- field @Deprecated public static final int NAVIGATION_MODE_TABS = 2; // 0x2
- }
-
- public static class ActionBar.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
- ctor public ActionBar.LayoutParams(android.content.Context, android.util.AttributeSet!);
- ctor public ActionBar.LayoutParams(int, int);
- ctor public ActionBar.LayoutParams(int, int, int);
- ctor public ActionBar.LayoutParams(int);
- ctor public ActionBar.LayoutParams(androidx.appcompat.app.ActionBar.LayoutParams!);
- ctor public ActionBar.LayoutParams(android.view.ViewGroup.LayoutParams!);
- field public int gravity;
- }
-
- public static interface ActionBar.OnMenuVisibilityListener {
- method public void onMenuVisibilityChanged(boolean);
- }
-
- @Deprecated public static interface ActionBar.OnNavigationListener {
- method @Deprecated public boolean onNavigationItemSelected(int, long);
- }
-
- @Deprecated public abstract static class ActionBar.Tab {
- ctor @Deprecated public ActionBar.Tab();
- method @Deprecated public abstract CharSequence! getContentDescription();
- method @Deprecated public abstract android.view.View! getCustomView();
- method @Deprecated public abstract android.graphics.drawable.Drawable! getIcon();
- method @Deprecated public abstract int getPosition();
- method @Deprecated public abstract Object! getTag();
- method @Deprecated public abstract CharSequence! getText();
- method @Deprecated public abstract void select();
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! setContentDescription(@StringRes int);
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! setContentDescription(CharSequence!);
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! setCustomView(android.view.View!);
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! setCustomView(int);
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! setIcon(android.graphics.drawable.Drawable!);
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! setIcon(@DrawableRes int);
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! setTabListener(androidx.appcompat.app.ActionBar.TabListener!);
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! setTag(Object!);
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! setText(CharSequence!);
- method @Deprecated public abstract androidx.appcompat.app.ActionBar.Tab! setText(int);
- field @Deprecated public static final int INVALID_POSITION = -1; // 0xffffffff
- }
-
- @Deprecated public static interface ActionBar.TabListener {
- method @Deprecated public void onTabReselected(androidx.appcompat.app.ActionBar.Tab!, androidx.fragment.app.FragmentTransaction!);
- method @Deprecated public void onTabSelected(androidx.appcompat.app.ActionBar.Tab!, androidx.fragment.app.FragmentTransaction!);
- method @Deprecated public void onTabUnselected(androidx.appcompat.app.ActionBar.Tab!, androidx.fragment.app.FragmentTransaction!);
- }
-
- public class ActionBarDrawerToggle implements androidx.drawerlayout.widget.DrawerLayout.DrawerListener {
- ctor public ActionBarDrawerToggle(android.app.Activity!, androidx.drawerlayout.widget.DrawerLayout!, @StringRes int, @StringRes int);
- ctor public ActionBarDrawerToggle(android.app.Activity!, androidx.drawerlayout.widget.DrawerLayout!, androidx.appcompat.widget.Toolbar!, @StringRes int, @StringRes int);
- method public androidx.appcompat.graphics.drawable.DrawerArrowDrawable getDrawerArrowDrawable();
- method public android.view.View.OnClickListener! getToolbarNavigationClickListener();
- method public boolean isDrawerIndicatorEnabled();
- method public boolean isDrawerSlideAnimationEnabled();
- method public void onConfigurationChanged(android.content.res.Configuration!);
- method public void onDrawerClosed(android.view.View!);
- method public void onDrawerOpened(android.view.View!);
- method public void onDrawerSlide(android.view.View!, float);
- method public void onDrawerStateChanged(int);
- method public boolean onOptionsItemSelected(android.view.MenuItem!);
- method public void setDrawerArrowDrawable(androidx.appcompat.graphics.drawable.DrawerArrowDrawable);
- method public void setDrawerIndicatorEnabled(boolean);
- method public void setDrawerSlideAnimationEnabled(boolean);
- method public void setHomeAsUpIndicator(android.graphics.drawable.Drawable!);
- method public void setHomeAsUpIndicator(int);
- method public void setToolbarNavigationClickListener(android.view.View.OnClickListener!);
- method public void syncState();
- }
-
- public static interface ActionBarDrawerToggle.Delegate {
- method public android.content.Context! getActionBarThemedContext();
- method public android.graphics.drawable.Drawable! getThemeUpIndicator();
- method public boolean isNavigationVisible();
- method public void setActionBarDescription(@StringRes int);
- method public void setActionBarUpIndicator(android.graphics.drawable.Drawable!, @StringRes int);
- }
-
- public static interface ActionBarDrawerToggle.DelegateProvider {
- method public androidx.appcompat.app.ActionBarDrawerToggle.Delegate? getDrawerToggleDelegate();
- }
-
- public class AlertDialog extends androidx.appcompat.app.AppCompatDialog implements android.content.DialogInterface {
- ctor protected AlertDialog(android.content.Context);
- ctor protected AlertDialog(android.content.Context, @StyleRes int);
- ctor protected AlertDialog(android.content.Context, boolean, android.content.DialogInterface.OnCancelListener?);
- method public android.widget.Button! getButton(int);
- method public android.widget.ListView! getListView();
- method public void setButton(int, CharSequence!, android.os.Message!);
- method public void setButton(int, CharSequence!, android.content.DialogInterface.OnClickListener!);
- method public void setButton(int, CharSequence!, android.graphics.drawable.Drawable!, android.content.DialogInterface.OnClickListener!);
- method public void setCustomTitle(android.view.View!);
- method public void setIcon(int);
- method public void setIcon(android.graphics.drawable.Drawable!);
- method public void setIconAttribute(int);
- method public void setMessage(CharSequence!);
- method public void setView(android.view.View!);
- method public void setView(android.view.View!, int, int, int, int);
- }
-
- public static class AlertDialog.Builder {
- ctor public AlertDialog.Builder(android.content.Context);
- ctor public AlertDialog.Builder(android.content.Context, @StyleRes int);
- method public androidx.appcompat.app.AlertDialog create();
- method public android.content.Context getContext();
- method public androidx.appcompat.app.AlertDialog.Builder! setAdapter(android.widget.ListAdapter!, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setCancelable(boolean);
- method public androidx.appcompat.app.AlertDialog.Builder! setCursor(android.database.Cursor!, android.content.DialogInterface.OnClickListener!, String!);
- method public androidx.appcompat.app.AlertDialog.Builder! setCustomTitle(android.view.View?);
- method public androidx.appcompat.app.AlertDialog.Builder! setIcon(@DrawableRes int);
- method public androidx.appcompat.app.AlertDialog.Builder! setIcon(android.graphics.drawable.Drawable?);
- method public androidx.appcompat.app.AlertDialog.Builder! setIconAttribute(@AttrRes int);
- method @Deprecated public androidx.appcompat.app.AlertDialog.Builder! setInverseBackgroundForced(boolean);
- method public androidx.appcompat.app.AlertDialog.Builder! setItems(@ArrayRes int, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setItems(CharSequence[]!, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setMessage(@StringRes int);
- method public androidx.appcompat.app.AlertDialog.Builder! setMessage(CharSequence?);
- method public androidx.appcompat.app.AlertDialog.Builder! setMultiChoiceItems(@ArrayRes int, boolean[]!, android.content.DialogInterface.OnMultiChoiceClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setMultiChoiceItems(CharSequence[]!, boolean[]!, android.content.DialogInterface.OnMultiChoiceClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setMultiChoiceItems(android.database.Cursor!, String!, String!, android.content.DialogInterface.OnMultiChoiceClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setNegativeButton(@StringRes int, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setNegativeButton(CharSequence!, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setNegativeButtonIcon(android.graphics.drawable.Drawable!);
- method public androidx.appcompat.app.AlertDialog.Builder! setNeutralButton(@StringRes int, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setNeutralButton(CharSequence!, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setNeutralButtonIcon(android.graphics.drawable.Drawable!);
- method public androidx.appcompat.app.AlertDialog.Builder! setOnCancelListener(android.content.DialogInterface.OnCancelListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setOnDismissListener(android.content.DialogInterface.OnDismissListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setOnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setOnKeyListener(android.content.DialogInterface.OnKeyListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setPositiveButton(@StringRes int, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setPositiveButton(CharSequence!, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setPositiveButtonIcon(android.graphics.drawable.Drawable!);
- method public androidx.appcompat.app.AlertDialog.Builder! setSingleChoiceItems(@ArrayRes int, int, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setSingleChoiceItems(android.database.Cursor!, int, String!, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setSingleChoiceItems(CharSequence[]!, int, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setSingleChoiceItems(android.widget.ListAdapter!, int, android.content.DialogInterface.OnClickListener!);
- method public androidx.appcompat.app.AlertDialog.Builder! setTitle(@StringRes int);
- method public androidx.appcompat.app.AlertDialog.Builder! setTitle(CharSequence?);
- method public androidx.appcompat.app.AlertDialog.Builder! setView(int);
- method public androidx.appcompat.app.AlertDialog.Builder! setView(android.view.View!);
- method public androidx.appcompat.app.AlertDialog! show();
- }
-
- public class AppCompatActivity extends androidx.fragment.app.FragmentActivity implements androidx.appcompat.app.ActionBarDrawerToggle.DelegateProvider androidx.appcompat.app.AppCompatCallback androidx.core.app.TaskStackBuilder.SupportParentable {
- ctor public AppCompatActivity();
- method public androidx.appcompat.app.AppCompatDelegate getDelegate();
- method public androidx.appcompat.app.ActionBarDrawerToggle.Delegate? getDrawerToggleDelegate();
- method public androidx.appcompat.app.ActionBar? getSupportActionBar();
- method public android.content.Intent? getSupportParentActivityIntent();
- method public void onCreateSupportNavigateUpTaskStack(androidx.core.app.TaskStackBuilder);
- method public final boolean onMenuItemSelected(int, android.view.MenuItem);
- method protected void onNightModeChanged(int);
- method public void onPrepareSupportNavigateUpTaskStack(androidx.core.app.TaskStackBuilder);
- method @CallSuper public void onSupportActionModeFinished(androidx.appcompat.view.ActionMode);
- method @CallSuper public void onSupportActionModeStarted(androidx.appcompat.view.ActionMode);
- method @Deprecated public void onSupportContentChanged();
- method public boolean onSupportNavigateUp();
- method public androidx.appcompat.view.ActionMode? onWindowStartingSupportActionMode(androidx.appcompat.view.ActionMode.Callback);
- method public void setSupportActionBar(androidx.appcompat.widget.Toolbar?);
- method @Deprecated public void setSupportProgress(int);
- method @Deprecated public void setSupportProgressBarIndeterminate(boolean);
- method @Deprecated public void setSupportProgressBarIndeterminateVisibility(boolean);
- method @Deprecated public void setSupportProgressBarVisibility(boolean);
- method public androidx.appcompat.view.ActionMode? startSupportActionMode(androidx.appcompat.view.ActionMode.Callback);
- method public void supportInvalidateOptionsMenu();
- method public void supportNavigateUpTo(android.content.Intent);
- method public boolean supportRequestWindowFeature(int);
- method public boolean supportShouldUpRecreateTask(android.content.Intent);
- }
-
- public interface AppCompatCallback {
- method public void onSupportActionModeFinished(androidx.appcompat.view.ActionMode!);
- method public void onSupportActionModeStarted(androidx.appcompat.view.ActionMode!);
- method public androidx.appcompat.view.ActionMode? onWindowStartingSupportActionMode(androidx.appcompat.view.ActionMode.Callback!);
- }
-
- public abstract class AppCompatDelegate {
- method public abstract void addContentView(android.view.View!, android.view.ViewGroup.LayoutParams!);
- method public abstract boolean applyDayNight();
- method public void attachBaseContext(android.content.Context!);
- method public static androidx.appcompat.app.AppCompatDelegate create(android.app.Activity, androidx.appcompat.app.AppCompatCallback?);
- method public static androidx.appcompat.app.AppCompatDelegate create(android.app.Dialog, androidx.appcompat.app.AppCompatCallback?);
- method public static androidx.appcompat.app.AppCompatDelegate create(android.content.Context, android.view.Window, androidx.appcompat.app.AppCompatCallback?);
- method public abstract android.view.View! createView(android.view.View?, String!, android.content.Context, android.util.AttributeSet);
- method public abstract <T extends android.view.View> T! findViewById(@IdRes int);
- method public static int getDefaultNightMode();
- method public abstract androidx.appcompat.app.ActionBarDrawerToggle.Delegate? getDrawerToggleDelegate();
- method public int getLocalNightMode();
- method public abstract android.view.MenuInflater! getMenuInflater();
- method public abstract androidx.appcompat.app.ActionBar? getSupportActionBar();
- method public abstract boolean hasWindowFeature(int);
- method public abstract void installViewFactory();
- method public abstract void invalidateOptionsMenu();
- method public static boolean isCompatVectorFromResourcesEnabled();
- method public abstract boolean isHandleNativeActionModesEnabled();
- method public abstract void onConfigurationChanged(android.content.res.Configuration!);
- method public abstract void onCreate(android.os.Bundle!);
- method public abstract void onDestroy();
- method public abstract void onPostCreate(android.os.Bundle!);
- method public abstract void onPostResume();
- method public abstract void onSaveInstanceState(android.os.Bundle!);
- method public void onSetTheme(@StyleRes int);
- method public abstract void onStart();
- method public abstract void onStop();
- method public abstract boolean requestWindowFeature(int);
- method public static void setCompatVectorFromResourcesEnabled(boolean);
- method public abstract void setContentView(android.view.View!);
- method public abstract void setContentView(@LayoutRes int);
- method public abstract void setContentView(android.view.View!, android.view.ViewGroup.LayoutParams!);
- method public static void setDefaultNightMode(int);
- method public abstract void setHandleNativeActionModesEnabled(boolean);
- method public abstract void setLocalNightMode(int);
- method public abstract void setSupportActionBar(androidx.appcompat.widget.Toolbar?);
- method public abstract void setTitle(CharSequence?);
- method public abstract androidx.appcompat.view.ActionMode? startSupportActionMode(androidx.appcompat.view.ActionMode.Callback);
- field public static final int FEATURE_ACTION_MODE_OVERLAY = 10; // 0xa
- field public static final int FEATURE_SUPPORT_ACTION_BAR = 108; // 0x6c
- field public static final int FEATURE_SUPPORT_ACTION_BAR_OVERLAY = 109; // 0x6d
- field @Deprecated public static final int MODE_NIGHT_AUTO = 0; // 0x0
- field public static final int MODE_NIGHT_AUTO_BATTERY = 3; // 0x3
- field @Deprecated public static final int MODE_NIGHT_AUTO_TIME = 0; // 0x0
- field public static final int MODE_NIGHT_FOLLOW_SYSTEM = -1; // 0xffffffff
- field public static final int MODE_NIGHT_NO = 1; // 0x1
- field public static final int MODE_NIGHT_UNSPECIFIED = -100; // 0xffffff9c
- field public static final int MODE_NIGHT_YES = 2; // 0x2
- }
-
- public class AppCompatDialog extends android.app.Dialog implements androidx.appcompat.app.AppCompatCallback {
- ctor public AppCompatDialog(android.content.Context!);
- ctor public AppCompatDialog(android.content.Context!, int);
- ctor protected AppCompatDialog(android.content.Context!, boolean, android.content.DialogInterface.OnCancelListener!);
- method public androidx.appcompat.app.AppCompatDelegate! getDelegate();
- method public androidx.appcompat.app.ActionBar! getSupportActionBar();
- method public void onSupportActionModeFinished(androidx.appcompat.view.ActionMode!);
- method public void onSupportActionModeStarted(androidx.appcompat.view.ActionMode!);
- method public androidx.appcompat.view.ActionMode? onWindowStartingSupportActionMode(androidx.appcompat.view.ActionMode.Callback!);
- method public boolean supportRequestWindowFeature(int);
- }
-
- public class AppCompatDialogFragment extends androidx.fragment.app.DialogFragment {
- ctor public AppCompatDialogFragment();
- }
-
- public class AppCompatViewInflater {
- ctor public AppCompatViewInflater();
- method protected androidx.appcompat.widget.AppCompatAutoCompleteTextView createAutoCompleteTextView(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatButton createButton(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatCheckBox createCheckBox(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatCheckedTextView createCheckedTextView(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatEditText createEditText(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatImageButton createImageButton(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatImageView createImageView(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatMultiAutoCompleteTextView createMultiAutoCompleteTextView(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatRadioButton createRadioButton(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatRatingBar createRatingBar(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatSeekBar createSeekBar(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatSpinner createSpinner(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatTextView createTextView(android.content.Context!, android.util.AttributeSet!);
- method protected androidx.appcompat.widget.AppCompatToggleButton createToggleButton(android.content.Context!, android.util.AttributeSet!);
- method protected android.view.View? createView(android.content.Context!, String!, android.util.AttributeSet!);
- }
-
-}
-
-package androidx.appcompat.graphics.drawable {
-
- public class DrawerArrowDrawable extends android.graphics.drawable.Drawable {
- ctor public DrawerArrowDrawable(android.content.Context!);
- method public void draw(android.graphics.Canvas!);
- method public float getArrowHeadLength();
- method public float getArrowShaftLength();
- method public float getBarLength();
- method public float getBarThickness();
- method @ColorInt public int getColor();
- method public int getDirection();
- method public float getGapSize();
- method public int getOpacity();
- method public final android.graphics.Paint! getPaint();
- method @FloatRange(from=0.0, to=1.0) public float getProgress();
- method public boolean isSpinEnabled();
- method public void setAlpha(int);
- method public void setArrowHeadLength(float);
- method public void setArrowShaftLength(float);
- method public void setBarLength(float);
- method public void setBarThickness(float);
- method public void setColor(@ColorInt int);
- method public void setColorFilter(android.graphics.ColorFilter!);
- method public void setDirection(int);
- method public void setGapSize(float);
- method public void setProgress(@FloatRange(from=0.0, to=1.0) float);
- method public void setSpinEnabled(boolean);
- method public void setVerticalMirror(boolean);
- field public static final int ARROW_DIRECTION_END = 3; // 0x3
- field public static final int ARROW_DIRECTION_LEFT = 0; // 0x0
- field public static final int ARROW_DIRECTION_RIGHT = 1; // 0x1
- field public static final int ARROW_DIRECTION_START = 2; // 0x2
- }
-
-}
-
-package androidx.appcompat.view {
-
- public abstract class ActionMode {
- ctor public ActionMode();
- method public abstract void finish();
- method public abstract android.view.View! getCustomView();
- method public abstract android.view.Menu! getMenu();
- method public abstract android.view.MenuInflater! getMenuInflater();
- method public abstract CharSequence! getSubtitle();
- method public Object! getTag();
- method public abstract CharSequence! getTitle();
- method public boolean getTitleOptionalHint();
- method public abstract void invalidate();
- method public boolean isTitleOptional();
- method public abstract void setCustomView(android.view.View!);
- method public abstract void setSubtitle(CharSequence!);
- method public abstract void setSubtitle(int);
- method public void setTag(Object!);
- method public abstract void setTitle(CharSequence!);
- method public abstract void setTitle(int);
- method public void setTitleOptionalHint(boolean);
- }
-
- public static interface ActionMode.Callback {
- method public boolean onActionItemClicked(androidx.appcompat.view.ActionMode!, android.view.MenuItem!);
- method public boolean onCreateActionMode(androidx.appcompat.view.ActionMode!, android.view.Menu!);
- method public void onDestroyActionMode(androidx.appcompat.view.ActionMode!);
- method public boolean onPrepareActionMode(androidx.appcompat.view.ActionMode!, android.view.Menu!);
- }
-
- public interface CollapsibleActionView {
- method public void onActionViewCollapsed();
- method public void onActionViewExpanded();
- }
-
- public class ContextThemeWrapper extends android.content.ContextWrapper {
- ctor public ContextThemeWrapper();
- ctor public ContextThemeWrapper(android.content.Context!, @StyleRes int);
- ctor public ContextThemeWrapper(android.content.Context!, android.content.res.Resources.Theme!);
- method public void applyOverrideConfiguration(android.content.res.Configuration!);
- method public int getThemeResId();
- method protected void onApplyThemeResource(android.content.res.Resources.Theme!, int, boolean);
- }
-
-}
-
-package androidx.appcompat.widget {
-
- public class ActionMenuView extends androidx.appcompat.widget.LinearLayoutCompat {
- ctor public ActionMenuView(android.content.Context!);
- ctor public ActionMenuView(android.content.Context!, android.util.AttributeSet!);
- method public void dismissPopupMenus();
- method protected androidx.appcompat.widget.ActionMenuView.LayoutParams! generateDefaultLayoutParams();
- method public androidx.appcompat.widget.ActionMenuView.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
- method protected androidx.appcompat.widget.ActionMenuView.LayoutParams! generateLayoutParams(android.view.ViewGroup.LayoutParams!);
- method public android.view.Menu! getMenu();
- method public android.graphics.drawable.Drawable? getOverflowIcon();
- method public int getPopupTheme();
- method public boolean hideOverflowMenu();
- method public boolean isOverflowMenuShowing();
- method public void onConfigurationChanged(android.content.res.Configuration!);
- method public void onDetachedFromWindow();
- method public void setOnMenuItemClickListener(androidx.appcompat.widget.ActionMenuView.OnMenuItemClickListener!);
- method public void setOverflowIcon(android.graphics.drawable.Drawable?);
- method public void setPopupTheme(@StyleRes int);
- method public boolean showOverflowMenu();
- }
-
- public static class ActionMenuView.LayoutParams extends androidx.appcompat.widget.LinearLayoutCompat.LayoutParams {
- ctor public ActionMenuView.LayoutParams(android.content.Context!, android.util.AttributeSet!);
- ctor public ActionMenuView.LayoutParams(android.view.ViewGroup.LayoutParams!);
- ctor public ActionMenuView.LayoutParams(androidx.appcompat.widget.ActionMenuView.LayoutParams!);
- ctor public ActionMenuView.LayoutParams(int, int);
- field @android.view.ViewDebug.ExportedProperty public int cellsUsed;
- field @android.view.ViewDebug.ExportedProperty public boolean expandable;
- field @android.view.ViewDebug.ExportedProperty public int extraPixels;
- field @android.view.ViewDebug.ExportedProperty public boolean isOverflowButton;
- field @android.view.ViewDebug.ExportedProperty public boolean preventEdgeOffset;
- }
-
- public static interface ActionMenuView.OnMenuItemClickListener {
- method public boolean onMenuItemClick(android.view.MenuItem!);
- }
-
- public class AppCompatAutoCompleteTextView extends android.widget.AutoCompleteTextView implements androidx.core.view.TintableBackgroundView {
- ctor public AppCompatAutoCompleteTextView(android.content.Context!);
- ctor public AppCompatAutoCompleteTextView(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatAutoCompleteTextView(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method public void setTextAppearance(android.content.Context!, int);
- }
-
- public class AppCompatButton extends android.widget.Button implements androidx.core.widget.AutoSizeableTextView androidx.core.view.TintableBackgroundView {
- ctor public AppCompatButton(android.content.Context!);
- ctor public AppCompatButton(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatButton(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int) throws java.lang.IllegalArgumentException;
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setAutoSizeTextTypeUniformWithPresetSizes(int[], int) throws java.lang.IllegalArgumentException;
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method public void setSupportAllCaps(boolean);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method public void setTextAppearance(android.content.Context!, int);
- }
-
- public class AppCompatCheckBox extends android.widget.CheckBox implements androidx.core.view.TintableBackgroundView androidx.core.widget.TintableCompoundButton {
- ctor public AppCompatCheckBox(android.content.Context!);
- ctor public AppCompatCheckBox(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatCheckBox(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportButtonTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportButtonTintMode();
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportButtonTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportButtonTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public class AppCompatCheckedTextView extends android.widget.CheckedTextView {
- ctor public AppCompatCheckedTextView(android.content.Context!);
- ctor public AppCompatCheckedTextView(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatCheckedTextView(android.content.Context!, android.util.AttributeSet!, int);
- method public void setTextAppearance(android.content.Context!, int);
- }
-
- public class AppCompatEditText extends android.widget.EditText implements androidx.core.view.TintableBackgroundView {
- ctor public AppCompatEditText(android.content.Context!);
- ctor public AppCompatEditText(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatEditText(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method public void setTextAppearance(android.content.Context!, int);
- }
-
- public class AppCompatImageButton extends android.widget.ImageButton implements androidx.core.view.TintableBackgroundView androidx.core.widget.TintableImageSourceView {
- ctor public AppCompatImageButton(android.content.Context!);
- ctor public AppCompatImageButton(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatImageButton(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportImageTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportImageTintMode();
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportImageTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportImageTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public class AppCompatImageView extends android.widget.ImageView implements androidx.core.view.TintableBackgroundView androidx.core.widget.TintableImageSourceView {
- ctor public AppCompatImageView(android.content.Context!);
- ctor public AppCompatImageView(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatImageView(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportImageTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportImageTintMode();
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportImageTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportImageTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public class AppCompatMultiAutoCompleteTextView extends android.widget.MultiAutoCompleteTextView implements androidx.core.view.TintableBackgroundView {
- ctor public AppCompatMultiAutoCompleteTextView(android.content.Context!);
- ctor public AppCompatMultiAutoCompleteTextView(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatMultiAutoCompleteTextView(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method public void setTextAppearance(android.content.Context!, int);
- }
-
- public class AppCompatRadioButton extends android.widget.RadioButton implements androidx.core.view.TintableBackgroundView androidx.core.widget.TintableCompoundButton {
- ctor public AppCompatRadioButton(android.content.Context!);
- ctor public AppCompatRadioButton(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatRadioButton(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportButtonTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportButtonTintMode();
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportButtonTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportButtonTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public class AppCompatRatingBar extends android.widget.RatingBar {
- ctor public AppCompatRatingBar(android.content.Context!);
- ctor public AppCompatRatingBar(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatRatingBar(android.content.Context!, android.util.AttributeSet!, int);
- }
-
- public class AppCompatSeekBar extends android.widget.SeekBar {
- ctor public AppCompatSeekBar(android.content.Context!);
- ctor public AppCompatSeekBar(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatSeekBar(android.content.Context!, android.util.AttributeSet!, int);
- }
-
- public class AppCompatSpinner extends android.widget.Spinner implements androidx.core.view.TintableBackgroundView {
- ctor public AppCompatSpinner(android.content.Context!);
- ctor public AppCompatSpinner(android.content.Context!, int);
- ctor public AppCompatSpinner(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatSpinner(android.content.Context!, android.util.AttributeSet!, int);
- ctor public AppCompatSpinner(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public AppCompatSpinner(android.content.Context!, android.util.AttributeSet!, int, int, android.content.res.Resources.Theme!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public class AppCompatTextView extends android.widget.TextView implements androidx.core.widget.AutoSizeableTextView androidx.core.view.TintableBackgroundView androidx.core.widget.TintableCompoundDrawablesView {
- ctor public AppCompatTextView(android.content.Context!);
- ctor public AppCompatTextView(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatTextView(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportCompoundDrawablesTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportCompoundDrawablesTintMode();
- method public androidx.core.text.PrecomputedTextCompat.Params getTextMetricsParamsCompat();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int) throws java.lang.IllegalArgumentException;
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setAutoSizeTextTypeUniformWithPresetSizes(int[], int) throws java.lang.IllegalArgumentException;
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method public void setPrecomputedText(androidx.core.text.PrecomputedTextCompat);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportCompoundDrawablesTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportCompoundDrawablesTintMode(android.graphics.PorterDuff.Mode?);
- method public void setTextAppearance(android.content.Context!, int);
- method public void setTextFuture(java.util.concurrent.Future<androidx.core.text.PrecomputedTextCompat>?);
- method public void setTextMetricsParamsCompat(androidx.core.text.PrecomputedTextCompat.Params);
- }
-
- public class AppCompatToggleButton extends android.widget.ToggleButton {
- ctor public AppCompatToggleButton(android.content.Context!);
- ctor public AppCompatToggleButton(android.content.Context!, android.util.AttributeSet!);
- ctor public AppCompatToggleButton(android.content.Context!, android.util.AttributeSet!, int);
- }
-
- public class LinearLayoutCompat extends android.view.ViewGroup {
- ctor public LinearLayoutCompat(android.content.Context!);
- ctor public LinearLayoutCompat(android.content.Context!, android.util.AttributeSet!);
- ctor public LinearLayoutCompat(android.content.Context!, android.util.AttributeSet!, int);
- method protected androidx.appcompat.widget.LinearLayoutCompat.LayoutParams! generateDefaultLayoutParams();
- method public androidx.appcompat.widget.LinearLayoutCompat.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
- method protected androidx.appcompat.widget.LinearLayoutCompat.LayoutParams! generateLayoutParams(android.view.ViewGroup.LayoutParams!);
- method public int getBaselineAlignedChildIndex();
- method public android.graphics.drawable.Drawable! getDividerDrawable();
- method public int getDividerPadding();
- method public int getGravity();
- method public int getOrientation();
- method public int getShowDividers();
- method public float getWeightSum();
- method public boolean isBaselineAligned();
- method public boolean isMeasureWithLargestChildEnabled();
- method public void setBaselineAligned(boolean);
- method public void setBaselineAlignedChildIndex(int);
- method public void setDividerDrawable(android.graphics.drawable.Drawable!);
- method public void setDividerPadding(int);
- method public void setGravity(int);
- method public void setHorizontalGravity(int);
- method public void setMeasureWithLargestChildEnabled(boolean);
- method public void setOrientation(int);
- method public void setShowDividers(int);
- method public void setVerticalGravity(int);
- method public void setWeightSum(float);
- field public static final int HORIZONTAL = 0; // 0x0
- field public static final int SHOW_DIVIDER_BEGINNING = 1; // 0x1
- field public static final int SHOW_DIVIDER_END = 4; // 0x4
- field public static final int SHOW_DIVIDER_MIDDLE = 2; // 0x2
- field public static final int SHOW_DIVIDER_NONE = 0; // 0x0
- field public static final int VERTICAL = 1; // 0x1
- }
-
- public static class LinearLayoutCompat.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
- ctor public LinearLayoutCompat.LayoutParams(android.content.Context!, android.util.AttributeSet!);
- ctor public LinearLayoutCompat.LayoutParams(int, int);
- ctor public LinearLayoutCompat.LayoutParams(int, int, float);
- ctor public LinearLayoutCompat.LayoutParams(android.view.ViewGroup.LayoutParams!);
- ctor public LinearLayoutCompat.LayoutParams(android.view.ViewGroup.MarginLayoutParams!);
- ctor public LinearLayoutCompat.LayoutParams(androidx.appcompat.widget.LinearLayoutCompat.LayoutParams!);
- field public int gravity;
- field public float weight;
- }
-
- public class ListPopupWindow {
- ctor public ListPopupWindow(android.content.Context);
- ctor public ListPopupWindow(android.content.Context, android.util.AttributeSet?);
- ctor public ListPopupWindow(android.content.Context, android.util.AttributeSet?, @AttrRes int);
- ctor public ListPopupWindow(android.content.Context, android.util.AttributeSet?, @AttrRes int, @StyleRes int);
- method public void clearListSelection();
- method public android.view.View.OnTouchListener! createDragToOpenListener(android.view.View!);
- method public void dismiss();
- method public android.view.View? getAnchorView();
- method @StyleRes public int getAnimationStyle();
- method public android.graphics.drawable.Drawable? getBackground();
- method public android.graphics.Rect? getEpicenterBounds();
- method public int getHeight();
- method public int getHorizontalOffset();
- method public int getInputMethodMode();
- method public android.widget.ListView? getListView();
- method public int getPromptPosition();
- method public Object? getSelectedItem();
- method public long getSelectedItemId();
- method public int getSelectedItemPosition();
- method public android.view.View? getSelectedView();
- method public int getSoftInputMode();
- method public int getVerticalOffset();
- method public int getWidth();
- method public boolean isInputMethodNotNeeded();
- method public boolean isModal();
- method public boolean isShowing();
- method public boolean onKeyDown(int, android.view.KeyEvent);
- method public boolean onKeyPreIme(int, android.view.KeyEvent);
- method public boolean onKeyUp(int, android.view.KeyEvent);
- method public boolean performItemClick(int);
- method public void postShow();
- method public void setAdapter(android.widget.ListAdapter?);
- method public void setAnchorView(android.view.View?);
- method public void setAnimationStyle(@StyleRes int);
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
- method public void setContentWidth(int);
- method public void setDropDownGravity(int);
- method public void setEpicenterBounds(android.graphics.Rect?);
- method public void setHeight(int);
- method public void setHorizontalOffset(int);
- method public void setInputMethodMode(int);
- method public void setListSelector(android.graphics.drawable.Drawable!);
- method public void setModal(boolean);
- method public void setOnDismissListener(android.widget.PopupWindow.OnDismissListener?);
- method public void setOnItemClickListener(android.widget.AdapterView.OnItemClickListener?);
- method public void setOnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener?);
- method public void setPromptPosition(int);
- method public void setPromptView(android.view.View?);
- method public void setSelection(int);
- method public void setSoftInputMode(int);
- method public void setVerticalOffset(int);
- method public void setWidth(int);
- method public void setWindowLayoutType(int);
- method public void show();
- field public static final int INPUT_METHOD_FROM_FOCUSABLE = 0; // 0x0
- field public static final int INPUT_METHOD_NEEDED = 1; // 0x1
- field public static final int INPUT_METHOD_NOT_NEEDED = 2; // 0x2
- field public static final int MATCH_PARENT = -1; // 0xffffffff
- field public static final int POSITION_PROMPT_ABOVE = 0; // 0x0
- field public static final int POSITION_PROMPT_BELOW = 1; // 0x1
- field public static final int WRAP_CONTENT = -2; // 0xfffffffe
- }
-
- public class PopupMenu {
- ctor public PopupMenu(android.content.Context, android.view.View);
- ctor public PopupMenu(android.content.Context, android.view.View, int);
- ctor public PopupMenu(android.content.Context, android.view.View, int, @AttrRes int, @StyleRes int);
- method public void dismiss();
- method public android.view.View.OnTouchListener getDragToOpenListener();
- method public int getGravity();
- method public android.view.Menu getMenu();
- method public android.view.MenuInflater getMenuInflater();
- method public void inflate(@MenuRes int);
- method public void setGravity(int);
- method public void setOnDismissListener(androidx.appcompat.widget.PopupMenu.OnDismissListener?);
- method public void setOnMenuItemClickListener(androidx.appcompat.widget.PopupMenu.OnMenuItemClickListener?);
- method public void show();
- }
-
- public static interface PopupMenu.OnDismissListener {
- method public void onDismiss(androidx.appcompat.widget.PopupMenu!);
- }
-
- public static interface PopupMenu.OnMenuItemClickListener {
- method public boolean onMenuItemClick(android.view.MenuItem!);
- }
-
- public class SearchView extends androidx.appcompat.widget.LinearLayoutCompat implements androidx.appcompat.view.CollapsibleActionView {
- ctor public SearchView(android.content.Context!);
- ctor public SearchView(android.content.Context!, android.util.AttributeSet!);
- ctor public SearchView(android.content.Context!, android.util.AttributeSet!, int);
- method public int getImeOptions();
- method public int getInputType();
- method public int getMaxWidth();
- method public CharSequence! getQuery();
- method public CharSequence? getQueryHint();
- method public androidx.cursoradapter.widget.CursorAdapter! getSuggestionsAdapter();
- method public boolean isIconfiedByDefault();
- method public boolean isIconified();
- method public boolean isQueryRefinementEnabled();
- method public boolean isSubmitButtonEnabled();
- method public void onActionViewCollapsed();
- method public void onActionViewExpanded();
- method public void setIconified(boolean);
- method public void setIconifiedByDefault(boolean);
- method public void setImeOptions(int);
- method public void setInputType(int);
- method public void setMaxWidth(int);
- method public void setOnCloseListener(androidx.appcompat.widget.SearchView.OnCloseListener!);
- method public void setOnQueryTextFocusChangeListener(android.view.View.OnFocusChangeListener!);
- method public void setOnQueryTextListener(androidx.appcompat.widget.SearchView.OnQueryTextListener!);
- method public void setOnSearchClickListener(android.view.View.OnClickListener!);
- method public void setOnSuggestionListener(androidx.appcompat.widget.SearchView.OnSuggestionListener!);
- method public void setQuery(CharSequence!, boolean);
- method public void setQueryHint(CharSequence?);
- method public void setQueryRefinementEnabled(boolean);
- method public void setSearchableInfo(android.app.SearchableInfo!);
- method public void setSubmitButtonEnabled(boolean);
- method public void setSuggestionsAdapter(androidx.cursoradapter.widget.CursorAdapter!);
- }
-
- public static interface SearchView.OnCloseListener {
- method public boolean onClose();
- }
-
- public static interface SearchView.OnQueryTextListener {
- method public boolean onQueryTextChange(String!);
- method public boolean onQueryTextSubmit(String!);
- }
-
- public static interface SearchView.OnSuggestionListener {
- method public boolean onSuggestionClick(int);
- method public boolean onSuggestionSelect(int);
- }
-
- public class ShareActionProvider extends androidx.core.view.ActionProvider {
- ctor public ShareActionProvider(android.content.Context!);
- method public android.view.View! onCreateActionView();
- method public void setOnShareTargetSelectedListener(androidx.appcompat.widget.ShareActionProvider.OnShareTargetSelectedListener!);
- method public void setShareHistoryFileName(String!);
- method public void setShareIntent(android.content.Intent!);
- field public static final String DEFAULT_SHARE_HISTORY_FILE_NAME = "share_history.xml";
- }
-
- public static interface ShareActionProvider.OnShareTargetSelectedListener {
- method public boolean onShareTargetSelected(androidx.appcompat.widget.ShareActionProvider!, android.content.Intent!);
- }
-
- public class SwitchCompat extends android.widget.CompoundButton {
- ctor public SwitchCompat(android.content.Context!);
- ctor public SwitchCompat(android.content.Context!, android.util.AttributeSet!);
- ctor public SwitchCompat(android.content.Context!, android.util.AttributeSet!, int);
- method public boolean getShowText();
- method public boolean getSplitTrack();
- method public int getSwitchMinWidth();
- method public int getSwitchPadding();
- method public CharSequence! getTextOff();
- method public CharSequence! getTextOn();
- method public android.graphics.drawable.Drawable! getThumbDrawable();
- method public int getThumbTextPadding();
- method public android.content.res.ColorStateList? getThumbTintList();
- method public android.graphics.PorterDuff.Mode? getThumbTintMode();
- method public android.graphics.drawable.Drawable! getTrackDrawable();
- method public android.content.res.ColorStateList? getTrackTintList();
- method public android.graphics.PorterDuff.Mode? getTrackTintMode();
- method public void onMeasure(int, int);
- method public void setShowText(boolean);
- method public void setSplitTrack(boolean);
- method public void setSwitchMinWidth(int);
- method public void setSwitchPadding(int);
- method public void setSwitchTextAppearance(android.content.Context!, int);
- method public void setSwitchTypeface(android.graphics.Typeface!, int);
- method public void setSwitchTypeface(android.graphics.Typeface!);
- method public void setTextOff(CharSequence!);
- method public void setTextOn(CharSequence!);
- method public void setThumbDrawable(android.graphics.drawable.Drawable!);
- method public void setThumbResource(int);
- method public void setThumbTextPadding(int);
- method public void setThumbTintList(android.content.res.ColorStateList?);
- method public void setThumbTintMode(android.graphics.PorterDuff.Mode?);
- method public void setTrackDrawable(android.graphics.drawable.Drawable!);
- method public void setTrackResource(int);
- method public void setTrackTintList(android.content.res.ColorStateList?);
- method public void setTrackTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public interface ThemedSpinnerAdapter extends android.widget.SpinnerAdapter {
- method public android.content.res.Resources.Theme? getDropDownViewTheme();
- method public void setDropDownViewTheme(android.content.res.Resources.Theme?);
- }
-
- public static final class ThemedSpinnerAdapter.Helper {
- ctor public ThemedSpinnerAdapter.Helper(android.content.Context);
- method public android.view.LayoutInflater getDropDownViewInflater();
- method public android.content.res.Resources.Theme? getDropDownViewTheme();
- method public void setDropDownViewTheme(android.content.res.Resources.Theme?);
- }
-
- public class Toolbar extends android.view.ViewGroup {
- ctor public Toolbar(android.content.Context!);
- ctor public Toolbar(android.content.Context!, android.util.AttributeSet?);
- ctor public Toolbar(android.content.Context!, android.util.AttributeSet?, int);
- method public void collapseActionView();
- method public void dismissPopupMenus();
- method protected androidx.appcompat.widget.Toolbar.LayoutParams! generateDefaultLayoutParams();
- method public androidx.appcompat.widget.Toolbar.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
- method protected androidx.appcompat.widget.Toolbar.LayoutParams! generateLayoutParams(android.view.ViewGroup.LayoutParams!);
- method public CharSequence? getCollapseContentDescription();
- method public android.graphics.drawable.Drawable? getCollapseIcon();
- method public int getContentInsetEnd();
- method public int getContentInsetEndWithActions();
- method public int getContentInsetLeft();
- method public int getContentInsetRight();
- method public int getContentInsetStart();
- method public int getContentInsetStartWithNavigation();
- method public int getCurrentContentInsetEnd();
- method public int getCurrentContentInsetLeft();
- method public int getCurrentContentInsetRight();
- method public int getCurrentContentInsetStart();
- method public android.graphics.drawable.Drawable! getLogo();
- method public CharSequence! getLogoDescription();
- method public android.view.Menu! getMenu();
- method public CharSequence? getNavigationContentDescription();
- method public android.graphics.drawable.Drawable? getNavigationIcon();
- method public android.graphics.drawable.Drawable? getOverflowIcon();
- method public int getPopupTheme();
- method public CharSequence! getSubtitle();
- method public CharSequence! getTitle();
- method public int getTitleMarginBottom();
- method public int getTitleMarginEnd();
- method public int getTitleMarginStart();
- method public int getTitleMarginTop();
- method public boolean hasExpandedActionView();
- method public boolean hideOverflowMenu();
- method public void inflateMenu(@MenuRes int);
- method public boolean isOverflowMenuShowing();
- method public void setCollapseContentDescription(@StringRes int);
- method public void setCollapseContentDescription(CharSequence?);
- method public void setCollapseIcon(@DrawableRes int);
- method public void setCollapseIcon(android.graphics.drawable.Drawable?);
- method public void setContentInsetEndWithActions(int);
- method public void setContentInsetStartWithNavigation(int);
- method public void setContentInsetsAbsolute(int, int);
- method public void setContentInsetsRelative(int, int);
- method public void setLogo(@DrawableRes int);
- method public void setLogo(android.graphics.drawable.Drawable!);
- method public void setLogoDescription(@StringRes int);
- method public void setLogoDescription(CharSequence!);
- method public void setNavigationContentDescription(@StringRes int);
- method public void setNavigationContentDescription(CharSequence?);
- method public void setNavigationIcon(@DrawableRes int);
- method public void setNavigationIcon(android.graphics.drawable.Drawable?);
- method public void setNavigationOnClickListener(android.view.View.OnClickListener!);
- method public void setOnMenuItemClickListener(androidx.appcompat.widget.Toolbar.OnMenuItemClickListener!);
- method public void setOverflowIcon(android.graphics.drawable.Drawable?);
- method public void setPopupTheme(@StyleRes int);
- method public void setSubtitle(@StringRes int);
- method public void setSubtitle(CharSequence!);
- method public void setSubtitleTextAppearance(android.content.Context!, @StyleRes int);
- method public void setSubtitleTextColor(@ColorInt int);
- method public void setSubtitleTextColor(android.content.res.ColorStateList);
- method public void setTitle(@StringRes int);
- method public void setTitle(CharSequence!);
- method public void setTitleMargin(int, int, int, int);
- method public void setTitleMarginBottom(int);
- method public void setTitleMarginEnd(int);
- method public void setTitleMarginStart(int);
- method public void setTitleMarginTop(int);
- method public void setTitleTextAppearance(android.content.Context!, @StyleRes int);
- method public void setTitleTextColor(@ColorInt int);
- method public void setTitleTextColor(android.content.res.ColorStateList);
- method public boolean showOverflowMenu();
- }
-
- public static class Toolbar.LayoutParams extends androidx.appcompat.app.ActionBar.LayoutParams {
- ctor public Toolbar.LayoutParams(android.content.Context, android.util.AttributeSet!);
- ctor public Toolbar.LayoutParams(int, int);
- ctor public Toolbar.LayoutParams(int, int, int);
- ctor public Toolbar.LayoutParams(int);
- ctor public Toolbar.LayoutParams(androidx.appcompat.widget.Toolbar.LayoutParams!);
- ctor public Toolbar.LayoutParams(androidx.appcompat.app.ActionBar.LayoutParams!);
- ctor public Toolbar.LayoutParams(android.view.ViewGroup.MarginLayoutParams!);
- ctor public Toolbar.LayoutParams(android.view.ViewGroup.LayoutParams!);
- }
-
- public static interface Toolbar.OnMenuItemClickListener {
- method public boolean onMenuItemClick(android.view.MenuItem!);
- }
-
- public static class Toolbar.SavedState extends androidx.customview.view.AbsSavedState {
- ctor public Toolbar.SavedState(android.os.Parcel!);
- ctor public Toolbar.SavedState(android.os.Parcel!, ClassLoader!);
- ctor public Toolbar.SavedState(android.os.Parcelable!);
- field public static final android.os.Parcelable.Creator<androidx.appcompat.widget.Toolbar.SavedState>! CREATOR;
- }
-
- public class TooltipCompat {
- method public static void setTooltipText(android.view.View, CharSequence?);
- }
-
-}
-
diff --git a/appcompat/api/current.txt b/appcompat/api/current.txt
index 0b1a7fa..e628e3f 100644
--- a/appcompat/api/current.txt
+++ b/appcompat/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.appcompat.app {
public abstract class ActionBar {
@@ -252,15 +252,13 @@
public abstract class AppCompatDelegate {
method public abstract void addContentView(android.view.View!, android.view.ViewGroup.LayoutParams!);
method public abstract boolean applyDayNight();
- method public void attachBaseContext(android.content.Context!);
- method public static androidx.appcompat.app.AppCompatDelegate create(android.app.Activity, androidx.appcompat.app.AppCompatCallback?);
- method public static androidx.appcompat.app.AppCompatDelegate create(android.app.Dialog, androidx.appcompat.app.AppCompatCallback?);
- method public static androidx.appcompat.app.AppCompatDelegate create(android.content.Context, android.view.Window, androidx.appcompat.app.AppCompatCallback?);
+ method public static androidx.appcompat.app.AppCompatDelegate! create(android.app.Activity!, androidx.appcompat.app.AppCompatCallback!);
+ method public static androidx.appcompat.app.AppCompatDelegate! create(android.app.Dialog!, androidx.appcompat.app.AppCompatCallback!);
+ method public static androidx.appcompat.app.AppCompatDelegate! create(android.content.Context!, android.view.Window!, androidx.appcompat.app.AppCompatCallback!);
method public abstract android.view.View! createView(android.view.View?, String!, android.content.Context, android.util.AttributeSet);
method public abstract <T extends android.view.View> T! findViewById(@IdRes int);
method public static int getDefaultNightMode();
method public abstract androidx.appcompat.app.ActionBarDrawerToggle.Delegate? getDrawerToggleDelegate();
- method public int getLocalNightMode();
method public abstract android.view.MenuInflater! getMenuInflater();
method public abstract androidx.appcompat.app.ActionBar? getSupportActionBar();
method public abstract boolean hasWindowFeature(int);
@@ -291,12 +289,9 @@
field public static final int FEATURE_ACTION_MODE_OVERLAY = 10; // 0xa
field public static final int FEATURE_SUPPORT_ACTION_BAR = 108; // 0x6c
field public static final int FEATURE_SUPPORT_ACTION_BAR_OVERLAY = 109; // 0x6d
- field @Deprecated public static final int MODE_NIGHT_AUTO = 0; // 0x0
- field public static final int MODE_NIGHT_AUTO_BATTERY = 3; // 0x3
- field @Deprecated public static final int MODE_NIGHT_AUTO_TIME = 0; // 0x0
+ field public static final int MODE_NIGHT_AUTO = 0; // 0x0
field public static final int MODE_NIGHT_FOLLOW_SYSTEM = -1; // 0xffffffff
field public static final int MODE_NIGHT_NO = 1; // 0x1
- field public static final int MODE_NIGHT_UNSPECIFIED = -100; // 0xffffff9c
field public static final int MODE_NIGHT_YES = 2; // 0x2
}
@@ -337,8 +332,26 @@
}
+package androidx.appcompat.content.res {
+
+ public final class AppCompatResources {
+ method public static android.content.res.ColorStateList! getColorStateList(android.content.Context, @ColorRes int);
+ method public static android.graphics.drawable.Drawable? getDrawable(android.content.Context, @DrawableRes int);
+ }
+
+}
+
package androidx.appcompat.graphics.drawable {
+ public class AnimatedStateListDrawableCompat extends android.graphics.drawable.Drawable implements androidx.core.graphics.drawable.TintAwareDrawable {
+ ctor public AnimatedStateListDrawableCompat();
+ method public void addState(int[], android.graphics.drawable.Drawable, int);
+ method public <T extends android.graphics.drawable.Drawable & android.graphics.drawable.Animatable> void addTransition(int, int, T, boolean);
+ method public static androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat? create(android.content.Context, @DrawableRes int, android.content.res.Resources.Theme?);
+ method public static androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat! createFromXmlInner(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method public void inflate(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ }
+
public class DrawerArrowDrawable extends android.graphics.drawable.Drawable {
ctor public DrawerArrowDrawable(android.content.Context!);
method public void draw(android.graphics.Canvas!);
@@ -461,11 +474,11 @@
ctor public AppCompatAutoCompleteTextView(android.content.Context!);
ctor public AppCompatAutoCompleteTextView(android.content.Context!, android.util.AttributeSet!);
ctor public AppCompatAutoCompleteTextView(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportBackgroundTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
method public void setTextAppearance(android.content.Context!, int);
}
@@ -473,14 +486,14 @@
ctor public AppCompatButton(android.content.Context!);
ctor public AppCompatButton(android.content.Context!, android.util.AttributeSet!);
ctor public AppCompatButton(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int) throws java.lang.IllegalArgumentException;
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setAutoSizeTextTypeUniformWithPresetSizes(int[], int) throws java.lang.IllegalArgumentException;
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportBackgroundTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int) throws java.lang.IllegalArgumentException;
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setAutoSizeTextTypeUniformWithPresetSizes(int[], int) throws java.lang.IllegalArgumentException;
method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
method public void setSupportAllCaps(boolean);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
method public void setTextAppearance(android.content.Context!, int);
}
@@ -488,15 +501,15 @@
ctor public AppCompatCheckBox(android.content.Context!);
ctor public AppCompatCheckBox(android.content.Context!, android.util.AttributeSet!);
ctor public AppCompatCheckBox(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportButtonTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportButtonTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportBackgroundTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportButtonTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportButtonTintMode();
method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportButtonTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportButtonTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportButtonTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportButtonTintMode(android.graphics.PorterDuff.Mode?);
}
public class AppCompatCheckedTextView extends android.widget.CheckedTextView {
@@ -510,11 +523,11 @@
ctor public AppCompatEditText(android.content.Context!);
ctor public AppCompatEditText(android.content.Context!, android.util.AttributeSet!);
ctor public AppCompatEditText(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportBackgroundTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
method public void setTextAppearance(android.content.Context!, int);
}
@@ -522,41 +535,41 @@
ctor public AppCompatImageButton(android.content.Context!);
ctor public AppCompatImageButton(android.content.Context!, android.util.AttributeSet!);
ctor public AppCompatImageButton(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportImageTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportImageTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportBackgroundTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportImageTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportImageTintMode();
method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportImageTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportImageTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportImageTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportImageTintMode(android.graphics.PorterDuff.Mode?);
}
public class AppCompatImageView extends android.widget.ImageView implements androidx.core.view.TintableBackgroundView androidx.core.widget.TintableImageSourceView {
ctor public AppCompatImageView(android.content.Context!);
ctor public AppCompatImageView(android.content.Context!, android.util.AttributeSet!);
ctor public AppCompatImageView(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportImageTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportImageTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportBackgroundTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportImageTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportImageTintMode();
method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportImageTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportImageTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportImageTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportImageTintMode(android.graphics.PorterDuff.Mode?);
}
public class AppCompatMultiAutoCompleteTextView extends android.widget.MultiAutoCompleteTextView implements androidx.core.view.TintableBackgroundView {
ctor public AppCompatMultiAutoCompleteTextView(android.content.Context!);
ctor public AppCompatMultiAutoCompleteTextView(android.content.Context!, android.util.AttributeSet!);
ctor public AppCompatMultiAutoCompleteTextView(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportBackgroundTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
method public void setTextAppearance(android.content.Context!, int);
}
@@ -564,15 +577,15 @@
ctor public AppCompatRadioButton(android.content.Context!);
ctor public AppCompatRadioButton(android.content.Context!, android.util.AttributeSet!);
ctor public AppCompatRadioButton(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportButtonTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportButtonTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportBackgroundTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportButtonTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportButtonTintMode();
method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportButtonTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportButtonTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportButtonTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportButtonTintMode(android.graphics.PorterDuff.Mode?);
}
public class AppCompatRatingBar extends android.widget.RatingBar {
@@ -594,30 +607,26 @@
ctor public AppCompatSpinner(android.content.Context!, android.util.AttributeSet!, int);
ctor public AppCompatSpinner(android.content.Context!, android.util.AttributeSet!, int, int);
ctor public AppCompatSpinner(android.content.Context!, android.util.AttributeSet!, int, int, android.content.res.Resources.Theme!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportBackgroundTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
}
- public class AppCompatTextView extends android.widget.TextView implements androidx.core.widget.AutoSizeableTextView androidx.core.view.TintableBackgroundView androidx.core.widget.TintableCompoundDrawablesView {
+ public class AppCompatTextView extends android.widget.TextView implements androidx.core.widget.AutoSizeableTextView androidx.core.view.TintableBackgroundView {
ctor public AppCompatTextView(android.content.Context!);
ctor public AppCompatTextView(android.content.Context!, android.util.AttributeSet!);
ctor public AppCompatTextView(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.res.ColorStateList? getSupportCompoundDrawablesTintList();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.PorterDuff.Mode? getSupportCompoundDrawablesTintMode();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.content.res.ColorStateList? getSupportBackgroundTintList();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
method public androidx.core.text.PrecomputedTextCompat.Params getTextMetricsParamsCompat();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int) throws java.lang.IllegalArgumentException;
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setAutoSizeTextTypeUniformWithPresetSizes(int[], int) throws java.lang.IllegalArgumentException;
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int) throws java.lang.IllegalArgumentException;
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setAutoSizeTextTypeUniformWithPresetSizes(int[], int) throws java.lang.IllegalArgumentException;
method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
method public void setPrecomputedText(androidx.core.text.PrecomputedTextCompat);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportCompoundDrawablesTintList(android.content.res.ColorStateList?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSupportCompoundDrawablesTintMode(android.graphics.PorterDuff.Mode?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
method public void setTextAppearance(android.content.Context!, int);
method public void setTextFuture(java.util.concurrent.Future<androidx.core.text.PrecomputedTextCompat>?);
method public void setTextMetricsParamsCompat(androidx.core.text.PrecomputedTextCompat.Params);
@@ -686,7 +695,6 @@
method public android.view.View? getAnchorView();
method @StyleRes public int getAnimationStyle();
method public android.graphics.drawable.Drawable? getBackground();
- method public android.graphics.Rect? getEpicenterBounds();
method public int getHeight();
method public int getHorizontalOffset();
method public int getInputMethodMode();
@@ -713,7 +721,6 @@
method public void setBackgroundDrawable(android.graphics.drawable.Drawable?);
method public void setContentWidth(int);
method public void setDropDownGravity(int);
- method public void setEpicenterBounds(android.graphics.Rect?);
method public void setHeight(int);
method public void setHorizontalOffset(int);
method public void setInputMethodMode(int);
diff --git a/appcompat/api/res-1.1.0-alpha03.txt b/appcompat/api/res-1.1.0-alpha03.txt
deleted file mode 100644
index 75efda2..0000000
--- a/appcompat/api/res-1.1.0-alpha03.txt
+++ /dev/null
@@ -1,364 +0,0 @@
-style TextAppearance_AppCompat
-style TextAppearance_AppCompat_Body1
-style TextAppearance_AppCompat_Body2
-style TextAppearance_AppCompat_Button
-style TextAppearance_AppCompat_Caption
-style TextAppearance_AppCompat_Display1
-style TextAppearance_AppCompat_Display2
-style TextAppearance_AppCompat_Display3
-style TextAppearance_AppCompat_Display4
-style TextAppearance_AppCompat_Headline
-style TextAppearance_AppCompat_Inverse
-style TextAppearance_AppCompat_Large
-style TextAppearance_AppCompat_Large_Inverse
-style TextAppearance_AppCompat_Light_SearchResult_Subtitle
-style TextAppearance_AppCompat_Light_SearchResult_Title
-style TextAppearance_AppCompat_Light_Widget_PopupMenu_Large
-style TextAppearance_AppCompat_Light_Widget_PopupMenu_Small
-style TextAppearance_AppCompat_Medium
-style TextAppearance_AppCompat_Medium_Inverse
-style TextAppearance_AppCompat_Menu
-style TextAppearance_AppCompat_SearchResult_Subtitle
-style TextAppearance_AppCompat_SearchResult_Title
-style TextAppearance_AppCompat_Small
-style TextAppearance_AppCompat_Small_Inverse
-style TextAppearance_AppCompat_Subhead
-style TextAppearance_AppCompat_Subhead_Inverse
-style TextAppearance_AppCompat_Title
-style TextAppearance_AppCompat_Title_Inverse
-style TextAppearance_AppCompat_Widget_ActionBar_Menu
-style TextAppearance_AppCompat_Widget_ActionBar_Subtitle
-style TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse
-style TextAppearance_AppCompat_Widget_ActionBar_Title
-style TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse
-style TextAppearance_AppCompat_Widget_ActionMode_Subtitle
-style TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse
-style TextAppearance_AppCompat_Widget_ActionMode_Title
-style TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse
-style TextAppearance_AppCompat_Widget_Button
-style TextAppearance_AppCompat_Widget_Button_Borderless_Colored
-style TextAppearance_AppCompat_Widget_Button_Colored
-style TextAppearance_AppCompat_Widget_Button_Inverse
-style TextAppearance_AppCompat_Widget_DropDownItem
-style TextAppearance_AppCompat_Widget_PopupMenu_Header
-style TextAppearance_AppCompat_Widget_PopupMenu_Large
-style TextAppearance_AppCompat_Widget_PopupMenu_Small
-style TextAppearance_AppCompat_Widget_Switch
-style TextAppearance_AppCompat_Widget_TextView_SpinnerItem
-style Theme_AppCompat
-style Theme_AppCompat_DayNight
-style Theme_AppCompat_DayNight_DarkActionBar
-style Theme_AppCompat_DayNight_Dialog
-style Theme_AppCompat_DayNight_Dialog_Alert
-style Theme_AppCompat_DayNight_Dialog_MinWidth
-style Theme_AppCompat_DayNight_DialogWhenLarge
-style Theme_AppCompat_DayNight_NoActionBar
-style Theme_AppCompat_Dialog
-style Theme_AppCompat_Dialog_Alert
-style Theme_AppCompat_Dialog_MinWidth
-style Theme_AppCompat_DialogWhenLarge
-style Theme_AppCompat_Light
-style Theme_AppCompat_Light_DarkActionBar
-style Theme_AppCompat_Light_Dialog
-style Theme_AppCompat_Light_Dialog_Alert
-style Theme_AppCompat_Light_Dialog_MinWidth
-style Theme_AppCompat_Light_DialogWhenLarge
-style Theme_AppCompat_Light_NoActionBar
-style Theme_AppCompat_NoActionBar
-style ThemeOverlay_AppCompat
-style ThemeOverlay_AppCompat_ActionBar
-style ThemeOverlay_AppCompat_Dark
-style ThemeOverlay_AppCompat_Dark_ActionBar
-style ThemeOverlay_AppCompat_Dialog
-style ThemeOverlay_AppCompat_Dialog_Alert
-style ThemeOverlay_AppCompat_Light
-style Widget_AppCompat_ActionBar
-style Widget_AppCompat_ActionBar_Solid
-style Widget_AppCompat_ActionBar_TabBar
-style Widget_AppCompat_ActionBar_TabText
-style Widget_AppCompat_ActionBar_TabView
-style Widget_AppCompat_ActionButton
-style Widget_AppCompat_ActionButton_CloseMode
-style Widget_AppCompat_ActionButton_Overflow
-style Widget_AppCompat_ActionMode
-style Widget_AppCompat_AutoCompleteTextView
-style Widget_AppCompat_Button
-style Widget_AppCompat_Button_Borderless
-style Widget_AppCompat_Button_Borderless_Colored
-style Widget_AppCompat_Button_ButtonBar_AlertDialog
-style Widget_AppCompat_Button_Colored
-style Widget_AppCompat_Button_Small
-style Widget_AppCompat_ButtonBar
-style Widget_AppCompat_ButtonBar_AlertDialog
-style Widget_AppCompat_CompoundButton_CheckBox
-style Widget_AppCompat_CompoundButton_RadioButton
-style Widget_AppCompat_CompoundButton_Switch
-style Widget_AppCompat_DrawerArrowToggle
-style Widget_AppCompat_DropDownItem_Spinner
-style Widget_AppCompat_EditText
-style Widget_AppCompat_ImageButton
-style Widget_AppCompat_Light_ActionBar
-style Widget_AppCompat_Light_ActionBar_Solid
-style Widget_AppCompat_Light_ActionBar_Solid_Inverse
-style Widget_AppCompat_Light_ActionBar_TabBar
-style Widget_AppCompat_Light_ActionBar_TabBar_Inverse
-style Widget_AppCompat_Light_ActionBar_TabText
-style Widget_AppCompat_Light_ActionBar_TabText_Inverse
-style Widget_AppCompat_Light_ActionBar_TabView
-style Widget_AppCompat_Light_ActionBar_TabView_Inverse
-style Widget_AppCompat_Light_ActionButton
-style Widget_AppCompat_Light_ActionButton_CloseMode
-style Widget_AppCompat_Light_ActionButton_Overflow
-style Widget_AppCompat_Light_ActionMode_Inverse
-style Widget_AppCompat_Light_AutoCompleteTextView
-style Widget_AppCompat_Light_DropDownItem_Spinner
-style Widget_AppCompat_Light_ListPopupWindow
-style Widget_AppCompat_Light_ListView_DropDown
-style Widget_AppCompat_Light_PopupMenu
-style Widget_AppCompat_Light_PopupMenu_Overflow
-style Widget_AppCompat_Light_SearchView
-style Widget_AppCompat_Light_Spinner_DropDown_ActionBar
-style Widget_AppCompat_ListPopupWindow
-style Widget_AppCompat_ListView
-style Widget_AppCompat_ListView_DropDown
-style Widget_AppCompat_ListView_Menu
-style Widget_AppCompat_PopupMenu
-style Widget_AppCompat_PopupMenu_Overflow
-style Widget_AppCompat_PopupWindow
-style Widget_AppCompat_ProgressBar
-style Widget_AppCompat_ProgressBar_Horizontal
-style Widget_AppCompat_RatingBar
-style Widget_AppCompat_RatingBar_Indicator
-style Widget_AppCompat_RatingBar_Small
-style Widget_AppCompat_SearchView
-style Widget_AppCompat_SearchView_ActionBar
-style Widget_AppCompat_SeekBar
-style Widget_AppCompat_SeekBar_Discrete
-style Widget_AppCompat_Spinner
-style Widget_AppCompat_Spinner_DropDown
-style Widget_AppCompat_Spinner_DropDown_ActionBar
-style Widget_AppCompat_Spinner_Underlined
-style Widget_AppCompat_TextView
-style Widget_AppCompat_TextView_SpinnerItem
-style Widget_AppCompat_Toolbar
-style Widget_AppCompat_Toolbar_Button_Navigation
-attr actionBarDivider
-attr actionBarItemBackground
-attr actionBarPopupTheme
-attr actionBarSize
-attr actionBarSplitStyle
-attr actionBarStyle
-attr actionBarTabBarStyle
-attr actionBarTabStyle
-attr actionBarTabTextStyle
-attr actionBarTheme
-attr actionBarWidgetTheme
-attr actionButtonStyle
-attr actionDropDownStyle
-attr actionLayout
-attr actionMenuTextAppearance
-attr actionMenuTextColor
-attr actionModeBackground
-attr actionModeCloseButtonStyle
-attr actionModeCloseDrawable
-attr actionModeCopyDrawable
-attr actionModeCutDrawable
-attr actionModeFindDrawable
-attr actionModePasteDrawable
-attr actionModeSelectAllDrawable
-attr actionModeShareDrawable
-attr actionModeSplitBackground
-attr actionModeStyle
-attr actionModeWebSearchDrawable
-attr actionOverflowButtonStyle
-attr actionOverflowMenuStyle
-attr actionProviderClass
-attr actionViewClass
-attr alertDialogStyle
-attr alertDialogTheme
-attr arrowHeadLength
-attr arrowShaftLength
-attr autoCompleteTextViewStyle
-attr autoSizeMaxTextSize
-attr autoSizeMinTextSize
-attr autoSizePresetSizes
-attr autoSizeStepGranularity
-attr autoSizeTextType
-attr background
-attr backgroundSplit
-attr backgroundStacked
-attr backgroundTint
-attr backgroundTintMode
-attr barLength
-attr borderlessButtonStyle
-attr buttonBarButtonStyle
-attr buttonBarNegativeButtonStyle
-attr buttonBarNeutralButtonStyle
-attr buttonBarPositiveButtonStyle
-attr buttonBarStyle
-attr buttonGravity
-attr buttonStyle
-attr buttonStyleSmall
-attr buttonTint
-attr buttonTintMode
-attr checkboxStyle
-attr checkedTextViewStyle
-attr closeIcon
-attr closeItemLayout
-attr collapseContentDescription
-attr collapseIcon
-attr color
-attr colorAccent
-attr colorBackgroundFloating
-attr colorButtonNormal
-attr colorControlActivated
-attr colorControlHighlight
-attr colorControlNormal
-attr colorError
-attr colorPrimary
-attr colorPrimaryDark
-attr commitIcon
-attr contentInsetEnd
-attr contentInsetEndWithActions
-attr contentInsetLeft
-attr contentInsetRight
-attr contentInsetStart
-attr contentInsetStartWithNavigation
-attr customNavigationLayout
-attr dialogCornerRadius
-attr dialogPreferredPadding
-attr dialogTheme
-attr displayOptions
-attr divider
-attr dividerHorizontal
-attr dividerPadding
-attr dividerVertical
-attr drawableSize
-attr drawerArrowStyle
-attr dropDownListViewStyle
-attr editTextBackground
-attr editTextColor
-attr editTextStyle
-attr elevation
-attr firstBaselineToTopHeight
-attr fontFamily
-attr fontVariationSettings
-attr gapBetweenBars
-attr goIcon
-attr height
-attr hideOnContentScroll
-attr homeAsUpIndicator
-attr homeLayout
-attr icon
-attr iconTint
-attr iconTintMode
-attr iconifiedByDefault
-attr imageButtonStyle
-attr indeterminateProgressStyle
-attr isLightTheme
-attr itemPadding
-attr lastBaselineToBottomHeight
-attr layout
-attr lineHeight
-attr listChoiceBackgroundIndicator
-attr listChoiceIndicatorMultipleAnimated
-attr listChoiceIndicatorSingleAnimated
-attr listDividerAlertDialog
-attr listPopupWindowStyle
-attr listPreferredItemHeight
-attr listPreferredItemHeightLarge
-attr listPreferredItemHeightSmall
-attr listPreferredItemPaddingEnd
-attr listPreferredItemPaddingLeft
-attr listPreferredItemPaddingRight
-attr listPreferredItemPaddingStart
-attr logo
-attr logoDescription
-attr maxButtonHeight
-attr measureWithLargestChild
-attr navigationContentDescription
-attr navigationIcon
-attr navigationMode
-attr overlapAnchor
-attr paddingEnd
-attr paddingStart
-attr panelBackground
-attr popupMenuStyle
-attr popupTheme
-attr popupWindowStyle
-attr preserveIconSpacing
-attr progressBarPadding
-attr progressBarStyle
-attr queryBackground
-attr queryHint
-attr radioButtonStyle
-attr ratingBarStyle
-attr ratingBarStyleIndicator
-attr ratingBarStyleSmall
-attr searchHintIcon
-attr searchIcon
-attr searchViewStyle
-attr seekBarStyle
-attr selectableItemBackground
-attr selectableItemBackgroundBorderless
-attr showAsAction
-attr showDividers
-attr showText
-attr spinBars
-attr spinnerDropDownItemStyle
-attr spinnerStyle
-attr splitTrack
-attr srcCompat
-attr state_above_anchor
-attr submitBackground
-attr subtitle
-attr subtitleTextAppearance
-attr subtitleTextColor
-attr subtitleTextStyle
-attr suggestionRowLayout
-layout support_simple_spinner_dropdown_item
-attr switchMinWidth
-attr switchPadding
-attr switchStyle
-attr switchTextAppearance
-attr textAllCaps
-attr textAppearanceLargePopupMenu
-attr textAppearanceListItem
-attr textAppearanceListItemSecondary
-attr textAppearanceListItemSmall
-attr textAppearancePopupMenuHeader
-attr textAppearanceSearchResultSubtitle
-attr textAppearanceSearchResultTitle
-attr textAppearanceSmallPopupMenu
-attr textColorAlertDialogListItem
-attr textLocale
-attr theme
-attr thickness
-attr thumbTextPadding
-attr thumbTint
-attr thumbTintMode
-attr tickMark
-attr tickMarkTint
-attr tickMarkTintMode
-attr tint
-attr tintMode
-attr title
-attr titleMargin
-attr titleMarginBottom
-attr titleMarginEnd
-attr titleMarginStart
-attr titleMarginTop
-attr titleMargins
-attr titleTextAppearance
-attr titleTextColor
-attr titleTextStyle
-attr toolbarNavigationButtonStyle
-attr toolbarStyle
-attr track
-attr trackTint
-attr trackTintMode
-attr voiceIcon
-attr windowActionBar
-attr windowActionBarOverlay
-attr windowActionModeOverlay
-attr windowNoTitle
diff --git a/appcompat/api/restricted_1.0.0.txt b/appcompat/api/restricted_1.0.0.txt
deleted file mode 100644
index 6215756..0000000
--- a/appcompat/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,1534 +0,0 @@
-// Signature format: 3.0
-package androidx.appcompat.app {
-
- public abstract class ActionBar {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean closeOptionsMenu();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean collapseActionView();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void dispatchMenuVisibilityChanged(boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean invalidateOptionsMenu();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean isTitleTruncated();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void onConfigurationChanged(android.content.res.Configuration!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean onKeyShortcut(int, android.view.KeyEvent!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean onMenuKeyEvent(android.view.KeyEvent!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean openOptionsMenu();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setDefaultDisplayHomeAsUpEnabled(boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setShowHideAnimationEnabled(boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setWindowTitle(CharSequence!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.appcompat.view.ActionMode! startActionMode(androidx.appcompat.view.ActionMode.Callback!);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface ActionBar.DisplayOptions {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface ActionBar.NavigationMode {
- }
-
- public static class AlertDialog.Builder {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.appcompat.app.AlertDialog.Builder! setRecycleOnMeasureEnabled(boolean);
- method @Deprecated @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.appcompat.app.AlertDialog.Builder! setView(android.view.View!, int, int, int, int);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface AppCompatDelegate.NightMode {
- }
-
- public class AppCompatDialog implements androidx.appcompat.app.AppCompatCallback {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void invalidateOptionsMenu();
- }
-
- public class AppCompatDialogFragment {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setupDialog(android.app.Dialog!, int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WindowDecorActionBar extends androidx.appcompat.app.ActionBar implements androidx.appcompat.widget.ActionBarOverlayLayout.ActionBarVisibilityCallback {
- ctor public WindowDecorActionBar(android.app.Activity!, boolean);
- ctor public WindowDecorActionBar(android.app.Dialog!);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public WindowDecorActionBar(android.view.View!);
- method public void addOnMenuVisibilityListener(androidx.appcompat.app.ActionBar.OnMenuVisibilityListener!);
- method public void addTab(androidx.appcompat.app.ActionBar.Tab!);
- method public void addTab(androidx.appcompat.app.ActionBar.Tab!, int);
- method public void addTab(androidx.appcompat.app.ActionBar.Tab!, boolean);
- method public void addTab(androidx.appcompat.app.ActionBar.Tab!, int, boolean);
- method public void animateToMode(boolean);
- method public void doHide(boolean);
- method public void doShow(boolean);
- method public void enableContentAnimations(boolean);
- method public android.view.View! getCustomView();
- method public int getDisplayOptions();
- method public int getHeight();
- method public int getNavigationItemCount();
- method public int getNavigationMode();
- method public int getSelectedNavigationIndex();
- method public androidx.appcompat.app.ActionBar.Tab! getSelectedTab();
- method public CharSequence! getSubtitle();
- method public androidx.appcompat.app.ActionBar.Tab! getTabAt(int);
- method public int getTabCount();
- method public CharSequence! getTitle();
- method public boolean hasIcon();
- method public boolean hasLogo();
- method public void hide();
- method public void hideForSystem();
- method public boolean isShowing();
- method public androidx.appcompat.app.ActionBar.Tab! newTab();
- method public void onContentScrollStarted();
- method public void onContentScrollStopped();
- method public void onWindowVisibilityChanged(int);
- method public void removeAllTabs();
- method public void removeOnMenuVisibilityListener(androidx.appcompat.app.ActionBar.OnMenuVisibilityListener!);
- method public void removeTab(androidx.appcompat.app.ActionBar.Tab!);
- method public void removeTabAt(int);
- method public boolean requestFocus();
- method public void selectTab(androidx.appcompat.app.ActionBar.Tab!);
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method public void setCustomView(int);
- method public void setCustomView(android.view.View!);
- method public void setCustomView(android.view.View!, androidx.appcompat.app.ActionBar.LayoutParams!);
- method public void setDisplayHomeAsUpEnabled(boolean);
- method public void setDisplayOptions(int);
- method public void setDisplayOptions(int, int);
- method public void setDisplayShowCustomEnabled(boolean);
- method public void setDisplayShowHomeEnabled(boolean);
- method public void setDisplayShowTitleEnabled(boolean);
- method public void setDisplayUseLogoEnabled(boolean);
- method public void setIcon(int);
- method public void setIcon(android.graphics.drawable.Drawable!);
- method public void setListNavigationCallbacks(android.widget.SpinnerAdapter!, androidx.appcompat.app.ActionBar.OnNavigationListener!);
- method public void setLogo(int);
- method public void setLogo(android.graphics.drawable.Drawable!);
- method public void setNavigationMode(int);
- method public void setSelectedNavigationItem(int);
- method public void setSubtitle(int);
- method public void setSubtitle(CharSequence!);
- method public void setTitle(int);
- method public void setTitle(CharSequence!);
- method public void show();
- method public void showForSystem();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WindowDecorActionBar.ActionModeImpl extends androidx.appcompat.view.ActionMode implements androidx.appcompat.view.menu.MenuBuilder.Callback {
- ctor public WindowDecorActionBar.ActionModeImpl(android.content.Context!, androidx.appcompat.view.ActionMode.Callback!);
- method public boolean dispatchOnCreate();
- method public void finish();
- method public android.view.View! getCustomView();
- method public android.view.Menu! getMenu();
- method public android.view.MenuInflater! getMenuInflater();
- method public CharSequence! getSubtitle();
- method public CharSequence! getTitle();
- method public void invalidate();
- method public void onCloseMenu(androidx.appcompat.view.menu.MenuBuilder!, boolean);
- method public void onCloseSubMenu(androidx.appcompat.view.menu.SubMenuBuilder!);
- method public boolean onMenuItemSelected(androidx.appcompat.view.menu.MenuBuilder!, android.view.MenuItem!);
- method public void onMenuModeChange(androidx.appcompat.view.menu.MenuBuilder!);
- method public boolean onSubMenuSelected(androidx.appcompat.view.menu.SubMenuBuilder!);
- method public void setCustomView(android.view.View!);
- method public void setSubtitle(CharSequence!);
- method public void setSubtitle(int);
- method public void setTitle(CharSequence!);
- method public void setTitle(int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WindowDecorActionBar.TabImpl extends androidx.appcompat.app.ActionBar.Tab {
- ctor public WindowDecorActionBar.TabImpl();
- method public androidx.appcompat.app.ActionBar.TabListener! getCallback();
- method public CharSequence! getContentDescription();
- method public android.view.View! getCustomView();
- method public android.graphics.drawable.Drawable! getIcon();
- method public int getPosition();
- method public Object! getTag();
- method public CharSequence! getText();
- method public void select();
- method public androidx.appcompat.app.ActionBar.Tab! setContentDescription(int);
- method public androidx.appcompat.app.ActionBar.Tab! setContentDescription(CharSequence!);
- method public androidx.appcompat.app.ActionBar.Tab! setCustomView(android.view.View!);
- method public androidx.appcompat.app.ActionBar.Tab! setCustomView(int);
- method public androidx.appcompat.app.ActionBar.Tab! setIcon(android.graphics.drawable.Drawable!);
- method public androidx.appcompat.app.ActionBar.Tab! setIcon(int);
- method public void setPosition(int);
- method public androidx.appcompat.app.ActionBar.Tab! setTabListener(androidx.appcompat.app.ActionBar.TabListener!);
- method public androidx.appcompat.app.ActionBar.Tab! setTag(Object!);
- method public androidx.appcompat.app.ActionBar.Tab! setText(CharSequence!);
- method public androidx.appcompat.app.ActionBar.Tab! setText(int);
- }
-
-}
-
-package androidx.appcompat.graphics.drawable {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class DrawableWrapper {
- ctor public DrawableWrapper(android.graphics.drawable.Drawable!);
- method public void draw(android.graphics.Canvas!);
- method public int getChangingConfigurations();
- method public android.graphics.drawable.Drawable! getCurrent();
- method public int getIntrinsicHeight();
- method public int getIntrinsicWidth();
- method public int getMinimumHeight();
- method public int getMinimumWidth();
- method public int getOpacity();
- method public boolean getPadding(android.graphics.Rect!);
- method public int[]! getState();
- method public android.graphics.Region! getTransparentRegion();
- method public android.graphics.drawable.Drawable! getWrappedDrawable();
- method public void invalidateDrawable(android.graphics.drawable.Drawable!);
- method public boolean isAutoMirrored();
- method public boolean isStateful();
- method public void jumpToCurrentState();
- method protected void onBoundsChange(android.graphics.Rect!);
- method protected boolean onLevelChange(int);
- method public void scheduleDrawable(android.graphics.drawable.Drawable!, Runnable!, long);
- method public void setAlpha(int);
- method public void setAutoMirrored(boolean);
- method public void setChangingConfigurations(int);
- method public void setColorFilter(android.graphics.ColorFilter!);
- method public void setDither(boolean);
- method public void setFilterBitmap(boolean);
- method public void setHotspot(float, float);
- method public void setHotspotBounds(int, int, int, int);
- method public boolean setState(int[]!);
- method public void setTint(int);
- method public void setTintList(android.content.res.ColorStateList!);
- method public void setTintMode(android.graphics.PorterDuff.Mode!);
- method public boolean setVisible(boolean, boolean);
- method public void setWrappedDrawable(android.graphics.drawable.Drawable!);
- method public void unscheduleDrawable(android.graphics.drawable.Drawable!, Runnable!);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface DrawerArrowDrawable.ArrowDirection {
- }
-
-}
-
-package androidx.appcompat.text {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class AllCapsTransformationMethod {
- ctor public AllCapsTransformationMethod(android.content.Context!);
- method public CharSequence! getTransformation(CharSequence!, android.view.View!);
- method public void onFocusChanged(android.view.View!, CharSequence!, boolean, int, android.graphics.Rect!);
- }
-
-}
-
-package androidx.appcompat.view {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ActionBarPolicy {
- method public boolean enableHomeButtonByDefault();
- method public static androidx.appcompat.view.ActionBarPolicy! get(android.content.Context!);
- method public int getEmbeddedMenuWidthLimit();
- method public int getMaxActionButtons();
- method public int getStackedTabMaxWidth();
- method public int getTabContainerHeight();
- method public boolean hasEmbeddedTabs();
- method public boolean showsOverflowMenuButton();
- }
-
- public abstract class ActionMode {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean isUiFocusable();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class StandaloneActionMode extends androidx.appcompat.view.ActionMode implements androidx.appcompat.view.menu.MenuBuilder.Callback {
- ctor public StandaloneActionMode(android.content.Context!, androidx.appcompat.widget.ActionBarContextView!, androidx.appcompat.view.ActionMode.Callback!, boolean);
- method public void finish();
- method public android.view.View! getCustomView();
- method public android.view.Menu! getMenu();
- method public android.view.MenuInflater! getMenuInflater();
- method public CharSequence! getSubtitle();
- method public CharSequence! getTitle();
- method public void invalidate();
- method public void onCloseMenu(androidx.appcompat.view.menu.MenuBuilder!, boolean);
- method public void onCloseSubMenu(androidx.appcompat.view.menu.SubMenuBuilder!);
- method public boolean onMenuItemSelected(androidx.appcompat.view.menu.MenuBuilder!, android.view.MenuItem!);
- method public void onMenuModeChange(androidx.appcompat.view.menu.MenuBuilder!);
- method public boolean onSubMenuSelected(androidx.appcompat.view.menu.SubMenuBuilder!);
- method public void setCustomView(android.view.View!);
- method public void setSubtitle(CharSequence!);
- method public void setSubtitle(int);
- method public void setTitle(CharSequence!);
- method public void setTitle(int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class SupportActionModeWrapper {
- ctor public SupportActionModeWrapper(android.content.Context!, androidx.appcompat.view.ActionMode!);
- method public void finish();
- method public android.view.View! getCustomView();
- method public android.view.Menu! getMenu();
- method public android.view.MenuInflater! getMenuInflater();
- method public CharSequence! getSubtitle();
- method public Object! getTag();
- method public CharSequence! getTitle();
- method public boolean getTitleOptionalHint();
- method public void invalidate();
- method public boolean isTitleOptional();
- method public void setCustomView(android.view.View!);
- method public void setSubtitle(CharSequence!);
- method public void setSubtitle(int);
- method public void setTag(Object!);
- method public void setTitle(CharSequence!);
- method public void setTitle(int);
- method public void setTitleOptionalHint(boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class SupportActionModeWrapper.CallbackWrapper implements androidx.appcompat.view.ActionMode.Callback {
- ctor public SupportActionModeWrapper.CallbackWrapper(android.content.Context!, android.view.ActionMode.Callback!);
- method public android.view.ActionMode! getActionModeWrapper(androidx.appcompat.view.ActionMode!);
- method public boolean onActionItemClicked(androidx.appcompat.view.ActionMode!, android.view.MenuItem!);
- method public boolean onCreateActionMode(androidx.appcompat.view.ActionMode!, android.view.Menu!);
- method public void onDestroyActionMode(androidx.appcompat.view.ActionMode!);
- method public boolean onPrepareActionMode(androidx.appcompat.view.ActionMode!, android.view.Menu!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class SupportMenuInflater {
- ctor public SupportMenuInflater(android.content.Context!);
- method public void inflate(@LayoutRes int, android.view.Menu!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ViewPropertyAnimatorCompatSet {
- ctor public ViewPropertyAnimatorCompatSet();
- method public void cancel();
- method public androidx.appcompat.view.ViewPropertyAnimatorCompatSet! play(androidx.core.view.ViewPropertyAnimatorCompat!);
- method public androidx.appcompat.view.ViewPropertyAnimatorCompatSet! playSequentially(androidx.core.view.ViewPropertyAnimatorCompat!, androidx.core.view.ViewPropertyAnimatorCompat!);
- method public androidx.appcompat.view.ViewPropertyAnimatorCompatSet! setDuration(long);
- method public androidx.appcompat.view.ViewPropertyAnimatorCompatSet! setInterpolator(android.view.animation.Interpolator!);
- method public androidx.appcompat.view.ViewPropertyAnimatorCompatSet! setListener(androidx.core.view.ViewPropertyAnimatorListener!);
- method public void start();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WindowCallbackWrapper {
- ctor public WindowCallbackWrapper(android.view.Window.Callback!);
- method public boolean dispatchGenericMotionEvent(android.view.MotionEvent!);
- method public boolean dispatchKeyEvent(android.view.KeyEvent!);
- method public boolean dispatchKeyShortcutEvent(android.view.KeyEvent!);
- method public boolean dispatchPopulateAccessibilityEvent(android.view.accessibility.AccessibilityEvent!);
- method public boolean dispatchTouchEvent(android.view.MotionEvent!);
- method public boolean dispatchTrackballEvent(android.view.MotionEvent!);
- method public void onActionModeFinished(android.view.ActionMode!);
- method public void onActionModeStarted(android.view.ActionMode!);
- method public void onAttachedToWindow();
- method public void onContentChanged();
- method public boolean onCreatePanelMenu(int, android.view.Menu!);
- method public android.view.View! onCreatePanelView(int);
- method public void onDetachedFromWindow();
- method public boolean onMenuItemSelected(int, android.view.MenuItem!);
- method public boolean onMenuOpened(int, android.view.Menu!);
- method public void onPanelClosed(int, android.view.Menu!);
- method @RequiresApi(26) public void onPointerCaptureChanged(boolean);
- method public boolean onPreparePanel(int, android.view.View!, android.view.Menu!);
- method @RequiresApi(24) public void onProvideKeyboardShortcuts(java.util.List<android.view.KeyboardShortcutGroup>!, android.view.Menu!, int);
- method @RequiresApi(23) public boolean onSearchRequested(android.view.SearchEvent!);
- method public boolean onSearchRequested();
- method public void onWindowAttributesChanged(android.view.WindowManager.LayoutParams!);
- method public void onWindowFocusChanged(boolean);
- method public android.view.ActionMode! onWindowStartingActionMode(android.view.ActionMode.Callback!);
- method @RequiresApi(23) public android.view.ActionMode! onWindowStartingActionMode(android.view.ActionMode.Callback!, int);
- }
-
-}
-
-package androidx.appcompat.view.menu {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ActionMenuItem {
- ctor public ActionMenuItem(android.content.Context!, int, int, int, int, CharSequence!);
- method public boolean collapseActionView();
- method public boolean expandActionView();
- method public android.view.ActionProvider! getActionProvider();
- method public android.view.View! getActionView();
- method public int getAlphabeticModifiers();
- method public char getAlphabeticShortcut();
- method public CharSequence! getContentDescription();
- method public int getGroupId();
- method public android.graphics.drawable.Drawable! getIcon();
- method public android.content.res.ColorStateList! getIconTintList();
- method public android.graphics.PorterDuff.Mode! getIconTintMode();
- method public android.content.Intent! getIntent();
- method public int getItemId();
- method public android.view.ContextMenu.ContextMenuInfo! getMenuInfo();
- method public int getNumericModifiers();
- method public char getNumericShortcut();
- method public int getOrder();
- method public android.view.SubMenu! getSubMenu();
- method public androidx.core.view.ActionProvider! getSupportActionProvider();
- method public CharSequence! getTitle();
- method public CharSequence! getTitleCondensed();
- method public CharSequence! getTooltipText();
- method public boolean hasSubMenu();
- method public boolean invoke();
- method public boolean isActionViewExpanded();
- method public boolean isCheckable();
- method public boolean isChecked();
- method public boolean isEnabled();
- method public boolean isVisible();
- method public android.view.MenuItem! setActionProvider(android.view.ActionProvider!);
- method public androidx.core.internal.view.SupportMenuItem! setActionView(android.view.View!);
- method public androidx.core.internal.view.SupportMenuItem! setActionView(int);
- method public android.view.MenuItem! setAlphabeticShortcut(char);
- method public android.view.MenuItem! setAlphabeticShortcut(char, int);
- method public android.view.MenuItem! setCheckable(boolean);
- method public android.view.MenuItem! setChecked(boolean);
- method public androidx.core.internal.view.SupportMenuItem! setContentDescription(CharSequence!);
- method public android.view.MenuItem! setEnabled(boolean);
- method public androidx.appcompat.view.menu.ActionMenuItem! setExclusiveCheckable(boolean);
- method public android.view.MenuItem! setIcon(android.graphics.drawable.Drawable!);
- method public android.view.MenuItem! setIcon(int);
- method public android.view.MenuItem! setIconTintList(android.content.res.ColorStateList?);
- method public android.view.MenuItem! setIconTintMode(android.graphics.PorterDuff.Mode!);
- method public android.view.MenuItem! setIntent(android.content.Intent!);
- method public android.view.MenuItem! setNumericShortcut(char);
- method public android.view.MenuItem! setNumericShortcut(char, int);
- method public android.view.MenuItem! setOnActionExpandListener(android.view.MenuItem.OnActionExpandListener!);
- method public android.view.MenuItem! setOnMenuItemClickListener(android.view.MenuItem.OnMenuItemClickListener!);
- method public android.view.MenuItem! setShortcut(char, char);
- method public android.view.MenuItem! setShortcut(char, char, int, int);
- method public void setShowAsAction(int);
- method public androidx.core.internal.view.SupportMenuItem! setShowAsActionFlags(int);
- method public androidx.core.internal.view.SupportMenuItem! setSupportActionProvider(androidx.core.view.ActionProvider!);
- method public android.view.MenuItem! setTitle(CharSequence!);
- method public android.view.MenuItem! setTitle(int);
- method public android.view.MenuItem! setTitleCondensed(CharSequence!);
- method public androidx.core.internal.view.SupportMenuItem! setTooltipText(CharSequence!);
- method public android.view.MenuItem! setVisible(boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ActionMenuItemView extends androidx.appcompat.widget.AppCompatTextView implements androidx.appcompat.widget.ActionMenuView.ActionMenuChildView androidx.appcompat.view.menu.MenuView.ItemView {
- ctor public ActionMenuItemView(android.content.Context!);
- ctor public ActionMenuItemView(android.content.Context!, android.util.AttributeSet!);
- ctor public ActionMenuItemView(android.content.Context!, android.util.AttributeSet!, int);
- method public androidx.appcompat.view.menu.MenuItemImpl! getItemData();
- method public boolean hasText();
- method public void initialize(androidx.appcompat.view.menu.MenuItemImpl!, int);
- method public boolean needsDividerAfter();
- method public boolean needsDividerBefore();
- method public void onClick(android.view.View!);
- method public void onConfigurationChanged(android.content.res.Configuration!);
- method public void onRestoreInstanceState(android.os.Parcelable!);
- method public boolean onTouchEvent(android.view.MotionEvent!);
- method public boolean prefersCondensedTitle();
- method public void setCheckable(boolean);
- method public void setChecked(boolean);
- method public void setExpandedFormat(boolean);
- method public void setIcon(android.graphics.drawable.Drawable!);
- method public void setItemInvoker(androidx.appcompat.view.menu.MenuBuilder.ItemInvoker!);
- method public void setPadding(int, int, int, int);
- method public void setPopupCallback(androidx.appcompat.view.menu.ActionMenuItemView.PopupCallback!);
- method public void setShortcut(boolean, char);
- method public void setTitle(CharSequence!);
- method public boolean showsIcon();
- }
-
- public abstract static class ActionMenuItemView.PopupCallback {
- ctor public ActionMenuItemView.PopupCallback();
- method public abstract androidx.appcompat.view.menu.ShowableListMenu! getPopup();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class BaseMenuPresenter implements androidx.appcompat.view.menu.MenuPresenter {
- ctor public BaseMenuPresenter(android.content.Context!, int, int);
- method protected void addItemView(android.view.View!, int);
- method public abstract void bindItemView(androidx.appcompat.view.menu.MenuItemImpl!, androidx.appcompat.view.menu.MenuView.ItemView!);
- method public boolean collapseItemActionView(androidx.appcompat.view.menu.MenuBuilder!, androidx.appcompat.view.menu.MenuItemImpl!);
- method public androidx.appcompat.view.menu.MenuView.ItemView! createItemView(android.view.ViewGroup!);
- method public boolean expandItemActionView(androidx.appcompat.view.menu.MenuBuilder!, androidx.appcompat.view.menu.MenuItemImpl!);
- method protected boolean filterLeftoverView(android.view.ViewGroup!, int);
- method public boolean flagActionItems();
- method public androidx.appcompat.view.menu.MenuPresenter.Callback! getCallback();
- method public int getId();
- method public android.view.View! getItemView(androidx.appcompat.view.menu.MenuItemImpl!, android.view.View!, android.view.ViewGroup!);
- method public androidx.appcompat.view.menu.MenuView! getMenuView(android.view.ViewGroup!);
- method public void initForMenu(android.content.Context!, androidx.appcompat.view.menu.MenuBuilder!);
- method public void onCloseMenu(androidx.appcompat.view.menu.MenuBuilder!, boolean);
- method public boolean onSubMenuSelected(androidx.appcompat.view.menu.SubMenuBuilder!);
- method public void setCallback(androidx.appcompat.view.menu.MenuPresenter.Callback!);
- method public void setId(int);
- method public boolean shouldIncludeItem(int, androidx.appcompat.view.menu.MenuItemImpl!);
- method public void updateMenuView(boolean);
- field protected android.content.Context! mContext;
- field protected android.view.LayoutInflater! mInflater;
- field protected androidx.appcompat.view.menu.MenuBuilder! mMenu;
- field protected androidx.appcompat.view.menu.MenuView! mMenuView;
- field protected android.content.Context! mSystemContext;
- field protected android.view.LayoutInflater! mSystemInflater;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class ExpandedMenuView implements androidx.appcompat.view.menu.MenuBuilder.ItemInvoker androidx.appcompat.view.menu.MenuView {
- ctor public ExpandedMenuView(android.content.Context!, android.util.AttributeSet!);
- ctor public ExpandedMenuView(android.content.Context!, android.util.AttributeSet!, int);
- method public int getWindowAnimations();
- method public void initialize(androidx.appcompat.view.menu.MenuBuilder!);
- method public boolean invokeItem(androidx.appcompat.view.menu.MenuItemImpl!);
- method protected void onDetachedFromWindow();
- method public void onItemClick(android.widget.AdapterView!, android.view.View!, int, long);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ListMenuItemView implements androidx.appcompat.view.menu.MenuView.ItemView {
- ctor public ListMenuItemView(android.content.Context!, android.util.AttributeSet!);
- ctor public ListMenuItemView(android.content.Context!, android.util.AttributeSet!, int);
- method public void adjustListItemSelectionBounds(android.graphics.Rect!);
- method public androidx.appcompat.view.menu.MenuItemImpl! getItemData();
- method public void initialize(androidx.appcompat.view.menu.MenuItemImpl!, int);
- method protected void onFinishInflate();
- method protected void onMeasure(int, int);
- method public boolean prefersCondensedTitle();
- method public void setCheckable(boolean);
- method public void setChecked(boolean);
- method public void setForceShowIcon(boolean);
- method public void setGroupDividerEnabled(boolean);
- method public void setIcon(android.graphics.drawable.Drawable!);
- method public void setShortcut(boolean, char);
- method public void setTitle(CharSequence!);
- method public boolean showsIcon();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ListMenuPresenter implements androidx.appcompat.view.menu.MenuPresenter {
- ctor public ListMenuPresenter(android.content.Context!, int);
- ctor public ListMenuPresenter(int, int);
- method public boolean collapseItemActionView(androidx.appcompat.view.menu.MenuBuilder!, androidx.appcompat.view.menu.MenuItemImpl!);
- method public boolean expandItemActionView(androidx.appcompat.view.menu.MenuBuilder!, androidx.appcompat.view.menu.MenuItemImpl!);
- method public boolean flagActionItems();
- method public android.widget.ListAdapter! getAdapter();
- method public int getId();
- method public androidx.appcompat.view.menu.MenuView! getMenuView(android.view.ViewGroup!);
- method public void initForMenu(android.content.Context!, androidx.appcompat.view.menu.MenuBuilder!);
- method public void onCloseMenu(androidx.appcompat.view.menu.MenuBuilder!, boolean);
- method public void onItemClick(android.widget.AdapterView<?>!, android.view.View!, int, long);
- method public void onRestoreInstanceState(android.os.Parcelable!);
- method public android.os.Parcelable! onSaveInstanceState();
- method public boolean onSubMenuSelected(androidx.appcompat.view.menu.SubMenuBuilder!);
- method public void restoreHierarchyState(android.os.Bundle!);
- method public void saveHierarchyState(android.os.Bundle!);
- method public void setCallback(androidx.appcompat.view.menu.MenuPresenter.Callback!);
- method public void setId(int);
- method public void setItemIndexOffset(int);
- method public void updateMenuView(boolean);
- field public static final String VIEWS_TAG = "android:menu:list";
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class MenuAdapter {
- ctor public MenuAdapter(androidx.appcompat.view.menu.MenuBuilder!, android.view.LayoutInflater!, boolean, int);
- method public androidx.appcompat.view.menu.MenuBuilder! getAdapterMenu();
- method public int getCount();
- method public boolean getForceShowIcon();
- method public androidx.appcompat.view.menu.MenuItemImpl! getItem(int);
- method public long getItemId(int);
- method public android.view.View! getView(int, android.view.View!, android.view.ViewGroup!);
- method public void notifyDataSetChanged();
- method public void setForceShowIcon(boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class MenuBuilder {
- ctor public MenuBuilder(android.content.Context!);
- method public android.view.MenuItem! add(CharSequence!);
- method public android.view.MenuItem! add(int);
- method public android.view.MenuItem! add(int, int, int, CharSequence!);
- method public android.view.MenuItem! add(int, int, int, int);
- method public int addIntentOptions(int, int, int, android.content.ComponentName!, android.content.Intent[]!, android.content.Intent!, int, android.view.MenuItem[]!);
- method protected android.view.MenuItem! addInternal(int, int, int, CharSequence!);
- method public void addMenuPresenter(androidx.appcompat.view.menu.MenuPresenter!);
- method public void addMenuPresenter(androidx.appcompat.view.menu.MenuPresenter!, android.content.Context!);
- method public android.view.SubMenu! addSubMenu(CharSequence!);
- method public android.view.SubMenu! addSubMenu(int);
- method public android.view.SubMenu! addSubMenu(int, int, int, CharSequence!);
- method public android.view.SubMenu! addSubMenu(int, int, int, int);
- method public void changeMenuMode();
- method public void clear();
- method public void clearAll();
- method public void clearHeader();
- method public final void close(boolean);
- method public void close();
- method public boolean collapseItemActionView(androidx.appcompat.view.menu.MenuItemImpl!);
- method public boolean expandItemActionView(androidx.appcompat.view.menu.MenuItemImpl!);
- method public int findGroupIndex(int);
- method public int findGroupIndex(int, int);
- method public android.view.MenuItem! findItem(int);
- method public int findItemIndex(int);
- method public void flagActionItems();
- method public java.util.ArrayList<androidx.appcompat.view.menu.MenuItemImpl>! getActionItems();
- method protected String! getActionViewStatesKey();
- method public android.content.Context! getContext();
- method public androidx.appcompat.view.menu.MenuItemImpl! getExpandedItem();
- method public android.graphics.drawable.Drawable! getHeaderIcon();
- method public CharSequence! getHeaderTitle();
- method public android.view.View! getHeaderView();
- method public android.view.MenuItem! getItem(int);
- method public java.util.ArrayList<androidx.appcompat.view.menu.MenuItemImpl>! getNonActionItems();
- method public androidx.appcompat.view.menu.MenuBuilder! getRootMenu();
- method public java.util.ArrayList<androidx.appcompat.view.menu.MenuItemImpl> getVisibleItems();
- method public boolean hasVisibleItems();
- method public boolean isGroupDividerEnabled();
- method public boolean isShortcutKey(int, android.view.KeyEvent!);
- method public boolean isShortcutsVisible();
- method public void onItemsChanged(boolean);
- method public boolean performIdentifierAction(int, int);
- method public boolean performItemAction(android.view.MenuItem!, int);
- method public boolean performItemAction(android.view.MenuItem!, androidx.appcompat.view.menu.MenuPresenter!, int);
- method public boolean performShortcut(int, android.view.KeyEvent!, int);
- method public void removeGroup(int);
- method public void removeItem(int);
- method public void removeItemAt(int);
- method public void removeMenuPresenter(androidx.appcompat.view.menu.MenuPresenter!);
- method public void restoreActionViewStates(android.os.Bundle!);
- method public void restorePresenterStates(android.os.Bundle!);
- method public void saveActionViewStates(android.os.Bundle!);
- method public void savePresenterStates(android.os.Bundle!);
- method public void setCallback(androidx.appcompat.view.menu.MenuBuilder.Callback!);
- method public void setCurrentMenuInfo(android.view.ContextMenu.ContextMenuInfo!);
- method public androidx.appcompat.view.menu.MenuBuilder! setDefaultShowAsAction(int);
- method public void setGroupCheckable(int, boolean, boolean);
- method public void setGroupDividerEnabled(boolean);
- method public void setGroupEnabled(int, boolean);
- method public void setGroupVisible(int, boolean);
- method protected androidx.appcompat.view.menu.MenuBuilder! setHeaderIconInt(android.graphics.drawable.Drawable!);
- method protected androidx.appcompat.view.menu.MenuBuilder! setHeaderIconInt(int);
- method protected androidx.appcompat.view.menu.MenuBuilder! setHeaderTitleInt(CharSequence!);
- method protected androidx.appcompat.view.menu.MenuBuilder! setHeaderTitleInt(int);
- method protected androidx.appcompat.view.menu.MenuBuilder! setHeaderViewInt(android.view.View!);
- method public void setOptionalIconsVisible(boolean);
- method public void setOverrideVisibleItems(boolean);
- method public void setQwertyMode(boolean);
- method public void setShortcutsVisible(boolean);
- method public int size();
- method public void startDispatchingItemsChanged();
- method public void stopDispatchingItemsChanged();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static interface MenuBuilder.Callback {
- method public boolean onMenuItemSelected(androidx.appcompat.view.menu.MenuBuilder!, android.view.MenuItem!);
- method public void onMenuModeChange(androidx.appcompat.view.menu.MenuBuilder!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static interface MenuBuilder.ItemInvoker {
- method public boolean invokeItem(androidx.appcompat.view.menu.MenuItemImpl!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class MenuItemImpl {
- method public void actionFormatChanged();
- method public boolean collapseActionView();
- method public boolean expandActionView();
- method public android.view.ActionProvider! getActionProvider();
- method public android.view.View! getActionView();
- method public int getAlphabeticModifiers();
- method public char getAlphabeticShortcut();
- method public CharSequence! getContentDescription();
- method public int getGroupId();
- method public android.graphics.drawable.Drawable! getIcon();
- method public android.content.res.ColorStateList! getIconTintList();
- method public android.graphics.PorterDuff.Mode! getIconTintMode();
- method public android.content.Intent! getIntent();
- method @android.view.ViewDebug.CapturedViewProperty public int getItemId();
- method public android.view.ContextMenu.ContextMenuInfo! getMenuInfo();
- method public int getNumericModifiers();
- method public char getNumericShortcut();
- method public int getOrder();
- method public int getOrdering();
- method public android.view.SubMenu! getSubMenu();
- method public androidx.core.view.ActionProvider! getSupportActionProvider();
- method @android.view.ViewDebug.CapturedViewProperty public CharSequence! getTitle();
- method public CharSequence! getTitleCondensed();
- method public CharSequence! getTooltipText();
- method public boolean hasCollapsibleActionView();
- method public boolean hasSubMenu();
- method public boolean invoke();
- method public boolean isActionButton();
- method public boolean isActionViewExpanded();
- method public boolean isCheckable();
- method public boolean isChecked();
- method public boolean isEnabled();
- method public boolean isExclusiveCheckable();
- method public boolean isVisible();
- method public boolean requestsActionButton();
- method public boolean requiresActionButton();
- method public android.view.MenuItem! setActionProvider(android.view.ActionProvider!);
- method public androidx.core.internal.view.SupportMenuItem! setActionView(android.view.View!);
- method public androidx.core.internal.view.SupportMenuItem! setActionView(int);
- method public void setActionViewExpanded(boolean);
- method public android.view.MenuItem! setAlphabeticShortcut(char);
- method public android.view.MenuItem! setAlphabeticShortcut(char, int);
- method public android.view.MenuItem! setCallback(Runnable!);
- method public android.view.MenuItem! setCheckable(boolean);
- method public android.view.MenuItem! setChecked(boolean);
- method public androidx.core.internal.view.SupportMenuItem! setContentDescription(CharSequence!);
- method public android.view.MenuItem! setEnabled(boolean);
- method public void setExclusiveCheckable(boolean);
- method public android.view.MenuItem! setIcon(android.graphics.drawable.Drawable!);
- method public android.view.MenuItem! setIcon(int);
- method public android.view.MenuItem! setIconTintList(android.content.res.ColorStateList?);
- method public android.view.MenuItem! setIconTintMode(android.graphics.PorterDuff.Mode!);
- method public android.view.MenuItem! setIntent(android.content.Intent!);
- method public void setIsActionButton(boolean);
- method public android.view.MenuItem! setNumericShortcut(char);
- method public android.view.MenuItem! setNumericShortcut(char, int);
- method public android.view.MenuItem! setOnActionExpandListener(android.view.MenuItem.OnActionExpandListener!);
- method public android.view.MenuItem! setOnMenuItemClickListener(android.view.MenuItem.OnMenuItemClickListener!);
- method public android.view.MenuItem! setShortcut(char, char);
- method public android.view.MenuItem! setShortcut(char, char, int, int);
- method public void setShowAsAction(int);
- method public androidx.core.internal.view.SupportMenuItem! setShowAsActionFlags(int);
- method public void setSubMenu(androidx.appcompat.view.menu.SubMenuBuilder!);
- method public androidx.core.internal.view.SupportMenuItem! setSupportActionProvider(androidx.core.view.ActionProvider!);
- method public android.view.MenuItem! setTitle(CharSequence!);
- method public android.view.MenuItem! setTitle(int);
- method public android.view.MenuItem! setTitleCondensed(CharSequence!);
- method public androidx.core.internal.view.SupportMenuItem! setTooltipText(CharSequence!);
- method public android.view.MenuItem! setVisible(boolean);
- method public boolean shouldShowIcon();
- method public boolean showsTextAsAction();
- method public String toString();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class MenuItemWrapperICS {
- method public boolean collapseActionView();
- method public boolean expandActionView();
- method public android.view.ActionProvider! getActionProvider();
- method public android.view.View! getActionView();
- method public int getAlphabeticModifiers();
- method public char getAlphabeticShortcut();
- method public CharSequence! getContentDescription();
- method public int getGroupId();
- method public android.graphics.drawable.Drawable! getIcon();
- method public android.content.res.ColorStateList! getIconTintList();
- method public android.graphics.PorterDuff.Mode! getIconTintMode();
- method public android.content.Intent! getIntent();
- method public int getItemId();
- method public android.view.ContextMenu.ContextMenuInfo! getMenuInfo();
- method public int getNumericModifiers();
- method public char getNumericShortcut();
- method public int getOrder();
- method public android.view.SubMenu! getSubMenu();
- method public CharSequence! getTitle();
- method public CharSequence! getTitleCondensed();
- method public CharSequence! getTooltipText();
- method public boolean hasSubMenu();
- method public boolean isActionViewExpanded();
- method public boolean isCheckable();
- method public boolean isChecked();
- method public boolean isEnabled();
- method public boolean isVisible();
- method public android.view.MenuItem! setActionProvider(android.view.ActionProvider!);
- method public android.view.MenuItem! setActionView(android.view.View!);
- method public android.view.MenuItem! setActionView(int);
- method public android.view.MenuItem! setAlphabeticShortcut(char);
- method public android.view.MenuItem! setAlphabeticShortcut(char, int);
- method public android.view.MenuItem! setCheckable(boolean);
- method public android.view.MenuItem! setChecked(boolean);
- method public android.view.MenuItem! setContentDescription(CharSequence!);
- method public android.view.MenuItem! setEnabled(boolean);
- method public void setExclusiveCheckable(boolean);
- method public android.view.MenuItem! setIcon(android.graphics.drawable.Drawable!);
- method public android.view.MenuItem! setIcon(int);
- method public android.view.MenuItem! setIconTintList(android.content.res.ColorStateList!);
- method public android.view.MenuItem! setIconTintMode(android.graphics.PorterDuff.Mode!);
- method public android.view.MenuItem! setIntent(android.content.Intent!);
- method public android.view.MenuItem! setNumericShortcut(char);
- method public android.view.MenuItem! setNumericShortcut(char, int);
- method public android.view.MenuItem! setOnActionExpandListener(android.view.MenuItem.OnActionExpandListener!);
- method public android.view.MenuItem! setOnMenuItemClickListener(android.view.MenuItem.OnMenuItemClickListener!);
- method public android.view.MenuItem! setShortcut(char, char);
- method public android.view.MenuItem! setShortcut(char, char, int, int);
- method public void setShowAsAction(int);
- method public android.view.MenuItem! setShowAsActionFlags(int);
- method public android.view.MenuItem! setTitle(CharSequence!);
- method public android.view.MenuItem! setTitle(int);
- method public android.view.MenuItem! setTitleCondensed(CharSequence!);
- method public android.view.MenuItem! setTooltipText(CharSequence!);
- method public android.view.MenuItem! setVisible(boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class MenuPopupHelper {
- ctor public MenuPopupHelper(android.content.Context, androidx.appcompat.view.menu.MenuBuilder);
- ctor public MenuPopupHelper(android.content.Context, androidx.appcompat.view.menu.MenuBuilder, android.view.View);
- ctor public MenuPopupHelper(android.content.Context, androidx.appcompat.view.menu.MenuBuilder, android.view.View, boolean, @AttrRes int);
- ctor public MenuPopupHelper(android.content.Context, androidx.appcompat.view.menu.MenuBuilder, android.view.View, boolean, @AttrRes int, @StyleRes int);
- method public void dismiss();
- method public int getGravity();
- method public android.widget.ListView! getListView();
- method public androidx.appcompat.view.menu.MenuPopup getPopup();
- method public boolean isShowing();
- method protected void onDismiss();
- method public void setAnchorView(android.view.View);
- method public void setForceShowIcon(boolean);
- method public void setGravity(int);
- method public void setOnDismissListener(android.widget.PopupWindow.OnDismissListener?);
- method public void setPresenterCallback(androidx.appcompat.view.menu.MenuPresenter.Callback?);
- method public void show();
- method public void show(int, int);
- method public boolean tryShow();
- method public boolean tryShow(int, int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface MenuPresenter {
- method public boolean collapseItemActionView(androidx.appcompat.view.menu.MenuBuilder!, androidx.appcompat.view.menu.MenuItemImpl!);
- method public boolean expandItemActionView(androidx.appcompat.view.menu.MenuBuilder!, androidx.appcompat.view.menu.MenuItemImpl!);
- method public boolean flagActionItems();
- method public int getId();
- method public androidx.appcompat.view.menu.MenuView! getMenuView(android.view.ViewGroup!);
- method public void initForMenu(android.content.Context!, androidx.appcompat.view.menu.MenuBuilder!);
- method public void onCloseMenu(androidx.appcompat.view.menu.MenuBuilder!, boolean);
- method public void onRestoreInstanceState(android.os.Parcelable!);
- method public android.os.Parcelable! onSaveInstanceState();
- method public boolean onSubMenuSelected(androidx.appcompat.view.menu.SubMenuBuilder!);
- method public void setCallback(androidx.appcompat.view.menu.MenuPresenter.Callback!);
- method public void updateMenuView(boolean);
- }
-
- public static interface MenuPresenter.Callback {
- method public void onCloseMenu(androidx.appcompat.view.menu.MenuBuilder!, boolean);
- method public boolean onOpenSubMenu(androidx.appcompat.view.menu.MenuBuilder!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface MenuView {
- method public int getWindowAnimations();
- method public void initialize(androidx.appcompat.view.menu.MenuBuilder!);
- }
-
- public static interface MenuView.ItemView {
- method public androidx.appcompat.view.menu.MenuItemImpl! getItemData();
- method public void initialize(androidx.appcompat.view.menu.MenuItemImpl!, int);
- method public boolean prefersCondensedTitle();
- method public void setCheckable(boolean);
- method public void setChecked(boolean);
- method public void setEnabled(boolean);
- method public void setIcon(android.graphics.drawable.Drawable!);
- method public void setShortcut(boolean, char);
- method public void setTitle(CharSequence!);
- method public boolean showsIcon();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class MenuWrapperFactory {
- method public static android.view.Menu! wrapSupportMenu(android.content.Context!, androidx.core.internal.view.SupportMenu!);
- method public static android.view.MenuItem! wrapSupportMenuItem(android.content.Context!, androidx.core.internal.view.SupportMenuItem!);
- method public static android.view.SubMenu! wrapSupportSubMenu(android.content.Context!, androidx.core.internal.view.SupportSubMenu!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface ShowableListMenu {
- method public void dismiss();
- method public android.widget.ListView! getListView();
- method public boolean isShowing();
- method public void show();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class SubMenuBuilder extends androidx.appcompat.view.menu.MenuBuilder {
- ctor public SubMenuBuilder(android.content.Context!, androidx.appcompat.view.menu.MenuBuilder!, androidx.appcompat.view.menu.MenuItemImpl!);
- method public String! getActionViewStatesKey();
- method public android.view.MenuItem! getItem();
- method public android.view.Menu! getParentMenu();
- method public boolean isQwertyMode();
- method public android.view.SubMenu! setHeaderIcon(android.graphics.drawable.Drawable!);
- method public android.view.SubMenu! setHeaderIcon(int);
- method public android.view.SubMenu! setHeaderTitle(CharSequence!);
- method public android.view.SubMenu! setHeaderTitle(int);
- method public android.view.SubMenu! setHeaderView(android.view.View!);
- method public android.view.SubMenu! setIcon(android.graphics.drawable.Drawable!);
- method public android.view.SubMenu! setIcon(int);
- }
-
-}
-
-package androidx.appcompat.widget {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ActionBarContainer {
- ctor public ActionBarContainer(android.content.Context!);
- ctor public ActionBarContainer(android.content.Context!, android.util.AttributeSet!);
- method protected void drawableStateChanged();
- method public android.view.View! getTabContainer();
- method public void jumpDrawablesToCurrentState();
- method public void onFinishInflate();
- method public boolean onHoverEvent(android.view.MotionEvent!);
- method public boolean onInterceptTouchEvent(android.view.MotionEvent!);
- method public void onLayout(boolean, int, int, int, int);
- method public void onMeasure(int, int);
- method public boolean onTouchEvent(android.view.MotionEvent!);
- method public void setPrimaryBackground(android.graphics.drawable.Drawable!);
- method public void setSplitBackground(android.graphics.drawable.Drawable!);
- method public void setStackedBackground(android.graphics.drawable.Drawable!);
- method public void setTabContainer(androidx.appcompat.widget.ScrollingTabContainerView!);
- method public void setTransitioning(boolean);
- method public void setVisibility(int);
- method public android.view.ActionMode! startActionModeForChild(android.view.View!, android.view.ActionMode.Callback!);
- method public android.view.ActionMode! startActionModeForChild(android.view.View!, android.view.ActionMode.Callback!, int);
- method protected boolean verifyDrawable(android.graphics.drawable.Drawable!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ActionBarContextView {
- ctor public ActionBarContextView(android.content.Context!);
- ctor public ActionBarContextView(android.content.Context!, android.util.AttributeSet!);
- ctor public ActionBarContextView(android.content.Context!, android.util.AttributeSet!, int);
- method public void animateToVisibility(int);
- method public boolean canShowOverflowMenu();
- method public void closeMode();
- method public void dismissPopupMenus();
- method protected android.view.ViewGroup.LayoutParams! generateDefaultLayoutParams();
- method public android.view.ViewGroup.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
- method public int getAnimatedVisibility();
- method public int getContentHeight();
- method public CharSequence! getSubtitle();
- method public CharSequence! getTitle();
- method public boolean hideOverflowMenu();
- method public void initForMode(androidx.appcompat.view.ActionMode!);
- method public boolean isOverflowMenuShowPending();
- method public boolean isOverflowMenuShowing();
- method public boolean isOverflowReserved();
- method public boolean isTitleOptional();
- method public void killMode();
- method public void onDetachedFromWindow();
- method public boolean onHoverEvent(android.view.MotionEvent!);
- method public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent!);
- method protected void onLayout(boolean, int, int, int, int);
- method protected void onMeasure(int, int);
- method public boolean onTouchEvent(android.view.MotionEvent!);
- method public void postShowOverflowMenu();
- method public void setContentHeight(int);
- method public void setCustomView(android.view.View!);
- method public void setSubtitle(CharSequence!);
- method public void setTitle(CharSequence!);
- method public void setTitleOptional(boolean);
- method public void setVisibility(int);
- method public androidx.core.view.ViewPropertyAnimatorCompat! setupAnimatorToVisibility(int, long);
- method public boolean shouldDelayChildPressedState();
- method public boolean showOverflowMenu();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ActionBarOverlayLayout implements androidx.appcompat.widget.DecorContentParent {
- ctor public ActionBarOverlayLayout(android.content.Context!);
- ctor public ActionBarOverlayLayout(android.content.Context!, android.util.AttributeSet!);
- method public boolean canShowOverflowMenu();
- method protected boolean checkLayoutParams(android.view.ViewGroup.LayoutParams!);
- method public void dismissPopups();
- method public void draw(android.graphics.Canvas!);
- method protected boolean fitSystemWindows(android.graphics.Rect!);
- method protected androidx.appcompat.widget.ActionBarOverlayLayout.LayoutParams! generateDefaultLayoutParams();
- method public androidx.appcompat.widget.ActionBarOverlayLayout.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
- method protected android.view.ViewGroup.LayoutParams! generateLayoutParams(android.view.ViewGroup.LayoutParams!);
- method public int getActionBarHideOffset();
- method public int getNestedScrollAxes();
- method public CharSequence! getTitle();
- method public boolean hasIcon();
- method public boolean hasLogo();
- method public boolean hideOverflowMenu();
- method public void initFeature(int);
- method public boolean isHideOnContentScrollEnabled();
- method public boolean isInOverlayMode();
- method public boolean isOverflowMenuShowPending();
- method public boolean isOverflowMenuShowing();
- method protected void onConfigurationChanged(android.content.res.Configuration!);
- method protected void onDetachedFromWindow();
- method protected void onLayout(boolean, int, int, int, int);
- method protected void onMeasure(int, int);
- method public boolean onNestedFling(android.view.View!, float, float, boolean);
- method public boolean onNestedPreFling(android.view.View!, float, float);
- method public void onNestedPreScroll(android.view.View!, int, int, int[]!);
- method public void onNestedScroll(android.view.View!, int, int, int, int);
- method public void onNestedScrollAccepted(android.view.View!, android.view.View!, int);
- method public boolean onStartNestedScroll(android.view.View!, android.view.View!, int);
- method public void onStopNestedScroll(android.view.View!);
- method public void onWindowSystemUiVisibilityChanged(int);
- method protected void onWindowVisibilityChanged(int);
- method public void restoreToolbarHierarchyState(android.util.SparseArray<android.os.Parcelable>!);
- method public void saveToolbarHierarchyState(android.util.SparseArray<android.os.Parcelable>!);
- method public void setActionBarHideOffset(int);
- method public void setActionBarVisibilityCallback(androidx.appcompat.widget.ActionBarOverlayLayout.ActionBarVisibilityCallback!);
- method public void setHasNonEmbeddedTabs(boolean);
- method public void setHideOnContentScrollEnabled(boolean);
- method public void setIcon(int);
- method public void setIcon(android.graphics.drawable.Drawable!);
- method public void setLogo(int);
- method public void setMenu(android.view.Menu!, androidx.appcompat.view.menu.MenuPresenter.Callback!);
- method public void setMenuPrepared();
- method public void setOverlayMode(boolean);
- method public void setShowingForActionMode(boolean);
- method public void setUiOptions(int);
- method public void setWindowCallback(android.view.Window.Callback!);
- method public void setWindowTitle(CharSequence!);
- method public boolean shouldDelayChildPressedState();
- method public boolean showOverflowMenu();
- }
-
- public static interface ActionBarOverlayLayout.ActionBarVisibilityCallback {
- method public void enableContentAnimations(boolean);
- method public void hideForSystem();
- method public void onContentScrollStarted();
- method public void onContentScrollStopped();
- method public void onWindowVisibilityChanged(int);
- method public void showForSystem();
- }
-
- public static class ActionBarOverlayLayout.LayoutParams {
- ctor public ActionBarOverlayLayout.LayoutParams(android.content.Context!, android.util.AttributeSet!);
- ctor public ActionBarOverlayLayout.LayoutParams(int, int);
- ctor public ActionBarOverlayLayout.LayoutParams(android.view.ViewGroup.LayoutParams!);
- ctor public ActionBarOverlayLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams!);
- }
-
- public class ActionMenuView extends androidx.appcompat.widget.LinearLayoutCompat implements androidx.appcompat.view.menu.MenuBuilder.ItemInvoker androidx.appcompat.view.menu.MenuView {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.appcompat.widget.ActionMenuView.LayoutParams! generateOverflowButtonLayoutParams();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getWindowAnimations();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected boolean hasSupportDividerBeforeChildAt(int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void initialize(androidx.appcompat.view.menu.MenuBuilder!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean invokeItem(androidx.appcompat.view.menu.MenuItemImpl!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean isOverflowMenuShowPending();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean isOverflowReserved();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.appcompat.view.menu.MenuBuilder! peekMenu();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setExpandedActionViewsExclusive(boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setMenuCallbacks(androidx.appcompat.view.menu.MenuPresenter.Callback!, androidx.appcompat.view.menu.MenuBuilder.Callback!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setOverflowReserved(boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setPresenter(androidx.appcompat.widget.ActionMenuPresenter!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static interface ActionMenuView.ActionMenuChildView {
- method public boolean needsDividerAfter();
- method public boolean needsDividerBefore();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ActivityChooserView {
- ctor public ActivityChooserView(android.content.Context!);
- ctor public ActivityChooserView(android.content.Context!, android.util.AttributeSet!);
- ctor public ActivityChooserView(android.content.Context!, android.util.AttributeSet!, int);
- method public boolean dismissPopup();
- method public androidx.appcompat.widget.ActivityChooserModel! getDataModel();
- method public boolean isShowingPopup();
- method protected void onAttachedToWindow();
- method protected void onDetachedFromWindow();
- method protected void onLayout(boolean, int, int, int, int);
- method protected void onMeasure(int, int);
- method public void setActivityChooserModel(androidx.appcompat.widget.ActivityChooserModel!);
- method public void setDefaultActionButtonContentDescription(int);
- method public void setExpandActivityOverflowButtonContentDescription(int);
- method public void setExpandActivityOverflowButtonDrawable(android.graphics.drawable.Drawable!);
- method public void setInitialActivityCount(int);
- method public void setOnDismissListener(android.widget.PopupWindow.OnDismissListener!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setProvider(androidx.core.view.ActionProvider!);
- method public boolean showPopup();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class ActivityChooserView.InnerLayout {
- ctor public ActivityChooserView.InnerLayout(android.content.Context!, android.util.AttributeSet!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class AlertDialogLayout extends androidx.appcompat.widget.LinearLayoutCompat {
- ctor public AlertDialogLayout(android.content.Context?);
- ctor public AlertDialogLayout(android.content.Context?, android.util.AttributeSet?);
- }
-
- public class AppCompatAutoCompleteTextView {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public class AppCompatButton {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getAutoSizeMaxTextSize();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getAutoSizeMinTextSize();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getAutoSizeStepGranularity();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int[]! getAutoSizeTextAvailableSizes();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getAutoSizeTextType();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setAutoSizeTextTypeUniformWithPresetSizes(int[], int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setAutoSizeTextTypeWithDefaults(int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public class AppCompatCheckBox {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.res.ColorStateList? getSupportButtonTintList();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.PorterDuff.Mode? getSupportButtonTintMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportButtonTintList(android.content.res.ColorStateList?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportButtonTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class AppCompatDrawableManager {
- ctor public AppCompatDrawableManager();
- method public static androidx.appcompat.widget.AppCompatDrawableManager! get();
- method public android.graphics.drawable.Drawable! getDrawable(android.content.Context, @DrawableRes int);
- method public static android.graphics.PorterDuffColorFilter! getPorterDuffColorFilter(int, android.graphics.PorterDuff.Mode!);
- method public void onConfigurationChanged(android.content.Context);
- }
-
- public class AppCompatEditText {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public class AppCompatImageButton {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.res.ColorStateList? getSupportImageTintList();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.PorterDuff.Mode? getSupportImageTintMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportImageTintList(android.content.res.ColorStateList?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportImageTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class AppCompatImageHelper {
- ctor public AppCompatImageHelper(android.widget.ImageView!);
- method public void loadFromAttributes(android.util.AttributeSet!, int);
- method public void setImageResource(int);
- }
-
- public class AppCompatImageView {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.res.ColorStateList? getSupportImageTintList();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.PorterDuff.Mode? getSupportImageTintMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportImageTintList(android.content.res.ColorStateList?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportImageTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public class AppCompatMultiAutoCompleteTextView {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public class AppCompatRadioButton {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.res.ColorStateList? getSupportButtonTintList();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.PorterDuff.Mode? getSupportButtonTintMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportButtonTintList(android.content.res.ColorStateList?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportButtonTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public class AppCompatSpinner {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public class AppCompatTextView {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getAutoSizeMaxTextSize();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getAutoSizeMinTextSize();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getAutoSizeStepGranularity();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int[]! getAutoSizeTextAvailableSizes();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getAutoSizeTextType();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setAutoSizeTextTypeUniformWithPresetSizes(int[], int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setAutoSizeTextTypeWithDefaults(int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ButtonBarLayout {
- ctor public ButtonBarLayout(android.content.Context!, android.util.AttributeSet!);
- method public int getMinimumHeight();
- method protected void onMeasure(int, int);
- method public void setAllowStacking(boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class ContentFrameLayout {
- ctor public ContentFrameLayout(android.content.Context!);
- ctor public ContentFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public ContentFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void dispatchFitSystemWindows(android.graphics.Rect!);
- method public android.util.TypedValue! getFixedHeightMajor();
- method public android.util.TypedValue! getFixedHeightMinor();
- method public android.util.TypedValue! getFixedWidthMajor();
- method public android.util.TypedValue! getFixedWidthMinor();
- method public android.util.TypedValue! getMinWidthMajor();
- method public android.util.TypedValue! getMinWidthMinor();
- method protected void onAttachedToWindow();
- method protected void onDetachedFromWindow();
- method protected void onMeasure(int, int);
- method public void setAttachListener(androidx.appcompat.widget.ContentFrameLayout.OnAttachListener!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setDecorPadding(int, int, int, int);
- }
-
- public static interface ContentFrameLayout.OnAttachListener {
- method public void onAttachedFromWindow();
- method public void onDetachedFromWindow();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface DecorContentParent {
- method public boolean canShowOverflowMenu();
- method public void dismissPopups();
- method public CharSequence! getTitle();
- method public boolean hasIcon();
- method public boolean hasLogo();
- method public boolean hideOverflowMenu();
- method public void initFeature(int);
- method public boolean isOverflowMenuShowPending();
- method public boolean isOverflowMenuShowing();
- method public void restoreToolbarHierarchyState(android.util.SparseArray<android.os.Parcelable>!);
- method public void saveToolbarHierarchyState(android.util.SparseArray<android.os.Parcelable>!);
- method public void setIcon(int);
- method public void setIcon(android.graphics.drawable.Drawable!);
- method public void setLogo(int);
- method public void setMenu(android.view.Menu!, androidx.appcompat.view.menu.MenuPresenter.Callback!);
- method public void setMenuPrepared();
- method public void setUiOptions(int);
- method public void setWindowCallback(android.view.Window.Callback!);
- method public void setWindowTitle(CharSequence!);
- method public boolean showOverflowMenu();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface DecorToolbar {
- method public void animateToVisibility(int);
- method public boolean canShowOverflowMenu();
- method public void collapseActionView();
- method public void dismissPopupMenus();
- method public android.content.Context! getContext();
- method public android.view.View! getCustomView();
- method public int getDisplayOptions();
- method public int getDropdownItemCount();
- method public int getDropdownSelectedPosition();
- method public int getHeight();
- method public android.view.Menu! getMenu();
- method public int getNavigationMode();
- method public CharSequence! getSubtitle();
- method public CharSequence! getTitle();
- method public android.view.ViewGroup! getViewGroup();
- method public int getVisibility();
- method public boolean hasEmbeddedTabs();
- method public boolean hasExpandedActionView();
- method public boolean hasIcon();
- method public boolean hasLogo();
- method public boolean hideOverflowMenu();
- method public void initIndeterminateProgress();
- method public void initProgress();
- method public boolean isOverflowMenuShowPending();
- method public boolean isOverflowMenuShowing();
- method public boolean isTitleTruncated();
- method public void restoreHierarchyState(android.util.SparseArray<android.os.Parcelable>!);
- method public void saveHierarchyState(android.util.SparseArray<android.os.Parcelable>!);
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method public void setCollapsible(boolean);
- method public void setCustomView(android.view.View!);
- method public void setDefaultNavigationContentDescription(int);
- method public void setDefaultNavigationIcon(android.graphics.drawable.Drawable!);
- method public void setDisplayOptions(int);
- method public void setDropdownParams(android.widget.SpinnerAdapter!, android.widget.AdapterView.OnItemSelectedListener!);
- method public void setDropdownSelectedPosition(int);
- method public void setEmbeddedTabView(androidx.appcompat.widget.ScrollingTabContainerView!);
- method public void setHomeButtonEnabled(boolean);
- method public void setIcon(int);
- method public void setIcon(android.graphics.drawable.Drawable!);
- method public void setLogo(int);
- method public void setLogo(android.graphics.drawable.Drawable!);
- method public void setMenu(android.view.Menu!, androidx.appcompat.view.menu.MenuPresenter.Callback!);
- method public void setMenuCallbacks(androidx.appcompat.view.menu.MenuPresenter.Callback!, androidx.appcompat.view.menu.MenuBuilder.Callback!);
- method public void setMenuPrepared();
- method public void setNavigationContentDescription(CharSequence!);
- method public void setNavigationContentDescription(int);
- method public void setNavigationIcon(android.graphics.drawable.Drawable!);
- method public void setNavigationIcon(int);
- method public void setNavigationMode(int);
- method public void setSubtitle(CharSequence!);
- method public void setTitle(CharSequence!);
- method public void setVisibility(int);
- method public void setWindowCallback(android.view.Window.Callback!);
- method public void setWindowTitle(CharSequence!);
- method public androidx.core.view.ViewPropertyAnimatorCompat! setupAnimatorToVisibility(int, long);
- method public boolean showOverflowMenu();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class DialogTitle {
- ctor public DialogTitle(android.content.Context!, android.util.AttributeSet!, int);
- ctor public DialogTitle(android.content.Context!, android.util.AttributeSet!);
- ctor public DialogTitle(android.content.Context!);
- method protected void onMeasure(int, int);
- method public void setCustomSelectionActionModeCallback(android.view.ActionMode.Callback!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class DrawableUtils {
- method public static boolean canSafelyMutateDrawable(android.graphics.drawable.Drawable);
- method public static android.graphics.Rect! getOpticalBounds(android.graphics.drawable.Drawable!);
- method public static android.graphics.PorterDuff.Mode! parseTintMode(int, android.graphics.PorterDuff.Mode!);
- field public static final android.graphics.Rect! INSETS_NONE;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class FitWindowsFrameLayout implements androidx.appcompat.widget.FitWindowsViewGroup {
- ctor public FitWindowsFrameLayout(android.content.Context!);
- ctor public FitWindowsFrameLayout(android.content.Context!, android.util.AttributeSet!);
- method protected boolean fitSystemWindows(android.graphics.Rect!);
- method public void setOnFitSystemWindowsListener(androidx.appcompat.widget.FitWindowsViewGroup.OnFitSystemWindowsListener!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class FitWindowsLinearLayout implements androidx.appcompat.widget.FitWindowsViewGroup {
- ctor public FitWindowsLinearLayout(android.content.Context!);
- ctor public FitWindowsLinearLayout(android.content.Context!, android.util.AttributeSet!);
- method protected boolean fitSystemWindows(android.graphics.Rect!);
- method public void setOnFitSystemWindowsListener(androidx.appcompat.widget.FitWindowsViewGroup.OnFitSystemWindowsListener!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface FitWindowsViewGroup {
- method public void setOnFitSystemWindowsListener(androidx.appcompat.widget.FitWindowsViewGroup.OnFitSystemWindowsListener!);
- }
-
- public static interface FitWindowsViewGroup.OnFitSystemWindowsListener {
- method public void onFitSystemWindows(android.graphics.Rect!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class ForwardingListener {
- ctor public ForwardingListener(android.view.View!);
- method public abstract androidx.appcompat.view.menu.ShowableListMenu! getPopup();
- method protected boolean onForwardingStarted();
- method protected boolean onForwardingStopped();
- method public boolean onTouch(android.view.View!, android.view.MotionEvent!);
- method public void onViewAttachedToWindow(android.view.View!);
- method public void onViewDetachedFromWindow(android.view.View!);
- }
-
- public class LinearLayoutCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getDividerWidth();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) protected boolean hasDividerBeforeChildAt(int);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface LinearLayoutCompat.DividerMode {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface LinearLayoutCompat.OrientationMode {
- }
-
- public class ListPopupWindow implements androidx.appcompat.view.menu.ShowableListMenu {
- method public void dismiss();
- method public android.widget.ListView? getListView();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean isDropDownAlwaysVisible();
- method public boolean isShowing();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setDropDownAlwaysVisible(boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setEpicenterBounds(android.graphics.Rect!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setForceIgnoreOutsideTouch(boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setOverlapAnchor(boolean);
- method public void show();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface MenuItemHoverListener {
- method public void onItemHoverEnter(androidx.appcompat.view.menu.MenuBuilder, android.view.MenuItem);
- method public void onItemHoverExit(androidx.appcompat.view.menu.MenuBuilder, android.view.MenuItem);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class MenuPopupWindow extends androidx.appcompat.widget.ListPopupWindow implements androidx.appcompat.widget.MenuItemHoverListener {
- ctor public MenuPopupWindow(android.content.Context!, android.util.AttributeSet!, int, int);
- method public void onItemHoverEnter(androidx.appcompat.view.menu.MenuBuilder, android.view.MenuItem);
- method public void onItemHoverExit(androidx.appcompat.view.menu.MenuBuilder, android.view.MenuItem);
- method public void setEnterTransition(Object!);
- method public void setExitTransition(Object!);
- method public void setHoverListener(androidx.appcompat.widget.MenuItemHoverListener!);
- method public void setTouchModal(boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class MenuPopupWindow.MenuDropDownListView {
- ctor public MenuPopupWindow.MenuDropDownListView(android.content.Context!, boolean);
- method public void clearSelection();
- method public boolean hasFocus();
- method public boolean hasWindowFocus();
- method public boolean isFocused();
- method public boolean isInTouchMode();
- method public int lookForSelectablePosition(int, boolean);
- method public int measureHeightOfChildrenCompat(int, int, int, int, int);
- method public boolean onForwardedEvent(android.view.MotionEvent!, int);
- method public boolean onHoverEvent(android.view.MotionEvent!);
- method public boolean onKeyDown(int, android.view.KeyEvent!);
- method public boolean onTouchEvent(android.view.MotionEvent!);
- method public void setHoverListener(androidx.appcompat.widget.MenuItemHoverListener!);
- method public void setSelector(android.graphics.drawable.Drawable!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ScrollingTabContainerView {
- ctor public ScrollingTabContainerView(android.content.Context!);
- method public void addTab(androidx.appcompat.app.ActionBar.Tab!, boolean);
- method public void addTab(androidx.appcompat.app.ActionBar.Tab!, int, boolean);
- method public void animateToTab(int);
- method public void animateToVisibility(int);
- method public void onAttachedToWindow();
- method protected void onConfigurationChanged(android.content.res.Configuration!);
- method public void onDetachedFromWindow();
- method public void onItemSelected(android.widget.AdapterView<?>!, android.view.View!, int, long);
- method public void onMeasure(int, int);
- method public void onNothingSelected(android.widget.AdapterView<?>!);
- method public void removeAllTabs();
- method public void removeTabAt(int);
- method public void setAllowCollapse(boolean);
- method public void setContentHeight(int);
- method public void setTabSelected(int);
- method public void updateTab(int);
- field protected final androidx.appcompat.widget.ScrollingTabContainerView.VisibilityAnimListener! mVisAnimListener;
- field protected android.view.ViewPropertyAnimator! mVisibilityAnim;
- }
-
- protected class ScrollingTabContainerView.VisibilityAnimListener {
- ctor protected ScrollingTabContainerView.VisibilityAnimListener();
- method public void onAnimationCancel(android.animation.Animator!);
- method public void onAnimationEnd(android.animation.Animator!);
- method public void onAnimationStart(android.animation.Animator!);
- method public androidx.appcompat.widget.ScrollingTabContainerView.VisibilityAnimListener! withFinalVisibility(android.view.ViewPropertyAnimator!, int);
- }
-
- public class SearchView extends androidx.appcompat.widget.LinearLayoutCompat implements androidx.appcompat.view.CollapsibleActionView {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setAppSearchData(android.os.Bundle!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class SearchView.SearchAutoComplete extends androidx.appcompat.widget.AppCompatAutoCompleteTextView {
- ctor public SearchView.SearchAutoComplete(android.content.Context!);
- ctor public SearchView.SearchAutoComplete(android.content.Context!, android.util.AttributeSet!);
- ctor public SearchView.SearchAutoComplete(android.content.Context!, android.util.AttributeSet!, int);
- method public boolean enoughToFilter();
- method protected void onFinishInflate();
- method protected void onFocusChanged(boolean, int, android.graphics.Rect!);
- method public boolean onKeyPreIme(int, android.view.KeyEvent!);
- method public void onWindowFocusChanged(boolean);
- method public void performCompletion();
- method protected void replaceText(CharSequence!);
- method public void setThreshold(int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class TintContextWrapper {
- method public android.content.res.AssetManager! getAssets();
- method public android.content.res.Resources! getResources();
- method public android.content.res.Resources.Theme! getTheme();
- method public void setTheme(int);
- method public static android.content.Context! wrap(android.content.Context);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class TintTypedArray {
- method public boolean getBoolean(int, boolean);
- method @RequiresApi(21) public int getChangingConfigurations();
- method public int getColor(int, int);
- method public android.content.res.ColorStateList! getColorStateList(int);
- method public float getDimension(int, float);
- method public int getDimensionPixelOffset(int, int);
- method public int getDimensionPixelSize(int, int);
- method public android.graphics.drawable.Drawable! getDrawable(int);
- method public android.graphics.drawable.Drawable! getDrawableIfKnown(int);
- method public float getFloat(int, float);
- method public android.graphics.Typeface? getFont(@StyleableRes int, int, androidx.core.content.res.ResourcesCompat.FontCallback?);
- method public float getFraction(int, int, int, float);
- method public int getIndex(int);
- method public int getIndexCount();
- method public int getInt(int, int);
- method public int getInteger(int, int);
- method public int getLayoutDimension(int, String!);
- method public int getLayoutDimension(int, int);
- method public String! getNonResourceString(int);
- method public String! getPositionDescription();
- method public int getResourceId(int, int);
- method public android.content.res.Resources! getResources();
- method public String! getString(int);
- method public CharSequence! getText(int);
- method public CharSequence[]! getTextArray(int);
- method public int getType(int);
- method public boolean getValue(int, android.util.TypedValue!);
- method public boolean hasValue(int);
- method public int length();
- method public static androidx.appcompat.widget.TintTypedArray! obtainStyledAttributes(android.content.Context!, android.util.AttributeSet!, int[]!);
- method public static androidx.appcompat.widget.TintTypedArray! obtainStyledAttributes(android.content.Context!, android.util.AttributeSet!, int[]!, int, int);
- method public static androidx.appcompat.widget.TintTypedArray! obtainStyledAttributes(android.content.Context!, int, int[]!);
- method public android.util.TypedValue! peekValue(int);
- method public void recycle();
- }
-
- public class Toolbar {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean canShowOverflowMenu();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.appcompat.widget.DecorToolbar! getWrapper();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean isOverflowMenuShowPending();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean isTitleTruncated();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setCollapsible(boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setMenu(androidx.appcompat.view.menu.MenuBuilder!, androidx.appcompat.widget.ActionMenuPresenter!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setMenuCallbacks(androidx.appcompat.view.menu.MenuPresenter.Callback!, androidx.appcompat.view.menu.MenuBuilder.Callback!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ToolbarWidgetWrapper implements androidx.appcompat.widget.DecorToolbar {
- ctor public ToolbarWidgetWrapper(androidx.appcompat.widget.Toolbar!, boolean);
- ctor public ToolbarWidgetWrapper(androidx.appcompat.widget.Toolbar!, boolean, int, int);
- method public void animateToVisibility(int);
- method public boolean canShowOverflowMenu();
- method public void collapseActionView();
- method public void dismissPopupMenus();
- method public android.content.Context! getContext();
- method public android.view.View! getCustomView();
- method public int getDisplayOptions();
- method public int getDropdownItemCount();
- method public int getDropdownSelectedPosition();
- method public int getHeight();
- method public android.view.Menu! getMenu();
- method public int getNavigationMode();
- method public CharSequence! getSubtitle();
- method public CharSequence! getTitle();
- method public android.view.ViewGroup! getViewGroup();
- method public int getVisibility();
- method public boolean hasEmbeddedTabs();
- method public boolean hasExpandedActionView();
- method public boolean hasIcon();
- method public boolean hasLogo();
- method public boolean hideOverflowMenu();
- method public void initIndeterminateProgress();
- method public void initProgress();
- method public boolean isOverflowMenuShowPending();
- method public boolean isOverflowMenuShowing();
- method public boolean isTitleTruncated();
- method public void restoreHierarchyState(android.util.SparseArray<android.os.Parcelable>!);
- method public void saveHierarchyState(android.util.SparseArray<android.os.Parcelable>!);
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method public void setCollapsible(boolean);
- method public void setCustomView(android.view.View!);
- method public void setDefaultNavigationContentDescription(int);
- method public void setDefaultNavigationIcon(android.graphics.drawable.Drawable!);
- method public void setDisplayOptions(int);
- method public void setDropdownParams(android.widget.SpinnerAdapter!, android.widget.AdapterView.OnItemSelectedListener!);
- method public void setDropdownSelectedPosition(int);
- method public void setEmbeddedTabView(androidx.appcompat.widget.ScrollingTabContainerView!);
- method public void setHomeButtonEnabled(boolean);
- method public void setIcon(int);
- method public void setIcon(android.graphics.drawable.Drawable!);
- method public void setLogo(int);
- method public void setLogo(android.graphics.drawable.Drawable!);
- method public void setMenu(android.view.Menu!, androidx.appcompat.view.menu.MenuPresenter.Callback!);
- method public void setMenuCallbacks(androidx.appcompat.view.menu.MenuPresenter.Callback!, androidx.appcompat.view.menu.MenuBuilder.Callback!);
- method public void setMenuPrepared();
- method public void setNavigationContentDescription(CharSequence!);
- method public void setNavigationContentDescription(int);
- method public void setNavigationIcon(android.graphics.drawable.Drawable!);
- method public void setNavigationIcon(int);
- method public void setNavigationMode(int);
- method public void setSubtitle(CharSequence!);
- method public void setTitle(CharSequence!);
- method public void setVisibility(int);
- method public void setWindowCallback(android.view.Window.Callback!);
- method public void setWindowTitle(CharSequence!);
- method public androidx.core.view.ViewPropertyAnimatorCompat! setupAnimatorToVisibility(int, long);
- method public boolean showOverflowMenu();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class VectorEnabledTintResources {
- ctor public VectorEnabledTintResources(android.content.Context, android.content.res.Resources);
- method public android.graphics.drawable.Drawable! getDrawable(int);
- method public static boolean isCompatVectorFromResourcesEnabled();
- method public static void setCompatVectorFromResourcesEnabled(boolean);
- method public static boolean shouldBeUsed();
- field public static final int MAX_SDK_WHERE_REQUIRED = 20; // 0x14
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class ViewStubCompat {
- ctor public ViewStubCompat(android.content.Context!, android.util.AttributeSet!);
- ctor public ViewStubCompat(android.content.Context!, android.util.AttributeSet!, int);
- method protected void dispatchDraw(android.graphics.Canvas!);
- method public void draw(android.graphics.Canvas!);
- method public int getInflatedId();
- method public android.view.LayoutInflater! getLayoutInflater();
- method public int getLayoutResource();
- method public android.view.View! inflate();
- method protected void onMeasure(int, int);
- method public void setInflatedId(int);
- method public void setLayoutInflater(android.view.LayoutInflater!);
- method public void setLayoutResource(int);
- method public void setOnInflateListener(androidx.appcompat.widget.ViewStubCompat.OnInflateListener!);
- method public void setVisibility(int);
- }
-
- public static interface ViewStubCompat.OnInflateListener {
- method public void onInflate(androidx.appcompat.widget.ViewStubCompat!, android.view.View!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ViewUtils {
- method public static void computeFitSystemWindows(android.view.View!, android.graphics.Rect!, android.graphics.Rect!);
- method public static boolean isLayoutRtl(android.view.View!);
- method public static void makeOptionalFitsSystemWindows(android.view.View!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface WithHint {
- method public CharSequence? getHint();
- }
-
-}
-
diff --git a/appcompat/build.gradle b/appcompat/build.gradle
index 3c8cde2..755d2ce 100644
--- a/appcompat/build.gradle
+++ b/appcompat/build.gradle
@@ -11,9 +11,10 @@
api(project(":core"))
implementation(project(":collection"))
- api(project(":cursoradapter"))
+ api("androidx.cursoradapter:cursoradapter:1.0.0")
api(project(":fragment"))
- api(project(":appcompat:appcompat-resources"))
+ api("androidx.vectordrawable:vectordrawable:1.0.1")
+ api("androidx.vectordrawable:vectordrawable-animated:1.0.0")
api("androidx.drawerlayout:drawerlayout:1.0.0")
androidTestImplementation(TEST_EXT_JUNIT)
@@ -58,5 +59,4 @@
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."
failOnUncheckedWarnings = false
failOnDeprecationWarnings = false
- trackRestrictedAPIs = false
}
diff --git a/appcompat/resources/src/main/res/drawable/abc_vector_test.xml b/appcompat/res/drawable/abc_vector_test.xml
similarity index 100%
rename from appcompat/resources/src/main/res/drawable/abc_vector_test.xml
rename to appcompat/res/drawable/abc_vector_test.xml
diff --git a/appcompat/res/values-as/strings.xml b/appcompat/res/values-as/strings.xml
deleted file mode 100644
index 700c8fb..0000000
--- a/appcompat/res/values-as/strings.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 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.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="abc_action_mode_done" msgid="2571498368472823490">"সম্পন্ন হ’ল"</string>
- <string name="abc_action_bar_home_description" msgid="7903180715631665059">"গৃহ পৃষ্ঠালৈ যাওক"</string>
- <string name="abc_action_bar_up_description" msgid="6794660482873516081">"ওপৰলৈ যাওক"</string>
- <string name="abc_action_menu_overflow_description" msgid="1155814932213556626">"অধিক বিকল্প"</string>
- <string name="abc_toolbar_collapse_description" msgid="6389460216547290468">"সংকোচন কৰক"</string>
- <string name="abc_searchview_description_search" msgid="5466662225065974044">"সন্ধান"</string>
- <string name="abc_search_hint" msgid="940844115270746197">"সন্ধান কৰক…"</string>
- <string name="abc_searchview_description_query" msgid="908784302972860853">"সন্ধান কৰা প্ৰশ্ন"</string>
- <string name="abc_searchview_description_clear" msgid="1769270744562318534">"সন্ধান কৰা প্ৰশ্ন মচক"</string>
- <string name="abc_searchview_description_submit" msgid="8203855622131699655">"প্ৰশ্ন দাখিল কৰক"</string>
- <string name="abc_searchview_description_voice" msgid="3478748990613108725">"কণ্ঠধ্বনিৰ দ্বাৰা সন্ধান"</string>
- <string name="abc_activitychooserview_choose_application" msgid="1798588241954930982">"কোনো এপ্ বাছনি কৰক"</string>
- <string name="abc_activity_chooser_view_see_all" msgid="3732416590524162402">"সকলো চাওক"</string>
- <string name="abc_shareactionprovider_share_with_application" msgid="9009661856846212431">"<xliff:g id="APPLICATION_NAME">%s</xliff:g>ৰ জৰিয়তে শ্বেয়াৰ কৰক"</string>
- <string name="abc_shareactionprovider_share_with" msgid="2650565705514630347">"ইয়াৰ জৰিয়তে শ্বেয়াৰ কৰক"</string>
- <string name="abc_capital_on" msgid="7831734969929204599">"অন"</string>
- <string name="abc_capital_off" msgid="3403923230105792483">"অফ"</string>
- <string name="search_menu_title" msgid="730395136688082741">"সন্ধান"</string>
- <string name="abc_prepend_shortcut_label" msgid="3570106412128999382">"Menu+"</string>
- <string name="abc_menu_meta_shortcut_label" msgid="8046416353848716905">"Meta+"</string>
- <string name="abc_menu_ctrl_shortcut_label" msgid="944415252197684443">"Ctrl+"</string>
- <string name="abc_menu_alt_shortcut_label" msgid="5725160506500770567">"Alt+"</string>
- <string name="abc_menu_shift_shortcut_label" msgid="3271697756921353410">"Shift+"</string>
- <string name="abc_menu_sym_shortcut_label" msgid="8327365089695024394">"Sym+"</string>
- <string name="abc_menu_function_shortcut_label" msgid="4974283687810130415">"Function+"</string>
- <string name="abc_menu_space_shortcut_label" msgid="2304645930658438191">"space"</string>
- <string name="abc_menu_enter_shortcut_label" msgid="6840127756824236027">"enter"</string>
- <string name="abc_menu_delete_shortcut_label" msgid="129742188101734366">"delete"</string>
-</resources>
diff --git a/appcompat/res/values-ca/strings.xml b/appcompat/res/values-ca/strings.xml
index b558afa2..705de23 100644
--- a/appcompat/res/values-ca/strings.xml
+++ b/appcompat/res/values-ca/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="abc_action_mode_done" msgid="2571498368472823490">"Fet"</string>
<string name="abc_action_bar_home_description" msgid="7903180715631665059">"Navega a la pàgina d\'inici"</string>
- <string name="abc_action_bar_up_description" msgid="6794660482873516081">"Navega cap amunt"</string>
+ <string name="abc_action_bar_up_description" msgid="6794660482873516081">"Navega cap a dalt"</string>
<string name="abc_action_menu_overflow_description" msgid="1155814932213556626">"Més opcions"</string>
<string name="abc_toolbar_collapse_description" msgid="6389460216547290468">"Replega"</string>
<string name="abc_searchview_description_search" msgid="5466662225065974044">"Cerca"</string>
diff --git a/appcompat/res/values-v21/styles_base.xml b/appcompat/res/values-v21/styles_base.xml
index 7b7cf3e..ccf7acc 100644
--- a/appcompat/res/values-v21/styles_base.xml
+++ b/appcompat/res/values-v21/styles_base.xml
@@ -77,11 +77,8 @@
<item name="android:minWidth">56dp</item>
</style>
- <!-- We use srcCompat on API 21-22 to allow tinting with themed CSLs -->
<style name="Base.Widget.AppCompat.ActionButton.Overflow"
parent="android:Widget.Material.ActionButton.Overflow">
- <item name="android:src">@null</item>
- <item name="srcCompat">@drawable/abc_ic_menu_overflow_material</item>
</style>
<!--
diff --git a/appcompat/res/values-v21/themes_base.xml b/appcompat/res/values-v21/themes_base.xml
index cad7da5..22585e4 100644
--- a/appcompat/res/values-v21/themes_base.xml
+++ b/appcompat/res/values-v21/themes_base.xml
@@ -64,6 +64,7 @@
<item name="actionButtonStyle">?android:attr/actionButtonStyle</item>
<item name="actionModeBackground">?android:attr/actionModeBackground</item>
<item name="actionModeCloseDrawable">?android:attr/actionModeCloseDrawable</item>
+ <item name="actionOverflowButtonStyle">?android:attr/actionOverflowButtonStyle</item>
<item name="homeAsUpIndicator">?android:attr/homeAsUpIndicator</item>
<!-- For PopupMenu -->
@@ -108,6 +109,7 @@
<item name="actionButtonStyle">?android:attr/actionButtonStyle</item>
<item name="actionModeBackground">?android:attr/actionModeBackground</item>
<item name="actionModeCloseDrawable">?android:attr/actionModeCloseDrawable</item>
+ <item name="actionOverflowButtonStyle">?android:attr/actionOverflowButtonStyle</item>
<item name="homeAsUpIndicator">?android:attr/homeAsUpIndicator</item>
<!-- For PopupMenu -->
diff --git a/appcompat/res/values-v23/styles_base.xml b/appcompat/res/values-v23/styles_base.xml
index f202cb8..c9b182e 100644
--- a/appcompat/res/values-v23/styles_base.xml
+++ b/appcompat/res/values-v23/styles_base.xml
@@ -36,7 +36,4 @@
<item name="android:hyphenationFrequency">none</item>
<item name="android:breakStrategy">high_quality</item>
</style>
-
- <style name="Base.Widget.AppCompat.ActionButton.Overflow" parent="android:Widget.Material.ActionButton.Overflow" />
-
</resources>
diff --git a/appcompat/res/values-v23/themes_base.xml b/appcompat/res/values-v23/themes_base.xml
index ff8579d..cff796c 100644
--- a/appcompat/res/values-v23/themes_base.xml
+++ b/appcompat/res/values-v23/themes_base.xml
@@ -30,7 +30,6 @@
<!-- We can use the platform styles on v23+ -->
<item name="actionMenuTextColor">?android:attr/actionMenuTextColor</item>
<item name="actionMenuTextAppearance">?android:attr/actionMenuTextAppearance</item>
- <item name="actionOverflowButtonStyle">?android:attr/actionOverflowButtonStyle</item>
<item name="controlBackground">@drawable/abc_control_background_material</item>
</style>
@@ -45,7 +44,6 @@
<!-- We can use the platform styles on v23+ -->
<item name="actionMenuTextColor">?android:attr/actionMenuTextColor</item>
<item name="actionMenuTextAppearance">?android:attr/actionMenuTextAppearance</item>
- <item name="actionOverflowButtonStyle">?android:attr/actionOverflowButtonStyle</item>
<item name="controlBackground">@drawable/abc_control_background_material</item>
</style>
diff --git a/appcompat/res/values/attrs.xml b/appcompat/res/values/attrs.xml
index d4541f8..57e00a6 100644
--- a/appcompat/res/values/attrs.xml
+++ b/appcompat/res/values/attrs.xml
@@ -902,28 +902,6 @@
<attr name="drawableBottomCompat" format="reference" />
<attr name="drawableStartCompat" format="reference" />
<attr name="drawableEndCompat" format="reference" />
- <!-- Tint to apply to the compound (left, top, etc.) drawables. -->
- <attr name="drawableTint" format="color" />
- <!-- Blending mode used to apply the compound (left, top, etc.) drawables tint. -->
- <attr name="drawableTintMode">
- <!-- The tint is drawn on top of the drawable.
- [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc] -->
- <enum name="src_over" value="3" />
- <!-- The tint is masked by the alpha channel of the drawable. The drawable’s
- color channels are thrown out. [Sa * Da, Sc * Da] -->
- <enum name="src_in" value="5" />
- <!-- The tint is drawn above the drawable, but with the drawable’s alpha
- channel masking the result. [Da, Sc * Da + (1 - Sa) * Dc] -->
- <enum name="src_atop" value="9" />
- <!-- Multiplies the color and alpha channels of the drawable with those of
- the tint. [Sa * Da, Sc * Dc] -->
- <enum name="multiply" value="14" />
- <!-- [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] -->
- <enum name="screen" value="15" />
- <!-- Combines the tint and drawable color and alpha channels, clamping the
- result to valid color values. Saturate(S + D) -->
- <enum name="add" value="16" />
- </attr>
</declare-styleable>
<declare-styleable name="LinearLayoutCompat">
@@ -1034,8 +1012,6 @@
<!-- A color to apply to the subtitle string. -->
<attr name="subtitleTextColor" format="color" />
<attr name="android:minHeight" />
- <!-- Menu resource to inflate to be shown in the toolbar -->
- <attr name="menu" format="reference" />
</declare-styleable>
<declare-styleable name="PopupWindowBackgroundState">
@@ -1304,4 +1280,93 @@
<attr name="paddingTopNoTitle" format="dimension" />
</declare-styleable>
+ <!-- Drawable used to render several states. Each state is represented by
+ a child drawable. -->
+ <declare-styleable name="StateListDrawable">
+ <!-- Indicates whether the drawable should be initially visible. -->
+ <attr name="android:visible" />
+ <!-- If true, allows the drawable's padding to change based on the
+ current state that is selected. If false, the padding will
+ stay the same (based on the maximum padding of all the states).
+ Enabling this feature requires that the owner of the drawable
+ deal with performing layout when the state changes, which is
+ often not supported. -->
+ <attr name="android:variablePadding" />
+ <!-- If true, the drawable's reported internal size will remain
+ constant as the state changes; the size is the maximum of all
+ of the states. If false, the size will vary based on the
+ current state. -->
+ <attr name="android:constantSize" />
+ <!-- Enables or disables dithering of the bitmap if the bitmap does not have the
+ same pixel configuration as the screen (for instance: a ARGB 8888 bitmap with
+ an RGB 565 screen). -->
+ <attr name="android:dither" />
+ <!-- Amount of time (in milliseconds) to fade in a new state drawable. -->
+ <attr name="android:enterFadeDuration" />
+ <!-- Amount of time (in milliseconds) to fade out an old state drawable. -->
+ <attr name="android:exitFadeDuration" />
+ <!-- Indicates if the drawable needs to be mirrored when its layout direction is
+ RTL (right-to-left). -->
+ <!--<attr name="autoMirrored"/>-->
+ </declare-styleable>
+
+ <!-- Represents a single state inside a StateListDrawable. -->
+ <declare-styleable name="StateListDrawableItem">
+ <!-- Reference to a drawable resource to use for the state. If not
+ given, the drawable must be defined by the first child tag. -->
+ <attr name="android:drawable" />
+ </declare-styleable>
+
+ <!-- Drawable used to render several states with animated transitions. Each state
+ is represented by a child drawable with an optional keyframe ID. -->
+ <declare-styleable name="AnimatedStateListDrawableCompat">
+ <!-- Indicates whether the drawable should be initially visible. -->
+ <attr name="android:visible" />
+ <!-- If true, allows the drawable's padding to change based on the
+ current state that is selected. If false, the padding will
+ stay the same (based on the maximum padding of all the states).
+ Enabling this feature requires that the owner of the drawable
+ deal with performing layout when the state changes, which is
+ often not supported. -->
+ <attr name="android:variablePadding" />
+ <!-- If true, the drawable's reported internal size will remain
+ constant as the state changes; the size is the maximum of all
+ of the states. If false, the size will vary based on the
+ current state. -->
+ <attr name="android:constantSize" />
+ <!-- Enables or disables dithering of the bitmap if the bitmap does not have the
+ same pixel configuration as the screen (for instance: a ARGB 8888 bitmap with
+ an RGB 565 screen). -->
+ <attr name="android:dither" />
+ <!-- Amount of time (in milliseconds) to fade in a new state drawable. -->
+ <attr name="android:enterFadeDuration" />
+ <!-- Amount of time (in milliseconds) to fade out an old state drawable. -->
+ <attr name="android:exitFadeDuration" />
+ <!-- Indicates if the drawable needs to be mirrored when its layout direction is
+ RTL (right-to-left). -->
+ <!--<attr name="autoMirrored"/>-->
+ </declare-styleable>
+
+ <!-- Transition used to animate between states with keyframe IDs. -->
+ <declare-styleable name="AnimatedStateListDrawableItem">
+ <!-- Reference to a drawable resource to use for the frame. If not
+ given, the drawable must be defined by the first child tag. -->
+ <attr name="android:drawable" />
+ <!-- Keyframe identifier for use in specifying transitions. -->
+ <attr name="android:id" />
+ </declare-styleable>
+
+ <!-- Transition used to animate between states with keyframe IDs. -->
+ <declare-styleable name="AnimatedStateListDrawableTransition">
+ <!-- Keyframe identifier for the starting state. -->
+ <attr name="android:fromId" />
+ <!-- Keyframe identifier for the ending state. -->
+ <attr name="android:toId" />
+ <!-- Reference to a animation drawable resource to use for the frame. If not
+ given, the animation drawable must be defined by the first child tag. -->
+ <attr name="android:drawable" />
+ <!-- Whether this transition is reversible. -->
+ <attr name="android:reversible" />
+ </declare-styleable>
+
</resources>
diff --git a/appcompat/resources/OWNERS b/appcompat/resources/OWNERS
deleted file mode 100644
index ed6b1a7..0000000
--- a/appcompat/resources/OWNERS
+++ /dev/null
@@ -1,6 +0,0 @@
-kirillg@google.com
-chrisbanes@google.com
-
-# For vector related files
-tianliu@google.com
-ilake@google.com
diff --git a/appcompat/resources/api/0.0.0.txt b/appcompat/resources/api/0.0.0.txt
deleted file mode 100644
index 3b82dbb..0000000
--- a/appcompat/resources/api/0.0.0.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 2.0
-package androidx.appcompat.graphics.drawable {
-
- public class AnimatedStateListDrawableCompat extends android.graphics.drawable.Drawable implements androidx.core.graphics.drawable.TintAwareDrawable {
- ctor public AnimatedStateListDrawableCompat();
- method public void addState(int[], android.graphics.drawable.Drawable, int);
- method public <T extends android.graphics.drawable.Drawable & android.graphics.drawable.Animatable> void addTransition(int, int, T, boolean);
- method public static androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat? create(android.content.Context, @DrawableRes int, android.content.res.Resources.Theme?);
- method public static androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat! createFromXmlInner(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public void inflate(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- }
-
-}
-
diff --git a/appcompat/resources/api/1.1.0-alpha03.txt b/appcompat/resources/api/1.1.0-alpha03.txt
deleted file mode 100644
index 990b059..0000000
--- a/appcompat/resources/api/1.1.0-alpha03.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-// Signature format: 3.0
-package androidx.appcompat.content.res {
-
- public final class AppCompatResources {
- method public static android.content.res.ColorStateList! getColorStateList(android.content.Context, @ColorRes int);
- method public static android.graphics.drawable.Drawable? getDrawable(android.content.Context, @DrawableRes int);
- }
-
-}
-
-package androidx.appcompat.graphics.drawable {
-
- public class AnimatedStateListDrawableCompat extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback androidx.core.graphics.drawable.TintAwareDrawable {
- ctor public AnimatedStateListDrawableCompat();
- method public void addState(int[], android.graphics.drawable.Drawable, int);
- method public void addState(int[]!, android.graphics.drawable.Drawable!);
- method public <T extends android.graphics.drawable.Drawable & android.graphics.drawable.Animatable> void addTransition(int, int, T, boolean);
- method public static androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat? create(android.content.Context, @DrawableRes int, android.content.res.Resources.Theme?);
- method public static androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat! createFromXmlInner(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public void draw(android.graphics.Canvas);
- method public final android.graphics.drawable.Drawable.ConstantState! getConstantState();
- method public int getOpacity();
- method public void inflate(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public void invalidateDrawable(android.graphics.drawable.Drawable);
- method public void scheduleDrawable(android.graphics.drawable.Drawable, Runnable, long);
- method public void setAlpha(int);
- method public void setColorFilter(android.graphics.ColorFilter!);
- method public void setDither(boolean);
- method public void setEnterFadeDuration(int);
- method public void setExitFadeDuration(int);
- method public void unscheduleDrawable(android.graphics.drawable.Drawable, Runnable);
- }
-
-}
-
diff --git a/appcompat/resources/api/current.txt b/appcompat/resources/api/current.txt
deleted file mode 100644
index 990b059..0000000
--- a/appcompat/resources/api/current.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-// Signature format: 3.0
-package androidx.appcompat.content.res {
-
- public final class AppCompatResources {
- method public static android.content.res.ColorStateList! getColorStateList(android.content.Context, @ColorRes int);
- method public static android.graphics.drawable.Drawable? getDrawable(android.content.Context, @DrawableRes int);
- }
-
-}
-
-package androidx.appcompat.graphics.drawable {
-
- public class AnimatedStateListDrawableCompat extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback androidx.core.graphics.drawable.TintAwareDrawable {
- ctor public AnimatedStateListDrawableCompat();
- method public void addState(int[], android.graphics.drawable.Drawable, int);
- method public void addState(int[]!, android.graphics.drawable.Drawable!);
- method public <T extends android.graphics.drawable.Drawable & android.graphics.drawable.Animatable> void addTransition(int, int, T, boolean);
- method public static androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat? create(android.content.Context, @DrawableRes int, android.content.res.Resources.Theme?);
- method public static androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat! createFromXmlInner(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public void draw(android.graphics.Canvas);
- method public final android.graphics.drawable.Drawable.ConstantState! getConstantState();
- method public int getOpacity();
- method public void inflate(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public void invalidateDrawable(android.graphics.drawable.Drawable);
- method public void scheduleDrawable(android.graphics.drawable.Drawable, Runnable, long);
- method public void setAlpha(int);
- method public void setColorFilter(android.graphics.ColorFilter!);
- method public void setDither(boolean);
- method public void setEnterFadeDuration(int);
- method public void setExitFadeDuration(int);
- method public void unscheduleDrawable(android.graphics.drawable.Drawable, Runnable);
- }
-
-}
-
diff --git a/appcompat/resources/api/res-1.1.0-alpha03.txt b/appcompat/resources/api/res-1.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/appcompat/resources/api/res-1.1.0-alpha03.txt
+++ /dev/null
diff --git a/appcompat/resources/build.gradle b/appcompat/resources/build.gradle
deleted file mode 100644
index d1816eb..0000000
--- a/appcompat/resources/build.gradle
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2019 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.
- */
-import static androidx.build.dependencies.DependenciesKt.*
-import androidx.build.LibraryGroups
-import androidx.build.LibraryVersions
-
-plugins {
- id("SupportAndroidLibraryPlugin")
-}
-
-dependencies {
- api(project(":annotation"))
-
- api(project(":core"))
- api(project(":collection"))
- api("androidx.cursoradapter:cursoradapter:1.0.0")
- api("androidx.vectordrawable:vectordrawable:1.0.1")
- api("androidx.vectordrawable:vectordrawable-animated:1.0.0")
-
- androidTestImplementation(TEST_EXT_JUNIT)
- androidTestImplementation(TEST_CORE)
- androidTestImplementation(TEST_RUNNER)
- androidTestImplementation(TEST_RULES)
- androidTestImplementation(TRUTH)
- androidTestImplementation(ESPRESSO_CORE, libs.exclude_for_espresso)
- androidTestImplementation(MOCKITO_CORE, libs.exclude_bytebuddy) // DexMaker has it"s own MockMaker
- androidTestImplementation(DEXMAKER_MOCKITO, libs.exclude_bytebuddy) // DexMaker has it"s own MockMaker
- androidTestImplementation project(':internal-testutils'), {
- exclude group: 'androidx.appcompat', module: 'appcompat-resources'
- }
-}
-
-android {
- defaultConfig {
- // This disables the builds tools automatic vector -> PNG generation
- generatedDensities = []
- }
-
- aaptOptions {
- additionalParameters "--no-version-vectors"
- noCompress 'ttf'
- }
-}
-
-supportLibrary {
- name = "Android Resources Library"
- publish = true
- mavenVersion = LibraryVersions.APPCOMPAT
- mavenGroup = LibraryGroups.APPCOMPAT
- inceptionYear = "2019"
- description = "The Resources Library is a static library that you can add to your Android application in order to use resource APIs that backport the latest APIs to older versions of the platform. Compatible on devices running API 14 or later."
- failOnUncheckedWarnings = false
- failOnDeprecationWarnings = false
- trackRestrictedAPIs = false
-}
diff --git a/appcompat/resources/src/androidTest/AndroidManifest.xml b/appcompat/resources/src/androidTest/AndroidManifest.xml
deleted file mode 100644
index 763b200..0000000
--- a/appcompat/resources/src/androidTest/AndroidManifest.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2019 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 xmlns:android="http://schemas.android.com/apk/res/android"
- package="androidx.appcompat.resources.test">
- <uses-sdk android:targetSdkVersion="${target-sdk-version}"/>
-
- <application
- android:theme="@android:style/Theme">
- <activity
- android:name="android.app.Activity"/>
- </application>
-
-</manifest>
diff --git a/appcompat/resources/src/androidTest/java/androidx/appcompat/content/res/AppCompatResourcesTestCase.java b/appcompat/resources/src/androidTest/java/androidx/appcompat/content/res/AppCompatResourcesTestCase.java
deleted file mode 100644
index 917ea00..0000000
--- a/appcompat/resources/src/androidTest/java/androidx/appcompat/content/res/AppCompatResourcesTestCase.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2019 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.appcompat.content.res;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import android.content.Context;
-import android.content.res.ColorStateList;
-
-import androidx.appcompat.resources.test.R;
-import androidx.test.core.app.ApplicationProvider;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@LargeTest
-@RunWith(AndroidJUnit4.class)
-public class AppCompatResourcesTestCase {
- private Context mContext;
-
- public AppCompatResourcesTestCase() {
- mContext = ApplicationProvider.getApplicationContext();
- }
-
- @Test
- public void testColorStateListCaching() {
- final ColorStateList result1 = AppCompatResources.getColorStateList(
- mContext, R.color.color_state_list_themed_attrs);
- final ColorStateList result2 = AppCompatResources.getColorStateList(
- mContext, R.color.color_state_list_themed_attrs);
- assertNotNull(result1);
- assertNotNull(result2);
- assertEquals(result1, result2);
- }
-
- @Test
- public void testGetDrawableVectorResource() {
- assertNotNull(AppCompatResources.getDrawable(mContext, R.drawable.test_vector_off));
- }
-
- @Test
- public void testGetAnimatedStateListDrawable() {
- assertNotNull(AppCompatResources.getDrawable(mContext, R.drawable.asl_heart));
- }
-}
diff --git a/appcompat/resources/src/androidTest/java/androidx/appcompat/graphics/drawable/AnimatedStateListDrawableCompatTest.java b/appcompat/resources/src/androidTest/java/androidx/appcompat/graphics/drawable/AnimatedStateListDrawableCompatTest.java
deleted file mode 100644
index 10c86dc..0000000
--- a/appcompat/resources/src/androidTest/java/androidx/appcompat/graphics/drawable/AnimatedStateListDrawableCompatTest.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Copyright 2019 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.appcompat.graphics.drawable;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import android.content.Context;
-import android.graphics.Canvas;
-import android.graphics.ColorFilter;
-import android.graphics.drawable.Animatable;
-import android.graphics.drawable.Drawable;
-import android.util.StateSet;
-
-import androidx.appcompat.resources.test.R;
-import androidx.test.core.app.ApplicationProvider;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
-import androidx.vectordrawable.graphics.drawable.Animatable2Compat;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-import java.util.HashSet;
-
-@MediumTest
-@RunWith(AndroidJUnit4.class)
-public class AnimatedStateListDrawableCompatTest {
- private static final int[] STATE_EMPTY = new int[]{};
- private static final int[] STATE_FOCUSED = new int[]{android.R.attr.state_focused};
-
- private Context mContext;
-
- @Before
- public void setup() {
- mContext = ApplicationProvider.getApplicationContext();
- }
-
- @Test
- public void testStateListDrawable() {
- new AnimatedStateListDrawableCompat();
-
- // Check the values set in the constructor
- assertNotNull(new AnimatedStateListDrawableCompat().getConstantState());
- }
-
- @Test
- public void testAddState() {
- AnimatedStateListDrawableCompat asld = new AnimatedStateListDrawableCompat();
- assertEquals(0, asld.getStateCount());
-
- try {
- asld.addState(StateSet.WILD_CARD, null, R.id.focused);
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- // Expected.
- }
-
- Drawable unfocused = new MockDrawable();
- asld.addState(StateSet.WILD_CARD, unfocused, R.id.focused);
- assertEquals(1, asld.getStateCount());
-
- Drawable focused = new MockDrawable();
- asld.addState(STATE_FOCUSED, focused, R.id.unfocused);
- assertEquals(2, asld.getStateCount());
- }
-
- @Test
- public void testAddTransition() {
- AnimatedStateListDrawableCompat asld = new AnimatedStateListDrawableCompat();
-
- Drawable focused = new MockDrawable();
- Drawable unfocused = new MockDrawable();
- asld.addState(STATE_FOCUSED, focused, R.id.focused);
- asld.addState(StateSet.WILD_CARD, unfocused, R.id.unfocused);
-
- try {
- asld.addTransition(R.id.focused, R.id.focused, null, false);
- fail("Expected IllegalArgumentException");
- } catch (IllegalArgumentException e) {
- // Expected.
- }
-
- MockTransition focusedToUnfocused = new MockTransition();
- asld.addTransition(R.id.focused, R.id.unfocused, focusedToUnfocused, false);
- assertEquals(3, asld.getStateCount());
-
- MockTransition unfocusedToFocused = new MockTransition();
- asld.addTransition(R.id.unfocused, R.id.focused, unfocusedToFocused, false);
- assertEquals(4, asld.getStateCount());
-
- MockTransition reversible = new MockTransition();
- asld.addTransition(R.id.focused, R.id.unfocused, reversible, true);
- assertEquals(5, asld.getStateCount());
- }
-
- @Test
- public void testIsStateful() {
- assertTrue(new AnimatedStateListDrawableCompat().isStateful());
- }
-
- @Test
- public void testOnStateChange() {
- AnimatedStateListDrawableCompat asld = new AnimatedStateListDrawableCompat();
-
- Drawable focused = new MockDrawable();
- Drawable unfocused = new MockDrawable();
- asld.addState(STATE_FOCUSED, focused, R.id.focused);
- asld.addState(StateSet.WILD_CARD, unfocused, R.id.unfocused);
-
- MockTransition focusedToUnfocused = new MockTransition();
- MockTransition unfocusedToFocused = new MockTransition();
- asld.addTransition(R.id.focused, R.id.unfocused, focusedToUnfocused, false);
- asld.addTransition(R.id.unfocused, R.id.focused, unfocusedToFocused, false);
-
- asld.setState(STATE_EMPTY);
- assertSame(unfocused, asld.getCurrent());
-
- asld.setState(STATE_FOCUSED);
- assertSame(unfocusedToFocused, asld.getCurrent());
-
- asld.setState(STATE_FOCUSED);
- assertSame(unfocusedToFocused, asld.getCurrent());
- }
-
- @Test
- public void testAnimationDrawableTransition() throws XmlPullParserException, IOException {
- AnimatedStateListDrawableCompat asld = AnimatedStateListDrawableCompat.create(mContext,
- R.drawable.animated_state_list_density, mContext.getTheme());
- assertTrue(asld.isVisible());
- // Missing public API to verify these.
- //assertFalse(asld.isConstantSize());
- //assertNull(asld.getConstantPadding());
- // Check that 4 drawables were parsed
- assertEquals(4, asld.getStateCount());
- }
-
- @Test
- public void testAnimatedVectorTransition() {
- AnimatedStateListDrawableCompat asld = AnimatedStateListDrawableCompat.create(mContext,
- R.drawable.asl_heart, mContext.getTheme());
- // Check that 4 drawables were parsed
- assertEquals(4, asld.getStateCount());
- }
-
- @Test
- public void testChildAnimatedVectorTransition() {
- AnimatedStateListDrawableCompat asld = AnimatedStateListDrawableCompat.create(mContext,
- R.drawable.animated_state_list_with_avd, mContext.getTheme());
- // Check that 6 drawables were parsed
- assertEquals(6, asld.getStateCount());
- }
-
- @Test
- public void testChildVectorItem() {
- AnimatedStateListDrawableCompat asld = AnimatedStateListDrawableCompat.create(mContext,
- R.drawable.asl_heart_embedded, mContext.getTheme());
- // Check that 4 drawables were parsed
- assertEquals(4, asld.getStateCount());
- }
-
- @Test
- public void testConstantStateWhenChildHasNullConstantState() {
- // Given an empty ASLD which returns a constant state
- AnimatedStateListDrawableCompat asld = new AnimatedStateListDrawableCompat();
- assertNotNull(asld.getConstantState());
-
- // When a drawable who returns a null constant state is added
- // MockDrawable returns null from getConstantState() - same as Drawable's default impl
- Drawable noConstantStateDrawable = new MockDrawable();
- asld.addState(StateSet.WILD_CARD, noConstantStateDrawable, R.id.focused);
-
- // Then the ASLD should also return a null constant state
- assertNull(asld.getConstantState());
- }
-
- public class MockTransition extends MockDrawable implements Animatable,
- Animatable2Compat {
- private HashSet<AnimationCallback> mCallbacks = new HashSet<>();
-
- @Override
- public void start() {
- }
-
- @Override
- public void stop() {
- }
-
- @Override
- public boolean isRunning() {
- return false;
- }
-
- @Override
- public void registerAnimationCallback(AnimationCallback callback) {
- mCallbacks.add(callback);
- }
-
- @Override
- public boolean unregisterAnimationCallback(AnimationCallback callback) {
- return mCallbacks.remove(callback);
- }
-
- @Override
- public void clearAnimationCallbacks() {
- mCallbacks.clear();
- }
- }
-
- public class MockDrawable extends Drawable {
- @Override
- public void draw(Canvas canvas) {
- }
-
- @Override
- public int getOpacity() {
- return 0;
- }
-
- @Override
- public void setAlpha(int alpha) {
- }
-
- @Override
- public void setColorFilter(ColorFilter cf) {
- }
- }
-}
diff --git a/appcompat/resources/src/androidTest/java/androidx/appcompat/widget/TintResourcesTest.java b/appcompat/resources/src/androidTest/java/androidx/appcompat/widget/TintResourcesTest.java
deleted file mode 100644
index 5c3e673..0000000
--- a/appcompat/resources/src/androidTest/java/androidx/appcompat/widget/TintResourcesTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2019 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.appcompat.widget;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import android.app.Activity;
-import android.content.res.Resources;
-import android.graphics.drawable.Drawable;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-import androidx.test.rule.ActivityTestRule;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public class TintResourcesTest {
- @Rule
- public final ActivityTestRule<Activity> mActivityTestRule =
- new ActivityTestRule<>(Activity.class);
-
- @Test
- public void testTintResourcesDelegateBackToOriginalResources() {
- final TestResources testResources =
- new TestResources(mActivityTestRule.getActivity().getResources());
- // First make sure that the flag is false
- assertFalse(testResources.wasGetDrawableCalled());
-
- // Now wrap in a TintResources instance and get a Drawable
- final Resources tintResources =
- new TintResources(mActivityTestRule.getActivity(), testResources);
- tintResources.getDrawable(android.R.drawable.ic_delete);
-
- // ...and assert that the flag was flipped
- assertTrue(testResources.wasGetDrawableCalled());
- }
-
- /**
- * Special Resources class which returns a known Drawable instance from a special ID
- */
- private static class TestResources extends Resources {
- private boolean mGetDrawableCalled;
-
- private TestResources(Resources res) {
- super(res.getAssets(), res.getDisplayMetrics(), res.getConfiguration());
- }
-
- @Override
- public Drawable getDrawable(int id) throws NotFoundException {
- mGetDrawableCalled = true;
- return super.getDrawable(id);
- }
-
- public boolean wasGetDrawableCalled() {
- return mGetDrawableCalled;
- }
- }
-
-}
diff --git a/appcompat/resources/src/androidTest/res/anim/animation_grouping_1_01.xml b/appcompat/resources/src/androidTest/res/anim/animation_grouping_1_01.xml
deleted file mode 100644
index a4cfc2b..0000000
--- a/appcompat/resources/src/androidTest/res/anim/animation_grouping_1_01.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android">
-
- <objectAnimator
- android:duration="50"
- android:propertyName="rotation"
- android:repeatCount="2"
- android:valueFrom="0"
- android:valueTo="180"/>
-</set>
diff --git a/appcompat/resources/src/androidTest/res/color/color_state_list_themed_attrs.xml b/appcompat/resources/src/androidTest/res/color/color_state_list_themed_attrs.xml
deleted file mode 100644
index 9ee972d..0000000
--- a/appcompat/resources/src/androidTest/res/color/color_state_list_themed_attrs.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2016 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
- <item android:color="?android:attr/colorForeground" android:state_enabled="false" app:alpha="0.5"/>
- <item android:color="?android:attr/colorForeground"/>
-</selector>
-
diff --git a/appcompat/resources/src/androidTest/res/drawable/animated_state_list_density.xml b/appcompat/resources/src/androidTest/res/drawable/animated_state_list_density.xml
deleted file mode 100644
index b1a8618..0000000
--- a/appcompat/resources/src/androidTest/res/drawable/animated_state_list_density.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:id="@+id/focused"
- android:drawable="@drawable/state_list_density_1"
- android:state_focused="true"/>
- <item
- android:id="@+id/unfocused"
- android:drawable="@drawable/state_list_density_2"/>
- <transition
- android:drawable="@drawable/animation_list_transition_1"
- android:fromId="@id/unfocused"
- android:toId="@id/focused"/>
- <transition
- android:drawable="@drawable/animation_list_transition_2"
- android:fromId="@id/focused"
- android:toId="@id/unfocused"/>
-</animated-selector>
diff --git a/appcompat/resources/src/androidTest/res/drawable/animated_state_list_with_avd.xml b/appcompat/resources/src/androidTest/res/drawable/animated_state_list_with_avd.xml
deleted file mode 100644
index 57539bb..0000000
--- a/appcompat/resources/src/androidTest/res/drawable/animated_state_list_with_avd.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:state_focused="true"
- android:id="@+id/focused"
- android:drawable="@drawable/red" />
- <item
- android:state_checked="false"
- android:id="@+id/unchecked"
- android:drawable="@drawable/black" />
- <transition
- android:fromId="@+id/unchecked"
- android:toId="@+id/focused">
- <!--empty avd -->
- <animated-vector
- android:drawable="@drawable/vector_drawable_grouping_1" >
- </animated-vector>
- </transition>
- <transition
- android:fromId="@+id/focused"
- android:toId="@+id/unchecked">
- <animated-vector
- android:drawable="@drawable/vector_drawable_grouping_1" >
- <target
- android:name="sun"
- android:animation="@anim/animation_grouping_1_01" />
- <target
- android:name="earth"
- android:animation="@anim/animation_grouping_1_01" />
- </animated-vector>
- </transition>
- <item
- android:state_checked="true"
- android:drawable="@drawable/blue" />
- <item
- android:state_activated="true"
- android:drawable="@drawable/yellow" />
-</animated-selector>
diff --git a/appcompat/resources/src/androidTest/res/drawable/animation_list_transition_1.xml b/appcompat/resources/src/androidTest/res/drawable/animation_list_transition_1.xml
deleted file mode 100644
index c46b2079..0000000
--- a/appcompat/resources/src/androidTest/res/drawable/animation_list_transition_1.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
- <item
- android:drawable="@drawable/state_list_density_1"
- android:duration="15"/>
-</animation-list>
diff --git a/appcompat/resources/src/androidTest/res/drawable/asl_heart.xml b/appcompat/resources/src/androidTest/res/drawable/asl_heart.xml
deleted file mode 100644
index 75427f8..0000000
--- a/appcompat/resources/src/androidTest/res/drawable/asl_heart.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
-
- <item
- android:id="@+id/liked"
- android:drawable="@drawable/ic_heart_full"
- android:state_checked="true"/>
-
- <item
- android:id="@+id/not_liked"
- android:drawable="@drawable/ic_heart_empty"/>
-
- <transition
- android:drawable="@drawable/avd_heart_fill"
- android:fromId="@id/not_liked"
- android:toId="@id/liked"/>
-
- <transition
- android:drawable="@drawable/avd_heart_empty"
- android:fromId="@id/liked"
- android:toId="@id/not_liked"/>
-
-</animated-selector>
diff --git a/appcompat/resources/src/androidTest/res/drawable/asl_heart_embedded.xml b/appcompat/resources/src/androidTest/res/drawable/asl_heart_embedded.xml
deleted file mode 100644
index 08164a1..0000000
--- a/appcompat/resources/src/androidTest/res/drawable/asl_heart_embedded.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
-
- <item
- android:id="@+id/liked"
- android:state_checked="true">
- <vector
- android:width="56dp"
- android:height="56dp"
- android:viewportHeight="56"
- android:viewportWidth="56">
- <path
- android:fillColor="#fff"
- android:pathData="M28,39 L26.405,37.5667575 C20.74,32.4713896 17,29.1089918 17,24.9945504 C17,21.6321526 19.6565,19 23.05,19 C24.964,19 26.801,19.8828338 28,21.2724796 C29.199,19.8828338 31.036,19 32.95,19 C36.3435,19 39,21.6321526 39,24.9945504 C39,29.1089918 35.26,32.4713896 29.595,37.5667575 L28,39 L28,39 Z"/>
- </vector>
- </item>
-
- <item
- android:id="@+id/not_liked"
- android:drawable="@drawable/ic_heart_empty"/>
-
- <transition
- android:drawable="@drawable/avd_heart_fill"
- android:fromId="@id/not_liked"
- android:toId="@id/liked"/>
-
- <transition
- android:drawable="@drawable/avd_heart_empty"
- android:fromId="@id/liked"
- android:toId="@id/not_liked"/>
-
-</animated-selector>
diff --git a/appcompat/resources/src/androidTest/res/drawable/avd_heart_empty.xml b/appcompat/resources/src/androidTest/res/drawable/avd_heart_empty.xml
deleted file mode 100644
index db7c773..0000000
--- a/appcompat/resources/src/androidTest/res/drawable/avd_heart_empty.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<animated-vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:aapt="http://schemas.android.com/aapt">
-
- <aapt:attr name="android:drawable">
-
- <vector
- android:width="56dp"
- android:height="56dp"
- android:viewportHeight="56"
- android:viewportWidth="56">
- <path
- android:fillColor="#fff"
- android:pathData="M32.95,19 C31.036,19 29.199,19.8828338 28,21.2724796 C26.801,19.8828338 24.964,19 23.05,19 C19.6565,19 17,21.6321526 17,24.9945504 C17,29.1089918 20.74,32.4713896 26.405,37.5667575 L28,39 L29.595,37.5667575 C35.26,32.4713896 39,29.1089918 39,24.9945504 C39,21.6321526 36.3435,19 32.95,19 L32.95,19 Z M28.1155,35.9536785 L28,36.0572207 L27.8845,35.9536785 C22.654,31.2506812 19.2,28.1444142 19.2,24.9945504 C19.2,22.8201635 20.8555,21.1798365 23.05,21.1798365 C24.744,21.1798365 26.394,22.2643052 26.9715,23.7520436 L29.023,23.7520436 C29.606,22.2643052 31.256,21.1798365 32.95,21.1798365 C35.1445,21.1798365 36.8,22.8201635 36.8,24.9945504 C36.8,28.1444142 33.346,31.2506812 28.1155,35.9536785 L28.1155,35.9536785 Z"/>
- <group android:name="filled">
- <clip-path
- android:name="clip"
- android:pathData="M18,38 C18,38 24,38 24,38 C24,38 32,38 32,38 C32,38 38,38 38,38 L38,38 L18,38 L18,18 Z"/>
- <path
- android:fillColor="#fff"
- android:pathData="M28,39 L26.405,37.5667575 C20.74,32.4713896 17,29.1089918 17,24.9945504 C17,21.6321526 19.6565,19 23.05,19 C24.964,19 26.801,19.8828338 28,21.2724796 C29.199,19.8828338 31.036,19 32.95,19 C36.3435,19 39,21.6321526 39,24.9945504 C39,29.1089918 35.26,32.4713896 29.595,37.5667575 L28,39 L28,39 Z"/>
- </group>
- </vector>
-
- </aapt:attr>
-
- <target android:name="clip">
- <aapt:attr name="android:animation">
-
- <set android:ordering="sequentially">
- <objectAnimator
- android:duration="160"
- android:interpolator="@android:interpolator/fast_out_linear_in"
- android:propertyName="pathData"
- android:valueFrom="M18,18 C18,18 24,18 24,18 C24,18 32,18 32,18 C32,18 38,18 38,18 L38,38 L18,38 L18,18 Z"
- android:valueTo="M18,26 C18,26 21,28 24,28 C27,28 29,25 32,25 C35,25 38,26 38,26 L38,38 L18,38 L18,26 Z"
- android:valueType="pathType"/>
- <objectAnimator
- android:duration="120"
- android:interpolator="@android:interpolator/linear_out_slow_in"
- android:propertyName="pathData"
- android:valueFrom="M18,26 C18,26 21,28 24,28 C27,28 29,25 32,25 C35,25 38,26 38,26 L38,38 L18,38 L18,26 Z"
- android:valueTo="M18,38 C18,38 24,38 24,38 C24,38 32,38 32,38 C32,38 38,38 38,38 L38,38 L18,38 L18,18 Z"
- android:valueType="pathType"/>
- </set>
-
- </aapt:attr>
- </target>
-
-</animated-vector>
diff --git a/appcompat/resources/src/androidTest/res/drawable/avd_heart_fill.xml b/appcompat/resources/src/androidTest/res/drawable/avd_heart_fill.xml
deleted file mode 100644
index 01954d1..0000000
--- a/appcompat/resources/src/androidTest/res/drawable/avd_heart_fill.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<animated-vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:aapt="http://schemas.android.com/aapt">
-
- <aapt:attr name="android:drawable">
-
- <vector
- android:width="56dp"
- android:height="56dp"
- android:viewportHeight="56"
- android:viewportWidth="56">
- <path
- android:fillColor="#fff"
- android:pathData="M32.95,19 C31.036,19 29.199,19.8828338 28,21.2724796 C26.801,19.8828338 24.964,19 23.05,19 C19.6565,19 17,21.6321526 17,24.9945504 C17,29.1089918 20.74,32.4713896 26.405,37.5667575 L28,39 L29.595,37.5667575 C35.26,32.4713896 39,29.1089918 39,24.9945504 C39,21.6321526 36.3435,19 32.95,19 L32.95,19 Z M28.1155,35.9536785 L28,36.0572207 L27.8845,35.9536785 C22.654,31.2506812 19.2,28.1444142 19.2,24.9945504 C19.2,22.8201635 20.8555,21.1798365 23.05,21.1798365 C24.744,21.1798365 26.394,22.2643052 26.9715,23.7520436 L29.023,23.7520436 C29.606,22.2643052 31.256,21.1798365 32.95,21.1798365 C35.1445,21.1798365 36.8,22.8201635 36.8,24.9945504 C36.8,28.1444142 33.346,31.2506812 28.1155,35.9536785 L28.1155,35.9536785 Z"/>
- <group android:name="filled">
- <clip-path
- android:name="clip"
- android:pathData="M18,38 C18,38 24,38 24,38 C24,38 32,38 32,38 C32,38 38,38 38,38 L38,38 L18,38 L18,18 Z"/>
- <path
- android:fillColor="#fff"
- android:pathData="M28,39 L26.405,37.5667575 C20.74,32.4713896 17,29.1089918 17,24.9945504 C17,21.6321526 19.6565,19 23.05,19 C24.964,19 26.801,19.8828338 28,21.2724796 C29.199,19.8828338 31.036,19 32.95,19 C36.3435,19 39,21.6321526 39,24.9945504 C39,29.1089918 35.26,32.4713896 29.595,37.5667575 L28,39 L28,39 Z"/>
- </group>
- </vector>
-
- </aapt:attr>
-
- <target android:name="clip">
- <aapt:attr name="android:animation">
-
- <set android:ordering="sequentially">
- <objectAnimator
- android:duration="160"
- android:interpolator="@android:interpolator/fast_out_linear_in"
- android:propertyName="pathData"
- android:valueFrom="M18,38 C18,38 24,38 24,38 C24,38 32,38 32,38 C32,38 38,38 38,38 L38,38 L18,38 L18,18 Z"
- android:valueTo="M18,26 C18,26 21,28 24,28 C27,28 29,25 32,25 C35,25 38,26 38,26 L38,38 L18,38 L18,26 Z"
- android:valueType="pathType"/>
- <objectAnimator
- android:duration="120"
- android:interpolator="@android:interpolator/linear_out_slow_in"
- android:propertyName="pathData"
- android:valueFrom="M18,26 C18,26 21,28 24,28 C27,28 29,25 32,25 C35,25 38,26 38,26 L38,38 L18,38 L18,26 Z"
- android:valueTo="M18,18 C18,18 24,18 24,18 C24,18 32,18 32,18 C32,18 38,18 38,18 L38,38 L18,38 L18,18 Z"
- android:valueType="pathType"/>
- </set>
-
- </aapt:attr>
- </target>
-
-</animated-vector>
diff --git a/appcompat/resources/src/androidTest/res/drawable/ic_heart_empty.xml b/appcompat/resources/src/androidTest/res/drawable/ic_heart_empty.xml
deleted file mode 100644
index 6243585..0000000
--- a/appcompat/resources/src/androidTest/res/drawable/ic_heart_empty.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="56dp"
- android:height="56dp"
- android:viewportHeight="56"
- android:viewportWidth="56">
-
- <path
- android:fillColor="#fff"
- android:pathData="M32.95,19 C31.036,19 29.199,19.8828338 28,21.2724796 C26.801,19.8828338 24.964,19 23.05,19 C19.6565,19 17,21.6321526 17,24.9945504 C17,29.1089918 20.74,32.4713896 26.405,37.5667575 L28,39 L29.595,37.5667575 C35.26,32.4713896 39,29.1089918 39,24.9945504 C39,21.6321526 36.3435,19 32.95,19 L32.95,19 Z M28.1155,35.9536785 L28,36.0572207 L27.8845,35.9536785 C22.654,31.2506812 19.2,28.1444142 19.2,24.9945504 C19.2,22.8201635 20.8555,21.1798365 23.05,21.1798365 C24.744,21.1798365 26.394,22.2643052 26.9715,23.7520436 L29.023,23.7520436 C29.606,22.2643052 31.256,21.1798365 32.95,21.1798365 C35.1445,21.1798365 36.8,22.8201635 36.8,24.9945504 C36.8,28.1444142 33.346,31.2506812 28.1155,35.9536785 L28.1155,35.9536785 Z"/>
-
-</vector>
diff --git a/appcompat/resources/src/androidTest/res/drawable/ic_heart_full.xml b/appcompat/resources/src/androidTest/res/drawable/ic_heart_full.xml
deleted file mode 100644
index e045ed8..0000000
--- a/appcompat/resources/src/androidTest/res/drawable/ic_heart_full.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="56dp"
- android:height="56dp"
- android:viewportHeight="56"
- android:viewportWidth="56">
-
- <path
- android:fillColor="#fff"
- android:pathData="M28,39 L26.405,37.5667575 C20.74,32.4713896 17,29.1089918 17,24.9945504 C17,21.6321526 19.6565,19 23.05,19 C24.964,19 26.801,19.8828338 28,21.2724796 C29.199,19.8828338 31.036,19 32.95,19 C36.3435,19 39,21.6321526 39,24.9945504 C39,29.1089918 35.26,32.4713896 29.595,37.5667575 L28,39 L28,39 Z"/>
-
-</vector>
diff --git a/appcompat/resources/src/androidTest/res/drawable/test_vector_off.xml b/appcompat/resources/src/androidTest/res/drawable/test_vector_off.xml
deleted file mode 100644
index 53427a2..0000000
--- a/appcompat/resources/src/androidTest/res/drawable/test_vector_off.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<vector
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:name="btn_radio_to_on_mtrl"
- android:width="32dp"
- android:viewportWidth="32"
- android:height="32dp"
- android:viewportHeight="32">
- <group
- android:name="btn_radio_to_on_mtrl_0"
- android:translateX="16"
- android:translateY="16" >
- <group
- android:name="ring_outer" >
- <path
- android:name="ring_outer_path"
- android:strokeColor="#FF000000"
- android:strokeWidth="2"
- android:pathData="M 0.0,-9.0 c 4.9705627482,0.0 9.0,4.0294372518 9.0,9.0 c 0.0,4.9705627482 -4.0294372518,9.0 -9.0,9.0 c -4.9705627482,0.0 -9.0,-4.0294372518 -9.0,-9.0 c 0.0,-4.9705627482 4.0294372518,-9.0 9.0,-9.0 Z" />
- </group>
- <group
- android:name="dot_group"
- android:scaleX="0"
- android:scaleY="0" >
- <path
- android:name="dot_path"
- android:pathData="M 0.0,-5.0 c -2.7619934082,0.0 -5.0,2.2380065918 -5.0,5.0 c 0.0,2.7619934082 2.2380065918,5.0 5.0,5.0 c 2.7619934082,0.0 5.0,-2.2380065918 5.0,-5.0 c 0.0,-2.7619934082 -2.2380065918,-5.0 -5.0,-5.0 Z"
- android:fillColor="#FF000000" />
- </group>
- </group>
-</vector>
\ No newline at end of file
diff --git a/appcompat/resources/src/androidTest/res/drawable/vector_drawable_grouping_1.xml b/appcompat/resources/src/androidTest/res/drawable/vector_drawable_grouping_1.xml
deleted file mode 100644
index 0a3548d..0000000
--- a/appcompat/resources/src/androidTest/res/drawable/vector_drawable_grouping_1.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="64dp"
- android:height="64dp"
- android:viewportHeight="256"
- android:viewportWidth="256">
-
- <group
- android:name="shape_layer_1"
- android:translateX="128"
- android:translateY="128">
- <group android:name="sun">
- <path
- android:name="ellipse_path_1"
- android:fillColor="#ffff8000"
- android:pathData="m -25 0 a 25,25 0 1,0 50,0 a 25,25 0 1,0 -50,0"/>
-
- <group
- android:name="earth"
- android:translateX="75">
- <path
- android:name="ellipse_path_1_1"
- android:fillColor="#ff5656ea"
- android:pathData="m -10 0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0"/>
-
- <group
- android:name="moon"
- android:translateX="25">
- <path
- android:name="ellipse_path_1_2"
- android:fillColor="#ffadadad"
- android:pathData="m -5 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0"/>
- </group>
- </group>
- </group>
- </group>
-
-</vector>
diff --git a/appcompat/resources/src/androidTest/res/values/colors.xml b/appcompat/resources/src/androidTest/res/values/colors.xml
deleted file mode 100644
index ee50ae1..0000000
--- a/appcompat/resources/src/androidTest/res/values/colors.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<resources>
- <drawable name="red">#7f00</drawable>
- <drawable name="blue">#770000ff</drawable>
- <drawable name="black">#77ffffff</drawable>
- <drawable name="yellow">#77ffff00</drawable>
-</resources>
diff --git a/appcompat/resources/src/main/AndroidManifest.xml b/appcompat/resources/src/main/AndroidManifest.xml
deleted file mode 100644
index a9d8443..0000000
--- a/appcompat/resources/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<manifest package="androidx.appcompat.resources"/>
diff --git a/appcompat/resources/src/main/java/androidx/appcompat/content/res/AppCompatResources.java b/appcompat/resources/src/main/java/androidx/appcompat/content/res/AppCompatResources.java
deleted file mode 100644
index 2bd036f..0000000
--- a/appcompat/resources/src/main/java/androidx/appcompat/content/res/AppCompatResources.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright 2016 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.appcompat.content.res;
-
-import android.content.Context;
-import android.content.res.ColorStateList;
-import android.content.res.Configuration;
-import android.content.res.Resources;
-import android.graphics.drawable.Drawable;
-import android.os.Build;
-import android.util.Log;
-import android.util.SparseArray;
-import android.util.TypedValue;
-
-import androidx.annotation.ColorRes;
-import androidx.annotation.DrawableRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.appcompat.widget.ResourceManagerInternal;
-import androidx.core.content.ContextCompat;
-import androidx.core.content.res.ColorStateListInflaterCompat;
-
-import org.xmlpull.v1.XmlPullParser;
-
-import java.util.WeakHashMap;
-
-/**
- * Class for accessing an application's resources through AppCompat, and thus any backward
- * compatible functionality.
- */
-public final class AppCompatResources {
-
- private static final String LOG_TAG = "AppCompatResources";
- private static final ThreadLocal<TypedValue> TL_TYPED_VALUE = new ThreadLocal<>();
-
- private static final WeakHashMap<Context, SparseArray<ColorStateListCacheEntry>>
- sColorStateCaches = new WeakHashMap<>(0);
-
- private static final Object sColorStateCacheLock = new Object();
-
- private AppCompatResources() {}
-
- /**
- * Returns the {@link ColorStateList} from the given resource. The resource can include
- * themeable attributes, regardless of API level.
- *
- * @param context context to inflate against
- * @param resId the resource identifier of the ColorStateList to retrieve
- */
- public static ColorStateList getColorStateList(@NonNull Context context, @ColorRes int resId) {
- if (Build.VERSION.SDK_INT >= 23) {
- // On M+ we can use the framework
- return context.getColorStateList(resId);
- }
-
- // Before that, we'll try handle it ourselves
- ColorStateList csl = getCachedColorStateList(context, resId);
- if (csl != null) {
- return csl;
- }
- // Cache miss, so try and inflate it ourselves
- csl = inflateColorStateList(context, resId);
- if (csl != null) {
- // If we inflated it, add it to the cache and return
- addColorStateListToCache(context, resId, csl);
- return csl;
- }
-
- // If we reach here then we couldn't inflate it, so let the framework handle it
- return ContextCompat.getColorStateList(context, resId);
- }
-
- /**
- * Return a drawable object associated with a particular resource ID.
- *
- * <p>This method supports inflation of {@code <vector>}, {@code <animated-vector>} and
- * {@code <animated-selector>} resources on devices where platform support is not available.</p>
- *
- * @param context context to inflate against
- * @param resId The desired resource identifier, as generated by the aapt
- * tool. This integer encodes the package, type, and resource
- * entry. The value 0 is an invalid identifier.
- * @return Drawable An object that can be used to draw this resource.
- * @see ContextCompat#getDrawable(Context, int)
- */
- @Nullable
- public static Drawable getDrawable(@NonNull Context context, @DrawableRes int resId) {
- return ResourceManagerInternal.get().getDrawable(context, resId);
- }
-
- /**
- * Inflates a {@link ColorStateList} from resources, honouring theme attributes.
- */
- @Nullable
- private static ColorStateList inflateColorStateList(Context context, int resId) {
- if (isColorInt(context, resId)) {
- // The resource is a color int, we can't handle it so return null
- return null;
- }
-
- final Resources r = context.getResources();
- final XmlPullParser xml = r.getXml(resId);
- try {
- return ColorStateListInflaterCompat.createFromXml(r, xml, context.getTheme());
- } catch (Exception e) {
- Log.e(LOG_TAG, "Failed to inflate ColorStateList, leaving it to the framework", e);
- }
- return null;
- }
-
- @Nullable
- private static ColorStateList getCachedColorStateList(@NonNull Context context,
- @ColorRes int resId) {
- synchronized (sColorStateCacheLock) {
- final SparseArray<ColorStateListCacheEntry> entries = sColorStateCaches.get(context);
- if (entries != null && entries.size() > 0) {
- final ColorStateListCacheEntry entry = entries.get(resId);
- if (entry != null) {
- if (entry.configuration.equals(context.getResources().getConfiguration())) {
- // If the current configuration matches the entry's, we can use it
- return entry.value;
- } else {
- // Otherwise we'll remove the entry
- entries.remove(resId);
- }
- }
- }
- }
- return null;
- }
-
- private static void addColorStateListToCache(@NonNull Context context, @ColorRes int resId,
- @NonNull ColorStateList value) {
- synchronized (sColorStateCacheLock) {
- SparseArray<ColorStateListCacheEntry> entries = sColorStateCaches.get(context);
- if (entries == null) {
- entries = new SparseArray<>();
- sColorStateCaches.put(context, entries);
- }
- entries.append(resId, new ColorStateListCacheEntry(value,
- context.getResources().getConfiguration()));
- }
- }
-
- private static boolean isColorInt(@NonNull Context context, @ColorRes int resId) {
- final Resources r = context.getResources();
-
- final TypedValue value = getTypedValue();
- r.getValue(resId, value, true);
-
- return value.type >= TypedValue.TYPE_FIRST_COLOR_INT
- && value.type <= TypedValue.TYPE_LAST_COLOR_INT;
- }
-
- @NonNull
- private static TypedValue getTypedValue() {
- TypedValue tv = TL_TYPED_VALUE.get();
- if (tv == null) {
- tv = new TypedValue();
- TL_TYPED_VALUE.set(tv);
- }
- return tv;
- }
-
- private static class ColorStateListCacheEntry {
- final ColorStateList value;
- final Configuration configuration;
-
- ColorStateListCacheEntry(@NonNull ColorStateList value,
- @NonNull Configuration configuration) {
- this.value = value;
- this.configuration = configuration;
- }
- }
-
-}
diff --git a/appcompat/resources/src/main/java/androidx/appcompat/graphics/drawable/AnimatedStateListDrawableCompat.java b/appcompat/resources/src/main/java/androidx/appcompat/graphics/drawable/AnimatedStateListDrawableCompat.java
deleted file mode 100644
index a398233..0000000
--- a/appcompat/resources/src/main/java/androidx/appcompat/graphics/drawable/AnimatedStateListDrawableCompat.java
+++ /dev/null
@@ -1,780 +0,0 @@
-/*
- * Copyright (C) 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.appcompat.graphics.drawable;
-
-import static android.os.Build.VERSION.SDK_INT;
-import static android.os.Build.VERSION_CODES.LOLLIPOP;
-
-import static androidx.core.content.res.TypedArrayUtils.obtainAttributes;
-
-import android.animation.ObjectAnimator;
-import android.animation.TimeInterpolator;
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.content.res.Resources;
-import android.content.res.TypedArray;
-import android.graphics.drawable.Animatable;
-import android.graphics.drawable.AnimationDrawable;
-import android.graphics.drawable.Drawable;
-import android.os.Build;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.util.StateSet;
-import android.util.Xml;
-
-import androidx.annotation.DrawableRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.appcompat.widget.ResourceManagerInternal;
-import androidx.collection.LongSparseArray;
-import androidx.collection.SparseArrayCompat;
-import androidx.core.graphics.drawable.TintAwareDrawable;
-import androidx.appcompat.resources.R;
-import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;
-import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-
-/**
- * A {@link Drawable} providing animated transitions between states.
- *
- * <p>A port of {@link android.graphics.drawable.AnimatedStateListDrawable} compatible with older
- * versions of the platform.
- *
- * <p>This drawable can be defined in an XML file with the <code>
- * <animated-selector></code> element. Each keyframe Drawable is defined in a
- * nested <code><item></code> element. Transitions are defined in a nested
- * <code><transition></code> element.
- *
- * <p>Notable exceptions not supported by this class:
- *
- * <ul>
- * <li><code>drawable</code>s defined as children of <code><item></code>s or
- * <code><transition></code>s (<b>except</b> vectors) ignore theme attributes prior to API level
- * 21</li>
- * <li>Animated vector transitions do not support reversing prior to API level 24</li>
- * </ul>
- *
- * {@link android.R.attr#state_focused}
- * {@link android.R.attr#state_window_focused}
- * {@link android.R.attr#state_enabled}
- * {@link android.R.attr#state_checkable}
- * {@link android.R.attr#state_checked}
- * {@link android.R.attr#state_selected}
- * {@link android.R.attr#state_activated}
- * {@link android.R.attr#state_active}
- * {@link android.R.attr#state_single}
- * {@link android.R.attr#state_first}
- * {@link android.R.attr#state_middle}
- * {@link android.R.attr#state_last}
- * {@link android.R.attr#state_pressed}
- * @see ResourceManagerInternal#getDrawable(Context, int)
- */
-public class AnimatedStateListDrawableCompat extends StateListDrawable
- implements TintAwareDrawable {
- private static final String LOGTAG = AnimatedStateListDrawableCompat.class.getSimpleName();
- private static final String ELEMENT_TRANSITION = "transition";
- private static final String ELEMENT_ITEM = "item";
- private static final String TRANSITION_MISSING_DRAWABLE_ERROR =
- ": <transition> tag requires a 'drawable' attribute or child tag defining a drawable";
- private static final String TRANSITION_MISSING_FROM_TO_ID =
- ": <transition> tag requires 'fromId' & 'toId' attributes";
- private static final String ITEM_MISSING_DRAWABLE_ERROR =
- ": <item> tag requires a 'drawable' attribute or child tag defining a drawable";
- private AnimatedStateListState mState;
- /** The currently running transition, if any. */
- private Transition mTransition;
- /** Index to be set after the transition ends. */
- private int mTransitionToIndex = -1;
- /** Index away from which we are transitioning. */
- private int mTransitionFromIndex = -1;
- private boolean mMutated;
-
- public AnimatedStateListDrawableCompat() {
- this(null, null);
- }
-
- AnimatedStateListDrawableCompat(@Nullable AnimatedStateListState state,
- @Nullable Resources res) {
- super(null);
- // Every animated state list drawable has its own constant state.
- final AnimatedStateListState newState = new AnimatedStateListState(state, this, res);
- setConstantState(newState);
- onStateChange(getState());
- jumpToCurrentState();
- }
-
- /**
- * Creates an AnimatedStateListDrawableCompat.
- *
- * @param context context to inflate against
- * @param resId the resource ID for AnimatedStateListDrawable object.
- * @param theme the theme to apply, may be null.
- * @return a new AnimatedStateListDrawableCompat or null if parsing error is found.
- * @see ResourceManagerInternal#getDrawable(Context, int)
- */
- @Nullable
- public static AnimatedStateListDrawableCompat create(
- @NonNull Context context,
- @DrawableRes int resId,
- @Nullable Resources.Theme theme) {
- try {
- final Resources res = context.getResources();
- @SuppressLint("ResourceType")
- final XmlPullParser parser = res.getXml(resId);
- final AttributeSet attrs = Xml.asAttributeSet(parser);
- int type;
- while ((type = parser.next()) != XmlPullParser.START_TAG
- && type != XmlPullParser.END_DOCUMENT) {
- // Empty loop
- }
- if (type != XmlPullParser.START_TAG) {
- throw new XmlPullParserException("No start tag found");
- }
- return createFromXmlInner(context, res, parser, attrs, theme);
- } catch (XmlPullParserException e) {
- Log.e(LOGTAG, "parser error", e);
- } catch (IOException e) {
- Log.e(LOGTAG, "parser error", e);
- }
- return null;
- }
-
- /**
- * Create a AnimatedStateListDrawableCompat from inside an XML document using an optional
- * {@link Resources.Theme}. Called on a parser positioned at a tag in an XML
- * document, tries to create an AnimatedStateListDrawableCompat from that tag.
- */
- public static AnimatedStateListDrawableCompat createFromXmlInner(
- @NonNull Context context,
- @NonNull Resources resources,
- @NonNull XmlPullParser parser,
- @NonNull AttributeSet attrs,
- @Nullable Resources.Theme theme)
- throws IOException, XmlPullParserException {
- final String name = parser.getName();
- if (!name.equals("animated-selector")) {
- throw new XmlPullParserException(
- parser.getPositionDescription() + ": invalid animated-selector tag " + name);
- }
- AnimatedStateListDrawableCompat asl = new AnimatedStateListDrawableCompat();
- asl.inflate(context, resources, parser, attrs, theme);
- return asl;
- }
-
- /**
- * Inflate this Drawable from an XML resource optionally styled by a theme.
- * This can't be called more than once for each Drawable.
- *
- * @param context context to inflate against
- * @param resources Resources used to resolve attribute values
- * @param parser XML parser from which to inflate this Drawable
- * @param attrs Base set of attribute values
- * @param theme Theme to apply, may be null
- * @throws XmlPullParserException
- * @throws IOException
- */
- @Override
- public void inflate(
- @NonNull Context context,
- @NonNull Resources resources,
- @NonNull XmlPullParser parser,
- @NonNull AttributeSet attrs,
- @Nullable Resources.Theme theme)
- throws XmlPullParserException, IOException {
- final TypedArray a = obtainAttributes(
- resources, theme, attrs, R.styleable.AnimatedStateListDrawableCompat);
- setVisible(a.getBoolean(R.styleable.AnimatedStateListDrawableCompat_android_visible, true),
- true);
- updateStateFromTypedArray(a);
- updateDensity(resources);
- a.recycle();
- inflateChildElements(context, resources, parser, attrs, theme);
- init();
- }
-
- @Override
- public boolean setVisible(boolean visible, boolean restart) {
- final boolean changed = super.setVisible(visible, restart);
- if (mTransition != null && (changed || restart)) {
- if (visible) {
- mTransition.start();
- } else {
- // Ensure we're showing the correct state when visible.
- jumpToCurrentState();
- }
- }
- return changed;
- }
-
- /**
- * Add a new drawable to the set of keyframes.
- *
- * @param stateSet An array of resource IDs to associate with the keyframe
- * @param drawable The drawable to show when in the specified state, may not be null
- * @param id The unique identifier for the keyframe
- */
- public void addState(@NonNull int[] stateSet, @NonNull Drawable drawable, int id) {
- if (drawable == null) {
- throw new IllegalArgumentException("Drawable must not be null");
- }
- mState.addStateSet(stateSet, drawable, id);
- onStateChange(getState());
- }
-
- /**
- * Adds a new transition between keyframes.
- *
- * @param fromId Unique identifier of the starting keyframe
- * @param toId Unique identifier of the ending keyframe
- * @param transition An {@link Animatable} drawable to use as a transition, may not be null
- * @param reversible Whether the transition can be reversed
- */
- public <T extends Drawable & Animatable> void addTransition(int fromId, int toId,
- @NonNull T transition, boolean reversible) {
- if (transition == null) {
- throw new IllegalArgumentException("Transition drawable must not be null");
- }
- mState.addTransition(fromId, toId, transition, reversible);
- }
-
- @Override
- public boolean isStateful() {
- return true;
- }
-
- @Override
- public void jumpToCurrentState() {
- super.jumpToCurrentState();
- if (mTransition != null) {
- mTransition.stop();
- mTransition = null;
- selectDrawable(mTransitionToIndex);
- mTransitionToIndex = -1;
- mTransitionFromIndex = -1;
- }
- }
-
- @Override
- protected boolean onStateChange(int[] stateSet) {
- // If we're not already at the target index, either attempt to find a
- // valid transition to it or jump directly there.
- final int targetIndex = mState.indexOfKeyframe(stateSet);
- boolean changed = targetIndex != getCurrentIndex()
- && (selectTransition(targetIndex) || selectDrawable(targetIndex));
- // We need to propagate the state change to the current drawable, but
- // we can't call StateListDrawable.onStateChange() without changing the
- // current drawable.
- final Drawable current = getCurrent();
- if (current != null) {
- changed |= current.setState(stateSet);
- }
- return changed;
- }
-
- private boolean selectTransition(int toIndex) {
- final int fromIndex;
- final Transition currentTransition = mTransition;
- if (currentTransition != null) {
- if (toIndex == mTransitionToIndex) {
- // Already animating to that keyframe.
- return true;
- } else if (toIndex == mTransitionFromIndex && currentTransition.canReverse()) {
- // Reverse the current animation.
- currentTransition.reverse();
- mTransitionToIndex = mTransitionFromIndex;
- mTransitionFromIndex = toIndex;
- return true;
- }
- // Start the next transition from the end of the current one.
- fromIndex = mTransitionToIndex;
- // Changing animation, end the current animation.
- currentTransition.stop();
- } else {
- fromIndex = getCurrentIndex();
- }
- // Reset state.
- mTransition = null;
- mTransitionFromIndex = -1;
- mTransitionToIndex = -1;
- final AnimatedStateListState state = mState;
- final int fromId = state.getKeyframeIdAt(fromIndex);
- final int toId = state.getKeyframeIdAt(toIndex);
- if (toId == 0 || fromId == 0) {
- // Missing a keyframe ID.
- return false;
- }
- final int transitionIndex = state.indexOfTransition(fromId, toId);
- if (transitionIndex < 0) {
- // Couldn't select a transition.
- return false;
- }
- boolean hasReversibleFlag = state.transitionHasReversibleFlag(fromId, toId);
- // This may fail if we're already on the transition, but that's okay!
- selectDrawable(transitionIndex);
- final Transition transition;
- final Drawable d = getCurrent();
- if (d instanceof AnimationDrawable) {
- final boolean reversed = state.isTransitionReversed(fromId, toId);
- transition = new AnimationDrawableTransition((AnimationDrawable) d,
- reversed, hasReversibleFlag);
- } else if (d instanceof AnimatedVectorDrawableCompat) {
- //final boolean reversed = state.isTransitionReversed(fromId, toId);
- transition = new AnimatedVectorDrawableTransition((AnimatedVectorDrawableCompat) d);
- } else if (d instanceof Animatable) {
- transition = new AnimatableTransition((Animatable) d);
- } else {
- // We don't know how to animate this transition.
- return false;
- }
- transition.start();
- mTransition = transition;
- mTransitionFromIndex = fromIndex;
- mTransitionToIndex = toIndex;
- return true;
- }
-
- private abstract static class Transition {
- public abstract void start();
-
- public abstract void stop();
-
- public void reverse() {
- // Not supported by default.
- }
-
- public boolean canReverse() {
- return false;
- }
- }
-
- private static class AnimatableTransition extends Transition {
- private final Animatable mA;
-
- AnimatableTransition(Animatable a) {
- mA = a;
- }
-
- @Override
- public void start() {
- mA.start();
- }
-
- @Override
- public void stop() {
- mA.stop();
- }
- }
-
- private static class AnimationDrawableTransition extends Transition {
- private final ObjectAnimator mAnim;
- // Even AnimationDrawable is always reversible technically, but
- // we should obey the XML's android:reversible flag.
- private final boolean mHasReversibleFlag;
-
- AnimationDrawableTransition(AnimationDrawable ad,
- boolean reversed, boolean hasReversibleFlag) {
- final int frameCount = ad.getNumberOfFrames();
- final int fromFrame = reversed ? frameCount - 1 : 0;
- final int toFrame = reversed ? 0 : frameCount - 1;
- final FrameInterpolator interp = new FrameInterpolator(ad, reversed);
- @SuppressLint("ObjectAnimatorBinding")
- final ObjectAnimator anim =
- ObjectAnimator.ofInt(ad, "currentIndex", fromFrame, toFrame);
- if (SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
- anim.setAutoCancel(true);
- }
- anim.setDuration(interp.getTotalDuration());
- anim.setInterpolator(interp);
- mHasReversibleFlag = hasReversibleFlag;
- mAnim = anim;
- }
-
- @Override
- public boolean canReverse() {
- return mHasReversibleFlag;
- }
-
- @Override
- public void start() {
- mAnim.start();
- }
-
- @Override
- public void reverse() {
- mAnim.reverse();
- }
-
- @Override
- public void stop() {
- mAnim.cancel();
- }
- }
-
- private static class AnimatedVectorDrawableTransition extends Transition {
- private final AnimatedVectorDrawableCompat mAvd;
-
- AnimatedVectorDrawableTransition(AnimatedVectorDrawableCompat avd) {
- mAvd = avd;
- }
-
- @Override
- public void start() {
- mAvd.start();
- }
-
- @Override
- public void stop() {
- mAvd.stop();
- }
- }
-
- private void updateStateFromTypedArray(TypedArray a) {
- final AnimatedStateListState state = mState;
- // Account for any configuration changes.
- if (SDK_INT >= LOLLIPOP) {
- state.mChangingConfigurations |= a.getChangingConfigurations();
- }
- // Extract the theme attributes, if any.
- state.setVariablePadding(
- a.getBoolean(R.styleable.AnimatedStateListDrawableCompat_android_variablePadding,
- state.mVariablePadding));
- state.setConstantSize(
- a.getBoolean(R.styleable.AnimatedStateListDrawableCompat_android_constantSize,
- state.mConstantSize));
- state.setEnterFadeDuration(
- a.getInt(R.styleable.AnimatedStateListDrawableCompat_android_enterFadeDuration,
- state.mEnterFadeDuration));
- state.setExitFadeDuration(
- a.getInt(R.styleable.AnimatedStateListDrawableCompat_android_exitFadeDuration,
- state.mExitFadeDuration));
- setDither(a.getBoolean(R.styleable.AnimatedStateListDrawableCompat_android_dither,
- state.mDither));
- }
-
- private void init() {
- onStateChange(getState());
- }
-
- private void inflateChildElements(
- @NonNull Context context,
- @NonNull Resources resources,
- @NonNull XmlPullParser parser,
- @NonNull AttributeSet attrs,
- @Nullable Resources.Theme theme)
- throws XmlPullParserException, IOException {
- int type;
- final int innerDepth = parser.getDepth() + 1;
- int depth;
- while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
- && ((depth = parser.getDepth()) >= innerDepth
- || type != XmlPullParser.END_TAG)) {
- if (type != XmlPullParser.START_TAG) {
- continue;
- }
- if (depth > innerDepth) {
- continue;
- }
- if (parser.getName().equals(ELEMENT_ITEM)) {
- parseItem(context, resources, parser, attrs, theme);
- } else if (parser.getName().equals(ELEMENT_TRANSITION)) {
- parseTransition(context, resources, parser, attrs, theme);
- }
- }
- }
-
- private int parseTransition(
- @NonNull Context context,
- @NonNull Resources resources,
- @NonNull XmlPullParser parser,
- @NonNull AttributeSet attrs,
- @Nullable Resources.Theme theme)
- throws XmlPullParserException, IOException {
-
- final TypedArray a = obtainAttributes(resources, theme, attrs,
- R.styleable.AnimatedStateListDrawableTransition);
- final int fromId = a.getResourceId(
- R.styleable.AnimatedStateListDrawableTransition_android_fromId, -1);
- final int toId = a.getResourceId(
- R.styleable.AnimatedStateListDrawableTransition_android_toId, -1);
- Drawable dr = null;
- final int drawableId = a.getResourceId(
- R.styleable.AnimatedStateListDrawableTransition_android_drawable, -1);
- if (drawableId > 0) {
- dr = ResourceManagerInternal.get().getDrawable(context, drawableId);
- }
- final boolean reversible = a.getBoolean(
- R.styleable.AnimatedStateListDrawableTransition_android_reversible, false);
- a.recycle();
- // Loading child elements modifies the state of the AttributeSet's underlying parser, so
- // it needs to happen after obtaining attributes and extracting states.
- if (dr == null) {
- int type;
- while ((type = parser.next()) == XmlPullParser.TEXT) {
- // no-op
- }
- if (type != XmlPullParser.START_TAG) {
- throw new XmlPullParserException(
- parser.getPositionDescription() + TRANSITION_MISSING_DRAWABLE_ERROR);
- }
- // Attempt to parse child AVDs
- if (parser.getName().equals("animated-vector")) {
- dr = AnimatedVectorDrawableCompat.createFromXmlInner(context, resources, parser,
- attrs, theme);
- } else if (SDK_INT >= LOLLIPOP) {
- dr = Drawable.createFromXmlInner(resources, parser, attrs, theme);
- } else {
- dr = Drawable.createFromXmlInner(resources, parser, attrs);
- }
- }
- if (dr == null) {
- throw new XmlPullParserException(
- parser.getPositionDescription() + TRANSITION_MISSING_DRAWABLE_ERROR);
- }
- if (fromId == -1 || toId == -1) {
- throw new XmlPullParserException(
- parser.getPositionDescription() + TRANSITION_MISSING_FROM_TO_ID);
- }
- return mState.addTransition(fromId, toId, dr, reversible);
- }
-
- private int parseItem(
- @NonNull Context context,
- @NonNull Resources resources,
- @NonNull XmlPullParser parser,
- @NonNull AttributeSet attrs,
- @Nullable Resources.Theme theme)
- throws XmlPullParserException, IOException {
- final TypedArray a = obtainAttributes(resources, theme, attrs,
- R.styleable.AnimatedStateListDrawableItem);
- final int keyframeId = a.getResourceId(R.styleable.AnimatedStateListDrawableItem_android_id,
- 0);
- Drawable dr = null;
- final int drawableId =
- a.getResourceId(R.styleable.AnimatedStateListDrawableItem_android_drawable, -1);
- if (drawableId > 0) {
- dr = ResourceManagerInternal.get().getDrawable(context, drawableId);
- }
- a.recycle();
- final int[] states = extractStateSet(attrs);
- // Loading child elements modifies the state of the AttributeSet's underlying parser, so
- // it needs to happen after obtaining attributes and extracting states.
- if (dr == null) {
- int type;
- while ((type = parser.next()) == XmlPullParser.TEXT) {
- // no-op
- }
- if (type != XmlPullParser.START_TAG) {
- throw new XmlPullParserException(
- parser.getPositionDescription() + ITEM_MISSING_DRAWABLE_ERROR);
- }
- // Attempt to parse child VDs
- if (parser.getName().equals("vector")) {
- dr = VectorDrawableCompat.createFromXmlInner(resources, parser, attrs, theme);
- } else if (SDK_INT >= LOLLIPOP) {
- dr = Drawable.createFromXmlInner(resources, parser, attrs, theme);
- } else {
- dr = Drawable.createFromXmlInner(resources, parser, attrs);
- }
- }
- if (dr == null) {
- throw new XmlPullParserException(
- parser.getPositionDescription() + ITEM_MISSING_DRAWABLE_ERROR);
- }
- return mState.addStateSet(states, dr, keyframeId);
- }
-
- @Override
- public Drawable mutate() {
- if (!mMutated && super.mutate() == this) {
- mState.mutate();
- mMutated = true;
- }
- return this;
- }
-
- @Override
- AnimatedStateListState cloneConstantState() {
- return new AnimatedStateListState(mState, this, null);
- }
-
- @Override
- void clearMutated() {
- super.clearMutated();
- mMutated = false;
- }
-
- static class AnimatedStateListState extends StateListState {
- // REVERSED_BIT is indicating the current transition's direction.
- private static final long REVERSED_BIT = 0x100000000L;
- // REVERSIBLE_FLAG_BIT is indicating whether the whole transition has
- // reversible flag set to true.
- private static final long REVERSIBLE_FLAG_BIT = 0x200000000L;
- LongSparseArray<Long> mTransitions;
- SparseArrayCompat<Integer> mStateIds;
-
- AnimatedStateListState(@Nullable AnimatedStateListState orig,
- @NonNull AnimatedStateListDrawableCompat owner, @Nullable Resources res) {
- super(orig, owner, res);
- if (orig != null) {
- // Perform a shallow copy and rely on mutate() to deep-copy.
- mTransitions = orig.mTransitions;
- mStateIds = orig.mStateIds;
- } else {
- mTransitions = new LongSparseArray<>();
- mStateIds = new SparseArrayCompat<>();
- }
- }
-
- @Override
- void mutate() {
- mTransitions = mTransitions.clone();
- mStateIds = mStateIds.clone();
- }
-
- int addTransition(int fromId, int toId, @NonNull Drawable anim, boolean reversible) {
- final int pos = super.addChild(anim);
- final long keyFromTo = generateTransitionKey(fromId, toId);
- long reversibleBit = 0;
- if (reversible) {
- reversibleBit = REVERSIBLE_FLAG_BIT;
- }
- mTransitions.append(keyFromTo, pos | reversibleBit);
- if (reversible) {
- final long keyToFrom = generateTransitionKey(toId, fromId);
- mTransitions.append(keyToFrom, pos | REVERSED_BIT | reversibleBit);
- }
- return pos;
- }
-
- int addStateSet(@NonNull int[] stateSet, @NonNull Drawable drawable, int id) {
- final int index = super.addStateSet(stateSet, drawable);
- mStateIds.put(index, id);
- return index;
- }
-
- int indexOfKeyframe(@NonNull int[] stateSet) {
- final int index = super.indexOfStateSet(stateSet);
- if (index >= 0) {
- return index;
- }
- return super.indexOfStateSet(StateSet.WILD_CARD);
- }
-
- int getKeyframeIdAt(int index) {
- return index < 0 ? 0 : mStateIds.get(index, 0);
- }
-
- int indexOfTransition(int fromId, int toId) {
- final long keyFromTo = generateTransitionKey(fromId, toId);
- return (int) mTransitions.get(keyFromTo, -1L).longValue();
- }
-
- boolean isTransitionReversed(int fromId, int toId) {
- final long keyFromTo = generateTransitionKey(fromId, toId);
- return (mTransitions.get(keyFromTo, -1L) & REVERSED_BIT) != 0L;
- }
-
- boolean transitionHasReversibleFlag(int fromId, int toId) {
- final long keyFromTo = generateTransitionKey(fromId, toId);
- return (mTransitions.get(keyFromTo, -1L) & REVERSIBLE_FLAG_BIT) != 0L;
- }
-
- @NonNull
- @Override
- public Drawable newDrawable() {
- return new AnimatedStateListDrawableCompat(this, null);
- }
-
- @NonNull
- @Override
- public Drawable newDrawable(Resources res) {
- return new AnimatedStateListDrawableCompat(this, res);
- }
-
- private static long generateTransitionKey(int fromId, int toId) {
- return (long) fromId << 32 | toId;
- }
- }
-
- @Override
- void setConstantState(@NonNull DrawableContainerState state) {
- super.setConstantState(state);
- if (state instanceof AnimatedStateListState) {
- mState = (AnimatedStateListState) state;
- }
- }
-
- /**
- * Interpolates between frames with respect to their individual durations.
- */
- private static class FrameInterpolator implements TimeInterpolator {
- private int[] mFrameTimes;
- private int mFrames;
- private int mTotalDuration;
-
- FrameInterpolator(AnimationDrawable d, boolean reversed) {
- updateFrames(d, reversed);
- }
-
- int updateFrames(AnimationDrawable d, boolean reversed) {
- final int frameCount = d.getNumberOfFrames();
- mFrames = frameCount;
- if (mFrameTimes == null || mFrameTimes.length < frameCount) {
- mFrameTimes = new int[frameCount];
- }
- final int[] frameTimes = mFrameTimes;
- int totalDuration = 0;
- for (int i = 0; i < frameCount; i++) {
- final int duration = d.getDuration(reversed ? frameCount - i - 1 : i);
- frameTimes[i] = duration;
- totalDuration += duration;
- }
- mTotalDuration = totalDuration;
- return totalDuration;
- }
-
- int getTotalDuration() {
- return mTotalDuration;
- }
-
- @Override
- public float getInterpolation(float input) {
- final int elapsed = (int) (input * mTotalDuration + 0.5f);
- final int frameCount = mFrames;
- final int[] frameTimes = mFrameTimes;
- // Find the current frame and remaining time within that frame.
- int remaining = elapsed;
- int i = 0;
- while (i < frameCount && remaining >= frameTimes[i]) {
- remaining -= frameTimes[i];
- i++;
- }
- // Remaining time is relative of total duration.
- final float frameElapsed;
- if (i < frameCount) {
- frameElapsed = remaining / (float) mTotalDuration;
- } else {
- frameElapsed = 0;
- }
- return i / (float) frameCount + frameElapsed;
- }
- }
-}
diff --git a/appcompat/resources/src/main/java/androidx/appcompat/graphics/drawable/DrawableContainer.java b/appcompat/resources/src/main/java/androidx/appcompat/graphics/drawable/DrawableContainer.java
deleted file mode 100644
index d3c9b9a..0000000
--- a/appcompat/resources/src/main/java/androidx/appcompat/graphics/drawable/DrawableContainer.java
+++ /dev/null
@@ -1,1211 +0,0 @@
-/*
- * Copyright (C) 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.appcompat.graphics.drawable;
-
-import static android.os.Build.VERSION_CODES.LOLLIPOP;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
-
-import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
-import android.content.res.ColorStateList;
-import android.content.res.Resources;
-import android.content.res.Resources.Theme;
-import android.graphics.Canvas;
-import android.graphics.ColorFilter;
-import android.graphics.Outline;
-import android.graphics.PixelFormat;
-import android.graphics.PorterDuff.Mode;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.os.Build;
-import android.os.SystemClock;
-import android.util.DisplayMetrics;
-import android.util.LayoutDirection;
-import android.util.SparseArray;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
-import androidx.annotation.RestrictTo;
-import androidx.core.graphics.drawable.DrawableCompat;
-
-/**
- * A helper class that contains several {@link Drawable}s and selects which one to use.
- *
- * Adapted from platform class, altered with API level checks as necessary.
- *
- * @hide
- */
-@RestrictTo(LIBRARY_GROUP_PREFIX)
-class DrawableContainer extends Drawable implements Drawable.Callback {
- private static final boolean DEBUG = false;
- private static final String TAG = "DrawableContainer";
- /**
- * To be proper, we should have a getter for dither (and alpha, etc.)
- * so that proxy classes like this can save/restore their delegates'
- * values, but we don't have getters. Since we do have setters
- * (e.g. setDither), which this proxy forwards on, we have to have some
- * default/initial setting.
- *
- * The initial setting for dither is now true, since it almost always seems
- * to improve the quality at negligible cost.
- */
- private static final boolean DEFAULT_DITHER = true;
- private DrawableContainerState mDrawableContainerState;
- private Rect mHotspotBounds;
- private Drawable mCurrDrawable;
- private Drawable mLastDrawable;
- private int mAlpha = 0xFF;
- /** Whether setAlpha() has been called at least once. */
- private boolean mHasAlpha;
- private int mCurIndex = -1;
- private int mLastIndex = -1;
- private boolean mMutated;
- // Animations.
- private Runnable mAnimationRunnable;
- private long mEnterAnimationEnd;
- private long mExitAnimationEnd;
- /** Callback that blocks invalidation. Used for drawable initialization. */
- private BlockInvalidateCallback mBlockInvalidateCallback;
-
- // overrides from Drawable
- @Override
- public void draw(@NonNull Canvas canvas) {
- if (mCurrDrawable != null) {
- mCurrDrawable.draw(canvas);
- }
- if (mLastDrawable != null) {
- mLastDrawable.draw(canvas);
- }
- }
-
- @Override
- public int getChangingConfigurations() {
- return super.getChangingConfigurations()
- | mDrawableContainerState.getChangingConfigurations();
- }
-
- // Remove BanTargetApiAnnotation suppression once b/120623677 is addressed.
- @SuppressLint({"WrongConstant", "BanTargetApiAnnotation"})
- @TargetApi(Build.VERSION_CODES.M)
- private boolean needsMirroring() {
- return isAutoMirrored() && getLayoutDirection() == LayoutDirection.RTL;
- }
-
- @Override
- public boolean getPadding(@NonNull Rect padding) {
- final Rect r = mDrawableContainerState.getConstantPadding();
- boolean result;
- if (r != null) {
- padding.set(r);
- result = (r.left | r.top | r.bottom | r.right) != 0;
- } else {
- if (mCurrDrawable != null) {
- result = mCurrDrawable.getPadding(padding);
- } else {
- result = super.getPadding(padding);
- }
- }
- if (needsMirroring()) {
- final int left = padding.left;
- final int right = padding.right;
- padding.left = right;
- padding.right = left;
- }
- return result;
- }
-
- @RequiresApi(LOLLIPOP)
- @Override
- public void getOutline(@NonNull Outline outline) {
- if (mCurrDrawable != null) {
- mCurrDrawable.getOutline(outline);
- }
- }
-
- @Override
- public void setAlpha(int alpha) {
- if (!mHasAlpha || mAlpha != alpha) {
- mHasAlpha = true;
- mAlpha = alpha;
- if (mCurrDrawable != null) {
- if (mEnterAnimationEnd == 0) {
- mCurrDrawable.setAlpha(alpha);
- } else {
- animate(false);
- }
- }
- }
- }
-
- @Override
- public int getAlpha() {
- return mAlpha;
- }
-
- @Override
- public void setDither(boolean dither) {
- if (mDrawableContainerState.mDither != dither) {
- mDrawableContainerState.mDither = dither;
- if (mCurrDrawable != null) {
- mCurrDrawable.setDither(mDrawableContainerState.mDither);
- }
- }
- }
-
- @Override
- public void setColorFilter(ColorFilter colorFilter) {
- mDrawableContainerState.mHasColorFilter = true;
- if (mDrawableContainerState.mColorFilter != colorFilter) {
- mDrawableContainerState.mColorFilter = colorFilter;
- if (mCurrDrawable != null) {
- mCurrDrawable.setColorFilter(colorFilter);
- }
- }
- }
-
- @Override
- public void setTintList(ColorStateList tint) {
- mDrawableContainerState.mHasTintList = true;
- if (mDrawableContainerState.mTintList != tint) {
- mDrawableContainerState.mTintList = tint;
- DrawableCompat.setTintList(mCurrDrawable, tint);
- }
- }
-
- @Override
- public void setTintMode(@NonNull Mode tintMode) {
- mDrawableContainerState.mHasTintMode = true;
- if (mDrawableContainerState.mTintMode != tintMode) {
- mDrawableContainerState.mTintMode = tintMode;
- DrawableCompat.setTintMode(mCurrDrawable, tintMode);
- }
- }
-
- /**
- * Change the global fade duration when a new drawable is entering
- * the scene.
- *
- * @param ms The amount of time to fade in milliseconds.
- */
- public void setEnterFadeDuration(int ms) {
- mDrawableContainerState.mEnterFadeDuration = ms;
- }
-
- /**
- * Change the global fade duration when a new drawable is leaving
- * the scene.
- *
- * @param ms The amount of time to fade in milliseconds.
- */
- public void setExitFadeDuration(int ms) {
- mDrawableContainerState.mExitFadeDuration = ms;
- }
-
- @Override
- protected void onBoundsChange(Rect bounds) {
- if (mLastDrawable != null) {
- mLastDrawable.setBounds(bounds);
- }
- if (mCurrDrawable != null) {
- mCurrDrawable.setBounds(bounds);
- }
- }
-
- @Override
- public boolean isStateful() {
- return mDrawableContainerState.isStateful();
- }
-
- @Override
- public void setAutoMirrored(boolean mirrored) {
- if (mDrawableContainerState.mAutoMirrored != mirrored) {
- mDrawableContainerState.mAutoMirrored = mirrored;
- if (mCurrDrawable != null) {
- DrawableCompat.setAutoMirrored(mCurrDrawable,
- mDrawableContainerState.mAutoMirrored);
- }
- }
- }
-
- @Override
- public boolean isAutoMirrored() {
- return mDrawableContainerState.mAutoMirrored;
- }
-
- @Override
- public void jumpToCurrentState() {
- boolean changed = false;
- if (mLastDrawable != null) {
- mLastDrawable.jumpToCurrentState();
- mLastDrawable = null;
- mLastIndex = -1;
- changed = true;
- }
- if (mCurrDrawable != null) {
- mCurrDrawable.jumpToCurrentState();
- if (mHasAlpha) {
- mCurrDrawable.setAlpha(mAlpha);
- }
- }
- if (mExitAnimationEnd != 0) {
- mExitAnimationEnd = 0;
- changed = true;
- }
- if (mEnterAnimationEnd != 0) {
- mEnterAnimationEnd = 0;
- changed = true;
- }
- if (changed) {
- invalidateSelf();
- }
- }
-
- @Override
- public void setHotspot(float x, float y) {
- if (mCurrDrawable != null) {
- DrawableCompat.setHotspot(mCurrDrawable, x, y);
- }
- }
-
- @Override
- public void setHotspotBounds(int left, int top, int right, int bottom) {
- if (mHotspotBounds == null) {
- mHotspotBounds = new Rect(left, top, right, bottom);
- } else {
- mHotspotBounds.set(left, top, right, bottom);
- }
- if (mCurrDrawable != null) {
- DrawableCompat.setHotspotBounds(mCurrDrawable, left, top, right, bottom);
- }
- }
-
- @Override
- public void getHotspotBounds(@NonNull Rect outRect) {
- if (mHotspotBounds != null) {
- outRect.set(mHotspotBounds);
- } else {
- super.getHotspotBounds(outRect);
- }
- }
-
- @Override
- protected boolean onStateChange(int[] state) {
- if (mLastDrawable != null) {
- return mLastDrawable.setState(state);
- }
- if (mCurrDrawable != null) {
- return mCurrDrawable.setState(state);
- }
- return false;
- }
-
- @Override
- protected boolean onLevelChange(int level) {
- if (mLastDrawable != null) {
- return mLastDrawable.setLevel(level);
- }
- if (mCurrDrawable != null) {
- return mCurrDrawable.setLevel(level);
- }
- return false;
- }
-
- @Override
- public boolean onLayoutDirectionChanged(int layoutDirection) {
- // Let the container handle setting its own layout direction. Otherwise,
- // we're accessing potentially unused states.
- return mDrawableContainerState.setLayoutDirection(layoutDirection, getCurrentIndex());
- }
-
- @Override
- public int getIntrinsicWidth() {
- if (mDrawableContainerState.isConstantSize()) {
- return mDrawableContainerState.getConstantWidth();
- }
- return mCurrDrawable != null ? mCurrDrawable.getIntrinsicWidth() : -1;
- }
-
- @Override
- public int getIntrinsicHeight() {
- if (mDrawableContainerState.isConstantSize()) {
- return mDrawableContainerState.getConstantHeight();
- }
- return mCurrDrawable != null ? mCurrDrawable.getIntrinsicHeight() : -1;
- }
-
- @Override
- public int getMinimumWidth() {
- if (mDrawableContainerState.isConstantSize()) {
- return mDrawableContainerState.getConstantMinimumWidth();
- }
- return mCurrDrawable != null ? mCurrDrawable.getMinimumWidth() : 0;
- }
-
- @Override
- public int getMinimumHeight() {
- if (mDrawableContainerState.isConstantSize()) {
- return mDrawableContainerState.getConstantMinimumHeight();
- }
- return mCurrDrawable != null ? mCurrDrawable.getMinimumHeight() : 0;
- }
-
- @Override
- public void invalidateDrawable(@NonNull Drawable who) {
- // This may have been called as the result of a tint changing, in
- // which case we may need to refresh the cached statefulness or
- // opacity.
- if (mDrawableContainerState != null) {
- mDrawableContainerState.invalidateCache();
- }
- if (who == mCurrDrawable && getCallback() != null) {
- getCallback().invalidateDrawable(this);
- }
- }
-
- @Override
- public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
- if (who == mCurrDrawable && getCallback() != null) {
- getCallback().scheduleDrawable(this, what, when);
- }
- }
-
- @Override
- public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
- if (who == mCurrDrawable && getCallback() != null) {
- getCallback().unscheduleDrawable(this, what);
- }
- }
-
- @Override
- public boolean setVisible(boolean visible, boolean restart) {
- boolean changed = super.setVisible(visible, restart);
- if (mLastDrawable != null) {
- mLastDrawable.setVisible(visible, restart);
- }
- if (mCurrDrawable != null) {
- mCurrDrawable.setVisible(visible, restart);
- }
- return changed;
- }
-
- @Override
- public int getOpacity() {
- return mCurrDrawable == null || !mCurrDrawable.isVisible() ? PixelFormat.TRANSPARENT :
- mDrawableContainerState.getOpacity();
- }
-
- void setCurrentIndex(int index) {
- selectDrawable(index);
- }
-
- int getCurrentIndex() {
- return mCurIndex;
- }
-
- /**
- * Sets the currently displayed drawable by index.
- * <p>
- * If an invalid index is specified, the current drawable will be set to
- * {@code null} and the index will be set to {@code -1}.
- *
- * @param index the index of the drawable to display
- * @return {@code true} if the drawable changed, {@code false} otherwise
- */
- boolean selectDrawable(int index) {
- if (index == mCurIndex) {
- return false;
- }
- final long now = SystemClock.uptimeMillis();
- if (DEBUG) {
- android.util.Log.i(TAG, toString() + " from " + mCurIndex + " to " + index
- + ": exit=" + mDrawableContainerState.mExitFadeDuration
- + " enter=" + mDrawableContainerState.mEnterFadeDuration);
- }
- if (mDrawableContainerState.mExitFadeDuration > 0) {
- if (mLastDrawable != null) {
- mLastDrawable.setVisible(false, false);
- }
- if (mCurrDrawable != null) {
- mLastDrawable = mCurrDrawable;
- mLastIndex = mCurIndex;
- mExitAnimationEnd = now + mDrawableContainerState.mExitFadeDuration;
- } else {
- mLastDrawable = null;
- mLastIndex = -1;
- mExitAnimationEnd = 0;
- }
- } else if (mCurrDrawable != null) {
- mCurrDrawable.setVisible(false, false);
- }
- if (index >= 0 && index < mDrawableContainerState.mNumChildren) {
- final Drawable d = mDrawableContainerState.getChild(index);
- mCurrDrawable = d;
- mCurIndex = index;
- if (d != null) {
- if (mDrawableContainerState.mEnterFadeDuration > 0) {
- mEnterAnimationEnd = now + mDrawableContainerState.mEnterFadeDuration;
- }
- initializeDrawableForDisplay(d);
- }
- } else {
- mCurrDrawable = null;
- mCurIndex = -1;
- }
- if (mEnterAnimationEnd != 0 || mExitAnimationEnd != 0) {
- if (mAnimationRunnable == null) {
- mAnimationRunnable = new Runnable() {
- @Override
- public void run() {
- animate(true);
- invalidateSelf();
- }
- };
- } else {
- unscheduleSelf(mAnimationRunnable);
- }
- // Compute first frame and schedule next animation.
- animate(true);
- }
- invalidateSelf();
- return true;
- }
-
- /**
- * Initializes a drawable for display in this container.
- *
- * @param d The drawable to initialize.
- */
- private void initializeDrawableForDisplay(Drawable d) {
- if (mBlockInvalidateCallback == null) {
- mBlockInvalidateCallback = new BlockInvalidateCallback();
- }
- // Temporary fix for suspending callbacks during initialization. We
- // don't want any of these setters causing an invalidate() since that
- // may call back into DrawableContainer.
- d.setCallback(mBlockInvalidateCallback.wrap(d.getCallback()));
- try {
- if (mDrawableContainerState.mEnterFadeDuration <= 0 && mHasAlpha) {
- d.setAlpha(mAlpha);
- }
- if (mDrawableContainerState.mHasColorFilter) {
- // Color filter always overrides tint.
- d.setColorFilter(mDrawableContainerState.mColorFilter);
- } else {
- if (mDrawableContainerState.mHasTintList) {
- DrawableCompat.setTintList(d, mDrawableContainerState.mTintList);
- }
- if (mDrawableContainerState.mHasTintMode) {
- DrawableCompat.setTintMode(d, mDrawableContainerState.mTintMode);
- }
- }
- d.setVisible(isVisible(), true);
- d.setDither(mDrawableContainerState.mDither);
- d.setState(getState());
- d.setLevel(getLevel());
- d.setBounds(getBounds());
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- d.setLayoutDirection(getLayoutDirection());
- }
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- d.setAutoMirrored(mDrawableContainerState.mAutoMirrored);
- }
- final Rect hotspotBounds = mHotspotBounds;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && hotspotBounds != null) {
- d.setHotspotBounds(hotspotBounds.left, hotspotBounds.top,
- hotspotBounds.right, hotspotBounds.bottom);
- }
- } finally {
- d.setCallback(mBlockInvalidateCallback.unwrap());
- }
- }
-
- void animate(boolean schedule) {
- mHasAlpha = true;
- final long now = SystemClock.uptimeMillis();
- boolean animating = false;
- if (mCurrDrawable != null) {
- if (mEnterAnimationEnd != 0) {
- if (mEnterAnimationEnd <= now) {
- mCurrDrawable.setAlpha(mAlpha);
- mEnterAnimationEnd = 0;
- } else {
- int animAlpha = (int) ((mEnterAnimationEnd - now) * 255)
- / mDrawableContainerState.mEnterFadeDuration;
- mCurrDrawable.setAlpha(((255 - animAlpha) * mAlpha) / 255);
- animating = true;
- }
- }
- } else {
- mEnterAnimationEnd = 0;
- }
- if (mLastDrawable != null) {
- if (mExitAnimationEnd != 0) {
- if (mExitAnimationEnd <= now) {
- mLastDrawable.setVisible(false, false);
- mLastDrawable = null;
- mLastIndex = -1;
- mExitAnimationEnd = 0;
- } else {
- int animAlpha = (int) ((mExitAnimationEnd - now) * 255)
- / mDrawableContainerState.mExitFadeDuration;
- mLastDrawable.setAlpha((animAlpha * mAlpha) / 255);
- animating = true;
- }
- }
- } else {
- mExitAnimationEnd = 0;
- }
- if (schedule && animating) {
- scheduleSelf(mAnimationRunnable, now + 1000 / 60);
- }
- }
-
- @NonNull
- @Override
- public Drawable getCurrent() {
- return mCurrDrawable;
- }
-
- /**
- * Updates the source density based on the resources used to inflate
- * density-dependent values. Implementing classes should call this method
- * during inflation.
- *
- * @param res the resources used to inflate density-dependent values
- */
- final void updateDensity(Resources res) {
- mDrawableContainerState.updateDensity(res);
- }
-
- @Override
- @RequiresApi(21)
- public void applyTheme(@NonNull Theme theme) {
- mDrawableContainerState.applyTheme(theme);
- }
-
- @Override
- @RequiresApi(21)
- public boolean canApplyTheme() {
- return mDrawableContainerState.canApplyTheme();
- }
-
- @Override
- public final ConstantState getConstantState() {
- if (mDrawableContainerState.canConstantState()) {
- mDrawableContainerState.mChangingConfigurations = getChangingConfigurations();
- return mDrawableContainerState;
- }
- return null;
- }
-
- @NonNull
- @Override
- public Drawable mutate() {
- if (!mMutated && super.mutate() == this) {
- final DrawableContainerState clone = cloneConstantState();
- clone.mutate();
- setConstantState(clone);
- mMutated = true;
- }
- return this;
- }
-
- /**
- * Returns a shallow copy of the container's constant state to be used as
- * the base state for {@link #mutate()}.
- *
- * @return a shallow copy of the constant state
- */
- DrawableContainerState cloneConstantState() {
- return mDrawableContainerState;
- }
-
- void clearMutated() {
- mDrawableContainerState.clearMutated();
- mMutated = false;
- }
-
- /**
- * A ConstantState that can contain several {@link Drawable}s.
- *
- * This class was made public to enable testing, and its visibility may change in a future
- * release.
- */
- abstract static class DrawableContainerState extends ConstantState {
- final DrawableContainer mOwner;
- Resources mSourceRes;
- int mDensity = DisplayMetrics.DENSITY_DEFAULT;
- int mChangingConfigurations;
- int mChildrenChangingConfigurations;
- SparseArray<ConstantState> mDrawableFutures;
- Drawable[] mDrawables;
- int mNumChildren;
- boolean mVariablePadding = false;
- boolean mCheckedPadding;
- Rect mConstantPadding;
- boolean mConstantSize = false;
- boolean mCheckedConstantSize;
- int mConstantWidth;
- int mConstantHeight;
- int mConstantMinimumWidth;
- int mConstantMinimumHeight;
- boolean mCheckedOpacity;
- int mOpacity;
- boolean mCheckedStateful;
- boolean mStateful;
- boolean mCheckedConstantState;
- boolean mCanConstantState;
- boolean mDither = DEFAULT_DITHER;
- boolean mMutated;
- int mLayoutDirection;
- int mEnterFadeDuration = 0;
- int mExitFadeDuration = 0;
- boolean mAutoMirrored;
- ColorFilter mColorFilter;
- boolean mHasColorFilter;
- ColorStateList mTintList;
- Mode mTintMode;
- boolean mHasTintList;
- boolean mHasTintMode;
-
- DrawableContainerState(DrawableContainerState orig, DrawableContainer owner,
- Resources res) {
- mOwner = owner;
- mSourceRes = res != null ? res : (orig != null ? orig.mSourceRes : null);
- mDensity = resolveDensity(res, orig != null ? orig.mDensity : 0);
- if (orig != null) {
- mChangingConfigurations = orig.mChangingConfigurations;
- mChildrenChangingConfigurations = orig.mChildrenChangingConfigurations;
- mCheckedConstantState = true;
- mCanConstantState = true;
- mVariablePadding = orig.mVariablePadding;
- mConstantSize = orig.mConstantSize;
- mDither = orig.mDither;
- mMutated = orig.mMutated;
- mLayoutDirection = orig.mLayoutDirection;
- mEnterFadeDuration = orig.mEnterFadeDuration;
- mExitFadeDuration = orig.mExitFadeDuration;
- mAutoMirrored = orig.mAutoMirrored;
- mColorFilter = orig.mColorFilter;
- mHasColorFilter = orig.mHasColorFilter;
- mTintList = orig.mTintList;
- mTintMode = orig.mTintMode;
- mHasTintList = orig.mHasTintList;
- mHasTintMode = orig.mHasTintMode;
- if (orig.mDensity == mDensity) {
- if (orig.mCheckedPadding) {
- mConstantPadding = new Rect(orig.mConstantPadding);
- mCheckedPadding = true;
- }
- if (orig.mCheckedConstantSize) {
- mConstantWidth = orig.mConstantWidth;
- mConstantHeight = orig.mConstantHeight;
- mConstantMinimumWidth = orig.mConstantMinimumWidth;
- mConstantMinimumHeight = orig.mConstantMinimumHeight;
- mCheckedConstantSize = true;
- }
- }
- if (orig.mCheckedOpacity) {
- mOpacity = orig.mOpacity;
- mCheckedOpacity = true;
- }
- if (orig.mCheckedStateful) {
- mStateful = orig.mStateful;
- mCheckedStateful = true;
- }
- // Postpone cloning children and futures until we're absolutely
- // sure that we're done computing values for the original state.
- final Drawable[] origDr = orig.mDrawables;
- mDrawables = new Drawable[origDr.length];
- mNumChildren = orig.mNumChildren;
- final SparseArray<ConstantState> origDf = orig.mDrawableFutures;
- if (origDf != null) {
- mDrawableFutures = origDf.clone();
- } else {
- mDrawableFutures = new SparseArray<>(mNumChildren);
- }
- // Create futures for drawables with constant states. If a
- // drawable doesn't have a constant state, then we can't clone
- // it and we'll have to reference the original.
- final int count = mNumChildren;
- for (int i = 0; i < count; i++) {
- if (origDr[i] != null) {
- final ConstantState cs = origDr[i].getConstantState();
- if (cs != null) {
- mDrawableFutures.put(i, cs);
- } else {
- mDrawables[i] = origDr[i];
- }
- }
- }
- } else {
- mDrawables = new Drawable[10];
- mNumChildren = 0;
- }
- }
-
- @Override
- public int getChangingConfigurations() {
- return mChangingConfigurations | mChildrenChangingConfigurations;
- }
-
- /**
- * Adds the drawable to the end of the list of contained drawables.
- *
- * @param dr the drawable to add
- * @return the position of the drawable within the container
- */
- public final int addChild(Drawable dr) {
- final int pos = mNumChildren;
- if (pos >= mDrawables.length) {
- growArray(pos, pos + 10);
- }
- dr.mutate();
- dr.setVisible(false, true);
- dr.setCallback(mOwner);
- mDrawables[pos] = dr;
- mNumChildren++;
- mChildrenChangingConfigurations |= dr.getChangingConfigurations();
- invalidateCache();
- mConstantPadding = null;
- mCheckedPadding = false;
- mCheckedConstantSize = false;
- mCheckedConstantState = false;
- return pos;
- }
-
- /**
- * Invalidates the cached opacity and statefulness.
- */
- void invalidateCache() {
- mCheckedOpacity = false;
- mCheckedStateful = false;
- }
-
- final int getCapacity() {
- return mDrawables.length;
- }
-
- private void createAllFutures() {
- if (mDrawableFutures != null) {
- final int futureCount = mDrawableFutures.size();
- for (int keyIndex = 0; keyIndex < futureCount; keyIndex++) {
- final int index = mDrawableFutures.keyAt(keyIndex);
- final ConstantState cs = mDrawableFutures.valueAt(keyIndex);
- mDrawables[index] = prepareDrawable(cs.newDrawable(mSourceRes));
- }
- mDrawableFutures = null;
- }
- }
-
- private Drawable prepareDrawable(Drawable child) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- child.setLayoutDirection(mLayoutDirection);
- }
- child = child.mutate();
- child.setCallback(mOwner);
- return child;
- }
-
- public final int getChildCount() {
- return mNumChildren;
- }
-
- /**
- * @return Child <code>drawable</code> at position <code>index</code>
- */
- public final Drawable getChild(int index) {
- final Drawable result = mDrawables[index];
- if (result != null) {
- return result;
- }
- // Prepare future drawable if necessary.
- if (mDrawableFutures != null) {
- final int keyIndex = mDrawableFutures.indexOfKey(index);
- if (keyIndex >= 0) {
- final ConstantState cs = mDrawableFutures.valueAt(keyIndex);
- final Drawable prepared = prepareDrawable(cs.newDrawable(mSourceRes));
- mDrawables[index] = prepared;
- mDrawableFutures.removeAt(keyIndex);
- if (mDrawableFutures.size() == 0) {
- mDrawableFutures = null;
- }
- return prepared;
- }
- }
- return null;
- }
-
- final boolean setLayoutDirection(int layoutDirection, int currentIndex) {
- boolean changed = false;
- // No need to call createAllFutures, since future drawables will
- // change layout direction when they are prepared.
- final int count = mNumChildren;
- final Drawable[] drawables = mDrawables;
- for (int i = 0; i < count; i++) {
- if (drawables[i] != null) {
- boolean childChanged = false;
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
- childChanged = drawables[i].setLayoutDirection(layoutDirection);
- }
- if (i == currentIndex) {
- changed = childChanged;
- }
- }
- }
- mLayoutDirection = layoutDirection;
- return changed;
- }
-
- /**
- * Updates the source density based on the resources used to inflate
- * density-dependent values.
- *
- * @param res the resources used to inflate density-dependent values
- */
- final void updateDensity(Resources res) {
- if (res != null) {
- mSourceRes = res;
- // The density may have changed since the last update (if any). Any
- // dimension-type attributes will need their default values scaled.
- final int targetDensity = resolveDensity(res, mDensity);
- final int sourceDensity = mDensity;
- mDensity = targetDensity;
- if (sourceDensity != targetDensity) {
- mCheckedConstantSize = false;
- mCheckedPadding = false;
- }
- }
- }
-
- @RequiresApi(LOLLIPOP)
- final void applyTheme(Theme theme) {
- if (theme != null) {
- createAllFutures();
- final int count = mNumChildren;
- final Drawable[] drawables = mDrawables;
- for (int i = 0; i < count; i++) {
- if (drawables[i] != null && drawables[i].canApplyTheme()) {
- drawables[i].applyTheme(theme);
- // Update cached mask of child changing configurations.
- mChildrenChangingConfigurations |= drawables[i].getChangingConfigurations();
- }
- }
- updateDensity(theme.getResources());
- }
- }
-
- @RequiresApi(LOLLIPOP)
- @Override
- public boolean canApplyTheme() {
- final int count = mNumChildren;
- final Drawable[] drawables = mDrawables;
- for (int i = 0; i < count; i++) {
- final Drawable d = drawables[i];
- if (d != null) {
- if (d.canApplyTheme()) {
- return true;
- }
- } else {
- final ConstantState future = mDrawableFutures.get(i);
- if (future != null && future.canApplyTheme()) {
- return true;
- }
- }
- }
- return false;
- }
-
- void mutate() {
- // No need to call createAllFutures, since future drawables will
- // mutate when they are prepared.
- final int count = mNumChildren;
- final Drawable[] drawables = mDrawables;
- for (int i = 0; i < count; i++) {
- if (drawables[i] != null) {
- drawables[i].mutate();
- }
- }
- mMutated = true;
- }
-
- final void clearMutated() {
- /*final int count = mNumChildren;
- final Drawable[] drawables = mDrawables;
- for (int i = 0; i < count; i++) {
- if (drawables[i] != null) {
- drawables[i].clearMutated();
- }
- }*/
- mMutated = false;
- }
-
- /**
- * A boolean value indicating whether to use the maximum padding value
- * of all frames in the set (false), or to use the padding value of the
- * frame being shown (true). Default value is false.
- */
- public final void setVariablePadding(boolean variable) {
- mVariablePadding = variable;
- }
-
- /**
- * @return The constant padding
- */
- public final Rect getConstantPadding() {
- if (mVariablePadding) {
- return null;
- }
- if ((mConstantPadding != null) || mCheckedPadding) {
- return mConstantPadding;
- }
- createAllFutures();
- Rect r = null;
- final Rect t = new Rect();
- final int count = mNumChildren;
- final Drawable[] drawables = mDrawables;
- for (int i = 0; i < count; i++) {
- if (drawables[i].getPadding(t)) {
- if (r == null) r = new Rect(0, 0, 0, 0);
- if (t.left > r.left) r.left = t.left;
- if (t.top > r.top) r.top = t.top;
- if (t.right > r.right) r.right = t.right;
- if (t.bottom > r.bottom) r.bottom = t.bottom;
- }
- }
- mCheckedPadding = true;
- return (mConstantPadding = r);
- }
-
- public final void setConstantSize(boolean constant) {
- mConstantSize = constant;
- }
-
- /**
- * If drawable has a constant size across all children
- */
- public final boolean isConstantSize() {
- return mConstantSize;
- }
-
- /**
- * The constant width across all children
- */
- public final int getConstantWidth() {
- if (!mCheckedConstantSize) {
- computeConstantSize();
- }
- return mConstantWidth;
- }
-
- /**
- * The constant height across all children
- */
- public final int getConstantHeight() {
- if (!mCheckedConstantSize) {
- computeConstantSize();
- }
- return mConstantHeight;
- }
-
- /**
- * The constant minimum width across all children
- */
- public final int getConstantMinimumWidth() {
- if (!mCheckedConstantSize) {
- computeConstantSize();
- }
- return mConstantMinimumWidth;
- }
-
- /**
- * The constant minimum height across all children
- */
- public final int getConstantMinimumHeight() {
- if (!mCheckedConstantSize) {
- computeConstantSize();
- }
- return mConstantMinimumHeight;
- }
-
- protected void computeConstantSize() {
- mCheckedConstantSize = true;
- createAllFutures();
- final int count = mNumChildren;
- final Drawable[] drawables = mDrawables;
- mConstantWidth = mConstantHeight = -1;
- mConstantMinimumWidth = mConstantMinimumHeight = 0;
- for (int i = 0; i < count; i++) {
- final Drawable dr = drawables[i];
- int s = dr.getIntrinsicWidth();
- if (s > mConstantWidth) mConstantWidth = s;
- s = dr.getIntrinsicHeight();
- if (s > mConstantHeight) mConstantHeight = s;
- s = dr.getMinimumWidth();
- if (s > mConstantMinimumWidth) mConstantMinimumWidth = s;
- s = dr.getMinimumHeight();
- if (s > mConstantMinimumHeight) mConstantMinimumHeight = s;
- }
- }
-
- public final void setEnterFadeDuration(int duration) {
- mEnterFadeDuration = duration;
- }
-
- public final int getEnterFadeDuration() {
- return mEnterFadeDuration;
- }
-
- public final void setExitFadeDuration(int duration) {
- mExitFadeDuration = duration;
- }
-
- public final int getExitFadeDuration() {
- return mExitFadeDuration;
- }
-
- /**
- * @return the resolved opacity of all child drawables.
- */
- public final int getOpacity() {
- if (mCheckedOpacity) {
- return mOpacity;
- }
- createAllFutures();
- final int count = mNumChildren;
- final Drawable[] drawables = mDrawables;
- int op = (count > 0) ? drawables[0].getOpacity() : PixelFormat.TRANSPARENT;
- for (int i = 1; i < count; i++) {
- op = Drawable.resolveOpacity(op, drawables[i].getOpacity());
- }
- mOpacity = op;
- mCheckedOpacity = true;
- return op;
- }
-
- /**
- * @return <code>true</code> if <b>any</b> child drawable is stateful.
- */
- public final boolean isStateful() {
- if (mCheckedStateful) {
- return mStateful;
- }
- createAllFutures();
- final int count = mNumChildren;
- final Drawable[] drawables = mDrawables;
- boolean isStateful = false;
- for (int i = 0; i < count; i++) {
- if (drawables[i].isStateful()) {
- isStateful = true;
- break;
- }
- }
- mStateful = isStateful;
- mCheckedStateful = true;
- return isStateful;
- }
-
- /**
- * Increase the size of the child drawable array.
- */
- public void growArray(int oldSize, int newSize) {
- Drawable[] newDrawables = new Drawable[newSize];
- System.arraycopy(mDrawables, 0, newDrawables, 0, oldSize);
- mDrawables = newDrawables;
- }
-
- /**
- * If all child drawables have a constant state
- */
- public synchronized boolean canConstantState() {
- if (mCheckedConstantState) {
- return mCanConstantState;
- }
- createAllFutures();
- mCheckedConstantState = true;
- final int count = mNumChildren;
- final Drawable[] drawables = mDrawables;
- for (int i = 0; i < count; i++) {
- if (drawables[i].getConstantState() == null) {
- mCanConstantState = false;
- return false;
- }
- }
- mCanConstantState = true;
- return true;
- }
- }
-
- void setConstantState(DrawableContainerState state) {
- mDrawableContainerState = state;
- // The locally cached drawables may have changed.
- if (mCurIndex >= 0) {
- mCurrDrawable = state.getChild(mCurIndex);
- if (mCurrDrawable != null) {
- initializeDrawableForDisplay(mCurrDrawable);
- }
- }
- // Clear out the last drawable. We don't have enough information to
- // propagate local state from the past.
- mLastIndex = -1;
- mLastDrawable = null;
- }
-
- /**
- * Callback that blocks drawable invalidation.
- */
- static class BlockInvalidateCallback implements Drawable.Callback {
- private Drawable.Callback mCallback;
-
- public BlockInvalidateCallback wrap(Drawable.Callback callback) {
- mCallback = callback;
- return this;
- }
-
- public Drawable.Callback unwrap() {
- final Drawable.Callback callback = mCallback;
- mCallback = null;
- return callback;
- }
-
- @Override
- public void invalidateDrawable(@NonNull Drawable who) {
- // Ignore invalidation.
- }
-
- @Override
- public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
- if (mCallback != null) {
- mCallback.scheduleDrawable(who, what, when);
- }
- }
-
- @Override
- public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
- if (mCallback != null) {
- mCallback.unscheduleDrawable(who, what);
- }
- }
- }
-
- static int resolveDensity(@Nullable Resources r, int parentDensity) {
- final int densityDpi = r == null ? parentDensity : r.getDisplayMetrics().densityDpi;
- return densityDpi == 0 ? DisplayMetrics.DENSITY_DEFAULT : densityDpi;
- }
-}
diff --git a/appcompat/resources/src/main/java/androidx/appcompat/graphics/drawable/DrawableWrapper.java b/appcompat/resources/src/main/java/androidx/appcompat/graphics/drawable/DrawableWrapper.java
deleted file mode 100644
index 9ac8845..0000000
--- a/appcompat/resources/src/main/java/androidx/appcompat/graphics/drawable/DrawableWrapper.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * 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.
- */
-
-package androidx.appcompat.graphics.drawable;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
-
-import android.content.res.ColorStateList;
-import android.graphics.Canvas;
-import android.graphics.ColorFilter;
-import android.graphics.PorterDuff;
-import android.graphics.Rect;
-import android.graphics.Region;
-import android.graphics.drawable.Drawable;
-import android.view.View;
-
-import androidx.annotation.RestrictTo;
-import androidx.core.graphics.drawable.DrawableCompat;
-
-/**
- * Drawable which delegates all calls to its wrapped {@link Drawable}.
- * <p>
- * The wrapped {@link Drawable} <em>must</em> be fully released from any {@link View}
- * before wrapping, otherwise internal {@link Callback} may be dropped.
- *
- * @hide
- */
-@RestrictTo(LIBRARY_GROUP_PREFIX)
-public class DrawableWrapper extends Drawable implements Drawable.Callback {
-
- private Drawable mDrawable;
-
- public DrawableWrapper(Drawable drawable) {
- setWrappedDrawable(drawable);
- }
-
- @Override
- public void draw(Canvas canvas) {
- mDrawable.draw(canvas);
- }
-
- @Override
- protected void onBoundsChange(Rect bounds) {
- mDrawable.setBounds(bounds);
- }
-
- @Override
- public void setChangingConfigurations(int configs) {
- mDrawable.setChangingConfigurations(configs);
- }
-
- @Override
- public int getChangingConfigurations() {
- return mDrawable.getChangingConfigurations();
- }
-
- @Override
- public void setDither(boolean dither) {
- mDrawable.setDither(dither);
- }
-
- @Override
- public void setFilterBitmap(boolean filter) {
- mDrawable.setFilterBitmap(filter);
- }
-
- @Override
- public void setAlpha(int alpha) {
- mDrawable.setAlpha(alpha);
- }
-
- @Override
- public void setColorFilter(ColorFilter cf) {
- mDrawable.setColorFilter(cf);
- }
-
- @Override
- public boolean isStateful() {
- return mDrawable.isStateful();
- }
-
- @Override
- public boolean setState(final int[] stateSet) {
- return mDrawable.setState(stateSet);
- }
-
- @Override
- public int[] getState() {
- return mDrawable.getState();
- }
-
- @Override
- public void jumpToCurrentState() {
- DrawableCompat.jumpToCurrentState(mDrawable);
- }
-
- @Override
- public Drawable getCurrent() {
- return mDrawable.getCurrent();
- }
-
- @Override
- public boolean setVisible(boolean visible, boolean restart) {
- return super.setVisible(visible, restart) || mDrawable.setVisible(visible, restart);
- }
-
- @Override
- public int getOpacity() {
- return mDrawable.getOpacity();
- }
-
- @Override
- public Region getTransparentRegion() {
- return mDrawable.getTransparentRegion();
- }
-
- @Override
- public int getIntrinsicWidth() {
- return mDrawable.getIntrinsicWidth();
- }
-
- @Override
- public int getIntrinsicHeight() {
- return mDrawable.getIntrinsicHeight();
- }
-
- @Override
- public int getMinimumWidth() {
- return mDrawable.getMinimumWidth();
- }
-
- @Override
- public int getMinimumHeight() {
- return mDrawable.getMinimumHeight();
- }
-
- @Override
- public boolean getPadding(Rect padding) {
- return mDrawable.getPadding(padding);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void invalidateDrawable(Drawable who) {
- invalidateSelf();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void scheduleDrawable(Drawable who, Runnable what, long when) {
- scheduleSelf(what, when);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void unscheduleDrawable(Drawable who, Runnable what) {
- unscheduleSelf(what);
- }
-
- @Override
- protected boolean onLevelChange(int level) {
- return mDrawable.setLevel(level);
- }
-
- @Override
- public void setAutoMirrored(boolean mirrored) {
- DrawableCompat.setAutoMirrored(mDrawable, mirrored);
- }
-
- @Override
- public boolean isAutoMirrored() {
- return DrawableCompat.isAutoMirrored(mDrawable);
- }
-
- @Override
- public void setTint(int tint) {
- DrawableCompat.setTint(mDrawable, tint);
- }
-
- @Override
- public void setTintList(ColorStateList tint) {
- DrawableCompat.setTintList(mDrawable, tint);
- }
-
- @Override
- public void setTintMode(PorterDuff.Mode tintMode) {
- DrawableCompat.setTintMode(mDrawable, tintMode);
- }
-
- @Override
- public void setHotspot(float x, float y) {
- DrawableCompat.setHotspot(mDrawable, x, y);
- }
-
- @Override
- public void setHotspotBounds(int left, int top, int right, int bottom) {
- DrawableCompat.setHotspotBounds(mDrawable, left, top, right, bottom);
- }
-
- public Drawable getWrappedDrawable() {
- return mDrawable;
- }
-
- public void setWrappedDrawable(Drawable drawable) {
- if (mDrawable != null) {
- mDrawable.setCallback(null);
- }
-
- mDrawable = drawable;
-
- if (drawable != null) {
- drawable.setCallback(this);
- }
- }
-}
diff --git a/appcompat/resources/src/main/java/androidx/appcompat/graphics/drawable/StateListDrawable.java b/appcompat/resources/src/main/java/androidx/appcompat/graphics/drawable/StateListDrawable.java
deleted file mode 100644
index 65a3878..0000000
--- a/appcompat/resources/src/main/java/androidx/appcompat/graphics/drawable/StateListDrawable.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * Copyright (C) 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.appcompat.graphics.drawable;
-
-import static android.os.Build.VERSION.SDK_INT;
-import static android.os.Build.VERSION_CODES.LOLLIPOP;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
-import static androidx.core.content.res.TypedArrayUtils.obtainAttributes;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.content.res.Resources.Theme;
-import android.content.res.TypedArray;
-import android.graphics.drawable.Drawable;
-import android.util.AttributeSet;
-import android.util.StateSet;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
-import androidx.annotation.RestrictTo;
-import androidx.appcompat.resources.R;
-import androidx.appcompat.widget.ResourceManagerInternal;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.IOException;
-import java.util.Arrays;
-
-/**
- * Lets you assign a number of graphic images to a single Drawable and swap out the visible item by
- * a string
- * ID value.
- *
- * <p>It can be defined in an XML file with the <code><selector></code> element.
- * Each state Drawable is defined in a nested <code><item></code> element. For more
- * information, see the guide to <a
- * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.</p>
- *
- * {@link android.R.attr#visible}
- * {@link android.R.attr#variablePadding}
- * {@link android.R.attr#constantSize}
- * {@link android.R.attr#state_focused}
- * {@link android.R.attr#state_window_focused}
- * {@link android.R.attr#state_enabled}
- * {@link android.R.attr#state_checkable}
- * {@link android.R.attr#state_checked}
- * {@link android.R.attr#state_selected}
- * {@link android.R.attr#state_activated}
- * {@link android.R.attr#state_active}
- * {@link android.R.attr#state_single}
- * {@link android.R.attr#state_first}
- * {@link android.R.attr#state_middle}
- * {@link android.R.attr#state_last}
- * {@link android.R.attr#state_pressed}
- *
- * Adapted from platform class; altered with API level checks as necessary & uses
- * {@link ResourceManagerInternal} for <code>Drawable</code> inflation.
- *
- * @hide
- */
-@RestrictTo(LIBRARY_GROUP_PREFIX)
-class StateListDrawable extends DrawableContainer {
- private static final String TAG = "StateListDrawable";
- private static final boolean DEBUG = false;
- private StateListState mStateListState;
- private boolean mMutated;
-
- StateListDrawable() {
- this(null, null);
- }
-
- /**
- * Add a new image/string ID to the set of images.
- *
- * @param stateSet - An array of resource Ids to associate with the image.
- * Switch to this image by calling setState().
- * @param drawable -The image to show.
- */
- public void addState(int[] stateSet, Drawable drawable) {
- if (drawable != null) {
- mStateListState.addStateSet(stateSet, drawable);
- // in case the new state matches our current state...
- onStateChange(getState());
- }
- }
-
- @Override
- public boolean isStateful() {
- return true;
- }
-
- @Override
- protected boolean onStateChange(int[] stateSet) {
- final boolean changed = super.onStateChange(stateSet);
- int idx = mStateListState.indexOfStateSet(stateSet);
- if (DEBUG) {
- android.util.Log.i(TAG, "onStateChange " + this + " states "
- + Arrays.toString(stateSet) + " found " + idx);
- }
- if (idx < 0) {
- idx = mStateListState.indexOfStateSet(StateSet.WILD_CARD);
- }
- return selectDrawable(idx) || changed;
- }
-
- /**
- * Inflate this Drawable from an XML resource optionally styled by a theme.
- * This can't be called more than once for each Drawable.
- *
- * @param r Resources used to resolve attribute values
- * @param parser XML parser from which to inflate this Drawable
- * @param attrs Base set of attribute values
- * @param theme Theme to apply, may be null
- * @throws XmlPullParserException
- * @throws IOException
- */
- public void inflate(
- @NonNull Context context,
- @NonNull Resources r,
- @NonNull XmlPullParser parser,
- @NonNull AttributeSet attrs,
- @Nullable Theme theme)
- throws XmlPullParserException, IOException {
- final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.StateListDrawable);
- setVisible(a.getBoolean(R.styleable.StateListDrawable_android_visible, true), true);
- updateStateFromTypedArray(a);
- updateDensity(r);
- a.recycle();
- inflateChildElements(context, r, parser, attrs, theme);
- onStateChange(getState());
- }
-
- /**
- * Updates the constant state from the values in the typed array.
- */
- private void updateStateFromTypedArray(TypedArray a) {
- final StateListState state = mStateListState;
- // Account for any configuration changes.
- if (SDK_INT >= LOLLIPOP) {
- state.mChangingConfigurations |= a.getChangingConfigurations();
- }
- state.mVariablePadding = a.getBoolean(
- R.styleable.StateListDrawable_android_variablePadding, state.mVariablePadding);
- state.mConstantSize = a.getBoolean(
- R.styleable.StateListDrawable_android_constantSize, state.mConstantSize);
- state.mEnterFadeDuration = a.getInt(
- R.styleable.StateListDrawable_android_enterFadeDuration, state.mEnterFadeDuration);
- state.mExitFadeDuration = a.getInt(
- R.styleable.StateListDrawable_android_exitFadeDuration, state.mExitFadeDuration);
- state.mDither = a.getBoolean(
- R.styleable.StateListDrawable_android_dither, state.mDither);
- }
-
- /**
- * Inflates child elements from XML.
- */
- private void inflateChildElements(Context context, Resources r,
- XmlPullParser parser, AttributeSet attrs,
- Theme theme) throws XmlPullParserException, IOException {
- final StateListState state = mStateListState;
- final int innerDepth = parser.getDepth() + 1;
- int type;
- int depth;
- while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
- && ((depth = parser.getDepth()) >= innerDepth
- || type != XmlPullParser.END_TAG)) {
- if (type != XmlPullParser.START_TAG) {
- continue;
- }
- if (depth > innerDepth || !parser.getName().equals("item")) {
- continue;
- }
- // This allows state list drawable item elements to be themed at
- // inflation time but does NOT make them work for Zygote preload.
- final TypedArray a = obtainAttributes(r, theme, attrs,
- R.styleable.StateListDrawableItem);
- Drawable dr = null;
- final int drawableId = a.getResourceId(
- R.styleable.StateListDrawableItem_android_drawable, -1);
- if (drawableId > 0) {
- dr = ResourceManagerInternal.get().getDrawable(context, drawableId);
- }
- a.recycle();
- final int[] states = extractStateSet(attrs);
- // Loading child elements modifies the state of the AttributeSet's
- // underlying parser, so it needs to happen after obtaining
- // attributes and extracting states.
- if (dr == null) {
- while ((type = parser.next()) == XmlPullParser.TEXT) {
- // no-op
- }
- if (type != XmlPullParser.START_TAG) {
- throw new XmlPullParserException(
- parser.getPositionDescription()
- + ": <item> tag requires a 'drawable' attribute or "
- + "child tag defining a drawable");
- }
- if (SDK_INT >= LOLLIPOP) {
- dr = Drawable.createFromXmlInner(r, parser, attrs, theme);
- } else {
- dr = Drawable.createFromXmlInner(r, parser, attrs);
- }
- }
- state.addStateSet(states, dr);
- }
- }
-
- /**
- * Extracts state_ attributes from an attribute set.
- *
- * @param attrs The attribute set.
- * @return An array of state_ attributes.
- */
- int[] extractStateSet(AttributeSet attrs) {
- int j = 0;
- final int numAttrs = attrs.getAttributeCount();
- int[] states = new int[numAttrs];
- for (int i = 0; i < numAttrs; i++) {
- final int stateResId = attrs.getAttributeNameResource(i);
- switch (stateResId) {
- case 0:
- break;
- case android.R.attr.drawable:
- case android.R.attr.id:
- // Ignore attributes from StateListDrawableItem and
- // AnimatedStateListDrawableItem.
- continue;
- default:
- states[j++] = attrs.getAttributeBooleanValue(i, false)
- ? stateResId : -stateResId;
- }
- }
- states = StateSet.trimStateSet(states, j);
- return states;
- }
-
- StateListState getStateListState() {
- return mStateListState;
- }
-
- /**
- * Gets the number of states contained in this drawable.
- *
- * @return The number of states contained in this drawable.
- * @see #getStateSet(int)
- * @see #getStateDrawable(int)
- */
- int getStateCount() {
- return mStateListState.getChildCount();
- }
-
- /**
- * Gets the state set at an index.
- *
- * @param index The index of the state set.
- * @return The state set at the index.
- * @see #getStateCount()
- * @see #getStateDrawable(int)
- */
- int[] getStateSet(int index) {
- return mStateListState.mStateSets[index];
- }
-
- /**
- * Gets the drawable at an index.
- *
- * @param index The index of the drawable.
- * @return The drawable at the index.
- * @see #getStateCount()
- * @see #getStateSet(int)
- */
- Drawable getStateDrawable(int index) {
- return mStateListState.getChild(index);
- }
-
- /**
- * Gets the index of the drawable with the provided state set.
- *
- * @param stateSet the state set to look up
- * @return the index of the provided state set, or -1 if not found
- * @see #getStateDrawable(int)
- * @see #getStateSet(int)
- */
- int getStateDrawableIndex(int[] stateSet) {
- return mStateListState.indexOfStateSet(stateSet);
- }
-
- @NonNull
- @Override
- public Drawable mutate() {
- if (!mMutated && super.mutate() == this) {
- mStateListState.mutate();
- mMutated = true;
- }
- return this;
- }
-
- @Override
- StateListState cloneConstantState() {
- return new StateListState(mStateListState, this, null);
- }
-
- @Override
- void clearMutated() {
- super.clearMutated();
- mMutated = false;
- }
-
- static class StateListState extends DrawableContainerState {
- int[][] mStateSets;
-
- StateListState(StateListState orig, StateListDrawable owner, Resources res) {
- super(orig, owner, res);
- if (orig != null) {
- // Perform a shallow copy and rely on mutate() to deep-copy.
- mStateSets = orig.mStateSets;
- } else {
- mStateSets = new int[getCapacity()][];
- }
- }
-
- @Override
- void mutate() {
- final int[][] stateSets = new int[mStateSets.length][];
- for (int i = mStateSets.length - 1; i >= 0; i--) {
- stateSets[i] = mStateSets[i] != null ? mStateSets[i].clone() : null;
- }
- mStateSets = stateSets;
- }
-
- int addStateSet(int[] stateSet, Drawable drawable) {
- final int pos = addChild(drawable);
- mStateSets[pos] = stateSet;
- return pos;
- }
-
- int indexOfStateSet(int[] stateSet) {
- final int[][] stateSets = mStateSets;
- final int count = getChildCount();
- for (int i = 0; i < count; i++) {
- if (StateSet.stateSetMatches(stateSets[i], stateSet)) {
- return i;
- }
- }
- return -1;
- }
-
- @NonNull
- @Override
- public Drawable newDrawable() {
- return new StateListDrawable(this, null);
- }
-
- @NonNull
- @Override
- public Drawable newDrawable(Resources res) {
- return new StateListDrawable(this, res);
- }
-
- @Override
- public void growArray(int oldSize, int newSize) {
- super.growArray(oldSize, newSize);
- final int[][] newStateSets = new int[newSize][];
- System.arraycopy(mStateSets, 0, newStateSets, 0, oldSize);
- mStateSets = newStateSets;
- }
- }
-
- @Override
- @RequiresApi(21)
- public void applyTheme(@NonNull Theme theme) {
- super.applyTheme(theme);
- onStateChange(getState());
- }
-
- @Override
- void setConstantState(@NonNull DrawableContainerState state) {
- super.setConstantState(state);
- if (state instanceof StateListState) {
- mStateListState = (StateListState) state;
- }
- }
-
- StateListDrawable(StateListState state, Resources res) {
- // Every state list drawable has its own constant state.
- final StateListState newState = new StateListState(state, this, res);
- setConstantState(newState);
- onStateChange(getState());
- }
-
- /**
- * This constructor exists so subclasses can avoid calling the default
- * constructor and setting up a StateListDrawable-specific constant state.
- */
- StateListDrawable(@Nullable StateListState state) {
- if (state != null) {
- setConstantState(state);
- }
- }
-}
diff --git a/appcompat/resources/src/main/java/androidx/appcompat/widget/DrawableUtils.java b/appcompat/resources/src/main/java/androidx/appcompat/widget/DrawableUtils.java
deleted file mode 100644
index 58b1d10..0000000
--- a/appcompat/resources/src/main/java/androidx/appcompat/widget/DrawableUtils.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * 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.
- */
-
-package androidx.appcompat.widget;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
-
-import android.graphics.PorterDuff;
-import android.graphics.Rect;
-import android.graphics.drawable.Drawable;
-import android.graphics.drawable.DrawableContainer;
-import android.graphics.drawable.GradientDrawable;
-import android.graphics.drawable.InsetDrawable;
-import android.graphics.drawable.LayerDrawable;
-import android.graphics.drawable.ScaleDrawable;
-import android.os.Build;
-import android.util.Log;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RestrictTo;
-import androidx.core.graphics.drawable.DrawableCompat;
-import androidx.core.graphics.drawable.WrappedDrawable;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-/** @hide */
-@RestrictTo(LIBRARY_GROUP_PREFIX)
-public class DrawableUtils {
- private static final int[] CHECKED_STATE_SET = new int[]{android.R.attr.state_checked};
- private static final int[] EMPTY_STATE_SET = new int[0];
-
- private static final String TAG = "DrawableUtils";
-
- public static final Rect INSETS_NONE = new Rect();
- private static Class<?> sInsetsClazz;
-
- private static final String VECTOR_DRAWABLE_CLAZZ_NAME
- = "android.graphics.drawable.VectorDrawable";
-
- static {
- if (Build.VERSION.SDK_INT >= 18) {
- try {
- sInsetsClazz = Class.forName("android.graphics.Insets");
- } catch (ClassNotFoundException e) {
- // Oh well...
- }
- }
- }
-
- private DrawableUtils() {}
-
- /**
- * Allows us to get the optical insets for a {@link Drawable}. Since this is hidden we need to
- * use reflection. Since the {@code Insets} class is hidden also, we return a Rect instead.
- */
- public static Rect getOpticalBounds(Drawable drawable) {
- if (sInsetsClazz != null) {
- try {
- // If the Drawable is wrapped, we need to manually unwrap it and process
- // the wrapped drawable.
- drawable = DrawableCompat.unwrap(drawable);
-
- final Method getOpticalInsetsMethod = drawable.getClass()
- .getMethod("getOpticalInsets");
- final Object insets = getOpticalInsetsMethod.invoke(drawable);
-
- if (insets != null) {
- // If the drawable has some optical insets, let's copy them into a Rect
- final Rect result = new Rect();
-
- for (Field field : sInsetsClazz.getFields()) {
- switch (field.getName()) {
- case "left":
- result.left = field.getInt(insets);
- break;
- case "top":
- result.top = field.getInt(insets);
- break;
- case "right":
- result.right = field.getInt(insets);
- break;
- case "bottom":
- result.bottom = field.getInt(insets);
- break;
- }
- }
- return result;
- }
- } catch (Exception e) {
- // Eugh, we hit some kind of reflection issue...
- Log.e(TAG, "Couldn't obtain the optical insets. Ignoring.");
- }
- }
-
- // If we reach here, either we're running on a device pre-v18, the Drawable didn't have
- // any optical insets, or a reflection issue, so we'll just return an empty rect
- return INSETS_NONE;
- }
-
- /**
- * Attempt the fix any issues in the given drawable, usually caused by platform bugs in the
- * implementation. This method should be call after retrieval from
- * {@link android.content.res.Resources} or a {@link android.content.res.TypedArray}.
- */
- static void fixDrawable(@NonNull final Drawable drawable) {
- if (Build.VERSION.SDK_INT == 21
- && VECTOR_DRAWABLE_CLAZZ_NAME.equals(drawable.getClass().getName())) {
- fixVectorDrawableTinting(drawable);
- }
- }
-
- /**
- * Some drawable implementations have problems with mutation. This method returns false if
- * there is a known issue in the given drawable's implementation.
- */
- public static boolean canSafelyMutateDrawable(@NonNull Drawable drawable) {
- if (Build.VERSION.SDK_INT < 15 && drawable instanceof InsetDrawable) {
- return false;
- } else if (Build.VERSION.SDK_INT < 15 && drawable instanceof GradientDrawable) {
- // GradientDrawable has a bug pre-ICS which results in mutate() resulting
- // in loss of color
- return false;
- } else if (Build.VERSION.SDK_INT < 17 && drawable instanceof LayerDrawable) {
- return false;
- }
-
- if (drawable instanceof DrawableContainer) {
- // If we have a DrawableContainer, let's traverse its child array
- final Drawable.ConstantState state = drawable.getConstantState();
- if (state instanceof DrawableContainer.DrawableContainerState) {
- final DrawableContainer.DrawableContainerState containerState =
- (DrawableContainer.DrawableContainerState) state;
- for (final Drawable child : containerState.getChildren()) {
- if (!canSafelyMutateDrawable(child)) {
- return false;
- }
- }
- }
- } else if (drawable instanceof WrappedDrawable) {
- return canSafelyMutateDrawable(
- ((WrappedDrawable) drawable)
- .getWrappedDrawable());
- } else if (drawable instanceof androidx.appcompat.graphics.drawable.DrawableWrapper) {
- return canSafelyMutateDrawable(
- ((androidx.appcompat.graphics.drawable.DrawableWrapper) drawable)
- .getWrappedDrawable());
- } else if (drawable instanceof ScaleDrawable) {
- return canSafelyMutateDrawable(((ScaleDrawable) drawable).getDrawable());
- }
-
- return true;
- }
-
- /**
- * VectorDrawable has an issue on API 21 where it sometimes doesn't create its tint filter.
- * Fixed by toggling its state to force a filter creation.
- */
- private static void fixVectorDrawableTinting(final Drawable drawable) {
- final int[] originalState = drawable.getState();
- if (originalState == null || originalState.length == 0) {
- // The drawable doesn't have a state, so set it to be checked
- drawable.setState(CHECKED_STATE_SET);
- } else {
- // Else the drawable does have a state, so clear it
- drawable.setState(EMPTY_STATE_SET);
- }
- // Now set the original state
- drawable.setState(originalState);
- }
-
- /**
- * Parses tint mode.
- */
- public static PorterDuff.Mode parseTintMode(int value, PorterDuff.Mode defaultMode) {
- switch (value) {
- case 3: return PorterDuff.Mode.SRC_OVER;
- case 5: return PorterDuff.Mode.SRC_IN;
- case 9: return PorterDuff.Mode.SRC_ATOP;
- case 14: return PorterDuff.Mode.MULTIPLY;
- case 15: return PorterDuff.Mode.SCREEN;
- case 16: return PorterDuff.Mode.ADD;
- default: return defaultMode;
- }
- }
-
-}
diff --git a/appcompat/resources/src/main/java/androidx/appcompat/widget/ResourceManagerInternal.java b/appcompat/resources/src/main/java/androidx/appcompat/widget/ResourceManagerInternal.java
deleted file mode 100644
index cb58acd..0000000
--- a/appcompat/resources/src/main/java/androidx/appcompat/widget/ResourceManagerInternal.java
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
- * Copyright (C) 2019 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.appcompat.widget;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.content.res.ColorStateList;
-import android.content.res.Resources;
-import android.graphics.Color;
-import android.graphics.PorterDuff;
-import android.graphics.PorterDuffColorFilter;
-import android.graphics.drawable.Drawable;
-import android.graphics.drawable.Drawable.ConstantState;
-import android.os.Build;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.util.TypedValue;
-import android.util.Xml;
-
-import androidx.annotation.DrawableRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
-import androidx.annotation.RestrictTo;
-import androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat;
-import androidx.appcompat.resources.R;
-import androidx.collection.ArrayMap;
-import androidx.collection.LongSparseArray;
-import androidx.collection.LruCache;
-import androidx.collection.SparseArrayCompat;
-import androidx.core.content.ContextCompat;
-import androidx.core.graphics.drawable.DrawableCompat;
-import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;
-import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.lang.ref.WeakReference;
-import java.util.WeakHashMap;
-
-/**
- * @hide
- */
-@RestrictTo(LIBRARY_GROUP_PREFIX)
-public final class ResourceManagerInternal {
- /** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- interface ResourceManagerHooks {
- Drawable createDrawableFor(@NonNull ResourceManagerInternal appCompatDrawableManager,
- @NonNull Context context, @DrawableRes final int resId);
- boolean tintDrawable(@NonNull Context context, @DrawableRes int resId,
- @NonNull Drawable drawable);
- ColorStateList getTintListForDrawableRes(@NonNull Context context, @DrawableRes int resId);
- boolean tintDrawableUsingColorFilter(@NonNull Context context,
- @DrawableRes final int resId, @NonNull Drawable drawable);
- PorterDuff.Mode getTintModeForDrawableRes(final int resId);
- }
-
- private interface InflateDelegate {
- Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser,
- @NonNull AttributeSet attrs, @Nullable Resources.Theme theme);
- }
-
- private static final String TAG = "ResourceManagerInternal";
- private static final boolean DEBUG = false;
- private static final PorterDuff.Mode DEFAULT_MODE = PorterDuff.Mode.SRC_IN;
- private static final String SKIP_DRAWABLE_TAG = "appcompat_skip_skip";
-
- private static final String PLATFORM_VD_CLAZZ = "android.graphics.drawable.VectorDrawable";
-
- private static ResourceManagerInternal INSTANCE;
-
- /**
- * Returns the singleton instance of this class.
- */
- public static synchronized ResourceManagerInternal get() {
- if (INSTANCE == null) {
- INSTANCE = new ResourceManagerInternal();
- installDefaultInflateDelegates(INSTANCE);
- }
- return INSTANCE;
- }
-
- private static void installDefaultInflateDelegates(@NonNull ResourceManagerInternal manager) {
- // This sdk version check will affect src:appCompat code path.
- // Although VectorDrawable exists in Android framework from Lollipop, AppCompat will use
- // (Animated)VectorDrawableCompat before Nougat to utilize bug fixes & feature backports.
- if (Build.VERSION.SDK_INT < 24) {
- manager.addDelegate("vector", new VdcInflateDelegate());
- manager.addDelegate("animated-vector", new AvdcInflateDelegate());
- manager.addDelegate("animated-selector", new AsldcInflateDelegate());
- }
- }
-
- private static final ColorFilterLruCache COLOR_FILTER_CACHE = new ColorFilterLruCache(6);
-
- private WeakHashMap<Context, SparseArrayCompat<ColorStateList>> mTintLists;
- private ArrayMap<String, InflateDelegate> mDelegates;
- private SparseArrayCompat<String> mKnownDrawableIdTags;
-
- private final WeakHashMap<Context, LongSparseArray<WeakReference<ConstantState>>>
- mDrawableCaches = new WeakHashMap<>(0);
-
- private TypedValue mTypedValue;
-
- private boolean mHasCheckedVectorDrawableSetup;
-
- private ResourceManagerHooks mHooks;
-
- public synchronized void setHooks(ResourceManagerHooks hooks) {
- mHooks = hooks;
- }
-
- public synchronized Drawable getDrawable(@NonNull Context context, @DrawableRes int resId) {
- return getDrawable(context, resId, false);
- }
-
- synchronized Drawable getDrawable(@NonNull Context context, @DrawableRes int resId,
- boolean failIfNotKnown) {
- checkVectorDrawableSetup(context);
-
- Drawable drawable = loadDrawableFromDelegates(context, resId);
- if (drawable == null) {
- drawable = createDrawableIfNeeded(context, resId);
- }
- if (drawable == null) {
- drawable = ContextCompat.getDrawable(context, resId);
- }
-
- if (drawable != null) {
- // Tint it if needed
- drawable = tintDrawable(context, resId, failIfNotKnown, drawable);
- }
- if (drawable != null) {
- // See if we need to 'fix' the drawable
- DrawableUtils.fixDrawable(drawable);
- }
- return drawable;
- }
-
- public synchronized void onConfigurationChanged(@NonNull Context context) {
- LongSparseArray<WeakReference<ConstantState>> cache = mDrawableCaches.get(context);
- if (cache != null) {
- // Crude, but we'll just clear the cache when the configuration changes
- cache.clear();
- }
- }
-
- private static long createCacheKey(TypedValue tv) {
- return (((long) tv.assetCookie) << 32) | tv.data;
- }
-
- private Drawable createDrawableIfNeeded(@NonNull Context context,
- @DrawableRes final int resId) {
- if (mTypedValue == null) {
- mTypedValue = new TypedValue();
- }
- final TypedValue tv = mTypedValue;
- context.getResources().getValue(resId, tv, true);
- final long key = createCacheKey(tv);
-
- Drawable dr = getCachedDrawable(context, key);
- if (dr != null) {
- // If we got a cached drawable, return it
- return dr;
- }
-
- // Else we need to try and create one...
- dr = (this.mHooks == null) ? null
- : this.mHooks.createDrawableFor(this, context, resId);
-
- if (dr != null) {
- dr.setChangingConfigurations(tv.changingConfigurations);
- // If we reached here then we created a new drawable, add it to the cache
- addDrawableToCache(context, key, dr);
- }
-
- return dr;
- }
-
- private Drawable tintDrawable(@NonNull Context context, @DrawableRes int resId,
- boolean failIfNotKnown, @NonNull Drawable drawable) {
- final ColorStateList tintList = getTintList(context, resId);
- if (tintList != null) {
- // First mutate the Drawable, then wrap it and set the tint list
- if (DrawableUtils.canSafelyMutateDrawable(drawable)) {
- drawable = drawable.mutate();
- }
- drawable = DrawableCompat.wrap(drawable);
- DrawableCompat.setTintList(drawable, tintList);
-
- // If there is a blending mode specified for the drawable, use it
- final PorterDuff.Mode tintMode = getTintMode(resId);
- if (tintMode != null) {
- DrawableCompat.setTintMode(drawable, tintMode);
- }
- } else if ((mHooks != null) && mHooks.tintDrawable(context, resId, drawable)) {
- // If we're here, the installed hooks reported successful tinting of the
- // specific drawable
- } else {
- final boolean tinted = tintDrawableUsingColorFilter(context, resId, drawable);
- if (!tinted && failIfNotKnown) {
- // If we didn't tint using a ColorFilter, and we're set to fail if we don't
- // know the id, return null
- drawable = null;
- }
- }
- return drawable;
- }
-
- private Drawable loadDrawableFromDelegates(@NonNull Context context, @DrawableRes int resId) {
- if (mDelegates != null && !mDelegates.isEmpty()) {
- if (mKnownDrawableIdTags != null) {
- final String cachedTagName = mKnownDrawableIdTags.get(resId);
- if (SKIP_DRAWABLE_TAG.equals(cachedTagName)
- || (cachedTagName != null && mDelegates.get(cachedTagName) == null)) {
- // If we don't have a delegate for the drawable tag, or we've been set to
- // skip it, fail fast and return null
- if (DEBUG) {
- Log.d(TAG, "[loadDrawableFromDelegates] Skipping drawable: "
- + context.getResources().getResourceName(resId));
- }
- return null;
- }
- } else {
- // Create an id cache as we'll need one later
- mKnownDrawableIdTags = new SparseArrayCompat<>();
- }
-
- if (mTypedValue == null) {
- mTypedValue = new TypedValue();
- }
- final TypedValue tv = mTypedValue;
- final Resources res = context.getResources();
- res.getValue(resId, tv, true);
-
- final long key = createCacheKey(tv);
-
- Drawable dr = getCachedDrawable(context, key);
- if (dr != null) {
- if (DEBUG) {
- Log.i(TAG, "[loadDrawableFromDelegates] Returning cached drawable: " +
- context.getResources().getResourceName(resId));
- }
- // We have a cached drawable, return it!
- return dr;
- }
-
- if (tv.string != null && tv.string.toString().endsWith(".xml")) {
- // If the resource is an XML file, let's try and parse it
- try {
- @SuppressLint("ResourceType") final XmlPullParser parser = res.getXml(resId);
- final AttributeSet attrs = Xml.asAttributeSet(parser);
- int type;
- while ((type = parser.next()) != XmlPullParser.START_TAG &&
- type != XmlPullParser.END_DOCUMENT) {
- // Empty loop
- }
- if (type != XmlPullParser.START_TAG) {
- throw new XmlPullParserException("No start tag found");
- }
-
- final String tagName = parser.getName();
- // Add the tag name to the cache
- mKnownDrawableIdTags.append(resId, tagName);
-
- // Now try and find a delegate for the tag name and inflate if found
- final InflateDelegate delegate = mDelegates.get(tagName);
- if (delegate != null) {
- dr = delegate.createFromXmlInner(context, parser, attrs,
- context.getTheme());
- }
- if (dr != null) {
- // Add it to the drawable cache
- dr.setChangingConfigurations(tv.changingConfigurations);
- if (addDrawableToCache(context, key, dr) && DEBUG) {
- Log.i(TAG, "[loadDrawableFromDelegates] Saved drawable to cache: " +
- context.getResources().getResourceName(resId));
- }
- }
- } catch (Exception e) {
- Log.e(TAG, "Exception while inflating drawable", e);
- }
- }
- if (dr == null) {
- // If we reach here then the delegate inflation of the resource failed. Mark it as
- // bad so we skip the id next time
- mKnownDrawableIdTags.append(resId, SKIP_DRAWABLE_TAG);
- }
- return dr;
- }
-
- return null;
- }
-
- private synchronized Drawable getCachedDrawable(@NonNull final Context context,
- final long key) {
- final LongSparseArray<WeakReference<ConstantState>> cache = mDrawableCaches.get(context);
- if (cache == null) {
- return null;
- }
-
- final WeakReference<ConstantState> wr = cache.get(key);
- if (wr != null) {
- // We have the key, and the secret
- ConstantState entry = wr.get();
- if (entry != null) {
- return entry.newDrawable(context.getResources());
- } else {
- // Our entry has been purged
- cache.delete(key);
- }
- }
- return null;
- }
-
- private synchronized boolean addDrawableToCache(@NonNull final Context context, final long key,
- @NonNull final Drawable drawable) {
- final ConstantState cs = drawable.getConstantState();
- if (cs != null) {
- LongSparseArray<WeakReference<ConstantState>> cache = mDrawableCaches.get(context);
- if (cache == null) {
- cache = new LongSparseArray<>();
- mDrawableCaches.put(context, cache);
- }
- cache.put(key, new WeakReference<>(cs));
- return true;
- }
- return false;
- }
-
- synchronized Drawable onDrawableLoadedFromResources(@NonNull Context context,
- @NonNull VectorEnabledTintResources resources, @DrawableRes final int resId) {
- Drawable drawable = loadDrawableFromDelegates(context, resId);
- if (drawable == null) {
- drawable = resources.superGetDrawable(resId);
- }
- if (drawable != null) {
- return tintDrawable(context, resId, false, drawable);
- }
- return null;
- }
-
- boolean tintDrawableUsingColorFilter(@NonNull Context context,
- @DrawableRes final int resId, @NonNull Drawable drawable) {
- return (mHooks != null) && mHooks.tintDrawableUsingColorFilter(context, resId, drawable);
- }
-
- private void addDelegate(@NonNull String tagName, @NonNull InflateDelegate delegate) {
- if (mDelegates == null) {
- mDelegates = new ArrayMap<>();
- }
- mDelegates.put(tagName, delegate);
- }
-
- private void removeDelegate(@NonNull String tagName, @NonNull InflateDelegate delegate) {
- if (mDelegates != null && mDelegates.get(tagName) == delegate) {
- mDelegates.remove(tagName);
- }
- }
-
- private static boolean arrayContains(int[] array, int value) {
- for (int id : array) {
- if (id == value) {
- return true;
- }
- }
- return false;
- }
-
- PorterDuff.Mode getTintMode(final int resId) {
- return (mHooks == null) ? null : mHooks.getTintModeForDrawableRes(resId);
- }
-
- synchronized ColorStateList getTintList(@NonNull Context context, @DrawableRes int resId) {
- // Try the cache first (if it exists)
- ColorStateList tint = getTintListFromCache(context, resId);
-
- if (tint == null) {
- // ...if the cache did not contain a color state list, try and create one
- tint = (mHooks == null) ? null : mHooks.getTintListForDrawableRes(context, resId);
-
- if (tint != null) {
- addTintListToCache(context, resId, tint);
- }
- }
- return tint;
- }
-
- private ColorStateList getTintListFromCache(@NonNull Context context, @DrawableRes int resId) {
- if (mTintLists != null) {
- final SparseArrayCompat<ColorStateList> tints = mTintLists.get(context);
- return tints != null ? tints.get(resId) : null;
- }
- return null;
- }
-
- private void addTintListToCache(@NonNull Context context, @DrawableRes int resId,
- @NonNull ColorStateList tintList) {
- if (mTintLists == null) {
- mTintLists = new WeakHashMap<>();
- }
- SparseArrayCompat<ColorStateList> themeTints = mTintLists.get(context);
- if (themeTints == null) {
- themeTints = new SparseArrayCompat<>();
- mTintLists.put(context, themeTints);
- }
- themeTints.append(resId, tintList);
- }
-
- private static class ColorFilterLruCache extends LruCache<Integer, PorterDuffColorFilter> {
-
- public ColorFilterLruCache(int maxSize) {
- super(maxSize);
- }
-
- PorterDuffColorFilter get(int color, PorterDuff.Mode mode) {
- return get(generateCacheKey(color, mode));
- }
-
- PorterDuffColorFilter put(int color, PorterDuff.Mode mode, PorterDuffColorFilter filter) {
- return put(generateCacheKey(color, mode), filter);
- }
-
- private static int generateCacheKey(int color, PorterDuff.Mode mode) {
- int hashCode = 1;
- hashCode = 31 * hashCode + color;
- hashCode = 31 * hashCode + mode.hashCode();
- return hashCode;
- }
- }
-
- static void tintDrawable(Drawable drawable, TintInfo tint, int[] state) {
- if (DrawableUtils.canSafelyMutateDrawable(drawable)
- && drawable.mutate() != drawable) {
- Log.d(TAG, "Mutated drawable is not the same instance as the input.");
- return;
- }
-
- if (tint.mHasTintList || tint.mHasTintMode) {
- drawable.setColorFilter(createTintFilter(
- tint.mHasTintList ? tint.mTintList : null,
- tint.mHasTintMode ? tint.mTintMode : DEFAULT_MODE,
- state));
- } else {
- drawable.clearColorFilter();
- }
-
- if (Build.VERSION.SDK_INT <= 23) {
- // Pre-v23 there is no guarantee that a state change will invoke an invalidation,
- // so we force it ourselves
- drawable.invalidateSelf();
- }
- }
-
- private static PorterDuffColorFilter createTintFilter(ColorStateList tint,
- PorterDuff.Mode tintMode, final int[] state) {
- if (tint == null || tintMode == null) {
- return null;
- }
- final int color = tint.getColorForState(state, Color.TRANSPARENT);
- return getPorterDuffColorFilter(color, tintMode);
- }
-
- public static synchronized PorterDuffColorFilter getPorterDuffColorFilter(
- int color, PorterDuff.Mode mode) {
- // First, let's see if the cache already contains the color filter
- PorterDuffColorFilter filter = COLOR_FILTER_CACHE.get(color, mode);
-
- if (filter == null) {
- // Cache miss, so create a color filter and add it to the cache
- filter = new PorterDuffColorFilter(color, mode);
- COLOR_FILTER_CACHE.put(color, mode, filter);
- }
-
- return filter;
- }
-
- private void checkVectorDrawableSetup(@NonNull Context context) {
- if (mHasCheckedVectorDrawableSetup) {
- // We've already checked so return now...
- return;
- }
- // Here we will check that a known Vector drawable resource inside AppCompat can be
- // correctly decoded
- mHasCheckedVectorDrawableSetup = true;
- final Drawable d = getDrawable(context, R.drawable.abc_vector_test);
- if (d == null || !isVectorDrawable(d)) {
- mHasCheckedVectorDrawableSetup = false;
- throw new IllegalStateException("This app has been built with an incorrect "
- + "configuration. Please configure your build for VectorDrawableCompat.");
- }
- }
-
- private static boolean isVectorDrawable(@NonNull Drawable d) {
- return d instanceof VectorDrawableCompat
- || PLATFORM_VD_CLAZZ.equals(d.getClass().getName());
- }
-
- private static class VdcInflateDelegate implements InflateDelegate {
- VdcInflateDelegate() {
- }
-
- @Override
- public Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser,
- @NonNull AttributeSet attrs, @Nullable Resources.Theme theme) {
- try {
- return VectorDrawableCompat
- .createFromXmlInner(context.getResources(), parser, attrs, theme);
- } catch (Exception e) {
- Log.e("VdcInflateDelegate", "Exception while inflating <vector>", e);
- return null;
- }
- }
- }
-
- private static class AvdcInflateDelegate implements InflateDelegate {
- AvdcInflateDelegate() {
- }
-
- @Override
- public Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser,
- @NonNull AttributeSet attrs, @Nullable Resources.Theme theme) {
- try {
- return AnimatedVectorDrawableCompat
- .createFromXmlInner(context, context.getResources(), parser, attrs, theme);
- } catch (Exception e) {
- Log.e("AvdcInflateDelegate", "Exception while inflating <animated-vector>", e);
- return null;
- }
- }
- }
-
- @RequiresApi(11)
- static class AsldcInflateDelegate implements InflateDelegate {
- @Override
- public Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser,
- @NonNull AttributeSet attrs, @Nullable Resources.Theme theme) {
- try {
- return AnimatedStateListDrawableCompat
- .createFromXmlInner(context, context.getResources(), parser, attrs, theme);
- } catch (Exception e) {
- Log.e("AsldcInflateDelegate", "Exception while inflating <animated-selector>", e);
- return null;
- }
- }
- }
-}
diff --git a/appcompat/resources/src/main/java/androidx/appcompat/widget/TintContextWrapper.java b/appcompat/resources/src/main/java/androidx/appcompat/widget/TintContextWrapper.java
deleted file mode 100644
index e62f22b3..0000000
--- a/appcompat/resources/src/main/java/androidx/appcompat/widget/TintContextWrapper.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2015 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.appcompat.widget;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
-
-import android.content.Context;
-import android.content.ContextWrapper;
-import android.content.res.AssetManager;
-import android.content.res.Resources;
-import android.os.Build;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RestrictTo;
-
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-
-/**
- * A {@link android.content.ContextWrapper} which returns a tint-aware
- * {@link android.content.res.Resources} instance from {@link #getResources()}.
- *
- * @hide
- */
-@RestrictTo(LIBRARY_GROUP_PREFIX)
-public class TintContextWrapper extends ContextWrapper {
-
- private static final Object CACHE_LOCK = new Object();
- private static ArrayList<WeakReference<TintContextWrapper>> sCache;
-
- public static Context wrap(@NonNull final Context context) {
- if (shouldWrap(context)) {
- synchronized (CACHE_LOCK) {
- if (sCache == null) {
- sCache = new ArrayList<>();
- } else {
- // This is a convenient place to prune any dead reference entries
- for (int i = sCache.size() - 1; i >= 0; i--) {
- final WeakReference<TintContextWrapper> ref = sCache.get(i);
- if (ref == null || ref.get() == null) {
- sCache.remove(i);
- }
- }
- // Now check our instance cache
- for (int i = sCache.size() - 1; i >= 0; i--) {
- final WeakReference<TintContextWrapper> ref = sCache.get(i);
- final TintContextWrapper wrapper = ref != null ? ref.get() : null;
- if (wrapper != null && wrapper.getBaseContext() == context) {
- return wrapper;
- }
- }
- }
- // If we reach here then the cache didn't have a hit, so create a new instance
- // and add it to the cache
- final TintContextWrapper wrapper = new TintContextWrapper(context);
- sCache.add(new WeakReference<>(wrapper));
- return wrapper;
- }
- }
- return context;
- }
-
- private static boolean shouldWrap(@NonNull final Context context) {
- if (context instanceof TintContextWrapper
- || context.getResources() instanceof TintResources
- || context.getResources() instanceof VectorEnabledTintResources) {
- // If the Context already has a TintResources[Experimental] impl, no need to wrap again
- // If the Context is already a TintContextWrapper, no need to wrap again
- return false;
- }
- return Build.VERSION.SDK_INT < 21 || VectorEnabledTintResources.shouldBeUsed();
- }
-
- private final Resources mResources;
- private final Resources.Theme mTheme;
-
- private TintContextWrapper(@NonNull final Context base) {
- super(base);
-
- if (VectorEnabledTintResources.shouldBeUsed()) {
- // We need to create a copy of the Theme so that the Theme references our
- // new Resources instance
- mResources = new VectorEnabledTintResources(this, base.getResources());
- mTheme = mResources.newTheme();
- mTheme.setTo(base.getTheme());
- } else {
- mResources = new TintResources(this, base.getResources());
- mTheme = null;
- }
- }
-
- @Override
- public Resources.Theme getTheme() {
- return mTheme == null ? super.getTheme() : mTheme;
- }
-
- @Override
- public void setTheme(int resid) {
- if (mTheme == null) {
- super.setTheme(resid);
- } else {
- mTheme.applyStyle(resid, true);
- }
- }
-
- @Override
- public Resources getResources() {
- return mResources;
- }
-
- @Override
- public AssetManager getAssets() {
- // Ensure we're returning assets with the correct configuration.
- return mResources.getAssets();
- }
-}
\ No newline at end of file
diff --git a/appcompat/resources/src/main/java/androidx/appcompat/widget/TintInfo.java b/appcompat/resources/src/main/java/androidx/appcompat/widget/TintInfo.java
deleted file mode 100644
index 23c577b..0000000
--- a/appcompat/resources/src/main/java/androidx/appcompat/widget/TintInfo.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.
- */
-
-package androidx.appcompat.widget;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
-
-import android.content.res.ColorStateList;
-import android.graphics.PorterDuff;
-
-import androidx.annotation.RestrictTo;
-
-/** @hide */
-@RestrictTo(LIBRARY_GROUP_PREFIX)
-public class TintInfo {
- public ColorStateList mTintList;
- public PorterDuff.Mode mTintMode;
- public boolean mHasTintMode;
- public boolean mHasTintList;
-
- void clear() {
- mTintList = null;
- mHasTintList = false;
- mTintMode = null;
- mHasTintMode = false;
- }
-}
diff --git a/appcompat/resources/src/main/java/androidx/appcompat/widget/TintResources.java b/appcompat/resources/src/main/java/androidx/appcompat/widget/TintResources.java
deleted file mode 100644
index dc25d22..0000000
--- a/appcompat/resources/src/main/java/androidx/appcompat/widget/TintResources.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2015 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.appcompat.widget;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.drawable.Drawable;
-
-import androidx.annotation.NonNull;
-
-import java.lang.ref.WeakReference;
-
-/**
- * This class allows us to intercept calls so that we can tint resources (if applicable).
- */
-class TintResources extends ResourcesWrapper {
-
- private final WeakReference<Context> mContextRef;
-
- public TintResources(@NonNull Context context, @NonNull final Resources res) {
- super(res);
- mContextRef = new WeakReference<>(context);
- }
-
- /**
- * We intercept this call so that we tint the result (if applicable). This is needed for
- * things like {@link android.graphics.drawable.DrawableContainer}s which can retrieve
- * their children via this method.
- */
- @Override
- public Drawable getDrawable(int id) throws NotFoundException {
- Drawable d = super.getDrawable(id);
- Context context = mContextRef.get();
- if (d != null && context != null) {
- ResourceManagerInternal.get().tintDrawableUsingColorFilter(context, id, d);
- }
- return d;
- }
-}
\ No newline at end of file
diff --git a/appcompat/resources/src/main/java/androidx/appcompat/widget/VectorEnabledTintResources.java b/appcompat/resources/src/main/java/androidx/appcompat/widget/VectorEnabledTintResources.java
deleted file mode 100644
index 53382f9..0000000
--- a/appcompat/resources/src/main/java/androidx/appcompat/widget/VectorEnabledTintResources.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2015 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.appcompat.widget;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.drawable.Drawable;
-import android.os.Build;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RestrictTo;
-
-import java.lang.ref.WeakReference;
-
-/**
- * This class allows us to intercept calls so that we can tint resources (if applicable), and
- * inflate vector resources from within drawable containers pre-L.
- *
- * @hide
- */
-@RestrictTo(LIBRARY_GROUP_PREFIX)
-public class VectorEnabledTintResources extends Resources {
- private static boolean sCompatVectorFromResourcesEnabled = false;
-
- public static boolean shouldBeUsed() {
- return isCompatVectorFromResourcesEnabled()
- && Build.VERSION.SDK_INT <= MAX_SDK_WHERE_REQUIRED;
- }
-
- /**
- * The maximum API level where this class is needed.
- */
- public static final int MAX_SDK_WHERE_REQUIRED = 20;
-
- private final WeakReference<Context> mContextRef;
-
- public VectorEnabledTintResources(@NonNull final Context context,
- @NonNull final Resources res) {
- super(res.getAssets(), res.getDisplayMetrics(), res.getConfiguration());
- mContextRef = new WeakReference<>(context);
- }
-
- /**
- * We intercept this call so that we tint the result (if applicable). This is needed for
- * things like {@link android.graphics.drawable.DrawableContainer}s which can retrieve
- * their children via this method.
- */
- @Override
- public Drawable getDrawable(int id) throws NotFoundException {
- final Context context = mContextRef.get();
- if (context != null) {
- return ResourceManagerInternal.get().onDrawableLoadedFromResources(context, this, id);
- } else {
- return super.getDrawable(id);
- }
- }
-
- final Drawable superGetDrawable(int id) {
- return super.getDrawable(id);
- }
-
- /**
- * Sets whether vector drawables on older platforms (< API 21) can be used within
- * {@link android.graphics.drawable.DrawableContainer} resources.
- */
- public static void setCompatVectorFromResourcesEnabled(boolean enabled) {
- sCompatVectorFromResourcesEnabled = enabled;
- }
-
- /**
- * Returns whether vector drawables on older platforms (< API 21) can be accessed from within
- * resources.
- *
- * @see #setCompatVectorFromResourcesEnabled(boolean)
- */
- public static boolean isCompatVectorFromResourcesEnabled() {
- return sCompatVectorFromResourcesEnabled;
- }
-}
\ No newline at end of file
diff --git a/appcompat/resources/src/main/res/values/attrs.xml b/appcompat/resources/src/main/res/values/attrs.xml
deleted file mode 100644
index 6ee0cf8..0000000
--- a/appcompat/resources/src/main/res/values/attrs.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 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.
--->
-
-<resources>
- <eat-comment/>
-
- <!-- Drawable used to render several states. Each state is represented by
- a child drawable. -->
- <declare-styleable name="StateListDrawable">
- <!-- Indicates whether the drawable should be initially visible. -->
- <attr name="android:visible" />
- <!-- If true, allows the drawable's padding to change based on the
- current state that is selected. If false, the padding will
- stay the same (based on the maximum padding of all the states).
- Enabling this feature requires that the owner of the drawable
- deal with performing layout when the state changes, which is
- often not supported. -->
- <attr name="android:variablePadding" />
- <!-- If true, the drawable's reported internal size will remain
- constant as the state changes; the size is the maximum of all
- of the states. If false, the size will vary based on the
- current state. -->
- <attr name="android:constantSize" />
- <!-- Enables or disables dithering of the bitmap if the bitmap does not have the
- same pixel configuration as the screen (for instance: a ARGB 8888 bitmap with
- an RGB 565 screen). -->
- <attr name="android:dither" />
- <!-- Amount of time (in milliseconds) to fade in a new state drawable. -->
- <attr name="android:enterFadeDuration" />
- <!-- Amount of time (in milliseconds) to fade out an old state drawable. -->
- <attr name="android:exitFadeDuration" />
- <!-- Indicates if the drawable needs to be mirrored when its layout direction is
- RTL (right-to-left). -->
- <!--<attr name="autoMirrored"/>-->
- </declare-styleable>
-
- <!-- Represents a single state inside a StateListDrawable. -->
- <declare-styleable name="StateListDrawableItem">
- <!-- Reference to a drawable resource to use for the state. If not
- given, the drawable must be defined by the first child tag. -->
- <attr name="android:drawable" />
- </declare-styleable>
-
- <!-- Drawable used to render several states with animated transitions. Each state
- is represented by a child drawable with an optional keyframe ID. -->
- <declare-styleable name="AnimatedStateListDrawableCompat">
- <!-- Indicates whether the drawable should be initially visible. -->
- <attr name="android:visible" />
- <!-- If true, allows the drawable's padding to change based on the
- current state that is selected. If false, the padding will
- stay the same (based on the maximum padding of all the states).
- Enabling this feature requires that the owner of the drawable
- deal with performing layout when the state changes, which is
- often not supported. -->
- <attr name="android:variablePadding" />
- <!-- If true, the drawable's reported internal size will remain
- constant as the state changes; the size is the maximum of all
- of the states. If false, the size will vary based on the
- current state. -->
- <attr name="android:constantSize" />
- <!-- Enables or disables dithering of the bitmap if the bitmap does not have the
- same pixel configuration as the screen (for instance: a ARGB 8888 bitmap with
- an RGB 565 screen). -->
- <attr name="android:dither" />
- <!-- Amount of time (in milliseconds) to fade in a new state drawable. -->
- <attr name="android:enterFadeDuration" />
- <!-- Amount of time (in milliseconds) to fade out an old state drawable. -->
- <attr name="android:exitFadeDuration" />
- <!-- Indicates if the drawable needs to be mirrored when its layout direction is
- RTL (right-to-left). -->
- <!--<attr name="autoMirrored"/>-->
- </declare-styleable>
-
- <!-- Transition used to animate between states with keyframe IDs. -->
- <declare-styleable name="AnimatedStateListDrawableItem">
- <!-- Reference to a drawable resource to use for the frame. If not
- given, the drawable must be defined by the first child tag. -->
- <attr name="android:drawable" />
- <!-- Keyframe identifier for use in specifying transitions. -->
- <attr name="android:id" />
- </declare-styleable>
-
- <!-- Transition used to animate between states with keyframe IDs. -->
- <declare-styleable name="AnimatedStateListDrawableTransition">
- <!-- Keyframe identifier for the starting state. -->
- <attr name="android:fromId" />
- <!-- Keyframe identifier for the ending state. -->
- <attr name="android:toId" />
- <!-- Reference to a animation drawable resource to use for the frame. If not
- given, the animation drawable must be defined by the first child tag. -->
- <attr name="android:drawable" />
- <!-- Whether this transition is reversible. -->
- <attr name="android:reversible" />
- </declare-styleable>
-
-</resources>
diff --git a/appcompat/src/androidTest/AndroidManifest.xml b/appcompat/src/androidTest/AndroidManifest.xml
index 4bfb0be..a425c02 100644
--- a/appcompat/src/androidTest/AndroidManifest.xml
+++ b/appcompat/src/androidTest/AndroidManifest.xml
@@ -32,10 +32,6 @@
<activity
android:name="androidx.appcompat.app.WindowDecorAppCompatActivity"/>
-
- <activity
- android:name="androidx.appcompat.app.WindowDecorBeforeOnCreateAppCompatActivity"/>
-
<activity
android:name="androidx.appcompat.app.ToolbarAppCompatActivity"
android:theme="@style/Theme.AppCompat.NoActionBar"/>
@@ -148,16 +144,11 @@
android:theme="@style/Theme.AppCompat.DayNight"/>
<activity
- android:name="androidx.appcompat.app.NightModeUiModeConfigChangesActivity"
+ android:name="androidx.appcompat.app.NightModeConfigChangesActivity"
android:theme="@style/Theme.AppCompat.DayNight"
android:configChanges="uiMode"/>
<activity
- android:name="androidx.appcompat.app.NightModeOrientationConfigChangesActivity"
- android:theme="@style/Theme.AppCompat.DayNight"
- android:configChanges="orientation|screenSize"/>
-
- <activity
android:name="androidx.appcompat.app.AppCompatVectorDrawableIntegrationActivity"/>
<activity
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/AlertDialogCursorTest.java b/appcompat/src/androidTest/java/androidx/appcompat/app/AlertDialogCursorTest.java
index 968251d..44b38dd 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/AlertDialogCursorTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/AlertDialogCursorTest.java
@@ -54,6 +54,7 @@
import androidx.test.espresso.DataInteraction;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import org.hamcrest.Matcher;
@@ -65,7 +66,7 @@
import java.io.File;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class AlertDialogCursorTest {
@Rule
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/AlertDialogTest.java b/appcompat/src/androidTest/java/androidx/appcompat/app/AlertDialogTest.java
index ab34aa4..fdaac18 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/AlertDialogTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/AlertDialogTest.java
@@ -74,6 +74,8 @@
import androidx.test.espresso.Espresso;
import androidx.test.espresso.ViewInteraction;
import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.hamcrest.Description;
@@ -101,7 +103,6 @@
* is rendered by a single <code>CheckedTextView</code>.</li>
* </ul>
*/
-@LargeTest
public class AlertDialogTest {
@Rule
public final ActivityTestRule<AlertDialogTestActivity> mActivityTestRule;
@@ -142,6 +143,7 @@
}
@Test
+ @SmallTest
@UiThreadTest
public void testBuilderTheme() {
final Context context = mActivityTestRule.getActivity();
@@ -156,6 +158,7 @@
}
@Test
+ @MediumTest
public void testBasicContent() {
final Context context = mActivityTestRule.getActivity();
AlertDialog.Builder builder = new AlertDialog.Builder(context)
@@ -186,6 +189,7 @@
// Tests for message logic
@Test
+ @MediumTest
public void testMessageString() {
final String dialogMessage = "Dialog message";
AlertDialog.Builder builder = new AlertDialog.Builder(mActivityTestRule.getActivity())
@@ -198,6 +202,7 @@
}
@Test
+ @MediumTest
public void testMessageStringPostCreation() throws Throwable {
final String dialogInitialMessage = "Initial message";
final String dialogUpdatedMessage = "Updated message";
@@ -226,6 +231,7 @@
// Tests for title
@Test
+ @SmallTest
public void testThemeMainFontIsAppliedToTitle() {
final Context context = mActivityTestRule.getActivity();
context.setTheme(R.style.Theme_CustomFont);
@@ -267,6 +273,7 @@
}
@Test
+ @MediumTest
public void testCustomTitle() {
final Context context = mActivityTestRule.getActivity();
final LayoutInflater inflater = LayoutInflater.from(context);
@@ -282,6 +289,7 @@
}
@Test
+ @MediumTest
public void testCustomTitlePostCreation() {
final Context context = mActivityTestRule.getActivity();
final LayoutInflater inflater = LayoutInflater.from(context);
@@ -334,6 +342,7 @@
}
@Test
+ @MediumTest
public void testCustomView() {
final Context context = mActivityTestRule.getActivity();
final LayoutInflater inflater = LayoutInflater.from(context);
@@ -349,6 +358,7 @@
}
@Test
+ @MediumTest
public void testCustomViewById() {
final Context context = mActivityTestRule.getActivity();
AlertDialog.Builder builder = new AlertDialog.Builder(context)
@@ -363,6 +373,7 @@
}
@Test
+ @MediumTest
public void testCustomViewPostCreation() {
final Context context = mActivityTestRule.getActivity();
final LayoutInflater inflater = LayoutInflater.from(context);
@@ -392,6 +403,7 @@
// Tests for cancel logic
@Test
+ @MediumTest
public void testCancelCancelableDialog() {
DialogInterface.OnCancelListener mockCancelListener =
mock(DialogInterface.OnCancelListener.class);
@@ -412,6 +424,7 @@
}
@Test
+ @MediumTest
public void testCancelNonCancelableDialog() {
DialogInterface.OnCancelListener mockCancelListener =
mock(DialogInterface.OnCancelListener.class);
@@ -466,6 +479,7 @@
}
@Test
+ @MediumTest
public void testCustomAdapter() {
final Context context = mActivityTestRule.getActivity();
final String[] content = context.getResources().getStringArray(R.array.alert_dialog_items);
@@ -482,6 +496,7 @@
}
@Test
+ @MediumTest
public void testSimpleItemsFromRuntimeArray() {
final String[] content = new String[] { "Alice", "Bob", "Charlie", "Delta" };
final DialogInterface.OnClickListener mockClickListener =
@@ -495,6 +510,7 @@
}
@Test
+ @MediumTest
public void testSimpleItemsFromResourcesArray() {
final DialogInterface.OnClickListener mockClickListener =
mock(DialogInterface.OnClickListener.class);
@@ -589,6 +605,7 @@
}
@Test
+ @MediumTest
public void testMultiChoiceItemsFromRuntimeArray() {
final String[] content = new String[] { "Alice", "Bob", "Charlie", "Delta" };
final boolean[] checkedTracker = new boolean[] { false, true, false, false };
@@ -611,6 +628,7 @@
}
@Test
+ @MediumTest
public void testMultiChoiceItemsFromResourcesArray() {
final boolean[] checkedTracker = new boolean[] { true, false, true, false };
AlertDialog.Builder builder = new AlertDialog.Builder(mActivityTestRule.getActivity())
@@ -707,6 +725,7 @@
}
@Test
+ @LargeTest
public void testSingleChoiceItemsFromRuntimeArray() {
final String[] content = new String[] { "Alice", "Bob", "Charlie", "Delta" };
final DialogInterface.OnClickListener mockClickListener =
@@ -720,6 +739,7 @@
}
@Test
+ @LargeTest
public void testSingleChoiceItemsFromResourcesArray() {
final DialogInterface.OnClickListener mockClickListener =
mock(DialogInterface.OnClickListener.class);
@@ -735,6 +755,7 @@
// Tests for icon logic
@Test
+ @MediumTest
public void testIconResource() {
AlertDialog.Builder builder = new AlertDialog.Builder(mActivityTestRule.getActivity())
.setTitle(R.string.alert_dialog_title)
@@ -755,6 +776,7 @@
}
@Test
+ @MediumTest
public void testIconResourceChangeAfterInitialSetup() throws Throwable {
AlertDialog.Builder builder = new AlertDialog.Builder(mActivityTestRule.getActivity())
.setTitle(R.string.alert_dialog_title)
@@ -786,6 +808,7 @@
}
@Test
+ @MediumTest
public void testIconResourceChangeWithNoInitialSetup() throws Throwable {
AlertDialog.Builder builder = new AlertDialog.Builder(mActivityTestRule.getActivity())
.setTitle(R.string.alert_dialog_title)
@@ -816,6 +839,7 @@
}
@Test
+ @MediumTest
public void testIconResourceRemoveAfterInitialSetup() throws Throwable {
AlertDialog.Builder builder = new AlertDialog.Builder(mActivityTestRule.getActivity())
.setTitle(R.string.alert_dialog_title)
@@ -847,6 +871,7 @@
}
@Test
+ @MediumTest
public void testIconDrawable() {
AlertDialog.Builder builder = new AlertDialog.Builder(mActivityTestRule.getActivity())
.setTitle(R.string.alert_dialog_title)
@@ -867,6 +892,7 @@
}
@Test
+ @MediumTest
public void testIconResourceDrawableAfterInitialSetup() throws Throwable {
AlertDialog.Builder builder = new AlertDialog.Builder(mActivityTestRule.getActivity())
.setTitle(R.string.alert_dialog_title)
@@ -898,6 +924,7 @@
}
@Test
+ @MediumTest
public void testIconDrawableChangeWithNoInitialSetup() throws Throwable {
AlertDialog.Builder builder = new AlertDialog.Builder(mActivityTestRule.getActivity())
.setTitle(R.string.alert_dialog_title)
@@ -928,6 +955,7 @@
}
@Test
+ @MediumTest
public void testIconDrawableRemoveAfterInitialSetup() throws Throwable {
AlertDialog.Builder builder = new AlertDialog.Builder(mActivityTestRule.getActivity())
.setTitle(R.string.alert_dialog_title)
@@ -1276,6 +1304,7 @@
}
@Test
+ @MediumTest
public void testButtonVisibility() {
final String positiveButtonText = "Positive button";
final String negativeButtonText = "Negative button";
@@ -1309,6 +1338,7 @@
}
@Test
+ @LargeTest
public void testButtons() {
// Positive-only button
verifyDialogButtons("Positive", null, null, AlertDialog.BUTTON_POSITIVE);
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatInflaterBadClassNameTest.java b/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatInflaterBadClassNameTest.java
index 27054fd..09684b8 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatInflaterBadClassNameTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatInflaterBadClassNameTest.java
@@ -15,13 +15,13 @@
*/
package androidx.appcompat.app;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
/**
* Testing the default view inflation where appcompat views are used for specific
* views in layouts specified in XML.
*/
-@MediumTest
+@SmallTest
public class AppCompatInflaterBadClassNameTest extends
AppCompatInflaterPassTest<AppCompatInflaterBadClassNameActivity> {
public AppCompatInflaterBadClassNameTest() {
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatInflaterCustomTest.java b/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatInflaterCustomTest.java
index a4d0edc..68ef62d 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatInflaterCustomTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatInflaterCustomTest.java
@@ -26,7 +26,7 @@
import androidx.appcompat.widget.AppCompatRadioButton;
import androidx.appcompat.widget.AppCompatSpinner;
import androidx.appcompat.widget.AppCompatTextView;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
@@ -37,7 +37,7 @@
* Testing the custom view inflation where app-specific views are used for specific
* views in layouts specified in XML.
*/
-@MediumTest
+@SmallTest
public class AppCompatInflaterCustomTest {
private ViewGroup mContainer;
private AppCompatInflaterCustomActivity mActivity;
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatInflaterNullTest.java b/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatInflaterNullTest.java
index 774e5ad..63b5a64 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatInflaterNullTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatInflaterNullTest.java
@@ -15,13 +15,13 @@
*/
package androidx.appcompat.app;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
/**
* Testing the default view inflation where appcompat views are used for specific
* views in layouts specified in XML.
*/
-@MediumTest
+@SmallTest
public class AppCompatInflaterNullTest extends
AppCompatInflaterPassTest<AppCompatInflaterNullActivity> {
public AppCompatInflaterNullTest() {
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatMenuItemIconTintingTest.java b/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatMenuItemIconTintingTest.java
index 4b12878..c88ba2a 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatMenuItemIconTintingTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatMenuItemIconTintingTest.java
@@ -37,7 +37,7 @@
import androidx.core.view.MenuItemCompat;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
@@ -48,7 +48,7 @@
/**
* Test icon tinting in {@link MenuItem}s
*/
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class AppCompatMenuItemIconTintingTest {
private AppCompatMenuItemIconTintingTestActivity mActivity;
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatMenuItemShortcutsTest.java b/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatMenuItemShortcutsTest.java
index d74f4db..d3948e9 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatMenuItemShortcutsTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatMenuItemShortcutsTest.java
@@ -25,7 +25,7 @@
import androidx.appcompat.test.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
@@ -36,7 +36,7 @@
/**
* Test shortcut trigger in case of MenuItems with non-default modifiers.
*/
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class AppCompatMenuItemShortcutsTest {
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatVectorDrawableIntegrationTest.java b/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatVectorDrawableIntegrationTest.java
index 14b6fb1..43830f4 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatVectorDrawableIntegrationTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/AppCompatVectorDrawableIntegrationTest.java
@@ -29,7 +29,7 @@
import androidx.appcompat.test.R;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
@@ -37,7 +37,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class AppCompatVectorDrawableIntegrationTest {
@Rule
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/BaseKeyEventsTestCase.java b/appcompat/src/androidTest/java/androidx/appcompat/app/BaseKeyEventsTestCase.java
index fab9728..3cef5f4 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/BaseKeyEventsTestCase.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/BaseKeyEventsTestCase.java
@@ -41,7 +41,7 @@
import androidx.core.view.MenuItemCompat;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -72,7 +72,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testBackDismissesActionMode() {
final AtomicBoolean destroyed = new AtomicBoolean();
@@ -136,7 +136,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testMenuPressInvokesPanelCallbacks() throws InterruptedException {
mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_MENU);
mInstrumentation.waitForIdleSync();
@@ -148,7 +148,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testBackPressWithMenuInvokesOnPanelClosed() throws InterruptedException {
mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_MENU);
mInstrumentation.waitForIdleSync();
@@ -159,7 +159,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testBackPressWithEmptyMenuFinishesActivity() throws InterruptedException {
repopulateWithEmptyMenu();
@@ -171,7 +171,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testDelKeyEventReachesActivity() {
// First send the event
mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_DEL);
@@ -187,7 +187,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testMenuKeyEventReachesActivity() throws InterruptedException {
mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_MENU);
mInstrumentation.waitForIdleSync();
@@ -202,7 +202,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testActionMenuContent() throws Throwable {
onView(withId(R.id.action_search))
.check(matches(isDisplayed()))
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/BasicsTestCaseWithToolbar.java b/appcompat/src/androidTest/java/androidx/appcompat/app/BasicsTestCaseWithToolbar.java
index 11f17da..9e7d206 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/BasicsTestCaseWithToolbar.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/BasicsTestCaseWithToolbar.java
@@ -17,11 +17,11 @@
package androidx.appcompat.app;
import androidx.test.annotation.UiThreadTest;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
-@LargeTest
+@SmallTest
public class BasicsTestCaseWithToolbar extends BaseBasicsTestCase<ToolbarAppCompatActivity> {
public BasicsTestCaseWithToolbar() {
super(ToolbarAppCompatActivity.class);
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/BasicsTestCaseWithWindowDecor.java b/appcompat/src/androidTest/java/androidx/appcompat/app/BasicsTestCaseWithWindowDecor.java
index e5364f8..9187f57 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/BasicsTestCaseWithWindowDecor.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/BasicsTestCaseWithWindowDecor.java
@@ -17,11 +17,11 @@
package androidx.appcompat.app;
import androidx.test.annotation.UiThreadTest;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
-@LargeTest
+@SmallTest
public class BasicsTestCaseWithWindowDecor extends BaseBasicsTestCase<WindowDecorAppCompatActivity> {
public BasicsTestCaseWithWindowDecor() {
super(WindowDecorAppCompatActivity.class);
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/DrawerDynamicLayoutTest.java b/appcompat/src/androidTest/java/androidx/appcompat/app/DrawerDynamicLayoutTest.java
index a379cce..b0b231b 100755
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/DrawerDynamicLayoutTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/DrawerDynamicLayoutTest.java
@@ -36,7 +36,7 @@
import androidx.test.espresso.UiController;
import androidx.test.espresso.ViewAction;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.hamcrest.Description;
@@ -51,7 +51,7 @@
* Test cases to verify that <code>DrawerLayout</code> only supports configurations
* with at most one drawer child along each vertical (left / right) edge.
*/
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class DrawerDynamicLayoutTest {
@Rule
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/FragmentContentIdTest.java b/appcompat/src/androidTest/java/androidx/appcompat/app/FragmentContentIdTest.java
index 69ae97c..27f0ed7 100755
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/FragmentContentIdTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/FragmentContentIdTest.java
@@ -24,7 +24,7 @@
import androidx.appcompat.test.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Rule;
@@ -37,7 +37,7 @@
public final ActivityTestRule<FragmentContentIdActivity> mActivityTestRule =
new ActivityTestRule<>(FragmentContentIdActivity.class);
- @LargeTest
+ @SmallTest
@Test
public void testFragmentAddedToAndroidContentIdCanBeRemoved() throws Throwable {
mActivityTestRule.runOnUiThread(new Runnable() {
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/KeyEventsTestCaseWithToolbar.java b/appcompat/src/androidTest/java/androidx/appcompat/app/KeyEventsTestCaseWithToolbar.java
index 027eeca..29366ef 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/KeyEventsTestCaseWithToolbar.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/KeyEventsTestCaseWithToolbar.java
@@ -23,24 +23,25 @@
import android.view.Window;
import androidx.appcompat.widget.Toolbar;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
-@MediumTest
public class KeyEventsTestCaseWithToolbar extends BaseKeyEventsTestCase<ToolbarAppCompatActivity> {
public KeyEventsTestCaseWithToolbar() {
super(ToolbarAppCompatActivity.class);
}
@Test
+ @SmallTest
@Override
public void testMenuKeyEventReachesActivity() throws InterruptedException {
// With Toolbar, MENU key gets sent-to (and consumed by) Toolbar rather than Activity
}
@Test
+ @SmallTest
public void testMenuKeyOpensToolbarMenu() {
// Base test only checks that *a* menu is opened, we check here that the toolbar's menu
// specifically is opened.
@@ -57,6 +58,7 @@
}
@Test
+ @SmallTest
public void testOpenMenuOpensToolbarMenu() throws Throwable {
if (!mActivityTestRule.getActivity().getWindow().hasFeature(Window.FEATURE_OPTIONS_PANEL)) {
return;
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/KeyEventsTestCaseWithWindowDecor.java b/appcompat/src/androidTest/java/androidx/appcompat/app/KeyEventsTestCaseWithWindowDecor.java
index 49a9488..092a092 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/KeyEventsTestCaseWithWindowDecor.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/KeyEventsTestCaseWithWindowDecor.java
@@ -27,7 +27,7 @@
import androidx.appcompat.test.R;
import androidx.core.view.ViewCompat;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
@@ -38,7 +38,7 @@
}
@Test
- @LargeTest
+ @SmallTest
public void testUnhandledKeys() throws Throwable {
final ViewGroup container = mActivityTestRule.getActivity().findViewById(R.id.test_content);
final MockUnhandledKeyListener listener = new MockUnhandledKeyListener();
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeActivity.java b/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeActivity.java
index b9faf73..c455c81 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeActivity.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeActivity.java
@@ -20,6 +20,15 @@
import androidx.appcompat.testutils.BaseTestActivity;
public class NightModeActivity extends BaseTestActivity {
+
+ /**
+ * Warning, gross hack here. Since night mode uses recreate(), we need a way to be able to
+ * grab the top activity. The test runner only keeps reference to the original Activity which
+ * is no good for these tests. Fixed by keeping a static reference to the 'top' instance, and
+ * updating it in onResume and onPause. I said it was gross.
+ */
+ static NightModeActivity TOP_ACTIVITY = null;
+
private int mLastNightModeChange = Integer.MIN_VALUE;
@Override
@@ -28,6 +37,20 @@
}
@Override
+ protected void onResume() {
+ super.onResume();
+ TOP_ACTIVITY = this;
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ if (TOP_ACTIVITY == this) {
+ TOP_ACTIVITY = null;
+ }
+ }
+
+ @Override
public void onNightModeChanged(int mode) {
mLastNightModeChange = mode;
}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeConfigChangesActivity.java b/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeConfigChangesActivity.java
new file mode 100644
index 0000000..68f24a4
--- /dev/null
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeConfigChangesActivity.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2019 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.appcompat.app;
+
+public class NightModeConfigChangesActivity extends NightModeActivity {}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeConfigChangesTestCase.java b/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeConfigChangesTestCase.java
new file mode 100644
index 0000000..f186837
--- /dev/null
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeConfigChangesTestCase.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2019 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.appcompat.app;
+
+import static androidx.appcompat.testutils.NightModeUtils.assertConfigurationNightModeEquals;
+import static androidx.appcompat.testutils.NightModeUtils.setLocalNightModeAndWait;
+
+import static org.junit.Assert.assertEquals;
+
+import android.content.res.Configuration;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.LargeTest;
+import androidx.test.rule.ActivityTestRule;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@LargeTest
+@RunWith(AndroidJUnit4.class)
+public class NightModeConfigChangesTestCase {
+ @Rule
+ public final ActivityTestRule<NightModeConfigChangesActivity> mActivityTestRule;
+
+ public NightModeConfigChangesTestCase() {
+ mActivityTestRule = new ActivityTestRule<>(NightModeConfigChangesActivity.class);
+ }
+
+ @Before
+ public void setup() {
+ // By default we'll set the night mode to NO, which allows us to make better
+ // assumptions in the test below
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
+ }
+
+ @Test
+ public void testResourcesNotUpdated() throws Throwable {
+ final int defaultNightMode = mActivityTestRule.getActivity()
+ .getResources().getConfiguration().uiMode
+ & Configuration.UI_MODE_NIGHT_MASK;
+
+ // Set local night mode to YES
+ setLocalNightModeAndWait(mActivityTestRule, AppCompatDelegate.MODE_NIGHT_YES);
+
+ // Assert that the Activity did not get updated
+ assertConfigurationNightModeEquals(defaultNightMode,
+ mActivityTestRule.getActivity().getResources().getConfiguration());
+
+ // Set local night mode back to NO
+ setLocalNightModeAndWait(mActivityTestRule, AppCompatDelegate.MODE_NIGHT_NO);
+
+ // Assert that the Activity did not get updated
+ assertConfigurationNightModeEquals(defaultNightMode,
+ mActivityTestRule.getActivity().getResources().getConfiguration());
+ }
+
+ @Test
+ public void testOnNightModeChangedCalled() throws Throwable {
+ // Set local night mode to YES
+ setLocalNightModeAndWait(mActivityTestRule, AppCompatDelegate.MODE_NIGHT_YES);
+ // Assert that the Activity received a new value
+ assertEquals(AppCompatDelegate.MODE_NIGHT_YES,
+ mActivityTestRule.getActivity().getLastNightModeAndReset());
+
+ // Set local night mode to NO
+ setLocalNightModeAndWait(mActivityTestRule, AppCompatDelegate.MODE_NIGHT_NO);
+ // Assert that the Activity received a new value
+ assertEquals(AppCompatDelegate.MODE_NIGHT_NO,
+ mActivityTestRule.getActivity().getLastNightModeAndReset());
+ }
+}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeOrientationConfigChangesActivity.java b/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeOrientationConfigChangesActivity.java
deleted file mode 100644
index dc235e3..0000000
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeOrientationConfigChangesActivity.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2019 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.appcompat.app;
-
-public class NightModeOrientationConfigChangesActivity extends NightModeActivity {}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeOrientationConfigChangesTestCase.java b/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeOrientationConfigChangesTestCase.java
deleted file mode 100644
index a845616..0000000
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeOrientationConfigChangesTestCase.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2019 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.appcompat.app;
-
-import static androidx.appcompat.testutils.NightModeUtils.assertConfigurationNightModeEquals;
-import static androidx.appcompat.testutils.NightModeUtils.setLocalNightModeAndWaitForDestroy;
-import static androidx.appcompat.testutils.TestUtilsActions.rotateScreenOrientation;
-import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.matcher.ViewMatchers.isRoot;
-
-import static org.junit.Assert.assertSame;
-
-import android.app.Activity;
-import android.content.res.Configuration;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
-import androidx.test.rule.ActivityTestRule;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@LargeTest
-@RunWith(AndroidJUnit4.class)
-public class NightModeOrientationConfigChangesTestCase {
- @Rule
- public final ActivityTestRule<NightModeOrientationConfigChangesActivity> mActivityTestRule;
-
- public NightModeOrientationConfigChangesTestCase() {
- mActivityTestRule = new ActivityTestRule<>(NightModeOrientationConfigChangesActivity.class);
- }
-
- @Before
- public void setup() {
- // By default we'll set the night mode to NO, which allows us to make better
- // assumptions in the test below
- AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
- }
-
- @Test
- public void testRotateDoesNotRecreateActivity() throws Throwable {
- // Set local night mode to YES
- setLocalNightModeAndWaitForDestroy(mActivityTestRule, AppCompatDelegate.MODE_NIGHT_YES);
-
- final Activity activity = mActivityTestRule.getActivity();
-
- // Assert that the current Activity is 'dark'
- assertConfigurationNightModeEquals(Configuration.UI_MODE_NIGHT_YES,
- activity.getResources().getConfiguration());
-
- // Now rotate the device
- onView(isRoot()).perform(rotateScreenOrientation(activity));
-
- // And assert that we have the same Activity, and thus was not recreated
- assertSame(activity, mActivityTestRule.getActivity());
- }
-}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeTestCase.java b/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeTestCase.java
index baec85d..e16949d 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeTestCase.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeTestCase.java
@@ -16,28 +16,27 @@
package androidx.appcompat.app;
-import static androidx.appcompat.testutils.NightModeUtils.assertConfigurationNightModeEquals;
+import static androidx.appcompat.app.NightModeActivity.TOP_ACTIVITY;
import static androidx.appcompat.testutils.NightModeUtils.setLocalNightModeAndWait;
import static androidx.appcompat.testutils.TestUtilsMatchers.isBackground;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
-import static androidx.testutils.LifecycleOwnerUtils.waitUntilState;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import android.app.Instrumentation;
-import android.content.res.Configuration;
-import android.webkit.WebView;
import androidx.appcompat.test.R;
import androidx.core.content.ContextCompat;
-import androidx.lifecycle.Lifecycle;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
+import androidx.testutils.AppCompatActivityUtils;
+import androidx.testutils.RecreatedAppCompatActivity;
import org.junit.Before;
import org.junit.Rule;
@@ -45,6 +44,7 @@
import org.junit.runner.RunWith;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
@LargeTest
@RunWith(AndroidJUnit4.class)
@@ -72,38 +72,14 @@
onView(withId(R.id.text_night_mode)).check(matches(withText(STRING_DAY)));
// Now force the local night mode to be yes (aka night mode)
- setLocalNightModeAndWaitForRecreate(AppCompatDelegate.MODE_NIGHT_YES);
-
- // Assert that the new local night mode is returned
- assertEquals(AppCompatDelegate.MODE_NIGHT_YES,
- mActivityTestRule.getActivity().getDelegate().getLocalNightMode());
+ setLocalNightModeAndWaitForRecreate(
+ mActivityTestRule.getActivity(), AppCompatDelegate.MODE_NIGHT_YES);
// Now check the text has changed, signifying that night resources are being used
onView(withId(R.id.text_night_mode)).check(matches(withText(STRING_NIGHT)));
}
@Test
- public void testSwitchingYesToFollowSystem() throws Throwable {
- // Verify first that we're in day mode
- onView(withId(R.id.text_night_mode))
- .check(matches(withText(STRING_DAY)));
-
- // Now force the local night mode to be yes (aka night mode)
- setLocalNightModeAndWaitForRecreate(AppCompatDelegate.MODE_NIGHT_YES);
-
- // Now check the text has changed, signifying that night resources are being used
- onView(withId(R.id.text_night_mode))
- .check(matches(withText(STRING_NIGHT)));
-
- // Now force the local night mode to be FOLLOW_SYSTEM, which should go back to DAY
- setLocalNightModeAndWaitForRecreate(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
-
- // Now check the text has changed, signifying that night resources are being used
- onView(withId(R.id.text_night_mode))
- .check(matches(withText(STRING_DAY)));
- }
-
- @Test
public void testColorConvertedDrawableChangesWithNightMode() throws Throwable {
final NightModeActivity activity = mActivityTestRule.getActivity();
final int dayColor = ContextCompat.getColor(activity, R.color.color_sky_day);
@@ -113,76 +89,84 @@
// to be looped since the issue is with drawable caching, therefore we need to prime the
// cache for the issue to happen
for (int i = 0; i < 5; i++) {
- // First force it to be night mode and assert the color
- setLocalNightModeAndWaitForRecreate(AppCompatDelegate.MODE_NIGHT_YES);
- onView(withId(R.id.view_background)).check(matches(isBackground(nightColor)));
-
- // Now force the local night mode to be no (aka day mode) and assert the color
- setLocalNightModeAndWaitForRecreate(AppCompatDelegate.MODE_NIGHT_NO);
+ // First force it to not be night mode
+ setLocalNightModeAndWaitForRecreate(TOP_ACTIVITY, AppCompatDelegate.MODE_NIGHT_NO);
+ // ... and verify first that we're in day mode
onView(withId(R.id.view_background)).check(matches(isBackground(dayColor)));
+
+ // Now force the local night mode to be yes (aka night mode)
+ setLocalNightModeAndWaitForRecreate(TOP_ACTIVITY, AppCompatDelegate.MODE_NIGHT_YES);
+ // ... and verify first that we're in night mode
+ onView(withId(R.id.view_background)).check(matches(isBackground(nightColor)));
}
}
@Test
- public void testNightModeAutoTimeRecreatesOnTimeChange() throws Throwable {
+ public void testNightModeAutoRecreatesOnTimeChange() throws Throwable {
// Create a fake TwilightManager and set it as the app instance
final FakeTwilightManager twilightManager = new FakeTwilightManager();
TwilightManager.setInstance(twilightManager);
+ final NightModeActivity activity = mActivityTestRule.getActivity();
+
// Verify that we're currently in day mode
onView(withId(R.id.text_night_mode)).check(matches(withText(STRING_DAY)));
// Set MODE_NIGHT_AUTO so that we will change to night mode automatically
- setLocalNightModeAndWait(mActivityTestRule, AppCompatDelegate.MODE_NIGHT_AUTO_TIME);
+ final NightModeActivity newActivity =
+ setLocalNightModeAndWaitForRecreate(activity, AppCompatDelegate.MODE_NIGHT_AUTO);
final AppCompatDelegateImpl newDelegate =
- (AppCompatDelegateImpl) mActivityTestRule.getActivity().getDelegate();
+ (AppCompatDelegateImpl) newActivity.getDelegate();
// Update the fake twilight manager to be in night and trigger a fake 'time' change
mActivityTestRule.runOnUiThread(new Runnable() {
@Override
public void run() {
twilightManager.setIsNight(true);
- newDelegate.getAutoTimeNightModeManager().onChange();
+ newDelegate.getAutoNightModeManager().dispatchTimeChanged();
}
});
- // Now wait until the Activity is destroyed (thus recreated)
- waitUntilState(mActivityTestRule, Lifecycle.State.DESTROYED);
+ RecreatedAppCompatActivity.sResumed = new CountDownLatch(1);
+ assertTrue(RecreatedAppCompatActivity.sResumed.await(1, TimeUnit.SECONDS));
+ // At this point recreate that has been triggered by dispatchTimeChanged call
+ // has completed
// Check that the text has changed, signifying that night resources are being used
onView(withId(R.id.text_night_mode)).check(matches(withText(STRING_NIGHT)));
}
@Test
- public void testNightModeAutoTimeRecreatesOnResume() throws Throwable {
+ public void testNightModeAutoRecreatesOnResume() throws Throwable {
// Create a fake TwilightManager and set it as the app instance
final FakeTwilightManager twilightManager = new FakeTwilightManager();
TwilightManager.setInstance(twilightManager);
- // Set MODE_NIGHT_AUTO_TIME so that we will change to night mode automatically
- setLocalNightModeAndWait(mActivityTestRule, AppCompatDelegate.MODE_NIGHT_AUTO_TIME);
+ NightModeActivity activity = mActivityTestRule.getActivity();
+ // Set MODE_NIGHT_AUTO so that we will change to night mode automatically
+ activity = setLocalNightModeAndWaitForRecreate(activity, AppCompatDelegate.MODE_NIGHT_AUTO);
// Verify that we're currently in day mode
onView(withId(R.id.text_night_mode)).check(matches(withText(STRING_DAY)));
+ final NightModeActivity toTest = activity;
final CountDownLatch resumeCompleteLatch = new CountDownLatch(1);
mActivityTestRule.runOnUiThread(new Runnable() {
@Override
public void run() {
- final NightModeActivity activity = mActivityTestRule.getActivity();
final Instrumentation instrumentation =
InstrumentationRegistry.getInstrumentation();
// Now fool the Activity into thinking that it has gone into the background
- instrumentation.callActivityOnPause(activity);
- instrumentation.callActivityOnStop(activity);
+ instrumentation.callActivityOnPause(toTest);
+ instrumentation.callActivityOnStop(toTest);
// Now update the twilight manager while the Activity is in the 'background'
twilightManager.setIsNight(true);
// Now tell the Activity that it has gone into the foreground again
- instrumentation.callActivityOnStart(activity);
- instrumentation.callActivityOnResume(activity);
+ instrumentation.callActivityOnStart(toTest);
+ instrumentation.callActivityOnResume(toTest);
resumeCompleteLatch.countDown();
}
@@ -208,53 +192,6 @@
mActivityTestRule.getActivity().getLastNightModeAndReset());
}
- @Test
- public void testDialogDoesNotOverrideActivityConfiguration() throws Throwable {
- // Set Activity local night mode to YES
- setLocalNightModeAndWaitForRecreate(AppCompatDelegate.MODE_NIGHT_YES);
-
- // Assert that the uiMode is as expected
- assertConfigurationNightModeEquals(Configuration.UI_MODE_NIGHT_YES,
- mActivityTestRule.getActivity());
-
- // Now show a AppCompatDialog
- mActivityTestRule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- AppCompatDialog dialog = new AppCompatDialog(mActivityTestRule.getActivity());
- dialog.show();
- }
- });
-
- // Assert that the uiMode is unchanged
- assertConfigurationNightModeEquals(Configuration.UI_MODE_NIGHT_YES,
- mActivityTestRule.getActivity());
- }
-
- @Test
- public void testLoadingWebViewMaintainsConfiguration() throws Throwable {
- // Set night mode and wait for the new Activity
- setLocalNightModeAndWaitForRecreate(AppCompatDelegate.MODE_NIGHT_YES);
-
- // Assert that the context still has a night themed configuration
- assertConfigurationNightModeEquals(
- Configuration.UI_MODE_NIGHT_YES,
- mActivityTestRule.getActivity().getResources().getConfiguration());
-
- // Now load a WebView into the Activity
- mActivityTestRule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- final WebView webView = new WebView(mActivityTestRule.getActivity());
- }
- });
-
- // Now assert that the context still has a night themed configuration
- assertConfigurationNightModeEquals(
- Configuration.UI_MODE_NIGHT_YES,
- mActivityTestRule.getActivity().getResources().getConfiguration());
- }
-
private static class FakeTwilightManager extends TwilightManager {
private boolean mIsNight;
@@ -272,15 +209,21 @@
}
}
- private void setLocalNightModeAndWaitForRecreate(
+ private NightModeActivity setLocalNightModeAndWaitForRecreate(
+ final NightModeActivity activity,
@AppCompatDelegate.NightMode final int nightMode) throws Throwable {
- final NightModeActivity activity = mActivityTestRule.getActivity();
+ final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
mActivityTestRule.runOnUiThread(new Runnable() {
@Override
public void run() {
activity.getDelegate().setLocalNightMode(nightMode);
}
});
- waitUntilState(activity, mActivityTestRule, Lifecycle.State.DESTROYED);
+ final NightModeActivity result =
+ AppCompatActivityUtils.recreateActivity(mActivityTestRule, activity);
+ AppCompatActivityUtils.waitForExecution(mActivityTestRule);
+
+ instrumentation.waitForIdleSync();
+ return result;
}
}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeUiModeConfigChangesActivity.java b/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeUiModeConfigChangesActivity.java
deleted file mode 100644
index 5498d4b..0000000
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeUiModeConfigChangesActivity.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2019 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.appcompat.app;
-
-public class NightModeUiModeConfigChangesActivity extends NightModeActivity {}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeUiModeConfigChangesTestCase.java b/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeUiModeConfigChangesTestCase.java
deleted file mode 100644
index bed3af3..0000000
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/NightModeUiModeConfigChangesTestCase.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2019 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.appcompat.app;
-
-import static androidx.appcompat.testutils.NightModeUtils.assertConfigurationNightModeEquals;
-import static androidx.appcompat.testutils.NightModeUtils.setLocalNightModeAndWait;
-
-import static org.junit.Assert.assertEquals;
-
-import android.content.res.Configuration;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
-import androidx.test.rule.ActivityTestRule;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@LargeTest
-@RunWith(AndroidJUnit4.class)
-public class NightModeUiModeConfigChangesTestCase {
- @Rule
- public final ActivityTestRule<NightModeUiModeConfigChangesActivity> mActivityTestRule;
-
- public NightModeUiModeConfigChangesTestCase() {
- mActivityTestRule = new ActivityTestRule<>(NightModeUiModeConfigChangesActivity.class);
- }
-
- @Before
- public void setup() {
- // By default we'll set the night mode to NO, which allows us to make better
- // assumptions in the test below
- AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
- }
-
- @Test
- public void testResourcesNotUpdated() throws Throwable {
- final int defaultNightMode = mActivityTestRule.getActivity()
- .getResources().getConfiguration().uiMode
- & Configuration.UI_MODE_NIGHT_MASK;
-
- // Set local night mode to YES
- setLocalNightModeAndWait(mActivityTestRule, AppCompatDelegate.MODE_NIGHT_YES);
-
- // Assert that the Activity did not get updated
- assertConfigurationNightModeEquals(defaultNightMode,
- mActivityTestRule.getActivity().getResources().getConfiguration());
-
- // Set local night mode back to NO
- setLocalNightModeAndWait(mActivityTestRule, AppCompatDelegate.MODE_NIGHT_NO);
-
- // Assert that the Activity did not get updated
- assertConfigurationNightModeEquals(defaultNightMode,
- mActivityTestRule.getActivity().getResources().getConfiguration());
- }
-
- @Test
- public void testOnNightModeChangedCalled() throws Throwable {
- // Set local night mode to YES
- setLocalNightModeAndWait(mActivityTestRule, AppCompatDelegate.MODE_NIGHT_YES);
- // Assert that the Activity received a new value
- assertEquals(AppCompatDelegate.MODE_NIGHT_YES,
- mActivityTestRule.getActivity().getLastNightModeAndReset());
-
- // Set local night mode to NO
- setLocalNightModeAndWait(mActivityTestRule, AppCompatDelegate.MODE_NIGHT_NO);
- // Assert that the Activity received a new value
- assertEquals(AppCompatDelegate.MODE_NIGHT_NO,
- mActivityTestRule.getActivity().getLastNightModeAndReset());
- }
-}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/WindowDecorBeforeOnCreateAppCompatActivity.java b/appcompat/src/androidTest/java/androidx/appcompat/app/WindowDecorBeforeOnCreateAppCompatActivity.java
deleted file mode 100644
index ce65ed9..0000000
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/WindowDecorBeforeOnCreateAppCompatActivity.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2019 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.appcompat.app;
-
-import android.os.Bundle;
-
-import androidx.appcompat.test.R;
-import androidx.appcompat.testutils.BaseTestActivity;
-
-public class WindowDecorBeforeOnCreateAppCompatActivity extends BaseTestActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- getSupportActionBar();
- super.onCreate(savedInstanceState);
- }
-
- @Override
- protected int getContentViewLayoutResId() {
- return R.layout.window_decor_content;
- }
-}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/app/WindowDecorBeforeOnCreateTestCase.java b/appcompat/src/androidTest/java/androidx/appcompat/app/WindowDecorBeforeOnCreateTestCase.java
deleted file mode 100644
index 4d0c1f3..0000000
--- a/appcompat/src/androidTest/java/androidx/appcompat/app/WindowDecorBeforeOnCreateTestCase.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2019 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.appcompat.app;
-
-import static org.junit.Assert.assertNotNull;
-
-import androidx.test.annotation.UiThreadTest;
-import androidx.test.filters.LargeTest;
-import androidx.test.rule.ActivityTestRule;
-
-import org.junit.Rule;
-import org.junit.Test;
-
-@LargeTest
-public class WindowDecorBeforeOnCreateTestCase {
- @Rule
- public final ActivityTestRule<WindowDecorBeforeOnCreateAppCompatActivity> mActivityTestRule;
-
- public WindowDecorBeforeOnCreateTestCase() {
- mActivityTestRule = new ActivityTestRule<>(
- WindowDecorBeforeOnCreateAppCompatActivity.class);
- }
-
- @Test
- @UiThreadTest
- public void testSupportActionBar() {
- assertNotNull(mActivityTestRule.getActivity().getSupportActionBar());
- }
-}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/graphics/drawable/AnimatedStateListDrawableCompatTest.java b/appcompat/src/androidTest/java/androidx/appcompat/graphics/drawable/AnimatedStateListDrawableCompatTest.java
new file mode 100644
index 0000000..61959ce
--- /dev/null
+++ b/appcompat/src/androidTest/java/androidx/appcompat/graphics/drawable/AnimatedStateListDrawableCompatTest.java
@@ -0,0 +1,238 @@
+/*
+ * 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.appcompat.graphics.drawable;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.ColorFilter;
+import android.graphics.drawable.Animatable;
+import android.graphics.drawable.Drawable;
+import android.util.StateSet;
+
+import androidx.appcompat.test.R;
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.vectordrawable.graphics.drawable.Animatable2Compat;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.io.IOException;
+import java.util.HashSet;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class AnimatedStateListDrawableCompatTest {
+ private static final int[] STATE_EMPTY = new int[]{};
+ private static final int[] STATE_FOCUSED = new int[]{android.R.attr.state_focused};
+
+ private Context mContext;
+
+ @Before
+ public void setup() {
+ mContext = ApplicationProvider.getApplicationContext();
+ }
+
+ @Test
+ public void testStateListDrawable() {
+ new AnimatedStateListDrawableCompat();
+
+ // Check the values set in the constructor
+ assertNotNull(new AnimatedStateListDrawableCompat().getConstantState());
+ }
+
+ @Test
+ public void testAddState() {
+ AnimatedStateListDrawableCompat asld = new AnimatedStateListDrawableCompat();
+ assertEquals(0, asld.getStateCount());
+
+ try {
+ asld.addState(StateSet.WILD_CARD, null, R.id.focused);
+ fail("Expected IllegalArgumentException");
+ } catch (IllegalArgumentException e) {
+ // Expected.
+ }
+
+ Drawable unfocused = mock(Drawable.class);
+ asld.addState(StateSet.WILD_CARD, unfocused, R.id.focused);
+ assertEquals(1, asld.getStateCount());
+
+ Drawable focused = mock(Drawable.class);
+ asld.addState(STATE_FOCUSED, focused, R.id.unfocused);
+ assertEquals(2, asld.getStateCount());
+ }
+
+ @Test
+ public void testAddTransition() {
+ AnimatedStateListDrawableCompat asld = new AnimatedStateListDrawableCompat();
+
+ Drawable focused = mock(Drawable.class);
+ Drawable unfocused = mock(Drawable.class);
+ asld.addState(STATE_FOCUSED, focused, R.id.focused);
+ asld.addState(StateSet.WILD_CARD, unfocused, R.id.unfocused);
+
+ try {
+ asld.addTransition(R.id.focused, R.id.focused, null, false);
+ fail("Expected IllegalArgumentException");
+ } catch (IllegalArgumentException e) {
+ // Expected.
+ }
+
+ MockTransition focusedToUnfocused = mock(MockTransition.class);
+ asld.addTransition(R.id.focused, R.id.unfocused, focusedToUnfocused, false);
+ assertEquals(3, asld.getStateCount());
+
+ MockTransition unfocusedToFocused = mock(MockTransition.class);
+ asld.addTransition(R.id.unfocused, R.id.focused, unfocusedToFocused, false);
+ assertEquals(4, asld.getStateCount());
+
+ MockTransition reversible = mock(MockTransition.class);
+ asld.addTransition(R.id.focused, R.id.unfocused, reversible, true);
+ assertEquals(5, asld.getStateCount());
+ }
+
+ @Test
+ public void testIsStateful() {
+ assertTrue(new AnimatedStateListDrawableCompat().isStateful());
+ }
+
+ @Test
+ public void testOnStateChange() {
+ AnimatedStateListDrawableCompat asld = new AnimatedStateListDrawableCompat();
+
+ Drawable focused = mock(Drawable.class);
+ Drawable unfocused = mock(Drawable.class);
+ asld.addState(STATE_FOCUSED, focused, R.id.focused);
+ asld.addState(StateSet.WILD_CARD, unfocused, R.id.unfocused);
+
+ MockTransition focusedToUnfocused = mock(MockTransition.class);
+ MockTransition unfocusedToFocused = mock(MockTransition.class);
+ asld.addTransition(R.id.focused, R.id.unfocused, focusedToUnfocused, false);
+ asld.addTransition(R.id.unfocused, R.id.focused, unfocusedToFocused, false);
+
+ asld.setState(STATE_EMPTY);
+ assertSame(unfocused, asld.getCurrent());
+
+ asld.setState(STATE_FOCUSED);
+ assertSame(unfocusedToFocused, asld.getCurrent());
+
+ asld.setState(STATE_FOCUSED);
+ assertSame(unfocusedToFocused, asld.getCurrent());
+ }
+
+ @Test
+ public void testAnimationDrawableTransition() throws XmlPullParserException, IOException {
+ AnimatedStateListDrawableCompat asld = AnimatedStateListDrawableCompat.create(mContext,
+ R.drawable.animated_state_list_density, mContext.getTheme());
+ assertTrue(asld.isVisible());
+ // Missing public API to verify these.
+ //assertFalse(asld.isConstantSize());
+ //assertNull(asld.getConstantPadding());
+ // Check that 4 drawables were parsed
+ assertEquals(4, asld.getStateCount());
+ }
+
+ @Test
+ public void testAnimatedVectorTransition() {
+ AnimatedStateListDrawableCompat asld = AnimatedStateListDrawableCompat.create(mContext,
+ R.drawable.asl_heart, mContext.getTheme());
+ // Check that 4 drawables were parsed
+ assertEquals(4, asld.getStateCount());
+ }
+
+ @Test
+ public void testChildAnimatedVectorTransition() {
+ AnimatedStateListDrawableCompat asld = AnimatedStateListDrawableCompat.create(mContext,
+ R.drawable.animated_state_list_with_avd, mContext.getTheme());
+ // Check that 6 drawables were parsed
+ assertEquals(6, asld.getStateCount());
+ }
+
+ @Test
+ public void testChildVectorItem() {
+ AnimatedStateListDrawableCompat asld = AnimatedStateListDrawableCompat.create(mContext,
+ R.drawable.asl_heart_embedded, mContext.getTheme());
+ // Check that 4 drawables were parsed
+ assertEquals(4, asld.getStateCount());
+ }
+
+ @Test
+ public void testConstantStateWhenChildHasNullConstantState() {
+ // Given an empty ASLD which returns a constant state
+ AnimatedStateListDrawableCompat asld = new AnimatedStateListDrawableCompat();
+ assertNotNull(asld.getConstantState());
+
+ // When a drawable who returns a null constant state is added
+ Drawable noConstantStateDrawable = mock(Drawable.class);
+ Mockito.when(noConstantStateDrawable.getConstantState()).thenReturn(null);
+ asld.addState(StateSet.WILD_CARD, noConstantStateDrawable, R.id.focused);
+
+ // Then the ASLD should also return a null constant state
+ assertNull(asld.getConstantState());
+ }
+
+ public abstract class MockTransition extends MockDrawable implements Animatable,
+ Animatable2Compat {
+ private HashSet<AnimationCallback> mCallbacks = new HashSet<>();
+
+ @Override
+ public void registerAnimationCallback(AnimationCallback callback) {
+ mCallbacks.add(callback);
+ }
+
+ @Override
+ public boolean unregisterAnimationCallback(AnimationCallback callback) {
+ return mCallbacks.remove(callback);
+ }
+
+ @Override
+ public void clearAnimationCallbacks() {
+ mCallbacks.clear();
+ }
+ }
+
+ public class MockDrawable extends Drawable {
+ @Override
+ public void draw(Canvas canvas) {
+ }
+
+ @Override
+ public int getOpacity() {
+ return 0;
+ }
+
+ @Override
+ public void setAlpha(int alpha) {
+ }
+
+ @Override
+ public void setColorFilter(ColorFilter cf) {
+ }
+ }
+}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/res/content/AppCompatResourcesTestCase.java b/appcompat/src/androidTest/java/androidx/appcompat/res/content/AppCompatResourcesTestCase.java
new file mode 100644
index 0000000..6cf62e0
--- /dev/null
+++ b/appcompat/src/androidTest/java/androidx/appcompat/res/content/AppCompatResourcesTestCase.java
@@ -0,0 +1,70 @@
+/*
+ * 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.appcompat.res.content;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import android.app.Activity;
+import android.content.res.ColorStateList;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.content.res.AppCompatResources;
+import androidx.appcompat.test.R;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.rule.ActivityTestRule;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@SmallTest
+@RunWith(AndroidJUnit4.class)
+public class AppCompatResourcesTestCase {
+ @Rule
+ public final ActivityTestRule<AppCompatActivity> mActivityTestRule;
+
+ public AppCompatResourcesTestCase() {
+ mActivityTestRule = new ActivityTestRule<>(AppCompatActivity.class);
+ }
+
+ @Test
+ public void testColorStateListCaching() {
+ final Activity context = mActivityTestRule.getActivity();
+ final ColorStateList result1 = AppCompatResources.getColorStateList(
+ context, R.color.color_state_list_themed_attrs);
+ final ColorStateList result2 = AppCompatResources.getColorStateList(
+ context, R.color.color_state_list_themed_attrs);
+ assertNotNull(result1);
+ assertNotNull(result2);
+ assertEquals(result1, result2);
+ }
+
+ @Test
+ public void testGetDrawableVectorResource() {
+ final Activity context = mActivityTestRule.getActivity();
+ assertNotNull(AppCompatResources.getDrawable(context, R.drawable.test_vector_off));
+ }
+
+ @Test
+ public void testGetAnimatedStateListDrawable() {
+ final Activity context = mActivityTestRule.getActivity();
+ assertNotNull(AppCompatResources.getDrawable(context, R.drawable.asl_heart));
+ }
+
+}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/testutils/NightModeUtils.java b/appcompat/src/androidTest/java/androidx/appcompat/testutils/NightModeUtils.java
index 6d7ef15..502b25a 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/testutils/NightModeUtils.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/testutils/NightModeUtils.java
@@ -19,61 +19,31 @@
import static org.junit.Assert.assertEquals;
import android.app.Instrumentation;
-import android.content.Context;
import android.content.res.Configuration;
-import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
-import androidx.appcompat.app.AppCompatDelegate.NightMode;
-import androidx.lifecycle.Lifecycle;
+import androidx.appcompat.app.AppCompatDelegate;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
-import androidx.testutils.LifecycleOwnerUtils;
public class NightModeUtils {
- public static void assertConfigurationNightModeEquals(int expectedNightMode,
- @NonNull Context context) {
- assertConfigurationNightModeEquals(expectedNightMode,
- context.getResources().getConfiguration());
- }
-
public static void assertConfigurationNightModeEquals(
int expectedNightMode, Configuration configuration) {
assertEquals(expectedNightMode, configuration.uiMode & Configuration.UI_MODE_NIGHT_MASK);
}
- public static <T extends AppCompatActivity> void setLocalNightModeAndWait(
- final ActivityTestRule<T> activityRule, @NightMode final int nightMode
- ) throws Throwable {
- setLocalNightModeAndWait(activityRule.getActivity(), activityRule, nightMode);
- }
-
- public static <T extends AppCompatActivity> void setLocalNightModeAndWait(
- final AppCompatActivity activity,
- final ActivityTestRule<T> activityRule,
- @NightMode final int nightMode
+ public static void setLocalNightModeAndWait(
+ final ActivityTestRule<? extends AppCompatActivity> activityRule,
+ @AppCompatDelegate.NightMode final int nightMode
) throws Throwable {
final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
activityRule.runOnUiThread(new Runnable() {
@Override
public void run() {
- activity.getDelegate().setLocalNightMode(nightMode);
+ activityRule.getActivity().getDelegate().setLocalNightMode(nightMode);
}
});
instrumentation.waitForIdleSync();
}
-
- public static <T extends AppCompatActivity> void setLocalNightModeAndWaitForDestroy(
- final ActivityTestRule<T> activityRule, @NightMode final int nightMode
- ) throws Throwable {
- final T activity = activityRule.getActivity();
- activityRule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- activity.getDelegate().setLocalNightMode(nightMode);
- }
- });
- LifecycleOwnerUtils.waitUntilState(activity, activityRule, Lifecycle.State.DESTROYED);
- }
}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/testutils/TestUtilsActions.java b/appcompat/src/androidTest/java/androidx/appcompat/testutils/TestUtilsActions.java
index 67224bd..78b05c7 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/testutils/TestUtilsActions.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/testutils/TestUtilsActions.java
@@ -22,8 +22,6 @@
import static org.hamcrest.core.AllOf.allOf;
-import android.app.Activity;
-import android.content.pm.ActivityInfo;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.view.View;
@@ -188,34 +186,4 @@
}
};
}
-
- public static ViewAction rotateScreenOrientation(final Activity activity) {
- return new ViewAction() {
- @Override
- public Matcher<View> getConstraints() {
- return isDisplayed();
- }
-
- @Override
- public String getDescription() {
- return "Rotating screen orientation";
- }
-
- @Override
- public void perform(UiController uiController, View view) {
- uiController.loopMainThreadUntilIdle();
-
- switch (activity.getRequestedOrientation()) {
- case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:
- activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
- break;
- default:
- activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
- break;
- }
-
- uiController.loopMainThreadUntilIdle();
- }
- };
- }
}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatBaseImageViewTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatBaseImageViewTest.java
index bcd8c08..ba2fc74 100755
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatBaseImageViewTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatBaseImageViewTest.java
@@ -210,45 +210,6 @@
}
/**
- * Tests for behavior around setting a tint list without setting a tint mode
- */
- @Test
- @SmallTest
- public void testImageTintingWithDefaultMode() {
- final @IdRes int viewId = R.id.view_untinted_source;
- final Resources res = mActivity.getResources();
- final T view = (T) mContainer.findViewById(viewId);
-
- @ColorInt final int sandDefault = ResourcesCompat.getColor(
- res, R.color.sand_default, null);
- @ColorInt final int sandDisabled = ResourcesCompat.getColor(
- res, R.color.sand_disabled, null);
-
- // This is the fill color of R.drawable.test_drawable_blue set on our view
- // that we'll be testing in this method
- @ColorInt final int sourceColor = ResourcesCompat.getColor(
- res, R.color.test_blue, null);
-
- final ColorStateList sandColorStateList = ResourcesCompat.getColorStateList(
- res, R.color.color_state_list_sand, null);
-
- // Test the default state for tinting set up in the layout XML file.
- verifyImageSourceIsColoredAs("Default no tinting in enabled state",
- view, sourceColor, 0);
-
- // Applying the tint should immediately switch colors
- onView(withId(viewId)).perform(
- AppCompatTintableViewActions.setImageSourceTintList(sandColorStateList));
- verifyImageSourceIsColoredAs("Enabled sand tint after supplying tint list",
- view, sandDefault, 0);
-
- // Disabling the view should now switch colors
- onView(withId(viewId)).perform(setEnabled(false));
- verifyImageSourceIsColoredAs("Disabled sand tint after disabling view",
- view, sandDisabled, 0);
- }
-
- /**
* This method tests that opaque tinting applied to tintable image source
* is applied correctly after changing the image source itself.
*/
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatBaseViewTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatBaseViewTest.java
index aa56c6b..2dd5ce0 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatBaseViewTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatBaseViewTest.java
@@ -45,7 +45,7 @@
import androidx.core.content.res.ResourcesCompat;
import androidx.core.graphics.ColorUtils;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
@@ -60,7 +60,6 @@
* base view class (such as <code>AppCompatTextView</code>'s all-caps support).
*/
@RunWith(AndroidJUnit4.class)
-@MediumTest
public abstract class AppCompatBaseViewTest<A extends BaseTestActivity, T extends View> {
@Rule
public final ActivityTestRule<A> mActivityTestRule;
@@ -102,6 +101,7 @@
* tintable view has no background.
*/
@Test
+ @SmallTest
public void testBackgroundTintingWithNoBackground() {
if (hasBackgroundByDefault()) {
return;
@@ -145,6 +145,7 @@
* tintable view has no background.
*/
@Test
+ @SmallTest
public void testBackgroundTintingViewCompatWithNoBackground() {
if (hasBackgroundByDefault()) {
return;
@@ -188,6 +189,7 @@
* background tint lists on the same background.
*/
@Test
+ @SmallTest
public void testBackgroundTintingAcrossStateChange() {
final @IdRes int viewId = R.id.view_tinted_background;
final T view = (T) mContainer.findViewById(viewId);
@@ -268,6 +270,7 @@
* background tint lists on the same background.
*/
@Test
+ @SmallTest
public void testBackgroundTintingViewCompatAcrossStateChange() {
final @IdRes int viewId = R.id.view_tinted_background;
final T view = (T) mContainer.findViewById(viewId);
@@ -349,6 +352,7 @@
* background tinting mode.
*/
@Test
+ @SmallTest
public void testBackgroundTintingAcrossModeChange() {
final @IdRes int viewId = R.id.view_untinted_background;
final T view = (T) mContainer.findViewById(viewId);
@@ -417,6 +421,7 @@
* background tinting mode.
*/
@Test
+ @SmallTest
public void testBackgroundTintingViewCompatAcrossModeChange() {
final @IdRes int viewId = R.id.view_untinted_background;
final T view = (T) mContainer.findViewById(viewId);
@@ -484,6 +489,7 @@
* is applied correctly after changing the background itself of the view.
*/
@Test
+ @SmallTest
public void testBackgroundOpaqueTintingAcrossBackgroundChange() {
final @IdRes int viewId = R.id.view_tinted_no_background;
final T view = (T) mContainer.findViewById(viewId);
@@ -542,6 +548,7 @@
* is applied correctly after changing the background itself of the view.
*/
@Test
+ @SmallTest
public void testBackgroundTranslucentTintingAcrossBackgroundChange() {
final @IdRes int viewId = R.id.view_untinted_no_background;
final T view = (T) mContainer.findViewById(viewId);
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatButtonAutoSizeTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatButtonAutoSizeTest.java
index 9d1157e..f2da2e8 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatButtonAutoSizeTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatButtonAutoSizeTest.java
@@ -17,11 +17,11 @@
package androidx.appcompat.widget;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class AppCompatButtonAutoSizeTest extends
AppCompatBaseAutoSizeTest<AppCompatButtonAutoSizeActivity, AppCompatButton> {
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatButtonTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatButtonTest.java
index 3bc8f73..9da53cd 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatButtonTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatButtonTest.java
@@ -25,7 +25,7 @@
import androidx.appcompat.test.R;
import androidx.core.content.res.ResourcesCompat;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
@@ -33,7 +33,7 @@
* In addition to all tinting-related tests done by the base class, this class provides
* tests specific to {@link AppCompatButton} class.
*/
-@LargeTest
+@SmallTest
public class AppCompatButtonTest
extends AppCompatBaseViewTest<AppCompatButtonActivity, AppCompatButton> {
public AppCompatButtonTest() {
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatCheckBoxTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatCheckBoxTest.java
index 40272a4..6dec2f0 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatCheckBoxTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatCheckBoxTest.java
@@ -29,8 +29,8 @@
import androidx.core.content.res.ResourcesCompat;
import androidx.core.widget.CompoundButtonCompat;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -38,7 +38,7 @@
/**
* Provides tests specific to {@link AppCompatCheckBox} class.
*/
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class AppCompatCheckBoxTest extends AppCompatBaseViewTest<AppCompatCheckBoxActivity,
AppCompatCheckBox> {
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextTest.java
index bc5214f..b9e6a32 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextTest.java
@@ -27,8 +27,8 @@
import androidx.appcompat.test.R;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Rule;
@@ -38,7 +38,7 @@
/**
* Tests for the {@link AppCompatEditText} class.
*/
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class AppCompatEditTextTest {
@Rule
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatImageViewTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatImageViewTest.java
index 8f06fff..ec701131 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatImageViewTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatImageViewTest.java
@@ -22,7 +22,7 @@
import androidx.appcompat.test.R;
import androidx.appcompat.testutils.TestUtilsMatchers;
import androidx.test.espresso.ViewInteraction;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
@@ -30,7 +30,7 @@
* In addition to all tinting-related tests done by the base class, this class provides
* tests specific to {@link AppCompatImageView} class.
*/
-@LargeTest
+@SmallTest
public class AppCompatImageViewTest extends AppCompatBaseImageViewTest<AppCompatImageView> {
public AppCompatImageViewTest() {
super(AppCompatImageViewActivity.class);
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatRadioButtonTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatRadioButtonTest.java
index fbbd6b2..dee4845 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatRadioButtonTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatRadioButtonTest.java
@@ -29,8 +29,8 @@
import androidx.core.content.res.ResourcesCompat;
import androidx.core.widget.CompoundButtonCompat;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -38,7 +38,7 @@
/**
* Provides tests specific to {@link AppCompatRadioButton} class.
*/
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class AppCompatRadioButtonTest extends AppCompatBaseViewTest<AppCompatRadioButtonActivity,
AppCompatRadioButton> {
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatSpinnerTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatSpinnerTest.java
index d4267b0..5afa7d7 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatSpinnerTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatSpinnerTest.java
@@ -31,7 +31,6 @@
import android.content.pm.ActivityInfo;
import android.content.res.Resources;
-import android.os.SystemClock;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
@@ -42,6 +41,7 @@
import androidx.core.content.res.ResourcesCompat;
import androidx.test.filters.LargeTest;
import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.hamcrest.Matcher;
import org.junit.After;
@@ -51,7 +51,7 @@
* In addition to all tinting-related tests done by the base class, this class provides
* tests specific to {@link AppCompatSpinner} class.
*/
-@LargeTest
+@SmallTest
public class AppCompatSpinnerTest
extends AppCompatBaseViewTest<AppCompatSpinnerActivity, AppCompatSpinner> {
private static final String EARTH = "Earth";
@@ -69,18 +69,12 @@
@Override
public void setUp() {
super.setUp();
- if (mActivity.getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
- mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
- SystemClock.sleep(250);
- }
+ mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
@After
public void cleanUp() {
- if (mActivity.getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
- mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
- SystemClock.sleep(250);
- }
+ mActivity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
/**
@@ -169,13 +163,13 @@
assertThat(dialogPopup.mPopup, instanceOf(AlertDialog.class));
}
- @LargeTest
+ @MediumTest
@Test
public void testChangeOrientationDialogPopupPersists() {
verifyChangeOrientationPopupPersists(R.id.spinner_dialog_popup);
}
- @LargeTest
+ @MediumTest
@Test
public void testChangeOrientationDropdownPopupPersists() {
verifyChangeOrientationPopupPersists(R.id.spinner_dropdown_popup);
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeTest.java
index 75c2b92..5d766a6 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeTest.java
@@ -32,15 +32,15 @@
import androidx.appcompat.test.R;
import androidx.core.widget.TextViewCompat;
import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
-import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.lang.reflect.Field;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class AppCompatTextViewAutoSizeTest extends
AppCompatBaseAutoSizeTest<AppCompatTextViewAutoSizeActivity, AppCompatTextView> {
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatTextViewTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatTextViewTest.java
index 9b4e2ad..aa4d5f3 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatTextViewTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatTextViewTest.java
@@ -19,7 +19,6 @@
import static androidx.appcompat.testutils.TestUtilsActions.setTextAppearance;
import static androidx.appcompat.testutils.TestUtilsMatchers.isBackground;
import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.action.ViewActions.scrollTo;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
@@ -34,7 +33,6 @@
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.Paint;
-import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.VectorDrawable;
@@ -49,19 +47,16 @@
import androidx.annotation.ColorInt;
import androidx.annotation.GuardedBy;
-import androidx.appcompat.content.res.AppCompatResources;
import androidx.appcompat.test.R;
-import androidx.appcompat.testutils.TestUtils;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
-import androidx.core.graphics.ColorUtils;
import androidx.core.text.PrecomputedTextCompat;
import androidx.core.view.ViewCompat;
import androidx.core.widget.TextViewCompat;
import androidx.test.annotation.UiThreadTest;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
import org.junit.Test;
@@ -79,7 +74,7 @@
* In addition to all tinting-related tests done by the base class, this class provides
* tests specific to {@link AppCompatTextView} class.
*/
-@LargeTest
+@SmallTest
public class AppCompatTextViewTest
extends AppCompatBaseViewTest<AppCompatTextViewActivity, AppCompatTextView> {
private static final String SAMPLE_TEXT_1 = "Hello, World!";
@@ -1012,167 +1007,4 @@
final String msg = "Expected 3em character is 'h' but actual 3em character is " + actual;
assertEquals(msg, 'h', find3EmChar(tv.getPaint()));
}
-
- @Test
- public void testCompoundDrawablesTint() {
- // Given an ACTV with a white drawableLeftCompat set and a #f0f drawableTint
- final AppCompatTextView textView = mActivity.findViewById(
- R.id.text_view_compound_drawable_tint);
- final int tint = 0xffff00ff;
- // Then the drawable should be tinted
- final Drawable drawable = textView.getCompoundDrawables()[0];
- TestUtils.assertAllPixelsOfColor(
- "Tint not applied to AppCompatTextView compound drawable",
- drawable,
- drawable.getIntrinsicWidth(),
- drawable.getIntrinsicHeight(),
- true,
- tint,
- 0,
- true);
- // Then the TextViewCompat getter should return the tint
- assertEquals(ColorStateList.valueOf(tint),
- TextViewCompat.getCompoundDrawableTintList(textView));
- }
-
- @Test
- public void testCompoundDrawablesTintList() {
- // Given an ACTV with a white drawableLeftCompat and a ColorStateList drawableTint set
- final AppCompatTextView textView = mActivity.findViewById(
- R.id.text_view_compound_drawable_tint_list);
- final int defaultTint = ResourcesCompat.getColor(mResources, R.color.lilac_default, null);
- final int disabledTint = ResourcesCompat.getColor(mResources, R.color.lilac_disabled, null);
-
- // Then the initial drawable tint is applied
- final Drawable drawable = textView.getCompoundDrawables()[0];
- TestUtils.assertAllPixelsOfColor(
- "Tint not applied to AppCompatTextView compound drawable",
- drawable,
- drawable.getIntrinsicWidth(),
- drawable.getIntrinsicHeight(),
- true,
- defaultTint,
- 0,
- true);
-
- // When the view is disabled
- onView(withId(textView.getId())).perform(scrollTo(), setEnabled(false));
- // Then the appropriate drawable tint is applied
- TestUtils.assertAllPixelsOfColor(
- "Tint not applied to AppCompatTextView compound drawable",
- drawable,
- drawable.getIntrinsicWidth(),
- drawable.getIntrinsicHeight(),
- true,
- disabledTint,
- 0,
- true);
- }
-
- @Test
- public void testCompoundDrawablesTintMode() {
- // Given an ACTV with a red drawableLeft, a semi-transparent blue drawableTint
- // & drawableTintMode of src_over
- final AppCompatTextView textView = mActivity.findViewById(
- R.id.text_view_compound_drawable_tint_mode);
- final int expected = ColorUtils.compositeColors(0x800000ff, 0xffff0000);
- final int tolerance = 2; // allow some tolerance for the blending
- // Then the drawable should be tinted
- final Drawable drawable = textView.getCompoundDrawables()[0];
- TestUtils.assertAllPixelsOfColor(
- "Tint not applied to AppCompatTextView compound drawable",
- drawable,
- drawable.getIntrinsicWidth(),
- drawable.getIntrinsicHeight(),
- true,
- expected,
- tolerance,
- true);
- // Then the TextViewCompat getter returns the mode
- assertEquals(PorterDuff.Mode.SRC_OVER,
- TextViewCompat.getCompoundDrawableTintMode(textView));
- }
-
- @Test
- public void testSetCompoundDrawablesTintList() {
- // Given an ACTV with a compound drawable
- final AppCompatTextView textView = new AppCompatTextView(mActivity);
- textView.setCompoundDrawables(AppCompatResources.getDrawable(
- mActivity, R.drawable.white_square), null, null, null);
-
- // When a tint is set programmatically
- final int tint = 0xffa4c639;
- final ColorStateList tintList = ColorStateList.valueOf(tint);
- TextViewCompat.setCompoundDrawableTintList(textView, tintList);
-
- // Then the drawable should be tinted
- final Drawable drawable = textView.getCompoundDrawables()[0];
- TestUtils.assertAllPixelsOfColor(
- "Tint not applied to AppCompatTextView compound drawable",
- drawable,
- drawable.getIntrinsicWidth(),
- drawable.getIntrinsicHeight(),
- true,
- tint,
- 0,
- true);
- // Then the TextViewCompat getter should return the tint
- assertEquals(tintList, TextViewCompat.getCompoundDrawableTintList(textView));
- }
-
- @Test
- public void testSetCompoundDrawablesTintMode() {
- // Given an ACTV with a red compound drawable
- final AppCompatTextView textView = new AppCompatTextView(mActivity);
- textView.setCompoundDrawables(AppCompatResources.getDrawable(
- mActivity, R.drawable.red_square), null, null, null);
-
- // When a semi-transparent blue tint is set programmatically with a mode of SRC_OVER
- final int tint = 0x800000ff;
- final PorterDuff.Mode mode = PorterDuff.Mode.SRC_OVER;
- final ColorStateList tintList = ColorStateList.valueOf(tint);
- TextViewCompat.setCompoundDrawableTintList(textView, tintList);
- TextViewCompat.setCompoundDrawableTintMode(textView, mode);
- final int expected = ColorUtils.compositeColors(tint, 0xffff0000);
- final int tolerance = 2; // allow some tolerance for the blending
-
- // Then the drawable should be tinted
- final Drawable drawable = textView.getCompoundDrawables()[0];
- TestUtils.assertAllPixelsOfColor(
- "Tint not applied to AppCompatTextView compound drawable",
- drawable,
- drawable.getIntrinsicWidth(),
- drawable.getIntrinsicHeight(),
- true,
- expected,
- tolerance,
- true);
- // Then the TextViewCompat getter should return the tint mode
- assertEquals(mode, TextViewCompat.getCompoundDrawableTintMode(textView));
- }
-
-
- @Test
- public void testCompoundDrawablesSetAfterTint() {
- // Given an ACTV with a magenta tint
- final AppCompatTextView textView = new AppCompatTextView(mActivity);
- final int tint = 0xffff00ff;
- TextViewCompat.setCompoundDrawableTintList(textView, ColorStateList.valueOf(tint));
-
- // When a white compound drawable is set
- textView.setCompoundDrawables(AppCompatResources.getDrawable(
- mActivity, R.drawable.white_square), null, null, null);
-
- // Then the drawable should be tinted
- final Drawable drawable = textView.getCompoundDrawables()[0];
- TestUtils.assertAllPixelsOfColor(
- "Tint not applied to AppCompatTextView compound drawable",
- drawable,
- drawable.getIntrinsicWidth(),
- drawable.getIntrinsicHeight(),
- true,
- tint,
- 0,
- true);
- }
}
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/ListPopupWindowTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/ListPopupWindowTest.java
index 183e22c..c38fe17 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/ListPopupWindowTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/ListPopupWindowTest.java
@@ -27,9 +27,7 @@
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Matchers.any;
@@ -61,7 +59,6 @@
import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;
import androidx.test.filters.MediumTest;
-import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -293,47 +290,6 @@
}
@Test
- @SmallTest
- public void testAccessEpicenter() {
- new Builder().configure();
- final Rect initialRect = new Rect(10, 10, 20, 20);
- assertNull(mListPopupWindow.getEpicenterBounds());
-
- mListPopupWindow.setEpicenterBounds(initialRect);
- assertEquals(initialRect, mListPopupWindow.getEpicenterBounds());
-
- mListPopupWindow.setEpicenterBounds(null);
- assertNull(mListPopupWindow.getEpicenterBounds());
- }
-
- @Test
- @SmallTest
- public void testEpicenterSetterImmutability() {
- new Builder().configure();
- final Rect initialRect = new Rect(10, 10, 20, 20);
-
- mListPopupWindow.setEpicenterBounds(initialRect);
- assertEquals(initialRect, mListPopupWindow.getEpicenterBounds());
-
- initialRect.offset(5, 5);
- assertNotEquals(initialRect, mListPopupWindow.getEpicenterBounds());
- }
-
- @Test
- @SmallTest
- public void testEpicenterGetterImmutability() {
- new Builder().configure();
- final Rect initialRect = new Rect(10, 10, 20, 20);
-
- mListPopupWindow.setEpicenterBounds(initialRect);
- final Rect retrievedRect = mListPopupWindow.getEpicenterBounds();
- assertEquals(initialRect, retrievedRect);
-
- retrievedRect.offset(5, 5);
- assertNotEquals(initialRect, retrievedRect);
- }
-
- @Test
@MediumTest
public void testItemClickViaAPI() throws Throwable {
Builder popupBuilder = new Builder().withItemClickListener();
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/PopupMenuTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/PopupMenuTest.java
index f87fcd5..6004bb6 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/PopupMenuTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/PopupMenuTest.java
@@ -65,6 +65,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -82,7 +83,6 @@
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-@LargeTest
public class PopupMenuTest {
@Rule
public final ActivityTestRule<PopupTestActivity> mActivityTestRule =
@@ -127,6 +127,7 @@
}
@Test
+ @MediumTest
public void testBasicContent() throws Throwable {
final Builder menuBuilder = new Builder();
menuBuilder.wireToActionButton();
@@ -314,6 +315,7 @@
@FlakyTest(bugId = 33669575)
@Test
+ @LargeTest
public void testAnchoring() {
Builder menuBuilder = new Builder();
menuBuilder.wireToActionButton();
@@ -347,6 +349,7 @@
}
@Test
+ @MediumTest
public void testDismissalViaAPI() throws Throwable {
Builder menuBuilder = new Builder().withDismissListener();
menuBuilder.wireToActionButton();
@@ -370,6 +373,7 @@
}
@Test
+ @MediumTest
public void testDismissalViaTouch() throws Throwable {
Builder menuBuilder = new Builder().withDismissListener();
menuBuilder.wireToActionButton();
@@ -425,6 +429,7 @@
}
@Test
+ @MediumTest
public void testSimpleMenuItemClickViaEvent() {
Builder menuBuilder = new Builder().withMenuItemClickListener();
menuBuilder.wireToActionButton();
@@ -447,6 +452,7 @@
}
@Test
+ @MediumTest
public void testSimpleMenuItemClickViaAPI() throws Throwable {
Builder menuBuilder = new Builder().withMenuItemClickListener();
menuBuilder.wireToActionButton();
@@ -472,6 +478,7 @@
}
@Test
+ @MediumTest
public void testSubMenuClicksViaEvent() throws Throwable {
Builder menuBuilder = new Builder().withMenuItemClickListener();
menuBuilder.wireToActionButton();
@@ -533,6 +540,7 @@
}
@Test
+ @MediumTest
@Ignore
public void testSubMenuClicksViaAPI() throws Throwable {
Builder menuBuilder = new Builder().withMenuItemClickListener();
@@ -602,6 +610,7 @@
}
@Test
+ @MediumTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
public void testHoverSelectsMenuItem() throws Throwable {
Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/SwitchCompatTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/SwitchCompatTest.java
index 2119a2a..bea1cd3 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/SwitchCompatTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/SwitchCompatTest.java
@@ -30,7 +30,7 @@
import androidx.appcompat.test.R;
import androidx.core.content.res.ResourcesCompat;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
@@ -41,7 +41,7 @@
/**
* Provides tests specific to {@link SwitchCompat} class.
*/
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class SwitchCompatTest {
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/TintResourcesTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/TintResourcesTest.java
index 6213985..d3afb0a 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/TintResourcesTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/TintResourcesTest.java
@@ -24,14 +24,14 @@
import androidx.appcompat.app.AppCompatActivity;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class TintResourcesTest {
@Rule
diff --git a/appcompat/src/androidTest/java/androidx/appcompat/widget/ToolbarTest.java b/appcompat/src/androidTest/java/androidx/appcompat/widget/ToolbarTest.java
index 047a560..3a96981 100644
--- a/appcompat/src/androidTest/java/androidx/appcompat/widget/ToolbarTest.java
+++ b/appcompat/src/androidTest/java/androidx/appcompat/widget/ToolbarTest.java
@@ -16,25 +16,19 @@
package androidx.appcompat.widget;
-import static androidx.appcompat.testutils.TestUtils.assertCenterPixelOfColor;
-
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
import android.app.Activity;
import android.app.Instrumentation;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
-import android.view.Menu;
import android.view.MenuItem;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.appcompat.test.R;
import androidx.appcompat.testutils.TestUtils;
-import androidx.test.espresso.Espresso;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -46,7 +40,7 @@
/**
* Test {@link Toolbar}.
*/
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class ToolbarTest {
@@ -144,40 +138,4 @@
assertEquals(expectedColor, toolbar.getTitleTextView().getCurrentTextColor());
assertEquals(expectedColor, toolbar.getSubtitleTextView().getCurrentTextColor());
}
-
- @Test
- public void testToolbarMenuFromXml() {
- final Toolbar toolbar = mActivity.findViewById(R.id.toolbar_menu);
- final Menu menu = toolbar.getMenu();
-
- assertNotEquals(0, menu.size());
- assertNotNull(menu.findItem(R.id.action_search));
- }
-
- @Test
- public void testToolbarOverflowIconWithThemedCSL() throws Throwable {
- final Toolbar toolbar = mActivity.findViewById(R.id.toolbar_themedcsl_colorcontrolnormal);
-
- // Inflate a menu so that the overflow is displayed
- mActivityRule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- toolbar.inflateMenu(R.menu.popup_menu);
- }
- });
- Espresso.onIdle();
-
- // Assert that the overflow icon is tinted magenta, as per the theme
- final Drawable icon = toolbar.getOverflowIcon();
- assertNotNull(icon);
- assertCenterPixelOfColor(
- "Overflow icon is not tinted",
- icon,
- icon.getIntrinsicWidth(),
- icon.getIntrinsicHeight(),
- false,
- 0xFFFF00FF,
- 10,
- false);
- }
}
diff --git a/appcompat/src/androidTest/res/anim/animation_grouping_1_01.xml b/appcompat/src/androidTest/res/anim/animation_grouping_1_01.xml
new file mode 100644
index 0000000..34b2cef
--- /dev/null
+++ b/appcompat/src/androidTest/res/anim/animation_grouping_1_01.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <objectAnimator
+ android:duration="50"
+ android:propertyName="rotation"
+ android:repeatCount="2"
+ android:valueFrom="0"
+ android:valueTo="180"/>
+</set>
diff --git a/appcompat/src/androidTest/res/color/color_state_theme_coloraccent.xml b/appcompat/src/androidTest/res/color/color_state_theme_coloraccent.xml
deleted file mode 100644
index 0bab11b..0000000
--- a/appcompat/src/androidTest/res/color/color_state_theme_coloraccent.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2019 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.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="?attr/colorAccent" />
-</selector>
\ No newline at end of file
diff --git a/appcompat/src/androidTest/res/drawable/animated_state_list_density.xml b/appcompat/src/androidTest/res/drawable/animated_state_list_density.xml
new file mode 100644
index 0000000..8781877
--- /dev/null
+++ b/appcompat/src/androidTest/res/drawable/animated_state_list_density.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+
+<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/focused"
+ android:drawable="@drawable/state_list_density_1"
+ android:state_focused="true"/>
+ <item
+ android:id="@+id/unfocused"
+ android:drawable="@drawable/state_list_density_2"/>
+ <transition
+ android:drawable="@drawable/animation_list_transition_1"
+ android:fromId="@id/unfocused"
+ android:toId="@id/focused"/>
+ <transition
+ android:drawable="@drawable/animation_list_transition_2"
+ android:fromId="@id/focused"
+ android:toId="@id/unfocused"/>
+</animated-selector>
diff --git a/appcompat/src/androidTest/res/drawable/animated_state_list_with_avd.xml b/appcompat/src/androidTest/res/drawable/animated_state_list_with_avd.xml
new file mode 100644
index 0000000..9114e5d
--- /dev/null
+++ b/appcompat/src/androidTest/res/drawable/animated_state_list_with_avd.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+
+<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:state_focused="true"
+ android:id="@+id/focused"
+ android:drawable="@drawable/red" />
+ <item
+ android:state_checked="false"
+ android:id="@+id/unchecked"
+ android:drawable="@drawable/black" />
+ <transition
+ android:fromId="@+id/unchecked"
+ android:toId="@+id/focused">
+ <!--empty avd -->
+ <animated-vector
+ android:drawable="@drawable/vector_drawable_grouping_1" >
+ </animated-vector>
+ </transition>
+ <transition
+ android:fromId="@+id/focused"
+ android:toId="@+id/unchecked">
+ <animated-vector
+ android:drawable="@drawable/vector_drawable_grouping_1" >
+ <target
+ android:name="sun"
+ android:animation="@anim/animation_grouping_1_01" />
+ <target
+ android:name="earth"
+ android:animation="@anim/animation_grouping_1_01" />
+ </animated-vector>
+ </transition>
+ <item
+ android:state_checked="true"
+ android:drawable="@drawable/blue" />
+ <item
+ android:state_activated="true"
+ android:drawable="@drawable/yellow" />
+</animated-selector>
diff --git a/appcompat/src/androidTest/res/drawable/animation_list_transition_1.xml b/appcompat/src/androidTest/res/drawable/animation_list_transition_1.xml
new file mode 100644
index 0000000..68baf28
--- /dev/null
+++ b/appcompat/src/androidTest/res/drawable/animation_list_transition_1.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+
+<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:drawable="@drawable/state_list_density_1"
+ android:duration="15"/>
+</animation-list>
diff --git a/appcompat/resources/src/androidTest/res/drawable/animation_list_transition_2.xml b/appcompat/src/androidTest/res/drawable/animation_list_transition_2.xml
similarity index 100%
rename from appcompat/resources/src/androidTest/res/drawable/animation_list_transition_2.xml
rename to appcompat/src/androidTest/res/drawable/animation_list_transition_2.xml
diff --git a/appcompat/src/androidTest/res/drawable/asl_heart.xml b/appcompat/src/androidTest/res/drawable/asl_heart.xml
index 75427f8..b250d9f 100644
--- a/appcompat/src/androidTest/res/drawable/asl_heart.xml
+++ b/appcompat/src/androidTest/res/drawable/asl_heart.xml
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright 2019 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.
+ ~ Copyright (C) 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.
-->
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
diff --git a/appcompat/src/androidTest/res/drawable/asl_heart_embedded.xml b/appcompat/src/androidTest/res/drawable/asl_heart_embedded.xml
new file mode 100644
index 0000000..8fed37e
--- /dev/null
+++ b/appcompat/src/androidTest/res/drawable/asl_heart_embedded.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+
+<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:id="@+id/liked"
+ android:state_checked="true">
+ <vector
+ android:width="56dp"
+ android:height="56dp"
+ android:viewportHeight="56"
+ android:viewportWidth="56">
+ <path
+ android:fillColor="#fff"
+ android:pathData="M28,39 L26.405,37.5667575 C20.74,32.4713896 17,29.1089918 17,24.9945504 C17,21.6321526 19.6565,19 23.05,19 C24.964,19 26.801,19.8828338 28,21.2724796 C29.199,19.8828338 31.036,19 32.95,19 C36.3435,19 39,21.6321526 39,24.9945504 C39,29.1089918 35.26,32.4713896 29.595,37.5667575 L28,39 L28,39 Z"/>
+ </vector>
+ </item>
+
+ <item
+ android:id="@+id/not_liked"
+ android:drawable="@drawable/ic_heart_empty"/>
+
+ <transition
+ android:drawable="@drawable/avd_heart_fill"
+ android:fromId="@id/not_liked"
+ android:toId="@id/liked"/>
+
+ <transition
+ android:drawable="@drawable/avd_heart_empty"
+ android:fromId="@id/liked"
+ android:toId="@id/not_liked"/>
+
+</animated-selector>
diff --git a/appcompat/src/androidTest/res/drawable/avd_heart_empty.xml b/appcompat/src/androidTest/res/drawable/avd_heart_empty.xml
index db7c773..2d8c708 100644
--- a/appcompat/src/androidTest/res/drawable/avd_heart_empty.xml
+++ b/appcompat/src/androidTest/res/drawable/avd_heart_empty.xml
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright 2019 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.
+ ~ 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.
-->
<animated-vector
diff --git a/appcompat/src/androidTest/res/drawable/avd_heart_fill.xml b/appcompat/src/androidTest/res/drawable/avd_heart_fill.xml
index 01954d1..ed9c75b 100644
--- a/appcompat/src/androidTest/res/drawable/avd_heart_fill.xml
+++ b/appcompat/src/androidTest/res/drawable/avd_heart_fill.xml
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright 2019 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.
+ ~ 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.
-->
<animated-vector
diff --git a/appcompat/src/androidTest/res/drawable/ic_heart_empty.xml b/appcompat/src/androidTest/res/drawable/ic_heart_empty.xml
index 6243585..c8daef5 100644
--- a/appcompat/src/androidTest/res/drawable/ic_heart_empty.xml
+++ b/appcompat/src/androidTest/res/drawable/ic_heart_empty.xml
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright 2019 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.
+ ~ Copyright (C) 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.
-->
<vector
diff --git a/appcompat/src/androidTest/res/drawable/ic_heart_full.xml b/appcompat/src/androidTest/res/drawable/ic_heart_full.xml
index e045ed8..e11dd64 100644
--- a/appcompat/src/androidTest/res/drawable/ic_heart_full.xml
+++ b/appcompat/src/androidTest/res/drawable/ic_heart_full.xml
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright 2019 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.
+ ~ Copyright (C) 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.
-->
<vector
diff --git a/appcompat/src/androidTest/res/drawable/red_square.xml b/appcompat/src/androidTest/res/drawable/red_square.xml
deleted file mode 100644
index 7dbfa6f..0000000
--- a/appcompat/src/androidTest/res/drawable/red_square.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ 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.
- -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24"
- android:viewportHeight="24">
- <path
- android:fillColor="#f00"
- android:pathData="M0,0 L24,0 L24,24 L0,24z"/>
-</vector>
diff --git a/appcompat/resources/src/androidTest/res/drawable/state_list_density_1.jpeg b/appcompat/src/androidTest/res/drawable/state_list_density_1.jpeg
similarity index 100%
rename from appcompat/resources/src/androidTest/res/drawable/state_list_density_1.jpeg
rename to appcompat/src/androidTest/res/drawable/state_list_density_1.jpeg
Binary files differ
diff --git a/appcompat/resources/src/androidTest/res/drawable/state_list_density_2.jpeg b/appcompat/src/androidTest/res/drawable/state_list_density_2.jpeg
similarity index 100%
rename from appcompat/resources/src/androidTest/res/drawable/state_list_density_2.jpeg
rename to appcompat/src/androidTest/res/drawable/state_list_density_2.jpeg
Binary files differ
diff --git a/appcompat/src/androidTest/res/drawable/vector_drawable_grouping_1.xml b/appcompat/src/androidTest/res/drawable/vector_drawable_grouping_1.xml
new file mode 100644
index 0000000..a17fd62
--- /dev/null
+++ b/appcompat/src/androidTest/res/drawable/vector_drawable_grouping_1.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="64dp"
+ android:height="64dp"
+ android:viewportHeight="256"
+ android:viewportWidth="256">
+
+ <group
+ android:name="shape_layer_1"
+ android:translateX="128"
+ android:translateY="128">
+ <group android:name="sun">
+ <path
+ android:name="ellipse_path_1"
+ android:fillColor="#ffff8000"
+ android:pathData="m -25 0 a 25,25 0 1,0 50,0 a 25,25 0 1,0 -50,0"/>
+
+ <group
+ android:name="earth"
+ android:translateX="75">
+ <path
+ android:name="ellipse_path_1_1"
+ android:fillColor="#ff5656ea"
+ android:pathData="m -10 0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0"/>
+
+ <group
+ android:name="moon"
+ android:translateX="25">
+ <path
+ android:name="ellipse_path_1_2"
+ android:fillColor="#ffadadad"
+ android:pathData="m -5 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0"/>
+ </group>
+ </group>
+ </group>
+ </group>
+
+</vector>
diff --git a/appcompat/src/androidTest/res/drawable/white_square.xml b/appcompat/src/androidTest/res/drawable/white_square.xml
deleted file mode 100644
index df0bb2c..0000000
--- a/appcompat/src/androidTest/res/drawable/white_square.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ 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.
- -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24"
- android:viewportHeight="24">
- <path
- android:fillColor="#fff"
- android:pathData="M0,0 L24,0 L24,24 L0,24z"/>
-</vector>
diff --git a/appcompat/src/androidTest/res/layout/appcompat_textview_activity.xml b/appcompat/src/androidTest/res/layout/appcompat_textview_activity.xml
index fa04dfd..2b509ed 100644
--- a/appcompat/src/androidTest/res/layout/appcompat_textview_activity.xml
+++ b/appcompat/src/androidTest/res/layout/appcompat_textview_activity.xml
@@ -390,29 +390,6 @@
android:layout_height="wrap_content"
app:fontVariationSettings="'wdth' 30"
android:textAppearance="@style/TextView_FontVariation"/>
-
- <androidx.appcompat.widget.AppCompatTextView
- android:id="@+id/text_view_compound_drawable_tint"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- app:drawableLeftCompat="@drawable/white_square"
- app:drawableTint="#f0f"/>
-
- <androidx.appcompat.widget.AppCompatTextView
- android:id="@+id/text_view_compound_drawable_tint_list"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- app:drawableLeftCompat="@drawable/white_square"
- app:drawableTint="@color/color_state_list_lilac"/>
-
- <androidx.appcompat.widget.AppCompatTextView
- android:id="@+id/text_view_compound_drawable_tint_mode"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- app:drawableLeftCompat="@drawable/red_square"
- app:drawableTint="#800000ff"
- app:drawableTintMode="src_over"/>
-
</LinearLayout>
</ScrollView>
diff --git a/appcompat/src/androidTest/res/layout/appcompat_toolbar_activity.xml b/appcompat/src/androidTest/res/layout/appcompat_toolbar_activity.xml
index c1bab6a4..055f918 100644
--- a/appcompat/src/androidTest/res/layout/appcompat_toolbar_activity.xml
+++ b/appcompat/src/androidTest/res/layout/appcompat_toolbar_activity.xml
@@ -16,55 +16,38 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
- android:id="@+id/toolbar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="?attr/colorPrimaryDark"
- android:minHeight="?attr/actionBarSize"
- android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
- app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
+ android:id="@+id/toolbar"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:minHeight="?attr/actionBarSize"
+ android:background="?attr/colorPrimaryDark"
+ android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
+ app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<androidx.appcompat.widget.Toolbar
- android:id="@+id/toolbar_textcolor_csl"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="?attr/actionBarSize"
- app:subtitle="Subtitle"
- app:subtitleTextColor="@color/color_state_lilac_alpha"
- app:title="Title"
- app:titleTextColor="@color/color_state_lilac_alpha" />
+ android:id="@+id/toolbar_textcolor_csl"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ app:title="Title"
+ app:subtitle="Subtitle"
+ android:minHeight="?attr/actionBarSize"
+ app:titleTextColor="@color/color_state_lilac_alpha"
+ app:subtitleTextColor="@color/color_state_lilac_alpha"/>
<androidx.appcompat.widget.Toolbar
- android:id="@+id/toolbar_textcolor_hex"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="?attr/actionBarSize"
- app:subtitle="Subtitle"
- app:subtitleTextColor="#FF00FF"
- app:title="Title"
- app:titleTextColor="#FF00FF" />
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/toolbar_themedcsl_colorcontrolnormal"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="?attr/actionBarSize"
- android:theme="@style/ThemeOverlay.ThemedCslMagenta"
- app:subtitle="Subtitle"
- app:title="Title" />
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/toolbar_menu"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="?attr/actionBarSize"
- app:title="Title"
- app:menu="@menu/sample_actions" />
+ android:id="@+id/toolbar_textcolor_hex"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ app:title="Title"
+ app:subtitle="Subtitle"
+ android:minHeight="?attr/actionBarSize"
+ app:titleTextColor="#FF00FF"
+ app:subtitleTextColor="#FF00FF"/>
</LinearLayout>
\ No newline at end of file
diff --git a/appcompat/src/androidTest/res/values/styles.xml b/appcompat/src/androidTest/res/values/styles.xml
index d22dcb3..f387155 100644
--- a/appcompat/src/androidTest/res/values/styles.xml
+++ b/appcompat/src/androidTest/res/values/styles.xml
@@ -117,10 +117,4 @@
<style name="Theme.CustomFont" parent="@style/Theme.AppCompat.Light">
<item name="fontFamily">@font/a3em</item>
</style>
-
- <style name="ThemeOverlay.ThemedCslMagenta" parent="@style/ThemeOverlay.AppCompat.ActionBar">
- <item name="colorAccent">#FF00FF</item>
- <item name="colorControlNormal">@color/color_state_theme_coloraccent</item>
- </style>
-
</resources>
diff --git a/appcompat/src/main/java/androidx/appcompat/app/ActionBar.java b/appcompat/src/main/java/androidx/appcompat/app/ActionBar.java
index b24ca17..8575edb 100644
--- a/appcompat/src/main/java/androidx/appcompat/app/ActionBar.java
+++ b/appcompat/src/main/java/androidx/appcompat/app/ActionBar.java
@@ -16,7 +16,7 @@
package androidx.appcompat.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Configuration;
@@ -92,7 +92,7 @@
public abstract class ActionBar {
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
@IntDef({NAVIGATION_MODE_STANDARD, NAVIGATION_MODE_LIST, NAVIGATION_MODE_TABS})
public @interface NavigationMode {}
@@ -137,7 +137,7 @@
public static final int NAVIGATION_MODE_TABS = 2;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef(flag=true, value={
DISPLAY_USE_LOGO,
DISPLAY_SHOW_HOME,
@@ -866,7 +866,7 @@
* @return true if the Title field has been truncated
* @hide pending API approval
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isTitleTruncated() { return false; }
/**
@@ -1037,69 +1037,69 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setDefaultDisplayHomeAsUpEnabled(boolean enabled) {
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setShowHideAnimationEnabled(boolean enabled) {
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void onConfigurationChanged(Configuration config) {
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void dispatchMenuVisibilityChanged(boolean visible) {
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ActionMode startActionMode(ActionMode.Callback callback) {
return null;
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean openOptionsMenu() {
return false;
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean closeOptionsMenu() {
return false;
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean invalidateOptionsMenu() {
return false;
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean onMenuKeyEvent(KeyEvent event) {
return false;
}
/** @hide **/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean onKeyShortcut(int keyCode, KeyEvent ev) {
return false;
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean collapseActionView() {
return false;
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setWindowTitle(CharSequence title) {
}
@@ -1109,7 +1109,7 @@
* @return {@code true} if focus changes or {@code false} if focus doesn't change.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
boolean requestFocus() {
return false;
}
diff --git a/appcompat/src/main/java/androidx/appcompat/app/AlertDialog.java b/appcompat/src/main/java/androidx/appcompat/app/AlertDialog.java
index c0f2243..37c66d6 100644
--- a/appcompat/src/main/java/androidx/appcompat/app/AlertDialog.java
+++ b/appcompat/src/main/java/androidx/appcompat/app/AlertDialog.java
@@ -16,7 +16,7 @@
package androidx.appcompat.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Dialog;
import android.content.Context;
@@ -191,7 +191,7 @@
* Internal api to allow hinting for the best button panel layout.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void setButtonPanelLayoutHint(int layoutHint) {
mAlert.setButtonPanelLayoutHint(layoutHint);
}
@@ -926,9 +926,8 @@
* This is currently hidden because it seems like people should just
* be able to put padding around the view.
* @hide
- * @deprecated This method has been deprecated.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Deprecated
public Builder setView(View view, int viewSpacingLeft, int viewSpacingTop,
int viewSpacingRight, int viewSpacingBottom) {
@@ -961,7 +960,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Builder setRecycleOnMeasureEnabled(boolean enabled) {
P.mRecycleOnMeasure = enabled;
return this;
diff --git a/appcompat/src/main/java/androidx/appcompat/app/AppCompatActivity.java b/appcompat/src/main/java/androidx/appcompat/app/AppCompatActivity.java
index c34cc57..03e3f00 100644
--- a/appcompat/src/main/java/androidx/appcompat/app/AppCompatActivity.java
+++ b/appcompat/src/main/java/androidx/appcompat/app/AppCompatActivity.java
@@ -16,7 +16,6 @@
package androidx.appcompat.app;
-import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -68,12 +67,6 @@
private Resources mResources;
@Override
- protected void attachBaseContext(Context newBase) {
- super.attachBaseContext(newBase);
- getDelegate().attachBaseContext(newBase);
- }
-
- @Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
final AppCompatDelegate delegate = getDelegate();
delegate.installViewFactory();
diff --git a/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegate.java b/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegate.java
index 6dca0e7..8dd1948 100644
--- a/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegate.java
+++ b/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegate.java
@@ -16,7 +16,7 @@
package androidx.appcompat.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Activity;
import android.app.Dialog;
@@ -91,78 +91,49 @@
static final String TAG = "AppCompatDelegate";
/**
- * Mode which uses the system's night mode setting to determine if it is night or not.
- *
- * @see #setLocalNightMode(int)
- */
- public static final int MODE_NIGHT_FOLLOW_SYSTEM = -1;
-
- /**
- * Night mode which switches between dark and light mode depending on the time of day
- * (dark at night, light in the day).
- *
- * <p>The calculation used to determine whether it is night or not makes use of the location
- * APIs (if this app has the necessary permissions). This allows us to generate accurate
- * sunrise and sunset times. If this app does not have permission to access the location APIs
- * then we use hardcoded times which will be less accurate.</p>
- *
- * @deprecated Automatic switching of dark/light based on the current time is deprecated.
- * Considering using an explicit setting, or {@link #MODE_NIGHT_AUTO_BATTERY}.
- */
- @Deprecated
- public static final int MODE_NIGHT_AUTO_TIME = 0;
-
- /**
- * @deprecated Use {@link AppCompatDelegate#MODE_NIGHT_AUTO_TIME} instead
- */
- @Deprecated
- public static final int MODE_NIGHT_AUTO = MODE_NIGHT_AUTO_TIME;
-
- /**
- * Night mode which uses always uses a light mode, enabling {@code notnight} qualified
- * resources regardless of the time.
+ * Mode which means to not use night mode, and therefore prefer {@code notnight} qualified
+ * resources where available, regardless of the time.
*
* @see #setLocalNightMode(int)
*/
public static final int MODE_NIGHT_NO = 1;
/**
- * Night mode which uses always uses a dark mode, enabling {@code night} qualified
- * resources regardless of the time.
+ * Mode which means to always use night mode, and therefore prefer {@code night} qualified
+ * resources where available, regardless of the time.
*
* @see #setLocalNightMode(int)
*/
public static final int MODE_NIGHT_YES = 2;
/**
- * Night mode which uses a dark mode when the system's 'Battery Saver' feature is enabled,
- * otherwise it uses a 'light mode'. This mode can help the device to decrease power usage,
- * depending on the display technology in the device.
+ * Mode which means to use night mode when it is determined that it is night or not.
*
- * <em>Please note: this mode should only be used when running on devices which do not
- * provide a similar device-wide setting.</em>
+ * <p>The calculation used to determine whether it is night or not makes use of the location
+ * APIs (if this app has the necessary permissions). This allows us to generate accurate
+ * sunrise and sunset times. If this app does not have permission to access the location APIs
+ * then we use hardcoded times which will be less accurate.</p>
*
* @see #setLocalNightMode(int)
*/
- public static final int MODE_NIGHT_AUTO_BATTERY = 3;
+ public static final int MODE_NIGHT_AUTO = 0;
/**
- * An unspecified mode for night mode. This is primarily used with
- * {@link #setLocalNightMode(int)}, to allow the default night mode to be used.
- * If both the default and local night modes are set to this value, then the default value of
- * {@link #MODE_NIGHT_FOLLOW_SYSTEM} is applied.
+ * Mode which uses the system's night mode setting to determine if it is night or not.
*
- * @see AppCompatDelegate#setDefaultNightMode(int)
+ * @see #setLocalNightMode(int)
*/
- public static final int MODE_NIGHT_UNSPECIFIED = -100;
+ public static final int MODE_NIGHT_FOLLOW_SYSTEM = -1;
+
+ static final int MODE_NIGHT_UNSPECIFIED = -100;
@NightMode
- private static int sDefaultNightMode = MODE_NIGHT_UNSPECIFIED;
+ private static int sDefaultNightMode = MODE_NIGHT_FOLLOW_SYSTEM;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- @IntDef({MODE_NIGHT_NO, MODE_NIGHT_YES, MODE_NIGHT_AUTO_TIME, MODE_NIGHT_FOLLOW_SYSTEM,
- MODE_NIGHT_UNSPECIFIED, MODE_NIGHT_AUTO_BATTERY})
+ @RestrictTo(LIBRARY_GROUP)
+ @IntDef({MODE_NIGHT_NO, MODE_NIGHT_YES, MODE_NIGHT_AUTO, MODE_NIGHT_FOLLOW_SYSTEM,
+ MODE_NIGHT_UNSPECIFIED})
@Retention(RetentionPolicy.SOURCE)
public @interface NightMode {}
@@ -208,10 +179,8 @@
*
* @param callback An optional callback for AppCompat specific events
*/
- @NonNull
- public static AppCompatDelegate create(@NonNull Activity activity,
- @Nullable AppCompatCallback callback) {
- return new AppCompatDelegateImpl(activity, callback);
+ public static AppCompatDelegate create(Activity activity, AppCompatCallback callback) {
+ return new AppCompatDelegateImpl(activity, activity.getWindow(), callback);
}
/**
@@ -219,10 +188,8 @@
*
* @param callback An optional callback for AppCompat specific events
*/
- @NonNull
- public static AppCompatDelegate create(@NonNull Dialog dialog,
- @Nullable AppCompatCallback callback) {
- return new AppCompatDelegateImpl(dialog, callback);
+ public static AppCompatDelegate create(Dialog dialog, AppCompatCallback callback) {
+ return new AppCompatDelegateImpl(dialog.getContext(), dialog.getWindow(), callback);
}
/**
@@ -231,9 +198,8 @@
*
* @param callback An optional callback for AppCompat specific events
*/
- @NonNull
- public static AppCompatDelegate create(@NonNull Context context, @NonNull Window window,
- @Nullable AppCompatCallback callback) {
+ public static AppCompatDelegate create(Context context, Window window,
+ AppCompatCallback callback) {
return new AppCompatDelegateImpl(context, window, callback);
}
@@ -352,12 +318,6 @@
public abstract void addContentView(View v, ViewGroup.LayoutParams lp);
/**
- * Should be called from {@link Activity#attachBaseContext(Context)}
- */
- public void attachBaseContext(Context context) {
- }
-
- /**
* Should be called from {@link Activity#onTitleChanged(CharSequence, int)}}
*/
public abstract void setTitle(@Nullable CharSequence title);
@@ -481,8 +441,8 @@
* automatically recreated or its {@link Configuration} updated. Which one depends on how
* the component is setup (via {@code android:configChanges} or similar).</p>
*
- * <p>You can be notified when the night changes by overriding the
- * {@link AppCompatActivity#onNightModeChanged(int)} method.</p>
+ * <p>You can notified when the night changes by overriding the
+ * {@link AppCompatCallback#onNightModeChanged(int)} method.</p>
*
* @see #setDefaultNightMode(int)
* @see #setLocalNightMode(int)
@@ -497,22 +457,10 @@
*
* <p>As this will call {@link #applyDayNight()}, the host component might be
* recreated automatically.</p>
- *
- * <p>It is not recommended to use this method on a delegate attached to a {@link Dialog}.
- * Dialogs use the host Activity as their context, resulting in the dialog's night mode
- * overriding the Activity's night mode.
*/
public abstract void setLocalNightMode(@NightMode int mode);
/**
- * Returns the night mode previously set via {@link #getLocalNightMode()}.
- */
- @NightMode
- public int getLocalNightMode() {
- return MODE_NIGHT_UNSPECIFIED;
- }
-
- /**
* Sets the default night mode. This is used across all activities/dialogs but can be overridden
* locally via {@link #setLocalNightMode(int)}.
*
@@ -527,11 +475,10 @@
*/
public static void setDefaultNightMode(@NightMode int mode) {
switch (mode) {
+ case MODE_NIGHT_AUTO:
case MODE_NIGHT_NO:
case MODE_NIGHT_YES:
case MODE_NIGHT_FOLLOW_SYSTEM:
- case MODE_NIGHT_AUTO_TIME:
- case MODE_NIGHT_AUTO_BATTERY:
sDefaultNightMode = mode;
break;
default:
diff --git a/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java b/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java
index f745ba6..88d967c 100644
--- a/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java
+++ b/appcompat/src/main/java/androidx/appcompat/app/AppCompatDelegateImpl.java
@@ -20,8 +20,6 @@
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import static android.view.Window.FEATURE_OPTIONS_PANEL;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
@@ -29,7 +27,6 @@
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
-import android.content.ContextWrapper;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ActivityInfo;
@@ -45,7 +42,6 @@
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
-import android.os.PowerManager;
import android.text.TextUtils;
import android.util.AndroidRuntimeException;
import android.util.AttributeSet;
@@ -75,7 +71,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
-import androidx.annotation.RestrictTo;
import androidx.annotation.StyleRes;
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.R;
@@ -100,8 +95,6 @@
import androidx.appcompat.widget.VectorEnabledTintResources;
import androidx.appcompat.widget.ViewStubCompat;
import androidx.appcompat.widget.ViewUtils;
-import androidx.collection.ArrayMap;
-import androidx.core.app.ActivityCompat;
import androidx.core.app.NavUtils;
import androidx.core.view.KeyEventDispatcher;
import androidx.core.view.LayoutInflaterCompat;
@@ -116,19 +109,13 @@
import org.xmlpull.v1.XmlPullParser;
import java.util.List;
-import java.util.Map;
-/**
- * @hide
- */
-@RestrictTo(LIBRARY)
class AppCompatDelegateImpl extends AppCompatDelegate
implements MenuBuilder.Callback, LayoutInflater.Factory2 {
- private static final Map<Class<?>, Integer> sLocalNightModes = new ArrayMap<>();
-
private static final boolean DEBUG = false;
private static final boolean IS_PRE_LOLLIPOP = Build.VERSION.SDK_INT < 21;
+ private static final String KEY_LOCAL_NIGHT_MODE = "appcompat:local_night_mode";
private static final int[] sWindowBackgroundStyleable = {android.R.attr.windowBackground};
@@ -172,10 +159,10 @@
}
}
- final Object mHost;
final Context mContext;
- Window mWindow;
- private AppCompatWindowCallback mAppCompatWindowCallback;
+ final Window mWindow;
+ final Window.Callback mOriginalWindowCallback;
+ final Window.Callback mAppCompatWindowCallback;
final AppCompatCallback mAppCompatCallback;
ActionBar mActionBar;
@@ -223,20 +210,18 @@
private boolean mLongPressBackDown;
- private boolean mBaseContextAttached;
- private boolean mCreated;
@SuppressWarnings("WeakerAccess") /* synthetic access */
boolean mIsDestroyed;
@NightMode
private int mLocalNightMode = MODE_NIGHT_UNSPECIFIED;
+ private boolean mCreated;
private int mThemeResId;
private boolean mActivityHandlesUiMode;
private boolean mActivityHandlesUiModeChecked;
- private AutoNightModeManager mAutoTimeNightModeManager;
- private AutoNightModeManager mAutoBatteryNightModeManager;
+ private AutoNightModeManager mAutoNightModeManager;
boolean mInvalidatePanelMenuPosted;
int mInvalidatePanelMenuFeatures;
@@ -261,76 +246,36 @@
private AppCompatViewInflater mAppCompatViewInflater;
- AppCompatDelegateImpl(Activity activity, AppCompatCallback callback) {
- this(activity, null, callback, activity);
- }
-
- AppCompatDelegateImpl(Dialog dialog, AppCompatCallback callback) {
- this(dialog.getContext(), dialog.getWindow(), callback, dialog);
- }
-
AppCompatDelegateImpl(Context context, Window window, AppCompatCallback callback) {
- this(context, window, callback, context);
- }
-
- private AppCompatDelegateImpl(Context context, Window window, AppCompatCallback callback,
- Object host) {
mContext = context;
+ mWindow = window;
mAppCompatCallback = callback;
- mHost = host;
- if (window != null) {
- attachToWindow(window);
+ mOriginalWindowCallback = mWindow.getCallback();
+ if (mOriginalWindowCallback instanceof AppCompatWindowCallback) {
+ throw new IllegalStateException(
+ "AppCompat has already installed itself into the Window");
}
+ mAppCompatWindowCallback = new AppCompatWindowCallback(mOriginalWindowCallback);
+ // Now install the new callback
+ mWindow.setCallback(mAppCompatWindowCallback);
- if (mLocalNightMode == MODE_NIGHT_UNSPECIFIED && mHost instanceof Dialog) {
- final AppCompatActivity activity = tryUnwrapContext();
- if (activity != null) {
- // This code path is used to detect when this Delegate is a child Delegate from
- // an Activity, primarily for Dialogs. Dialogs use the Activity as it's Context,
- // so we want to make sure that the this 'child' delegate does not interfere
- // with the Activity config. The simplest way to do that is to match the
- // outer Activity's local night mode
- mLocalNightMode = activity.getDelegate().getLocalNightMode();
- }
+ final TintTypedArray a = TintTypedArray.obtainStyledAttributes(
+ context, null, sWindowBackgroundStyleable);
+ final Drawable winBg = a.getDrawableIfKnown(0);
+ if (winBg != null) {
+ mWindow.setBackgroundDrawable(winBg);
}
- if (mLocalNightMode == MODE_NIGHT_UNSPECIFIED) {
- // Try and read the current night mode from our static store
- final Integer value = sLocalNightModes.get(mHost.getClass());
- if (value != null) {
- mLocalNightMode = value;
- // Finally remove the value
- sLocalNightModes.remove(mHost.getClass());
- }
- }
-
- // Preload appcompat-specific handling of drawables that should be handled in a special
- // way (for tinting etc). After the following line completes, calls from AppCompatResources
- // to ResourceManagerInternal (in appcompat-resources) will handle those internal drawable
- // paths correctly without having to go through AppCompatDrawableManager APIs.
- AppCompatDrawableManager.preload();
- }
-
- @Override
- public void attachBaseContext(Context context) {
- applyDayNight();
- mBaseContextAttached = true;
+ a.recycle();
}
@Override
public void onCreate(Bundle savedInstanceState) {
- // attachBaseContext will only be called from an Activity, so make sure we switch this for
- // Dialogs, etc
- mBaseContextAttached = true;
-
- // We lazily fetch the Window for Activities, to allow DayNight to apply in
- // attachBaseContext
- ensureWindow();
-
- if (mHost instanceof Activity) {
+ if (mOriginalWindowCallback instanceof Activity) {
String parentActivityName = null;
try {
- parentActivityName = NavUtils.getParentActivityName((Activity) mHost);
+ parentActivityName = NavUtils.getParentActivityName(
+ (Activity) mOriginalWindowCallback);
} catch (IllegalArgumentException iae) {
// Ignore in this case
}
@@ -345,15 +290,14 @@
}
}
- applyDayNight();
-
- final TintTypedArray a = TintTypedArray.obtainStyledAttributes(
- mContext, null, sWindowBackgroundStyleable);
- final Drawable winBg = a.getDrawableIfKnown(0);
- if (winBg != null) {
- mWindow.setBackgroundDrawable(winBg);
+ if (savedInstanceState != null && mLocalNightMode == MODE_NIGHT_UNSPECIFIED) {
+ // If we have a icicle and we haven't had a local night mode set yet, try and read
+ // it from the icicle
+ mLocalNightMode = savedInstanceState.getInt(KEY_LOCAL_NIGHT_MODE,
+ MODE_NIGHT_UNSPECIFIED);
}
- a.recycle();
+
+ applyDayNight();
mCreated = true;
}
@@ -387,10 +331,11 @@
return;
}
- if (mHost instanceof Activity) {
- mActionBar = new WindowDecorActionBar((Activity) mHost, mOverlayActionBar);
- } else if (mHost instanceof Dialog) {
- mActionBar = new WindowDecorActionBar((Dialog) mHost);
+ if (mOriginalWindowCallback instanceof Activity) {
+ mActionBar = new WindowDecorActionBar((Activity) mOriginalWindowCallback,
+ mOverlayActionBar);
+ } else if (mOriginalWindowCallback instanceof Dialog) {
+ mActionBar = new WindowDecorActionBar((Dialog) mOriginalWindowCallback);
}
if (mActionBar != null) {
mActionBar.setDefaultDisplayHomeAsUpEnabled(mEnableDefaultActionBarUp);
@@ -399,7 +344,7 @@
@Override
public void setSupportActionBar(Toolbar toolbar) {
- if (!(mHost instanceof Activity)) {
+ if (!(mOriginalWindowCallback instanceof Activity)) {
// Only Activities support custom Action Bars
return;
}
@@ -421,8 +366,8 @@
}
if (toolbar != null) {
- final ToolbarActionBar tbab = new ToolbarActionBar(toolbar, getTitle(),
- mAppCompatWindowCallback);
+ final ToolbarActionBar tbab = new ToolbarActionBar(toolbar,
+ ((Activity) mOriginalWindowCallback).getTitle(), mAppCompatWindowCallback);
mActionBar = tbab;
mWindow.setCallback(tbab.getWrappedWindowCallback());
} else {
@@ -484,9 +429,8 @@
// Make sure that the DrawableManager knows about the new config
AppCompatDrawableManager.get().onConfigurationChanged(mContext);
- // Re-apply Day/Night with the new configuration but disable recreations. Since this
- // configuration change has only just happened we can safely just update the resources now
- applyDayNight(false);
+ // Re-apply Day/Night with the new configuration
+ applyDayNight();
}
@Override
@@ -504,11 +448,8 @@
}
// Make sure we clean up any receivers setup for AUTO mode
- if (mAutoTimeNightModeManager != null) {
- mAutoTimeNightModeManager.cleanup();
- }
- if (mAutoBatteryNightModeManager != null) {
- mAutoBatteryNightModeManager.cleanup();
+ if (mAutoNightModeManager != null) {
+ mAutoNightModeManager.cleanup();
}
}
@@ -523,43 +464,43 @@
@Override
public void setContentView(View v) {
ensureSubDecor();
- ViewGroup contentParent = mSubDecor.findViewById(android.R.id.content);
+ ViewGroup contentParent = (ViewGroup) mSubDecor.findViewById(android.R.id.content);
contentParent.removeAllViews();
contentParent.addView(v);
- mAppCompatWindowCallback.getWrapped().onContentChanged();
+ mOriginalWindowCallback.onContentChanged();
}
@Override
public void setContentView(int resId) {
ensureSubDecor();
- ViewGroup contentParent = mSubDecor.findViewById(android.R.id.content);
+ ViewGroup contentParent = (ViewGroup) mSubDecor.findViewById(android.R.id.content);
contentParent.removeAllViews();
LayoutInflater.from(mContext).inflate(resId, contentParent);
- mAppCompatWindowCallback.getWrapped().onContentChanged();
+ mOriginalWindowCallback.onContentChanged();
}
@Override
public void setContentView(View v, ViewGroup.LayoutParams lp) {
ensureSubDecor();
- ViewGroup contentParent = mSubDecor.findViewById(android.R.id.content);
+ ViewGroup contentParent = (ViewGroup) mSubDecor.findViewById(android.R.id.content);
contentParent.removeAllViews();
contentParent.addView(v, lp);
- mAppCompatWindowCallback.getWrapped().onContentChanged();
+ mOriginalWindowCallback.onContentChanged();
}
@Override
public void addContentView(View v, ViewGroup.LayoutParams lp) {
ensureSubDecor();
- ViewGroup contentParent = mSubDecor.findViewById(android.R.id.content);
+ ViewGroup contentParent = (ViewGroup) mSubDecor.findViewById(android.R.id.content);
contentParent.addView(v, lp);
- mAppCompatWindowCallback.getWrapped().onContentChanged();
+ mOriginalWindowCallback.onContentChanged();
}
@Override
public void onSaveInstanceState(Bundle outState) {
if (mLocalNightMode != MODE_NIGHT_UNSPECIFIED) {
// If we have a local night mode set, save it
- sLocalNightModes.put(mHost.getClass(), mLocalNightMode);
+ outState.putInt(KEY_LOCAL_NIGHT_MODE, mLocalNightMode);
}
}
@@ -576,11 +517,8 @@
}
// Make sure we clean up any receivers setup for AUTO mode
- if (mAutoTimeNightModeManager != null) {
- mAutoTimeNightModeManager.cleanup();
- }
- if (mAutoBatteryNightModeManager != null) {
- mAutoBatteryNightModeManager.cleanup();
+ if (mAutoNightModeManager != null) {
+ mAutoNightModeManager.cleanup();
}
}
@@ -589,35 +527,6 @@
mThemeResId = themeResId;
}
- private void ensureWindow() {
- // We lazily fetch the Window for Activities, to allow DayNight to apply in
- // attachBaseContext
- if (mWindow == null && mHost instanceof Activity) {
- attachToWindow(((Activity) mHost).getWindow());
- }
- if (mWindow == null) {
- throw new IllegalStateException("We have not been given a Window");
- }
- }
-
- private void attachToWindow(@NonNull Window window) {
- if (mWindow != null) {
- throw new IllegalStateException(
- "AppCompat has already installed itself into the Window");
- }
-
- final Window.Callback callback = window.getCallback();
- if (callback instanceof AppCompatWindowCallback) {
- throw new IllegalStateException(
- "AppCompat has already installed itself into the Window");
- }
- mAppCompatWindowCallback = new AppCompatWindowCallback(callback);
- // Now install the new callback
- window.setCallback(mAppCompatWindowCallback);
-
- mWindow = window;
- }
-
private void ensureSubDecor() {
if (!mSubDecorInstalled) {
mSubDecor = createSubDecor();
@@ -677,7 +586,6 @@
a.recycle();
// Now let's make sure that the Window has installed its decor by retrieving it
- ensureWindow();
mWindow.getDecorView();
final LayoutInflater inflater = LayoutInflater.from(mContext);
@@ -953,8 +861,8 @@
final CharSequence getTitle() {
// If the original window callback is an Activity, we'll use its title
- if (mHost instanceof Activity) {
- return ((Activity) mHost).getTitle();
+ if (mOriginalWindowCallback instanceof Activity) {
+ return ((Activity) mOriginalWindowCallback).getTitle();
}
// Else, we'll return the title we have recorded ourselves
return mTitle;
@@ -1268,7 +1176,8 @@
boolean dispatchKeyEvent(KeyEvent event) {
// Check AppCompatDialog directly since it isn't able to implement KeyEventDispatcher
// while it is @hide.
- if (mHost instanceof KeyEventDispatcher.Component || mHost instanceof AppCompatDialog) {
+ if (mOriginalWindowCallback instanceof KeyEventDispatcher.Component
+ || mOriginalWindowCallback instanceof AppCompatDialog) {
View root = mWindow.getDecorView();
if (root != null && KeyEventDispatcher.dispatchBeforeHierarchy(root, event)) {
return true;
@@ -1277,7 +1186,7 @@
if (event.getKeyCode() == KeyEvent.KEYCODE_MENU) {
// If this is a MENU event, let the Activity have a go.
- if (mAppCompatWindowCallback.getWrapped().dispatchKeyEvent(event)) {
+ if (mOriginalWindowCallback.dispatchKeyEvent(event)) {
return true;
}
}
@@ -1429,22 +1338,6 @@
return onCreateView(null, name, context, attrs);
}
- @Nullable
- private AppCompatActivity tryUnwrapContext() {
- Context context = mContext;
- while (context != null) {
- if (context instanceof AppCompatActivity) {
- return (AppCompatActivity) context;
- }
- if (context instanceof ContextWrapper) {
- context = ((ContextWrapper) context).getBaseContext();
- } else {
- return null;
- }
- }
- return null;
- }
-
private void openPanel(final PanelFeatureState st, KeyEvent event) {
// Already open, return
if (st.isOpen || mIsDestroyed) {
@@ -1898,7 +1791,7 @@
// We need to be careful which callback we dispatch the call to. We can not dispatch
// this to the Window's callback since that will call back into this method and cause a
// crash. Instead we need to dispatch down to the original Activity/Dialog/etc.
- mAppCompatWindowCallback.getWrapped().onPanelClosed(featureId, menu);
+ mOriginalWindowCallback.onPanelClosed(featureId, menu);
}
}
@@ -2120,46 +2013,45 @@
@Override
public boolean applyDayNight() {
- return applyDayNight(true);
- }
+ boolean applied = false;
- private boolean applyDayNight(final boolean recreateIfNeeded) {
- @NightMode final int nightMode = calculateNightMode();
+ @NightMode final int nightMode = getNightMode();
@ApplyableNightMode final int modeToApply = mapNightMode(nightMode);
- final boolean applied = updateForNightMode(modeToApply, recreateIfNeeded);
+ if (modeToApply != MODE_NIGHT_FOLLOW_SYSTEM) {
+ applied = updateForNightMode(modeToApply);
+ }
- if (nightMode == MODE_NIGHT_AUTO_TIME) {
+ if (nightMode == MODE_NIGHT_AUTO) {
// If we're already been started, we may need to setup auto mode again
- getAutoTimeNightModeManager().setup();
- } else if (nightMode == MODE_NIGHT_AUTO_BATTERY) {
- getAutoBatteryNightModeManager().setup();
+ ensureAutoNightModeManager();
+ mAutoNightModeManager.setup();
}
return applied;
}
@Override
- public void setLocalNightMode(@NightMode int mode) {
- if (mLocalNightMode != mode) {
- mLocalNightMode = mode;
- applyDayNight();
+ public void setLocalNightMode(@NightMode final int mode) {
+ switch (mode) {
+ case MODE_NIGHT_AUTO:
+ case MODE_NIGHT_NO:
+ case MODE_NIGHT_YES:
+ case MODE_NIGHT_FOLLOW_SYSTEM:
+ if (mLocalNightMode != mode) {
+ mLocalNightMode = mode;
+ applyDayNight();
+ }
+ break;
+ default:
+ Log.i(TAG, "setLocalNightMode() called with an unknown mode");
+ break;
}
}
- @Override
- public int getLocalNightMode() {
- return mLocalNightMode;
- }
-
@ApplyableNightMode
int mapNightMode(@NightMode final int mode) {
switch (mode) {
- case MODE_NIGHT_NO:
- case MODE_NIGHT_YES:
- case MODE_NIGHT_FOLLOW_SYSTEM:
- // $FALLTHROUGH since these are all valid modes to return
- return mode;
- case MODE_NIGHT_AUTO_TIME:
+ case MODE_NIGHT_AUTO:
if (Build.VERSION.SDK_INT >= 23) {
UiModeManager uiModeManager = mContext.getSystemService(UiModeManager.class);
if (uiModeManager.getNightMode() == UiModeManager.MODE_NIGHT_AUTO) {
@@ -2168,20 +2060,18 @@
return MODE_NIGHT_FOLLOW_SYSTEM;
}
}
- return getAutoTimeNightModeManager().getApplyableNightMode();
- case MODE_NIGHT_AUTO_BATTERY:
- return getAutoBatteryNightModeManager().getApplyableNightMode();
+ ensureAutoNightModeManager();
+ return mAutoNightModeManager.getApplyableNightMode();
case MODE_NIGHT_UNSPECIFIED:
- // If we don't have a mode specified, let the system handle it
+ // If we don't have a mode specified, just let the system handle it
return MODE_NIGHT_FOLLOW_SYSTEM;
default:
- throw new IllegalStateException("Unknown value set for night mode. Please use one"
- + " of the MODE_NIGHT values from AppCompatDelegate.");
+ return mode;
}
}
@NightMode
- private int calculateNightMode() {
+ private int getNightMode() {
return mLocalNightMode != MODE_NIGHT_UNSPECIFIED ? mLocalNightMode : getDefaultNightMode();
}
@@ -2193,147 +2083,92 @@
* @param config The configuration which triggered this update
* @return true if an action has been taken (recreation, resources updating, etc)
*/
- private boolean updateForNightMode(@ApplyableNightMode final int mode,
- final boolean allowRecreation) {
+ private boolean updateForNightMode(@ApplyableNightMode final int mode) {
+ final Resources res = mContext.getResources();
+ final Configuration config = res.getConfiguration();
+ final int currentNightMode = config.uiMode & Configuration.UI_MODE_NIGHT_MASK;
+
+ final int newNightMode = (mode == MODE_NIGHT_YES)
+ ? Configuration.UI_MODE_NIGHT_YES
+ : Configuration.UI_MODE_NIGHT_NO;
+
boolean handled = false;
- int newNightMode;
- switch (mode) {
- case MODE_NIGHT_YES:
- newNightMode = Configuration.UI_MODE_NIGHT_YES;
- break;
- case MODE_NIGHT_NO:
- newNightMode = Configuration.UI_MODE_NIGHT_NO;
- break;
- default:
- case MODE_NIGHT_FOLLOW_SYSTEM:
- // If we're following the system, we just use the system default from the
- // application context
- newNightMode = mContext.getApplicationContext()
- .getResources()
- .getConfiguration()
- .uiMode & Configuration.UI_MODE_NIGHT_MASK;
- break;
- }
+ if (currentNightMode != newNightMode) {
+ final boolean manifestHandlingUiMode = isActivityManifestHandlingUiMode();
+ final boolean shouldRecreateOnNightModeChange =
+ !manifestHandlingUiMode && mCreated && mContext instanceof Activity;
- final boolean activityHandlingUiMode = isActivityManifestHandlingUiMode();
-
- if (!activityHandlingUiMode && Build.VERSION.SDK_INT >= 17 && !mBaseContextAttached
- && mHost instanceof android.view.ContextThemeWrapper) {
- // If we're here then we can try and apply an override configuration on the Context.
- final Configuration conf = new Configuration();
- conf.uiMode = newNightMode | (conf.uiMode & ~Configuration.UI_MODE_NIGHT_MASK);
-
- try {
+ if (shouldRecreateOnNightModeChange) {
if (DEBUG) {
- Log.d(TAG, "updateForNightMode. Applying override config");
+ Log.d(TAG, "updateForNightMode. Night mode changed, recreating Activity");
}
- ((android.view.ContextThemeWrapper) mHost).applyOverrideConfiguration(conf);
- handled = true;
- } catch (IllegalStateException e) {
- // applyOverrideConfiguration throws an IllegalStateException if it's resources
- // have already been created. Since there's no way to check this beforehand we
- // just have to try it and catch the exception
- handled = false;
+ // If we've already been created, we need to recreate the Activity for the
+ // mode to be applied
+ ((Activity) mContext).recreate();
+ } else if (!manifestHandlingUiMode) {
+ // If the Activity is not set to handle uiMode config changes we will
+ // update the Resources with a new Configuration with an updated UI Mode
+ final Configuration newConf = new Configuration(config);
+ newConf.uiMode = newNightMode | (config.uiMode & ~Configuration.UI_MODE_NIGHT_MASK);
+ res.updateConfiguration(newConf, res.getDisplayMetrics());
+
+ if (DEBUG) {
+ Log.d(TAG, "updateForNightMode. Night mode changed, updated res config");
+ }
+ // We may need to flush the Resources' drawable cache due to framework bugs.
+ if (Build.VERSION.SDK_INT < 26) {
+ ResourcesFlusher.flush(res);
+ }
+
+ if (mThemeResId != 0) {
+ // We need to re-apply the theme so that it reflected the new
+ // configuration
+ mContext.setTheme(mThemeResId);
+
+ if (Build.VERSION.SDK_INT >= 23) {
+ // On M+ setTheme only applies if the themeResId actually changes,
+ // since we have no way to publicly check what the Theme's current
+ // themeResId is, we just manually apply it anyway. Most of the time
+ // this is what we need anyway (since the themeResId does not
+ // often change)
+ mContext.getTheme().applyStyle(mThemeResId, true);
+ }
+ }
+ }
+ handled = true;
+ } else {
+ if (DEBUG) {
+ Log.d(TAG, "applyNightMode() | Skipping. Night mode has not changed: " + mode);
}
}
- if (!handled && !activityHandlingUiMode) {
- final int currentNightMode = mContext.getResources().getConfiguration().uiMode
- & Configuration.UI_MODE_NIGHT_MASK;
- if (currentNightMode != newNightMode) {
- if (allowRecreation && (Build.VERSION.SDK_INT >= 17 || mCreated)
- && mHost instanceof Activity) {
- // If we're created and are an Activity, we can recreate to apply
- // The SDK_INT check above is because applyOverrideConfiguration only exists on
- // API 17+, so we don't want to get into an loop of infinite recreations.
- // On < API 17 we need to use updateConfiguration before we're 'created'
- if (DEBUG) {
- Log.d(TAG, "updateForNightMode. Recreating Activity");
- }
- ActivityCompat.recreate((Activity) mHost);
- handled = true;
- }
- if (!handled) {
- // Else we need to use the updateConfiguration path
- if (DEBUG) {
- Log.d(TAG, "updateForNightMode. Updating resources config");
- }
- updateResourcesConfigurationForNightMode(newNightMode);
- handled = true;
- }
- } else {
- if (DEBUG) {
- Log.d(TAG, "updateForNightMode. Skipping. Night mode: " + mode);
- }
- }
- }
-
- // Notify the activity of the night mode. We only notify if we handled the change,
- // or the Activity is set to handle uiMode changes
- if ((handled || activityHandlingUiMode) && mHost instanceof AppCompatActivity) {
- ((AppCompatActivity) mHost).onNightModeChanged(mode);
+ // Notify the activity of the night mode
+ if (mContext instanceof AppCompatActivity) {
+ ((AppCompatActivity) mContext).onNightModeChanged(mode);
}
return handled;
}
- private void updateResourcesConfigurationForNightMode(final int uiModeNightModeValue) {
- // If the Activity is not set to handle uiMode config changes we will
- // update the Resources with a new Configuration with an updated UI Mode
- final Resources res = mContext.getResources();
- final Configuration conf = new Configuration();
- conf.uiMode = uiModeNightModeValue
- | (res.getConfiguration().uiMode & ~Configuration.UI_MODE_NIGHT_MASK);
- res.updateConfiguration(conf, null);
-
- // We may need to flush the Resources' drawable cache due to framework bugs.
- if (Build.VERSION.SDK_INT < 26) {
- ResourcesFlusher.flush(res);
- }
-
- if (mThemeResId != 0) {
- // We need to re-apply the theme so that it reflected the new
- // configuration
- mContext.setTheme(mThemeResId);
-
- if (Build.VERSION.SDK_INT >= 23) {
- // On M+ setTheme only applies if the themeResId actually changes,
- // since we have no way to publicly check what the Theme's current
- // themeResId is, we just manually apply it anyway. Most of the time
- // this is what we need anyway (since the themeResId does not
- // often change)
- mContext.getTheme().applyStyle(mThemeResId, true);
- }
+ private void ensureAutoNightModeManager() {
+ if (mAutoNightModeManager == null) {
+ mAutoNightModeManager = new AutoNightModeManager(TwilightManager.getInstance(mContext));
}
}
- /**
- * @hide
- */
- @NonNull
- @RestrictTo(LIBRARY)
- final AutoNightModeManager getAutoTimeNightModeManager() {
- if (mAutoTimeNightModeManager == null) {
- mAutoTimeNightModeManager = new AutoTimeNightModeManager(
- TwilightManager.getInstance(mContext));
- }
- return mAutoTimeNightModeManager;
- }
-
- private AutoNightModeManager getAutoBatteryNightModeManager() {
- if (mAutoBatteryNightModeManager == null) {
- mAutoBatteryNightModeManager = new AutoBatteryNightModeManager(mContext);
- }
- return mAutoBatteryNightModeManager;
+ @VisibleForTesting
+ final AutoNightModeManager getAutoNightModeManager() {
+ ensureAutoNightModeManager();
+ return mAutoNightModeManager;
}
private boolean isActivityManifestHandlingUiMode() {
- if (!mActivityHandlesUiModeChecked && mHost instanceof Activity) {
+ if (!mActivityHandlesUiModeChecked && mContext instanceof Activity) {
final PackageManager pm = mContext.getPackageManager();
try {
final ActivityInfo info = pm.getActivityInfo(
- new ComponentName(mContext, mHost.getClass()), 0);
+ new ComponentName(mContext, mContext.getClass()), 0);
mActivityHandlesUiMode = (info.configChanges & ActivityInfo.CONFIG_UI_MODE) != 0;
} catch (PackageManager.NameNotFoundException e) {
// This shouldn't happen but let's not crash because of it, we'll just log and
@@ -2864,110 +2699,67 @@
}
}
- /**
- * @hide
- */
@VisibleForTesting
- @RestrictTo(LIBRARY)
- abstract class AutoNightModeManager {
- private BroadcastReceiver mReceiver;
+ final class AutoNightModeManager {
+ private TwilightManager mTwilightManager;
+ private boolean mIsNight;
+
+ private BroadcastReceiver mAutoTimeChangeReceiver;
+ private IntentFilter mAutoTimeChangeReceiverFilter;
+
+ AutoNightModeManager(@NonNull TwilightManager twilightManager) {
+ mTwilightManager = twilightManager;
+ mIsNight = twilightManager.isNight();
+ }
@ApplyableNightMode
- abstract int getApplyableNightMode();
+ int getApplyableNightMode() {
+ mIsNight = mTwilightManager.isNight();
+ return mIsNight ? MODE_NIGHT_YES : MODE_NIGHT_NO;
+ }
- abstract void onChange();
+ void dispatchTimeChanged() {
+ final boolean isNight = mTwilightManager.isNight();
+ if (isNight != mIsNight) {
+ mIsNight = isNight;
+ applyDayNight();
+ }
+ }
void setup() {
cleanup();
- final IntentFilter filter = createIntentFilterForBroadcastReceiver();
- if (filter == null || filter.countActions() == 0) {
- // Null or empty IntentFilter, skip
- return;
- }
-
- if (mReceiver == null) {
- mReceiver = new BroadcastReceiver() {
+ // If we're set to AUTO, we register a receiver to be notified on time changes. The
+ // system only sends the tick out every minute, but that's enough fidelity for our use
+ // case
+ if (mAutoTimeChangeReceiver == null) {
+ mAutoTimeChangeReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
- onChange();
+ if (DEBUG) {
+ Log.d("AutoTimeChangeReceiver", "onReceive | Intent: " + intent);
+ }
+ dispatchTimeChanged();
}
};
}
- mContext.registerReceiver(mReceiver, filter);
+ if (mAutoTimeChangeReceiverFilter == null) {
+ mAutoTimeChangeReceiverFilter = new IntentFilter();
+ mAutoTimeChangeReceiverFilter.addAction(Intent.ACTION_TIME_CHANGED);
+ mAutoTimeChangeReceiverFilter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
+ mAutoTimeChangeReceiverFilter.addAction(Intent.ACTION_TIME_TICK);
+ }
+ mContext.registerReceiver(mAutoTimeChangeReceiver, mAutoTimeChangeReceiverFilter);
}
- @Nullable
- abstract IntentFilter createIntentFilterForBroadcastReceiver();
-
void cleanup() {
- if (mReceiver != null) {
- mContext.unregisterReceiver(mReceiver);
- mReceiver = null;
+ if (mAutoTimeChangeReceiver != null) {
+ mContext.unregisterReceiver(mAutoTimeChangeReceiver);
+ mAutoTimeChangeReceiver = null;
}
}
}
- private class AutoTimeNightModeManager extends AutoNightModeManager {
- private final TwilightManager mTwilightManager;
-
- AutoTimeNightModeManager(@NonNull TwilightManager twilightManager) {
- mTwilightManager = twilightManager;
- }
-
- @ApplyableNightMode
- @Override
- public int getApplyableNightMode() {
- return mTwilightManager.isNight() ? MODE_NIGHT_YES : MODE_NIGHT_NO;
- }
-
- @Override
- public void onChange() {
- applyDayNight();
- }
-
- @Override
- IntentFilter createIntentFilterForBroadcastReceiver() {
- IntentFilter filter = new IntentFilter();
- filter.addAction(Intent.ACTION_TIME_CHANGED);
- filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
- filter.addAction(Intent.ACTION_TIME_TICK);
- return filter;
- }
- }
-
- private class AutoBatteryNightModeManager extends AutoNightModeManager {
- private final PowerManager mPowerManager;
-
- AutoBatteryNightModeManager(@NonNull Context context) {
- mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
- }
-
- @ApplyableNightMode
- @Override
- public int getApplyableNightMode() {
- if (Build.VERSION.SDK_INT >= 21) {
- return mPowerManager.isPowerSaveMode() ? MODE_NIGHT_YES : MODE_NIGHT_NO;
- }
- return MODE_NIGHT_NO;
- }
-
- @Override
- public void onChange() {
- applyDayNight();
- }
-
- @Override
- IntentFilter createIntentFilterForBroadcastReceiver() {
- if (Build.VERSION.SDK_INT >= 21) {
- IntentFilter filter = new IntentFilter();
- filter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED);
- return filter;
- }
- return null;
- }
- }
-
@Override
public final ActionBarDrawerToggle.Delegate getDrawerToggleDelegate() {
return new ActionBarDrawableToggleImpl();
diff --git a/appcompat/src/main/java/androidx/appcompat/app/AppCompatDialog.java b/appcompat/src/main/java/androidx/appcompat/app/AppCompatDialog.java
index d0443af..e1539cb 100644
--- a/appcompat/src/main/java/androidx/appcompat/app/AppCompatDialog.java
+++ b/appcompat/src/main/java/androidx/appcompat/app/AppCompatDialog.java
@@ -16,7 +16,7 @@
package androidx.appcompat.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Dialog;
import android.content.Context;
@@ -56,15 +56,11 @@
public AppCompatDialog(Context context, int theme) {
super(context, getThemeResId(context, theme));
- final AppCompatDelegate delegate = getDelegate();
- // Make sure we provide the delegate with the current theme res id
- delegate.onSetTheme(getThemeResId(context, theme));
-
// This is a bit weird, but Dialog's are typically created and setup before being shown,
// which means that we can't rely on onCreate() being called before a content view is set.
// To workaround this, we call onCreate(null) in the ctor, and then again as usual in
// onCreate().
- delegate.onCreate(null);
+ getDelegate().onCreate(null);
}
protected AppCompatDialog(Context context, boolean cancelable,
@@ -157,7 +153,7 @@
* @hide
*/
@Override
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void invalidateOptionsMenu() {
getDelegate().invalidateOptionsMenu();
}
diff --git a/appcompat/src/main/java/androidx/appcompat/app/AppCompatDialogFragment.java b/appcompat/src/main/java/androidx/appcompat/app/AppCompatDialogFragment.java
index feb05f0..2b2508a 100644
--- a/appcompat/src/main/java/androidx/appcompat/app/AppCompatDialogFragment.java
+++ b/appcompat/src/main/java/androidx/appcompat/app/AppCompatDialogFragment.java
@@ -17,7 +17,7 @@
package androidx.appcompat.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Dialog;
import android.os.Bundle;
@@ -44,7 +44,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setupDialog(@NonNull Dialog dialog, int style) {
if (dialog instanceof AppCompatDialog) {
diff --git a/appcompat/src/main/java/androidx/appcompat/app/WindowDecorActionBar.java b/appcompat/src/main/java/androidx/appcompat/app/WindowDecorActionBar.java
index 7471b76..88ba36d 100644
--- a/appcompat/src/main/java/androidx/appcompat/app/WindowDecorActionBar.java
+++ b/appcompat/src/main/java/androidx/appcompat/app/WindowDecorActionBar.java
@@ -16,7 +16,7 @@
package androidx.appcompat.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Activity;
import android.app.Dialog;
@@ -76,7 +76,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class WindowDecorActionBar extends ActionBar implements
ActionBarOverlayLayout.ActionBarVisibilityCallback {
private static final String TAG = "WindowDecorActionBar";
@@ -185,7 +185,7 @@
* Only for edit mode.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public WindowDecorActionBar(View layout) {
assert layout.isInEditMode();
init(layout);
@@ -982,7 +982,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public class ActionModeImpl extends ActionMode implements MenuBuilder.Callback {
private final Context mActionModeContext;
private final MenuBuilder mMenu;
@@ -1158,7 +1158,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public class TabImpl extends ActionBar.Tab {
private ActionBar.TabListener mCallback;
private Object mTag;
diff --git a/appcompat/src/main/java/androidx/appcompat/content/res/AppCompatResources.java b/appcompat/src/main/java/androidx/appcompat/content/res/AppCompatResources.java
new file mode 100644
index 0000000..4652f04
--- /dev/null
+++ b/appcompat/src/main/java/androidx/appcompat/content/res/AppCompatResources.java
@@ -0,0 +1,190 @@
+/*
+ * Copyright (C) 2016 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.appcompat.content.res;
+
+import android.content.Context;
+import android.content.res.ColorStateList;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.util.Log;
+import android.util.SparseArray;
+import android.util.TypedValue;
+
+import androidx.annotation.ColorRes;
+import androidx.annotation.DrawableRes;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.widget.AppCompatDrawableManager;
+import androidx.core.content.ContextCompat;
+import androidx.core.content.res.ColorStateListInflaterCompat;
+
+import org.xmlpull.v1.XmlPullParser;
+
+import java.util.WeakHashMap;
+
+/**
+ * Class for accessing an application's resources through AppCompat, and thus any backward
+ * compatible functionality.
+ */
+public final class AppCompatResources {
+
+ private static final String LOG_TAG = "AppCompatResources";
+ private static final ThreadLocal<TypedValue> TL_TYPED_VALUE = new ThreadLocal<>();
+
+ private static final WeakHashMap<Context, SparseArray<ColorStateListCacheEntry>>
+ sColorStateCaches = new WeakHashMap<>(0);
+
+ private static final Object sColorStateCacheLock = new Object();
+
+ private AppCompatResources() {}
+
+ /**
+ * Returns the {@link ColorStateList} from the given resource. The resource can include
+ * themeable attributes, regardless of API level.
+ *
+ * @param context context to inflate against
+ * @param resId the resource identifier of the ColorStateList to retrieve
+ */
+ public static ColorStateList getColorStateList(@NonNull Context context, @ColorRes int resId) {
+ if (Build.VERSION.SDK_INT >= 23) {
+ // On M+ we can use the framework
+ return context.getColorStateList(resId);
+ }
+
+ // Before that, we'll try handle it ourselves
+ ColorStateList csl = getCachedColorStateList(context, resId);
+ if (csl != null) {
+ return csl;
+ }
+ // Cache miss, so try and inflate it ourselves
+ csl = inflateColorStateList(context, resId);
+ if (csl != null) {
+ // If we inflated it, add it to the cache and return
+ addColorStateListToCache(context, resId, csl);
+ return csl;
+ }
+
+ // If we reach here then we couldn't inflate it, so let the framework handle it
+ return ContextCompat.getColorStateList(context, resId);
+ }
+
+ /**
+ * Return a drawable object associated with a particular resource ID.
+ *
+ * <p>This method supports inflation of {@code <vector>}, {@code <animated-vector>} and
+ * {@code <animated-selector>} resources on devices where platform support is not available.</p>
+ *
+ * @param context context to inflate against
+ * @param resId The desired resource identifier, as generated by the aapt
+ * tool. This integer encodes the package, type, and resource
+ * entry. The value 0 is an invalid identifier.
+ * @return Drawable An object that can be used to draw this resource.
+ * @see ContextCompat#getDrawable(Context, int)
+ */
+ @Nullable
+ public static Drawable getDrawable(@NonNull Context context, @DrawableRes int resId) {
+ return AppCompatDrawableManager.get().getDrawable(context, resId);
+ }
+
+ /**
+ * Inflates a {@link ColorStateList} from resources, honouring theme attributes.
+ */
+ @Nullable
+ private static ColorStateList inflateColorStateList(Context context, int resId) {
+ if (isColorInt(context, resId)) {
+ // The resource is a color int, we can't handle it so return null
+ return null;
+ }
+
+ final Resources r = context.getResources();
+ final XmlPullParser xml = r.getXml(resId);
+ try {
+ return ColorStateListInflaterCompat.createFromXml(r, xml, context.getTheme());
+ } catch (Exception e) {
+ Log.e(LOG_TAG, "Failed to inflate ColorStateList, leaving it to the framework", e);
+ }
+ return null;
+ }
+
+ @Nullable
+ private static ColorStateList getCachedColorStateList(@NonNull Context context,
+ @ColorRes int resId) {
+ synchronized (sColorStateCacheLock) {
+ final SparseArray<ColorStateListCacheEntry> entries = sColorStateCaches.get(context);
+ if (entries != null && entries.size() > 0) {
+ final ColorStateListCacheEntry entry = entries.get(resId);
+ if (entry != null) {
+ if (entry.configuration.equals(context.getResources().getConfiguration())) {
+ // If the current configuration matches the entry's, we can use it
+ return entry.value;
+ } else {
+ // Otherwise we'll remove the entry
+ entries.remove(resId);
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static void addColorStateListToCache(@NonNull Context context, @ColorRes int resId,
+ @NonNull ColorStateList value) {
+ synchronized (sColorStateCacheLock) {
+ SparseArray<ColorStateListCacheEntry> entries = sColorStateCaches.get(context);
+ if (entries == null) {
+ entries = new SparseArray<>();
+ sColorStateCaches.put(context, entries);
+ }
+ entries.append(resId, new ColorStateListCacheEntry(value,
+ context.getResources().getConfiguration()));
+ }
+ }
+
+ private static boolean isColorInt(@NonNull Context context, @ColorRes int resId) {
+ final Resources r = context.getResources();
+
+ final TypedValue value = getTypedValue();
+ r.getValue(resId, value, true);
+
+ return value.type >= TypedValue.TYPE_FIRST_COLOR_INT
+ && value.type <= TypedValue.TYPE_LAST_COLOR_INT;
+ }
+
+ @NonNull
+ private static TypedValue getTypedValue() {
+ TypedValue tv = TL_TYPED_VALUE.get();
+ if (tv == null) {
+ tv = new TypedValue();
+ TL_TYPED_VALUE.set(tv);
+ }
+ return tv;
+ }
+
+ private static class ColorStateListCacheEntry {
+ final ColorStateList value;
+ final Configuration configuration;
+
+ ColorStateListCacheEntry(@NonNull ColorStateList value,
+ @NonNull Configuration configuration) {
+ this.value = value;
+ this.configuration = configuration;
+ }
+ }
+
+}
diff --git a/appcompat/src/main/java/androidx/appcompat/graphics/drawable/AnimatedStateListDrawableCompat.java b/appcompat/src/main/java/androidx/appcompat/graphics/drawable/AnimatedStateListDrawableCompat.java
new file mode 100644
index 0000000..f7973ae
--- /dev/null
+++ b/appcompat/src/main/java/androidx/appcompat/graphics/drawable/AnimatedStateListDrawableCompat.java
@@ -0,0 +1,780 @@
+/*
+ * Copyright (C) 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.appcompat.graphics.drawable;
+
+import static android.os.Build.VERSION.SDK_INT;
+import static android.os.Build.VERSION_CODES.LOLLIPOP;
+
+import static androidx.core.content.res.TypedArrayUtils.obtainAttributes;
+
+import android.animation.ObjectAnimator;
+import android.animation.TimeInterpolator;
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.res.Resources;
+import android.content.res.TypedArray;
+import android.graphics.drawable.Animatable;
+import android.graphics.drawable.AnimationDrawable;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.util.StateSet;
+import android.util.Xml;
+
+import androidx.annotation.DrawableRes;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.R;
+import androidx.appcompat.content.res.AppCompatResources;
+import androidx.collection.LongSparseArray;
+import androidx.collection.SparseArrayCompat;
+import androidx.core.graphics.drawable.TintAwareDrawable;
+import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;
+import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.io.IOException;
+
+/**
+ * A {@link Drawable} providing animated transitions between states.
+ *
+ * <p>A port of {@link android.graphics.drawable.AnimatedStateListDrawable} compatible with older
+ * versions of the platform.
+ *
+ * <p>This drawable can be defined in an XML file with the <code>
+ * <animated-selector></code> element. Each keyframe Drawable is defined in a
+ * nested <code><item></code> element. Transitions are defined in a nested
+ * <code><transition></code> element.
+ *
+ * <p>Notable exceptions not supported by this class:
+ *
+ * <ul>
+ * <li><code>drawable</code>s defined as children of <code><item></code>s or
+ * <code><transition></code>s (<b>except</b> vectors) ignore theme attributes prior to API level
+ * 21</li>
+ * <li>Animated vector transitions do not support reversing prior to API level 24</li>
+ * </ul>
+ *
+ * {@link android.R.attr#state_focused}
+ * {@link android.R.attr#state_window_focused}
+ * {@link android.R.attr#state_enabled}
+ * {@link android.R.attr#state_checkable}
+ * {@link android.R.attr#state_checked}
+ * {@link android.R.attr#state_selected}
+ * {@link android.R.attr#state_activated}
+ * {@link android.R.attr#state_active}
+ * {@link android.R.attr#state_single}
+ * {@link android.R.attr#state_first}
+ * {@link android.R.attr#state_middle}
+ * {@link android.R.attr#state_last}
+ * {@link android.R.attr#state_pressed}
+ * @see AppCompatResources#getDrawable(Context, int)
+ */
+public class AnimatedStateListDrawableCompat extends StateListDrawable
+ implements TintAwareDrawable {
+ private static final String LOGTAG = AnimatedStateListDrawableCompat.class.getSimpleName();
+ private static final String ELEMENT_TRANSITION = "transition";
+ private static final String ELEMENT_ITEM = "item";
+ private static final String TRANSITION_MISSING_DRAWABLE_ERROR =
+ ": <transition> tag requires a 'drawable' attribute or child tag defining a drawable";
+ private static final String TRANSITION_MISSING_FROM_TO_ID =
+ ": <transition> tag requires 'fromId' & 'toId' attributes";
+ private static final String ITEM_MISSING_DRAWABLE_ERROR =
+ ": <item> tag requires a 'drawable' attribute or child tag defining a drawable";
+ private AnimatedStateListState mState;
+ /** The currently running transition, if any. */
+ private Transition mTransition;
+ /** Index to be set after the transition ends. */
+ private int mTransitionToIndex = -1;
+ /** Index away from which we are transitioning. */
+ private int mTransitionFromIndex = -1;
+ private boolean mMutated;
+
+ public AnimatedStateListDrawableCompat() {
+ this(null, null);
+ }
+
+ AnimatedStateListDrawableCompat(@Nullable AnimatedStateListState state,
+ @Nullable Resources res) {
+ super(null);
+ // Every animated state list drawable has its own constant state.
+ final AnimatedStateListState newState = new AnimatedStateListState(state, this, res);
+ setConstantState(newState);
+ onStateChange(getState());
+ jumpToCurrentState();
+ }
+
+ /**
+ * Creates an AnimatedStateListDrawableCompat.
+ *
+ * @param context context to inflate against
+ * @param resId the resource ID for AnimatedStateListDrawable object.
+ * @param theme the theme to apply, may be null.
+ * @return a new AnimatedStateListDrawableCompat or null if parsing error is found.
+ * @see AppCompatResources#getDrawable(Context, int)
+ */
+ @Nullable
+ public static AnimatedStateListDrawableCompat create(
+ @NonNull Context context,
+ @DrawableRes int resId,
+ @Nullable Resources.Theme theme) {
+ try {
+ final Resources res = context.getResources();
+ @SuppressLint("ResourceType")
+ final XmlPullParser parser = res.getXml(resId);
+ final AttributeSet attrs = Xml.asAttributeSet(parser);
+ int type;
+ while ((type = parser.next()) != XmlPullParser.START_TAG
+ && type != XmlPullParser.END_DOCUMENT) {
+ // Empty loop
+ }
+ if (type != XmlPullParser.START_TAG) {
+ throw new XmlPullParserException("No start tag found");
+ }
+ return createFromXmlInner(context, res, parser, attrs, theme);
+ } catch (XmlPullParserException e) {
+ Log.e(LOGTAG, "parser error", e);
+ } catch (IOException e) {
+ Log.e(LOGTAG, "parser error", e);
+ }
+ return null;
+ }
+
+ /**
+ * Create a AnimatedStateListDrawableCompat from inside an XML document using an optional
+ * {@link Resources.Theme}. Called on a parser positioned at a tag in an XML
+ * document, tries to create an AnimatedStateListDrawableCompat from that tag.
+ */
+ public static AnimatedStateListDrawableCompat createFromXmlInner(
+ @NonNull Context context,
+ @NonNull Resources resources,
+ @NonNull XmlPullParser parser,
+ @NonNull AttributeSet attrs,
+ @Nullable Resources.Theme theme)
+ throws IOException, XmlPullParserException {
+ final String name = parser.getName();
+ if (!name.equals("animated-selector")) {
+ throw new XmlPullParserException(
+ parser.getPositionDescription() + ": invalid animated-selector tag " + name);
+ }
+ AnimatedStateListDrawableCompat asl = new AnimatedStateListDrawableCompat();
+ asl.inflate(context, resources, parser, attrs, theme);
+ return asl;
+ }
+
+ /**
+ * Inflate this Drawable from an XML resource optionally styled by a theme.
+ * This can't be called more than once for each Drawable.
+ *
+ * @param context context to inflate against
+ * @param resources Resources used to resolve attribute values
+ * @param parser XML parser from which to inflate this Drawable
+ * @param attrs Base set of attribute values
+ * @param theme Theme to apply, may be null
+ * @throws XmlPullParserException
+ * @throws IOException
+ */
+ @Override
+ public void inflate(
+ @NonNull Context context,
+ @NonNull Resources resources,
+ @NonNull XmlPullParser parser,
+ @NonNull AttributeSet attrs,
+ @Nullable Resources.Theme theme)
+ throws XmlPullParserException, IOException {
+ final TypedArray a = obtainAttributes(
+ resources, theme, attrs, R.styleable.AnimatedStateListDrawableCompat);
+ setVisible(a.getBoolean(R.styleable.AnimatedStateListDrawableCompat_android_visible, true),
+ true);
+ updateStateFromTypedArray(a);
+ updateDensity(resources);
+ a.recycle();
+ inflateChildElements(context, resources, parser, attrs, theme);
+ init();
+ }
+
+ @Override
+ public boolean setVisible(boolean visible, boolean restart) {
+ final boolean changed = super.setVisible(visible, restart);
+ if (mTransition != null && (changed || restart)) {
+ if (visible) {
+ mTransition.start();
+ } else {
+ // Ensure we're showing the correct state when visible.
+ jumpToCurrentState();
+ }
+ }
+ return changed;
+ }
+
+ /**
+ * Add a new drawable to the set of keyframes.
+ *
+ * @param stateSet An array of resource IDs to associate with the keyframe
+ * @param drawable The drawable to show when in the specified state, may not be null
+ * @param id The unique identifier for the keyframe
+ */
+ public void addState(@NonNull int[] stateSet, @NonNull Drawable drawable, int id) {
+ if (drawable == null) {
+ throw new IllegalArgumentException("Drawable must not be null");
+ }
+ mState.addStateSet(stateSet, drawable, id);
+ onStateChange(getState());
+ }
+
+ /**
+ * Adds a new transition between keyframes.
+ *
+ * @param fromId Unique identifier of the starting keyframe
+ * @param toId Unique identifier of the ending keyframe
+ * @param transition An {@link Animatable} drawable to use as a transition, may not be null
+ * @param reversible Whether the transition can be reversed
+ */
+ public <T extends Drawable & Animatable> void addTransition(int fromId, int toId,
+ @NonNull T transition, boolean reversible) {
+ if (transition == null) {
+ throw new IllegalArgumentException("Transition drawable must not be null");
+ }
+ mState.addTransition(fromId, toId, transition, reversible);
+ }
+
+ @Override
+ public boolean isStateful() {
+ return true;
+ }
+
+ @Override
+ public void jumpToCurrentState() {
+ super.jumpToCurrentState();
+ if (mTransition != null) {
+ mTransition.stop();
+ mTransition = null;
+ selectDrawable(mTransitionToIndex);
+ mTransitionToIndex = -1;
+ mTransitionFromIndex = -1;
+ }
+ }
+
+ @Override
+ protected boolean onStateChange(int[] stateSet) {
+ // If we're not already at the target index, either attempt to find a
+ // valid transition to it or jump directly there.
+ final int targetIndex = mState.indexOfKeyframe(stateSet);
+ boolean changed = targetIndex != getCurrentIndex()
+ && (selectTransition(targetIndex) || selectDrawable(targetIndex));
+ // We need to propagate the state change to the current drawable, but
+ // we can't call StateListDrawable.onStateChange() without changing the
+ // current drawable.
+ final Drawable current = getCurrent();
+ if (current != null) {
+ changed |= current.setState(stateSet);
+ }
+ return changed;
+ }
+
+ private boolean selectTransition(int toIndex) {
+ final int fromIndex;
+ final Transition currentTransition = mTransition;
+ if (currentTransition != null) {
+ if (toIndex == mTransitionToIndex) {
+ // Already animating to that keyframe.
+ return true;
+ } else if (toIndex == mTransitionFromIndex && currentTransition.canReverse()) {
+ // Reverse the current animation.
+ currentTransition.reverse();
+ mTransitionToIndex = mTransitionFromIndex;
+ mTransitionFromIndex = toIndex;
+ return true;
+ }
+ // Start the next transition from the end of the current one.
+ fromIndex = mTransitionToIndex;
+ // Changing animation, end the current animation.
+ currentTransition.stop();
+ } else {
+ fromIndex = getCurrentIndex();
+ }
+ // Reset state.
+ mTransition = null;
+ mTransitionFromIndex = -1;
+ mTransitionToIndex = -1;
+ final AnimatedStateListState state = mState;
+ final int fromId = state.getKeyframeIdAt(fromIndex);
+ final int toId = state.getKeyframeIdAt(toIndex);
+ if (toId == 0 || fromId == 0) {
+ // Missing a keyframe ID.
+ return false;
+ }
+ final int transitionIndex = state.indexOfTransition(fromId, toId);
+ if (transitionIndex < 0) {
+ // Couldn't select a transition.
+ return false;
+ }
+ boolean hasReversibleFlag = state.transitionHasReversibleFlag(fromId, toId);
+ // This may fail if we're already on the transition, but that's okay!
+ selectDrawable(transitionIndex);
+ final Transition transition;
+ final Drawable d = getCurrent();
+ if (d instanceof AnimationDrawable) {
+ final boolean reversed = state.isTransitionReversed(fromId, toId);
+ transition = new AnimationDrawableTransition((AnimationDrawable) d,
+ reversed, hasReversibleFlag);
+ } else if (d instanceof AnimatedVectorDrawableCompat) {
+ //final boolean reversed = state.isTransitionReversed(fromId, toId);
+ transition = new AnimatedVectorDrawableTransition((AnimatedVectorDrawableCompat) d);
+ } else if (d instanceof Animatable) {
+ transition = new AnimatableTransition((Animatable) d);
+ } else {
+ // We don't know how to animate this transition.
+ return false;
+ }
+ transition.start();
+ mTransition = transition;
+ mTransitionFromIndex = fromIndex;
+ mTransitionToIndex = toIndex;
+ return true;
+ }
+
+ private abstract static class Transition {
+ public abstract void start();
+
+ public abstract void stop();
+
+ public void reverse() {
+ // Not supported by default.
+ }
+
+ public boolean canReverse() {
+ return false;
+ }
+ }
+
+ private static class AnimatableTransition extends Transition {
+ private final Animatable mA;
+
+ AnimatableTransition(Animatable a) {
+ mA = a;
+ }
+
+ @Override
+ public void start() {
+ mA.start();
+ }
+
+ @Override
+ public void stop() {
+ mA.stop();
+ }
+ }
+
+ private static class AnimationDrawableTransition extends Transition {
+ private final ObjectAnimator mAnim;
+ // Even AnimationDrawable is always reversible technically, but
+ // we should obey the XML's android:reversible flag.
+ private final boolean mHasReversibleFlag;
+
+ AnimationDrawableTransition(AnimationDrawable ad,
+ boolean reversed, boolean hasReversibleFlag) {
+ final int frameCount = ad.getNumberOfFrames();
+ final int fromFrame = reversed ? frameCount - 1 : 0;
+ final int toFrame = reversed ? 0 : frameCount - 1;
+ final FrameInterpolator interp = new FrameInterpolator(ad, reversed);
+ @SuppressLint("ObjectAnimatorBinding")
+ final ObjectAnimator anim =
+ ObjectAnimator.ofInt(ad, "currentIndex", fromFrame, toFrame);
+ if (SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
+ anim.setAutoCancel(true);
+ }
+ anim.setDuration(interp.getTotalDuration());
+ anim.setInterpolator(interp);
+ mHasReversibleFlag = hasReversibleFlag;
+ mAnim = anim;
+ }
+
+ @Override
+ public boolean canReverse() {
+ return mHasReversibleFlag;
+ }
+
+ @Override
+ public void start() {
+ mAnim.start();
+ }
+
+ @Override
+ public void reverse() {
+ mAnim.reverse();
+ }
+
+ @Override
+ public void stop() {
+ mAnim.cancel();
+ }
+ }
+
+ private static class AnimatedVectorDrawableTransition extends Transition {
+ private final AnimatedVectorDrawableCompat mAvd;
+
+ AnimatedVectorDrawableTransition(AnimatedVectorDrawableCompat avd) {
+ mAvd = avd;
+ }
+
+ @Override
+ public void start() {
+ mAvd.start();
+ }
+
+ @Override
+ public void stop() {
+ mAvd.stop();
+ }
+ }
+
+ private void updateStateFromTypedArray(TypedArray a) {
+ final AnimatedStateListState state = mState;
+ // Account for any configuration changes.
+ if (SDK_INT >= LOLLIPOP) {
+ state.mChangingConfigurations |= a.getChangingConfigurations();
+ }
+ // Extract the theme attributes, if any.
+ state.setVariablePadding(
+ a.getBoolean(R.styleable.AnimatedStateListDrawableCompat_android_variablePadding,
+ state.mVariablePadding));
+ state.setConstantSize(
+ a.getBoolean(R.styleable.AnimatedStateListDrawableCompat_android_constantSize,
+ state.mConstantSize));
+ state.setEnterFadeDuration(
+ a.getInt(R.styleable.AnimatedStateListDrawableCompat_android_enterFadeDuration,
+ state.mEnterFadeDuration));
+ state.setExitFadeDuration(
+ a.getInt(R.styleable.AnimatedStateListDrawableCompat_android_exitFadeDuration,
+ state.mExitFadeDuration));
+ setDither(a.getBoolean(R.styleable.AnimatedStateListDrawableCompat_android_dither,
+ state.mDither));
+ }
+
+ private void init() {
+ onStateChange(getState());
+ }
+
+ private void inflateChildElements(
+ @NonNull Context context,
+ @NonNull Resources resources,
+ @NonNull XmlPullParser parser,
+ @NonNull AttributeSet attrs,
+ @Nullable Resources.Theme theme)
+ throws XmlPullParserException, IOException {
+ int type;
+ final int innerDepth = parser.getDepth() + 1;
+ int depth;
+ while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
+ && ((depth = parser.getDepth()) >= innerDepth
+ || type != XmlPullParser.END_TAG)) {
+ if (type != XmlPullParser.START_TAG) {
+ continue;
+ }
+ if (depth > innerDepth) {
+ continue;
+ }
+ if (parser.getName().equals(ELEMENT_ITEM)) {
+ parseItem(context, resources, parser, attrs, theme);
+ } else if (parser.getName().equals(ELEMENT_TRANSITION)) {
+ parseTransition(context, resources, parser, attrs, theme);
+ }
+ }
+ }
+
+ private int parseTransition(
+ @NonNull Context context,
+ @NonNull Resources resources,
+ @NonNull XmlPullParser parser,
+ @NonNull AttributeSet attrs,
+ @Nullable Resources.Theme theme)
+ throws XmlPullParserException, IOException {
+
+ final TypedArray a = obtainAttributes(resources, theme, attrs,
+ R.styleable.AnimatedStateListDrawableTransition);
+ final int fromId = a.getResourceId(
+ R.styleable.AnimatedStateListDrawableTransition_android_fromId, -1);
+ final int toId = a.getResourceId(
+ R.styleable.AnimatedStateListDrawableTransition_android_toId, -1);
+ Drawable dr = null;
+ final int drawableId = a.getResourceId(
+ R.styleable.AnimatedStateListDrawableTransition_android_drawable, -1);
+ if (drawableId > 0) {
+ dr = AppCompatResources.getDrawable(context, drawableId);
+ }
+ final boolean reversible = a.getBoolean(
+ R.styleable.AnimatedStateListDrawableTransition_android_reversible, false);
+ a.recycle();
+ // Loading child elements modifies the state of the AttributeSet's underlying parser, so
+ // it needs to happen after obtaining attributes and extracting states.
+ if (dr == null) {
+ int type;
+ while ((type = parser.next()) == XmlPullParser.TEXT) {
+ // no-op
+ }
+ if (type != XmlPullParser.START_TAG) {
+ throw new XmlPullParserException(
+ parser.getPositionDescription() + TRANSITION_MISSING_DRAWABLE_ERROR);
+ }
+ // Attempt to parse child AVDs
+ if (parser.getName().equals("animated-vector")) {
+ dr = AnimatedVectorDrawableCompat.createFromXmlInner(context, resources, parser,
+ attrs, theme);
+ } else if (SDK_INT >= LOLLIPOP) {
+ dr = Drawable.createFromXmlInner(resources, parser, attrs, theme);
+ } else {
+ dr = Drawable.createFromXmlInner(resources, parser, attrs);
+ }
+ }
+ if (dr == null) {
+ throw new XmlPullParserException(
+ parser.getPositionDescription() + TRANSITION_MISSING_DRAWABLE_ERROR);
+ }
+ if (fromId == -1 || toId == -1) {
+ throw new XmlPullParserException(
+ parser.getPositionDescription() + TRANSITION_MISSING_FROM_TO_ID);
+ }
+ return mState.addTransition(fromId, toId, dr, reversible);
+ }
+
+ private int parseItem(
+ @NonNull Context context,
+ @NonNull Resources resources,
+ @NonNull XmlPullParser parser,
+ @NonNull AttributeSet attrs,
+ @Nullable Resources.Theme theme)
+ throws XmlPullParserException, IOException {
+ final TypedArray a = obtainAttributes(resources, theme, attrs,
+ R.styleable.AnimatedStateListDrawableItem);
+ final int keyframeId = a.getResourceId(R.styleable.AnimatedStateListDrawableItem_android_id,
+ 0);
+ Drawable dr = null;
+ final int drawableId =
+ a.getResourceId(R.styleable.AnimatedStateListDrawableItem_android_drawable, -1);
+ if (drawableId > 0) {
+ dr = AppCompatResources.getDrawable(context, drawableId);
+ }
+ a.recycle();
+ final int[] states = extractStateSet(attrs);
+ // Loading child elements modifies the state of the AttributeSet's underlying parser, so
+ // it needs to happen after obtaining attributes and extracting states.
+ if (dr == null) {
+ int type;
+ while ((type = parser.next()) == XmlPullParser.TEXT) {
+ // no-op
+ }
+ if (type != XmlPullParser.START_TAG) {
+ throw new XmlPullParserException(
+ parser.getPositionDescription() + ITEM_MISSING_DRAWABLE_ERROR);
+ }
+ // Attempt to parse child VDs
+ if (parser.getName().equals("vector")) {
+ dr = VectorDrawableCompat.createFromXmlInner(resources, parser, attrs, theme);
+ } else if (SDK_INT >= LOLLIPOP) {
+ dr = Drawable.createFromXmlInner(resources, parser, attrs, theme);
+ } else {
+ dr = Drawable.createFromXmlInner(resources, parser, attrs);
+ }
+ }
+ if (dr == null) {
+ throw new XmlPullParserException(
+ parser.getPositionDescription() + ITEM_MISSING_DRAWABLE_ERROR);
+ }
+ return mState.addStateSet(states, dr, keyframeId);
+ }
+
+ @Override
+ public Drawable mutate() {
+ if (!mMutated && super.mutate() == this) {
+ mState.mutate();
+ mMutated = true;
+ }
+ return this;
+ }
+
+ @Override
+ AnimatedStateListState cloneConstantState() {
+ return new AnimatedStateListState(mState, this, null);
+ }
+
+ @Override
+ void clearMutated() {
+ super.clearMutated();
+ mMutated = false;
+ }
+
+ static class AnimatedStateListState extends StateListState {
+ // REVERSED_BIT is indicating the current transition's direction.
+ private static final long REVERSED_BIT = 0x100000000L;
+ // REVERSIBLE_FLAG_BIT is indicating whether the whole transition has
+ // reversible flag set to true.
+ private static final long REVERSIBLE_FLAG_BIT = 0x200000000L;
+ LongSparseArray<Long> mTransitions;
+ SparseArrayCompat<Integer> mStateIds;
+
+ AnimatedStateListState(@Nullable AnimatedStateListState orig,
+ @NonNull AnimatedStateListDrawableCompat owner, @Nullable Resources res) {
+ super(orig, owner, res);
+ if (orig != null) {
+ // Perform a shallow copy and rely on mutate() to deep-copy.
+ mTransitions = orig.mTransitions;
+ mStateIds = orig.mStateIds;
+ } else {
+ mTransitions = new LongSparseArray<>();
+ mStateIds = new SparseArrayCompat<>();
+ }
+ }
+
+ @Override
+ void mutate() {
+ mTransitions = mTransitions.clone();
+ mStateIds = mStateIds.clone();
+ }
+
+ int addTransition(int fromId, int toId, @NonNull Drawable anim, boolean reversible) {
+ final int pos = super.addChild(anim);
+ final long keyFromTo = generateTransitionKey(fromId, toId);
+ long reversibleBit = 0;
+ if (reversible) {
+ reversibleBit = REVERSIBLE_FLAG_BIT;
+ }
+ mTransitions.append(keyFromTo, pos | reversibleBit);
+ if (reversible) {
+ final long keyToFrom = generateTransitionKey(toId, fromId);
+ mTransitions.append(keyToFrom, pos | REVERSED_BIT | reversibleBit);
+ }
+ return pos;
+ }
+
+ int addStateSet(@NonNull int[] stateSet, @NonNull Drawable drawable, int id) {
+ final int index = super.addStateSet(stateSet, drawable);
+ mStateIds.put(index, id);
+ return index;
+ }
+
+ int indexOfKeyframe(@NonNull int[] stateSet) {
+ final int index = super.indexOfStateSet(stateSet);
+ if (index >= 0) {
+ return index;
+ }
+ return super.indexOfStateSet(StateSet.WILD_CARD);
+ }
+
+ int getKeyframeIdAt(int index) {
+ return index < 0 ? 0 : mStateIds.get(index, 0);
+ }
+
+ int indexOfTransition(int fromId, int toId) {
+ final long keyFromTo = generateTransitionKey(fromId, toId);
+ return (int) mTransitions.get(keyFromTo, -1L).longValue();
+ }
+
+ boolean isTransitionReversed(int fromId, int toId) {
+ final long keyFromTo = generateTransitionKey(fromId, toId);
+ return (mTransitions.get(keyFromTo, -1L) & REVERSED_BIT) != 0L;
+ }
+
+ boolean transitionHasReversibleFlag(int fromId, int toId) {
+ final long keyFromTo = generateTransitionKey(fromId, toId);
+ return (mTransitions.get(keyFromTo, -1L) & REVERSIBLE_FLAG_BIT) != 0L;
+ }
+
+ @NonNull
+ @Override
+ public Drawable newDrawable() {
+ return new AnimatedStateListDrawableCompat(this, null);
+ }
+
+ @NonNull
+ @Override
+ public Drawable newDrawable(Resources res) {
+ return new AnimatedStateListDrawableCompat(this, res);
+ }
+
+ private static long generateTransitionKey(int fromId, int toId) {
+ return (long) fromId << 32 | toId;
+ }
+ }
+
+ @Override
+ void setConstantState(@NonNull DrawableContainerState state) {
+ super.setConstantState(state);
+ if (state instanceof AnimatedStateListState) {
+ mState = (AnimatedStateListState) state;
+ }
+ }
+
+ /**
+ * Interpolates between frames with respect to their individual durations.
+ */
+ private static class FrameInterpolator implements TimeInterpolator {
+ private int[] mFrameTimes;
+ private int mFrames;
+ private int mTotalDuration;
+
+ FrameInterpolator(AnimationDrawable d, boolean reversed) {
+ updateFrames(d, reversed);
+ }
+
+ int updateFrames(AnimationDrawable d, boolean reversed) {
+ final int frameCount = d.getNumberOfFrames();
+ mFrames = frameCount;
+ if (mFrameTimes == null || mFrameTimes.length < frameCount) {
+ mFrameTimes = new int[frameCount];
+ }
+ final int[] frameTimes = mFrameTimes;
+ int totalDuration = 0;
+ for (int i = 0; i < frameCount; i++) {
+ final int duration = d.getDuration(reversed ? frameCount - i - 1 : i);
+ frameTimes[i] = duration;
+ totalDuration += duration;
+ }
+ mTotalDuration = totalDuration;
+ return totalDuration;
+ }
+
+ int getTotalDuration() {
+ return mTotalDuration;
+ }
+
+ @Override
+ public float getInterpolation(float input) {
+ final int elapsed = (int) (input * mTotalDuration + 0.5f);
+ final int frameCount = mFrames;
+ final int[] frameTimes = mFrameTimes;
+ // Find the current frame and remaining time within that frame.
+ int remaining = elapsed;
+ int i = 0;
+ while (i < frameCount && remaining >= frameTimes[i]) {
+ remaining -= frameTimes[i];
+ i++;
+ }
+ // Remaining time is relative of total duration.
+ final float frameElapsed;
+ if (i < frameCount) {
+ frameElapsed = remaining / (float) mTotalDuration;
+ } else {
+ frameElapsed = 0;
+ }
+ return i / (float) frameCount + frameElapsed;
+ }
+ }
+}
diff --git a/appcompat/src/main/java/androidx/appcompat/graphics/drawable/DrawableContainer.java b/appcompat/src/main/java/androidx/appcompat/graphics/drawable/DrawableContainer.java
new file mode 100644
index 0000000..fbbea57
--- /dev/null
+++ b/appcompat/src/main/java/androidx/appcompat/graphics/drawable/DrawableContainer.java
@@ -0,0 +1,1211 @@
+/*
+ * Copyright (C) 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.appcompat.graphics.drawable;
+
+import static android.os.Build.VERSION_CODES.LOLLIPOP;
+
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+
+import android.annotation.SuppressLint;
+import android.annotation.TargetApi;
+import android.content.res.ColorStateList;
+import android.content.res.Resources;
+import android.content.res.Resources.Theme;
+import android.graphics.Canvas;
+import android.graphics.ColorFilter;
+import android.graphics.Outline;
+import android.graphics.PixelFormat;
+import android.graphics.PorterDuff.Mode;
+import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.os.SystemClock;
+import android.util.DisplayMetrics;
+import android.util.LayoutDirection;
+import android.util.SparseArray;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+import androidx.annotation.RestrictTo;
+import androidx.core.graphics.drawable.DrawableCompat;
+
+/**
+ * A helper class that contains several {@link Drawable}s and selects which one to use.
+ *
+ * Adapted from platform class, altered with API level checks as necessary.
+ *
+ * @hide
+ */
+@RestrictTo(LIBRARY_GROUP)
+class DrawableContainer extends Drawable implements Drawable.Callback {
+ private static final boolean DEBUG = false;
+ private static final String TAG = "DrawableContainer";
+ /**
+ * To be proper, we should have a getter for dither (and alpha, etc.)
+ * so that proxy classes like this can save/restore their delegates'
+ * values, but we don't have getters. Since we do have setters
+ * (e.g. setDither), which this proxy forwards on, we have to have some
+ * default/initial setting.
+ *
+ * The initial setting for dither is now true, since it almost always seems
+ * to improve the quality at negligible cost.
+ */
+ private static final boolean DEFAULT_DITHER = true;
+ private DrawableContainerState mDrawableContainerState;
+ private Rect mHotspotBounds;
+ private Drawable mCurrDrawable;
+ private Drawable mLastDrawable;
+ private int mAlpha = 0xFF;
+ /** Whether setAlpha() has been called at least once. */
+ private boolean mHasAlpha;
+ private int mCurIndex = -1;
+ private int mLastIndex = -1;
+ private boolean mMutated;
+ // Animations.
+ private Runnable mAnimationRunnable;
+ private long mEnterAnimationEnd;
+ private long mExitAnimationEnd;
+ /** Callback that blocks invalidation. Used for drawable initialization. */
+ private BlockInvalidateCallback mBlockInvalidateCallback;
+
+ // overrides from Drawable
+ @Override
+ public void draw(@NonNull Canvas canvas) {
+ if (mCurrDrawable != null) {
+ mCurrDrawable.draw(canvas);
+ }
+ if (mLastDrawable != null) {
+ mLastDrawable.draw(canvas);
+ }
+ }
+
+ @Override
+ public int getChangingConfigurations() {
+ return super.getChangingConfigurations()
+ | mDrawableContainerState.getChangingConfigurations();
+ }
+
+ // Remove BanTargetApiAnnotation suppression once b/120623677 is addressed.
+ @SuppressLint({"WrongConstant", "BanTargetApiAnnotation"})
+ @TargetApi(Build.VERSION_CODES.M)
+ private boolean needsMirroring() {
+ return isAutoMirrored() && getLayoutDirection() == LayoutDirection.RTL;
+ }
+
+ @Override
+ public boolean getPadding(@NonNull Rect padding) {
+ final Rect r = mDrawableContainerState.getConstantPadding();
+ boolean result;
+ if (r != null) {
+ padding.set(r);
+ result = (r.left | r.top | r.bottom | r.right) != 0;
+ } else {
+ if (mCurrDrawable != null) {
+ result = mCurrDrawable.getPadding(padding);
+ } else {
+ result = super.getPadding(padding);
+ }
+ }
+ if (needsMirroring()) {
+ final int left = padding.left;
+ final int right = padding.right;
+ padding.left = right;
+ padding.right = left;
+ }
+ return result;
+ }
+
+ @RequiresApi(LOLLIPOP)
+ @Override
+ public void getOutline(@NonNull Outline outline) {
+ if (mCurrDrawable != null) {
+ mCurrDrawable.getOutline(outline);
+ }
+ }
+
+ @Override
+ public void setAlpha(int alpha) {
+ if (!mHasAlpha || mAlpha != alpha) {
+ mHasAlpha = true;
+ mAlpha = alpha;
+ if (mCurrDrawable != null) {
+ if (mEnterAnimationEnd == 0) {
+ mCurrDrawable.setAlpha(alpha);
+ } else {
+ animate(false);
+ }
+ }
+ }
+ }
+
+ @Override
+ public int getAlpha() {
+ return mAlpha;
+ }
+
+ @Override
+ public void setDither(boolean dither) {
+ if (mDrawableContainerState.mDither != dither) {
+ mDrawableContainerState.mDither = dither;
+ if (mCurrDrawable != null) {
+ mCurrDrawable.setDither(mDrawableContainerState.mDither);
+ }
+ }
+ }
+
+ @Override
+ public void setColorFilter(ColorFilter colorFilter) {
+ mDrawableContainerState.mHasColorFilter = true;
+ if (mDrawableContainerState.mColorFilter != colorFilter) {
+ mDrawableContainerState.mColorFilter = colorFilter;
+ if (mCurrDrawable != null) {
+ mCurrDrawable.setColorFilter(colorFilter);
+ }
+ }
+ }
+
+ @Override
+ public void setTintList(ColorStateList tint) {
+ mDrawableContainerState.mHasTintList = true;
+ if (mDrawableContainerState.mTintList != tint) {
+ mDrawableContainerState.mTintList = tint;
+ DrawableCompat.setTintList(mCurrDrawable, tint);
+ }
+ }
+
+ @Override
+ public void setTintMode(@NonNull Mode tintMode) {
+ mDrawableContainerState.mHasTintMode = true;
+ if (mDrawableContainerState.mTintMode != tintMode) {
+ mDrawableContainerState.mTintMode = tintMode;
+ DrawableCompat.setTintMode(mCurrDrawable, tintMode);
+ }
+ }
+
+ /**
+ * Change the global fade duration when a new drawable is entering
+ * the scene.
+ *
+ * @param ms The amount of time to fade in milliseconds.
+ */
+ public void setEnterFadeDuration(int ms) {
+ mDrawableContainerState.mEnterFadeDuration = ms;
+ }
+
+ /**
+ * Change the global fade duration when a new drawable is leaving
+ * the scene.
+ *
+ * @param ms The amount of time to fade in milliseconds.
+ */
+ public void setExitFadeDuration(int ms) {
+ mDrawableContainerState.mExitFadeDuration = ms;
+ }
+
+ @Override
+ protected void onBoundsChange(Rect bounds) {
+ if (mLastDrawable != null) {
+ mLastDrawable.setBounds(bounds);
+ }
+ if (mCurrDrawable != null) {
+ mCurrDrawable.setBounds(bounds);
+ }
+ }
+
+ @Override
+ public boolean isStateful() {
+ return mDrawableContainerState.isStateful();
+ }
+
+ @Override
+ public void setAutoMirrored(boolean mirrored) {
+ if (mDrawableContainerState.mAutoMirrored != mirrored) {
+ mDrawableContainerState.mAutoMirrored = mirrored;
+ if (mCurrDrawable != null) {
+ DrawableCompat.setAutoMirrored(mCurrDrawable,
+ mDrawableContainerState.mAutoMirrored);
+ }
+ }
+ }
+
+ @Override
+ public boolean isAutoMirrored() {
+ return mDrawableContainerState.mAutoMirrored;
+ }
+
+ @Override
+ public void jumpToCurrentState() {
+ boolean changed = false;
+ if (mLastDrawable != null) {
+ mLastDrawable.jumpToCurrentState();
+ mLastDrawable = null;
+ mLastIndex = -1;
+ changed = true;
+ }
+ if (mCurrDrawable != null) {
+ mCurrDrawable.jumpToCurrentState();
+ if (mHasAlpha) {
+ mCurrDrawable.setAlpha(mAlpha);
+ }
+ }
+ if (mExitAnimationEnd != 0) {
+ mExitAnimationEnd = 0;
+ changed = true;
+ }
+ if (mEnterAnimationEnd != 0) {
+ mEnterAnimationEnd = 0;
+ changed = true;
+ }
+ if (changed) {
+ invalidateSelf();
+ }
+ }
+
+ @Override
+ public void setHotspot(float x, float y) {
+ if (mCurrDrawable != null) {
+ DrawableCompat.setHotspot(mCurrDrawable, x, y);
+ }
+ }
+
+ @Override
+ public void setHotspotBounds(int left, int top, int right, int bottom) {
+ if (mHotspotBounds == null) {
+ mHotspotBounds = new Rect(left, top, right, bottom);
+ } else {
+ mHotspotBounds.set(left, top, right, bottom);
+ }
+ if (mCurrDrawable != null) {
+ DrawableCompat.setHotspotBounds(mCurrDrawable, left, top, right, bottom);
+ }
+ }
+
+ @Override
+ public void getHotspotBounds(@NonNull Rect outRect) {
+ if (mHotspotBounds != null) {
+ outRect.set(mHotspotBounds);
+ } else {
+ super.getHotspotBounds(outRect);
+ }
+ }
+
+ @Override
+ protected boolean onStateChange(int[] state) {
+ if (mLastDrawable != null) {
+ return mLastDrawable.setState(state);
+ }
+ if (mCurrDrawable != null) {
+ return mCurrDrawable.setState(state);
+ }
+ return false;
+ }
+
+ @Override
+ protected boolean onLevelChange(int level) {
+ if (mLastDrawable != null) {
+ return mLastDrawable.setLevel(level);
+ }
+ if (mCurrDrawable != null) {
+ return mCurrDrawable.setLevel(level);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean onLayoutDirectionChanged(int layoutDirection) {
+ // Let the container handle setting its own layout direction. Otherwise,
+ // we're accessing potentially unused states.
+ return mDrawableContainerState.setLayoutDirection(layoutDirection, getCurrentIndex());
+ }
+
+ @Override
+ public int getIntrinsicWidth() {
+ if (mDrawableContainerState.isConstantSize()) {
+ return mDrawableContainerState.getConstantWidth();
+ }
+ return mCurrDrawable != null ? mCurrDrawable.getIntrinsicWidth() : -1;
+ }
+
+ @Override
+ public int getIntrinsicHeight() {
+ if (mDrawableContainerState.isConstantSize()) {
+ return mDrawableContainerState.getConstantHeight();
+ }
+ return mCurrDrawable != null ? mCurrDrawable.getIntrinsicHeight() : -1;
+ }
+
+ @Override
+ public int getMinimumWidth() {
+ if (mDrawableContainerState.isConstantSize()) {
+ return mDrawableContainerState.getConstantMinimumWidth();
+ }
+ return mCurrDrawable != null ? mCurrDrawable.getMinimumWidth() : 0;
+ }
+
+ @Override
+ public int getMinimumHeight() {
+ if (mDrawableContainerState.isConstantSize()) {
+ return mDrawableContainerState.getConstantMinimumHeight();
+ }
+ return mCurrDrawable != null ? mCurrDrawable.getMinimumHeight() : 0;
+ }
+
+ @Override
+ public void invalidateDrawable(@NonNull Drawable who) {
+ // This may have been called as the result of a tint changing, in
+ // which case we may need to refresh the cached statefulness or
+ // opacity.
+ if (mDrawableContainerState != null) {
+ mDrawableContainerState.invalidateCache();
+ }
+ if (who == mCurrDrawable && getCallback() != null) {
+ getCallback().invalidateDrawable(this);
+ }
+ }
+
+ @Override
+ public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
+ if (who == mCurrDrawable && getCallback() != null) {
+ getCallback().scheduleDrawable(this, what, when);
+ }
+ }
+
+ @Override
+ public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
+ if (who == mCurrDrawable && getCallback() != null) {
+ getCallback().unscheduleDrawable(this, what);
+ }
+ }
+
+ @Override
+ public boolean setVisible(boolean visible, boolean restart) {
+ boolean changed = super.setVisible(visible, restart);
+ if (mLastDrawable != null) {
+ mLastDrawable.setVisible(visible, restart);
+ }
+ if (mCurrDrawable != null) {
+ mCurrDrawable.setVisible(visible, restart);
+ }
+ return changed;
+ }
+
+ @Override
+ public int getOpacity() {
+ return mCurrDrawable == null || !mCurrDrawable.isVisible() ? PixelFormat.TRANSPARENT :
+ mDrawableContainerState.getOpacity();
+ }
+
+ void setCurrentIndex(int index) {
+ selectDrawable(index);
+ }
+
+ int getCurrentIndex() {
+ return mCurIndex;
+ }
+
+ /**
+ * Sets the currently displayed drawable by index.
+ * <p>
+ * If an invalid index is specified, the current drawable will be set to
+ * {@code null} and the index will be set to {@code -1}.
+ *
+ * @param index the index of the drawable to display
+ * @return {@code true} if the drawable changed, {@code false} otherwise
+ */
+ boolean selectDrawable(int index) {
+ if (index == mCurIndex) {
+ return false;
+ }
+ final long now = SystemClock.uptimeMillis();
+ if (DEBUG) {
+ android.util.Log.i(TAG, toString() + " from " + mCurIndex + " to " + index
+ + ": exit=" + mDrawableContainerState.mExitFadeDuration
+ + " enter=" + mDrawableContainerState.mEnterFadeDuration);
+ }
+ if (mDrawableContainerState.mExitFadeDuration > 0) {
+ if (mLastDrawable != null) {
+ mLastDrawable.setVisible(false, false);
+ }
+ if (mCurrDrawable != null) {
+ mLastDrawable = mCurrDrawable;
+ mLastIndex = mCurIndex;
+ mExitAnimationEnd = now + mDrawableContainerState.mExitFadeDuration;
+ } else {
+ mLastDrawable = null;
+ mLastIndex = -1;
+ mExitAnimationEnd = 0;
+ }
+ } else if (mCurrDrawable != null) {
+ mCurrDrawable.setVisible(false, false);
+ }
+ if (index >= 0 && index < mDrawableContainerState.mNumChildren) {
+ final Drawable d = mDrawableContainerState.getChild(index);
+ mCurrDrawable = d;
+ mCurIndex = index;
+ if (d != null) {
+ if (mDrawableContainerState.mEnterFadeDuration > 0) {
+ mEnterAnimationEnd = now + mDrawableContainerState.mEnterFadeDuration;
+ }
+ initializeDrawableForDisplay(d);
+ }
+ } else {
+ mCurrDrawable = null;
+ mCurIndex = -1;
+ }
+ if (mEnterAnimationEnd != 0 || mExitAnimationEnd != 0) {
+ if (mAnimationRunnable == null) {
+ mAnimationRunnable = new Runnable() {
+ @Override
+ public void run() {
+ animate(true);
+ invalidateSelf();
+ }
+ };
+ } else {
+ unscheduleSelf(mAnimationRunnable);
+ }
+ // Compute first frame and schedule next animation.
+ animate(true);
+ }
+ invalidateSelf();
+ return true;
+ }
+
+ /**
+ * Initializes a drawable for display in this container.
+ *
+ * @param d The drawable to initialize.
+ */
+ private void initializeDrawableForDisplay(Drawable d) {
+ if (mBlockInvalidateCallback == null) {
+ mBlockInvalidateCallback = new BlockInvalidateCallback();
+ }
+ // Temporary fix for suspending callbacks during initialization. We
+ // don't want any of these setters causing an invalidate() since that
+ // may call back into DrawableContainer.
+ d.setCallback(mBlockInvalidateCallback.wrap(d.getCallback()));
+ try {
+ if (mDrawableContainerState.mEnterFadeDuration <= 0 && mHasAlpha) {
+ d.setAlpha(mAlpha);
+ }
+ if (mDrawableContainerState.mHasColorFilter) {
+ // Color filter always overrides tint.
+ d.setColorFilter(mDrawableContainerState.mColorFilter);
+ } else {
+ if (mDrawableContainerState.mHasTintList) {
+ DrawableCompat.setTintList(d, mDrawableContainerState.mTintList);
+ }
+ if (mDrawableContainerState.mHasTintMode) {
+ DrawableCompat.setTintMode(d, mDrawableContainerState.mTintMode);
+ }
+ }
+ d.setVisible(isVisible(), true);
+ d.setDither(mDrawableContainerState.mDither);
+ d.setState(getState());
+ d.setLevel(getLevel());
+ d.setBounds(getBounds());
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ d.setLayoutDirection(getLayoutDirection());
+ }
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ d.setAutoMirrored(mDrawableContainerState.mAutoMirrored);
+ }
+ final Rect hotspotBounds = mHotspotBounds;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && hotspotBounds != null) {
+ d.setHotspotBounds(hotspotBounds.left, hotspotBounds.top,
+ hotspotBounds.right, hotspotBounds.bottom);
+ }
+ } finally {
+ d.setCallback(mBlockInvalidateCallback.unwrap());
+ }
+ }
+
+ void animate(boolean schedule) {
+ mHasAlpha = true;
+ final long now = SystemClock.uptimeMillis();
+ boolean animating = false;
+ if (mCurrDrawable != null) {
+ if (mEnterAnimationEnd != 0) {
+ if (mEnterAnimationEnd <= now) {
+ mCurrDrawable.setAlpha(mAlpha);
+ mEnterAnimationEnd = 0;
+ } else {
+ int animAlpha = (int) ((mEnterAnimationEnd - now) * 255)
+ / mDrawableContainerState.mEnterFadeDuration;
+ mCurrDrawable.setAlpha(((255 - animAlpha) * mAlpha) / 255);
+ animating = true;
+ }
+ }
+ } else {
+ mEnterAnimationEnd = 0;
+ }
+ if (mLastDrawable != null) {
+ if (mExitAnimationEnd != 0) {
+ if (mExitAnimationEnd <= now) {
+ mLastDrawable.setVisible(false, false);
+ mLastDrawable = null;
+ mLastIndex = -1;
+ mExitAnimationEnd = 0;
+ } else {
+ int animAlpha = (int) ((mExitAnimationEnd - now) * 255)
+ / mDrawableContainerState.mExitFadeDuration;
+ mLastDrawable.setAlpha((animAlpha * mAlpha) / 255);
+ animating = true;
+ }
+ }
+ } else {
+ mExitAnimationEnd = 0;
+ }
+ if (schedule && animating) {
+ scheduleSelf(mAnimationRunnable, now + 1000 / 60);
+ }
+ }
+
+ @NonNull
+ @Override
+ public Drawable getCurrent() {
+ return mCurrDrawable;
+ }
+
+ /**
+ * Updates the source density based on the resources used to inflate
+ * density-dependent values. Implementing classes should call this method
+ * during inflation.
+ *
+ * @param res the resources used to inflate density-dependent values
+ */
+ final void updateDensity(Resources res) {
+ mDrawableContainerState.updateDensity(res);
+ }
+
+ @Override
+ @RequiresApi(21)
+ public void applyTheme(@NonNull Theme theme) {
+ mDrawableContainerState.applyTheme(theme);
+ }
+
+ @Override
+ @RequiresApi(21)
+ public boolean canApplyTheme() {
+ return mDrawableContainerState.canApplyTheme();
+ }
+
+ @Override
+ public final ConstantState getConstantState() {
+ if (mDrawableContainerState.canConstantState()) {
+ mDrawableContainerState.mChangingConfigurations = getChangingConfigurations();
+ return mDrawableContainerState;
+ }
+ return null;
+ }
+
+ @NonNull
+ @Override
+ public Drawable mutate() {
+ if (!mMutated && super.mutate() == this) {
+ final DrawableContainerState clone = cloneConstantState();
+ clone.mutate();
+ setConstantState(clone);
+ mMutated = true;
+ }
+ return this;
+ }
+
+ /**
+ * Returns a shallow copy of the container's constant state to be used as
+ * the base state for {@link #mutate()}.
+ *
+ * @return a shallow copy of the constant state
+ */
+ DrawableContainerState cloneConstantState() {
+ return mDrawableContainerState;
+ }
+
+ void clearMutated() {
+ mDrawableContainerState.clearMutated();
+ mMutated = false;
+ }
+
+ /**
+ * A ConstantState that can contain several {@link Drawable}s.
+ *
+ * This class was made public to enable testing, and its visibility may change in a future
+ * release.
+ */
+ abstract static class DrawableContainerState extends ConstantState {
+ final DrawableContainer mOwner;
+ Resources mSourceRes;
+ int mDensity = DisplayMetrics.DENSITY_DEFAULT;
+ int mChangingConfigurations;
+ int mChildrenChangingConfigurations;
+ SparseArray<ConstantState> mDrawableFutures;
+ Drawable[] mDrawables;
+ int mNumChildren;
+ boolean mVariablePadding = false;
+ boolean mCheckedPadding;
+ Rect mConstantPadding;
+ boolean mConstantSize = false;
+ boolean mCheckedConstantSize;
+ int mConstantWidth;
+ int mConstantHeight;
+ int mConstantMinimumWidth;
+ int mConstantMinimumHeight;
+ boolean mCheckedOpacity;
+ int mOpacity;
+ boolean mCheckedStateful;
+ boolean mStateful;
+ boolean mCheckedConstantState;
+ boolean mCanConstantState;
+ boolean mDither = DEFAULT_DITHER;
+ boolean mMutated;
+ int mLayoutDirection;
+ int mEnterFadeDuration = 0;
+ int mExitFadeDuration = 0;
+ boolean mAutoMirrored;
+ ColorFilter mColorFilter;
+ boolean mHasColorFilter;
+ ColorStateList mTintList;
+ Mode mTintMode;
+ boolean mHasTintList;
+ boolean mHasTintMode;
+
+ DrawableContainerState(DrawableContainerState orig, DrawableContainer owner,
+ Resources res) {
+ mOwner = owner;
+ mSourceRes = res != null ? res : (orig != null ? orig.mSourceRes : null);
+ mDensity = resolveDensity(res, orig != null ? orig.mDensity : 0);
+ if (orig != null) {
+ mChangingConfigurations = orig.mChangingConfigurations;
+ mChildrenChangingConfigurations = orig.mChildrenChangingConfigurations;
+ mCheckedConstantState = true;
+ mCanConstantState = true;
+ mVariablePadding = orig.mVariablePadding;
+ mConstantSize = orig.mConstantSize;
+ mDither = orig.mDither;
+ mMutated = orig.mMutated;
+ mLayoutDirection = orig.mLayoutDirection;
+ mEnterFadeDuration = orig.mEnterFadeDuration;
+ mExitFadeDuration = orig.mExitFadeDuration;
+ mAutoMirrored = orig.mAutoMirrored;
+ mColorFilter = orig.mColorFilter;
+ mHasColorFilter = orig.mHasColorFilter;
+ mTintList = orig.mTintList;
+ mTintMode = orig.mTintMode;
+ mHasTintList = orig.mHasTintList;
+ mHasTintMode = orig.mHasTintMode;
+ if (orig.mDensity == mDensity) {
+ if (orig.mCheckedPadding) {
+ mConstantPadding = new Rect(orig.mConstantPadding);
+ mCheckedPadding = true;
+ }
+ if (orig.mCheckedConstantSize) {
+ mConstantWidth = orig.mConstantWidth;
+ mConstantHeight = orig.mConstantHeight;
+ mConstantMinimumWidth = orig.mConstantMinimumWidth;
+ mConstantMinimumHeight = orig.mConstantMinimumHeight;
+ mCheckedConstantSize = true;
+ }
+ }
+ if (orig.mCheckedOpacity) {
+ mOpacity = orig.mOpacity;
+ mCheckedOpacity = true;
+ }
+ if (orig.mCheckedStateful) {
+ mStateful = orig.mStateful;
+ mCheckedStateful = true;
+ }
+ // Postpone cloning children and futures until we're absolutely
+ // sure that we're done computing values for the original state.
+ final Drawable[] origDr = orig.mDrawables;
+ mDrawables = new Drawable[origDr.length];
+ mNumChildren = orig.mNumChildren;
+ final SparseArray<ConstantState> origDf = orig.mDrawableFutures;
+ if (origDf != null) {
+ mDrawableFutures = origDf.clone();
+ } else {
+ mDrawableFutures = new SparseArray<>(mNumChildren);
+ }
+ // Create futures for drawables with constant states. If a
+ // drawable doesn't have a constant state, then we can't clone
+ // it and we'll have to reference the original.
+ final int count = mNumChildren;
+ for (int i = 0; i < count; i++) {
+ if (origDr[i] != null) {
+ final ConstantState cs = origDr[i].getConstantState();
+ if (cs != null) {
+ mDrawableFutures.put(i, cs);
+ } else {
+ mDrawables[i] = origDr[i];
+ }
+ }
+ }
+ } else {
+ mDrawables = new Drawable[10];
+ mNumChildren = 0;
+ }
+ }
+
+ @Override
+ public int getChangingConfigurations() {
+ return mChangingConfigurations | mChildrenChangingConfigurations;
+ }
+
+ /**
+ * Adds the drawable to the end of the list of contained drawables.
+ *
+ * @param dr the drawable to add
+ * @return the position of the drawable within the container
+ */
+ public final int addChild(Drawable dr) {
+ final int pos = mNumChildren;
+ if (pos >= mDrawables.length) {
+ growArray(pos, pos + 10);
+ }
+ dr.mutate();
+ dr.setVisible(false, true);
+ dr.setCallback(mOwner);
+ mDrawables[pos] = dr;
+ mNumChildren++;
+ mChildrenChangingConfigurations |= dr.getChangingConfigurations();
+ invalidateCache();
+ mConstantPadding = null;
+ mCheckedPadding = false;
+ mCheckedConstantSize = false;
+ mCheckedConstantState = false;
+ return pos;
+ }
+
+ /**
+ * Invalidates the cached opacity and statefulness.
+ */
+ void invalidateCache() {
+ mCheckedOpacity = false;
+ mCheckedStateful = false;
+ }
+
+ final int getCapacity() {
+ return mDrawables.length;
+ }
+
+ private void createAllFutures() {
+ if (mDrawableFutures != null) {
+ final int futureCount = mDrawableFutures.size();
+ for (int keyIndex = 0; keyIndex < futureCount; keyIndex++) {
+ final int index = mDrawableFutures.keyAt(keyIndex);
+ final ConstantState cs = mDrawableFutures.valueAt(keyIndex);
+ mDrawables[index] = prepareDrawable(cs.newDrawable(mSourceRes));
+ }
+ mDrawableFutures = null;
+ }
+ }
+
+ private Drawable prepareDrawable(Drawable child) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ child.setLayoutDirection(mLayoutDirection);
+ }
+ child = child.mutate();
+ child.setCallback(mOwner);
+ return child;
+ }
+
+ public final int getChildCount() {
+ return mNumChildren;
+ }
+
+ /**
+ * @return Child <code>drawable</code> at position <code>index</code>
+ */
+ public final Drawable getChild(int index) {
+ final Drawable result = mDrawables[index];
+ if (result != null) {
+ return result;
+ }
+ // Prepare future drawable if necessary.
+ if (mDrawableFutures != null) {
+ final int keyIndex = mDrawableFutures.indexOfKey(index);
+ if (keyIndex >= 0) {
+ final ConstantState cs = mDrawableFutures.valueAt(keyIndex);
+ final Drawable prepared = prepareDrawable(cs.newDrawable(mSourceRes));
+ mDrawables[index] = prepared;
+ mDrawableFutures.removeAt(keyIndex);
+ if (mDrawableFutures.size() == 0) {
+ mDrawableFutures = null;
+ }
+ return prepared;
+ }
+ }
+ return null;
+ }
+
+ final boolean setLayoutDirection(int layoutDirection, int currentIndex) {
+ boolean changed = false;
+ // No need to call createAllFutures, since future drawables will
+ // change layout direction when they are prepared.
+ final int count = mNumChildren;
+ final Drawable[] drawables = mDrawables;
+ for (int i = 0; i < count; i++) {
+ if (drawables[i] != null) {
+ boolean childChanged = false;
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
+ childChanged = drawables[i].setLayoutDirection(layoutDirection);
+ }
+ if (i == currentIndex) {
+ changed = childChanged;
+ }
+ }
+ }
+ mLayoutDirection = layoutDirection;
+ return changed;
+ }
+
+ /**
+ * Updates the source density based on the resources used to inflate
+ * density-dependent values.
+ *
+ * @param res the resources used to inflate density-dependent values
+ */
+ final void updateDensity(Resources res) {
+ if (res != null) {
+ mSourceRes = res;
+ // The density may have changed since the last update (if any). Any
+ // dimension-type attributes will need their default values scaled.
+ final int targetDensity = resolveDensity(res, mDensity);
+ final int sourceDensity = mDensity;
+ mDensity = targetDensity;
+ if (sourceDensity != targetDensity) {
+ mCheckedConstantSize = false;
+ mCheckedPadding = false;
+ }
+ }
+ }
+
+ @RequiresApi(LOLLIPOP)
+ final void applyTheme(Theme theme) {
+ if (theme != null) {
+ createAllFutures();
+ final int count = mNumChildren;
+ final Drawable[] drawables = mDrawables;
+ for (int i = 0; i < count; i++) {
+ if (drawables[i] != null && drawables[i].canApplyTheme()) {
+ drawables[i].applyTheme(theme);
+ // Update cached mask of child changing configurations.
+ mChildrenChangingConfigurations |= drawables[i].getChangingConfigurations();
+ }
+ }
+ updateDensity(theme.getResources());
+ }
+ }
+
+ @RequiresApi(LOLLIPOP)
+ @Override
+ public boolean canApplyTheme() {
+ final int count = mNumChildren;
+ final Drawable[] drawables = mDrawables;
+ for (int i = 0; i < count; i++) {
+ final Drawable d = drawables[i];
+ if (d != null) {
+ if (d.canApplyTheme()) {
+ return true;
+ }
+ } else {
+ final ConstantState future = mDrawableFutures.get(i);
+ if (future != null && future.canApplyTheme()) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ void mutate() {
+ // No need to call createAllFutures, since future drawables will
+ // mutate when they are prepared.
+ final int count = mNumChildren;
+ final Drawable[] drawables = mDrawables;
+ for (int i = 0; i < count; i++) {
+ if (drawables[i] != null) {
+ drawables[i].mutate();
+ }
+ }
+ mMutated = true;
+ }
+
+ final void clearMutated() {
+ /*final int count = mNumChildren;
+ final Drawable[] drawables = mDrawables;
+ for (int i = 0; i < count; i++) {
+ if (drawables[i] != null) {
+ drawables[i].clearMutated();
+ }
+ }*/
+ mMutated = false;
+ }
+
+ /**
+ * A boolean value indicating whether to use the maximum padding value
+ * of all frames in the set (false), or to use the padding value of the
+ * frame being shown (true). Default value is false.
+ */
+ public final void setVariablePadding(boolean variable) {
+ mVariablePadding = variable;
+ }
+
+ /**
+ * @return The constant padding
+ */
+ public final Rect getConstantPadding() {
+ if (mVariablePadding) {
+ return null;
+ }
+ if ((mConstantPadding != null) || mCheckedPadding) {
+ return mConstantPadding;
+ }
+ createAllFutures();
+ Rect r = null;
+ final Rect t = new Rect();
+ final int count = mNumChildren;
+ final Drawable[] drawables = mDrawables;
+ for (int i = 0; i < count; i++) {
+ if (drawables[i].getPadding(t)) {
+ if (r == null) r = new Rect(0, 0, 0, 0);
+ if (t.left > r.left) r.left = t.left;
+ if (t.top > r.top) r.top = t.top;
+ if (t.right > r.right) r.right = t.right;
+ if (t.bottom > r.bottom) r.bottom = t.bottom;
+ }
+ }
+ mCheckedPadding = true;
+ return (mConstantPadding = r);
+ }
+
+ public final void setConstantSize(boolean constant) {
+ mConstantSize = constant;
+ }
+
+ /**
+ * If drawable has a constant size across all children
+ */
+ public final boolean isConstantSize() {
+ return mConstantSize;
+ }
+
+ /**
+ * The constant width across all children
+ */
+ public final int getConstantWidth() {
+ if (!mCheckedConstantSize) {
+ computeConstantSize();
+ }
+ return mConstantWidth;
+ }
+
+ /**
+ * The constant height across all children
+ */
+ public final int getConstantHeight() {
+ if (!mCheckedConstantSize) {
+ computeConstantSize();
+ }
+ return mConstantHeight;
+ }
+
+ /**
+ * The constant minimum width across all children
+ */
+ public final int getConstantMinimumWidth() {
+ if (!mCheckedConstantSize) {
+ computeConstantSize();
+ }
+ return mConstantMinimumWidth;
+ }
+
+ /**
+ * The constant minimum height across all children
+ */
+ public final int getConstantMinimumHeight() {
+ if (!mCheckedConstantSize) {
+ computeConstantSize();
+ }
+ return mConstantMinimumHeight;
+ }
+
+ protected void computeConstantSize() {
+ mCheckedConstantSize = true;
+ createAllFutures();
+ final int count = mNumChildren;
+ final Drawable[] drawables = mDrawables;
+ mConstantWidth = mConstantHeight = -1;
+ mConstantMinimumWidth = mConstantMinimumHeight = 0;
+ for (int i = 0; i < count; i++) {
+ final Drawable dr = drawables[i];
+ int s = dr.getIntrinsicWidth();
+ if (s > mConstantWidth) mConstantWidth = s;
+ s = dr.getIntrinsicHeight();
+ if (s > mConstantHeight) mConstantHeight = s;
+ s = dr.getMinimumWidth();
+ if (s > mConstantMinimumWidth) mConstantMinimumWidth = s;
+ s = dr.getMinimumHeight();
+ if (s > mConstantMinimumHeight) mConstantMinimumHeight = s;
+ }
+ }
+
+ public final void setEnterFadeDuration(int duration) {
+ mEnterFadeDuration = duration;
+ }
+
+ public final int getEnterFadeDuration() {
+ return mEnterFadeDuration;
+ }
+
+ public final void setExitFadeDuration(int duration) {
+ mExitFadeDuration = duration;
+ }
+
+ public final int getExitFadeDuration() {
+ return mExitFadeDuration;
+ }
+
+ /**
+ * @return the resolved opacity of all child drawables.
+ */
+ public final int getOpacity() {
+ if (mCheckedOpacity) {
+ return mOpacity;
+ }
+ createAllFutures();
+ final int count = mNumChildren;
+ final Drawable[] drawables = mDrawables;
+ int op = (count > 0) ? drawables[0].getOpacity() : PixelFormat.TRANSPARENT;
+ for (int i = 1; i < count; i++) {
+ op = Drawable.resolveOpacity(op, drawables[i].getOpacity());
+ }
+ mOpacity = op;
+ mCheckedOpacity = true;
+ return op;
+ }
+
+ /**
+ * @return <code>true</code> if <b>any</b> child drawable is stateful.
+ */
+ public final boolean isStateful() {
+ if (mCheckedStateful) {
+ return mStateful;
+ }
+ createAllFutures();
+ final int count = mNumChildren;
+ final Drawable[] drawables = mDrawables;
+ boolean isStateful = false;
+ for (int i = 0; i < count; i++) {
+ if (drawables[i].isStateful()) {
+ isStateful = true;
+ break;
+ }
+ }
+ mStateful = isStateful;
+ mCheckedStateful = true;
+ return isStateful;
+ }
+
+ /**
+ * Increase the size of the child drawable array.
+ */
+ public void growArray(int oldSize, int newSize) {
+ Drawable[] newDrawables = new Drawable[newSize];
+ System.arraycopy(mDrawables, 0, newDrawables, 0, oldSize);
+ mDrawables = newDrawables;
+ }
+
+ /**
+ * If all child drawables have a constant state
+ */
+ public synchronized boolean canConstantState() {
+ if (mCheckedConstantState) {
+ return mCanConstantState;
+ }
+ createAllFutures();
+ mCheckedConstantState = true;
+ final int count = mNumChildren;
+ final Drawable[] drawables = mDrawables;
+ for (int i = 0; i < count; i++) {
+ if (drawables[i].getConstantState() == null) {
+ mCanConstantState = false;
+ return false;
+ }
+ }
+ mCanConstantState = true;
+ return true;
+ }
+ }
+
+ void setConstantState(DrawableContainerState state) {
+ mDrawableContainerState = state;
+ // The locally cached drawables may have changed.
+ if (mCurIndex >= 0) {
+ mCurrDrawable = state.getChild(mCurIndex);
+ if (mCurrDrawable != null) {
+ initializeDrawableForDisplay(mCurrDrawable);
+ }
+ }
+ // Clear out the last drawable. We don't have enough information to
+ // propagate local state from the past.
+ mLastIndex = -1;
+ mLastDrawable = null;
+ }
+
+ /**
+ * Callback that blocks drawable invalidation.
+ */
+ static class BlockInvalidateCallback implements Drawable.Callback {
+ private Drawable.Callback mCallback;
+
+ public BlockInvalidateCallback wrap(Drawable.Callback callback) {
+ mCallback = callback;
+ return this;
+ }
+
+ public Drawable.Callback unwrap() {
+ final Drawable.Callback callback = mCallback;
+ mCallback = null;
+ return callback;
+ }
+
+ @Override
+ public void invalidateDrawable(@NonNull Drawable who) {
+ // Ignore invalidation.
+ }
+
+ @Override
+ public void scheduleDrawable(@NonNull Drawable who, @NonNull Runnable what, long when) {
+ if (mCallback != null) {
+ mCallback.scheduleDrawable(who, what, when);
+ }
+ }
+
+ @Override
+ public void unscheduleDrawable(@NonNull Drawable who, @NonNull Runnable what) {
+ if (mCallback != null) {
+ mCallback.unscheduleDrawable(who, what);
+ }
+ }
+ }
+
+ static int resolveDensity(@Nullable Resources r, int parentDensity) {
+ final int densityDpi = r == null ? parentDensity : r.getDisplayMetrics().densityDpi;
+ return densityDpi == 0 ? DisplayMetrics.DENSITY_DEFAULT : densityDpi;
+ }
+}
diff --git a/appcompat/src/main/java/androidx/appcompat/graphics/drawable/DrawableWrapper.java b/appcompat/src/main/java/androidx/appcompat/graphics/drawable/DrawableWrapper.java
new file mode 100644
index 0000000..83ef0ed
--- /dev/null
+++ b/appcompat/src/main/java/androidx/appcompat/graphics/drawable/DrawableWrapper.java
@@ -0,0 +1,234 @@
+/*
+ * 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.
+ */
+
+package androidx.appcompat.graphics.drawable;
+
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+
+import android.content.res.ColorStateList;
+import android.graphics.Canvas;
+import android.graphics.ColorFilter;
+import android.graphics.PorterDuff;
+import android.graphics.Rect;
+import android.graphics.Region;
+import android.graphics.drawable.Drawable;
+import android.view.View;
+
+import androidx.annotation.RestrictTo;
+import androidx.core.graphics.drawable.DrawableCompat;
+
+/**
+ * Drawable which delegates all calls to its wrapped {@link Drawable}.
+ * <p>
+ * The wrapped {@link Drawable} <em>must</em> be fully released from any {@link View}
+ * before wrapping, otherwise internal {@link Drawable.Callback} may be dropped.
+ *
+ * @hide
+ */
+@RestrictTo(LIBRARY_GROUP)
+public class DrawableWrapper extends Drawable implements Drawable.Callback {
+
+ private Drawable mDrawable;
+
+ public DrawableWrapper(Drawable drawable) {
+ setWrappedDrawable(drawable);
+ }
+
+ @Override
+ public void draw(Canvas canvas) {
+ mDrawable.draw(canvas);
+ }
+
+ @Override
+ protected void onBoundsChange(Rect bounds) {
+ mDrawable.setBounds(bounds);
+ }
+
+ @Override
+ public void setChangingConfigurations(int configs) {
+ mDrawable.setChangingConfigurations(configs);
+ }
+
+ @Override
+ public int getChangingConfigurations() {
+ return mDrawable.getChangingConfigurations();
+ }
+
+ @Override
+ public void setDither(boolean dither) {
+ mDrawable.setDither(dither);
+ }
+
+ @Override
+ public void setFilterBitmap(boolean filter) {
+ mDrawable.setFilterBitmap(filter);
+ }
+
+ @Override
+ public void setAlpha(int alpha) {
+ mDrawable.setAlpha(alpha);
+ }
+
+ @Override
+ public void setColorFilter(ColorFilter cf) {
+ mDrawable.setColorFilter(cf);
+ }
+
+ @Override
+ public boolean isStateful() {
+ return mDrawable.isStateful();
+ }
+
+ @Override
+ public boolean setState(final int[] stateSet) {
+ return mDrawable.setState(stateSet);
+ }
+
+ @Override
+ public int[] getState() {
+ return mDrawable.getState();
+ }
+
+ @Override
+ public void jumpToCurrentState() {
+ DrawableCompat.jumpToCurrentState(mDrawable);
+ }
+
+ @Override
+ public Drawable getCurrent() {
+ return mDrawable.getCurrent();
+ }
+
+ @Override
+ public boolean setVisible(boolean visible, boolean restart) {
+ return super.setVisible(visible, restart) || mDrawable.setVisible(visible, restart);
+ }
+
+ @Override
+ public int getOpacity() {
+ return mDrawable.getOpacity();
+ }
+
+ @Override
+ public Region getTransparentRegion() {
+ return mDrawable.getTransparentRegion();
+ }
+
+ @Override
+ public int getIntrinsicWidth() {
+ return mDrawable.getIntrinsicWidth();
+ }
+
+ @Override
+ public int getIntrinsicHeight() {
+ return mDrawable.getIntrinsicHeight();
+ }
+
+ @Override
+ public int getMinimumWidth() {
+ return mDrawable.getMinimumWidth();
+ }
+
+ @Override
+ public int getMinimumHeight() {
+ return mDrawable.getMinimumHeight();
+ }
+
+ @Override
+ public boolean getPadding(Rect padding) {
+ return mDrawable.getPadding(padding);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void invalidateDrawable(Drawable who) {
+ invalidateSelf();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void scheduleDrawable(Drawable who, Runnable what, long when) {
+ scheduleSelf(what, when);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void unscheduleDrawable(Drawable who, Runnable what) {
+ unscheduleSelf(what);
+ }
+
+ @Override
+ protected boolean onLevelChange(int level) {
+ return mDrawable.setLevel(level);
+ }
+
+ @Override
+ public void setAutoMirrored(boolean mirrored) {
+ DrawableCompat.setAutoMirrored(mDrawable, mirrored);
+ }
+
+ @Override
+ public boolean isAutoMirrored() {
+ return DrawableCompat.isAutoMirrored(mDrawable);
+ }
+
+ @Override
+ public void setTint(int tint) {
+ DrawableCompat.setTint(mDrawable, tint);
+ }
+
+ @Override
+ public void setTintList(ColorStateList tint) {
+ DrawableCompat.setTintList(mDrawable, tint);
+ }
+
+ @Override
+ public void setTintMode(PorterDuff.Mode tintMode) {
+ DrawableCompat.setTintMode(mDrawable, tintMode);
+ }
+
+ @Override
+ public void setHotspot(float x, float y) {
+ DrawableCompat.setHotspot(mDrawable, x, y);
+ }
+
+ @Override
+ public void setHotspotBounds(int left, int top, int right, int bottom) {
+ DrawableCompat.setHotspotBounds(mDrawable, left, top, right, bottom);
+ }
+
+ public Drawable getWrappedDrawable() {
+ return mDrawable;
+ }
+
+ public void setWrappedDrawable(Drawable drawable) {
+ if (mDrawable != null) {
+ mDrawable.setCallback(null);
+ }
+
+ mDrawable = drawable;
+
+ if (drawable != null) {
+ drawable.setCallback(this);
+ }
+ }
+}
diff --git a/appcompat/src/main/java/androidx/appcompat/graphics/drawable/DrawerArrowDrawable.java b/appcompat/src/main/java/androidx/appcompat/graphics/drawable/DrawerArrowDrawable.java
index 0ff2a5a..41933d08 100644
--- a/appcompat/src/main/java/androidx/appcompat/graphics/drawable/DrawerArrowDrawable.java
+++ b/appcompat/src/main/java/androidx/appcompat/graphics/drawable/DrawerArrowDrawable.java
@@ -16,7 +16,7 @@
package androidx.appcompat.graphics.drawable;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.TypedArray;
@@ -88,7 +88,7 @@
public static final int ARROW_DIRECTION_END = 3;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({ARROW_DIRECTION_LEFT, ARROW_DIRECTION_RIGHT,
ARROW_DIRECTION_START, ARROW_DIRECTION_END})
@Retention(RetentionPolicy.SOURCE)
diff --git a/appcompat/src/main/java/androidx/appcompat/graphics/drawable/StateListDrawable.java b/appcompat/src/main/java/androidx/appcompat/graphics/drawable/StateListDrawable.java
new file mode 100644
index 0000000..0b0e60e
--- /dev/null
+++ b/appcompat/src/main/java/androidx/appcompat/graphics/drawable/StateListDrawable.java
@@ -0,0 +1,417 @@
+/*
+ * Copyright (C) 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.appcompat.graphics.drawable;
+
+import static android.os.Build.VERSION.SDK_INT;
+import static android.os.Build.VERSION_CODES.LOLLIPOP;
+
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+import static androidx.core.content.res.TypedArrayUtils.obtainAttributes;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.content.res.Resources.Theme;
+import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.util.StateSet;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+import androidx.annotation.RestrictTo;
+import androidx.appcompat.R;
+import androidx.appcompat.content.res.AppCompatResources;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+/**
+ * Lets you assign a number of graphic images to a single Drawable and swap out the visible item by
+ * a string
+ * ID value.
+ *
+ * <p>It can be defined in an XML file with the <code><selector></code> element.
+ * Each state Drawable is defined in a nested <code><item></code> element. For more
+ * information, see the guide to <a
+ * href="{@docRoot}guide/topics/resources/drawable-resource.html">Drawable Resources</a>.</p>
+ *
+ * {@link android.R.attr#visible}
+ * {@link android.R.attr#variablePadding}
+ * {@link android.R.attr#constantSize}
+ * {@link android.R.attr#state_focused}
+ * {@link android.R.attr#state_window_focused}
+ * {@link android.R.attr#state_enabled}
+ * {@link android.R.attr#state_checkable}
+ * {@link android.R.attr#state_checked}
+ * {@link android.R.attr#state_selected}
+ * {@link android.R.attr#state_activated}
+ * {@link android.R.attr#state_active}
+ * {@link android.R.attr#state_single}
+ * {@link android.R.attr#state_first}
+ * {@link android.R.attr#state_middle}
+ * {@link android.R.attr#state_last}
+ * {@link android.R.attr#state_pressed}
+ *
+ * Adapted from platform class; altered with API level checks as necessary & uses
+ * {@link AppCompatResources} for <code>Drawable</code> inflation.
+ *
+ * @hide
+ */
+@RestrictTo(LIBRARY_GROUP)
+class StateListDrawable extends DrawableContainer {
+ private static final String TAG = "StateListDrawable";
+ private static final boolean DEBUG = false;
+ private StateListState mStateListState;
+ private boolean mMutated;
+
+ StateListDrawable() {
+ this(null, null);
+ }
+
+ /**
+ * Add a new image/string ID to the set of images.
+ *
+ * @param stateSet - An array of resource Ids to associate with the image.
+ * Switch to this image by calling setState().
+ * @param drawable -The image to show.
+ */
+ public void addState(int[] stateSet, Drawable drawable) {
+ if (drawable != null) {
+ mStateListState.addStateSet(stateSet, drawable);
+ // in case the new state matches our current state...
+ onStateChange(getState());
+ }
+ }
+
+ @Override
+ public boolean isStateful() {
+ return true;
+ }
+
+ @Override
+ protected boolean onStateChange(int[] stateSet) {
+ final boolean changed = super.onStateChange(stateSet);
+ int idx = mStateListState.indexOfStateSet(stateSet);
+ if (DEBUG) {
+ android.util.Log.i(TAG, "onStateChange " + this + " states "
+ + Arrays.toString(stateSet) + " found " + idx);
+ }
+ if (idx < 0) {
+ idx = mStateListState.indexOfStateSet(StateSet.WILD_CARD);
+ }
+ return selectDrawable(idx) || changed;
+ }
+
+ /**
+ * Inflate this Drawable from an XML resource optionally styled by a theme.
+ * This can't be called more than once for each Drawable.
+ *
+ * @param r Resources used to resolve attribute values
+ * @param parser XML parser from which to inflate this Drawable
+ * @param attrs Base set of attribute values
+ * @param theme Theme to apply, may be null
+ * @throws XmlPullParserException
+ * @throws IOException
+ */
+ public void inflate(
+ @NonNull Context context,
+ @NonNull Resources r,
+ @NonNull XmlPullParser parser,
+ @NonNull AttributeSet attrs,
+ @Nullable Theme theme)
+ throws XmlPullParserException, IOException {
+ final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.StateListDrawable);
+ setVisible(a.getBoolean(R.styleable.StateListDrawable_android_visible, true), true);
+ updateStateFromTypedArray(a);
+ updateDensity(r);
+ a.recycle();
+ inflateChildElements(context, r, parser, attrs, theme);
+ onStateChange(getState());
+ }
+
+ /**
+ * Updates the constant state from the values in the typed array.
+ */
+ private void updateStateFromTypedArray(TypedArray a) {
+ final StateListState state = mStateListState;
+ // Account for any configuration changes.
+ if (SDK_INT >= LOLLIPOP) {
+ state.mChangingConfigurations |= a.getChangingConfigurations();
+ }
+ state.mVariablePadding = a.getBoolean(
+ R.styleable.StateListDrawable_android_variablePadding, state.mVariablePadding);
+ state.mConstantSize = a.getBoolean(
+ R.styleable.StateListDrawable_android_constantSize, state.mConstantSize);
+ state.mEnterFadeDuration = a.getInt(
+ R.styleable.StateListDrawable_android_enterFadeDuration, state.mEnterFadeDuration);
+ state.mExitFadeDuration = a.getInt(
+ R.styleable.StateListDrawable_android_exitFadeDuration, state.mExitFadeDuration);
+ state.mDither = a.getBoolean(
+ R.styleable.StateListDrawable_android_dither, state.mDither);
+ }
+
+ /**
+ * Inflates child elements from XML.
+ */
+ private void inflateChildElements(Context context, Resources r,
+ XmlPullParser parser, AttributeSet attrs,
+ Theme theme) throws XmlPullParserException, IOException {
+ final StateListState state = mStateListState;
+ final int innerDepth = parser.getDepth() + 1;
+ int type;
+ int depth;
+ while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
+ && ((depth = parser.getDepth()) >= innerDepth
+ || type != XmlPullParser.END_TAG)) {
+ if (type != XmlPullParser.START_TAG) {
+ continue;
+ }
+ if (depth > innerDepth || !parser.getName().equals("item")) {
+ continue;
+ }
+ // This allows state list drawable item elements to be themed at
+ // inflation time but does NOT make them work for Zygote preload.
+ final TypedArray a = obtainAttributes(r, theme, attrs,
+ R.styleable.StateListDrawableItem);
+ Drawable dr = null;
+ final int drawableId = a.getResourceId(
+ R.styleable.StateListDrawableItem_android_drawable, -1);
+ if (drawableId > 0) {
+ dr = AppCompatResources.getDrawable(context, drawableId);
+ }
+ a.recycle();
+ final int[] states = extractStateSet(attrs);
+ // Loading child elements modifies the state of the AttributeSet's
+ // underlying parser, so it needs to happen after obtaining
+ // attributes and extracting states.
+ if (dr == null) {
+ while ((type = parser.next()) == XmlPullParser.TEXT) {
+ // no-op
+ }
+ if (type != XmlPullParser.START_TAG) {
+ throw new XmlPullParserException(
+ parser.getPositionDescription()
+ + ": <item> tag requires a 'drawable' attribute or "
+ + "child tag defining a drawable");
+ }
+ if (SDK_INT >= LOLLIPOP) {
+ dr = Drawable.createFromXmlInner(r, parser, attrs, theme);
+ } else {
+ dr = Drawable.createFromXmlInner(r, parser, attrs);
+ }
+ }
+ state.addStateSet(states, dr);
+ }
+ }
+
+ /**
+ * Extracts state_ attributes from an attribute set.
+ *
+ * @param attrs The attribute set.
+ * @return An array of state_ attributes.
+ */
+ int[] extractStateSet(AttributeSet attrs) {
+ int j = 0;
+ final int numAttrs = attrs.getAttributeCount();
+ int[] states = new int[numAttrs];
+ for (int i = 0; i < numAttrs; i++) {
+ final int stateResId = attrs.getAttributeNameResource(i);
+ switch (stateResId) {
+ case 0:
+ break;
+ case android.R.attr.drawable:
+ case android.R.attr.id:
+ // Ignore attributes from StateListDrawableItem and
+ // AnimatedStateListDrawableItem.
+ continue;
+ default:
+ states[j++] = attrs.getAttributeBooleanValue(i, false)
+ ? stateResId : -stateResId;
+ }
+ }
+ states = StateSet.trimStateSet(states, j);
+ return states;
+ }
+
+ StateListState getStateListState() {
+ return mStateListState;
+ }
+
+ /**
+ * Gets the number of states contained in this drawable.
+ *
+ * @return The number of states contained in this drawable.
+ * @see #getStateSet(int)
+ * @see #getStateDrawable(int)
+ */
+ int getStateCount() {
+ return mStateListState.getChildCount();
+ }
+
+ /**
+ * Gets the state set at an index.
+ *
+ * @param index The index of the state set.
+ * @return The state set at the index.
+ * @see #getStateCount()
+ * @see #getStateDrawable(int)
+ */
+ int[] getStateSet(int index) {
+ return mStateListState.mStateSets[index];
+ }
+
+ /**
+ * Gets the drawable at an index.
+ *
+ * @param index The index of the drawable.
+ * @return The drawable at the index.
+ * @see #getStateCount()
+ * @see #getStateSet(int)
+ */
+ Drawable getStateDrawable(int index) {
+ return mStateListState.getChild(index);
+ }
+
+ /**
+ * Gets the index of the drawable with the provided state set.
+ *
+ * @param stateSet the state set to look up
+ * @return the index of the provided state set, or -1 if not found
+ * @see #getStateDrawable(int)
+ * @see #getStateSet(int)
+ */
+ int getStateDrawableIndex(int[] stateSet) {
+ return mStateListState.indexOfStateSet(stateSet);
+ }
+
+ @NonNull
+ @Override
+ public Drawable mutate() {
+ if (!mMutated && super.mutate() == this) {
+ mStateListState.mutate();
+ mMutated = true;
+ }
+ return this;
+ }
+
+ @Override
+ StateListState cloneConstantState() {
+ return new StateListState(mStateListState, this, null);
+ }
+
+ @Override
+ void clearMutated() {
+ super.clearMutated();
+ mMutated = false;
+ }
+
+ static class StateListState extends DrawableContainerState {
+ int[][] mStateSets;
+
+ StateListState(StateListState orig, StateListDrawable owner, Resources res) {
+ super(orig, owner, res);
+ if (orig != null) {
+ // Perform a shallow copy and rely on mutate() to deep-copy.
+ mStateSets = orig.mStateSets;
+ } else {
+ mStateSets = new int[getCapacity()][];
+ }
+ }
+
+ @Override
+ void mutate() {
+ final int[][] stateSets = new int[mStateSets.length][];
+ for (int i = mStateSets.length - 1; i >= 0; i--) {
+ stateSets[i] = mStateSets[i] != null ? mStateSets[i].clone() : null;
+ }
+ mStateSets = stateSets;
+ }
+
+ int addStateSet(int[] stateSet, Drawable drawable) {
+ final int pos = addChild(drawable);
+ mStateSets[pos] = stateSet;
+ return pos;
+ }
+
+ int indexOfStateSet(int[] stateSet) {
+ final int[][] stateSets = mStateSets;
+ final int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ if (StateSet.stateSetMatches(stateSets[i], stateSet)) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ @NonNull
+ @Override
+ public Drawable newDrawable() {
+ return new StateListDrawable(this, null);
+ }
+
+ @NonNull
+ @Override
+ public Drawable newDrawable(Resources res) {
+ return new StateListDrawable(this, res);
+ }
+
+ @Override
+ public void growArray(int oldSize, int newSize) {
+ super.growArray(oldSize, newSize);
+ final int[][] newStateSets = new int[newSize][];
+ System.arraycopy(mStateSets, 0, newStateSets, 0, oldSize);
+ mStateSets = newStateSets;
+ }
+ }
+
+ @Override
+ @RequiresApi(21)
+ public void applyTheme(@NonNull Theme theme) {
+ super.applyTheme(theme);
+ onStateChange(getState());
+ }
+
+ @Override
+ void setConstantState(@NonNull DrawableContainerState state) {
+ super.setConstantState(state);
+ if (state instanceof StateListState) {
+ mStateListState = (StateListState) state;
+ }
+ }
+
+ StateListDrawable(StateListState state, Resources res) {
+ // Every state list drawable has its own constant state.
+ final StateListState newState = new StateListState(state, this, res);
+ setConstantState(newState);
+ onStateChange(getState());
+ }
+
+ /**
+ * This constructor exists so subclasses can avoid calling the default
+ * constructor and setting up a StateListDrawable-specific constant state.
+ */
+ StateListDrawable(@Nullable StateListState state) {
+ if (state != null) {
+ setConstantState(state);
+ }
+ }
+}
diff --git a/appcompat/src/main/java/androidx/appcompat/text/AllCapsTransformationMethod.java b/appcompat/src/main/java/androidx/appcompat/text/AllCapsTransformationMethod.java
index 145a798..7a1028d 100644
--- a/appcompat/src/main/java/androidx/appcompat/text/AllCapsTransformationMethod.java
+++ b/appcompat/src/main/java/androidx/appcompat/text/AllCapsTransformationMethod.java
@@ -16,7 +16,7 @@
package androidx.appcompat.text;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Rect;
@@ -30,7 +30,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class AllCapsTransformationMethod implements TransformationMethod {
private Locale mLocale;
diff --git a/appcompat/src/main/java/androidx/appcompat/view/ActionBarPolicy.java b/appcompat/src/main/java/androidx/appcompat/view/ActionBarPolicy.java
index d00f006..bde69a2 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/ActionBarPolicy.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/ActionBarPolicy.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Configuration;
@@ -34,7 +34,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ActionBarPolicy {
private Context mContext;
diff --git a/appcompat/src/main/java/androidx/appcompat/view/ActionMode.java b/appcompat/src/main/java/androidx/appcompat/view/ActionMode.java
index 4553b87..df3e73d 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/ActionMode.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/ActionMode.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.Menu;
import android.view.MenuInflater;
@@ -220,7 +220,7 @@
* @return true if the UI used to show this action mode can take focus
* @hide Internal use only
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isUiFocusable() {
return true;
}
diff --git a/appcompat/src/main/java/androidx/appcompat/view/StandaloneActionMode.java b/appcompat/src/main/java/androidx/appcompat/view/StandaloneActionMode.java
index 3d3bcd9..aa091dc 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/StandaloneActionMode.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/StandaloneActionMode.java
@@ -15,7 +15,7 @@
*/
package androidx.appcompat.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.view.Menu;
@@ -35,7 +35,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class StandaloneActionMode extends ActionMode implements MenuBuilder.Callback {
private Context mContext;
private ActionBarContextView mContextView;
diff --git a/appcompat/src/main/java/androidx/appcompat/view/SupportActionModeWrapper.java b/appcompat/src/main/java/androidx/appcompat/view/SupportActionModeWrapper.java
index 7f8be43..afa772b 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/SupportActionModeWrapper.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/SupportActionModeWrapper.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.view.ActionMode;
@@ -39,7 +39,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class SupportActionModeWrapper extends ActionMode {
final Context mContext;
@@ -139,7 +139,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class CallbackWrapper implements androidx.appcompat.view.ActionMode.Callback {
final Callback mWrappedCallback;
final Context mContext;
diff --git a/appcompat/src/main/java/androidx/appcompat/view/SupportMenuInflater.java b/appcompat/src/main/java/androidx/appcompat/view/SupportMenuInflater.java
index 1bd8cbd..cbcfdc6 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/SupportMenuInflater.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/SupportMenuInflater.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Activity;
import android.content.Context;
@@ -65,7 +65,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class SupportMenuInflater extends MenuInflater {
static final String LOG_TAG = "SupportMenuInflater";
diff --git a/appcompat/src/main/java/androidx/appcompat/view/ViewPropertyAnimatorCompatSet.java b/appcompat/src/main/java/androidx/appcompat/view/ViewPropertyAnimatorCompatSet.java
index 01b8e30..82c270e 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/ViewPropertyAnimatorCompatSet.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/ViewPropertyAnimatorCompatSet.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.View;
import android.view.animation.Interpolator;
@@ -34,7 +34,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ViewPropertyAnimatorCompatSet {
final ArrayList<ViewPropertyAnimatorCompat> mAnimators;
diff --git a/appcompat/src/main/java/androidx/appcompat/view/WindowCallbackWrapper.java b/appcompat/src/main/java/androidx/appcompat/view/WindowCallbackWrapper.java
index 996ee99..b5bb8d56 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/WindowCallbackWrapper.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/WindowCallbackWrapper.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.ActionMode;
import android.view.KeyEvent;
@@ -42,7 +42,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class WindowCallbackWrapper implements Window.Callback {
final Window.Callback mWrapped;
@@ -183,8 +183,4 @@
public void onPointerCaptureChanged(boolean hasCapture) {
mWrapped.onPointerCaptureChanged(hasCapture);
}
-
- public final Window.Callback getWrapped() {
- return mWrapped;
- }
}
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/ActionMenuItem.java b/appcompat/src/main/java/androidx/appcompat/view/menu/ActionMenuItem.java
index b07d90f..562dfca 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/ActionMenuItem.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/ActionMenuItem.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.Intent;
@@ -39,7 +39,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ActionMenuItem implements SupportMenuItem {
private final int mId;
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/ActionMenuItemView.java b/appcompat/src/main/java/androidx/appcompat/view/menu/ActionMenuItemView.java
index 89d3d4b..001d8b4 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/ActionMenuItemView.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/ActionMenuItemView.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Configuration;
@@ -39,7 +39,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ActionMenuItemView extends AppCompatTextView
implements MenuView.ItemView, View.OnClickListener, ActionMenuView.ActionMenuChildView {
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/BaseMenuPresenter.java b/appcompat/src/main/java/androidx/appcompat/view/menu/BaseMenuPresenter.java
index 769f66a..3399ef4 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/BaseMenuPresenter.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/BaseMenuPresenter.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.view.LayoutInflater;
@@ -34,7 +34,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public abstract class BaseMenuPresenter implements MenuPresenter {
protected Context mSystemContext;
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/ExpandedMenuView.java b/appcompat/src/main/java/androidx/appcompat/view/menu/ExpandedMenuView.java
index 7733139..ab75f59 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/ExpandedMenuView.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/ExpandedMenuView.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.util.AttributeSet;
@@ -35,7 +35,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class ExpandedMenuView extends ListView
implements ItemInvoker, MenuView, OnItemClickListener {
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/ListMenuItemView.java b/appcompat/src/main/java/androidx/appcompat/view/menu/ListMenuItemView.java
index 1e90a80..89cb92c 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/ListMenuItemView.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/ListMenuItemView.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.TypedArray;
@@ -44,7 +44,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ListMenuItemView extends LinearLayout
implements MenuView.ItemView, AbsListView.SelectionBoundsAdjuster {
private static final String TAG = "ListMenuItemView";
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/ListMenuPresenter.java b/appcompat/src/main/java/androidx/appcompat/view/menu/ListMenuPresenter.java
index 5dc51fa..1677e96 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/ListMenuPresenter.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/ListMenuPresenter.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.os.Bundle;
@@ -40,7 +40,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ListMenuPresenter implements MenuPresenter, AdapterView.OnItemClickListener {
private static final String TAG = "ListMenuPresenter";
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuAdapter.java b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuAdapter.java
index 7add7e9..15beea8 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuAdapter.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuAdapter.java
@@ -15,7 +15,7 @@
*/
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.LayoutInflater;
import android.view.View;
@@ -29,7 +29,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class MenuAdapter extends BaseAdapter {
MenuBuilder mAdapterMenu;
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuBuilder.java b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuBuilder.java
index 38eb882..2b5e653 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuBuilder.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuBuilder.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ComponentName;
import android.content.Context;
@@ -56,7 +56,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class MenuBuilder implements SupportMenu {
private static final String TAG = "MenuBuilder";
@@ -197,7 +197,7 @@
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public interface Callback {
/**
@@ -221,7 +221,7 @@
* Called by menu items to execute their associated action
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public interface ItemInvoker {
boolean invokeItem(MenuItemImpl item);
}
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuItemImpl.java b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuItemImpl.java
index 5d3ffb6..d18f8fd 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuItemImpl.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuItemImpl.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ActivityNotFoundException;
import android.content.Context;
@@ -48,7 +48,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class MenuItemImpl implements SupportMenuItem {
private static final String TAG = "MenuItemImpl";
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuItemWrapperICS.java b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuItemWrapperICS.java
index 46f191f..016ef06 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuItemWrapperICS.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuItemWrapperICS.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.Intent;
@@ -43,7 +43,7 @@
* Wraps a support {@link SupportMenuItem} as a framework {@link android.view.MenuItem}
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class MenuItemWrapperICS extends BaseMenuWrapper implements MenuItem {
static final String LOG_TAG = "MenuItemWrapper";
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuPopupHelper.java b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuPopupHelper.java
index 9bc4584..5cac689 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuPopupHelper.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuPopupHelper.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Point;
@@ -43,7 +43,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class MenuPopupHelper implements MenuHelper {
private static final int TOUCH_EPICENTER_SIZE_DP = 48;
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuPresenter.java b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuPresenter.java
index 8ba99363..75e2447 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuPresenter.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuPresenter.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.os.Parcelable;
@@ -30,7 +30,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface MenuPresenter {
/**
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuView.java b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuView.java
index 0ed86da..a9e94e6 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuView.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuView.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.drawable.Drawable;
@@ -28,7 +28,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface MenuView {
/**
* Initializes the menu to the given menu. This should be called after the
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuWrapperICS.java b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuWrapperICS.java
index 1f47ef1..6d5b90a 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/MenuWrapperICS.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/MenuWrapperICS.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ComponentName;
import android.content.Context;
@@ -33,7 +33,7 @@
* Wraps a support {@link SupportMenu} as a framework {@link android.view.Menu}
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class MenuWrapperICS extends BaseMenuWrapper implements Menu {
private final SupportMenu mWrappedObject;
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/ShowableListMenu.java b/appcompat/src/main/java/androidx/appcompat/view/menu/ShowableListMenu.java
index a365a53..76b9721 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/ShowableListMenu.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/ShowableListMenu.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.widget.ListView;
@@ -27,7 +27,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface ShowableListMenu {
void show();
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/SubMenuBuilder.java b/appcompat/src/main/java/androidx/appcompat/view/menu/SubMenuBuilder.java
index a456183..8f5f153 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/SubMenuBuilder.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/SubMenuBuilder.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.drawable.Drawable;
@@ -33,7 +33,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class SubMenuBuilder extends MenuBuilder implements SubMenu {
private MenuBuilder mParentMenu;
private MenuItemImpl mItem;
diff --git a/appcompat/src/main/java/androidx/appcompat/view/menu/SubMenuWrapperICS.java b/appcompat/src/main/java/androidx/appcompat/view/menu/SubMenuWrapperICS.java
index 04312fc..241d11c 100644
--- a/appcompat/src/main/java/androidx/appcompat/view/menu/SubMenuWrapperICS.java
+++ b/appcompat/src/main/java/androidx/appcompat/view/menu/SubMenuWrapperICS.java
@@ -16,7 +16,7 @@
package androidx.appcompat.view.menu;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.drawable.Drawable;
@@ -31,7 +31,7 @@
* Wraps a support {@link SupportSubMenu} as a framework {@link android.view.SubMenu}
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
class SubMenuWrapperICS extends MenuWrapperICS implements SubMenu {
private final SupportSubMenu mSubMenu;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ActionBarContainer.java b/appcompat/src/main/java/androidx/appcompat/widget/ActionBarContainer.java
index 4b83512..49e063f 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ActionBarContainer.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ActionBarContainer.java
@@ -16,12 +16,11 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
-import android.os.Build;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
@@ -37,7 +36,7 @@
* It applies special styles as needed to help handle animated transitions between them.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ActionBarContainer extends FrameLayout {
private boolean mIsTransitioning;
private View mTabContainer;
@@ -102,9 +101,6 @@
setWillNotDraw(mIsSplit ? mSplitBackground == null :
mBackground == null && mStackedBackground == null);
invalidate();
- if (Build.VERSION.SDK_INT >= 21) {
- invalidateOutline();
- }
}
public void setStackedBackground(Drawable bg) {
@@ -123,9 +119,6 @@
setWillNotDraw(mIsSplit ? mSplitBackground == null :
mBackground == null && mStackedBackground == null);
invalidate();
- if (Build.VERSION.SDK_INT >= 21) {
- invalidateOutline();
- }
}
public void setSplitBackground(Drawable bg) {
@@ -143,9 +136,6 @@
setWillNotDraw(mIsSplit ? mSplitBackground == null :
mBackground == null && mStackedBackground == null);
invalidate();
- if (Build.VERSION.SDK_INT >= 21) {
- invalidateOutline();
- }
}
@Override
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ActionBarContextView.java b/appcompat/src/main/java/androidx/appcompat/widget/ActionBarContextView.java
index 9bc598c..c577552c 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ActionBarContextView.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ActionBarContextView.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.text.TextUtils;
@@ -37,7 +37,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ActionBarContextView extends AbsActionBarView {
private static final String TAG = "ActionBarContextView";
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ActionBarOverlayLayout.java b/appcompat/src/main/java/androidx/appcompat/widget/ActionBarOverlayLayout.java
index b381680..a5d4053 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ActionBarOverlayLayout.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ActionBarOverlayLayout.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -53,7 +53,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ActionBarOverlayLayout extends ViewGroup implements DecorContentParent,
NestedScrollingParent, NestedScrollingParent2, NestedScrollingParent3 {
private static final String TAG = "ActionBarOverlayLayout";
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ActionMenuView.java b/appcompat/src/main/java/androidx/appcompat/widget/ActionMenuView.java
index 4b82d87..c145677 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ActionMenuView.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ActionMenuView.java
@@ -15,7 +15,7 @@
*/
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Configuration;
@@ -117,7 +117,7 @@
* @param presenter Menu presenter used to display popup menu
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setPresenter(ActionMenuPresenter presenter) {
mPresenter = presenter;
mPresenter.setMenuView(this);
@@ -567,13 +567,13 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isOverflowReserved() {
return mReserveOverflow;
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setOverflowReserved(boolean reserveOverflow) {
mReserveOverflow = reserveOverflow;
}
@@ -611,7 +611,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public LayoutParams generateOverflowButtonLayoutParams() {
LayoutParams result = generateDefaultLayoutParams();
result.isOverflowButton = true;
@@ -620,21 +620,21 @@
/** @hide */
@Override
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean invokeItem(MenuItemImpl item) {
return mMenu.performItemAction(item, 0);
}
/** @hide */
@Override
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public int getWindowAnimations() {
return 0;
}
/** @hide */
@Override
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void initialize(MenuBuilder menu) {
mMenu = menu;
}
@@ -667,7 +667,7 @@
* Must be called before the first call to getMenu()
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setMenuCallbacks(MenuPresenter.Callback pcb, MenuBuilder.Callback mcb) {
mActionMenuPresenterCallback = pcb;
mMenuBuilderCallback = mcb;
@@ -677,7 +677,7 @@
* Returns the current menu or null if one has not yet been configured.
* @hide Internal use only for action bar integration
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public MenuBuilder peekMenu() {
return mMenu;
}
@@ -711,7 +711,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isOverflowMenuShowPending() {
return mPresenter != null && mPresenter.isOverflowMenuShowPending();
}
@@ -728,7 +728,7 @@
/**
* @hide Private LinearLayout (superclass) API. Un-hide if LinearLayout API is made public.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected boolean hasSupportDividerBeforeChildAt(int childIndex) {
if (childIndex == 0) {
return false;
@@ -751,7 +751,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setExpandedActionViewsExclusive(boolean exclusive) {
mPresenter.setExpandedActionViewsExclusive(exclusive);
}
@@ -804,7 +804,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public interface ActionMenuChildView {
boolean needsDividerBefore();
boolean needsDividerAfter();
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ActivityChooserView.java b/appcompat/src/main/java/androidx/appcompat/widget/ActivityChooserView.java
index a350c0d..86c35a4 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ActivityChooserView.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ActivityChooserView.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.Intent;
@@ -72,7 +72,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ActivityChooserView extends ViewGroup implements
ActivityChooserModel.ActivityChooserModelClient {
@@ -337,7 +337,7 @@
* Set the provider hosting this view, if applicable.
* @hide Internal use only
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setProvider(ActionProvider provider) {
mProvider = provider;
}
@@ -858,7 +858,7 @@
* Allows us to set the background using TintTypedArray
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class InnerLayout extends LinearLayout {
private static final int[] TINT_ATTRS = {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AlertDialogLayout.java b/appcompat/src/main/java/androidx/appcompat/widget/AlertDialogLayout.java
index 9ab8d9e..bae1f49 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AlertDialogLayout.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AlertDialogLayout.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.drawable.Drawable;
@@ -48,7 +48,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class AlertDialogLayout extends LinearLayoutCompat {
public AlertDialogLayout(@Nullable Context context) {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatAutoCompleteTextView.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatAutoCompleteTextView.java
index 030c41e..febd7cb 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatAutoCompleteTextView.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatAutoCompleteTextView.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -115,7 +115,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintList(@Nullable ColorStateList tint) {
if (mBackgroundTintHelper != null) {
@@ -129,7 +129,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public ColorStateList getSupportBackgroundTintList() {
@@ -143,7 +143,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mBackgroundTintHelper != null) {
@@ -157,7 +157,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public PorterDuff.Mode getSupportBackgroundTintMode() {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatButton.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatButton.java
index 8027efd..98425bf 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatButton.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatButton.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -100,7 +100,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintList(@Nullable ColorStateList tint) {
if (mBackgroundTintHelper != null) {
@@ -114,7 +114,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public ColorStateList getSupportBackgroundTintList() {
@@ -128,7 +128,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mBackgroundTintHelper != null) {
@@ -142,7 +142,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public PorterDuff.Mode getSupportBackgroundTintMode() {
@@ -211,7 +211,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setAutoSizeTextTypeWithDefaults(
@TextViewCompat.AutoSizeTextType int autoSizeTextType) {
@@ -227,7 +227,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setAutoSizeTextTypeUniformWithConfiguration(
int autoSizeMinTextSize,
@@ -248,7 +248,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setAutoSizeTextTypeUniformWithPresetSizes(@NonNull int[] presetSizes, int unit)
throws IllegalArgumentException {
@@ -264,7 +264,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@TextViewCompat.AutoSizeTextType
public int getAutoSizeTextType() {
@@ -283,7 +283,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int getAutoSizeStepGranularity() {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
@@ -299,7 +299,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int getAutoSizeMinTextSize() {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
@@ -315,7 +315,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int getAutoSizeMaxTextSize() {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
@@ -331,7 +331,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int[] getAutoSizeTextAvailableSizes() {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatCheckBox.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatCheckBox.java
index d5d4019..6d65eca 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatCheckBox.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatCheckBox.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -102,7 +102,7 @@
* This should be accessed from {@link androidx.core.widget.CompoundButtonCompat}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportButtonTintList(@Nullable ColorStateList tint) {
if (mCompoundButtonHelper != null) {
@@ -114,7 +114,7 @@
* This should be accessed from {@link androidx.core.widget.CompoundButtonCompat}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Nullable
@Override
public ColorStateList getSupportButtonTintList() {
@@ -127,7 +127,7 @@
* This should be accessed from {@link androidx.core.widget.CompoundButtonCompat}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportButtonTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mCompoundButtonHelper != null) {
@@ -139,7 +139,7 @@
* This should be accessed from {@link androidx.core.widget.CompoundButtonCompat}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Nullable
@Override
public PorterDuff.Mode getSupportButtonTintMode() {
@@ -153,7 +153,7 @@
* {@link ViewCompat#setBackgroundTintList(View, ColorStateList)}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintList(@Nullable ColorStateList tint) {
if (mBackgroundTintHelper != null) {
@@ -167,7 +167,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public ColorStateList getSupportBackgroundTintList() {
@@ -181,7 +181,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mBackgroundTintHelper != null) {
@@ -195,7 +195,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public PorterDuff.Mode getSupportBackgroundTintMode() {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatDrawableManager.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatDrawableManager.java
index 9777298..6dd85e4 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatDrawableManager.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatDrawableManager.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.appcompat.content.res.AppCompatResources.getColorStateList;
import static androidx.appcompat.widget.ThemeUtils.getDisabledThemeAttrColor;
import static androidx.appcompat.widget.ThemeUtils.getThemeAttrColor;
@@ -42,7 +42,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class AppCompatDrawableManager {
private static final String TAG = "AppCompatDrawableManag";
private static final boolean DEBUG = false;
@@ -50,11 +50,14 @@
private static AppCompatDrawableManager INSTANCE;
- public static synchronized void preload() {
+ /**
+ * Returns the singleton instance of this class.
+ */
+ public static synchronized AppCompatDrawableManager get() {
if (INSTANCE == null) {
INSTANCE = new AppCompatDrawableManager();
- INSTANCE.mResourceManager = ResourceManagerInternal.get();
- INSTANCE.mResourceManager.setHooks(new ResourceManagerInternal.ResourceManagerHooks() {
+ INSTANCE.mResourceManager = ResourceManager.get();
+ INSTANCE.mResourceManager.setHooks(new ResourceManager.ResourceManagerHooks() {
/**
* Drawables which should be tinted with the value of
* {@code R.attr.colorControlNormal}, using the default mode using a raw color
@@ -227,7 +230,7 @@
}
@Override
- public Drawable createDrawableFor(@NonNull ResourceManagerInternal resourceManager,
+ public Drawable createDrawableFor(@NonNull ResourceManager resourceManager,
@NonNull Context context, int resId) {
if (resId == R.drawable.abc_cab_background_top_material) {
return new LayerDrawable(new Drawable[]{
@@ -388,19 +391,10 @@
}
});
}
- }
-
- /**
- * Returns the singleton instance of this class.
- */
- public static synchronized AppCompatDrawableManager get() {
- if (INSTANCE == null) {
- preload();
- }
return INSTANCE;
}
- private ResourceManagerInternal mResourceManager;
+ private ResourceManager mResourceManager;
public synchronized Drawable getDrawable(@NonNull Context context, @DrawableRes int resId) {
return mResourceManager.getDrawable(context, resId);
@@ -430,11 +424,11 @@
}
static void tintDrawable(Drawable drawable, TintInfo tint, int[] state) {
- ResourceManagerInternal.tintDrawable(drawable, tint, state);
+ ResourceManager.tintDrawable(drawable, tint, state);
}
public static synchronized PorterDuffColorFilter getPorterDuffColorFilter(
int color, PorterDuff.Mode mode) {
- return ResourceManagerInternal.getPorterDuffColorFilter(color, mode);
+ return ResourceManager.getPorterDuffColorFilter(color, mode);
}
}
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatEditText.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatEditText.java
index 6de13fe..51282ae 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatEditText.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatEditText.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -118,7 +118,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintList(@Nullable ColorStateList tint) {
if (mBackgroundTintHelper != null) {
@@ -132,7 +132,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public ColorStateList getSupportBackgroundTintList() {
@@ -146,7 +146,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mBackgroundTintHelper != null) {
@@ -160,7 +160,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public PorterDuff.Mode getSupportBackgroundTintMode() {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatImageButton.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatImageButton.java
index 8f41021..7ebc7e6 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatImageButton.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatImageButton.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -131,7 +131,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintList(@Nullable ColorStateList tint) {
if (mBackgroundTintHelper != null) {
@@ -145,7 +145,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public ColorStateList getSupportBackgroundTintList() {
@@ -159,7 +159,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mBackgroundTintHelper != null) {
@@ -173,7 +173,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public PorterDuff.Mode getSupportBackgroundTintMode() {
@@ -186,7 +186,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportImageTintList(@Nullable ColorStateList tint) {
if (mImageHelper != null) {
@@ -200,7 +200,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public ColorStateList getSupportImageTintList() {
@@ -214,7 +214,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportImageTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mImageHelper != null) {
@@ -228,7 +228,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public PorterDuff.Mode getSupportImageTintMode() {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatImageHelper.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatImageHelper.java
index faf62f7..282ffcd 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatImageHelper.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatImageHelper.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
@@ -34,7 +34,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class AppCompatImageHelper {
private final ImageView mView;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatImageView.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatImageView.java
index 92b0c67..f6dc092 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatImageView.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatImageView.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -30,6 +30,7 @@
import androidx.annotation.DrawableRes;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
+import androidx.appcompat.R;
import androidx.core.view.TintableBackgroundView;
import androidx.core.widget.ImageViewCompat;
import androidx.core.widget.TintableImageSourceView;
@@ -140,7 +141,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintList(@Nullable ColorStateList tint) {
if (mBackgroundTintHelper != null) {
@@ -154,7 +155,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public ColorStateList getSupportBackgroundTintList() {
@@ -168,7 +169,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mBackgroundTintHelper != null) {
@@ -182,7 +183,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public PorterDuff.Mode getSupportBackgroundTintMode() {
@@ -196,7 +197,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportImageTintList(@Nullable ColorStateList tint) {
if (mImageHelper != null) {
@@ -210,7 +211,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public ColorStateList getSupportImageTintList() {
@@ -224,7 +225,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportImageTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mImageHelper != null) {
@@ -238,7 +239,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public PorterDuff.Mode getSupportImageTintMode() {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatMultiAutoCompleteTextView.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatMultiAutoCompleteTextView.java
index c92eb4a..1498adb 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatMultiAutoCompleteTextView.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatMultiAutoCompleteTextView.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -112,7 +112,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintList(@Nullable ColorStateList tint) {
if (mBackgroundTintHelper != null) {
@@ -126,7 +126,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public ColorStateList getSupportBackgroundTintList() {
@@ -140,7 +140,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mBackgroundTintHelper != null) {
@@ -154,7 +154,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public PorterDuff.Mode getSupportBackgroundTintMode() {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatRadioButton.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatRadioButton.java
index 399bf5b..e9c654d 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatRadioButton.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatRadioButton.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -102,7 +102,7 @@
* This should be accessed from {@link androidx.core.widget.CompoundButtonCompat}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportButtonTintList(@Nullable ColorStateList tint) {
if (mCompoundButtonHelper != null) {
@@ -114,7 +114,7 @@
* This should be accessed from {@link androidx.core.widget.CompoundButtonCompat}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Nullable
@Override
public ColorStateList getSupportButtonTintList() {
@@ -127,7 +127,7 @@
* This should be accessed from {@link androidx.core.widget.CompoundButtonCompat}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportButtonTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mCompoundButtonHelper != null) {
@@ -139,7 +139,7 @@
* This should be accessed from {@link androidx.core.widget.CompoundButtonCompat}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Nullable
@Override
public PorterDuff.Mode getSupportButtonTintMode() {
@@ -154,7 +154,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintList(@Nullable ColorStateList tint) {
if (mBackgroundTintHelper != null) {
@@ -168,7 +168,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public ColorStateList getSupportBackgroundTintList() {
@@ -182,7 +182,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mBackgroundTintHelper != null) {
@@ -196,7 +196,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public PorterDuff.Mode getSupportBackgroundTintMode() {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatSpinner.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatSpinner.java
index 86886bd..9c4819c 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatSpinner.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatSpinner.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -486,7 +486,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintList(@Nullable ColorStateList tint) {
if (mBackgroundTintHelper != null) {
@@ -500,7 +500,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public ColorStateList getSupportBackgroundTintList() {
@@ -515,7 +515,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mBackgroundTintHelper != null) {
@@ -529,7 +529,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public PorterDuff.Mode getSupportBackgroundTintMode() {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextHelper.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextHelper.java
index fb97e5e..7711aed 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextHelper.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextHelper.java
@@ -16,14 +16,13 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.core.widget.AutoSizeableTextView.PLATFORM_SUPPORTS_AUTOSIZE;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
-import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
@@ -34,7 +33,6 @@
import android.widget.TextView;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.appcompat.R;
import androidx.core.content.res.ResourcesCompat;
@@ -60,7 +58,6 @@
private TintInfo mDrawableBottomTint;
private TintInfo mDrawableStartTint;
private TintInfo mDrawableEndTint;
- private TintInfo mDrawableTint; // Tint used for all compound drawables
@NonNull
private final AppCompatTextViewAutoSizeHelper mAutoSizeTextHelper;
@@ -299,17 +296,6 @@
setCompoundDrawables(drawableLeft, drawableTop, drawableRight, drawableBottom,
drawableStart, drawableEnd);
- if (a.hasValue(R.styleable.AppCompatTextView_drawableTint)) {
- final ColorStateList tintList = a.getColorStateList(
- R.styleable.AppCompatTextView_drawableTint);
- TextViewCompat.setCompoundDrawableTintList(mView, tintList);
- }
- if (a.hasValue(R.styleable.AppCompatTextView_drawableTintMode)) {
- final PorterDuff.Mode tintMode = DrawableUtils.parseTintMode(
- a.getInt(R.styleable.AppCompatTextView_drawableTintMode, -1), null);
- TextViewCompat.setCompoundDrawableTintMode(mView, tintMode);
- }
-
final int firstBaselineToTopHeight = a.getDimensionPixelSize(
R.styleable.AppCompatTextView_firstBaselineToTopHeight, -1);
final int lastBaselineToBottomHeight = a.getDimensionPixelSize(
@@ -481,10 +467,6 @@
mView.setAllCaps(allCaps);
}
- void onSetCompoundDrawables() {
- applyCompoundDrawablesTints();
- }
-
void applyCompoundDrawablesTints() {
if (mDrawableLeftTint != null || mDrawableTopTint != null ||
mDrawableRightTint != null || mDrawableBottomTint != null) {
@@ -522,7 +504,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void onLayout(boolean changed, int left, int top, int right, int bottom) {
if (!PLATFORM_SUPPORTS_AUTOSIZE) {
autoSizeText();
@@ -530,7 +512,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void setTextSize(int unit, float size) {
if (!PLATFORM_SUPPORTS_AUTOSIZE) {
if (!isAutoSizeEnabled()) {
@@ -540,13 +522,13 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void autoSizeText() {
mAutoSizeTextHelper.autoSizeText();
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
boolean isAutoSizeEnabled() {
return mAutoSizeTextHelper.isAutoSizeEnabled();
}
@@ -594,43 +576,6 @@
return mAutoSizeTextHelper.getAutoSizeTextAvailableSizes();
}
- @Nullable
- ColorStateList getCompoundDrawableTintList() {
- return mDrawableTint != null ? mDrawableTint.mTintList : null;
- }
-
- void setCompoundDrawableTintList(@Nullable ColorStateList tintList) {
- if (mDrawableTint == null) {
- mDrawableTint = new TintInfo();
- }
- mDrawableTint.mTintList = tintList;
- mDrawableTint.mHasTintList = tintList != null;
- setCompoundTints();
- }
-
- @Nullable
- PorterDuff.Mode getCompoundDrawableTintMode() {
- return mDrawableTint != null ? mDrawableTint.mTintMode : null;
- }
-
- void setCompoundDrawableTintMode(@Nullable PorterDuff.Mode tintMode) {
- if (mDrawableTint == null) {
- mDrawableTint = new TintInfo();
- }
- mDrawableTint.mTintMode = tintMode;
- mDrawableTint.mHasTintMode = tintMode != null;
- setCompoundTints();
- }
-
- private void setCompoundTints() {
- mDrawableLeftTint = mDrawableTint;
- mDrawableTopTint = mDrawableTint;
- mDrawableRightTint = mDrawableTint;
- mDrawableBottomTint = mDrawableTint;
- mDrawableStartTint = mDrawableTint;
- mDrawableEndTint = mDrawableTint;
- }
-
private void setCompoundDrawables(Drawable drawableLeft, Drawable drawableTop,
Drawable drawableRight, Drawable drawableBottom, Drawable drawableStart,
Drawable drawableEnd) {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextView.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextView.java
index c0d7238..107f7df 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextView.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextView.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -45,7 +45,6 @@
import androidx.core.view.TintableBackgroundView;
import androidx.core.widget.AutoSizeableTextView;
import androidx.core.widget.TextViewCompat;
-import androidx.core.widget.TintableCompoundDrawablesView;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
@@ -77,7 +76,7 @@
* You should only need to manually use this class when writing custom views.</p>
*/
public class AppCompatTextView extends TextView implements TintableBackgroundView,
- TintableCompoundDrawablesView, AutoSizeableTextView {
+ AutoSizeableTextView {
private final AppCompatBackgroundHelper mBackgroundTintHelper;
private final AppCompatTextHelper mTextHelper;
@@ -129,7 +128,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintList(@Nullable ColorStateList tint) {
if (mBackgroundTintHelper != null) {
@@ -143,7 +142,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public ColorStateList getSupportBackgroundTintList() {
@@ -157,7 +156,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
if (mBackgroundTintHelper != null) {
@@ -171,7 +170,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@Nullable
public PorterDuff.Mode getSupportBackgroundTintMode() {
@@ -232,7 +231,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setAutoSizeTextTypeWithDefaults(
@TextViewCompat.AutoSizeTextType int autoSizeTextType) {
@@ -252,7 +251,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setAutoSizeTextTypeUniformWithConfiguration(
int autoSizeMinTextSize,
@@ -277,7 +276,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void setAutoSizeTextTypeUniformWithPresetSizes(@NonNull int[] presetSizes, int unit)
throws IllegalArgumentException {
@@ -296,7 +295,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
@TextViewCompat.AutoSizeTextType
public int getAutoSizeTextType() {
@@ -318,7 +317,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int getAutoSizeStepGranularity() {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
@@ -337,7 +336,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int getAutoSizeMinTextSize() {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
@@ -356,7 +355,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int getAutoSizeMaxTextSize() {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
@@ -375,7 +374,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int[] getAutoSizeTextAvailableSizes() {
if (PLATFORM_SUPPORTS_AUTOSIZE) {
@@ -549,34 +548,6 @@
}
@Override
- public void setCompoundDrawables(@Nullable Drawable left, @Nullable Drawable top,
- @Nullable Drawable right, @Nullable Drawable bottom) {
- super.setCompoundDrawables(left, top, right, bottom);
- if (mTextHelper != null) {
- mTextHelper.onSetCompoundDrawables();
- }
- }
-
- @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
- @Override
- public void setCompoundDrawablesRelative(@Nullable Drawable start, @Nullable Drawable top,
- @Nullable Drawable end, @Nullable Drawable bottom) {
- super.setCompoundDrawablesRelative(start, top, end, bottom);
- if (mTextHelper != null) {
- mTextHelper.onSetCompoundDrawables();
- }
- }
-
- @Override
- public void setCompoundDrawablesWithIntrinsicBounds(@Nullable Drawable left,
- @Nullable Drawable top, @Nullable Drawable right, @Nullable Drawable bottom) {
- super.setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom);
- if (mTextHelper != null) {
- mTextHelper.onSetCompoundDrawables();
- }
- }
-
- @Override
public void setCompoundDrawablesWithIntrinsicBounds(int left, int top, int right, int bottom) {
final Context context = getContext();
setCompoundDrawablesWithIntrinsicBounds(
@@ -584,19 +555,6 @@
top != 0 ? AppCompatResources.getDrawable(context, top) : null,
right != 0 ? AppCompatResources.getDrawable(context, right) : null,
bottom != 0 ? AppCompatResources.getDrawable(context, bottom) : null);
- if (mTextHelper != null) {
- mTextHelper.onSetCompoundDrawables();
- }
- }
-
- @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
- @Override
- public void setCompoundDrawablesRelativeWithIntrinsicBounds(@Nullable Drawable start,
- @Nullable Drawable top, @Nullable Drawable end, @Nullable Drawable bottom) {
- super.setCompoundDrawablesRelativeWithIntrinsicBounds(start, top, end, bottom);
- if (mTextHelper != null) {
- mTextHelper.onSetCompoundDrawables();
- }
}
@RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
@@ -609,90 +567,6 @@
top != 0 ? AppCompatResources.getDrawable(context, top) : null,
end != 0 ? AppCompatResources.getDrawable(context, end) : null,
bottom != 0 ? AppCompatResources.getDrawable(context, bottom) : null);
- if (mTextHelper != null) {
- mTextHelper.onSetCompoundDrawables();
- }
- }
-
- /**
- * This should be accessed via
- * {@link androidx.core.widget.TextViewCompat#getCompoundDrawableTintList(TextView)}
- *
- * @return the tint applied to the compound drawables
- * @attr ref androidx.appcompat.R.styleable#AppCompatTextView_drawableTint
- * @see #setSupportCompoundDrawablesTintList(ColorStateList)
- *
- * @hide
- */
- @Nullable
- @Override
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- public ColorStateList getSupportCompoundDrawablesTintList() {
- return mTextHelper.getCompoundDrawableTintList();
- }
-
- /**
- * This should be accessed via {@link
- * androidx.core.widget.TextViewCompat#setCompoundDrawableTintList(TextView, ColorStateList)}
- *
- * Applies a tint to the compound drawables. Does not modify the current tint mode, which is
- * {@link PorterDuff.Mode#SRC_IN} by default.
- * <p>
- * Subsequent calls to {@link #setCompoundDrawables(Drawable, Drawable, Drawable, Drawable)} and
- * related methods will automatically mutate the drawables and apply the specified tint and tint
- * mode using {@link Drawable#setTintList(ColorStateList)}.
- *
- * @param tintList the tint to apply, may be {@code null} to clear tint
- * @attr ref androidx.appcompat.R.styleable#AppCompatTextView_drawableTint
- * @see #getSupportCompoundDrawablesTintList()
- *
- * @hide
- */
- @Override
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- public void setSupportCompoundDrawablesTintList(@Nullable ColorStateList tintList) {
- mTextHelper.setCompoundDrawableTintList(tintList);
- mTextHelper.applyCompoundDrawablesTints();
- }
-
- /**
- * This should be accessed via
- * {@link androidx.core.widget.TextViewCompat#getCompoundDrawableTintMode(TextView)}
- *
- * Returns the blending mode used to apply the tint to the compound drawables, if specified.
- *
- * @return the blending mode used to apply the tint to the compound drawables
- * @attr ref androidx.appcompat.R.styleable#AppCompatTextView_drawableTintMode
- * @see #setSupportCompoundDrawablesTintMode(PorterDuff.Mode)
- *
- * @hide
- */
- @Nullable
- @Override
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
- return mTextHelper.getCompoundDrawableTintMode();
- }
-
- /**
- * This should be accessed via {@link
- * androidx.core.widget.TextViewCompat#setCompoundDrawableTintMode(TextView, PorterDuff.Mode)}
- *
- * Specifies the blending mode used to apply the tint specified by
- * {@link #setSupportCompoundDrawablesTintList(ColorStateList)} to the compound drawables. The
- * default mode is {@link PorterDuff.Mode#SRC_IN}.
- *
- * @param tintMode the blending mode used to apply the tint, may be {@code null} to clear tint
- * @attr ref androidx.appcompat.R.styleable#AppCompatTextView_drawableTintMode
- * @see #setSupportCompoundDrawablesTintList(ColorStateList)
- *
- * @hide
- */
- @Override
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- public void setSupportCompoundDrawablesTintMode(@Nullable PorterDuff.Mode tintMode) {
- mTextHelper.setCompoundDrawableTintMode(tintMode);
- mTextHelper.applyCompoundDrawablesTints();
}
@Override
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeHelper.java b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeHelper.java
index b52de5c..923ea5b 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeHelper.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextViewAutoSizeHelper.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Resources;
@@ -199,7 +199,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void setAutoSizeTextTypeWithDefaults(@TextViewCompat.AutoSizeTextType int autoSizeTextType) {
if (supportsAutoSizeText()) {
switch (autoSizeTextType) {
@@ -262,7 +262,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void setAutoSizeTextTypeUniformWithConfiguration(
int autoSizeMinTextSize,
int autoSizeMaxTextSize,
@@ -308,7 +308,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void setAutoSizeTextTypeUniformWithPresetSizes(@NonNull int[] presetSizes, int unit)
throws IllegalArgumentException {
if (supportsAutoSizeText()) {
@@ -358,7 +358,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@TextViewCompat.AutoSizeTextType
int getAutoSizeTextType() {
return mAutoSizeTextType;
@@ -373,7 +373,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
int getAutoSizeStepGranularity() {
return Math.round(mAutoSizeStepGranularityInPx);
}
@@ -389,7 +389,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
int getAutoSizeMinTextSize() {
return Math.round(mAutoSizeMinTextSizeInPx);
}
@@ -405,7 +405,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
int getAutoSizeMaxTextSize() {
return Math.round(mAutoSizeMaxTextSizeInPx);
}
@@ -418,7 +418,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
int[] getAutoSizeTextAvailableSizes() {
return mAutoSizeTextSizesInPx;
}
@@ -541,7 +541,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void autoSizeText() {
if (!isAutoSizeEnabled()) {
return;
@@ -590,7 +590,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void setTextSizeInternal(int unit, float size) {
Resources res = mContext == null
? Resources.getSystem()
@@ -855,7 +855,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
boolean isAutoSizeEnabled() {
return supportsAutoSizeText()
&& mAutoSizeTextType != TextViewCompat.AUTO_SIZE_TEXT_TYPE_NONE;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ButtonBarLayout.java b/appcompat/src/main/java/androidx/appcompat/widget/ButtonBarLayout.java
index 40e7748..2a4a0ce 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ButtonBarLayout.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ButtonBarLayout.java
@@ -15,7 +15,7 @@
*/
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.TypedArray;
@@ -34,7 +34,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ButtonBarLayout extends LinearLayout {
/** Amount of the second button to "peek" above the fold when stacked. */
private static final int PEEK_BUTTON_DP = 16;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ContentFrameLayout.java b/appcompat/src/main/java/androidx/appcompat/widget/ContentFrameLayout.java
index 3d77e91..6f20da1 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ContentFrameLayout.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ContentFrameLayout.java
@@ -21,7 +21,7 @@
import static android.view.View.MeasureSpec.getMode;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Rect;
@@ -71,7 +71,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void dispatchFitSystemWindows(Rect insets) {
fitSystemWindows(insets);
}
@@ -86,7 +86,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setDecorPadding(int left, int top, int right, int bottom) {
mDecorPadding.set(left, top, right, bottom);
if (ViewCompat.isLaidOut(this)) {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/DecorContentParent.java b/appcompat/src/main/java/androidx/appcompat/widget/DecorContentParent.java
index bb92dbd..af14904 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/DecorContentParent.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/DecorContentParent.java
@@ -17,7 +17,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.drawable.Drawable;
import android.os.Parcelable;
@@ -34,7 +34,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface DecorContentParent {
void setWindowCallback(Window.Callback cb);
void setWindowTitle(CharSequence title);
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/DecorToolbar.java b/appcompat/src/main/java/androidx/appcompat/widget/DecorToolbar.java
index d685b63..9b69e9e 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/DecorToolbar.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/DecorToolbar.java
@@ -17,7 +17,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.drawable.Drawable;
@@ -42,7 +42,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface DecorToolbar {
ViewGroup getViewGroup();
Context getContext();
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/DialogTitle.java b/appcompat/src/main/java/androidx/appcompat/widget/DialogTitle.java
index 63b117b..0a20e81f 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/DialogTitle.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/DialogTitle.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.TypedArray;
@@ -33,7 +33,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class DialogTitle extends AppCompatTextView {
public DialogTitle(Context context, AttributeSet attrs, int defStyleAttr) {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/DrawableUtils.java b/appcompat/src/main/java/androidx/appcompat/widget/DrawableUtils.java
new file mode 100644
index 0000000..575a21c
--- /dev/null
+++ b/appcompat/src/main/java/androidx/appcompat/widget/DrawableUtils.java
@@ -0,0 +1,198 @@
+/*
+ * 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.
+ */
+
+package androidx.appcompat.widget;
+
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+
+import android.graphics.PorterDuff;
+import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.DrawableContainer;
+import android.graphics.drawable.GradientDrawable;
+import android.graphics.drawable.InsetDrawable;
+import android.graphics.drawable.LayerDrawable;
+import android.graphics.drawable.ScaleDrawable;
+import android.os.Build;
+import android.util.Log;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+import androidx.core.graphics.drawable.DrawableCompat;
+import androidx.core.graphics.drawable.WrappedDrawable;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+/** @hide */
+@RestrictTo(LIBRARY_GROUP)
+public class DrawableUtils {
+
+ private static final String TAG = "DrawableUtils";
+
+ public static final Rect INSETS_NONE = new Rect();
+ private static Class<?> sInsetsClazz;
+
+ private static final String VECTOR_DRAWABLE_CLAZZ_NAME
+ = "android.graphics.drawable.VectorDrawable";
+
+ static {
+ if (Build.VERSION.SDK_INT >= 18) {
+ try {
+ sInsetsClazz = Class.forName("android.graphics.Insets");
+ } catch (ClassNotFoundException e) {
+ // Oh well...
+ }
+ }
+ }
+
+ private DrawableUtils() {}
+
+ /**
+ * Allows us to get the optical insets for a {@link Drawable}. Since this is hidden we need to
+ * use reflection. Since the {@code Insets} class is hidden also, we return a Rect instead.
+ */
+ public static Rect getOpticalBounds(Drawable drawable) {
+ if (sInsetsClazz != null) {
+ try {
+ // If the Drawable is wrapped, we need to manually unwrap it and process
+ // the wrapped drawable.
+ drawable = DrawableCompat.unwrap(drawable);
+
+ final Method getOpticalInsetsMethod = drawable.getClass()
+ .getMethod("getOpticalInsets");
+ final Object insets = getOpticalInsetsMethod.invoke(drawable);
+
+ if (insets != null) {
+ // If the drawable has some optical insets, let's copy them into a Rect
+ final Rect result = new Rect();
+
+ for (Field field : sInsetsClazz.getFields()) {
+ switch (field.getName()) {
+ case "left":
+ result.left = field.getInt(insets);
+ break;
+ case "top":
+ result.top = field.getInt(insets);
+ break;
+ case "right":
+ result.right = field.getInt(insets);
+ break;
+ case "bottom":
+ result.bottom = field.getInt(insets);
+ break;
+ }
+ }
+ return result;
+ }
+ } catch (Exception e) {
+ // Eugh, we hit some kind of reflection issue...
+ Log.e(TAG, "Couldn't obtain the optical insets. Ignoring.");
+ }
+ }
+
+ // If we reach here, either we're running on a device pre-v18, the Drawable didn't have
+ // any optical insets, or a reflection issue, so we'll just return an empty rect
+ return INSETS_NONE;
+ }
+
+ /**
+ * Attempt the fix any issues in the given drawable, usually caused by platform bugs in the
+ * implementation. This method should be call after retrieval from
+ * {@link android.content.res.Resources} or a {@link android.content.res.TypedArray}.
+ */
+ static void fixDrawable(@NonNull final Drawable drawable) {
+ if (Build.VERSION.SDK_INT == 21
+ && VECTOR_DRAWABLE_CLAZZ_NAME.equals(drawable.getClass().getName())) {
+ fixVectorDrawableTinting(drawable);
+ }
+ }
+
+ /**
+ * Some drawable implementations have problems with mutation. This method returns false if
+ * there is a known issue in the given drawable's implementation.
+ */
+ public static boolean canSafelyMutateDrawable(@NonNull Drawable drawable) {
+ if (Build.VERSION.SDK_INT < 15 && drawable instanceof InsetDrawable) {
+ return false;
+ } else if (Build.VERSION.SDK_INT < 15 && drawable instanceof GradientDrawable) {
+ // GradientDrawable has a bug pre-ICS which results in mutate() resulting
+ // in loss of color
+ return false;
+ } else if (Build.VERSION.SDK_INT < 17 && drawable instanceof LayerDrawable) {
+ return false;
+ }
+
+ if (drawable instanceof DrawableContainer) {
+ // If we have a DrawableContainer, let's traverse its child array
+ final Drawable.ConstantState state = drawable.getConstantState();
+ if (state instanceof DrawableContainer.DrawableContainerState) {
+ final DrawableContainer.DrawableContainerState containerState =
+ (DrawableContainer.DrawableContainerState) state;
+ for (final Drawable child : containerState.getChildren()) {
+ if (!canSafelyMutateDrawable(child)) {
+ return false;
+ }
+ }
+ }
+ } else if (drawable instanceof WrappedDrawable) {
+ return canSafelyMutateDrawable(
+ ((WrappedDrawable) drawable)
+ .getWrappedDrawable());
+ } else if (drawable instanceof androidx.appcompat.graphics.drawable.DrawableWrapper) {
+ return canSafelyMutateDrawable(
+ ((androidx.appcompat.graphics.drawable.DrawableWrapper) drawable)
+ .getWrappedDrawable());
+ } else if (drawable instanceof ScaleDrawable) {
+ return canSafelyMutateDrawable(((ScaleDrawable) drawable).getDrawable());
+ }
+
+ return true;
+ }
+
+ /**
+ * VectorDrawable has an issue on API 21 where it sometimes doesn't create its tint filter.
+ * Fixed by toggling its state to force a filter creation.
+ */
+ private static void fixVectorDrawableTinting(final Drawable drawable) {
+ final int[] originalState = drawable.getState();
+ if (originalState == null || originalState.length == 0) {
+ // The drawable doesn't have a state, so set it to be checked
+ drawable.setState(ThemeUtils.CHECKED_STATE_SET);
+ } else {
+ // Else the drawable does have a state, so clear it
+ drawable.setState(ThemeUtils.EMPTY_STATE_SET);
+ }
+ // Now set the original state
+ drawable.setState(originalState);
+ }
+
+ /**
+ * Parses tint mode.
+ */
+ public static PorterDuff.Mode parseTintMode(int value, PorterDuff.Mode defaultMode) {
+ switch (value) {
+ case 3: return PorterDuff.Mode.SRC_OVER;
+ case 5: return PorterDuff.Mode.SRC_IN;
+ case 9: return PorterDuff.Mode.SRC_ATOP;
+ case 14: return PorterDuff.Mode.MULTIPLY;
+ case 15: return PorterDuff.Mode.SCREEN;
+ case 16: return PorterDuff.Mode.ADD;
+ default: return defaultMode;
+ }
+ }
+
+}
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/FitWindowsFrameLayout.java b/appcompat/src/main/java/androidx/appcompat/widget/FitWindowsFrameLayout.java
index 59f590f..144a462 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/FitWindowsFrameLayout.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/FitWindowsFrameLayout.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Rect;
@@ -28,7 +28,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class FitWindowsFrameLayout extends FrameLayout implements FitWindowsViewGroup {
private OnFitSystemWindowsListener mListener;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/FitWindowsLinearLayout.java b/appcompat/src/main/java/androidx/appcompat/widget/FitWindowsLinearLayout.java
index dbea5ba..6006a80 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/FitWindowsLinearLayout.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/FitWindowsLinearLayout.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Rect;
@@ -28,7 +28,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class FitWindowsLinearLayout extends LinearLayout implements FitWindowsViewGroup {
private OnFitSystemWindowsListener mListener;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/FitWindowsViewGroup.java b/appcompat/src/main/java/androidx/appcompat/widget/FitWindowsViewGroup.java
index c2e13d5..9561a11 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/FitWindowsViewGroup.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/FitWindowsViewGroup.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Rect;
@@ -25,7 +25,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface FitWindowsViewGroup {
interface OnFitSystemWindowsListener {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ForwardingListener.java b/appcompat/src/main/java/androidx/appcompat/widget/ForwardingListener.java
index e96af27..3c5959f 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ForwardingListener.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ForwardingListener.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.SystemClock;
import android.view.MotionEvent;
@@ -32,7 +32,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public abstract class ForwardingListener
implements View.OnTouchListener, View.OnAttachStateChangeListener {
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/LinearLayoutCompat.java b/appcompat/src/main/java/androidx/appcompat/widget/LinearLayoutCompat.java
index bd16798..f30aad7 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/LinearLayoutCompat.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/LinearLayoutCompat.java
@@ -17,7 +17,7 @@
package androidx.appcompat.widget;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.TypedArray;
@@ -56,7 +56,7 @@
*/
public class LinearLayoutCompat extends ViewGroup {
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({HORIZONTAL, VERTICAL})
@Retention(RetentionPolicy.SOURCE)
public @interface OrientationMode {}
@@ -65,7 +65,7 @@
public static final int VERTICAL = 1;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef(flag = true,
value = {
SHOW_DIVIDER_NONE,
@@ -135,10 +135,6 @@
private static final int INDEX_BOTTOM = 2;
private static final int INDEX_FILL = 3;
- /** Class name may be obfuscated by Proguard. Hardcode the string for accessibility usage. */
- private static final String ACCESSIBILITY_CLASS_NAME =
- "androidx.appcompat.widget.LinearLayoutCompat";
-
private Drawable mDivider;
private int mDividerWidth;
private int mDividerHeight;
@@ -277,7 +273,7 @@
*
* @hide Used internally by framework.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public int getDividerWidth() {
return mDividerWidth;
}
@@ -1758,13 +1754,13 @@
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
- event.setClassName(ACCESSIBILITY_CLASS_NAME);
+ event.setClassName(LinearLayoutCompat.class.getName());
}
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
- info.setClassName(ACCESSIBILITY_CLASS_NAME);
+ info.setClassName(LinearLayoutCompat.class.getName());
}
/**
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ListPopupWindow.java b/appcompat/src/main/java/androidx/appcompat/widget/ListPopupWindow.java
index 056213e..b7db4cd 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ListPopupWindow.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ListPopupWindow.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.TypedArray;
@@ -346,7 +346,7 @@
*
* @hide Used only by AutoCompleteTextView to handle some internal special cases.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setForceIgnoreOutsideTouch(boolean forceIgnoreOutsideTouch) {
mForceIgnoreOutsideTouch = forceIgnoreOutsideTouch;
}
@@ -362,7 +362,7 @@
*
* @hide Only used by AutoCompleteTextView under special conditions.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setDropDownAlwaysVisible(boolean dropDownAlwaysVisible) {
mDropDownAlwaysVisible = dropDownAlwaysVisible;
}
@@ -372,7 +372,7 @@
*
* @hide Only used by AutoCompleteTextView under special conditions.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isDropDownAlwaysVisible() {
return mDropDownAlwaysVisible;
}
@@ -501,25 +501,15 @@
}
/**
- * Specifies the custom anchor-relative bounds of the popup's transition
+ * Specifies the anchor-relative bounds of the popup's transition
* epicenter.
*
- * @param bounds anchor-relative bounds or {@code null} to use default epicenter
- * @see #getEpicenterBounds()
+ * @param bounds anchor-relative bounds
+ * @hide
*/
- public void setEpicenterBounds(@Nullable Rect bounds) {
- mEpicenterBounds = bounds != null ? new Rect(bounds) : null;
- }
-
- /**
- * Return custom anchor-relative bounds of the popup's transition epicenter
- *
- * @return anchor-relative bounds, or @{@code null} if not set
- * @see #setEpicenterBounds(Rect)
- */
- @Nullable
- public Rect getEpicenterBounds() {
- return mEpicenterBounds != null ? new Rect(mEpicenterBounds) : null;
+ @RestrictTo(LIBRARY_GROUP)
+ public void setEpicenterBounds(Rect bounds) {
+ mEpicenterBounds = bounds;
}
/**
@@ -1323,7 +1313,7 @@
* @hide Only used by {@link androidx.appcompat.view.menu.CascadingMenuPopup} to position
* a submenu correctly.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setOverlapAnchor(boolean overlapAnchor) {
mOverlapAnchorSet = true;
mOverlapAnchor = overlapAnchor;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/MenuItemHoverListener.java b/appcompat/src/main/java/androidx/appcompat/widget/MenuItemHoverListener.java
index 9d09898..f61f9d8 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/MenuItemHoverListener.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/MenuItemHoverListener.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.MenuItem;
@@ -30,7 +30,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface MenuItemHoverListener {
/**
* Called when hover exits a menu item.
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/MenuPopupWindow.java b/appcompat/src/main/java/androidx/appcompat/widget/MenuPopupWindow.java
index aa8295a..ebae836 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/MenuPopupWindow.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/MenuPopupWindow.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Configuration;
@@ -49,7 +49,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class MenuPopupWindow extends ListPopupWindow implements MenuItemHoverListener {
private static final String TAG = "MenuPopupWindow";
@@ -126,7 +126,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class MenuDropDownListView extends DropDownListView {
final int mAdvanceKey;
final int mRetreatKey;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/PopupMenu.java b/appcompat/src/main/java/androidx/appcompat/widget/PopupMenu.java
index bd207d0..13acde3 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/PopupMenu.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/PopupMenu.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.view.Gravity;
@@ -301,7 +301,7 @@
* @return The view representing the list of menu items.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
ListView getMenuListView() {
if (!mPopup.isShowing()) {
return null;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ResourceManager.java b/appcompat/src/main/java/androidx/appcompat/widget/ResourceManager.java
new file mode 100644
index 0000000..f8b5b11
--- /dev/null
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ResourceManager.java
@@ -0,0 +1,565 @@
+/*
+ * Copyright (C) 2019 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.appcompat.widget;
+
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.res.ColorStateList;
+import android.content.res.Resources;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.Drawable.ConstantState;
+import android.os.Build;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.util.TypedValue;
+import android.util.Xml;
+
+import androidx.annotation.DrawableRes;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+import androidx.annotation.RestrictTo;
+import androidx.appcompat.R;
+import androidx.appcompat.graphics.drawable.AnimatedStateListDrawableCompat;
+import androidx.collection.ArrayMap;
+import androidx.collection.LongSparseArray;
+import androidx.collection.LruCache;
+import androidx.collection.SparseArrayCompat;
+import androidx.core.content.ContextCompat;
+import androidx.core.graphics.drawable.DrawableCompat;
+import androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat;
+import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.lang.ref.WeakReference;
+import java.util.WeakHashMap;
+
+/**
+ * @hide
+ */
+@RestrictTo(LIBRARY_GROUP)
+public final class ResourceManager {
+ @RestrictTo(LIBRARY_GROUP)
+ interface ResourceManagerHooks {
+ Drawable createDrawableFor(@NonNull ResourceManager appCompatDrawableManager,
+ @NonNull Context context, @DrawableRes final int resId);
+ boolean tintDrawable(@NonNull Context context, @DrawableRes int resId,
+ @NonNull Drawable drawable);
+ ColorStateList getTintListForDrawableRes(@NonNull Context context, @DrawableRes int resId);
+ boolean tintDrawableUsingColorFilter(@NonNull Context context,
+ @DrawableRes final int resId, @NonNull Drawable drawable);
+ PorterDuff.Mode getTintModeForDrawableRes(final int resId);
+ }
+
+ private interface InflateDelegate {
+ Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser,
+ @NonNull AttributeSet attrs, @Nullable Resources.Theme theme);
+ }
+
+ private static final String TAG = "ResourceManager";
+ private static final boolean DEBUG = false;
+ private static final PorterDuff.Mode DEFAULT_MODE = PorterDuff.Mode.SRC_IN;
+ private static final String SKIP_DRAWABLE_TAG = "appcompat_skip_skip";
+
+ private static final String PLATFORM_VD_CLAZZ = "android.graphics.drawable.VectorDrawable";
+
+ private static ResourceManager INSTANCE;
+
+ /**
+ * Returns the singleton instance of this class.
+ */
+ public static synchronized ResourceManager get() {
+ if (INSTANCE == null) {
+ INSTANCE = new ResourceManager();
+ installDefaultInflateDelegates(INSTANCE);
+ }
+ return INSTANCE;
+ }
+
+ private static void installDefaultInflateDelegates(@NonNull ResourceManager manager) {
+ // This sdk version check will affect src:appCompat code path.
+ // Although VectorDrawable exists in Android framework from Lollipop, AppCompat will use
+ // (Animated)VectorDrawableCompat before Nougat to utilize bug fixes & feature backports.
+ if (Build.VERSION.SDK_INT < 24) {
+ manager.addDelegate("vector", new VdcInflateDelegate());
+ manager.addDelegate("animated-vector", new AvdcInflateDelegate());
+ manager.addDelegate("animated-selector", new AsldcInflateDelegate());
+ }
+ }
+
+ private static final ColorFilterLruCache COLOR_FILTER_CACHE = new ColorFilterLruCache(6);
+
+ private WeakHashMap<Context, SparseArrayCompat<ColorStateList>> mTintLists;
+ private ArrayMap<String, InflateDelegate> mDelegates;
+ private SparseArrayCompat<String> mKnownDrawableIdTags;
+
+ private final WeakHashMap<Context, LongSparseArray<WeakReference<ConstantState>>>
+ mDrawableCaches = new WeakHashMap<>(0);
+
+ private TypedValue mTypedValue;
+
+ private boolean mHasCheckedVectorDrawableSetup;
+
+ private ResourceManagerHooks mHooks;
+
+ public synchronized void setHooks(ResourceManagerHooks hooks) {
+ mHooks = hooks;
+ }
+
+ public synchronized Drawable getDrawable(@NonNull Context context, @DrawableRes int resId) {
+ return getDrawable(context, resId, false);
+ }
+
+ synchronized Drawable getDrawable(@NonNull Context context, @DrawableRes int resId,
+ boolean failIfNotKnown) {
+ checkVectorDrawableSetup(context);
+
+ Drawable drawable = loadDrawableFromDelegates(context, resId);
+ if (drawable == null) {
+ drawable = createDrawableIfNeeded(context, resId);
+ }
+ if (drawable == null) {
+ drawable = ContextCompat.getDrawable(context, resId);
+ }
+
+ if (drawable != null) {
+ // Tint it if needed
+ drawable = tintDrawable(context, resId, failIfNotKnown, drawable);
+ }
+ if (drawable != null) {
+ // See if we need to 'fix' the drawable
+ DrawableUtils.fixDrawable(drawable);
+ }
+ return drawable;
+ }
+
+ public synchronized void onConfigurationChanged(@NonNull Context context) {
+ LongSparseArray<WeakReference<ConstantState>> cache = mDrawableCaches.get(context);
+ if (cache != null) {
+ // Crude, but we'll just clear the cache when the configuration changes
+ cache.clear();
+ }
+ }
+
+ private static long createCacheKey(TypedValue tv) {
+ return (((long) tv.assetCookie) << 32) | tv.data;
+ }
+
+ private Drawable createDrawableIfNeeded(@NonNull Context context,
+ @DrawableRes final int resId) {
+ if (mTypedValue == null) {
+ mTypedValue = new TypedValue();
+ }
+ final TypedValue tv = mTypedValue;
+ context.getResources().getValue(resId, tv, true);
+ final long key = createCacheKey(tv);
+
+ Drawable dr = getCachedDrawable(context, key);
+ if (dr != null) {
+ // If we got a cached drawable, return it
+ return dr;
+ }
+
+ // Else we need to try and create one...
+ dr = (this.mHooks == null) ? null
+ : this.mHooks.createDrawableFor(this, context, resId);
+
+ if (dr != null) {
+ dr.setChangingConfigurations(tv.changingConfigurations);
+ // If we reached here then we created a new drawable, add it to the cache
+ addDrawableToCache(context, key, dr);
+ }
+
+ return dr;
+ }
+
+ private Drawable tintDrawable(@NonNull Context context, @DrawableRes int resId,
+ boolean failIfNotKnown, @NonNull Drawable drawable) {
+ final ColorStateList tintList = getTintList(context, resId);
+ if (tintList != null) {
+ // First mutate the Drawable, then wrap it and set the tint list
+ if (DrawableUtils.canSafelyMutateDrawable(drawable)) {
+ drawable = drawable.mutate();
+ }
+ drawable = DrawableCompat.wrap(drawable);
+ DrawableCompat.setTintList(drawable, tintList);
+
+ // If there is a blending mode specified for the drawable, use it
+ final PorterDuff.Mode tintMode = getTintMode(resId);
+ if (tintMode != null) {
+ DrawableCompat.setTintMode(drawable, tintMode);
+ }
+ } else if ((mHooks != null) && mHooks.tintDrawable(context, resId, drawable)) {
+ // If we're here, the installed hooks reported successful tinting of the
+ // specific drawable
+ } else {
+ final boolean tinted = tintDrawableUsingColorFilter(context, resId, drawable);
+ if (!tinted && failIfNotKnown) {
+ // If we didn't tint using a ColorFilter, and we're set to fail if we don't
+ // know the id, return null
+ drawable = null;
+ }
+ }
+ return drawable;
+ }
+
+ private Drawable loadDrawableFromDelegates(@NonNull Context context, @DrawableRes int resId) {
+ if (mDelegates != null && !mDelegates.isEmpty()) {
+ if (mKnownDrawableIdTags != null) {
+ final String cachedTagName = mKnownDrawableIdTags.get(resId);
+ if (SKIP_DRAWABLE_TAG.equals(cachedTagName)
+ || (cachedTagName != null && mDelegates.get(cachedTagName) == null)) {
+ // If we don't have a delegate for the drawable tag, or we've been set to
+ // skip it, fail fast and return null
+ if (DEBUG) {
+ Log.d(TAG, "[loadDrawableFromDelegates] Skipping drawable: "
+ + context.getResources().getResourceName(resId));
+ }
+ return null;
+ }
+ } else {
+ // Create an id cache as we'll need one later
+ mKnownDrawableIdTags = new SparseArrayCompat<>();
+ }
+
+ if (mTypedValue == null) {
+ mTypedValue = new TypedValue();
+ }
+ final TypedValue tv = mTypedValue;
+ final Resources res = context.getResources();
+ res.getValue(resId, tv, true);
+
+ final long key = createCacheKey(tv);
+
+ Drawable dr = getCachedDrawable(context, key);
+ if (dr != null) {
+ if (DEBUG) {
+ Log.i(TAG, "[loadDrawableFromDelegates] Returning cached drawable: " +
+ context.getResources().getResourceName(resId));
+ }
+ // We have a cached drawable, return it!
+ return dr;
+ }
+
+ if (tv.string != null && tv.string.toString().endsWith(".xml")) {
+ // If the resource is an XML file, let's try and parse it
+ try {
+ @SuppressLint("ResourceType") final XmlPullParser parser = res.getXml(resId);
+ final AttributeSet attrs = Xml.asAttributeSet(parser);
+ int type;
+ while ((type = parser.next()) != XmlPullParser.START_TAG &&
+ type != XmlPullParser.END_DOCUMENT) {
+ // Empty loop
+ }
+ if (type != XmlPullParser.START_TAG) {
+ throw new XmlPullParserException("No start tag found");
+ }
+
+ final String tagName = parser.getName();
+ // Add the tag name to the cache
+ mKnownDrawableIdTags.append(resId, tagName);
+
+ // Now try and find a delegate for the tag name and inflate if found
+ final InflateDelegate delegate = mDelegates.get(tagName);
+ if (delegate != null) {
+ dr = delegate.createFromXmlInner(context, parser, attrs,
+ context.getTheme());
+ }
+ if (dr != null) {
+ // Add it to the drawable cache
+ dr.setChangingConfigurations(tv.changingConfigurations);
+ if (addDrawableToCache(context, key, dr) && DEBUG) {
+ Log.i(TAG, "[loadDrawableFromDelegates] Saved drawable to cache: " +
+ context.getResources().getResourceName(resId));
+ }
+ }
+ } catch (Exception e) {
+ Log.e(TAG, "Exception while inflating drawable", e);
+ }
+ }
+ if (dr == null) {
+ // If we reach here then the delegate inflation of the resource failed. Mark it as
+ // bad so we skip the id next time
+ mKnownDrawableIdTags.append(resId, SKIP_DRAWABLE_TAG);
+ }
+ return dr;
+ }
+
+ return null;
+ }
+
+ private synchronized Drawable getCachedDrawable(@NonNull final Context context,
+ final long key) {
+ final LongSparseArray<WeakReference<ConstantState>> cache = mDrawableCaches.get(context);
+ if (cache == null) {
+ return null;
+ }
+
+ final WeakReference<ConstantState> wr = cache.get(key);
+ if (wr != null) {
+ // We have the key, and the secret
+ ConstantState entry = wr.get();
+ if (entry != null) {
+ return entry.newDrawable(context.getResources());
+ } else {
+ // Our entry has been purged
+ cache.delete(key);
+ }
+ }
+ return null;
+ }
+
+ private synchronized boolean addDrawableToCache(@NonNull final Context context, final long key,
+ @NonNull final Drawable drawable) {
+ final ConstantState cs = drawable.getConstantState();
+ if (cs != null) {
+ LongSparseArray<WeakReference<ConstantState>> cache = mDrawableCaches.get(context);
+ if (cache == null) {
+ cache = new LongSparseArray<>();
+ mDrawableCaches.put(context, cache);
+ }
+ cache.put(key, new WeakReference<>(cs));
+ return true;
+ }
+ return false;
+ }
+
+ synchronized Drawable onDrawableLoadedFromResources(@NonNull Context context,
+ @NonNull VectorEnabledTintResources resources, @DrawableRes final int resId) {
+ Drawable drawable = loadDrawableFromDelegates(context, resId);
+ if (drawable == null) {
+ drawable = resources.superGetDrawable(resId);
+ }
+ if (drawable != null) {
+ return tintDrawable(context, resId, false, drawable);
+ }
+ return null;
+ }
+
+ boolean tintDrawableUsingColorFilter(@NonNull Context context,
+ @DrawableRes final int resId, @NonNull Drawable drawable) {
+ return (mHooks != null) && mHooks.tintDrawableUsingColorFilter(context, resId, drawable);
+ }
+
+ private void addDelegate(@NonNull String tagName, @NonNull InflateDelegate delegate) {
+ if (mDelegates == null) {
+ mDelegates = new ArrayMap<>();
+ }
+ mDelegates.put(tagName, delegate);
+ }
+
+ private void removeDelegate(@NonNull String tagName, @NonNull InflateDelegate delegate) {
+ if (mDelegates != null && mDelegates.get(tagName) == delegate) {
+ mDelegates.remove(tagName);
+ }
+ }
+
+ private static boolean arrayContains(int[] array, int value) {
+ for (int id : array) {
+ if (id == value) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ PorterDuff.Mode getTintMode(final int resId) {
+ return (mHooks == null) ? null : mHooks.getTintModeForDrawableRes(resId);
+ }
+
+ synchronized ColorStateList getTintList(@NonNull Context context, @DrawableRes int resId) {
+ // Try the cache first (if it exists)
+ ColorStateList tint = getTintListFromCache(context, resId);
+
+ if (tint == null) {
+ // ...if the cache did not contain a color state list, try and create one
+ tint = (mHooks == null) ? null : mHooks.getTintListForDrawableRes(context, resId);
+
+ if (tint != null) {
+ addTintListToCache(context, resId, tint);
+ }
+ }
+ return tint;
+ }
+
+ private ColorStateList getTintListFromCache(@NonNull Context context, @DrawableRes int resId) {
+ if (mTintLists != null) {
+ final SparseArrayCompat<ColorStateList> tints = mTintLists.get(context);
+ return tints != null ? tints.get(resId) : null;
+ }
+ return null;
+ }
+
+ private void addTintListToCache(@NonNull Context context, @DrawableRes int resId,
+ @NonNull ColorStateList tintList) {
+ if (mTintLists == null) {
+ mTintLists = new WeakHashMap<>();
+ }
+ SparseArrayCompat<ColorStateList> themeTints = mTintLists.get(context);
+ if (themeTints == null) {
+ themeTints = new SparseArrayCompat<>();
+ mTintLists.put(context, themeTints);
+ }
+ themeTints.append(resId, tintList);
+ }
+
+ private static class ColorFilterLruCache extends LruCache<Integer, PorterDuffColorFilter> {
+
+ public ColorFilterLruCache(int maxSize) {
+ super(maxSize);
+ }
+
+ PorterDuffColorFilter get(int color, PorterDuff.Mode mode) {
+ return get(generateCacheKey(color, mode));
+ }
+
+ PorterDuffColorFilter put(int color, PorterDuff.Mode mode, PorterDuffColorFilter filter) {
+ return put(generateCacheKey(color, mode), filter);
+ }
+
+ private static int generateCacheKey(int color, PorterDuff.Mode mode) {
+ int hashCode = 1;
+ hashCode = 31 * hashCode + color;
+ hashCode = 31 * hashCode + mode.hashCode();
+ return hashCode;
+ }
+ }
+
+ static void tintDrawable(Drawable drawable, TintInfo tint, int[] state) {
+ if (DrawableUtils.canSafelyMutateDrawable(drawable)
+ && drawable.mutate() != drawable) {
+ Log.d(TAG, "Mutated drawable is not the same instance as the input.");
+ return;
+ }
+
+ if (tint.mHasTintList || tint.mHasTintMode) {
+ drawable.setColorFilter(createTintFilter(
+ tint.mHasTintList ? tint.mTintList : null,
+ tint.mHasTintMode ? tint.mTintMode : DEFAULT_MODE,
+ state));
+ } else {
+ drawable.clearColorFilter();
+ }
+
+ if (Build.VERSION.SDK_INT <= 23) {
+ // Pre-v23 there is no guarantee that a state change will invoke an invalidation,
+ // so we force it ourselves
+ drawable.invalidateSelf();
+ }
+ }
+
+ private static PorterDuffColorFilter createTintFilter(ColorStateList tint,
+ PorterDuff.Mode tintMode, final int[] state) {
+ if (tint == null || tintMode == null) {
+ return null;
+ }
+ final int color = tint.getColorForState(state, Color.TRANSPARENT);
+ return getPorterDuffColorFilter(color, tintMode);
+ }
+
+ public static synchronized PorterDuffColorFilter getPorterDuffColorFilter(
+ int color, PorterDuff.Mode mode) {
+ // First, let's see if the cache already contains the color filter
+ PorterDuffColorFilter filter = COLOR_FILTER_CACHE.get(color, mode);
+
+ if (filter == null) {
+ // Cache miss, so create a color filter and add it to the cache
+ filter = new PorterDuffColorFilter(color, mode);
+ COLOR_FILTER_CACHE.put(color, mode, filter);
+ }
+
+ return filter;
+ }
+
+ // TODO - this will go to the new module along with R.drawable.abc_vector_test
+ private void checkVectorDrawableSetup(@NonNull Context context) {
+ if (mHasCheckedVectorDrawableSetup) {
+ // We've already checked so return now...
+ return;
+ }
+ // Here we will check that a known Vector drawable resource inside AppCompat can be
+ // correctly decoded
+ mHasCheckedVectorDrawableSetup = true;
+ final Drawable d = getDrawable(context, R.drawable.abc_vector_test);
+ if (d == null || !isVectorDrawable(d)) {
+ mHasCheckedVectorDrawableSetup = false;
+ throw new IllegalStateException("This app has been built with an incorrect "
+ + "configuration. Please configure your build for VectorDrawableCompat.");
+ }
+ }
+
+ private static boolean isVectorDrawable(@NonNull Drawable d) {
+ return d instanceof VectorDrawableCompat
+ || PLATFORM_VD_CLAZZ.equals(d.getClass().getName());
+ }
+
+ private static class VdcInflateDelegate implements InflateDelegate {
+ VdcInflateDelegate() {
+ }
+
+ @Override
+ public Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser,
+ @NonNull AttributeSet attrs, @Nullable Resources.Theme theme) {
+ try {
+ return VectorDrawableCompat
+ .createFromXmlInner(context.getResources(), parser, attrs, theme);
+ } catch (Exception e) {
+ Log.e("VdcInflateDelegate", "Exception while inflating <vector>", e);
+ return null;
+ }
+ }
+ }
+
+ private static class AvdcInflateDelegate implements InflateDelegate {
+ AvdcInflateDelegate() {
+ }
+
+ @Override
+ public Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser,
+ @NonNull AttributeSet attrs, @Nullable Resources.Theme theme) {
+ try {
+ return AnimatedVectorDrawableCompat
+ .createFromXmlInner(context, context.getResources(), parser, attrs, theme);
+ } catch (Exception e) {
+ Log.e("AvdcInflateDelegate", "Exception while inflating <animated-vector>", e);
+ return null;
+ }
+ }
+ }
+
+ @RequiresApi(11)
+ static class AsldcInflateDelegate implements InflateDelegate {
+ @Override
+ public Drawable createFromXmlInner(@NonNull Context context, @NonNull XmlPullParser parser,
+ @NonNull AttributeSet attrs, @Nullable Resources.Theme theme) {
+ try {
+ return AnimatedStateListDrawableCompat
+ .createFromXmlInner(context, context.getResources(), parser, attrs, theme);
+ } catch (Exception e) {
+ Log.e("AsldcInflateDelegate", "Exception while inflating <animated-selector>", e);
+ return null;
+ }
+ }
+ }
+}
diff --git a/appcompat/resources/src/main/java/androidx/appcompat/widget/ResourcesWrapper.java b/appcompat/src/main/java/androidx/appcompat/widget/ResourcesWrapper.java
similarity index 100%
rename from appcompat/resources/src/main/java/androidx/appcompat/widget/ResourcesWrapper.java
rename to appcompat/src/main/java/androidx/appcompat/widget/ResourcesWrapper.java
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ScrollingTabContainerView.java b/appcompat/src/main/java/androidx/appcompat/widget/ScrollingTabContainerView.java
index 07da6b9..2fdf7d4 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ScrollingTabContainerView.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ScrollingTabContainerView.java
@@ -15,7 +15,7 @@
*/
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -54,7 +54,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ScrollingTabContainerView extends HorizontalScrollView
implements AdapterView.OnItemSelectedListener {
@@ -387,10 +387,6 @@
private ImageView mIconView;
private View mCustomView;
- // Class name may be obfuscated by Proguard. Hardcode the string for accessibility usage.
- private static final String ACCESSIBILITY_CLASS_NAME =
- "androidx.appcompat.app.ActionBar$Tab";
-
public TabView(Context context, ActionBar.Tab tab, boolean forList) {
super(context, null, R.attr.actionBarTabStyle);
mTab = tab;
@@ -427,7 +423,7 @@
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
// This view masquerades as an action bar tab.
- event.setClassName(ACCESSIBILITY_CLASS_NAME);
+ event.setClassName(ActionBar.Tab.class.getName());
}
@Override
@@ -435,7 +431,7 @@
super.onInitializeAccessibilityNodeInfo(info);
// This view masquerades as an action bar tab.
- info.setClassName(ACCESSIBILITY_CLASS_NAME);
+ info.setClassName(ActionBar.Tab.class.getName());
}
@Override
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/SearchView.java b/appcompat/src/main/java/androidx/appcompat/widget/SearchView.java
index 364f2cb..b7798e9 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/SearchView.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/SearchView.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.appcompat.widget.SuggestionsAdapter.getColumnString;
import android.app.PendingIntent;
@@ -423,7 +423,7 @@
* @param appSearchData bundle provided by the app when launching the search dialog
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setAppSearchData(Bundle appSearchData) {
mAppSearchData = appSearchData;
}
@@ -1819,7 +1819,7 @@
* Local subclass for AutoCompleteTextView.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class SearchAutoComplete extends AppCompatAutoCompleteTextView {
private int mThreshold;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/SuggestionsAdapter.java b/appcompat/src/main/java/androidx/appcompat/widget/SuggestionsAdapter.java
index 635176a..4a8e6c5 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/SuggestionsAdapter.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/SuggestionsAdapter.java
@@ -16,6 +16,7 @@
* limitations under the License.
*/
+import android.annotation.SuppressLint;
import android.app.SearchManager;
import android.app.SearchableInfo;
import android.content.ComponentName;
@@ -89,6 +90,7 @@
// private final Runnable mStartSpinnerRunnable;
// private final Runnable mStopSpinnerRunnable;
+ @SuppressLint("RestrictedApi")
public SuggestionsAdapter(Context context, SearchView searchView, SearchableInfo searchable,
WeakHashMap<String, Drawable.ConstantState> outsideDrawablesCache) {
super(context, searchView.getSuggestionRowLayout(), null /* no initial cursor */,
@@ -331,6 +333,7 @@
}
}
+ @SuppressLint("RestrictedApi")
private CharSequence formatUrl(CharSequence url) {
if (mUrlColor == null) {
// Lazily get the URL color from the current theme.
@@ -444,6 +447,7 @@
* @see android.widget.ListAdapter#getView(int, View, ViewGroup)
*/
@Override
+ @SuppressLint("RestrictedApi")
public View getView(int position, View convertView, ViewGroup parent) {
try {
return super.getView(position, convertView, parent);
@@ -467,6 +471,7 @@
* @see android.widget.CursorAdapter#getDropDownView(int, View, ViewGroup)
*/
@Override
+ @SuppressLint("RestrictedApi")
public View getDropDownView(int position, View convertView, ViewGroup parent) {
try {
return super.getDropDownView(position, convertView, parent);
@@ -600,6 +605,7 @@
* @param cursor A cursor positioned at the current suggestion.
* @return A non-null drawable.
*/
+ @SuppressLint("RestrictedApi")
private Drawable getDefaultIcon1(Cursor cursor) {
// Check the component that gave us the suggestion
Drawable drawable = getActivityIconWithCache(mSearchable.getSearchActivity());
@@ -642,6 +648,7 @@
* @return A drawable, or {@code null} if neither the activity or the application
* have an icon set.
*/
+ @SuppressLint("RestrictedApi")
private Drawable getActivityIcon(ComponentName component) {
PackageManager pm = mContext.getPackageManager();
final ActivityInfo activityInfo;
@@ -694,6 +701,7 @@
* Import of hidden method: ContentResolver.getResourceId(Uri).
* Modified to return a drawable, rather than a hidden type.
*/
+ @SuppressLint("RestrictedApi")
Drawable getDrawableFromResourceUri(Uri uri) throws FileNotFoundException {
String authority = uri.getAuthority();
Resources r;
@@ -732,6 +740,7 @@
/**
* Import of hidden method: SearchManager.getSuggestions(SearchableInfo, String, int).
*/
+ @SuppressLint("RestrictedApi")
Cursor getSearchManagerSuggestions(SearchableInfo searchable, String query, int limit) {
if (searchable == null) {
return null;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/TintContextWrapper.java b/appcompat/src/main/java/androidx/appcompat/widget/TintContextWrapper.java
new file mode 100644
index 0000000..0610c89
--- /dev/null
+++ b/appcompat/src/main/java/androidx/appcompat/widget/TintContextWrapper.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2015 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.appcompat.widget;
+
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+
+import android.content.Context;
+import android.content.ContextWrapper;
+import android.content.res.AssetManager;
+import android.content.res.Resources;
+import android.os.Build;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+
+/**
+ * A {@link android.content.ContextWrapper} which returns a tint-aware
+ * {@link android.content.res.Resources} instance from {@link #getResources()}.
+ *
+ * @hide
+ */
+@RestrictTo(LIBRARY_GROUP)
+public class TintContextWrapper extends ContextWrapper {
+
+ private static final Object CACHE_LOCK = new Object();
+ private static ArrayList<WeakReference<TintContextWrapper>> sCache;
+
+ public static Context wrap(@NonNull final Context context) {
+ if (shouldWrap(context)) {
+ synchronized (CACHE_LOCK) {
+ if (sCache == null) {
+ sCache = new ArrayList<>();
+ } else {
+ // This is a convenient place to prune any dead reference entries
+ for (int i = sCache.size() - 1; i >= 0; i--) {
+ final WeakReference<TintContextWrapper> ref = sCache.get(i);
+ if (ref == null || ref.get() == null) {
+ sCache.remove(i);
+ }
+ }
+ // Now check our instance cache
+ for (int i = sCache.size() - 1; i >= 0; i--) {
+ final WeakReference<TintContextWrapper> ref = sCache.get(i);
+ final TintContextWrapper wrapper = ref != null ? ref.get() : null;
+ if (wrapper != null && wrapper.getBaseContext() == context) {
+ return wrapper;
+ }
+ }
+ }
+ // If we reach here then the cache didn't have a hit, so create a new instance
+ // and add it to the cache
+ final TintContextWrapper wrapper = new TintContextWrapper(context);
+ sCache.add(new WeakReference<>(wrapper));
+ return wrapper;
+ }
+ }
+ return context;
+ }
+
+ private static boolean shouldWrap(@NonNull final Context context) {
+ if (context instanceof TintContextWrapper
+ || context.getResources() instanceof TintResources
+ || context.getResources() instanceof VectorEnabledTintResources) {
+ // If the Context already has a TintResources[Experimental] impl, no need to wrap again
+ // If the Context is already a TintContextWrapper, no need to wrap again
+ return false;
+ }
+ return Build.VERSION.SDK_INT < 21 || VectorEnabledTintResources.shouldBeUsed();
+ }
+
+ private final Resources mResources;
+ private final Resources.Theme mTheme;
+
+ private TintContextWrapper(@NonNull final Context base) {
+ super(base);
+
+ if (VectorEnabledTintResources.shouldBeUsed()) {
+ // We need to create a copy of the Theme so that the Theme references our
+ // new Resources instance
+ mResources = new VectorEnabledTintResources(this, base.getResources());
+ mTheme = mResources.newTheme();
+ mTheme.setTo(base.getTheme());
+ } else {
+ mResources = new TintResources(this, base.getResources());
+ mTheme = null;
+ }
+ }
+
+ @Override
+ public Resources.Theme getTheme() {
+ return mTheme == null ? super.getTheme() : mTheme;
+ }
+
+ @Override
+ public void setTheme(int resid) {
+ if (mTheme == null) {
+ super.setTheme(resid);
+ } else {
+ mTheme.applyStyle(resid, true);
+ }
+ }
+
+ @Override
+ public Resources getResources() {
+ return mResources;
+ }
+
+ @Override
+ public AssetManager getAssets() {
+ // Ensure we're returning assets with the correct configuration.
+ return mResources.getAssets();
+ }
+}
\ No newline at end of file
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/TintInfo.java b/appcompat/src/main/java/androidx/appcompat/widget/TintInfo.java
new file mode 100644
index 0000000..7d49a20
--- /dev/null
+++ b/appcompat/src/main/java/androidx/appcompat/widget/TintInfo.java
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+package androidx.appcompat.widget;
+
+import android.content.res.ColorStateList;
+import android.graphics.PorterDuff;
+
+class TintInfo {
+ public ColorStateList mTintList;
+ public PorterDuff.Mode mTintMode;
+ public boolean mHasTintMode;
+ public boolean mHasTintList;
+
+ void clear() {
+ mTintList = null;
+ mHasTintList = false;
+ mTintMode = null;
+ mHasTintMode = false;
+ }
+}
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/TintResources.java b/appcompat/src/main/java/androidx/appcompat/widget/TintResources.java
new file mode 100644
index 0000000..d14bdab
--- /dev/null
+++ b/appcompat/src/main/java/androidx/appcompat/widget/TintResources.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2015 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.appcompat.widget;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
+
+import androidx.annotation.NonNull;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * This class allows us to intercept calls so that we can tint resources (if applicable).
+ */
+class TintResources extends ResourcesWrapper {
+
+ private final WeakReference<Context> mContextRef;
+
+ public TintResources(@NonNull Context context, @NonNull final Resources res) {
+ super(res);
+ mContextRef = new WeakReference<>(context);
+ }
+
+ /**
+ * We intercept this call so that we tint the result (if applicable). This is needed for
+ * things like {@link android.graphics.drawable.DrawableContainer}s which can retrieve
+ * their children via this method.
+ */
+ @Override
+ public Drawable getDrawable(int id) throws NotFoundException {
+ Drawable d = super.getDrawable(id);
+ Context context = mContextRef.get();
+ if (d != null && context != null) {
+ AppCompatDrawableManager.get().tintDrawableUsingColorFilter(context, id, d);
+ }
+ return d;
+ }
+}
\ No newline at end of file
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/TintTypedArray.java b/appcompat/src/main/java/androidx/appcompat/widget/TintTypedArray.java
index d0038bc..ba1fdf1 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/TintTypedArray.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/TintTypedArray.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -41,7 +41,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class TintTypedArray {
private final Context mContext;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/Toolbar.java b/appcompat/src/main/java/androidx/appcompat/widget/Toolbar.java
index 2754164..7018bfc 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/Toolbar.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/Toolbar.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.annotation.RestrictTo.Scope.TESTS;
import android.content.Context;
@@ -140,7 +140,6 @@
* {@link androidx.appcompat.R.attr#titleMarginTop}
* {@link androidx.appcompat.R.attr#titleTextAppearance}
* {@link androidx.appcompat.R.attr#titleTextColor}
- * {@link androidx.appcompat.R.attr#menu}
*/
public class Toolbar extends ViewGroup {
private static final String TAG = "Toolbar";
@@ -342,11 +341,6 @@
if (a.hasValue(R.styleable.Toolbar_subtitleTextColor)) {
setSubtitleTextColor(a.getColorStateList(R.styleable.Toolbar_subtitleTextColor));
}
-
- if (a.hasValue(R.styleable.Toolbar_menu)) {
- inflateMenu(a.getResourceId(R.styleable.Toolbar_menu, 0));
- }
-
a.recycle();
}
@@ -510,7 +504,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean canShowOverflowMenu() {
return getVisibility() == VISIBLE && mMenuView != null && mMenuView.isOverflowReserved();
}
@@ -526,7 +520,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isOverflowMenuShowPending() {
return mMenuView != null && mMenuView.isOverflowMenuShowPending();
}
@@ -550,7 +544,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setMenu(MenuBuilder menu, ActionMenuPresenter outerPresenter) {
if (menu == null && mMenuView == null) {
return;
@@ -596,7 +590,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isTitleTruncated() {
if (mTitleTextView == null) {
return false;
@@ -1120,7 +1114,6 @@
* an XML menu resource, use {@link #inflateMenu(int)}.</p>
*
* @return The toolbar's Menu
- * {@link androidx.appcompat.R.attr#menu}
*/
public Menu getMenu() {
ensureMenu();
@@ -1185,7 +1178,6 @@
* be modified or removed.</p>
*
* @param resId ID of a menu resource to inflate
- * {@link androidx.appcompat.R.attr#menu}
*/
public void inflateMenu(@MenuRes int resId) {
getMenuInflater().inflate(resId, getMenu());
@@ -2226,7 +2218,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public DecorToolbar getWrapper() {
if (mWrapper == null) {
mWrapper = new ToolbarWidgetWrapper(this, true);
@@ -2265,7 +2257,7 @@
* it could be considered "empty" (no visible elements with nonzero measured size)
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setCollapsible(boolean collapsible) {
mCollapsible = collapsible;
requestLayout();
@@ -2275,7 +2267,7 @@
* Must be called before the menu is accessed
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setMenuCallbacks(MenuPresenter.Callback pcb, MenuBuilder.Callback mcb) {
mActionMenuPresenterCallback = pcb;
mMenuBuilderCallback = mcb;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ToolbarWidgetWrapper.java b/appcompat/src/main/java/androidx/appcompat/widget/ToolbarWidgetWrapper.java
index 1fb1451..0efc3a2 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ToolbarWidgetWrapper.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ToolbarWidgetWrapper.java
@@ -17,7 +17,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.ActionBar;
import android.content.Context;
@@ -58,7 +58,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ToolbarWidgetWrapper implements DecorToolbar {
private static final String TAG = "ToolbarWidgetWrapper";
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/TooltipCompatHandler.java b/appcompat/src/main/java/androidx/appcompat/widget/TooltipCompatHandler.java
index 401abaf..a970202 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/TooltipCompatHandler.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/TooltipCompatHandler.java
@@ -18,7 +18,7 @@
import static android.view.View.SYSTEM_UI_FLAG_LOW_PROFILE;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.text.TextUtils;
@@ -38,7 +38,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
class TooltipCompatHandler implements View.OnLongClickListener, View.OnHoverListener,
View.OnAttachStateChangeListener {
private static final String TAG = "TooltipCompatHandler";
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/TooltipPopup.java b/appcompat/src/main/java/androidx/appcompat/widget/TooltipPopup.java
index 6697a11..c714000 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/TooltipPopup.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/TooltipPopup.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Activity;
import android.content.Context;
@@ -41,7 +41,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
class TooltipPopup {
private static final String TAG = "TooltipPopup";
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/VectorEnabledTintResources.java b/appcompat/src/main/java/androidx/appcompat/widget/VectorEnabledTintResources.java
new file mode 100644
index 0000000..af61860f
--- /dev/null
+++ b/appcompat/src/main/java/androidx/appcompat/widget/VectorEnabledTintResources.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2015 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.appcompat.widget;
+
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * This class allows us to intercept calls so that we can tint resources (if applicable), and
+ * inflate vector resources from within drawable containers pre-L.
+ *
+ * @hide
+ */
+@RestrictTo(LIBRARY_GROUP)
+public class VectorEnabledTintResources extends Resources {
+ private static boolean sCompatVectorFromResourcesEnabled = false;
+
+ public static boolean shouldBeUsed() {
+ return isCompatVectorFromResourcesEnabled()
+ && Build.VERSION.SDK_INT <= MAX_SDK_WHERE_REQUIRED;
+ }
+
+ /**
+ * The maximum API level where this class is needed.
+ */
+ public static final int MAX_SDK_WHERE_REQUIRED = 20;
+
+ private final WeakReference<Context> mContextRef;
+
+ public VectorEnabledTintResources(@NonNull final Context context,
+ @NonNull final Resources res) {
+ super(res.getAssets(), res.getDisplayMetrics(), res.getConfiguration());
+ mContextRef = new WeakReference<>(context);
+ }
+
+ /**
+ * We intercept this call so that we tint the result (if applicable). This is needed for
+ * things like {@link android.graphics.drawable.DrawableContainer}s which can retrieve
+ * their children via this method.
+ */
+ @Override
+ public Drawable getDrawable(int id) throws NotFoundException {
+ final Context context = mContextRef.get();
+ if (context != null) {
+ return AppCompatDrawableManager.get().onDrawableLoadedFromResources(context, this, id);
+ } else {
+ return super.getDrawable(id);
+ }
+ }
+
+ final Drawable superGetDrawable(int id) {
+ return super.getDrawable(id);
+ }
+
+ /**
+ * Sets whether vector drawables on older platforms (< API 21) can be used within
+ * {@link android.graphics.drawable.DrawableContainer} resources.
+ */
+ public static void setCompatVectorFromResourcesEnabled(boolean enabled) {
+ sCompatVectorFromResourcesEnabled = enabled;
+ }
+
+ /**
+ * Returns whether vector drawables on older platforms (< API 21) can be accessed from within
+ * resources.
+ *
+ * @see #setCompatVectorFromResourcesEnabled(boolean)
+ */
+ public static boolean isCompatVectorFromResourcesEnabled() {
+ return sCompatVectorFromResourcesEnabled;
+ }
+}
\ No newline at end of file
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ViewStubCompat.java b/appcompat/src/main/java/androidx/appcompat/widget/ViewStubCompat.java
index 4473648..06fb0f8 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ViewStubCompat.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ViewStubCompat.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -39,7 +39,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class ViewStubCompat extends View {
private int mLayoutResource = 0;
private int mInflatedId;
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/ViewUtils.java b/appcompat/src/main/java/androidx/appcompat/widget/ViewUtils.java
index ef43e50..497eb78 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/ViewUtils.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/ViewUtils.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Rect;
import android.os.Build;
@@ -32,7 +32,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ViewUtils {
private static final String TAG = "ViewUtils";
diff --git a/appcompat/src/main/java/androidx/appcompat/widget/WithHint.java b/appcompat/src/main/java/androidx/appcompat/widget/WithHint.java
index 2672ea7..f9069bd 100644
--- a/appcompat/src/main/java/androidx/appcompat/widget/WithHint.java
+++ b/appcompat/src/main/java/androidx/appcompat/widget/WithHint.java
@@ -16,7 +16,7 @@
package androidx.appcompat.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
@@ -24,7 +24,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface WithHint {
/**
* Returns the hint which is displayed in the floating label, if enabled.
diff --git a/arch/core-common/api/2.0.0.txt b/arch/core-common/api/2.0.0.txt
index dba1d6a7..fd7a0e5 100644
--- a/arch/core-common/api/2.0.0.txt
+++ b/arch/core-common/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.arch.core.util {
public interface Function<I, O> {
diff --git a/arch/core-common/api/2.1.0-alpha01.txt b/arch/core-common/api/2.1.0-alpha01.txt
deleted file mode 100644
index dba1d6a7..0000000
--- a/arch/core-common/api/2.1.0-alpha01.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.arch.core.util {
-
- public interface Function<I, O> {
- method public O! apply(I!);
- }
-
-}
-
diff --git a/arch/core-common/api/current.txt b/arch/core-common/api/current.txt
index dba1d6a7..fd7a0e5 100644
--- a/arch/core-common/api/current.txt
+++ b/arch/core-common/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.arch.core.util {
public interface Function<I, O> {
diff --git a/arch/core-common/build.gradle b/arch/core-common/build.gradle
index ed1ecbe..81a34ad 100644
--- a/arch/core-common/build.gradle
+++ b/arch/core-common/build.gradle
@@ -24,7 +24,7 @@
}
dependencies {
- compile(project(":annotation"))
+ compile(SUPPORT_ANNOTATIONS)
testCompile(JUNIT)
testCompile(MOCKITO_CORE)
@@ -38,5 +38,4 @@
inceptionYear = "2017"
description = "Android Arch-Common"
url = SupportLibraryExtension.ARCHITECTURE_URL
- trackRestrictedAPIs = false
-}
+}
\ No newline at end of file
diff --git a/arch/core-common/src/main/java/androidx/arch/core/internal/FastSafeIterableMap.java b/arch/core-common/src/main/java/androidx/arch/core/internal/FastSafeIterableMap.java
index c53ff9a..c3a9086 100644
--- a/arch/core-common/src/main/java/androidx/arch/core/internal/FastSafeIterableMap.java
+++ b/arch/core-common/src/main/java/androidx/arch/core/internal/FastSafeIterableMap.java
@@ -31,7 +31,7 @@
* @param <V> Value type
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class FastSafeIterableMap<K, V> extends SafeIterableMap<K, V> {
private HashMap<K, Entry<K, V>> mHashMap = new HashMap<>();
diff --git a/arch/core-common/src/main/java/androidx/arch/core/internal/SafeIterableMap.java b/arch/core-common/src/main/java/androidx/arch/core/internal/SafeIterableMap.java
index a7bd54f..ff1cbda 100644
--- a/arch/core-common/src/main/java/androidx/arch/core/internal/SafeIterableMap.java
+++ b/arch/core-common/src/main/java/androidx/arch/core/internal/SafeIterableMap.java
@@ -31,7 +31,7 @@
* @param <V> Value type
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class SafeIterableMap<K, V> implements Iterable<Map.Entry<K, V>> {
@SuppressWarnings("WeakerAccess") /* synthetic access */
diff --git a/arch/core-runtime/api/2.0.0-alpha01.txt b/arch/core-runtime/api/2.0.0-alpha01.txt
index da4f6cc..d802177 100644
--- a/arch/core-runtime/api/2.0.0-alpha01.txt
+++ b/arch/core-runtime/api/2.0.0-alpha01.txt
@@ -1 +1 @@
-// Signature format: 3.0
+// Signature format: 2.0
diff --git a/arch/core-runtime/api/2.0.0.txt b/arch/core-runtime/api/2.0.0.txt
index da4f6cc..d802177 100644
--- a/arch/core-runtime/api/2.0.0.txt
+++ b/arch/core-runtime/api/2.0.0.txt
@@ -1 +1 @@
-// Signature format: 3.0
+// Signature format: 2.0
diff --git a/arch/core-runtime/api/2.1.0-alpha01.txt b/arch/core-runtime/api/2.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/arch/core-runtime/api/2.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/arch/core-runtime/api/current.txt b/arch/core-runtime/api/current.txt
index da4f6cc..d802177 100644
--- a/arch/core-runtime/api/current.txt
+++ b/arch/core-runtime/api/current.txt
@@ -1 +1 @@
-// Signature format: 3.0
+// Signature format: 2.0
diff --git a/arch/core-runtime/api/res-2.1.0-alpha01.txt b/arch/core-runtime/api/res-2.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/arch/core-runtime/api/res-2.1.0-alpha01.txt
+++ /dev/null
diff --git a/arch/core-runtime/api/restricted_2.0.0-alpha01.txt b/arch/core-runtime/api/restricted_2.0.0-alpha01.txt
deleted file mode 100644
index adaaab4..0000000
--- a/arch/core-runtime/api/restricted_2.0.0-alpha01.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-// Signature format: 3.0
-package androidx.arch.core.executor {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ArchTaskExecutor extends androidx.arch.core.executor.TaskExecutor {
- method public void executeOnDiskIO(Runnable!);
- method public static java.util.concurrent.Executor getIOThreadExecutor();
- method public static androidx.arch.core.executor.ArchTaskExecutor getInstance();
- method public static java.util.concurrent.Executor getMainThreadExecutor();
- method public boolean isMainThread();
- method public void postToMainThread(Runnable!);
- method public void setDelegate(androidx.arch.core.executor.TaskExecutor?);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DefaultTaskExecutor extends androidx.arch.core.executor.TaskExecutor {
- ctor public DefaultTaskExecutor();
- method public void executeOnDiskIO(Runnable!);
- method public boolean isMainThread();
- method public void postToMainThread(Runnable!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class TaskExecutor {
- ctor public TaskExecutor();
- method public abstract void executeOnDiskIO(Runnable);
- method public void executeOnMainThread(Runnable);
- method public abstract boolean isMainThread();
- method public abstract void postToMainThread(Runnable);
- }
-
-}
-
diff --git a/arch/core-runtime/api/restricted_2.0.0.txt b/arch/core-runtime/api/restricted_2.0.0.txt
deleted file mode 100644
index 8baf33b..0000000
--- a/arch/core-runtime/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-// Signature format: 3.0
-package androidx.arch.core.executor {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ArchTaskExecutor extends androidx.arch.core.executor.TaskExecutor {
- method public void executeOnDiskIO(Runnable!);
- method public static java.util.concurrent.Executor getIOThreadExecutor();
- method public static androidx.arch.core.executor.ArchTaskExecutor getInstance();
- method public static java.util.concurrent.Executor getMainThreadExecutor();
- method public boolean isMainThread();
- method public void postToMainThread(Runnable!);
- method public void setDelegate(androidx.arch.core.executor.TaskExecutor?);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class DefaultTaskExecutor extends androidx.arch.core.executor.TaskExecutor {
- ctor public DefaultTaskExecutor();
- method public void executeOnDiskIO(Runnable!);
- method public boolean isMainThread();
- method public void postToMainThread(Runnable!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class TaskExecutor {
- ctor public TaskExecutor();
- method public abstract void executeOnDiskIO(Runnable);
- method public void executeOnMainThread(Runnable);
- method public abstract boolean isMainThread();
- method public abstract void postToMainThread(Runnable);
- }
-
-}
-
diff --git a/arch/core-runtime/api/restricted_2.1.0-alpha01.txt b/arch/core-runtime/api/restricted_2.1.0-alpha01.txt
deleted file mode 100644
index adaaab4..0000000
--- a/arch/core-runtime/api/restricted_2.1.0-alpha01.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-// Signature format: 3.0
-package androidx.arch.core.executor {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ArchTaskExecutor extends androidx.arch.core.executor.TaskExecutor {
- method public void executeOnDiskIO(Runnable!);
- method public static java.util.concurrent.Executor getIOThreadExecutor();
- method public static androidx.arch.core.executor.ArchTaskExecutor getInstance();
- method public static java.util.concurrent.Executor getMainThreadExecutor();
- method public boolean isMainThread();
- method public void postToMainThread(Runnable!);
- method public void setDelegate(androidx.arch.core.executor.TaskExecutor?);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DefaultTaskExecutor extends androidx.arch.core.executor.TaskExecutor {
- ctor public DefaultTaskExecutor();
- method public void executeOnDiskIO(Runnable!);
- method public boolean isMainThread();
- method public void postToMainThread(Runnable!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class TaskExecutor {
- ctor public TaskExecutor();
- method public abstract void executeOnDiskIO(Runnable);
- method public void executeOnMainThread(Runnable);
- method public abstract boolean isMainThread();
- method public abstract void postToMainThread(Runnable);
- }
-
-}
-
diff --git a/arch/core-runtime/api/restricted_current.txt b/arch/core-runtime/api/restricted_current.txt
deleted file mode 100644
index adaaab4..0000000
--- a/arch/core-runtime/api/restricted_current.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-// Signature format: 3.0
-package androidx.arch.core.executor {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ArchTaskExecutor extends androidx.arch.core.executor.TaskExecutor {
- method public void executeOnDiskIO(Runnable!);
- method public static java.util.concurrent.Executor getIOThreadExecutor();
- method public static androidx.arch.core.executor.ArchTaskExecutor getInstance();
- method public static java.util.concurrent.Executor getMainThreadExecutor();
- method public boolean isMainThread();
- method public void postToMainThread(Runnable!);
- method public void setDelegate(androidx.arch.core.executor.TaskExecutor?);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DefaultTaskExecutor extends androidx.arch.core.executor.TaskExecutor {
- ctor public DefaultTaskExecutor();
- method public void executeOnDiskIO(Runnable!);
- method public boolean isMainThread();
- method public void postToMainThread(Runnable!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class TaskExecutor {
- ctor public TaskExecutor();
- method public abstract void executeOnDiskIO(Runnable);
- method public void executeOnMainThread(Runnable);
- method public abstract boolean isMainThread();
- method public abstract void postToMainThread(Runnable);
- }
-
-}
-
diff --git a/arch/core-runtime/build.gradle b/arch/core-runtime/build.gradle
index 7091d76..0010920 100644
--- a/arch/core-runtime/build.gradle
+++ b/arch/core-runtime/build.gradle
@@ -24,7 +24,7 @@
}
dependencies {
- api(project(":annotation"))
+ api(SUPPORT_ANNOTATIONS)
api(project(":arch:core-common"))
}
diff --git a/arch/core-runtime/src/main/java/androidx/arch/core/executor/ArchTaskExecutor.java b/arch/core-runtime/src/main/java/androidx/arch/core/executor/ArchTaskExecutor.java
index cdeb07f..a38dff8 100644
--- a/arch/core-runtime/src/main/java/androidx/arch/core/executor/ArchTaskExecutor.java
+++ b/arch/core-runtime/src/main/java/androidx/arch/core/executor/ArchTaskExecutor.java
@@ -28,7 +28,7 @@
*
* @hide This API is not final.
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class ArchTaskExecutor extends TaskExecutor {
private static volatile ArchTaskExecutor sInstance;
diff --git a/arch/core-runtime/src/main/java/androidx/arch/core/executor/DefaultTaskExecutor.java b/arch/core-runtime/src/main/java/androidx/arch/core/executor/DefaultTaskExecutor.java
index 3b7aa69..c9fb85a 100644
--- a/arch/core-runtime/src/main/java/androidx/arch/core/executor/DefaultTaskExecutor.java
+++ b/arch/core-runtime/src/main/java/androidx/arch/core/executor/DefaultTaskExecutor.java
@@ -33,7 +33,7 @@
/**
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class DefaultTaskExecutor extends TaskExecutor {
private final Object mLock = new Object();
diff --git a/arch/core-runtime/src/main/java/androidx/arch/core/executor/TaskExecutor.java b/arch/core-runtime/src/main/java/androidx/arch/core/executor/TaskExecutor.java
index 090736e..4b3c5fa 100644
--- a/arch/core-runtime/src/main/java/androidx/arch/core/executor/TaskExecutor.java
+++ b/arch/core-runtime/src/main/java/androidx/arch/core/executor/TaskExecutor.java
@@ -27,7 +27,7 @@
* TODO: Don't use this from outside, we don't know what the API will look like yet.
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public abstract class TaskExecutor {
/**
* Executes the given task in the disk IO thread pool.
diff --git a/arch/core-testing/api/2.0.0.txt b/arch/core-testing/api/2.0.0.txt
index 7eb7fe1..1ae677c 100644
--- a/arch/core-testing/api/2.0.0.txt
+++ b/arch/core-testing/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.arch.core.executor.testing {
public class CountingTaskExecutorRule extends org.junit.rules.TestWatcher {
diff --git a/arch/core-testing/api/2.1.0-alpha01.txt b/arch/core-testing/api/2.1.0-alpha01.txt
deleted file mode 100644
index 7eb7fe1..0000000
--- a/arch/core-testing/api/2.1.0-alpha01.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-// Signature format: 3.0
-package androidx.arch.core.executor.testing {
-
- public class CountingTaskExecutorRule extends org.junit.rules.TestWatcher {
- ctor public CountingTaskExecutorRule();
- method public void drainTasks(int, java.util.concurrent.TimeUnit!) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException;
- method public boolean isIdle();
- method protected void onIdle();
- }
-
- public class InstantTaskExecutorRule extends org.junit.rules.TestWatcher {
- ctor public InstantTaskExecutorRule();
- }
-
-}
-
diff --git a/arch/core-testing/api/current.txt b/arch/core-testing/api/current.txt
index 7eb7fe1..1ae677c 100644
--- a/arch/core-testing/api/current.txt
+++ b/arch/core-testing/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.arch.core.executor.testing {
public class CountingTaskExecutorRule extends org.junit.rules.TestWatcher {
diff --git a/arch/core-testing/api/res-2.1.0-alpha01.txt b/arch/core-testing/api/res-2.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/arch/core-testing/api/res-2.1.0-alpha01.txt
+++ /dev/null
diff --git a/arch/core-testing/api/restricted_2.0.0.txt b/arch/core-testing/api/restricted_2.0.0.txt
deleted file mode 100644
index 6b162df..0000000
--- a/arch/core-testing/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-// Signature format: 3.0
-package androidx.arch.core.executor {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class JunitTaskExecutorRule implements org.junit.rules.TestRule {
- ctor public JunitTaskExecutorRule(int, boolean);
- method public org.junit.runners.model.Statement! apply(org.junit.runners.model.Statement!, org.junit.runner.Description!);
- method public void drainTasks(int) throws java.lang.InterruptedException;
- method public androidx.arch.core.executor.TaskExecutor! getTaskExecutor();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TaskExecutorWithFakeMainThread extends androidx.arch.core.executor.TaskExecutor {
- ctor public TaskExecutorWithFakeMainThread(int);
- method public void drainTasks(int) throws java.lang.InterruptedException;
- method public void executeOnDiskIO(Runnable!);
- method public boolean isMainThread();
- method public void postToMainThread(Runnable!);
- }
-
-}
-
diff --git a/arch/core-testing/api/restricted_2.1.0-alpha01.txt b/arch/core-testing/api/restricted_2.1.0-alpha01.txt
deleted file mode 100644
index 6b162df..0000000
--- a/arch/core-testing/api/restricted_2.1.0-alpha01.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-// Signature format: 3.0
-package androidx.arch.core.executor {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class JunitTaskExecutorRule implements org.junit.rules.TestRule {
- ctor public JunitTaskExecutorRule(int, boolean);
- method public org.junit.runners.model.Statement! apply(org.junit.runners.model.Statement!, org.junit.runner.Description!);
- method public void drainTasks(int) throws java.lang.InterruptedException;
- method public androidx.arch.core.executor.TaskExecutor! getTaskExecutor();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TaskExecutorWithFakeMainThread extends androidx.arch.core.executor.TaskExecutor {
- ctor public TaskExecutorWithFakeMainThread(int);
- method public void drainTasks(int) throws java.lang.InterruptedException;
- method public void executeOnDiskIO(Runnable!);
- method public boolean isMainThread();
- method public void postToMainThread(Runnable!);
- }
-
-}
-
diff --git a/arch/core-testing/api/restricted_current.txt b/arch/core-testing/api/restricted_current.txt
deleted file mode 100644
index 6b162df..0000000
--- a/arch/core-testing/api/restricted_current.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-// Signature format: 3.0
-package androidx.arch.core.executor {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class JunitTaskExecutorRule implements org.junit.rules.TestRule {
- ctor public JunitTaskExecutorRule(int, boolean);
- method public org.junit.runners.model.Statement! apply(org.junit.runners.model.Statement!, org.junit.runner.Description!);
- method public void drainTasks(int) throws java.lang.InterruptedException;
- method public androidx.arch.core.executor.TaskExecutor! getTaskExecutor();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TaskExecutorWithFakeMainThread extends androidx.arch.core.executor.TaskExecutor {
- ctor public TaskExecutorWithFakeMainThread(int);
- method public void drainTasks(int) throws java.lang.InterruptedException;
- method public void executeOnDiskIO(Runnable!);
- method public boolean isMainThread();
- method public void postToMainThread(Runnable!);
- }
-
-}
-
diff --git a/arch/core-testing/build.gradle b/arch/core-testing/build.gradle
index 2dec495..f733c36 100644
--- a/arch/core-testing/build.gradle
+++ b/arch/core-testing/build.gradle
@@ -25,7 +25,7 @@
dependencies {
api(project(":arch:core-runtime"))
- api(project(":annotation"))
+ api(SUPPORT_ANNOTATIONS)
api(JUNIT)
api(MOCKITO_CORE, libs.exclude_bytebuddy)
diff --git a/arch/core-testing/src/androidTest/java/androidx/arch/core/executor/testing/CountingTaskExecutorRuleTest.java b/arch/core-testing/src/androidTest/java/androidx/arch/core/executor/testing/CountingTaskExecutorRuleTest.java
index 4b0bf6d..ac68079f 100644
--- a/arch/core-testing/src/androidTest/java/androidx/arch/core/executor/testing/CountingTaskExecutorRuleTest.java
+++ b/arch/core-testing/src/androidTest/java/androidx/arch/core/executor/testing/CountingTaskExecutorRuleTest.java
@@ -21,7 +21,7 @@
import androidx.arch.core.executor.ArchTaskExecutor;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import org.junit.Rule;
import org.junit.Test;
@@ -35,7 +35,7 @@
import java.util.concurrent.TimeoutException;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@MediumTest
public class CountingTaskExecutorRuleTest {
private final Semaphore mOnIdleCount = new Semaphore(0);
diff --git a/arch/core-testing/src/main/java/androidx/arch/core/executor/JunitTaskExecutorRule.java b/arch/core-testing/src/main/java/androidx/arch/core/executor/JunitTaskExecutorRule.java
index 94ebb2b..1a09d1e 100644
--- a/arch/core-testing/src/main/java/androidx/arch/core/executor/JunitTaskExecutorRule.java
+++ b/arch/core-testing/src/main/java/androidx/arch/core/executor/JunitTaskExecutorRule.java
@@ -32,7 +32,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class JunitTaskExecutorRule implements TestRule {
private final TaskExecutorWithFakeMainThread mTaskExecutor;
diff --git a/arch/core-testing/src/main/java/androidx/arch/core/executor/TaskExecutorWithFakeMainThread.java b/arch/core-testing/src/main/java/androidx/arch/core/executor/TaskExecutorWithFakeMainThread.java
index 89e969b..d855a08 100644
--- a/arch/core-testing/src/main/java/androidx/arch/core/executor/TaskExecutorWithFakeMainThread.java
+++ b/arch/core-testing/src/main/java/androidx/arch/core/executor/TaskExecutorWithFakeMainThread.java
@@ -36,7 +36,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@SuppressLint("SyntheticAccessor")
public class TaskExecutorWithFakeMainThread extends TaskExecutor {
@SuppressWarnings("WeakerAccess") /* synthetic access */
diff --git a/asynclayoutinflater/api/1.0.0.txt b/asynclayoutinflater/api/1.0.0.txt
index a729b12..0b5a843 100644
--- a/asynclayoutinflater/api/1.0.0.txt
+++ b/asynclayoutinflater/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.asynclayoutinflater.view {
public final class AsyncLayoutInflater {
diff --git a/asynclayoutinflater/api/1.1.0-alpha01.txt b/asynclayoutinflater/api/1.1.0-alpha01.txt
deleted file mode 100644
index a729b12..0000000
--- a/asynclayoutinflater/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.asynclayoutinflater.view {
-
- public final class AsyncLayoutInflater {
- ctor public AsyncLayoutInflater(android.content.Context);
- method @UiThread public void inflate(@LayoutRes int, android.view.ViewGroup?, androidx.asynclayoutinflater.view.AsyncLayoutInflater.OnInflateFinishedListener);
- }
-
- public static interface AsyncLayoutInflater.OnInflateFinishedListener {
- method public void onInflateFinished(android.view.View, @LayoutRes int, android.view.ViewGroup?);
- }
-
-}
-
diff --git a/asynclayoutinflater/api/current.txt b/asynclayoutinflater/api/current.txt
index a729b12..0b5a843 100644
--- a/asynclayoutinflater/api/current.txt
+++ b/asynclayoutinflater/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.asynclayoutinflater.view {
public final class AsyncLayoutInflater {
diff --git a/asynclayoutinflater/api/res-1.1.0-alpha01.txt b/asynclayoutinflater/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/asynclayoutinflater/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/asynclayoutinflater/api/restricted_1.0.0.txt b/asynclayoutinflater/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/asynclayoutinflater/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/asynclayoutinflater/api/restricted_1.1.0-alpha01.txt b/asynclayoutinflater/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/asynclayoutinflater/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/asynclayoutinflater/api/restricted_current.txt b/asynclayoutinflater/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/asynclayoutinflater/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/benchmark/src/androidTest/java/androidx/benchmark/BenchmarkRuleTest.kt b/benchmark/src/androidTest/java/androidx/benchmark/BenchmarkRuleTest.kt
deleted file mode 100644
index a72ad3b..0000000
--- a/benchmark/src/androidTest/java/androidx/benchmark/BenchmarkRuleTest.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2019 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.benchmark
-
-import androidx.test.filters.SmallTest
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
-@SmallTest
-@RunWith(JUnit4::class)
-class BenchmarkRuleTest {
- @Suppress("MemberVisibilityCanBePrivate") // intentionally public
- // NOTE: not annotated, so will throw when state is accessed
- val rule = BenchmarkRule()
-
- @Test(expected = IllegalStateException::class)
- fun throwsIfNotAnnotated() {
- rule.state
- }
-}
diff --git a/benchmark/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt b/benchmark/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt
index b79bba0..de01de0 100644
--- a/benchmark/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt
+++ b/benchmark/src/androidTest/java/androidx/benchmark/BenchmarkStateTest.kt
@@ -16,16 +16,15 @@
package androidx.benchmark
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import org.junit.Assert.assertEquals
-import org.junit.Assert.assertNotNull
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import java.util.concurrent.TimeUnit
-@LargeTest
+@SmallTest
@RunWith(JUnit4::class)
class BenchmarkStateTest {
private fun ms2ns(ms: Long): Long = TimeUnit.MILLISECONDS.toNanos(ms)
@@ -61,22 +60,4 @@
assertEquals(summary1.indexOf("foo"),
summary2.indexOf("foo"))
}
-
- @Test
- fun bundle() {
- val bundle = BenchmarkState().apply {
- while (keepRunning()) {
- // nothing, we're ignoring numbers
- }
- }.getFullStatusReport("foo")
- val expectedLabel = WarningState.WARNING_PREFIX + "foo"
-
- assertTrue(
- (bundle.get("android.studio.display.benchmark") as String).contains(expectedLabel))
-
- // check attribute presence and naming
- assertNotNull(bundle.get(expectedLabel + "_min"))
- assertNotNull(bundle.get(expectedLabel + "_mean"))
- assertNotNull(bundle.get(expectedLabel + "_count"))
- }
}
diff --git a/benchmark/src/main/java/androidx/benchmark/BenchmarkRule.java b/benchmark/src/main/java/androidx/benchmark/BenchmarkRule.java
index f1a8013..e6d097a 100644
--- a/benchmark/src/main/java/androidx/benchmark/BenchmarkRule.java
+++ b/benchmark/src/main/java/androidx/benchmark/BenchmarkRule.java
@@ -19,7 +19,6 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import android.app.Activity;
import android.util.Log;
import androidx.annotation.NonNull;
@@ -33,6 +32,7 @@
* Use this rule to make sure we report the status after the test success.
*
* <pre>
+ *
* {@literal @}Rule public BenchmarkRule benchmarkRule = new BenchmarkRule();
* {@literal @}Test public void functionName() {
* ...
@@ -55,16 +55,9 @@
private static final String TAG = "BenchmarkRule";
@SuppressWarnings("WeakerAccess") // synthetic access
final BenchmarkState mState = new BenchmarkState();
- @SuppressWarnings("WeakerAccess") // synthetic access
- boolean mApplied = false;
@NonNull
public BenchmarkState getState() {
- if (!mApplied) {
- throw new IllegalStateException("Cannot get state before BenchmarkRule is applied"
- + " to a test. Check that your BenchmarkRule is annotated correctly"
- + " (@Rule in Java, @get:Rule in Kotlin).");
- }
return mState;
}
@@ -74,7 +67,6 @@
return new Statement() {
@Override
public void evaluate() throws Throwable {
- mApplied = true;
String invokeMethodName = description.getMethodName();
Log.i(TAG, "Running " + description.getClassName() + "#" + invokeMethodName);
@@ -103,8 +95,8 @@
base.evaluate();
- InstrumentationRegistry.getInstrumentation().sendStatus(Activity.RESULT_OK,
- mState.getFullStatusReport(invokeMethodName));
+ mState.sendFullStatusReport(InstrumentationRegistry.getInstrumentation(),
+ invokeMethodName);
}
};
}
diff --git a/benchmark/src/main/java/androidx/benchmark/BenchmarkState.java b/benchmark/src/main/java/androidx/benchmark/BenchmarkState.java
index 480bc92..ac85f70 100644
--- a/benchmark/src/main/java/androidx/benchmark/BenchmarkState.java
+++ b/benchmark/src/main/java/androidx/benchmark/BenchmarkState.java
@@ -16,6 +16,9 @@
package androidx.benchmark;
+import android.app.Activity;
+import android.app.Instrumentation;
+import android.content.pm.ApplicationInfo;
import android.os.Build;
import android.os.Bundle;
import android.os.Debug;
@@ -47,10 +50,10 @@
* }
*/
public final class BenchmarkState {
- private static final String TAG = "Benchmark";
+ private static final String TAG = "BenchmarkState";
private static final String CSV_TAG = "BenchmarkCsv";
- private static final String STUDIO_OUTPUT_KEY_PREFIX = "android.studio.display.";
- private static final String STUDIO_OUTPUT_KEY_ID = "benchmark";
+ private static final String STUDIO_OUTPUT_KEY = "android.studio.display.benchmark";
+ private static final boolean IS_DEBUGGABLE;
private static final boolean ENABLE_PROFILING = false;
@@ -59,13 +62,17 @@
private static final int RUNNING = 2; // The benchmark is running.
private static final int FINISHED = 3; // The benchmark has stopped.
- // values determined empirically
+ // values determined emperically
private static final long TARGET_TEST_DURATION_NS = TimeUnit.MILLISECONDS.toNanos(500);
private static final int MAX_TEST_ITERATIONS = 1000000;
private static final int MIN_TEST_ITERATIONS = 10;
private static final int REPEAT_COUNT = 5;
static {
+ ApplicationInfo appInfo = InstrumentationRegistry.getInstrumentation().getTargetContext()
+ .getApplicationInfo();
+ IS_DEBUGGABLE = (appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
+
StringBuilder sb = new StringBuilder();
sb.append("Benchmark");
for (int i = 0; i < REPEAT_COUNT; i++) {
@@ -259,32 +266,6 @@
return sb.toString();
}
- @NonNull
- private String ideSummaryLineWrapped(@NonNull String key) {
- StringBuilder result = null;
-
- String warningString = WarningState.acquireWarningStringForLogging();
- if (warningString != null) {
- for (String s : warningString.split("\n")) {
- if (result == null) {
- if (s.isEmpty()) {
- continue;
- }
- result = new StringBuilder(s).append("\n");
- } else {
- result.append(STUDIO_OUTPUT_KEY_ID).append(": ").append(s).append("\n");
- }
- }
- if (result != null) {
- result.append(STUDIO_OUTPUT_KEY_ID).append(": ").append(ideSummaryLine(key));
- return result.toString();
- }
- }
-
- return ideSummaryLine(key);
- }
-
- @NonNull
String ideSummaryLine(@NonNull String key) {
// NOTE: this summary line will use default locale to determine separators. As
// this line is only meant for human eyes, we don't worry about consistency here.
@@ -305,12 +286,17 @@
}
/**
- * Acquires a status report bundle
+ * Submit status report bundle as a RESULT_OK to the passed Instrumentation
*
+ * @param instrumentation Instrumentation used to signal result.
* @param key Run identifier, prepended to bundle properties.
*/
- Bundle getFullStatusReport(@NonNull String key) {
- key = WarningState.WARNING_PREFIX + key;
+ @SuppressWarnings("WeakerAccess")
+ public void sendFullStatusReport(@NonNull Instrumentation instrumentation,
+ @NonNull String key) {
+ if (IS_DEBUGGABLE) {
+ key = "DEBUGGABLE_" + key;
+ }
Log.i(TAG, key + summaryLine());
Log.i(CSV_TAG, key + csvLine());
Bundle status = new Bundle();
@@ -319,8 +305,7 @@
status.putLong(key + "_min", min());
status.putLong(key + "_standardDeviation", standardDeviation());
status.putLong(key + "_count", count());
- status.putString(STUDIO_OUTPUT_KEY_PREFIX + STUDIO_OUTPUT_KEY_ID,
- ideSummaryLineWrapped(key));
- return status;
+ status.putString(STUDIO_OUTPUT_KEY, ideSummaryLine(key));
+ instrumentation.sendStatus(Activity.RESULT_OK, status);
}
}
diff --git a/benchmark/src/main/java/androidx/benchmark/WarningState.java b/benchmark/src/main/java/androidx/benchmark/WarningState.java
deleted file mode 100644
index 742eb9c..0000000
--- a/benchmark/src/main/java/androidx/benchmark/WarningState.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2019 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.benchmark;
-
-import android.content.pm.ApplicationInfo;
-import android.os.Build;
-import android.util.Log;
-
-import androidx.annotation.Nullable;
-import androidx.test.platform.app.InstrumentationRegistry;
-
-class WarningState {
- private static final String TAG = "Benchmark";
-
- static final String WARNING_PREFIX;
- private static String sWarningString;
-
- static {
- ApplicationInfo appInfo = InstrumentationRegistry.getInstrumentation().getTargetContext()
- .getApplicationInfo();
- String warningPrefix = "";
- String warningString = "";
- if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
- warningPrefix += "DEBUGGABLE_";
- warningString += "\nWARNING: Debuggable Benchmark\n"
- + " Benchmark is running with debuggable=true, which drastically reduces\n"
- + " runtime performance in order to support debugging features. Run\n"
- + " benchmarks with debuggable=false. Debuggable affects execution speed\n"
- + " in ways that mean benchmark improvements might not carry over to a\n"
- + " real user's experience (or even regress release performance).\n";
- }
- if (Build.FINGERPRINT.startsWith("generic")
- || Build.FINGERPRINT.startsWith("unknown")
- || Build.MODEL.contains("google_sdk")
- || Build.MODEL.contains("Emulator")
- || Build.MODEL.contains("Android SDK built for x86")
- || Build.MANUFACTURER.contains("Genymotion")
- || (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic"))
- || "google_sdk".equals(Build.PRODUCT)) {
- warningPrefix += "EMULATOR_";
- warningString += "\nWARNING: Running on Emulator\n"
- + " Benchmark is running on an emulator, which is not representative of\n"
- + " real user devices. Use a physical device to benchmark. Emulator\n"
- + " benchmark improvements might not carry over to a real user's\n"
- + " experience (or even regress real device performance).\n";
- }
- if (Build.FINGERPRINT.contains(":eng/")) {
- warningPrefix += "ENG-BUILD_";
- warningString += "\nWARNING: Running on Eng Build\n"
- + " Benchmark is running on device flashed with a '-eng' build. Eng builds\n"
- + " of the platform drastically reduce performance to enable testing\n"
- + " changes quickly. For this reason they should not be used for\n"
- + " benchmarking. Use a '-user' or '-userdebug' system image.\n";
- }
- WARNING_PREFIX = warningPrefix;
-
- if (!warningString.isEmpty()) {
- sWarningString = warningString;
- for (String line : sWarningString.split("\n")) {
- Log.w(TAG, line);
- }
- Log.w(TAG, "");
- }
- }
-
- @Nullable
- static String acquireWarningStringForLogging() {
- String ret = sWarningString;
- sWarningString = null;
- return ret;
- }
-}
diff --git a/biometric/api/1.0.0-alpha03.txt b/biometric/api/1.0.0-alpha03.txt
index f517f0f..fbc7f7a 100644
--- a/biometric/api/1.0.0-alpha03.txt
+++ b/biometric/api/1.0.0-alpha03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.biometric {
public class BiometricPrompt {
diff --git a/biometric/api/1.0.0-alpha04.txt b/biometric/api/1.0.0-alpha04.txt
index f517f0f..fbc7f7a 100644
--- a/biometric/api/1.0.0-alpha04.txt
+++ b/biometric/api/1.0.0-alpha04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.biometric {
public class BiometricPrompt {
diff --git a/biometric/api/current.txt b/biometric/api/current.txt
index f517f0f..fbc7f7a 100644
--- a/biometric/api/current.txt
+++ b/biometric/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.biometric {
public class BiometricPrompt {
diff --git a/biometric/api/restricted_1.0.0-alpha04.txt b/biometric/api/restricted_1.0.0-alpha04.txt
deleted file mode 100644
index b567bf4..0000000
--- a/biometric/api/restricted_1.0.0-alpha04.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.biometric {
-
-
-
-
-
-}
-
diff --git a/biometric/api/restricted_current.txt b/biometric/api/restricted_current.txt
deleted file mode 100644
index b567bf4..0000000
--- a/biometric/api/restricted_current.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.biometric {
-
-
-
-
-
-}
-
diff --git a/biometric/res/values-af/strings.xml b/biometric/res/values-af/strings.xml
index 29d0149..41d57f5 100644
--- a/biometric/res/values-af/strings.xml
+++ b/biometric/res/values-af/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Geen vingerafdrukke is geregistreer nie."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Hierdie toetstel het nie \'n vingerafdruksensor nie"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Vingerafdrukhandeling is deur gebruiker gekanselleer."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Onbekende fout"</string>
</resources>
diff --git a/biometric/res/values-am/strings.xml b/biometric/res/values-am/strings.xml
index b16c910..1865cbd 100644
--- a/biometric/res/values-am/strings.xml
+++ b/biometric/res/values-am/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"ምንም የጣት አሻራዎች አልተመዘገቡም።"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"ይህ መሣሪያ የጣት አሻራ ዳሳሽ የለውም"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"የጣት አሻራ ክወና በተጠቃሚ ተሰርዟል።"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"ያልታወቀ ስህተት"</string>
</resources>
diff --git a/biometric/res/values-ar/strings.xml b/biometric/res/values-ar/strings.xml
index a879778..ad7b5a1 100644
--- a/biometric/res/values-ar/strings.xml
+++ b/biometric/res/values-ar/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"ليست هناك بصمات إصبع مسجَّلة."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"لا يحتوي هذا الجهاز على جهاز استشعار بصمات الأصابع."</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"تم إلغاء تشغيل بصمة الإصبع بواسطة المستخدم."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"خطأ غير معروف"</string>
</resources>
diff --git a/biometric/res/values-as/strings.xml b/biometric/res/values-as/strings.xml
deleted file mode 100644
index a360c76..0000000
--- a/biometric/res/values-as/strings.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Copyright (C) 2017 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.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="fingerprint_dialog_touch_sensor" msgid="5354590751262189738">"ফিংগাৰপ্ৰিণ্ট ছেন্সৰটো স্পৰ্শ কৰক"</string>
- <string name="fingerprint_not_recognized" msgid="5491287833813257925">"চিনাক্ত কৰিব পৰা নাই"</string>
- <string name="accessibility_fingerprint_dialog_help_area" msgid="6241458715391513061">"সহায় বাৰ্তাৰ ক্ষেত্ৰ"</string>
- <string name="fingerprint_error_hw_not_available" msgid="3976825677335166260">"ফিংগাৰপ্ৰিণ্ট হাৰ্ডৱেৰ নাই।"</string>
- <string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"কোনো ফিংগাৰপ্ৰিণ্ট যোগ কৰা নহ\'ল।"</string>
- <string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"এই ডিভাইচটোত ফিংগাৰপ্ৰিণ্ট ছেন্সৰ নাই"</string>
- <string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"ব্যৱহাৰকাৰীয়ে ফিংগাৰপ্ৰিণ্টৰ দ্বাৰা বিশ্বাসযোগ্যতা প্ৰমাণীকৰণ কাৰ্য বাতিল কৰিছে।"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"অজ্ঞাত আসোঁৱাহ"</string>
-</resources>
diff --git a/biometric/res/values-az/strings.xml b/biometric/res/values-az/strings.xml
index 81db72c..38f9760 100644
--- a/biometric/res/values-az/strings.xml
+++ b/biometric/res/values-az/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Barmaq izi qeydə alınmayıb."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Bu cihazda barmaq izi sensoru yoxdur"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Barmaq izi əməliyyatı istifadəçi tərəfindən ləğv edildi."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Naməlum xəta"</string>
</resources>
diff --git a/biometric/res/values-b+sr+Latn/strings.xml b/biometric/res/values-b+sr+Latn/strings.xml
index 1316516..18a4bf0 100644
--- a/biometric/res/values-b+sr+Latn/strings.xml
+++ b/biometric/res/values-b+sr+Latn/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nije registrovan nijedan otisak prsta."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Ovaj uređaj nema senzor za otisak prsta"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Korisnik je otkazao radnju sa otiskom prsta."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Nepoznata greška"</string>
</resources>
diff --git a/biometric/res/values-be/strings.xml b/biometric/res/values-be/strings.xml
index 1b63759..904c2ad 100644
--- a/biometric/res/values-be/strings.xml
+++ b/biometric/res/values-be/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Адбіткі пальцаў не зарэгістраваны."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"На гэтай прыладзе няма сканера адбіткаў пальцаў"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Аўтэнтыфікацыя па адбітках пальцаў скасавана карыстальнікам."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Невядомая памылка"</string>
</resources>
diff --git a/biometric/res/values-bg/strings.xml b/biometric/res/values-bg/strings.xml
index bdea901..b775a40 100644
--- a/biometric/res/values-bg/strings.xml
+++ b/biometric/res/values-bg/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Няма регистрирани отпечатъци."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Това устройство няма сензор за отпечатъци"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Операцията за удостоверяване чрез отпечатък бе анулирана от потребителя."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Неизвестна грешка"</string>
</resources>
diff --git a/biometric/res/values-bn/strings.xml b/biometric/res/values-bn/strings.xml
index a1f4575..94759b1 100644
--- a/biometric/res/values-bn/strings.xml
+++ b/biometric/res/values-bn/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"কোনও আঙ্গুলের ছাপ নথিভুক্ত নেই।"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"এই ডিভাইসে আঙ্গুলের ছাপ নেওয়ার সেন্সর নেই"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"ব্যবহারকারী আঙ্গুলের ছাপ নেওয়ার অপারেশনটি বাতিল করেছেন।"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"অজানা সমস্যা"</string>
</resources>
diff --git a/biometric/res/values-bs/strings.xml b/biometric/res/values-bs/strings.xml
index 2875b0b..47c50f0 100644
--- a/biometric/res/values-bs/strings.xml
+++ b/biometric/res/values-bs/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nije prijavljen nijedan otisak prsta."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Ovaj uređaj nema senzor za otisak prsta"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Korisnik je otkazao radnju s otiskom prsta."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Nepoznata greška"</string>
</resources>
diff --git a/biometric/res/values-ca/strings.xml b/biometric/res/values-ca/strings.xml
index 01d08ef..6623973 100644
--- a/biometric/res/values-ca/strings.xml
+++ b/biometric/res/values-ca/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"No s\'ha registrat cap empremta digital."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Aquest dispositiu no té sensor d\'empremtes digitals"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"L\'usuari ha cancel·lat l\'operació d\'empremta digital."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Error desconegut"</string>
</resources>
diff --git a/biometric/res/values-cs/strings.xml b/biometric/res/values-cs/strings.xml
index 4c5dfdf..6b0c087 100644
--- a/biometric/res/values-cs/strings.xml
+++ b/biometric/res/values-cs/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nejsou zaregistrovány žádné otisky prstů."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Toto zařízení nemá snímač otisků prstů"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Uživatel operaci s otiskem prstu zrušil."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Neznámá chyba"</string>
</resources>
diff --git a/biometric/res/values-da/strings.xml b/biometric/res/values-da/strings.xml
index cfd7e8d..4227a15 100644
--- a/biometric/res/values-da/strings.xml
+++ b/biometric/res/values-da/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Der er ikke registreret nogen fingeraftryk."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Denne enhed har ingen fingeraftrykslæser"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Fingeraftrykshandlingen blev annulleret af brugeren."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Ukendt fejl"</string>
</resources>
diff --git a/biometric/res/values-de/strings.xml b/biometric/res/values-de/strings.xml
index 8c4a890..2b53818 100644
--- a/biometric/res/values-de/strings.xml
+++ b/biometric/res/values-de/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Keine Fingerabdrücke erfasst."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Dieses Gerät hat keinen Fingerabdrucksensor"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Vorgang der Fingerabdruckauthentifizierung vom Nutzer abgebrochen."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Unbekannter Fehler"</string>
</resources>
diff --git a/biometric/res/values-el/strings.xml b/biometric/res/values-el/strings.xml
index 93a53ff..80fca12 100644
--- a/biometric/res/values-el/strings.xml
+++ b/biometric/res/values-el/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Δεν έχουν καταχωριστεί δακτυλικά αποτυπώματα."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Αυτή η συσκευή δεν διαθέτει αισθητήρα δακτυλικών αποτυπωμάτων"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Η λειτουργία δακτυλικού αποτυπώματος ακυρώθηκε από τον χρήστη."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Άγνωστο σφάλμα"</string>
</resources>
diff --git a/biometric/res/values-en-rAU/strings.xml b/biometric/res/values-en-rAU/strings.xml
index 7126ba4..70be6de 100644
--- a/biometric/res/values-en-rAU/strings.xml
+++ b/biometric/res/values-en-rAU/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"No fingerprints enrolled."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"This device does not have a fingerprint sensor"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Fingerprint operation cancelled by user."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Unknown error"</string>
</resources>
diff --git a/biometric/res/values-en-rGB/strings.xml b/biometric/res/values-en-rGB/strings.xml
index 7126ba4..70be6de 100644
--- a/biometric/res/values-en-rGB/strings.xml
+++ b/biometric/res/values-en-rGB/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"No fingerprints enrolled."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"This device does not have a fingerprint sensor"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Fingerprint operation cancelled by user."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Unknown error"</string>
</resources>
diff --git a/biometric/res/values-en-rIN/strings.xml b/biometric/res/values-en-rIN/strings.xml
index 7126ba4..70be6de 100644
--- a/biometric/res/values-en-rIN/strings.xml
+++ b/biometric/res/values-en-rIN/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"No fingerprints enrolled."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"This device does not have a fingerprint sensor"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Fingerprint operation cancelled by user."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Unknown error"</string>
</resources>
diff --git a/biometric/res/values-es-rUS/strings.xml b/biometric/res/values-es-rUS/strings.xml
index 59c6d38..86622da 100644
--- a/biometric/res/values-es-rUS/strings.xml
+++ b/biometric/res/values-es-rUS/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"No se registraron huellas digitales."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Este dispositivo no tiene sensor de huellas digitales"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"El usuario canceló la operación de huella digital."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Error desconocido"</string>
</resources>
diff --git a/biometric/res/values-es/strings.xml b/biometric/res/values-es/strings.xml
index 9f5183a..4e4b443 100644
--- a/biometric/res/values-es/strings.xml
+++ b/biometric/res/values-es/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"No se ha registrado ninguna huella digital."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"El dispositivo no tiene ningún sensor de huellas digitales"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"El usuario ha cancelado la operación de huella digital."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Error desconocido"</string>
</resources>
diff --git a/biometric/res/values-et/strings.xml b/biometric/res/values-et/strings.xml
index 38b4d3b..5681c28 100644
--- a/biometric/res/values-et/strings.xml
+++ b/biometric/res/values-et/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Ühtegi sõrmejälge pole registreeritud."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Selles seadmes pole sõrmejäljeandurit"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Kasutaja tühistas sõrmejälje kasutamise."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Tundmatu viga"</string>
</resources>
diff --git a/biometric/res/values-eu/strings.xml b/biometric/res/values-eu/strings.xml
index cc0ac0a..d7f339c 100644
--- a/biometric/res/values-eu/strings.xml
+++ b/biometric/res/values-eu/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Ez da erregistratu hatz-markarik."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Gailu honek ez du hatz-marken sentsorerik"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Erabiltzaileak bertan behera utzi du hatz-marka bidezko eragiketa."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Errore ezezaguna"</string>
</resources>
diff --git a/biometric/res/values-fa/strings.xml b/biometric/res/values-fa/strings.xml
index e12992e..73add23 100644
--- a/biometric/res/values-fa/strings.xml
+++ b/biometric/res/values-fa/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"اثر انگشتی ثبت نشده است."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"این دستگاه حسگر اثر انگشت ندارد"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"کاربر عملیات اثر انگشت را لغو کرد"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"خطای ناشناس"</string>
</resources>
diff --git a/biometric/res/values-fi/strings.xml b/biometric/res/values-fi/strings.xml
index d77621c..fe49dd2 100644
--- a/biometric/res/values-fi/strings.xml
+++ b/biometric/res/values-fi/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Sormenjälkiä ei ole lisätty."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Laitteessa ei ole sormenjälkitunnistinta."</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Käyttäjä peruutti sormenjälkitoiminnon."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Tuntematon virhe"</string>
</resources>
diff --git a/biometric/res/values-fr-rCA/strings.xml b/biometric/res/values-fr-rCA/strings.xml
index 5ecac9e..9fcafb5 100644
--- a/biometric/res/values-fr-rCA/strings.xml
+++ b/biometric/res/values-fr-rCA/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Aucune empreinte digitale enregistrée."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Cet appareil ne possède pas de capteur d\'empreintes digitales"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"L\'opération d\'authentification par empreinte digitale a été annulée par l\'utilisateur."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Erreur inconnue"</string>
</resources>
diff --git a/biometric/res/values-fr/strings.xml b/biometric/res/values-fr/strings.xml
index 7511ebc..6c87c96 100644
--- a/biometric/res/values-fr/strings.xml
+++ b/biometric/res/values-fr/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Aucune empreinte digitale enregistrée."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Aucun lecteur d\'empreinte digitale n\'est installé sur cet appareil"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Opération d\'authentification par empreinte digitale annulée par l\'utilisateur."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Erreur inconnue"</string>
</resources>
diff --git a/biometric/res/values-gl/strings.xml b/biometric/res/values-gl/strings.xml
index 55c1fa1..627f843 100644
--- a/biometric/res/values-gl/strings.xml
+++ b/biometric/res/values-gl/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Non se rexistraron impresións dixitais."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Este dispositivo non ten sensor de impresión dixital"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"O usuario cancelou a operación da impresión dixital."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Produciuse un erro descoñecido"</string>
</resources>
diff --git a/biometric/res/values-gu/strings.xml b/biometric/res/values-gu/strings.xml
index 3cc33cbe..f40c47a 100644
--- a/biometric/res/values-gu/strings.xml
+++ b/biometric/res/values-gu/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"કોઈ ફિંગરપ્રિન્ટની નોંધણી કરવામાં આવી નથી."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"આ ડિવાઇસમાં કોઈ ફિંગરપ્રિન્ટ સેન્સર નથી"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"ફિંગરપ્રિન્ટ ચકાસવાની પ્રક્રિયા વપરાશકર્તાએ રદ કરી."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"અજાણી ભૂલ"</string>
</resources>
diff --git a/biometric/res/values-hi/strings.xml b/biometric/res/values-hi/strings.xml
index 2015088..e66349e 100644
--- a/biometric/res/values-hi/strings.xml
+++ b/biometric/res/values-hi/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"कोई फ़िंगरप्रिंट रजिस्टर नहीं किया गया है."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"इस डिवाइस में फ़िंगरप्रिंट सेंसर नहीं है"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"उपयोगकर्ता ने फिंगरप्रिंट की पुष्टि की कार्रवाई रद्द कर दी है."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"अनजान गड़बड़ी"</string>
</resources>
diff --git a/biometric/res/values-hr/strings.xml b/biometric/res/values-hr/strings.xml
index e9bcf43..a3261cc 100644
--- a/biometric/res/values-hr/strings.xml
+++ b/biometric/res/values-hr/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nije registriran nijedan otisak prsta."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Ovaj uređaj nema senzor otiska prsta"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Radnju s otiskom prsta otkazao je korisnik."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Nepoznata pogreška"</string>
</resources>
diff --git a/biometric/res/values-hu/strings.xml b/biometric/res/values-hu/strings.xml
index a82b908..fc50a5b 100644
--- a/biometric/res/values-hu/strings.xml
+++ b/biometric/res/values-hu/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nincsenek regisztrált ujjlenyomatok."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Ez az eszköz nem rendelkezik ujjlenyomat-érzékelővel"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Az ujjlenyomattal kapcsolatos műveletet a felhasználó megszakította."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Ismeretlen hiba"</string>
</resources>
diff --git a/biometric/res/values-hy/strings.xml b/biometric/res/values-hy/strings.xml
index 3edc356..c01187e 100644
--- a/biometric/res/values-hy/strings.xml
+++ b/biometric/res/values-hy/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Գրանցված մատնահետքեր չկան:"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Սարքը չունի մատնահետքերի սկաներ"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Մատնահետքով նույնականացման գործողությունը չեղարկվել է օգտատիրոջ կողմից:"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Անհայտ սխալ"</string>
</resources>
diff --git a/biometric/res/values-in/strings.xml b/biometric/res/values-in/strings.xml
index 4e8b0a6..b9e06f7 100644
--- a/biometric/res/values-in/strings.xml
+++ b/biometric/res/values-in/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Tidak ada sidik jari yang terdaftar."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Perangkat ini tidak memiliki sensor sidik jari"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Operasi sidik jari dibatalkan oleh pengguna."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Error tidak diketahui"</string>
</resources>
diff --git a/biometric/res/values-is/strings.xml b/biometric/res/values-is/strings.xml
index 509e72e..dfc1f9a 100644
--- a/biometric/res/values-is/strings.xml
+++ b/biometric/res/values-is/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Engin fingraför hafa verið skráð."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Þetta tæki er ekki með fingrafaralesara"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Notandi hætti við að nota fingrafar."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Óþekkt villa"</string>
</resources>
diff --git a/biometric/res/values-it/strings.xml b/biometric/res/values-it/strings.xml
index c98c029d..7fa3559 100644
--- a/biometric/res/values-it/strings.xml
+++ b/biometric/res/values-it/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nessuna impronta digitale registrata."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Questo dispositivo non è dotato di sensore di impronte digitali"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Operazione di autenticazione dell\'impronta digitale annullata dall\'utente."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Errore sconosciuto"</string>
</resources>
diff --git a/biometric/res/values-iw/strings.xml b/biometric/res/values-iw/strings.xml
index c2564aa..6b7013b 100644
--- a/biometric/res/values-iw/strings.xml
+++ b/biometric/res/values-iw/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"לא נרשמו טביעות אצבע."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"במכשיר זה אין חיישן טביעות אצבע"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"פעולת טביעת האצבע בוטלה בידי המשתמש."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"שגיאה לא ידועה"</string>
</resources>
diff --git a/biometric/res/values-ja/strings.xml b/biometric/res/values-ja/strings.xml
index 2fb4cc1..9c0313f 100644
--- a/biometric/res/values-ja/strings.xml
+++ b/biometric/res/values-ja/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"指紋が登録されていません。"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"この端末には指紋認証センサーがありません"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"指紋認証操作がユーザーによりキャンセルされました。"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"不明なエラーです"</string>
</resources>
diff --git a/biometric/res/values-ka/strings.xml b/biometric/res/values-ka/strings.xml
index 6f4076e..fd13abf 100644
--- a/biometric/res/values-ka/strings.xml
+++ b/biometric/res/values-ka/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"თითის ანაბეჭდები არ არის რეგისტრირებული."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"ამ მოწყობილობას არ აქვს თითის ანაბეჭდის სენსორი"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"თითის ანაბეჭდის ოპერაცია გააუქმა მომხმარებელმა."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"უცნობი შეცდომა"</string>
</resources>
diff --git a/biometric/res/values-kk/strings.xml b/biometric/res/values-kk/strings.xml
index 4c6fb3e..3314d54 100644
--- a/biometric/res/values-kk/strings.xml
+++ b/biometric/res/values-kk/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Саусақ іздері тіркелмеген."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Бұл құрылғыда саусақ ізін оқу сканері жоқ"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Пайдаланушы саусақ ізі операциясынан бас тартты."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Белгісіз қате"</string>
</resources>
diff --git a/biometric/res/values-km/strings.xml b/biometric/res/values-km/strings.xml
index 613cc16..8604351 100644
--- a/biometric/res/values-km/strings.xml
+++ b/biometric/res/values-km/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"មិនមានការថតបញ្ចូលស្នាមម្រាមដៃទេ។"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"ឧបករណ៍នេះមិនមានឧបករណ៍ចាប់ស្នាមម្រាមដៃទេ"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"ប្រតិបត្តិការស្នាមម្រាមដៃត្រូវបានបោះបង់ដោយអ្នកប្រើប្រាស់។"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"មានបញ្ហាដែលមិនស្គាល់"</string>
</resources>
diff --git a/biometric/res/values-kn/strings.xml b/biometric/res/values-kn/strings.xml
index f773393..4e463f8 100644
--- a/biometric/res/values-kn/strings.xml
+++ b/biometric/res/values-kn/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"ಯಾವುದೇ ಫಿಂಗರ್ಪ್ರಿಂಟ್ ಅನ್ನು ನೋಂದಣಿ ಮಾಡಿಲ್ಲ."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"ಈ ಸಾಧನವು ಫಿಂಗರ್ಪ್ರಿಂಟ್ ಸೆನ್ಸಾರ್ ಅನ್ನು ಹೊಂದಿಲ್ಲ"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"ಬಳಕೆದಾರರಿಂದ ಫಿಂಗರ್ ಫ್ರಿಂಟ್ ಕಾರ್ಯಾಚರಣೆಯನ್ನು ರದ್ದುಪಡಿಸಲಾಗಿದೆ."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"ಅಪರಿಚಿತ ದೋಷ"</string>
</resources>
diff --git a/biometric/res/values-ko/strings.xml b/biometric/res/values-ko/strings.xml
index a34d50b..3c02691 100644
--- a/biometric/res/values-ko/strings.xml
+++ b/biometric/res/values-ko/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"등록된 지문이 없습니다."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"기기에 지문 센서가 없습니다."</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"사용자가 지문 인식 작업을 취소했습니다."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"알 수 없는 오류"</string>
</resources>
diff --git a/biometric/res/values-ky/strings.xml b/biometric/res/values-ky/strings.xml
index d08cbd7..d39aa24 100644
--- a/biometric/res/values-ky/strings.xml
+++ b/biometric/res/values-ky/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Бир да манжа изи катталган эмес."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Бул түзмөктө манжа изинин сенсору жок"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Манжа изи менен аныктыгын текшерүүнү колдонуучу жокко чыгарды."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Белгисиз ката"</string>
</resources>
diff --git a/biometric/res/values-lo/strings.xml b/biometric/res/values-lo/strings.xml
index 3934266..a21b2d1 100644
--- a/biometric/res/values-lo/strings.xml
+++ b/biometric/res/values-lo/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"ບໍ່ມີການລົງທະບຽນລາຍນິ້ວມື."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"ອຸປະກອນນີ້ບໍ່ມີເຊັນເຊີລາຍນິ້ວມື"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"ຜູ້ໃຊ້ໄດ້ຍົກເລີກຄຳສັ່ງລາຍນິ້ວມືແລ້ວ."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"ຄວາມຜິດພາດທີ່ບໍ່ຮູ້ຈັກ"</string>
</resources>
diff --git a/biometric/res/values-lt/strings.xml b/biometric/res/values-lt/strings.xml
index d1f68f8..b826be9 100644
--- a/biometric/res/values-lt/strings.xml
+++ b/biometric/res/values-lt/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Neužregistruota jokių kontrolinių kodų."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Šiame įrenginyje nėra piršto antspaudo jutiklio"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Piršto antspaudo operaciją atšaukė naudotojas."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Nežinoma klaida"</string>
</resources>
diff --git a/biometric/res/values-lv/strings.xml b/biometric/res/values-lv/strings.xml
index 1610693..8549e4c 100644
--- a/biometric/res/values-lv/strings.xml
+++ b/biometric/res/values-lv/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nav reģistrēts neviens pirksta nospiedums."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Šajā ierīcē nav pirksta nospieduma sensora"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Lietotājs atcēla pirksta nospieduma darbību."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Nezināma kļūda"</string>
</resources>
diff --git a/biometric/res/values-mk/strings.xml b/biometric/res/values-mk/strings.xml
index ecc1891..8c3c8a6 100644
--- a/biometric/res/values-mk/strings.xml
+++ b/biometric/res/values-mk/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Нема запишани отпечатоци."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Уредов нема сензор за отпечатоци"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Корисникот ја откажа потврдата со отпечаток."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Непозната грешка"</string>
</resources>
diff --git a/biometric/res/values-ml/strings.xml b/biometric/res/values-ml/strings.xml
index a95fdee..1383401 100644
--- a/biometric/res/values-ml/strings.xml
+++ b/biometric/res/values-ml/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"ഫിംഗർപ്രിന്റുകളൊന്നും എൻറോൾ ചെയ്തിട്ടില്ല."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"ഈ ഉപകരണത്തിൽ വിരലടയാള സെൻസർ ഇല്ല"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"ഫിംഗർപ്രിന്റിന്റെ പ്രവർത്തനം ഉപയോക്താവ് റദ്ദാക്കി."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"അജ്ഞാത പിശക്"</string>
</resources>
diff --git a/biometric/res/values-mn/strings.xml b/biometric/res/values-mn/strings.xml
index 50fb50e..4edd851 100644
--- a/biometric/res/values-mn/strings.xml
+++ b/biometric/res/values-mn/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Бүртгүүлсэн хурууны хээ алга байна."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Энэ төхөөрөмжид хурууны хээ мэдрэгч алга байна"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Хэрэглэгч хурууны хээний баталгаажуулалтыг болиулсан байна."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Тодорхойгүй алдаа гарлаа"</string>
</resources>
diff --git a/biometric/res/values-mr/strings.xml b/biometric/res/values-mr/strings.xml
index d3f28b15..ff79977 100644
--- a/biometric/res/values-mr/strings.xml
+++ b/biometric/res/values-mr/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"कोणत्याही फिंगरप्रिंटची नोंद झाली नाही."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"या डिव्हाइसवर फिंगरप्रिंट सेन्सर नाही"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"वापरकर्त्याने फिंगरप्रिंट ऑपरेशन रद्द केले."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"अज्ञात एरर"</string>
</resources>
diff --git a/biometric/res/values-ms/strings.xml b/biometric/res/values-ms/strings.xml
index c0d4c12..218a8a7 100644
--- a/biometric/res/values-ms/strings.xml
+++ b/biometric/res/values-ms/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Tiada cap jari didaftarkan."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Peranti ini tiada penderia cap jari"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Pengendalian cap jari dibatalkan oleh pengguna."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Ralat tidak diketahui"</string>
</resources>
diff --git a/biometric/res/values-my/strings.xml b/biometric/res/values-my/strings.xml
index aceb45d..57d02f2 100644
--- a/biometric/res/values-my/strings.xml
+++ b/biometric/res/values-my/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"မည်သည့် လက်ဗွေကိုမျှ ထည့်သွင်းမထားပါ။"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"ဤစက်ပစ္စည်းတွင် လက်ဗွေအာရုံခံကိရိယာ မရှိပါ"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"လက်ဗွေဖြင့် အထောက်အထားစိစစ်ခြင်းကို အသုံးပြုသူက ပယ်ဖျက်ထားသည်။"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"အမျိုးအမည်မသိ အမှား"</string>
</resources>
diff --git a/biometric/res/values-nb/strings.xml b/biometric/res/values-nb/strings.xml
index 632b548..a87282a 100644
--- a/biometric/res/values-nb/strings.xml
+++ b/biometric/res/values-nb/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Ingen fingeravtrykk er registrert."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Denne enheten har ikke fingeravtrykkssensor"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Fingeravtrykk-operasjonen ble avbrutt av brukeren."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Ukjent feil"</string>
</resources>
diff --git a/biometric/res/values-ne/strings.xml b/biometric/res/values-ne/strings.xml
index 9d8eebc..c09084f 100644
--- a/biometric/res/values-ne/strings.xml
+++ b/biometric/res/values-ne/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"कुनै पनि फिंगरप्रिन्ट दर्ता गरिएको छैन।"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"यो यन्त्रमा कुनै फिंगरप्रिन्ट सेन्सर छैन"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"प्रयोगकर्ताले फिंगरप्रिन्टसम्बन्धी कारबाही रद्द गर्नुभयो।"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"अज्ञात त्रुटि"</string>
</resources>
diff --git a/biometric/res/values-nl/strings.xml b/biometric/res/values-nl/strings.xml
index 96f85e5..f88f21d 100644
--- a/biometric/res/values-nl/strings.xml
+++ b/biometric/res/values-nl/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Geen vingerafdrukken geregistreerd."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Dit apparaat heeft geen vingerafdruksensor"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Vingerafdrukverificatie geannuleerd door gebruiker."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Onbekende fout"</string>
</resources>
diff --git a/biometric/res/values-or/strings.xml b/biometric/res/values-or/strings.xml
index 15cd436..8505536 100644
--- a/biometric/res/values-or/strings.xml
+++ b/biometric/res/values-or/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"କୌଣସି ଆଙ୍ଗୁଠି ଚିହ୍ନ ପଞ୍ଜୀକୃତ ହୋଇନାହିଁ।"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"ଏହି ଡିଭାଇସ୍ରେ ଆଙ୍ଗୁଠି ଚିହ୍ନ ସେନସର୍ ନାହିଁ"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"ୟୁଜର୍ଙ୍କ ଦ୍ଵାରା ଆଙ୍ଗୁଠି ଚିହ୍ନ ନେବା କାମକୁ କ୍ୟାନ୍ସଲ୍ କରିଦିଆଯାଇଛି।"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"ଅଜଣା ତ୍ରୁଟି"</string>
</resources>
diff --git a/biometric/res/values-pa/strings.xml b/biometric/res/values-pa/strings.xml
index 75aae0e..a9c8aca 100644
--- a/biometric/res/values-pa/strings.xml
+++ b/biometric/res/values-pa/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"ਕੋਈ ਫਿੰਗਰਪ੍ਰਿੰਟ ਦਰਜ ਨਹੀਂ ਕੀਤਾ ਗਿਆ।"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"ਇਸ ਡੀਵਾਈਸ ਵਿੱਚ ਫਿੰਗਰਪ੍ਰਿੰਟ ਸੈਂਸਰ ਨਹੀਂ ਹੈ"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"ਫਿੰਗਰਪ੍ਰਿੰਟ ਦੇ ਪੁਸ਼ਟੀਕਰਨ ਦੀ ਕਾਰਵਾਈ ਵਰਤੋਂਕਾਰ ਵੱਲੋਂ ਰੱਦ ਕੀਤੀ ਗਈ।"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"ਅਗਿਆਤ ਗੜਬੜ"</string>
</resources>
diff --git a/biometric/res/values-pl/strings.xml b/biometric/res/values-pl/strings.xml
index d29470e..aeba62e 100644
--- a/biometric/res/values-pl/strings.xml
+++ b/biometric/res/values-pl/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nie zarejestrowano odcisków palców."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"To urządzenie nie jest wyposażone w czytnik linii papilarnych"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Odczyt odcisku palca został anulowany przez użytkownika."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Nieznany błąd"</string>
</resources>
diff --git a/biometric/res/values-pt-rBR/strings.xml b/biometric/res/values-pt-rBR/strings.xml
index 15147b9b..1edb6b7 100644
--- a/biometric/res/values-pt-rBR/strings.xml
+++ b/biometric/res/values-pt-rBR/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nenhuma impressão digital registrada."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Este dispositivo não tem um sensor de impressão digital"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Operação de impressão digital cancelada pelo usuário."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Erro desconhecido"</string>
</resources>
diff --git a/biometric/res/values-pt-rPT/strings.xml b/biometric/res/values-pt-rPT/strings.xml
index 1215739..753ae64 100644
--- a/biometric/res/values-pt-rPT/strings.xml
+++ b/biometric/res/values-pt-rPT/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nenhuma impressão digital registada."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Este dispositivo não tem sensor de impressões digitais."</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Operação de impressão digital cancelada pelo utilizador."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Erro desconhecido."</string>
</resources>
diff --git a/biometric/res/values-pt/strings.xml b/biometric/res/values-pt/strings.xml
index 15147b9b..1edb6b7 100644
--- a/biometric/res/values-pt/strings.xml
+++ b/biometric/res/values-pt/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nenhuma impressão digital registrada."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Este dispositivo não tem um sensor de impressão digital"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Operação de impressão digital cancelada pelo usuário."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Erro desconhecido"</string>
</resources>
diff --git a/biometric/res/values-ro/strings.xml b/biometric/res/values-ro/strings.xml
index f4e2b7c..c454e3b 100644
--- a/biometric/res/values-ro/strings.xml
+++ b/biometric/res/values-ro/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nu au fost înregistrate amprente digitale."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Acest dispozitiv nu are senzor de amprentă"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Operațiunea privind amprenta digitală a fost anulată de utilizator."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Eroare necunoscută"</string>
</resources>
diff --git a/biometric/res/values-ru/strings.xml b/biometric/res/values-ru/strings.xml
index 2d3fdf5..bc1c55e 100644
--- a/biometric/res/values-ru/strings.xml
+++ b/biometric/res/values-ru/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Нет отсканированных отпечатков пальцев."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"На этом устройстве нет сканера отпечатков пальцев."</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Операция с отпечатком пальца отменена пользователем."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Неизвестная ошибка"</string>
</resources>
diff --git a/biometric/res/values-si/strings.xml b/biometric/res/values-si/strings.xml
index b30705e..7452c82 100644
--- a/biometric/res/values-si/strings.xml
+++ b/biometric/res/values-si/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"ඇඟිලි සලකුණු ඇතුළත් කර නොමැත."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"මෙම උපාංගයේ ඇඟිලි සලකුණු සංවේදකයක් නොමැත"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"පරිශීලක විසින් ඇඟිලි සලකුණු මෙහෙයුම අවසන් කරන ලදී."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"නොදන්නා දෝෂයකි"</string>
</resources>
diff --git a/biometric/res/values-sk/strings.xml b/biometric/res/values-sk/strings.xml
index 8644574..c191dd1 100644
--- a/biometric/res/values-sk/strings.xml
+++ b/biometric/res/values-sk/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Neregistrovali ste žiadne odtlačky prstov."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Toto zariadenie nemá senzor odtlačkov prstov"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Overenie odtlačku prsta zrušil používateľ."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Neznáma chyba"</string>
</resources>
diff --git a/biometric/res/values-sl/strings.xml b/biometric/res/values-sl/strings.xml
index ad901fa..540f92a 100644
--- a/biometric/res/values-sl/strings.xml
+++ b/biometric/res/values-sl/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Ni prijavljenih prstnih odtisov."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Ta naprava nima tipala prstnih odtisov"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Dejanje s prstnim odtisom je preklical uporabnik."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Neznana napaka"</string>
</resources>
diff --git a/biometric/res/values-sq/strings.xml b/biometric/res/values-sq/strings.xml
index 936e73a..21ca19c 100644
--- a/biometric/res/values-sq/strings.xml
+++ b/biometric/res/values-sq/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Nuk ka asnjë gjurmë gishti të regjistruar."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Kjo pajisje nuk ka një sensor të gjurmës së gishtit"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Veprimi i gjurmës së gishtit u anulua nga përdoruesi."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Gabim i panjohur"</string>
</resources>
diff --git a/biometric/res/values-sr/strings.xml b/biometric/res/values-sr/strings.xml
index 54774f9..a4266c7 100644
--- a/biometric/res/values-sr/strings.xml
+++ b/biometric/res/values-sr/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Није регистрован ниједан отисак прста."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Овај уређај нема сензор за отисак прста"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Корисник је отказао радњу са отиском прста."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Непозната грешка"</string>
</resources>
diff --git a/biometric/res/values-sv/strings.xml b/biometric/res/values-sv/strings.xml
index 137ca17..89cae3f 100644
--- a/biometric/res/values-sv/strings.xml
+++ b/biometric/res/values-sv/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Inga fingeravtryck har registrerats."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Enheten har ingen fingeravtryckssensor"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Fingeravtrycksåtgärden avbröts av användaren."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Okänt fel"</string>
</resources>
diff --git a/biometric/res/values-sw/strings.xml b/biometric/res/values-sw/strings.xml
index 01b2dae..fe3bc55 100644
--- a/biometric/res/values-sw/strings.xml
+++ b/biometric/res/values-sw/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Hakuna alama za vidole zilizojumuishwa."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Kifaa hiki hakina kitambua alama ya kidole"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Mtumiaji ameghairi uthibitishaji wa alama ya kidole."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Hitilafu isiyojulikana"</string>
</resources>
diff --git a/biometric/res/values-ta/strings.xml b/biometric/res/values-ta/strings.xml
index ad90b59..1aa662d 100644
--- a/biometric/res/values-ta/strings.xml
+++ b/biometric/res/values-ta/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"கைரேகைப் பதிவுகள் எதுவுமில்லை."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"இந்தச் சாதனத்தில் கைரேகை சென்சார் இல்லை"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"கைரேகைச் சரிபார்ப்பு பயனரால் ரத்துசெய்யப்பட்டது."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"அறியப்படாத பிழை"</string>
</resources>
diff --git a/biometric/res/values-te/strings.xml b/biometric/res/values-te/strings.xml
index c79a410..d995f7b 100644
--- a/biometric/res/values-te/strings.xml
+++ b/biometric/res/values-te/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"వేలిముద్రలు నమోదు చేయబడలేదు."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"ఈ పరికరంలో వేలిముద్ర సెన్సార్ లేదు"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"వేలిముద్ర చర్యని వినియోగదారు రద్దు చేసారు."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"తెలియని ఎర్రర్"</string>
</resources>
diff --git a/biometric/res/values-th/strings.xml b/biometric/res/values-th/strings.xml
index ff9d9fe..b4181eb 100644
--- a/biometric/res/values-th/strings.xml
+++ b/biometric/res/values-th/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"ไม่มีลายนิ้วมือที่ลงทะเบียน"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"อุปกรณ์นี้ไม่มีเซ็นเซอร์ลายนิ้วมือ"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"ผู้ใช้ยกเลิกการทำงานของลายนิ้วมือ"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"ข้อผิดพลาดที่ไม่รู้จัก"</string>
</resources>
diff --git a/biometric/res/values-tl/strings.xml b/biometric/res/values-tl/strings.xml
index 39c34b4..c42150b 100644
--- a/biometric/res/values-tl/strings.xml
+++ b/biometric/res/values-tl/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Walang naka-enroll na fingerprint."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Walang sensor para sa fingerprint ang device na ito"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Kinansela ng user ang operasyon sa fingerprint."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Hindi alam na error"</string>
</resources>
diff --git a/biometric/res/values-tr/strings.xml b/biometric/res/values-tr/strings.xml
index 7313323..25c6f3e 100644
--- a/biometric/res/values-tr/strings.xml
+++ b/biometric/res/values-tr/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Parmak izi kaydedilmedi."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Bu cihazda parmak izi sensörü yok"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Parmak izi işlemi kullanıcı tarafından iptal edildi."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Bilinmeyen hata"</string>
</resources>
diff --git a/biometric/res/values-uk/strings.xml b/biometric/res/values-uk/strings.xml
index 91950cb..d54d84e 100644
--- a/biometric/res/values-uk/strings.xml
+++ b/biometric/res/values-uk/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Відбитки пальців не зареєстровано."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"На цьому пристрої немає сканера відбитків пальців"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Користувач скасував дію з відбитком пальця."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Невідома помилка"</string>
</resources>
diff --git a/biometric/res/values-ur/strings.xml b/biometric/res/values-ur/strings.xml
index f4080bc..183145d 100644
--- a/biometric/res/values-ur/strings.xml
+++ b/biometric/res/values-ur/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"کوئی فنگر پرنٹ مندرج نہیں ہے۔"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"اس آلہ میں فنگر پرنٹ سینسر نہیں ہے"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"صارف نے فنگر پرنٹ کی کارروائی منسوخ کر دی۔"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"نامعلوم خرابی"</string>
</resources>
diff --git a/biometric/res/values-uz/strings.xml b/biometric/res/values-uz/strings.xml
index b196b86..c20a855 100644
--- a/biometric/res/values-uz/strings.xml
+++ b/biometric/res/values-uz/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Hech qanday barmoq izi qayd qilinmagan."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Bu qurilmada barmoq izi skaneri yo‘q"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Barmoq izi amali foydalanuvchi tomonidan bekor qilindi"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Notanish xato"</string>
</resources>
diff --git a/biometric/res/values-vi/strings.xml b/biometric/res/values-vi/strings.xml
index 793d91c..34e633e 100644
--- a/biometric/res/values-vi/strings.xml
+++ b/biometric/res/values-vi/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Chưa đăng ký vân tay."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Thiết bị này không có cảm biến vân tay"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Người dùng đã hủy thao tác dùng dấu vân tay."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Lỗi không xác định"</string>
</resources>
diff --git a/biometric/res/values-zh-rCN/strings.xml b/biometric/res/values-zh-rCN/strings.xml
index 0ba283e..58f5946 100644
--- a/biometric/res/values-zh-rCN/strings.xml
+++ b/biometric/res/values-zh-rCN/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"未注册任何指纹。"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"此设备没有指纹传感器"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"用户取消了指纹操作。"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"未知错误"</string>
</resources>
diff --git a/biometric/res/values-zh-rHK/strings.xml b/biometric/res/values-zh-rHK/strings.xml
index 5505c67..4fe7001 100644
--- a/biometric/res/values-zh-rHK/strings.xml
+++ b/biometric/res/values-zh-rHK/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"尚未註冊任何指紋。"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"此裝置沒有指紋感應器"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"使用者已取消指紋操作。"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"不明錯誤"</string>
</resources>
diff --git a/biometric/res/values-zh-rTW/strings.xml b/biometric/res/values-zh-rTW/strings.xml
index 19a2741..9521b24 100644
--- a/biometric/res/values-zh-rTW/strings.xml
+++ b/biometric/res/values-zh-rTW/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"未登錄任何指紋。"</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"這個裝置沒有指紋感應器"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"使用者已取消指紋驗證作業。"</string>
- <string name="default_error_msg" msgid="7497355367608150274">"不明的錯誤"</string>
</resources>
diff --git a/biometric/res/values-zu/strings.xml b/biometric/res/values-zu/strings.xml
index cfbb892..14b42e2 100644
--- a/biometric/res/values-zu/strings.xml
+++ b/biometric/res/values-zu/strings.xml
@@ -24,5 +24,4 @@
<string name="fingerprint_error_no_fingerprints" msgid="3350805046152877040">"Azikho izigxivizo zeminwe ezibhalisiwe."</string>
<string name="fingerprint_error_hw_not_present" msgid="1176237289575184578">"Le divayisi ayinayo inzwa yezigxivizo zeminwe"</string>
<string name="fingerprint_error_user_canceled" msgid="3421037373085129417">"Umsebenzi wesigxivizo somunwe sikhanselwe umsebenzisi."</string>
- <string name="default_error_msg" msgid="7497355367608150274">"Iphutha elingaziwe"</string>
</resources>
diff --git a/biometric/src/main/java/androidx/biometric/BiometricPrompt.java b/biometric/src/main/java/androidx/biometric/BiometricPrompt.java
index da6bf70..f2f37b8 100644
--- a/biometric/src/main/java/androidx/biometric/BiometricPrompt.java
+++ b/biometric/src/main/java/androidx/biometric/BiometricPrompt.java
@@ -469,9 +469,9 @@
// Create the fragment that wraps BiometricPrompt once.
if (mBiometricFragment == null) {
mBiometricFragment = BiometricFragment.newInstance();
+ mBiometricFragment.setCallbacks(mExecutor, mNegativeButtonListener,
+ mAuthenticationCallback);
}
- mBiometricFragment.setCallbacks(mExecutor, mNegativeButtonListener,
- mAuthenticationCallback);
// Set the crypto object.
mBiometricFragment.setCryptoObject(crypto);
mBiometricFragment.setBundle(bundle);
@@ -489,16 +489,16 @@
// Create the UI
if (mFingerprintDialogFragment == null) {
mFingerprintDialogFragment = FingerprintDialogFragment.newInstance();
+ mFingerprintDialogFragment.setNegativeButtonListener(mNegativeButtonListener);
}
- mFingerprintDialogFragment.setNegativeButtonListener(mNegativeButtonListener);
mFingerprintDialogFragment.setBundle(bundle);
mFingerprintDialogFragment.show(fragmentManager, DIALOG_FRAGMENT_TAG);
// Create the connection to FingerprintManager
if (mFingerprintHelperFragment == null) {
mFingerprintHelperFragment = FingerprintHelperFragment.newInstance();
+ mFingerprintHelperFragment.setCallback(mExecutor, mAuthenticationCallback);
}
- mFingerprintHelperFragment.setCallback(mExecutor, mAuthenticationCallback);
mFingerprintHelperFragment.setHandler(mFingerprintDialogFragment.getHandler());
mFingerprintHelperFragment.setCryptoObject(crypto);
diff --git a/browser/OWNERS b/browser/OWNERS
index b6d0e07..a0bf18a 100644
--- a/browser/OWNERS
+++ b/browser/OWNERS
@@ -1,2 +1,2 @@
lizeb@google.com
-peconn@google.com
+yusufo@google.com
\ No newline at end of file
diff --git a/browser/api/1.0.0.txt b/browser/api/1.0.0.txt
new file mode 100644
index 0000000..06890b2
--- /dev/null
+++ b/browser/api/1.0.0.txt
@@ -0,0 +1,209 @@
+// Signature format: 2.0
+package androidx.browser.browseractions {
+
+ public class BrowserActionItem {
+ ctor public BrowserActionItem(String, android.app.PendingIntent, @DrawableRes int);
+ ctor public BrowserActionItem(String, android.app.PendingIntent);
+ method public android.app.PendingIntent! getAction();
+ method public int getIconId();
+ method public String! getTitle();
+ }
+
+ public class BrowserActionsIntent {
+ method public static String! getCreatorPackageName(android.content.Intent!);
+ method public android.content.Intent getIntent();
+ method public static void launchIntent(android.content.Context!, android.content.Intent!);
+ method public static void openBrowserAction(android.content.Context!, android.net.Uri!);
+ method public static void openBrowserAction(android.content.Context!, android.net.Uri!, int, java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem>!, android.app.PendingIntent!);
+ method public static java.util.List<androidx.browser.browseractions.BrowserActionItem>! parseBrowserActionItems(java.util.ArrayList<android.os.Bundle>!);
+ field public static final String ACTION_BROWSER_ACTIONS_OPEN = "androidx.browser.browseractions.browser_action_open";
+ field public static final String EXTRA_APP_ID = "androidx.browser.browseractions.APP_ID";
+ field public static final String EXTRA_MENU_ITEMS = "androidx.browser.browseractions.extra.MENU_ITEMS";
+ field public static final String EXTRA_SELECTED_ACTION_PENDING_INTENT = "androidx.browser.browseractions.extra.SELECTED_ACTION_PENDING_INTENT";
+ field public static final String EXTRA_TYPE = "androidx.browser.browseractions.extra.TYPE";
+ field public static final int ITEM_COPY = 3; // 0x3
+ field public static final int ITEM_DOWNLOAD = 2; // 0x2
+ field public static final int ITEM_INVALID_ITEM = -1; // 0xffffffff
+ field public static final int ITEM_OPEN_IN_INCOGNITO = 1; // 0x1
+ field public static final int ITEM_OPEN_IN_NEW_TAB = 0; // 0x0
+ field public static final int ITEM_SHARE = 4; // 0x4
+ field public static final String KEY_ACTION = "androidx.browser.browseractions.ACTION";
+ field public static final String KEY_ICON_ID = "androidx.browser.browseractions.ICON_ID";
+ field public static final String KEY_TITLE = "androidx.browser.browseractions.TITLE";
+ field public static final int MAX_CUSTOM_ITEMS = 5; // 0x5
+ field public static final int URL_TYPE_AUDIO = 3; // 0x3
+ field public static final int URL_TYPE_FILE = 4; // 0x4
+ field public static final int URL_TYPE_IMAGE = 1; // 0x1
+ field public static final int URL_TYPE_NONE = 0; // 0x0
+ field public static final int URL_TYPE_PLUGIN = 5; // 0x5
+ field public static final int URL_TYPE_VIDEO = 2; // 0x2
+ }
+
+ public static final class BrowserActionsIntent.Builder {
+ ctor public BrowserActionsIntent.Builder(android.content.Context!, android.net.Uri!);
+ method public androidx.browser.browseractions.BrowserActionsIntent! build();
+ method public androidx.browser.browseractions.BrowserActionsIntent.Builder! setCustomItems(java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem>!);
+ method public androidx.browser.browseractions.BrowserActionsIntent.Builder! setCustomItems(androidx.browser.browseractions.BrowserActionItem...!);
+ method public androidx.browser.browseractions.BrowserActionsIntent.Builder! setOnItemSelectedAction(android.app.PendingIntent!);
+ method public androidx.browser.browseractions.BrowserActionsIntent.Builder! setUrlType(int);
+ }
+
+}
+
+package androidx.browser.customtabs {
+
+ public class CustomTabsCallback {
+ ctor public CustomTabsCallback();
+ method public void extraCallback(String!, android.os.Bundle!);
+ method public void onMessageChannelReady(android.os.Bundle!);
+ method public void onNavigationEvent(int, android.os.Bundle!);
+ method public void onPostMessage(String!, android.os.Bundle!);
+ method public void onRelationshipValidationResult(@androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri!, boolean, android.os.Bundle!);
+ field public static final int NAVIGATION_ABORTED = 4; // 0x4
+ field public static final int NAVIGATION_FAILED = 3; // 0x3
+ field public static final int NAVIGATION_FINISHED = 2; // 0x2
+ field public static final int NAVIGATION_STARTED = 1; // 0x1
+ field public static final int TAB_HIDDEN = 6; // 0x6
+ field public static final int TAB_SHOWN = 5; // 0x5
+ }
+
+ public class CustomTabsClient {
+ method public static boolean bindCustomTabsService(android.content.Context!, String!, androidx.browser.customtabs.CustomTabsServiceConnection!);
+ method public static boolean connectAndInitialize(android.content.Context!, String!);
+ method public android.os.Bundle! extraCommand(String!, android.os.Bundle!);
+ method public static String! getPackageName(android.content.Context!, java.util.List<java.lang.String>?);
+ method public static String! getPackageName(android.content.Context!, java.util.List<java.lang.String>?, boolean);
+ method public androidx.browser.customtabs.CustomTabsSession! newSession(androidx.browser.customtabs.CustomTabsCallback!);
+ method public boolean warmup(long);
+ }
+
+ public final class CustomTabsIntent {
+ method public static int getMaxToolbarItems();
+ method public void launchUrl(android.content.Context!, android.net.Uri!);
+ method public static android.content.Intent! setAlwaysUseBrowserUI(android.content.Intent!);
+ method public static boolean shouldAlwaysUseBrowserUI(android.content.Intent!);
+ field public static final String EXTRA_ACTION_BUTTON_BUNDLE = "android.support.customtabs.extra.ACTION_BUTTON_BUNDLE";
+ field public static final String EXTRA_CLOSE_BUTTON_ICON = "android.support.customtabs.extra.CLOSE_BUTTON_ICON";
+ field public static final String EXTRA_DEFAULT_SHARE_MENU_ITEM = "android.support.customtabs.extra.SHARE_MENU_ITEM";
+ field public static final String EXTRA_ENABLE_INSTANT_APPS = "android.support.customtabs.extra.EXTRA_ENABLE_INSTANT_APPS";
+ field public static final String EXTRA_ENABLE_URLBAR_HIDING = "android.support.customtabs.extra.ENABLE_URLBAR_HIDING";
+ field public static final String EXTRA_EXIT_ANIMATION_BUNDLE = "android.support.customtabs.extra.EXIT_ANIMATION_BUNDLE";
+ field public static final String EXTRA_MENU_ITEMS = "android.support.customtabs.extra.MENU_ITEMS";
+ field public static final String EXTRA_REMOTEVIEWS = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS";
+ field public static final String EXTRA_REMOTEVIEWS_CLICKED_ID = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_CLICKED_ID";
+ field public static final String EXTRA_REMOTEVIEWS_PENDINGINTENT = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_PENDINGINTENT";
+ field public static final String EXTRA_REMOTEVIEWS_VIEW_IDS = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_VIEW_IDS";
+ field public static final String EXTRA_SECONDARY_TOOLBAR_COLOR = "android.support.customtabs.extra.SECONDARY_TOOLBAR_COLOR";
+ field public static final String EXTRA_SESSION = "android.support.customtabs.extra.SESSION";
+ field public static final String EXTRA_TINT_ACTION_BUTTON = "android.support.customtabs.extra.TINT_ACTION_BUTTON";
+ field public static final String EXTRA_TITLE_VISIBILITY_STATE = "android.support.customtabs.extra.TITLE_VISIBILITY";
+ field public static final String EXTRA_TOOLBAR_COLOR = "android.support.customtabs.extra.TOOLBAR_COLOR";
+ field public static final String EXTRA_TOOLBAR_ITEMS = "android.support.customtabs.extra.TOOLBAR_ITEMS";
+ field public static final String KEY_DESCRIPTION = "android.support.customtabs.customaction.DESCRIPTION";
+ field public static final String KEY_ICON = "android.support.customtabs.customaction.ICON";
+ field public static final String KEY_ID = "android.support.customtabs.customaction.ID";
+ field public static final String KEY_MENU_ITEM_TITLE = "android.support.customtabs.customaction.MENU_ITEM_TITLE";
+ field public static final String KEY_PENDING_INTENT = "android.support.customtabs.customaction.PENDING_INTENT";
+ field public static final int NO_TITLE = 0; // 0x0
+ field public static final int SHOW_PAGE_TITLE = 1; // 0x1
+ field public static final int TOOLBAR_ACTION_BUTTON_ID = 0; // 0x0
+ field public final android.content.Intent intent;
+ field public final android.os.Bundle? startAnimationBundle;
+ }
+
+ public static final class CustomTabsIntent.Builder {
+ ctor public CustomTabsIntent.Builder();
+ ctor public CustomTabsIntent.Builder(androidx.browser.customtabs.CustomTabsSession?);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! addDefaultShareMenuItem();
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! addMenuItem(String, android.app.PendingIntent);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder! addToolbarItem(int, android.graphics.Bitmap, String, android.app.PendingIntent!) throws java.lang.IllegalStateException;
+ method public androidx.browser.customtabs.CustomTabsIntent! build();
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! enableUrlBarHiding();
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent, boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setCloseButtonIcon(android.graphics.Bitmap);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setExitAnimations(android.content.Context, @AnimRes int, @AnimRes int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setInstantAppsEnabled(boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setSecondaryToolbarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setSecondaryToolbarViews(android.widget.RemoteViews, int[]?, android.app.PendingIntent?);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setShowTitle(boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setStartAnimations(android.content.Context, @AnimRes int, @AnimRes int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setToolbarColor(@ColorInt int);
+ }
+
+ public abstract class CustomTabsService extends android.app.Service {
+ ctor public CustomTabsService();
+ method protected boolean cleanUpSession(androidx.browser.customtabs.CustomTabsSessionToken!);
+ method protected abstract android.os.Bundle! extraCommand(String!, android.os.Bundle!);
+ method protected abstract boolean mayLaunchUrl(androidx.browser.customtabs.CustomTabsSessionToken!, android.net.Uri!, android.os.Bundle!, java.util.List<android.os.Bundle>!);
+ method protected abstract boolean newSession(androidx.browser.customtabs.CustomTabsSessionToken!);
+ method public android.os.IBinder! onBind(android.content.Intent!);
+ method @androidx.browser.customtabs.CustomTabsService.Result protected abstract int postMessage(androidx.browser.customtabs.CustomTabsSessionToken!, String!, android.os.Bundle!);
+ method protected abstract boolean requestPostMessageChannel(androidx.browser.customtabs.CustomTabsSessionToken!, android.net.Uri!);
+ method protected abstract boolean updateVisuals(androidx.browser.customtabs.CustomTabsSessionToken!, android.os.Bundle!);
+ method protected abstract boolean validateRelationship(androidx.browser.customtabs.CustomTabsSessionToken!, @androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri!, android.os.Bundle!);
+ method protected abstract boolean warmup(long);
+ field public static final String ACTION_CUSTOM_TABS_CONNECTION = "android.support.customtabs.action.CustomTabsService";
+ field public static final String KEY_URL = "android.support.customtabs.otherurls.URL";
+ field public static final int RELATION_HANDLE_ALL_URLS = 2; // 0x2
+ field public static final int RELATION_USE_AS_ORIGIN = 1; // 0x1
+ field public static final int RESULT_FAILURE_DISALLOWED = -1; // 0xffffffff
+ field public static final int RESULT_FAILURE_MESSAGING_ERROR = -3; // 0xfffffffd
+ field public static final int RESULT_FAILURE_REMOTE_ERROR = -2; // 0xfffffffe
+ field public static final int RESULT_SUCCESS = 0; // 0x0
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({androidx.browser.customtabs.CustomTabsService.RELATION_USE_AS_ORIGIN, androidx.browser.customtabs.CustomTabsService.RELATION_HANDLE_ALL_URLS}) public static @interface CustomTabsService.Relation {
+ }
+
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({androidx.browser.customtabs.CustomTabsService.RESULT_SUCCESS, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_DISALLOWED, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_REMOTE_ERROR, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_MESSAGING_ERROR}) public static @interface CustomTabsService.Result {
+ }
+
+ public abstract class CustomTabsServiceConnection implements android.content.ServiceConnection {
+ ctor public CustomTabsServiceConnection();
+ method public abstract void onCustomTabsServiceConnected(android.content.ComponentName!, androidx.browser.customtabs.CustomTabsClient!);
+ method public final void onServiceConnected(android.content.ComponentName!, android.os.IBinder!);
+ }
+
+ public final class CustomTabsSession {
+ method @VisibleForTesting public static androidx.browser.customtabs.CustomTabsSession createMockSessionForTesting(android.content.ComponentName);
+ method public boolean mayLaunchUrl(android.net.Uri!, android.os.Bundle!, java.util.List<android.os.Bundle>!);
+ method @androidx.browser.customtabs.CustomTabsService.Result public int postMessage(String!, android.os.Bundle!);
+ method public boolean requestPostMessageChannel(android.net.Uri!);
+ method public boolean setActionButton(android.graphics.Bitmap, String);
+ method public boolean setSecondaryToolbarViews(android.widget.RemoteViews?, int[]?, android.app.PendingIntent?);
+ method @Deprecated public boolean setToolbarItem(int, android.graphics.Bitmap, String);
+ method public boolean validateRelationship(@androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri, android.os.Bundle?);
+ }
+
+ public class CustomTabsSessionToken {
+ method public static androidx.browser.customtabs.CustomTabsSessionToken createMockSessionTokenForTesting();
+ method public androidx.browser.customtabs.CustomTabsCallback! getCallback();
+ method public static androidx.browser.customtabs.CustomTabsSessionToken! getSessionTokenFromIntent(android.content.Intent!);
+ method public boolean isAssociatedWith(androidx.browser.customtabs.CustomTabsSession!);
+ }
+
+ public class PostMessageService extends android.app.Service {
+ ctor public PostMessageService();
+ method public android.os.IBinder! onBind(android.content.Intent!);
+ }
+
+ public abstract class PostMessageServiceConnection implements android.content.ServiceConnection {
+ ctor public PostMessageServiceConnection(androidx.browser.customtabs.CustomTabsSessionToken!);
+ method public boolean bindSessionToPostMessageService(android.content.Context!, String!);
+ method public final boolean notifyMessageChannelReady(android.os.Bundle!);
+ method public void onPostMessageServiceConnected();
+ method public void onPostMessageServiceDisconnected();
+ method public final void onServiceConnected(android.content.ComponentName!, android.os.IBinder!);
+ method public final void onServiceDisconnected(android.content.ComponentName!);
+ method public final boolean postMessage(String!, android.os.Bundle!);
+ method public void unbindFromContext(android.content.Context!);
+ }
+
+ public class TrustedWebUtils {
+ method public static void launchAsTrustedWebActivity(android.content.Context, androidx.browser.customtabs.CustomTabsIntent, android.net.Uri);
+ field public static final String EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY = "android.support.customtabs.extra.LAUNCH_AS_TRUSTED_WEB_ACTIVITY";
+ }
+
+}
+
diff --git a/browser/api/1.1.0-alpha01.txt b/browser/api/1.1.0-alpha01.txt
deleted file mode 100644
index 6d5793a..0000000
--- a/browser/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,210 +0,0 @@
-// Signature format: 3.0
-package androidx.browser.browseractions {
-
- public class BrowserActionItem {
- ctor public BrowserActionItem(String, android.app.PendingIntent, @DrawableRes int);
- ctor public BrowserActionItem(String, android.app.PendingIntent);
- method public android.app.PendingIntent getAction();
- method public int getIconId();
- method public String getTitle();
- }
-
- public class BrowserActionsIntent {
- method @Deprecated public static String? getCreatorPackageName(android.content.Intent);
- method public android.content.Intent getIntent();
- method public static String? getUntrustedCreatorPackageName(android.content.Intent);
- method public static void launchIntent(android.content.Context!, android.content.Intent!);
- method public static void openBrowserAction(android.content.Context!, android.net.Uri!);
- method public static void openBrowserAction(android.content.Context!, android.net.Uri!, int, java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem>!, android.app.PendingIntent!);
- method public static java.util.List<androidx.browser.browseractions.BrowserActionItem>! parseBrowserActionItems(java.util.ArrayList<android.os.Bundle>!);
- field public static final String ACTION_BROWSER_ACTIONS_OPEN = "androidx.browser.browseractions.browser_action_open";
- field public static final String EXTRA_APP_ID = "androidx.browser.browseractions.APP_ID";
- field public static final String EXTRA_MENU_ITEMS = "androidx.browser.browseractions.extra.MENU_ITEMS";
- field public static final String EXTRA_SELECTED_ACTION_PENDING_INTENT = "androidx.browser.browseractions.extra.SELECTED_ACTION_PENDING_INTENT";
- field public static final String EXTRA_TYPE = "androidx.browser.browseractions.extra.TYPE";
- field public static final int ITEM_COPY = 3; // 0x3
- field public static final int ITEM_DOWNLOAD = 2; // 0x2
- field public static final int ITEM_INVALID_ITEM = -1; // 0xffffffff
- field public static final int ITEM_OPEN_IN_INCOGNITO = 1; // 0x1
- field public static final int ITEM_OPEN_IN_NEW_TAB = 0; // 0x0
- field public static final int ITEM_SHARE = 4; // 0x4
- field public static final String KEY_ACTION = "androidx.browser.browseractions.ACTION";
- field public static final String KEY_ICON_ID = "androidx.browser.browseractions.ICON_ID";
- field public static final String KEY_TITLE = "androidx.browser.browseractions.TITLE";
- field public static final int MAX_CUSTOM_ITEMS = 5; // 0x5
- field public static final int URL_TYPE_AUDIO = 3; // 0x3
- field public static final int URL_TYPE_FILE = 4; // 0x4
- field public static final int URL_TYPE_IMAGE = 1; // 0x1
- field public static final int URL_TYPE_NONE = 0; // 0x0
- field public static final int URL_TYPE_PLUGIN = 5; // 0x5
- field public static final int URL_TYPE_VIDEO = 2; // 0x2
- }
-
- public static final class BrowserActionsIntent.Builder {
- ctor public BrowserActionsIntent.Builder(android.content.Context!, android.net.Uri!);
- method public androidx.browser.browseractions.BrowserActionsIntent! build();
- method public androidx.browser.browseractions.BrowserActionsIntent.Builder! setCustomItems(java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem>!);
- method public androidx.browser.browseractions.BrowserActionsIntent.Builder! setCustomItems(androidx.browser.browseractions.BrowserActionItem...!);
- method public androidx.browser.browseractions.BrowserActionsIntent.Builder! setOnItemSelectedAction(android.app.PendingIntent!);
- method public androidx.browser.browseractions.BrowserActionsIntent.Builder! setUrlType(int);
- }
-
-}
-
-package androidx.browser.customtabs {
-
- public class CustomTabsCallback {
- ctor public CustomTabsCallback();
- method public void extraCallback(String!, android.os.Bundle!);
- method public void onMessageChannelReady(android.os.Bundle!);
- method public void onNavigationEvent(int, android.os.Bundle!);
- method public void onPostMessage(String!, android.os.Bundle!);
- method public void onRelationshipValidationResult(@androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri!, boolean, android.os.Bundle!);
- field public static final int NAVIGATION_ABORTED = 4; // 0x4
- field public static final int NAVIGATION_FAILED = 3; // 0x3
- field public static final int NAVIGATION_FINISHED = 2; // 0x2
- field public static final int NAVIGATION_STARTED = 1; // 0x1
- field public static final int TAB_HIDDEN = 6; // 0x6
- field public static final int TAB_SHOWN = 5; // 0x5
- }
-
- public class CustomTabsClient {
- method public static boolean bindCustomTabsService(android.content.Context!, String!, androidx.browser.customtabs.CustomTabsServiceConnection!);
- method public static boolean connectAndInitialize(android.content.Context!, String!);
- method public android.os.Bundle! extraCommand(String!, android.os.Bundle!);
- method public static String! getPackageName(android.content.Context!, java.util.List<java.lang.String>?);
- method public static String? getPackageName(android.content.Context, java.util.List<java.lang.String>?, boolean);
- method public androidx.browser.customtabs.CustomTabsSession! newSession(androidx.browser.customtabs.CustomTabsCallback!);
- method public boolean warmup(long);
- }
-
- public final class CustomTabsIntent {
- method public static int getMaxToolbarItems();
- method public void launchUrl(android.content.Context!, android.net.Uri!);
- method public static android.content.Intent! setAlwaysUseBrowserUI(android.content.Intent!);
- method public static boolean shouldAlwaysUseBrowserUI(android.content.Intent!);
- field public static final String EXTRA_ACTION_BUTTON_BUNDLE = "android.support.customtabs.extra.ACTION_BUTTON_BUNDLE";
- field public static final String EXTRA_CLOSE_BUTTON_ICON = "android.support.customtabs.extra.CLOSE_BUTTON_ICON";
- field public static final String EXTRA_DEFAULT_SHARE_MENU_ITEM = "android.support.customtabs.extra.SHARE_MENU_ITEM";
- field public static final String EXTRA_ENABLE_INSTANT_APPS = "android.support.customtabs.extra.EXTRA_ENABLE_INSTANT_APPS";
- field public static final String EXTRA_ENABLE_URLBAR_HIDING = "android.support.customtabs.extra.ENABLE_URLBAR_HIDING";
- field public static final String EXTRA_EXIT_ANIMATION_BUNDLE = "android.support.customtabs.extra.EXIT_ANIMATION_BUNDLE";
- field public static final String EXTRA_MENU_ITEMS = "android.support.customtabs.extra.MENU_ITEMS";
- field public static final String EXTRA_REMOTEVIEWS = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS";
- field public static final String EXTRA_REMOTEVIEWS_CLICKED_ID = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_CLICKED_ID";
- field public static final String EXTRA_REMOTEVIEWS_PENDINGINTENT = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_PENDINGINTENT";
- field public static final String EXTRA_REMOTEVIEWS_VIEW_IDS = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_VIEW_IDS";
- field public static final String EXTRA_SECONDARY_TOOLBAR_COLOR = "android.support.customtabs.extra.SECONDARY_TOOLBAR_COLOR";
- field public static final String EXTRA_SESSION = "android.support.customtabs.extra.SESSION";
- field public static final String EXTRA_TINT_ACTION_BUTTON = "android.support.customtabs.extra.TINT_ACTION_BUTTON";
- field public static final String EXTRA_TITLE_VISIBILITY_STATE = "android.support.customtabs.extra.TITLE_VISIBILITY";
- field public static final String EXTRA_TOOLBAR_COLOR = "android.support.customtabs.extra.TOOLBAR_COLOR";
- field public static final String EXTRA_TOOLBAR_ITEMS = "android.support.customtabs.extra.TOOLBAR_ITEMS";
- field public static final String KEY_DESCRIPTION = "android.support.customtabs.customaction.DESCRIPTION";
- field public static final String KEY_ICON = "android.support.customtabs.customaction.ICON";
- field public static final String KEY_ID = "android.support.customtabs.customaction.ID";
- field public static final String KEY_MENU_ITEM_TITLE = "android.support.customtabs.customaction.MENU_ITEM_TITLE";
- field public static final String KEY_PENDING_INTENT = "android.support.customtabs.customaction.PENDING_INTENT";
- field public static final int NO_TITLE = 0; // 0x0
- field public static final int SHOW_PAGE_TITLE = 1; // 0x1
- field public static final int TOOLBAR_ACTION_BUTTON_ID = 0; // 0x0
- field public final android.content.Intent intent;
- field public final android.os.Bundle? startAnimationBundle;
- }
-
- public static final class CustomTabsIntent.Builder {
- ctor public CustomTabsIntent.Builder();
- ctor public CustomTabsIntent.Builder(androidx.browser.customtabs.CustomTabsSession?);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! addDefaultShareMenuItem();
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! addMenuItem(String, android.app.PendingIntent);
- method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder! addToolbarItem(int, android.graphics.Bitmap, String, android.app.PendingIntent!) throws java.lang.IllegalStateException;
- method public androidx.browser.customtabs.CustomTabsIntent! build();
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! enableUrlBarHiding();
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent, boolean);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! setCloseButtonIcon(android.graphics.Bitmap);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! setExitAnimations(android.content.Context, @AnimRes int, @AnimRes int);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! setInstantAppsEnabled(boolean);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! setSecondaryToolbarColor(@ColorInt int);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! setSecondaryToolbarViews(android.widget.RemoteViews, int[]?, android.app.PendingIntent?);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! setShowTitle(boolean);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! setStartAnimations(android.content.Context, @AnimRes int, @AnimRes int);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder! setToolbarColor(@ColorInt int);
- }
-
- public abstract class CustomTabsService extends android.app.Service {
- ctor public CustomTabsService();
- method protected boolean cleanUpSession(androidx.browser.customtabs.CustomTabsSessionToken!);
- method protected abstract android.os.Bundle! extraCommand(String!, android.os.Bundle!);
- method protected abstract boolean mayLaunchUrl(androidx.browser.customtabs.CustomTabsSessionToken!, android.net.Uri!, android.os.Bundle!, java.util.List<android.os.Bundle>!);
- method protected abstract boolean newSession(androidx.browser.customtabs.CustomTabsSessionToken!);
- method public android.os.IBinder! onBind(android.content.Intent!);
- method @androidx.browser.customtabs.CustomTabsService.Result protected abstract int postMessage(androidx.browser.customtabs.CustomTabsSessionToken!, String!, android.os.Bundle!);
- method protected abstract boolean requestPostMessageChannel(androidx.browser.customtabs.CustomTabsSessionToken!, android.net.Uri!);
- method protected abstract boolean updateVisuals(androidx.browser.customtabs.CustomTabsSessionToken!, android.os.Bundle!);
- method protected abstract boolean validateRelationship(androidx.browser.customtabs.CustomTabsSessionToken!, @androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri!, android.os.Bundle!);
- method protected abstract boolean warmup(long);
- field public static final String ACTION_CUSTOM_TABS_CONNECTION = "android.support.customtabs.action.CustomTabsService";
- field public static final String KEY_URL = "android.support.customtabs.otherurls.URL";
- field public static final int RELATION_HANDLE_ALL_URLS = 2; // 0x2
- field public static final int RELATION_USE_AS_ORIGIN = 1; // 0x1
- field public static final int RESULT_FAILURE_DISALLOWED = -1; // 0xffffffff
- field public static final int RESULT_FAILURE_MESSAGING_ERROR = -3; // 0xfffffffd
- field public static final int RESULT_FAILURE_REMOTE_ERROR = -2; // 0xfffffffe
- field public static final int RESULT_SUCCESS = 0; // 0x0
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({androidx.browser.customtabs.CustomTabsService.RELATION_USE_AS_ORIGIN, androidx.browser.customtabs.CustomTabsService.RELATION_HANDLE_ALL_URLS}) public static @interface CustomTabsService.Relation {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({androidx.browser.customtabs.CustomTabsService.RESULT_SUCCESS, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_DISALLOWED, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_REMOTE_ERROR, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_MESSAGING_ERROR}) public static @interface CustomTabsService.Result {
- }
-
- public abstract class CustomTabsServiceConnection implements android.content.ServiceConnection {
- ctor public CustomTabsServiceConnection();
- method public abstract void onCustomTabsServiceConnected(android.content.ComponentName!, androidx.browser.customtabs.CustomTabsClient!);
- method public final void onServiceConnected(android.content.ComponentName!, android.os.IBinder!);
- }
-
- public final class CustomTabsSession {
- method @VisibleForTesting public static androidx.browser.customtabs.CustomTabsSession createMockSessionForTesting(android.content.ComponentName);
- method public boolean mayLaunchUrl(android.net.Uri!, android.os.Bundle!, java.util.List<android.os.Bundle>!);
- method @androidx.browser.customtabs.CustomTabsService.Result public int postMessage(String!, android.os.Bundle!);
- method public boolean requestPostMessageChannel(android.net.Uri!);
- method public boolean setActionButton(android.graphics.Bitmap, String);
- method public boolean setSecondaryToolbarViews(android.widget.RemoteViews?, int[]?, android.app.PendingIntent?);
- method @Deprecated public boolean setToolbarItem(int, android.graphics.Bitmap, String);
- method public boolean validateRelationship(@androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri, android.os.Bundle?);
- }
-
- public class CustomTabsSessionToken {
- method public static androidx.browser.customtabs.CustomTabsSessionToken createMockSessionTokenForTesting();
- method public androidx.browser.customtabs.CustomTabsCallback! getCallback();
- method public static androidx.browser.customtabs.CustomTabsSessionToken! getSessionTokenFromIntent(android.content.Intent!);
- method public boolean isAssociatedWith(androidx.browser.customtabs.CustomTabsSession!);
- }
-
- public class PostMessageService extends android.app.Service {
- ctor public PostMessageService();
- method public android.os.IBinder! onBind(android.content.Intent!);
- }
-
- public abstract class PostMessageServiceConnection implements android.content.ServiceConnection {
- ctor public PostMessageServiceConnection(androidx.browser.customtabs.CustomTabsSessionToken!);
- method public boolean bindSessionToPostMessageService(android.content.Context!, String!);
- method public final boolean notifyMessageChannelReady(android.os.Bundle!);
- method public void onPostMessageServiceConnected();
- method public void onPostMessageServiceDisconnected();
- method public final void onServiceConnected(android.content.ComponentName!, android.os.IBinder!);
- method public final void onServiceDisconnected(android.content.ComponentName!);
- method public final boolean postMessage(String!, android.os.Bundle!);
- method public void unbindFromContext(android.content.Context!);
- }
-
- public class TrustedWebUtils {
- method public static void launchAsTrustedWebActivity(android.content.Context, androidx.browser.customtabs.CustomTabsIntent, android.net.Uri);
- field public static final String EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY = "android.support.customtabs.extra.LAUNCH_AS_TRUSTED_WEB_ACTIVITY";
- }
-
-}
-
diff --git a/browser/api/1.1.0-alpha02.txt b/browser/api/1.1.0-alpha02.txt
deleted file mode 100644
index 56bcfe8..0000000
--- a/browser/api/1.1.0-alpha02.txt
+++ /dev/null
@@ -1,215 +0,0 @@
-// Signature format: 3.0
-package androidx.browser.browseractions {
-
- public class BrowserActionItem {
- ctor public BrowserActionItem(String, android.app.PendingIntent, @DrawableRes int);
- ctor public BrowserActionItem(String, android.app.PendingIntent);
- method public android.app.PendingIntent getAction();
- method public int getIconId();
- method public String getTitle();
- }
-
- public class BrowserActionsIntent {
- method @Deprecated public static String? getCreatorPackageName(android.content.Intent);
- method public android.content.Intent getIntent();
- method public static String? getUntrustedCreatorPackageName(android.content.Intent);
- method public static void launchIntent(android.content.Context!, android.content.Intent!);
- method public static void openBrowserAction(android.content.Context!, android.net.Uri!);
- method public static void openBrowserAction(android.content.Context!, android.net.Uri!, int, java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem>!, android.app.PendingIntent!);
- method public static java.util.List<androidx.browser.browseractions.BrowserActionItem>! parseBrowserActionItems(java.util.ArrayList<android.os.Bundle>!);
- field public static final String ACTION_BROWSER_ACTIONS_OPEN = "androidx.browser.browseractions.browser_action_open";
- field public static final String EXTRA_APP_ID = "androidx.browser.browseractions.APP_ID";
- field public static final String EXTRA_MENU_ITEMS = "androidx.browser.browseractions.extra.MENU_ITEMS";
- field public static final String EXTRA_SELECTED_ACTION_PENDING_INTENT = "androidx.browser.browseractions.extra.SELECTED_ACTION_PENDING_INTENT";
- field public static final String EXTRA_TYPE = "androidx.browser.browseractions.extra.TYPE";
- field public static final int ITEM_COPY = 3; // 0x3
- field public static final int ITEM_DOWNLOAD = 2; // 0x2
- field public static final int ITEM_INVALID_ITEM = -1; // 0xffffffff
- field public static final int ITEM_OPEN_IN_INCOGNITO = 1; // 0x1
- field public static final int ITEM_OPEN_IN_NEW_TAB = 0; // 0x0
- field public static final int ITEM_SHARE = 4; // 0x4
- field public static final String KEY_ACTION = "androidx.browser.browseractions.ACTION";
- field public static final String KEY_ICON_ID = "androidx.browser.browseractions.ICON_ID";
- field public static final String KEY_TITLE = "androidx.browser.browseractions.TITLE";
- field public static final int MAX_CUSTOM_ITEMS = 5; // 0x5
- field public static final int URL_TYPE_AUDIO = 3; // 0x3
- field public static final int URL_TYPE_FILE = 4; // 0x4
- field public static final int URL_TYPE_IMAGE = 1; // 0x1
- field public static final int URL_TYPE_NONE = 0; // 0x0
- field public static final int URL_TYPE_PLUGIN = 5; // 0x5
- field public static final int URL_TYPE_VIDEO = 2; // 0x2
- }
-
- public static final class BrowserActionsIntent.Builder {
- ctor public BrowserActionsIntent.Builder(android.content.Context!, android.net.Uri!);
- method public androidx.browser.browseractions.BrowserActionsIntent! build();
- method public androidx.browser.browseractions.BrowserActionsIntent.Builder! setCustomItems(java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem>!);
- method public androidx.browser.browseractions.BrowserActionsIntent.Builder! setCustomItems(androidx.browser.browseractions.BrowserActionItem...!);
- method public androidx.browser.browseractions.BrowserActionsIntent.Builder! setOnItemSelectedAction(android.app.PendingIntent!);
- method public androidx.browser.browseractions.BrowserActionsIntent.Builder! setUrlType(int);
- }
-
-}
-
-package androidx.browser.customtabs {
-
- public class CustomTabsCallback {
- ctor public CustomTabsCallback();
- method public void extraCallback(String!, android.os.Bundle!);
- method public void onMessageChannelReady(android.os.Bundle!);
- method public void onNavigationEvent(int, android.os.Bundle!);
- method public void onPostMessage(String!, android.os.Bundle!);
- method public void onRelationshipValidationResult(@androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri!, boolean, android.os.Bundle!);
- field public static final int NAVIGATION_ABORTED = 4; // 0x4
- field public static final int NAVIGATION_FAILED = 3; // 0x3
- field public static final int NAVIGATION_FINISHED = 2; // 0x2
- field public static final int NAVIGATION_STARTED = 1; // 0x1
- field public static final int TAB_HIDDEN = 6; // 0x6
- field public static final int TAB_SHOWN = 5; // 0x5
- }
-
- public class CustomTabsClient {
- method public static boolean bindCustomTabsService(android.content.Context!, String!, androidx.browser.customtabs.CustomTabsServiceConnection!);
- method public static boolean connectAndInitialize(android.content.Context!, String!);
- method public android.os.Bundle! extraCommand(String!, android.os.Bundle!);
- method public static String! getPackageName(android.content.Context!, java.util.List<java.lang.String>?);
- method public static String? getPackageName(android.content.Context, java.util.List<java.lang.String>?, boolean);
- method public androidx.browser.customtabs.CustomTabsSession! newSession(androidx.browser.customtabs.CustomTabsCallback!);
- method public boolean warmup(long);
- }
-
- public final class CustomTabsIntent {
- method public static int getMaxToolbarItems();
- method public void launchUrl(android.content.Context!, android.net.Uri!);
- method public static android.content.Intent! setAlwaysUseBrowserUI(android.content.Intent!);
- method public static boolean shouldAlwaysUseBrowserUI(android.content.Intent!);
- field public static final int COLOR_SCHEME_DARK = 2; // 0x2
- field public static final int COLOR_SCHEME_LIGHT = 1; // 0x1
- field public static final int COLOR_SCHEME_SYSTEM = 0; // 0x0
- field public static final String EXTRA_ACTION_BUTTON_BUNDLE = "android.support.customtabs.extra.ACTION_BUTTON_BUNDLE";
- field public static final String EXTRA_CLOSE_BUTTON_ICON = "android.support.customtabs.extra.CLOSE_BUTTON_ICON";
- field public static final String EXTRA_COLOR_SCHEME = "androidx.browser.customtabs.extra.COLOR_SCHEME";
- field public static final String EXTRA_DEFAULT_SHARE_MENU_ITEM = "android.support.customtabs.extra.SHARE_MENU_ITEM";
- field public static final String EXTRA_ENABLE_INSTANT_APPS = "android.support.customtabs.extra.EXTRA_ENABLE_INSTANT_APPS";
- field public static final String EXTRA_ENABLE_URLBAR_HIDING = "android.support.customtabs.extra.ENABLE_URLBAR_HIDING";
- field public static final String EXTRA_EXIT_ANIMATION_BUNDLE = "android.support.customtabs.extra.EXIT_ANIMATION_BUNDLE";
- field public static final String EXTRA_MENU_ITEMS = "android.support.customtabs.extra.MENU_ITEMS";
- field public static final String EXTRA_REMOTEVIEWS = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS";
- field public static final String EXTRA_REMOTEVIEWS_CLICKED_ID = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_CLICKED_ID";
- field public static final String EXTRA_REMOTEVIEWS_PENDINGINTENT = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_PENDINGINTENT";
- field public static final String EXTRA_REMOTEVIEWS_VIEW_IDS = "android.support.customtabs.extra.EXTRA_REMOTEVIEWS_VIEW_IDS";
- field public static final String EXTRA_SECONDARY_TOOLBAR_COLOR = "android.support.customtabs.extra.SECONDARY_TOOLBAR_COLOR";
- field public static final String EXTRA_SESSION = "android.support.customtabs.extra.SESSION";
- field public static final String EXTRA_TINT_ACTION_BUTTON = "android.support.customtabs.extra.TINT_ACTION_BUTTON";
- field public static final String EXTRA_TITLE_VISIBILITY_STATE = "android.support.customtabs.extra.TITLE_VISIBILITY";
- field public static final String EXTRA_TOOLBAR_COLOR = "android.support.customtabs.extra.TOOLBAR_COLOR";
- field public static final String EXTRA_TOOLBAR_ITEMS = "android.support.customtabs.extra.TOOLBAR_ITEMS";
- field public static final String KEY_DESCRIPTION = "android.support.customtabs.customaction.DESCRIPTION";
- field public static final String KEY_ICON = "android.support.customtabs.customaction.ICON";
- field public static final String KEY_ID = "android.support.customtabs.customaction.ID";
- field public static final String KEY_MENU_ITEM_TITLE = "android.support.customtabs.customaction.MENU_ITEM_TITLE";
- field public static final String KEY_PENDING_INTENT = "android.support.customtabs.customaction.PENDING_INTENT";
- field public static final int NO_TITLE = 0; // 0x0
- field public static final int SHOW_PAGE_TITLE = 1; // 0x1
- field public static final int TOOLBAR_ACTION_BUTTON_ID = 0; // 0x0
- field public final android.content.Intent intent;
- field public final android.os.Bundle? startAnimationBundle;
- }
-
- public static final class CustomTabsIntent.Builder {
- ctor public CustomTabsIntent.Builder();
- ctor public CustomTabsIntent.Builder(androidx.browser.customtabs.CustomTabsSession?);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder addDefaultShareMenuItem();
- method public androidx.browser.customtabs.CustomTabsIntent.Builder addMenuItem(String, android.app.PendingIntent);
- method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder addToolbarItem(int, android.graphics.Bitmap, String, android.app.PendingIntent!) throws java.lang.IllegalStateException;
- method public androidx.browser.customtabs.CustomTabsIntent build();
- method public androidx.browser.customtabs.CustomTabsIntent.Builder enableUrlBarHiding();
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent, boolean);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setCloseButtonIcon(android.graphics.Bitmap);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setColorScheme(int);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setExitAnimations(android.content.Context, @AnimRes int, @AnimRes int);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setInstantAppsEnabled(boolean);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setSecondaryToolbarColor(@ColorInt int);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setSecondaryToolbarViews(android.widget.RemoteViews, int[]?, android.app.PendingIntent?);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setShowTitle(boolean);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setStartAnimations(android.content.Context, @AnimRes int, @AnimRes int);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setToolbarColor(@ColorInt int);
- }
-
- public abstract class CustomTabsService extends android.app.Service {
- ctor public CustomTabsService();
- method protected boolean cleanUpSession(androidx.browser.customtabs.CustomTabsSessionToken!);
- method protected abstract android.os.Bundle! extraCommand(String!, android.os.Bundle!);
- method protected abstract boolean mayLaunchUrl(androidx.browser.customtabs.CustomTabsSessionToken!, android.net.Uri!, android.os.Bundle!, java.util.List<android.os.Bundle>!);
- method protected abstract boolean newSession(androidx.browser.customtabs.CustomTabsSessionToken!);
- method public android.os.IBinder! onBind(android.content.Intent!);
- method @androidx.browser.customtabs.CustomTabsService.Result protected abstract int postMessage(androidx.browser.customtabs.CustomTabsSessionToken!, String!, android.os.Bundle!);
- method protected abstract boolean requestPostMessageChannel(androidx.browser.customtabs.CustomTabsSessionToken!, android.net.Uri!);
- method protected abstract boolean updateVisuals(androidx.browser.customtabs.CustomTabsSessionToken!, android.os.Bundle!);
- method protected abstract boolean validateRelationship(androidx.browser.customtabs.CustomTabsSessionToken!, @androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri!, android.os.Bundle!);
- method protected abstract boolean warmup(long);
- field public static final String ACTION_CUSTOM_TABS_CONNECTION = "android.support.customtabs.action.CustomTabsService";
- field public static final String KEY_URL = "android.support.customtabs.otherurls.URL";
- field public static final int RELATION_HANDLE_ALL_URLS = 2; // 0x2
- field public static final int RELATION_USE_AS_ORIGIN = 1; // 0x1
- field public static final int RESULT_FAILURE_DISALLOWED = -1; // 0xffffffff
- field public static final int RESULT_FAILURE_MESSAGING_ERROR = -3; // 0xfffffffd
- field public static final int RESULT_FAILURE_REMOTE_ERROR = -2; // 0xfffffffe
- field public static final int RESULT_SUCCESS = 0; // 0x0
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({androidx.browser.customtabs.CustomTabsService.RELATION_USE_AS_ORIGIN, androidx.browser.customtabs.CustomTabsService.RELATION_HANDLE_ALL_URLS}) public static @interface CustomTabsService.Relation {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({androidx.browser.customtabs.CustomTabsService.RESULT_SUCCESS, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_DISALLOWED, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_REMOTE_ERROR, androidx.browser.customtabs.CustomTabsService.RESULT_FAILURE_MESSAGING_ERROR}) public static @interface CustomTabsService.Result {
- }
-
- public abstract class CustomTabsServiceConnection implements android.content.ServiceConnection {
- ctor public CustomTabsServiceConnection();
- method public abstract void onCustomTabsServiceConnected(android.content.ComponentName!, androidx.browser.customtabs.CustomTabsClient!);
- method public final void onServiceConnected(android.content.ComponentName!, android.os.IBinder!);
- }
-
- public final class CustomTabsSession {
- method @VisibleForTesting public static androidx.browser.customtabs.CustomTabsSession createMockSessionForTesting(android.content.ComponentName);
- method public boolean mayLaunchUrl(android.net.Uri!, android.os.Bundle!, java.util.List<android.os.Bundle>!);
- method @androidx.browser.customtabs.CustomTabsService.Result public int postMessage(String!, android.os.Bundle!);
- method public boolean requestPostMessageChannel(android.net.Uri!);
- method public boolean setActionButton(android.graphics.Bitmap, String);
- method public boolean setSecondaryToolbarViews(android.widget.RemoteViews?, int[]?, android.app.PendingIntent?);
- method @Deprecated public boolean setToolbarItem(int, android.graphics.Bitmap, String);
- method public boolean validateRelationship(@androidx.browser.customtabs.CustomTabsService.Relation int, android.net.Uri, android.os.Bundle?);
- }
-
- public class CustomTabsSessionToken {
- method public static androidx.browser.customtabs.CustomTabsSessionToken createMockSessionTokenForTesting();
- method public androidx.browser.customtabs.CustomTabsCallback! getCallback();
- method public static androidx.browser.customtabs.CustomTabsSessionToken! getSessionTokenFromIntent(android.content.Intent!);
- method public boolean isAssociatedWith(androidx.browser.customtabs.CustomTabsSession!);
- }
-
- public class PostMessageService extends android.app.Service {
- ctor public PostMessageService();
- method public android.os.IBinder! onBind(android.content.Intent!);
- }
-
- public abstract class PostMessageServiceConnection implements android.content.ServiceConnection {
- ctor public PostMessageServiceConnection(androidx.browser.customtabs.CustomTabsSessionToken!);
- method public boolean bindSessionToPostMessageService(android.content.Context!, String!);
- method public final boolean notifyMessageChannelReady(android.os.Bundle!);
- method public void onPostMessageServiceConnected();
- method public void onPostMessageServiceDisconnected();
- method public final void onServiceConnected(android.content.ComponentName!, android.os.IBinder!);
- method public final void onServiceDisconnected(android.content.ComponentName!);
- method public final boolean postMessage(String!, android.os.Bundle!);
- method public void unbindFromContext(android.content.Context!);
- }
-
- public class TrustedWebUtils {
- method public static void launchAsTrustedWebActivity(android.content.Context, androidx.browser.customtabs.CustomTabsIntent, android.net.Uri);
- field public static final String EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY = "android.support.customtabs.extra.LAUNCH_AS_TRUSTED_WEB_ACTIVITY";
- }
-
-}
-
diff --git a/browser/api/current.txt b/browser/api/current.txt
index 56bcfe8..06890b2 100644
--- a/browser/api/current.txt
+++ b/browser/api/current.txt
@@ -1,18 +1,17 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.browser.browseractions {
public class BrowserActionItem {
ctor public BrowserActionItem(String, android.app.PendingIntent, @DrawableRes int);
ctor public BrowserActionItem(String, android.app.PendingIntent);
- method public android.app.PendingIntent getAction();
+ method public android.app.PendingIntent! getAction();
method public int getIconId();
- method public String getTitle();
+ method public String! getTitle();
}
public class BrowserActionsIntent {
- method @Deprecated public static String? getCreatorPackageName(android.content.Intent);
+ method public static String! getCreatorPackageName(android.content.Intent!);
method public android.content.Intent getIntent();
- method public static String? getUntrustedCreatorPackageName(android.content.Intent);
method public static void launchIntent(android.content.Context!, android.content.Intent!);
method public static void openBrowserAction(android.content.Context!, android.net.Uri!);
method public static void openBrowserAction(android.content.Context!, android.net.Uri!, int, java.util.ArrayList<androidx.browser.browseractions.BrowserActionItem>!, android.app.PendingIntent!);
@@ -73,7 +72,7 @@
method public static boolean connectAndInitialize(android.content.Context!, String!);
method public android.os.Bundle! extraCommand(String!, android.os.Bundle!);
method public static String! getPackageName(android.content.Context!, java.util.List<java.lang.String>?);
- method public static String? getPackageName(android.content.Context, java.util.List<java.lang.String>?, boolean);
+ method public static String! getPackageName(android.content.Context!, java.util.List<java.lang.String>?, boolean);
method public androidx.browser.customtabs.CustomTabsSession! newSession(androidx.browser.customtabs.CustomTabsCallback!);
method public boolean warmup(long);
}
@@ -83,12 +82,8 @@
method public void launchUrl(android.content.Context!, android.net.Uri!);
method public static android.content.Intent! setAlwaysUseBrowserUI(android.content.Intent!);
method public static boolean shouldAlwaysUseBrowserUI(android.content.Intent!);
- field public static final int COLOR_SCHEME_DARK = 2; // 0x2
- field public static final int COLOR_SCHEME_LIGHT = 1; // 0x1
- field public static final int COLOR_SCHEME_SYSTEM = 0; // 0x0
field public static final String EXTRA_ACTION_BUTTON_BUNDLE = "android.support.customtabs.extra.ACTION_BUTTON_BUNDLE";
field public static final String EXTRA_CLOSE_BUTTON_ICON = "android.support.customtabs.extra.CLOSE_BUTTON_ICON";
- field public static final String EXTRA_COLOR_SCHEME = "androidx.browser.customtabs.extra.COLOR_SCHEME";
field public static final String EXTRA_DEFAULT_SHARE_MENU_ITEM = "android.support.customtabs.extra.SHARE_MENU_ITEM";
field public static final String EXTRA_ENABLE_INSTANT_APPS = "android.support.customtabs.extra.EXTRA_ENABLE_INSTANT_APPS";
field public static final String EXTRA_ENABLE_URLBAR_HIDING = "android.support.customtabs.extra.ENABLE_URLBAR_HIDING";
@@ -119,22 +114,21 @@
public static final class CustomTabsIntent.Builder {
ctor public CustomTabsIntent.Builder();
ctor public CustomTabsIntent.Builder(androidx.browser.customtabs.CustomTabsSession?);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder addDefaultShareMenuItem();
- method public androidx.browser.customtabs.CustomTabsIntent.Builder addMenuItem(String, android.app.PendingIntent);
- method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder addToolbarItem(int, android.graphics.Bitmap, String, android.app.PendingIntent!) throws java.lang.IllegalStateException;
- method public androidx.browser.customtabs.CustomTabsIntent build();
- method public androidx.browser.customtabs.CustomTabsIntent.Builder enableUrlBarHiding();
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent, boolean);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setCloseButtonIcon(android.graphics.Bitmap);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setColorScheme(int);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setExitAnimations(android.content.Context, @AnimRes int, @AnimRes int);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setInstantAppsEnabled(boolean);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setSecondaryToolbarColor(@ColorInt int);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setSecondaryToolbarViews(android.widget.RemoteViews, int[]?, android.app.PendingIntent?);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setShowTitle(boolean);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setStartAnimations(android.content.Context, @AnimRes int, @AnimRes int);
- method public androidx.browser.customtabs.CustomTabsIntent.Builder setToolbarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! addDefaultShareMenuItem();
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! addMenuItem(String, android.app.PendingIntent);
+ method @Deprecated public androidx.browser.customtabs.CustomTabsIntent.Builder! addToolbarItem(int, android.graphics.Bitmap, String, android.app.PendingIntent!) throws java.lang.IllegalStateException;
+ method public androidx.browser.customtabs.CustomTabsIntent! build();
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! enableUrlBarHiding();
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent, boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setActionButton(android.graphics.Bitmap, String, android.app.PendingIntent);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setCloseButtonIcon(android.graphics.Bitmap);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setExitAnimations(android.content.Context, @AnimRes int, @AnimRes int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setInstantAppsEnabled(boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setSecondaryToolbarColor(@ColorInt int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setSecondaryToolbarViews(android.widget.RemoteViews, int[]?, android.app.PendingIntent?);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setShowTitle(boolean);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setStartAnimations(android.content.Context, @AnimRes int, @AnimRes int);
+ method public androidx.browser.customtabs.CustomTabsIntent.Builder! setToolbarColor(@ColorInt int);
}
public abstract class CustomTabsService extends android.app.Service {
diff --git a/browser/api/res-1.1.0-alpha01.txt b/browser/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/browser/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/browser/api/res-1.1.0-alpha02.txt b/browser/api/res-1.1.0-alpha02.txt
deleted file mode 100644
index e69de29..0000000
--- a/browser/api/res-1.1.0-alpha02.txt
+++ /dev/null
diff --git a/browser/api/restricted_1.1.0-alpha01.txt b/browser/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index 41ed405..0000000
--- a/browser/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-// Signature format: 3.0
-package androidx.browser.browseractions {
-
- public class BrowserActionItem {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public BrowserActionItem(String, android.app.PendingIntent, android.net.Uri);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class BrowserActionsFallbackMenuView extends android.widget.LinearLayout {
- ctor public BrowserActionsFallbackMenuView(android.content.Context!, android.util.AttributeSet!);
- }
-
- public class BrowserActionsIntent {
- }
-
- @IntDef({androidx.browser.browseractions.BrowserActionsIntent.ITEM_INVALID_ITEM, androidx.browser.browseractions.BrowserActionsIntent.ITEM_OPEN_IN_NEW_TAB, androidx.browser.browseractions.BrowserActionsIntent.ITEM_OPEN_IN_INCOGNITO, androidx.browser.browseractions.BrowserActionsIntent.ITEM_DOWNLOAD, androidx.browser.browseractions.BrowserActionsIntent.ITEM_COPY, androidx.browser.browseractions.BrowserActionsIntent.ITEM_SHARE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BrowserActionsIntent.BrowserActionsItemId {
- }
-
- @IntDef({androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_NONE, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_IMAGE, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_VIDEO, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_AUDIO, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_FILE, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_PLUGIN}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BrowserActionsIntent.BrowserActionsUrlType {
- }
-
-
-}
-
diff --git a/browser/api/restricted_1.1.0-alpha02.txt b/browser/api/restricted_1.1.0-alpha02.txt
deleted file mode 100644
index 13d91a5..0000000
--- a/browser/api/restricted_1.1.0-alpha02.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-// Signature format: 3.0
-package androidx.browser.browseractions {
-
- public class BrowserActionItem {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public BrowserActionItem(String, android.app.PendingIntent, android.net.Uri);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class BrowserActionsFallbackMenuView extends android.widget.LinearLayout {
- ctor public BrowserActionsFallbackMenuView(android.content.Context!, android.util.AttributeSet!);
- }
-
- public class BrowserActionsIntent {
- }
-
- @IntDef({androidx.browser.browseractions.BrowserActionsIntent.ITEM_INVALID_ITEM, androidx.browser.browseractions.BrowserActionsIntent.ITEM_OPEN_IN_NEW_TAB, androidx.browser.browseractions.BrowserActionsIntent.ITEM_OPEN_IN_INCOGNITO, androidx.browser.browseractions.BrowserActionsIntent.ITEM_DOWNLOAD, androidx.browser.browseractions.BrowserActionsIntent.ITEM_COPY, androidx.browser.browseractions.BrowserActionsIntent.ITEM_SHARE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BrowserActionsIntent.BrowserActionsItemId {
- }
-
- @IntDef({androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_NONE, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_IMAGE, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_VIDEO, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_AUDIO, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_FILE, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_PLUGIN}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BrowserActionsIntent.BrowserActionsUrlType {
- }
-
-
-}
-
-package androidx.browser.customtabs {
-
-
-}
-
diff --git a/browser/api/restricted_current.txt b/browser/api/restricted_current.txt
deleted file mode 100644
index 13d91a5..0000000
--- a/browser/api/restricted_current.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-// Signature format: 3.0
-package androidx.browser.browseractions {
-
- public class BrowserActionItem {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public BrowserActionItem(String, android.app.PendingIntent, android.net.Uri);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class BrowserActionsFallbackMenuView extends android.widget.LinearLayout {
- ctor public BrowserActionsFallbackMenuView(android.content.Context!, android.util.AttributeSet!);
- }
-
- public class BrowserActionsIntent {
- }
-
- @IntDef({androidx.browser.browseractions.BrowserActionsIntent.ITEM_INVALID_ITEM, androidx.browser.browseractions.BrowserActionsIntent.ITEM_OPEN_IN_NEW_TAB, androidx.browser.browseractions.BrowserActionsIntent.ITEM_OPEN_IN_INCOGNITO, androidx.browser.browseractions.BrowserActionsIntent.ITEM_DOWNLOAD, androidx.browser.browseractions.BrowserActionsIntent.ITEM_COPY, androidx.browser.browseractions.BrowserActionsIntent.ITEM_SHARE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BrowserActionsIntent.BrowserActionsItemId {
- }
-
- @IntDef({androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_NONE, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_IMAGE, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_VIDEO, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_AUDIO, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_FILE, androidx.browser.browseractions.BrowserActionsIntent.URL_TYPE_PLUGIN}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BrowserActionsIntent.BrowserActionsUrlType {
- }
-
-
-}
-
-package androidx.browser.customtabs {
-
-
-}
-
diff --git a/browser/build.gradle b/browser/build.gradle
index feed454..c8a3fca 100644
--- a/browser/build.gradle
+++ b/browser/build.gradle
@@ -8,7 +8,7 @@
android {
defaultConfig {
- minSdkVersion 16
+ minSdkVersion 15
}
}
@@ -19,8 +19,6 @@
api(project(":collection"))
api(project(":legacy-support-core-ui"))
- implementation(project(":concurrent:concurrent-futures"))
-
androidTestImplementation(TEST_EXT_JUNIT)
androidTestImplementation(TEST_CORE)
androidTestImplementation(TEST_RUNNER)
diff --git a/browser/src/androidTest/java/androidx/browser/browseractions/BrowserActionsFallbackMenuUiTest.java b/browser/src/androidTest/java/androidx/browser/browseractions/BrowserActionsFallbackMenuUiTest.java
index 1ed34b8..c25c01e2 100644
--- a/browser/src/androidTest/java/androidx/browser/browseractions/BrowserActionsFallbackMenuUiTest.java
+++ b/browser/src/androidTest/java/androidx/browser/browseractions/BrowserActionsFallbackMenuUiTest.java
@@ -29,9 +29,8 @@
import androidx.browser.R;
import androidx.browser.customtabs.TestActivity;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
-import androidx.testutils.PollingCheck;
import org.junit.Before;
import org.junit.Rule;
@@ -45,7 +44,7 @@
/** Unit tests for {@link BrowserActionsFallbackMenuUi}. */
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class BrowserActionsFallbackMenuUiTest {
private static final String TEST_URL = "http://www.example.com";
private static final String CUSTOM_ITEM_TITLE_1 = "Open url";
@@ -55,18 +54,11 @@
new ActivityTestRule<>(TestActivity.class);
private Context mContext;
private List<BrowserActionItem> mMenuItems;
- private List<String> mMenuItemTitles;
@Before
public void setup() {
mContext = mActivityTestRule.getActivity();
mMenuItems = createMenuItems();
- mMenuItemTitles = new ArrayList<>();
- mMenuItemTitles.add(mContext.getString(R.string.fallback_menu_item_open_in_browser));
- mMenuItemTitles.add(mContext.getString(R.string.fallback_menu_item_copy_link));
- mMenuItemTitles.add(mContext.getString(R.string.fallback_menu_item_share_link));
- mMenuItemTitles.add(CUSTOM_ITEM_TITLE_1);
- mMenuItemTitles.add(CUSTOM_ITEM_TITLE_2);
}
private List<BrowserActionItem> createMenuItems() {
@@ -138,19 +130,15 @@
(TextView) contentView.findViewById(R.id.browser_actions_header_text);
assertNotNull(urlTextView);
assertEquals(TEST_URL, urlTextView.getText());
- final ListView menuListView =
+ ListView menuListView =
(ListView) contentView.findViewById(R.id.browser_actions_menu_items);
assertNotNull(menuListView);
- PollingCheck.waitFor(new PollingCheck.PollingCheckCondition() {
- @Override
- public boolean canProceed() {
- return mMenuItemTitles.size() == menuListView.getCount();
- }
- });
- for (int i = 0; i < mMenuItemTitles.size(); i++) {
- TextView menuItemTitleView = (TextView) menuListView.getChildAt(i).findViewById(
- R.id.browser_actions_menu_item_text);
- assertEquals(mMenuItemTitles.get(i), menuItemTitleView.getText());
- }
+ assertEquals(2, menuListView.getCount());
+ TextView menuItemTitleView1 = (TextView) menuListView.getChildAt(0).findViewById(
+ R.id.browser_actions_menu_item_text);
+ assertEquals(CUSTOM_ITEM_TITLE_1, menuItemTitleView1.getText());
+ TextView menuItemTitleView2 = (TextView) menuListView.getChildAt(1).findViewById(
+ R.id.browser_actions_menu_item_text);
+ assertEquals(CUSTOM_ITEM_TITLE_2, menuItemTitleView2.getText());
}
-}
\ No newline at end of file
+}
diff --git a/browser/src/androidTest/java/androidx/browser/browseractions/BrowserActionsIntentTest.java b/browser/src/androidTest/java/androidx/browser/browseractions/BrowserActionsIntentTest.java
index 9311270..69bed08 100644
--- a/browser/src/androidTest/java/androidx/browser/browseractions/BrowserActionsIntentTest.java
+++ b/browser/src/androidTest/java/androidx/browser/browseractions/BrowserActionsIntentTest.java
@@ -62,8 +62,7 @@
assertEquals(BrowserActionsIntent.URL_TYPE_NONE,
intent.getIntExtra(BrowserActionsIntent.EXTRA_TYPE, 0));
assertTrue(intent.hasExtra(BrowserActionsIntent.EXTRA_APP_ID));
- assertEquals(mContext.getPackageName(),
- BrowserActionsIntent.getUntrustedCreatorPackageName(intent));
+ assertEquals(mContext.getPackageName(), BrowserActionsIntent.getCreatorPackageName(intent));
assertFalse(intent.hasExtra(BrowserActionsIntent.EXTRA_SELECTED_ACTION_PENDING_INTENT));
}
diff --git a/browser/src/androidTest/java/androidx/browser/customtabs/CustomTabsIntentTest.java b/browser/src/androidTest/java/androidx/browser/customtabs/CustomTabsIntentTest.java
index dd67cac..f98e9e19 100644
--- a/browser/src/androidTest/java/androidx/browser/customtabs/CustomTabsIntentTest.java
+++ b/browser/src/androidTest/java/androidx/browser/customtabs/CustomTabsIntentTest.java
@@ -21,7 +21,6 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import android.content.Intent;
import android.graphics.Color;
@@ -75,32 +74,4 @@
intent = new CustomTabsIntent.Builder().setToolbarColor(color).build().intent;
assertEquals(color, intent.getIntExtra(CustomTabsIntent.EXTRA_TOOLBAR_COLOR, 0));
}
-
- @Test
- public void testColorScheme() {
- try {
- new CustomTabsIntent.Builder().setColorScheme(-1);
- fail("Underflow arguments are expected to throw an exception");
- } catch (IllegalArgumentException exception) {
- }
-
- try {
- new CustomTabsIntent.Builder().setColorScheme(42);
- fail("Overflow arguments are expected to throw an exception");
- } catch (IllegalArgumentException exception) {
- }
-
- // None of the valid parameters should throw.
- final int[] colorSchemeValues = new int[] {
- CustomTabsIntent.COLOR_SCHEME_SYSTEM,
- CustomTabsIntent.COLOR_SCHEME_LIGHT,
- CustomTabsIntent.COLOR_SCHEME_DARK
- };
-
- for (int value : colorSchemeValues) {
- Intent intent =
- new CustomTabsIntent.Builder().setColorScheme(value).build().intent;
- assertEquals(value, intent.getIntExtra(CustomTabsIntent.EXTRA_COLOR_SCHEME, -1));
- }
- }
}
diff --git a/browser/src/androidTest/java/androidx/browser/customtabs/PostMessageTest.java b/browser/src/androidTest/java/androidx/browser/customtabs/PostMessageTest.java
index 3adef06..87d4f59 100644
--- a/browser/src/androidTest/java/androidx/browser/customtabs/PostMessageTest.java
+++ b/browser/src/androidTest/java/androidx/browser/customtabs/PostMessageTest.java
@@ -24,11 +24,10 @@
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
-import android.os.AsyncTask;
import android.os.Bundle;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.rule.ServiceTestRule;
import androidx.testutils.PollingCheck;
@@ -38,9 +37,9 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
+
/**
* Tests for a complete loop between a browser side {@link CustomTabsService}
* and a client side {@link PostMessageService}. Both services are bound to through
@@ -48,11 +47,9 @@
* side actions.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class PostMessageTest {
@Rule
- public final ServiceTestRule mServiceRule;
- @Rule
public final ActivityTestRule<TestActivity> mActivityTestRule;
private TestCustomTabsCallback mCallback;
private Context mContext;
@@ -64,7 +61,6 @@
public PostMessageTest() {
mActivityTestRule = new ActivityTestRule<TestActivity>(TestActivity.class);
- mServiceRule = new ServiceTestRule();
mCustomTabsServiceConnected = new AtomicBoolean(false);
}
@@ -77,21 +73,15 @@
@Override
public void extraCallback(String callbackName, Bundle args) {
if (TestCustomTabsService.CALLBACK_BIND_TO_POST_MESSAGE.equals(callbackName)) {
- // This gets run on the UI thread, where mServiceRule.bindService will not work.
- AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
- @Override
- public void run() {
- try {
- Intent postMessageServiceIntent = new Intent();
- postMessageServiceIntent.setClassName(mContext.getPackageName(),
- PostMessageService.class.getName());
- mServiceRule.bindService(postMessageServiceIntent,
- mPostMessageServiceConnection, Context.BIND_AUTO_CREATE);
- } catch (TimeoutException e) {
- fail();
- }
- }
- });
+ Intent postMessageServiceIntent = new Intent();
+ postMessageServiceIntent.setClassName(
+ mContext.getPackageName(), PostMessageService.class.getName());
+ try {
+ mContext.bindService(postMessageServiceIntent,
+ mPostMessageServiceConnection, Context.BIND_AUTO_CREATE);
+ } catch (Exception e) {
+ fail();
+ }
}
}
};
@@ -99,8 +89,8 @@
mCustomTabsServiceConnection = new CustomTabsServiceConnection() {
@Override
public void onCustomTabsServiceConnected(ComponentName name, CustomTabsClient client) {
- mCustomTabsServiceConnected.set(true);
mSession = client.newSession(mCallback);
+ mCustomTabsServiceConnected.set(true);
}
@Override
@@ -124,9 +114,9 @@
customTabsServiceIntent.setClassName(
mContext.getPackageName(), TestCustomTabsService.class.getName());
try {
- mServiceRule.bindService(customTabsServiceIntent,
+ mContext.bindService(customTabsServiceIntent,
mCustomTabsServiceConnection, Context.BIND_AUTO_CREATE);
- } catch (TimeoutException e) {
+ } catch (Exception e) {
fail();
}
}
diff --git a/browser/src/androidTest/java/androidx/browser/customtabs/TestCustomTabsCallback.java b/browser/src/androidTest/java/androidx/browser/customtabs/TestCustomTabsCallback.java
index 6353398..7c48245 100644
--- a/browser/src/androidTest/java/androidx/browser/customtabs/TestCustomTabsCallback.java
+++ b/browser/src/androidTest/java/androidx/browser/customtabs/TestCustomTabsCallback.java
@@ -55,7 +55,7 @@
@Override
public void onRelationshipValidationResult(int relation, Uri origin, boolean result,
- Bundle extras) throws RemoteException {
+ Bundle extras) throws RemoteException {
TestCustomTabsCallback.this.onRelationshipValidationResult(
relation, origin, result, extras);
}
diff --git a/browser/src/androidTest/java/androidx/browser/customtabs/TestCustomTabsService.java b/browser/src/androidTest/java/androidx/browser/customtabs/TestCustomTabsService.java
index 071d1c2..c3057b2f 100644
--- a/browser/src/androidTest/java/androidx/browser/customtabs/TestCustomTabsService.java
+++ b/browser/src/androidTest/java/androidx/browser/customtabs/TestCustomTabsService.java
@@ -43,7 +43,7 @@
@Override
protected boolean mayLaunchUrl(CustomTabsSessionToken sessionToken,
- Uri url, Bundle extras, List<Bundle> otherLikelyBundles) {
+ Uri url, Bundle extras, List<Bundle> otherLikelyBundles) {
return false;
}
@@ -74,7 +74,7 @@
@Override
protected boolean validateRelationship(CustomTabsSessionToken sessionToken,
- @Relation int relation, Uri origin, Bundle extras) {
+ @Relation int relation, Uri origin, Bundle extras) {
return false;
}
}
diff --git a/browser/src/main/aidl/android/support/customtabs/ICustomTabsCallback.aidl b/browser/src/main/aidl/android/support/customtabs/ICustomTabsCallback.aidl
index a5dd8ea..3e2c48c 100644
--- a/browser/src/main/aidl/android/support/customtabs/ICustomTabsCallback.aidl
+++ b/browser/src/main/aidl/android/support/customtabs/ICustomTabsCallback.aidl
@@ -28,4 +28,4 @@
void onMessageChannelReady(in Bundle extras) = 3;
void onPostMessage(String message, in Bundle extras) = 4;
void onRelationshipValidationResult(int relation, in Uri origin, boolean result, in Bundle extras) = 5;
-}
\ No newline at end of file
+}
diff --git a/browser/src/main/aidl/android/support/customtabs/ICustomTabsService.aidl b/browser/src/main/aidl/android/support/customtabs/ICustomTabsService.aidl
index c89d9db..376c2a4 100644
--- a/browser/src/main/aidl/android/support/customtabs/ICustomTabsService.aidl
+++ b/browser/src/main/aidl/android/support/customtabs/ICustomTabsService.aidl
@@ -37,4 +37,4 @@
boolean requestPostMessageChannel(in ICustomTabsCallback callback, in Uri postMessageOrigin) = 6;
int postMessage(in ICustomTabsCallback callback, String message, in Bundle extras) = 7;
boolean validateRelationship(in ICustomTabsCallback callback, int relation, in Uri origin, in Bundle extras) = 8;
-}
\ No newline at end of file
+}
diff --git a/browser/src/main/aidl/android/support/customtabs/IPostMessageService.aidl b/browser/src/main/aidl/android/support/customtabs/IPostMessageService.aidl
index 666fe83c..2c8a605c 100644
--- a/browser/src/main/aidl/android/support/customtabs/IPostMessageService.aidl
+++ b/browser/src/main/aidl/android/support/customtabs/IPostMessageService.aidl
@@ -27,4 +27,4 @@
interface IPostMessageService {
void onMessageChannelReady(in ICustomTabsCallback callback, in Bundle extras) = 1;
void onPostMessage(in ICustomTabsCallback callback, String message, in Bundle extras) = 2;
-}
\ No newline at end of file
+}
diff --git a/browser/src/main/java/androidx/browser/browseractions/BrowserActionItem.java b/browser/src/main/java/androidx/browser/browseractions/BrowserActionItem.java
index c79ad83..4b657c4 100644
--- a/browser/src/main/java/androidx/browser/browseractions/BrowserActionItem.java
+++ b/browser/src/main/java/androidx/browser/browseractions/BrowserActionItem.java
@@ -16,16 +16,10 @@
package androidx.browser.browseractions;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
-
import android.app.PendingIntent;
-import android.net.Uri;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RestrictTo;
/**
* A wrapper class holding custom item of Browser Actions menu.
@@ -35,9 +29,7 @@
private final String mTitle;
private final PendingIntent mAction;
@DrawableRes
- private int mIconId;
- private Uri mIconUri;
- private Runnable mRunnableAction;
+ private final int mIconId;
/**
* Constructor for BrowserActionItem with icon, string and action provided.
@@ -53,35 +45,6 @@
}
/**
- * Constructor for BrowserActionItem with icon access through a uri.
- * @param title The string shown for a custom item.
- * @param action The PendingIntent executed when a custom item is selected
- * @param iconUri The {@link Uri} used to access the icon file. Note: make sure this is
- * generated from {@link BrowserServiceFileProvider.generateUri(Context, Bitmap, String,
- * int, List<ResolveInfo>)}.
- */
- /** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- public BrowserActionItem(
- @NonNull String title, @NonNull PendingIntent action, @NonNull Uri iconUri) {
- mTitle = title;
- mAction = action;
- mIconUri = iconUri;
- }
-
- /**
- * Constructs a predefined fallback menu item with a Runnable action. The item will have no
- * icon and no custom PendingIntent action.
- * @param title The title of the menu item.
- * @param action The {@link Runnable} action to be executed when user choose the item.
- */
- BrowserActionItem(@NonNull String title, @NonNull Runnable action) {
- mTitle = title;
- mAction = null;
- mRunnableAction = action;
- }
-
- /**
* Constructor for BrowserActionItem with only string and action provided.
* @param title The icon shown for a custom item.
* @param action The string shown for a custom item.
@@ -100,7 +63,6 @@
/**
* @return The title of a custom item.
*/
- @NonNull
public String getTitle() {
return mTitle;
}
@@ -108,28 +70,7 @@
/**
* @return The action of a custom item.
*/
- @NonNull
public PendingIntent getAction() {
return mAction;
}
-
- /**
- * @return The uri used to get the icon of a custom item.
- * @hide
- */
- @RestrictTo(LIBRARY)
- @Nullable
- public Uri getIconUri() {
- return mIconUri;
- }
-
- /**
- * @return The {@link Runnable} action of a predefined fallback menu item.
- */
- /** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- @Nullable
- Runnable getRunnableAction() {
- return mRunnableAction;
- }
}
diff --git a/browser/src/main/java/androidx/browser/browseractions/BrowserActionsFallbackMenuAdapter.java b/browser/src/main/java/androidx/browser/browseractions/BrowserActionsFallbackMenuAdapter.java
index a1756eb..a82ecc2 100644
--- a/browser/src/main/java/androidx/browser/browseractions/BrowserActionsFallbackMenuAdapter.java
+++ b/browser/src/main/java/androidx/browser/browseractions/BrowserActionsFallbackMenuAdapter.java
@@ -17,9 +17,7 @@
package androidx.browser.browseractions;
import android.content.Context;
-import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
-import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -30,11 +28,7 @@
import androidx.browser.R;
import androidx.core.content.res.ResourcesCompat;
-import com.google.common.util.concurrent.ListenableFuture;
-
import java.util.List;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executor;
/**
* The adapter to display the icon and title of custom Browser Actions item.
@@ -66,7 +60,7 @@
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final BrowserActionItem menuItem = mMenuItems.get(position);
- final ViewHolderItem viewHolder;
+ ViewHolderItem viewHolder;
if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(
R.layout.browser_actions_context_menu_row, null);
@@ -80,47 +74,13 @@
viewHolder = (ViewHolderItem) convertView.getTag();
}
- final String titleText = menuItem.getTitle();
- viewHolder.mText.setText(titleText);
+ viewHolder.mText.setText(menuItem.getTitle());
if (menuItem.getIconId() != 0) {
Drawable drawable = ResourcesCompat.getDrawable(
mContext.getResources(), menuItem.getIconId(), null);
viewHolder.mIcon.setImageDrawable(drawable);
- } else if (menuItem.getIconUri() != null) {
- final ListenableFuture<Bitmap> bitmapFuture = BrowserServiceFileProvider
- .loadBitmap(mContext.getContentResolver(), menuItem.getIconUri());
-
- bitmapFuture.addListener(new Runnable() {
- @Override
- public void run() {
- // ViewHolder has been reused by other item.
- if (!TextUtils.equals(titleText, viewHolder.mText.getText())) return;
-
- Bitmap bitmap = null;
- try {
- bitmap = bitmapFuture.get();
- } catch (ExecutionException | InterruptedException e) {
- // Ignore and just don't use the image.
- }
-
- if (bitmap != null) {
- viewHolder.mIcon.setVisibility(View.VISIBLE);
- viewHolder.mIcon.setImageBitmap(bitmap);
- } else {
- viewHolder.mIcon.setVisibility(View.INVISIBLE);
- viewHolder.mIcon.setImageBitmap(null);
- }
- }
- }, new Executor() {
- @Override
- public void execute(Runnable runnable) {
- runnable.run();
- }
- });
-
} else {
- viewHolder.mIcon.setImageBitmap(null);
- viewHolder.mIcon.setVisibility(View.INVISIBLE);
+ viewHolder.mIcon.setImageDrawable(null);
}
return convertView;
}
diff --git a/browser/src/main/java/androidx/browser/browseractions/BrowserActionsFallbackMenuUi.java b/browser/src/main/java/androidx/browser/browseractions/BrowserActionsFallbackMenuUi.java
index bcc0099..270efd6 100644
--- a/browser/src/main/java/androidx/browser/browseractions/BrowserActionsFallbackMenuUi.java
+++ b/browser/src/main/java/androidx/browser/browseractions/BrowserActionsFallbackMenuUi.java
@@ -16,15 +16,12 @@
package androidx.browser.browseractions;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.PendingIntent;
import android.app.PendingIntent.CanceledException;
-import android.content.ClipData;
-import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
-import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
@@ -33,14 +30,12 @@
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;
-import android.widget.Toast;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
import androidx.browser.R;
import androidx.core.widget.TextViewCompat;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -49,18 +44,15 @@
class BrowserActionsFallbackMenuUi implements AdapterView.OnItemClickListener {
/** @hide */
@VisibleForTesting
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
interface BrowserActionsFallMenuUiListener {
void onMenuShown(View view);
}
private static final String TAG = "BrowserActionskMenuUi";
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- final Context mContext;
-
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- final Uri mUri;
+ private final Context mContext;
+ private final Uri mUri;
private final List<BrowserActionItem> mMenuItems;
@SuppressWarnings("WeakerAccess") /* synthetic access */
@@ -71,61 +63,22 @@
/**
* @param context The {@link Context} used to show the fallback menu.
* @param uri The uri which users click to trigger the menu.
- * @param customItems The custom menu items shown in the menu.
+ * @param menuItems The custom menu items shown in the menu.
*/
- BrowserActionsFallbackMenuUi(Context context, Uri uri, List<BrowserActionItem> customItems) {
+ BrowserActionsFallbackMenuUi(
+ Context context, Uri uri, List<BrowserActionItem> menuItems) {
mContext = context;
mUri = uri;
- mMenuItems = buildFallbackMenuItemList(context, customItems);
+ mMenuItems = menuItems;
}
/** @hide */
@VisibleForTesting
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void setMenuUiListener(BrowserActionsFallMenuUiListener menuUiListener) {
mMenuUiListener = menuUiListener;
}
- private List<BrowserActionItem> buildFallbackMenuItemList(
- Context context, List<BrowserActionItem> customItems) {
- List<BrowserActionItem> fallbackMenuItems = new ArrayList<>();
- fallbackMenuItems.add(new BrowserActionItem(
- mContext.getString(R.string.fallback_menu_item_open_in_browser),
- buildOpenInBrowserAction()));
- fallbackMenuItems.add(new BrowserActionItem(
- mContext.getString(R.string.fallback_menu_item_copy_link), buildCopyAction()));
- fallbackMenuItems.add(new BrowserActionItem(
- mContext.getString(R.string.fallback_menu_item_share_link), buildShareAction()));
- fallbackMenuItems.addAll(customItems);
- return fallbackMenuItems;
- }
-
- private PendingIntent buildOpenInBrowserAction() {
- Intent intent = new Intent(Intent.ACTION_VIEW, mUri);
- return PendingIntent.getActivity(mContext, 0, intent, 0);
- }
-
- private PendingIntent buildShareAction() {
- Intent intent = new Intent(Intent.ACTION_SEND);
- intent.putExtra(Intent.EXTRA_TEXT, mUri.toString());
- intent.setType("text/plain");
- return PendingIntent.getActivity(mContext, 0, intent, 0);
- }
-
- private Runnable buildCopyAction() {
- return new Runnable() {
- @Override
- public void run() {
- ClipboardManager clipboardManager =
- (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
- ClipData data = ClipData.newPlainText("url", mUri.toString());
- clipboardManager.setPrimaryClip(data);
- String toastMsg = mContext.getString(R.string.copy_toast_msg);
- Toast.makeText(mContext, toastMsg, Toast.LENGTH_SHORT).show();
- }
- };
- }
-
/**
* Shows the fallback menu.
*/
@@ -175,16 +128,12 @@
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- BrowserActionItem menuItem = mMenuItems.get(position);
- if (menuItem.getAction() != null) {
- try {
- menuItem.getAction().send();
- } catch (CanceledException e) {
- Log.e(TAG, "Failed to send custom item action", e);
- }
- } else if (menuItem.getRunnableAction() != null) {
- menuItem.getRunnableAction().run();
+ PendingIntent action = mMenuItems.get(position).getAction();
+ try {
+ action.send();
+ mBrowserActionsDialog.dismiss();
+ } catch (CanceledException e) {
+ Log.e(TAG, "Failed to send custom item action", e);
}
- mBrowserActionsDialog.dismiss();
}
}
diff --git a/browser/src/main/java/androidx/browser/browseractions/BrowserActionsFallbackMenuView.java b/browser/src/main/java/androidx/browser/browseractions/BrowserActionsFallbackMenuView.java
index b6d67af..351ee46 100644
--- a/browser/src/main/java/androidx/browser/browseractions/BrowserActionsFallbackMenuView.java
+++ b/browser/src/main/java/androidx/browser/browseractions/BrowserActionsFallbackMenuView.java
@@ -16,7 +16,7 @@
package androidx.browser.browseractions;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.util.AttributeSet;
@@ -29,7 +29,7 @@
* The class responsible for deciding the size of Browser Actions context menu.
*/
/** @hide */
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class BrowserActionsFallbackMenuView extends LinearLayout {
private final int mBrowserActionsMenuMinPaddingPx;
private final int mBrowserActionsMenuMaxWidthPx;
diff --git a/browser/src/main/java/androidx/browser/browseractions/BrowserActionsIntent.java b/browser/src/main/java/androidx/browser/browseractions/BrowserActionsIntent.java
index 42d0729..00aaafd 100644
--- a/browser/src/main/java/androidx/browser/browseractions/BrowserActionsIntent.java
+++ b/browser/src/main/java/androidx/browser/browseractions/BrowserActionsIntent.java
@@ -16,8 +16,7 @@
package androidx.browser.browseractions;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.PendingIntent;
import android.content.Context;
@@ -32,7 +31,6 @@
import androidx.annotation.DrawableRes;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
import androidx.core.content.ContextCompat;
@@ -42,13 +40,12 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-
/**
* Class holding the {@link Intent} and start bundle for a Browser Actions Activity.
*
* <p>
* <strong>Note:</strong> The constants below are public for the browser implementation's benefit.
- * You are strongly encouraged to use {@link BrowserActionsIntent.Builder}.
+ * You are strongly encouraged to use {@link BrowserActionsIntent.Builder}.</p>
*/
public class BrowserActionsIntent {
private static final String TAG = "BrowserActions";
@@ -58,10 +55,6 @@
/**
* Extra that specifies {@link PendingIntent} indicating which Application sends the {@link
* BrowserActionsIntent}.
- * <p>
- * <strong>Note:</strong> The PendingIntent is self-reported and untrusted, sending application
- * can modify it to use PendingIntent from other apps. This would return the package name from
- * the app who creates the PendintIntent.
*/
public static final String EXTRA_APP_ID = "androidx.browser.browseractions.APP_ID";
@@ -77,12 +70,6 @@
public static final String KEY_ICON_ID = "androidx.browser.browseractions.ICON_ID";
/**
- * Extra {@link Uri} that specifies location of file for the icon of a custom item shown in the
- * Browser Actions menu.
- */
- private static final String KEY_ICON_URI = "androidx.browser.browseractions.ICON_URI";
-
- /**
* Extra string that specifies the title of a custom item shown in the Browser Actions menu.
*/
public static final String KEY_TITLE = "androidx.browser.browseractions.TITLE";
@@ -120,7 +107,7 @@
* Defines the types of url for Browser Actions menu.
*/
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({URL_TYPE_NONE, URL_TYPE_IMAGE, URL_TYPE_VIDEO, URL_TYPE_AUDIO, URL_TYPE_FILE,
URL_TYPE_PLUGIN})
@Retention(RetentionPolicy.SOURCE)
@@ -137,7 +124,7 @@
* TODO(ltian): A long term solution need, since other providers might have customized menus.
*/
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({ITEM_INVALID_ITEM, ITEM_OPEN_IN_NEW_TAB, ITEM_OPEN_IN_INCOGNITO, ITEM_DOWNLOAD,
ITEM_COPY, ITEM_SHARE})
@Retention(RetentionPolicy.SOURCE)
@@ -169,7 +156,7 @@
/** @hide */
@VisibleForTesting
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
interface BrowserActionsFallDialogListener {
void onDialogShown();
}
@@ -187,7 +174,6 @@
private int mType;
private ArrayList<Bundle> mMenuItems = null;
private PendingIntent mOnItemSelectedPendingIntent = null;
- private List<Uri> mImageUris = null;
/**
* Constructs a {@link BrowserActionsIntent.Builder} object associated with default setting
@@ -200,7 +186,6 @@
mUri = uri;
mType = URL_TYPE_NONE;
mMenuItems = new ArrayList<>();
- mImageUris = new ArrayList<>();
}
/**
@@ -230,9 +215,6 @@
"Custom item should contain a non-empty title and non-null intent.");
} else {
mMenuItems.add(getBundleFromItem(items.get(i)));
- if (items.get(i).getIconUri() != null) {
- mImageUris.add(items.get(i).getIconUri());
- }
}
}
return this;
@@ -267,7 +249,6 @@
bundle.putString(KEY_TITLE, item.getTitle());
bundle.putParcelable(KEY_ACTION, item.getAction());
if (item.getIconId() != 0) bundle.putInt(KEY_ICON_ID, item.getIconId());
- if (item.getIconUri() != null) bundle.putParcelable(KEY_ICON_URI, item.getIconUri());
return bundle;
}
@@ -285,7 +266,6 @@
mIntent.putExtra(
EXTRA_SELECTED_ACTION_PENDING_INTENT, mOnItemSelectedPendingIntent);
}
- BrowserServiceFileProvider.grantReadPermission(mIntent, mImageUris, mContext);
return new BrowserActionsIntent(mIntent);
}
}
@@ -336,7 +316,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@VisibleForTesting
static void launchIntent(Context context, Intent intent, List<ResolveInfo> handlers) {
if (handlers == null || handlers.size() == 0) {
@@ -367,11 +347,8 @@
* BrowserActionsIntent}.
* @param context The context requesting for a Browser Actions menu.
* @return List of Browser Actions providers available to handle the intent.
- * @hide
*/
- @RestrictTo(LIBRARY)
- @NonNull
- public static List<ResolveInfo> getBrowserActionsIntentHandlers(@NonNull Context context) {
+ private static List<ResolveInfo> getBrowserActionsIntentHandlers(Context context) {
Intent intent =
new Intent(BrowserActionsIntent.ACTION_BROWSER_ACTIONS_OPEN, Uri.parse(TEST_URL));
PackageManager pm = context.getPackageManager();
@@ -387,7 +364,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@VisibleForTesting
static void setDialogShownListenter(BrowserActionsFallDialogListener dialogListener) {
sDialogListenter = dialogListener;
@@ -398,7 +375,7 @@
* @param context The context requesting for a Browser Actions menu.
* @param uri The url for Browser Actions menu.
* @param type The type of the url for context menu to be opened.
- * @param menuItems List of {@link BrowserActionItem} to add to the fallback menu.
+ * @param menuItems List of custom items to add to Browser Actions menu.
*/
private static void openFallbackBrowserActionsMenu(
Context context, Uri uri, int type, List<BrowserActionItem> menuItems) {
@@ -419,22 +396,16 @@
List<BrowserActionItem> mActions = new ArrayList<>();
for (int i = 0; i < bundles.size(); i++) {
Bundle bundle = bundles.get(i);
- String title = bundle.getString(KEY_TITLE);
- PendingIntent action = bundle.getParcelable(KEY_ACTION);
+ String title = bundle.getString(BrowserActionsIntent.KEY_TITLE);
+ PendingIntent action = bundle.getParcelable(BrowserActionsIntent.KEY_ACTION);
@DrawableRes
- int iconId = bundle.getInt(KEY_ICON_ID);
- Uri iconUri = bundle.getParcelable(KEY_ICON_URI);
- if (!TextUtils.isEmpty(title) && action != null) {
- BrowserActionItem item;
- if (iconId != 0) {
- item = new BrowserActionItem(title, action, iconId);
- } else {
- item = new BrowserActionItem(title, action, iconUri);
- }
- mActions.add(item);
- } else {
+ int iconId = bundle.getInt(BrowserActionsIntent.KEY_ICON_ID);
+ if (TextUtils.isEmpty(title) || action == null) {
throw new IllegalArgumentException(
"Custom item should contain a non-empty title and non-null intent.");
+ } else {
+ BrowserActionItem item = new BrowserActionItem(title, action, iconId);
+ mActions.add(item);
}
}
return mActions;
@@ -442,16 +413,11 @@
/**
* Get the package name of the creator application.
- * <p>
- * <strong> Note:</strong> This is self-reported and could be untrusted. Intent sender can
- * modify it to return the package name from a different application.
- *
* @param intent The {@link BrowserActionsIntent}.
* @return The creator package name.
*/
@SuppressWarnings("deprecation")
- @Nullable
- public static String getUntrustedCreatorPackageName(@NonNull Intent intent) {
+ public static String getCreatorPackageName(Intent intent) {
PendingIntent pendingIntent = intent.getParcelableExtra(BrowserActionsIntent.EXTRA_APP_ID);
if (pendingIntent != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
@@ -462,15 +428,4 @@
}
return null;
}
-
- /**
- * @deprecated This return value of this method cannot be trusted, it is kept around for
- * compatibility. Use {@link #getUntrustedCreatorPackageName}, or an alternative
- * method if you rely on the return value.
- */
- @Deprecated
- @Nullable
- public static String getCreatorPackageName(@NonNull Intent intent) {
- return getUntrustedCreatorPackageName(intent);
- }
}
diff --git a/browser/src/main/java/androidx/browser/browseractions/BrowserServiceFileProvider.java b/browser/src/main/java/androidx/browser/browseractions/BrowserServiceFileProvider.java
deleted file mode 100644
index 0d53d78..0000000
--- a/browser/src/main/java/androidx/browser/browseractions/BrowserServiceFileProvider.java
+++ /dev/null
@@ -1,301 +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.browser.browseractions;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-
-import android.content.ClipData;
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.SharedPreferences.Editor;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.net.Uri;
-import android.os.AsyncTask;
-import android.os.Build;
-import android.os.ParcelFileDescriptor;
-import android.util.Log;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RestrictTo;
-import androidx.annotation.UiThread;
-import androidx.concurrent.futures.ResolvableFuture;
-import androidx.core.content.FileProvider;
-import androidx.core.util.AtomicFile;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-import java.io.File;
-import java.io.FileDescriptor;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-/**
- * The class to pass images asynchronously between different Browser Services provider and Browser
- * client.
- *
- * Call {@link #saveBitmap} to save the image and {@link #loadBitmap} to read it.
- * @hide
- */
-@RestrictTo(LIBRARY)
-public final class BrowserServiceFileProvider extends FileProvider {
- private static final String TAG = "BrowserServiceFP";
- private static final String AUTHORITY_SUFFIX = ".image_provider";
- private static final String CONTENT_SCHEME = "content";
- private static final String FILE_SUB_DIR = "image_provider";
- private static final String FILE_SUB_DIR_NAME = "image_provider_images/";
- private static final String FILE_EXTENSION = ".png";
- private static final String CLIP_DATA_LABEL = "image_provider_uris";
- private static final String LAST_CLEANUP_TIME_KEY = "last_cleanup_time";
-
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- static Object sFileCleanupLock = new Object();
-
- private static class FileCleanupTask extends AsyncTask<Void, Void, Void> {
- private final Context mAppContext;
- private static final long IMAGE_RETENTION_DURATION = TimeUnit.DAYS.toMillis(7);
- private static final long CLEANUP_REQUIRED_TIME_SPAN = TimeUnit.DAYS.toMillis(7);
- private static final long DELETION_FAILED_REATTEMPT_DURATION = TimeUnit.DAYS.toMillis(1);
-
- FileCleanupTask(Context context) {
- super();
- mAppContext = context.getApplicationContext();
- }
-
- @Override
- protected Void doInBackground(Void... params) {
- SharedPreferences prefs = mAppContext.getSharedPreferences(
- mAppContext.getPackageName() + AUTHORITY_SUFFIX, Context.MODE_PRIVATE);
- if (!shouldCleanUp(prefs)) return null;
- synchronized (sFileCleanupLock) {
- boolean allFilesDeletedSuccessfully = true;
- File path = new File(mAppContext.getFilesDir(), FILE_SUB_DIR);
- if (!path.exists()) return null;
- File[] files = path.listFiles();
- long retentionDate = System.currentTimeMillis() - IMAGE_RETENTION_DURATION;
- for (File file : files) {
- if (!isImageFile(file)) continue;
- long lastModified = file.lastModified();
- if (lastModified < retentionDate && !file.delete()) {
- Log.e(TAG, "Fail to delete image: " + file.getAbsoluteFile());
- allFilesDeletedSuccessfully = false;
- }
- }
- // If fail to delete some files, kill off clean up task after one day.
- long lastCleanUpTime;
- if (allFilesDeletedSuccessfully) {
- lastCleanUpTime = System.currentTimeMillis();
- } else {
- lastCleanUpTime = System.currentTimeMillis() - CLEANUP_REQUIRED_TIME_SPAN
- + DELETION_FAILED_REATTEMPT_DURATION;
- }
- Editor editor = prefs.edit();
- editor.putLong(LAST_CLEANUP_TIME_KEY, lastCleanUpTime);
- editor.apply();
- }
- return null;
- }
-
- private static boolean isImageFile(File file) {
- String filename = file.getName();
- return filename.endsWith("." + FILE_EXTENSION);
- }
-
- private static boolean shouldCleanUp(SharedPreferences prefs) {
- long lastCleanup = prefs.getLong(LAST_CLEANUP_TIME_KEY, System.currentTimeMillis());
- return System.currentTimeMillis() > lastCleanup + CLEANUP_REQUIRED_TIME_SPAN;
- }
- }
-
- private static class FileSaveTask extends AsyncTask<String, Void, Void> {
- private final Context mAppContext;
- private final String mFilename;
- private final Bitmap mBitmap;
- private final Uri mFileUri;
- private final ResolvableFuture<Uri> mResultFuture;
-
- FileSaveTask(Context context, String filename, Bitmap bitmap, Uri fileUri,
- ResolvableFuture<Uri> resultFuture) {
- super();
- mAppContext = context.getApplicationContext();
- mFilename = filename;
- mBitmap = bitmap;
- mFileUri = fileUri;
- mResultFuture = resultFuture;
- }
-
- @Override
- protected Void doInBackground(String... params) {
- saveFileIfNeededBlocking();
- return null;
- }
-
- @Override
- protected void onPostExecute(Void result) {
- new FileCleanupTask(mAppContext).executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
- }
-
- private void saveFileIfNeededBlocking() {
- File path = new File(mAppContext.getFilesDir(), FILE_SUB_DIR);
- synchronized (sFileCleanupLock) {
- if (!path.exists() && !path.mkdir()) {
- mResultFuture.setException(new IOException("Could not create file directory."));
- return;
- }
- File img = new File(path, mFilename + FILE_EXTENSION);
-
- if (img.exists()) {
- mResultFuture.set(mFileUri);
- } else {
- saveFileBlocking(img);
- }
-
- img.setLastModified(System.currentTimeMillis());
- }
- }
-
- private void saveFileBlocking(File img) {
- FileOutputStream fOut = null;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
- AtomicFile atomicFile = new AtomicFile(img);
- try {
- fOut = atomicFile.startWrite();
- mBitmap.compress(Bitmap.CompressFormat.PNG, 100, fOut);
- fOut.close();
- atomicFile.finishWrite(fOut);
-
- mResultFuture.set(mFileUri);
- } catch (IOException e) {
- atomicFile.failWrite(fOut);
-
- mResultFuture.setException(e);
- }
- } else {
- try {
- fOut = new FileOutputStream(img);
- mBitmap.compress(Bitmap.CompressFormat.PNG, 100, fOut);
- fOut.close();
-
- mResultFuture.set(mFileUri);
- } catch (IOException e) {
- mResultFuture.setException(e);
- }
- }
- }
- }
-
- /**
- * Request a {@link Uri} used to access the bitmap through the file provider.
- * @param context The {@link Context} used to generate the uri, save the bitmap and grant the
- * read permission.
- * @param bitmap The {@link Bitmap} to be saved and access through the file provider.
- * @param name The name of the bitmap.
- * @param version The version number of the bitmap. Note: This plus the name decides the
- * filename of the bitmap. If it matches with existing file, bitmap will skip
- * saving.
- * @return A {@link ResolvableFuture} that will be fulfilled with the uri of the bitmap once
- * file writing has completed or an IOException describing the reason for failure.
- */
- @UiThread
- @NonNull
- public static ResolvableFuture<Uri> saveBitmap(@NonNull Context context, @NonNull Bitmap bitmap,
- @NonNull String name, int version) {
- String filename = name + "_" + Integer.toString(version);
- Uri uri = generateUri(context, filename);
-
- ResolvableFuture<Uri> result = ResolvableFuture.create();
- new FileSaveTask(context, filename, bitmap, uri, result)
- .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
- return result;
- }
-
- private static Uri generateUri(Context context, String filename) {
- String fileName = FILE_SUB_DIR_NAME + filename + FILE_EXTENSION;
- return new Uri.Builder()
- .scheme(CONTENT_SCHEME)
- .authority(context.getPackageName() + AUTHORITY_SUFFIX)
- .path(fileName)
- .build();
- }
-
- /**
- * Grant the read permission to a list of {@link Uri} sent through a {@link Intent}.
- * @param intent The sending Intent which holds a list of Uri.
- * @param uris A list of Uri generated by saveBitmap(Context, Bitmap, String, int,
- * List<String>), if null, nothing will be done.
- * @param context The context requests to grant the permission.
- */
- public static void grantReadPermission(@NonNull Intent intent, @Nullable List<Uri> uris,
- @NonNull Context context) {
- if (uris == null || uris.size() == 0) return;
- ContentResolver resolver = context.getContentResolver();
- intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
- ClipData clipData = ClipData.newUri(resolver, CLIP_DATA_LABEL, uris.get(0));
- for (int i = 1; i < uris.size(); i++) {
- clipData.addItem(new ClipData.Item(uris.get(i)));
- }
- intent.setClipData(clipData);
- }
-
- /**
- * Asynchronously loads a {@link Bitmap} from the uri generated by {@link #saveBitmap}.
- * @param resolver {@link ContentResolver} to access the Bitmap.
- * @param uri {@link Uri} pointing to the Bitmap.
- * @return A {@link ListenableFuture} that will be fulfilled with the Bitmap once the load has
- * completed or with an IOException describing the reason for failure.
- */
- @NonNull
- public static ListenableFuture<Bitmap> loadBitmap(@NonNull final ContentResolver resolver,
- @NonNull final Uri uri) {
- final ResolvableFuture<Bitmap> result = ResolvableFuture.create();
-
- AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
- @Override
- public void run() {
- try {
- ParcelFileDescriptor descriptor = resolver.openFileDescriptor(uri, "r");
-
- if (descriptor == null) {
- result.setException(new FileNotFoundException());
- return;
- }
-
- FileDescriptor fileDescriptor = descriptor.getFileDescriptor();
- Bitmap bitmap = BitmapFactory.decodeFileDescriptor(fileDescriptor);
- descriptor.close();
-
- if (bitmap == null) {
- result.setException(new IOException("File could not be decoded."));
- return;
- }
-
- result.set(bitmap);
- } catch (IOException e) {
- result.setException(e);
- }
- }
- });
-
- return result;
- }
-}
diff --git a/browser/src/main/java/androidx/browser/customtabs/CustomTabsCallback.java b/browser/src/main/java/androidx/browser/customtabs/CustomTabsCallback.java
index 2daff4e..2739bb0 100644
--- a/browser/src/main/java/androidx/browser/customtabs/CustomTabsCallback.java
+++ b/browser/src/main/java/androidx/browser/customtabs/CustomTabsCallback.java
@@ -19,8 +19,6 @@
import android.net.Uri;
import android.os.Bundle;
-import androidx.browser.customtabs.CustomTabsService.Relation;
-
/**
* A callback class for custom tabs client to get messages regarding events in their custom tabs. In
* the implementation, all callbacks are sent to the UI thread for the client.
@@ -77,7 +75,7 @@
* purposes.
*
* @param callbackName Name of the extra callback.
- * @param args Arguments for the callback
+ * @param args Arguments for the calback
*/
public void extraCallback(String callbackName, Bundle args) {}
@@ -113,6 +111,6 @@
* @param result Whether the relation was validated.
* @param extras Reserved for future use.
*/
- public void onRelationshipValidationResult(@Relation int relation, Uri requestedOrigin,
- boolean result, Bundle extras) {}
+ public void onRelationshipValidationResult(@CustomTabsService.Relation int relation, Uri requestedOrigin,
+ boolean result, Bundle extras) {}
}
diff --git a/browser/src/main/java/androidx/browser/customtabs/CustomTabsClient.java b/browser/src/main/java/androidx/browser/customtabs/CustomTabsClient.java
index 7cb492f..42dee4a 100644
--- a/browser/src/main/java/androidx/browser/customtabs/CustomTabsClient.java
+++ b/browser/src/main/java/androidx/browser/customtabs/CustomTabsClient.java
@@ -16,7 +16,7 @@
package androidx.browser.customtabs;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ComponentName;
import android.content.Context;
@@ -33,10 +33,8 @@
import android.support.customtabs.ICustomTabsService;
import android.text.TextUtils;
-import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
-import androidx.browser.customtabs.CustomTabsService.Relation;
import java.util.ArrayList;
import java.util.List;
@@ -50,7 +48,7 @@
private final ComponentName mServiceComponentName;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
CustomTabsClient(ICustomTabsService service, ComponentName componentName) {
mService = service;
mServiceComponentName = componentName;
@@ -79,7 +77,7 @@
/**
* Returns the preferred package to use for Custom Tabs, preferring the default VIEW handler.
*
- * @see #getPackageName(Context, List<String>, boolean)
+ * @see #getPackageName(Context, List, boolean)
*/
public static String getPackageName(Context context, @Nullable List<String> packages) {
return getPackageName(context, packages, false);
@@ -98,8 +96,8 @@
* @param ignoreDefault If set, the default VIEW handler won't get priority over other browsers.
* @return The preferred package name for handling Custom Tabs, or <code>null</code>.
*/
- public static @Nullable String getPackageName(
- @NonNull Context context, @Nullable List<String> packages, boolean ignoreDefault) {
+ public static String getPackageName(
+ Context context, @Nullable List<String> packages, boolean ignoreDefault) {
PackageManager pm = context.getPackageManager();
List<String> packageNames = packages == null ? new ArrayList<String>() : packages;
@@ -151,8 +149,8 @@
applicationContext.unbindService(this);
}
- @Override
- public void onServiceDisconnected(ComponentName componentName) { }
+ @Override
+ public final void onServiceDisconnected(ComponentName componentName) { }
};
try {
return bindCustomTabsService(applicationContext, packageName, connection);
@@ -242,7 +240,7 @@
@Override
public void onRelationshipValidationResult(
- final @Relation int relation, final Uri requestedOrigin, final boolean result,
+ final @CustomTabsService.Relation int relation, final Uri requestedOrigin, final boolean result,
final @Nullable Bundle extras) throws RemoteException {
if (callback == null) return;
mHandler.post(new Runnable() {
diff --git a/browser/src/main/java/androidx/browser/customtabs/CustomTabsIntent.java b/browser/src/main/java/androidx/browser/customtabs/CustomTabsIntent.java
index b118e9c..6242456 100644
--- a/browser/src/main/java/androidx/browser/customtabs/CustomTabsIntent.java
+++ b/browser/src/main/java/androidx/browser/customtabs/CustomTabsIntent.java
@@ -29,16 +29,12 @@
import androidx.annotation.AnimRes;
import androidx.annotation.ColorInt;
-import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import androidx.annotation.RestrictTo;
import androidx.core.app.ActivityOptionsCompat;
import androidx.core.app.BundleCompat;
import androidx.core.content.ContextCompat;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
/**
@@ -71,44 +67,6 @@
public static final String EXTRA_SESSION = "android.support.customtabs.extra.SESSION";
/**
- * @hide
- */
- @RestrictTo(RestrictTo.Scope.LIBRARY)
- @IntDef({COLOR_SCHEME_SYSTEM, COLOR_SCHEME_LIGHT, COLOR_SCHEME_DARK})
- @Retention(RetentionPolicy.SOURCE)
- public @interface ColorScheme {
- }
-
- /**
- * Applies either a light or dark color scheme to the user interface in the custom tab depending
- * on the user's system settings.
- */
- public static final int COLOR_SCHEME_SYSTEM = 0;
-
- /**
- * Applies a light color scheme to the user interface in the custom tab.
- */
- public static final int COLOR_SCHEME_LIGHT = 1;
-
- /**
- * Applies a light color scheme to the user interface in the custom tab. Colors set through
- * {@link #EXTRA_TOOLBAR_COLOR} may be darkened to match user expectations.
- */
- public static final int COLOR_SCHEME_DARK = 2;
-
- /**
- * Maximum value for the COLOR_SCHEME_* configuration options. For validation purposes only.
- */
- private static final int COLOR_SCHEME_MAX = 2;
-
- /**
- * Extra (int) that specifies which color scheme should be applied to the custom tab. Default is
- * {@link #COLOR_SCHEME_SYSTEM}.
- */
- public static final String EXTRA_COLOR_SCHEME =
- "androidx.browser.customtabs.extra.COLOR_SCHEME";
-
- /**
* Extra that changes the background color for the toolbar. colorRes is an int that specifies a
* {@link Color}, not a resource id.
*/
@@ -351,7 +309,6 @@
*
* @param color {@link Color}
*/
- @NonNull
public Builder setToolbarColor(@ColorInt int color) {
mIntent.putExtra(EXTRA_TOOLBAR_COLOR, color);
return this;
@@ -360,7 +317,6 @@
/**
* Enables the url bar to hide as the user scrolls down on the page.
*/
- @NonNull
public Builder enableUrlBarHiding() {
mIntent.putExtra(EXTRA_ENABLE_URLBAR_HIDING, true);
return this;
@@ -371,7 +327,6 @@
*
* @param icon The icon {@link Bitmap}
*/
- @NonNull
public Builder setCloseButtonIcon(@NonNull Bitmap icon) {
mIntent.putExtra(EXTRA_CLOSE_BUTTON_ICON, icon);
return this;
@@ -382,7 +337,6 @@
*
* @param showTitle Whether the title should be shown.
*/
- @NonNull
public Builder setShowTitle(boolean showTitle) {
mIntent.putExtra(EXTRA_TITLE_VISIBILITY_STATE,
showTitle ? SHOW_PAGE_TITLE : NO_TITLE);
@@ -395,7 +349,6 @@
* @param label Menu label.
* @param pendingIntent Pending intent delivered when the menu item is clicked.
*/
- @NonNull
public Builder addMenuItem(@NonNull String label, @NonNull PendingIntent pendingIntent) {
if (mMenuItems == null) mMenuItems = new ArrayList<>();
Bundle bundle = new Bundle();
@@ -408,7 +361,6 @@
/**
* Adds a default share item to the menu.
*/
- @NonNull
public Builder addDefaultShareMenuItem() {
mIntent.putExtra(EXTRA_DEFAULT_SHARE_MENU_ITEM, true);
return this;
@@ -428,7 +380,6 @@
*
* @see CustomTabsIntent.Builder#addToolbarItem(int, Bitmap, String, PendingIntent)
*/
- @NonNull
public Builder setActionButton(@NonNull Bitmap icon, @NonNull String description,
@NonNull PendingIntent pendingIntent, boolean shouldTint) {
Bundle bundle = new Bundle();
@@ -447,7 +398,6 @@
* @see CustomTabsIntent.Builder#setActionButton(
* Bitmap, String, PendingIntent, boolean)
*/
- @NonNull
public Builder setActionButton(@NonNull Bitmap icon, @NonNull String description,
@NonNull PendingIntent pendingIntent) {
return setActionButton(icon, description, pendingIntent, false);
@@ -472,7 +422,6 @@
* CustomTabsIntent.Builder#setSecondaryToolbarViews(RemoteViews, int[], PendingIntent).
*/
@Deprecated
- @NonNull
public Builder addToolbarItem(int id, @NonNull Bitmap icon, @NonNull String description,
PendingIntent pendingIntent) throws IllegalStateException {
if (mActionButtons == null) {
@@ -495,7 +444,6 @@
* Sets the color of the secondary toolbar.
* @param color The color for the secondary toolbar.
*/
- @NonNull
public Builder setSecondaryToolbarColor(@ColorInt int color) {
mIntent.putExtra(EXTRA_SECONDARY_TOOLBAR_COLOR, color);
return this;
@@ -516,7 +464,6 @@
* @see CustomTabsIntent#EXTRA_REMOTEVIEWS_PENDINGINTENT
* @see CustomTabsIntent#EXTRA_REMOTEVIEWS_CLICKED_ID
*/
- @NonNull
public Builder setSecondaryToolbarViews(@NonNull RemoteViews remoteViews,
@Nullable int[] clickableIDs, @Nullable PendingIntent pendingIntent) {
mIntent.putExtra(EXTRA_REMOTEVIEWS, remoteViews);
@@ -530,7 +477,6 @@
* @param enabled Whether Instant Apps should be enabled.
*/
- @NonNull
public Builder setInstantAppsEnabled(boolean enabled) {
mInstantAppsEnabled = enabled;
return this;
@@ -543,7 +489,6 @@
* @param enterResId Resource ID of the "enter" animation for the browser.
* @param exitResId Resource ID of the "exit" animation for the application.
*/
- @NonNull
public Builder setStartAnimations(
@NonNull Context context, @AnimRes int enterResId, @AnimRes int exitResId) {
mStartAnimationBundle = ActivityOptionsCompat.makeCustomAnimation(
@@ -558,7 +503,6 @@
* @param enterResId Resource ID of the "enter" animation for the application.
* @param exitResId Resource ID of the "exit" animation for the browser.
*/
- @NonNull
public Builder setExitAnimations(
@NonNull Context context, @AnimRes int enterResId, @AnimRes int exitResId) {
Bundle bundle = ActivityOptionsCompat.makeCustomAnimation(
@@ -568,27 +512,9 @@
}
/**
- * Sets the color scheme that should be applied to the user interface in the custom tab.
- *
- * @param colorScheme Desired color scheme.
- * @see CustomTabsIntent#COLOR_SCHEME_SYSTEM
- * @see CustomTabsIntent#COLOR_SCHEME_LIGHT
- * @see CustomTabsIntent#COLOR_SCHEME_DARK
- */
- @NonNull
- public Builder setColorScheme(@ColorScheme int colorScheme) {
- if (colorScheme < 0 || colorScheme > COLOR_SCHEME_MAX) {
- throw new IllegalArgumentException("Invalid value for the colorScheme argument");
- }
- mIntent.putExtra(EXTRA_COLOR_SCHEME, colorScheme);
- return this;
- }
-
- /**
* Combines all the options that have been set and returns a new {@link CustomTabsIntent}
* object.
*/
- @NonNull
public CustomTabsIntent build() {
if (mMenuItems != null) {
mIntent.putParcelableArrayListExtra(CustomTabsIntent.EXTRA_MENU_ITEMS, mMenuItems);
diff --git a/browser/src/main/java/androidx/browser/customtabs/CustomTabsService.java b/browser/src/main/java/androidx/browser/customtabs/CustomTabsService.java
index 80cc6bb..f07aa8e 100644
--- a/browser/src/main/java/androidx/browser/customtabs/CustomTabsService.java
+++ b/browser/src/main/java/androidx/browser/customtabs/CustomTabsService.java
@@ -130,7 +130,7 @@
@Override
public boolean mayLaunchUrl(ICustomTabsCallback callback, Uri url,
- Bundle extras, List<Bundle> otherLikelyBundles) {
+ Bundle extras, List<Bundle> otherLikelyBundles) {
return CustomTabsService.this.mayLaunchUrl(
new CustomTabsSessionToken(callback), url, extras, otherLikelyBundles);
}
@@ -148,7 +148,7 @@
@Override
public boolean requestPostMessageChannel(ICustomTabsCallback callback,
- Uri postMessageOrigin) {
+ Uri postMessageOrigin) {
return CustomTabsService.this.requestPostMessageChannel(
new CustomTabsSessionToken(callback), postMessageOrigin);
}
@@ -236,7 +236,7 @@
* @return Whether the call was successful.
*/
protected abstract boolean mayLaunchUrl(CustomTabsSessionToken sessionToken, Uri url,
- Bundle extras, List<Bundle> otherLikelyBundles);
+ Bundle extras, List<Bundle> otherLikelyBundles);
/**
* Unsupported commands that may be provided by the implementation.
@@ -264,7 +264,7 @@
* @return Whether the operation was successful.
*/
protected abstract boolean updateVisuals(CustomTabsSessionToken sessionToken,
- Bundle bundle);
+ Bundle bundle);
/**
* Sends a request to create a two way postMessage channel between the client and the browser
@@ -278,7 +278,7 @@
* asynchronous.
*/
protected abstract boolean requestPostMessageChannel(CustomTabsSessionToken sessionToken,
- Uri postMessageOrigin);
+ Uri postMessageOrigin);
/**
* Sends a postMessage request using the origin communicated via
diff --git a/browser/src/main/java/androidx/browser/customtabs/CustomTabsSession.java b/browser/src/main/java/androidx/browser/customtabs/CustomTabsSession.java
index 99540f5..3122495 100644
--- a/browser/src/main/java/androidx/browser/customtabs/CustomTabsSession.java
+++ b/browser/src/main/java/androidx/browser/customtabs/CustomTabsSession.java
@@ -31,8 +31,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
-import androidx.browser.customtabs.CustomTabsService.Relation;
-import androidx.browser.customtabs.CustomTabsService.Result;
import java.util.List;
@@ -192,9 +190,9 @@
* @param message The message that is being sent.
* @param extras Reserved for future use.
* @return An integer constant about the postMessage request result. Will return
- * {@link CustomTabsService#RESULT_SUCCESS} if successful.
+ * {@link CustomTabsService#RESULT_SUCCESS} if successful.
*/
- @Result
+ @CustomTabsService.Result
public int postMessage(String message, Bundle extras) {
synchronized (mLock) {
try {
@@ -225,8 +223,8 @@
* @param extras Reserved for future use.
* @return {@code true} if the request has been submitted successfully.
*/
- public boolean validateRelationship(@Relation int relation, @NonNull Uri origin,
- @Nullable Bundle extras) {
+ public boolean validateRelationship(@CustomTabsService.Relation int relation, @NonNull Uri origin,
+ @Nullable Bundle extras) {
if (relation < CustomTabsService.RELATION_USE_AS_ORIGIN
|| relation > CustomTabsService.RELATION_HANDLE_ALL_URLS) {
return false;
diff --git a/browser/src/main/java/androidx/browser/customtabs/CustomTabsSessionToken.java b/browser/src/main/java/androidx/browser/customtabs/CustomTabsSessionToken.java
index b666adf..0783a22 100644
--- a/browser/src/main/java/androidx/browser/customtabs/CustomTabsSessionToken.java
+++ b/browser/src/main/java/androidx/browser/customtabs/CustomTabsSessionToken.java
@@ -25,7 +25,6 @@
import android.util.Log;
import androidx.annotation.NonNull;
-import androidx.browser.customtabs.CustomTabsService.Relation;
import androidx.core.app.BundleCompat;
/**
@@ -53,7 +52,7 @@
public void onPostMessage(String message, Bundle extras) {}
@Override
- public void onRelationshipValidationResult(@Relation int relation, Uri requestedOrigin,
+ public void onRelationshipValidationResult(@CustomTabsService.Relation int relation, Uri requestedOrigin,
boolean result, Bundle extras) {}
@Override
@@ -128,8 +127,8 @@
}
@Override
- public void onRelationshipValidationResult(@Relation int relation, Uri origin,
- boolean result, Bundle extras) {
+ public void onRelationshipValidationResult(@CustomTabsService.Relation int relation, Uri origin,
+ boolean result, Bundle extras) {
try {
mCallbackBinder.onRelationshipValidationResult(
relation, origin, result, extras);
diff --git a/browser/src/main/java/androidx/browser/customtabs/PostMessageService.java b/browser/src/main/java/androidx/browser/customtabs/PostMessageService.java
index ec8e1d4..3764d65 100644
--- a/browser/src/main/java/androidx/browser/customtabs/PostMessageService.java
+++ b/browser/src/main/java/androidx/browser/customtabs/PostMessageService.java
@@ -38,7 +38,7 @@
@Override
public void onPostMessage(ICustomTabsCallback callback,
- String message, Bundle extras) throws RemoteException {
+ String message, Bundle extras) throws RemoteException {
callback.onPostMessage(message, extras);
}
};
diff --git a/browser/src/main/res/layout/browser_actions_context_menu_page.xml b/browser/src/main/res/layout/browser_actions_context_menu_page.xml
index 696f2ff..7720f91 100644
--- a/browser/src/main/res/layout/browser_actions_context_menu_page.xml
+++ b/browser/src/main/res/layout/browser_actions_context_menu_page.xml
@@ -1,19 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- 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
--->
-
+<!-- Copyright 2018 The Chromium Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style license that can be
+ found in the LICENSE file. -->
<androidx.browser.browseractions.BrowserActionsFallbackMenuView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
diff --git a/browser/src/main/res/layout/browser_actions_context_menu_row.xml b/browser/src/main/res/layout/browser_actions_context_menu_row.xml
index 91ccd11..d13e48f 100644
--- a/browser/src/main/res/layout/browser_actions_context_menu_row.xml
+++ b/browser/src/main/res/layout/browser_actions_context_menu_row.xml
@@ -1,19 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- 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
--->
-
+<!-- Copyright 2018 The Chromium Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style license that can be
+ found in the LICENSE file. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
@@ -21,7 +9,15 @@
android:layout_height="wrap_content"
android:paddingStart="15dp"
android:paddingEnd="15dp"
- android:minHeight="48dp">
+ android:minHeight="40dp">
+ <ImageView
+ android:id="@+id/browser_actions_menu_item_icon"
+ android:layout_width="20dp"
+ android:layout_height="match_parent"
+ android:paddingTop="10dp"
+ android:paddingBottom="10dp"
+ android:scaleType="centerInside"
+ android:contentDescription="@null" />
<TextView
android:id="@+id/browser_actions_menu_item_text"
android:layout_width="0dp"
@@ -31,12 +27,4 @@
android:layout_weight="1"
android:textSize="15sp"
android:textColor="@color/browser_actions_text_color" />
- <ImageView
- android:id="@+id/browser_actions_menu_item_icon"
- android:layout_width="20dp"
- android:layout_height="match_parent"
- android:paddingTop="8dp"
- android:paddingBottom="8dp"
- android:scaleType="centerInside"
- android:contentDescription="@null" />
</LinearLayout>
diff --git a/browser/src/main/res/values/colors.xml b/browser/src/main/res/values/colors.xml
index f21807f..3086991 100644
--- a/browser/src/main/res/values/colors.xml
+++ b/browser/src/main/res/values/colors.xml
@@ -1,18 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- 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
--->
+<!-- Copyright 2018 The Chromium Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style license that can be
+ found in the LICENSE file. -->
<resources>
<color name="browser_actions_text_color">#DE000000</color>
diff --git a/browser/src/main/res/values/dimens.xml b/browser/src/main/res/values/dimens.xml
index 463fa1f..b90750a 100644
--- a/browser/src/main/res/values/dimens.xml
+++ b/browser/src/main/res/values/dimens.xml
@@ -1,18 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- 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
--->
+<!-- Copyright 2018 The Chromium Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style license that can be
+ found in the LICENSE file. -->
<resources>
<!-- Browser Actions Context Menu Dimensions -->
diff --git a/browser/src/main/res/values/strings.xml b/browser/src/main/res/values/strings.xml
deleted file mode 100644
index b4c9924..0000000
--- a/browser/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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
--->
-
-<resources>
- <string name="fallback_menu_item_open_in_browser">Open in browser</string>
- <string name="fallback_menu_item_copy_link">Copy link</string>
- <string name="fallback_menu_item_share_link">Share link</string>
- <string name="copy_toast_msg">Link copied to clipboard</string>
-</resources>
\ No newline at end of file
diff --git a/browser/src/main/res/xml/image_share_filepaths.xml b/browser/src/main/res/xml/image_share_filepaths.xml
deleted file mode 100644
index 123fde9..0000000
--- a/browser/src/main/res/xml/image_share_filepaths.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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
--->
-
-<paths>
- <files-path path="image_provider/" name="image_provider_images" />
-</paths>
diff --git a/buildSrc/build_dependencies.gradle b/buildSrc/build_dependencies.gradle
index e7deb2c..eda9802d 100644
--- a/buildSrc/build_dependencies.gradle
+++ b/buildSrc/build_dependencies.gradle
@@ -16,9 +16,9 @@
def build_versions = [:]
-build_versions.kotlin = '1.3.10'
-build_versions.lint = '26.4.0-beta03'
-build_versions.dokka = "0.9.17-g20190228"
+build_versions.kotlin = '1.3.0'
+build_versions.lint = '26.3.0-rc01'
+build_versions.dokka = "0.9.17-g20181009"
rootProject.ext['build_versions'] = build_versions
@@ -32,7 +32,7 @@
logger.warn("USING OVERRIDDEN ANDROID GRADLE PLUGIN DEPENDENCY OF " + build_libs.gradle)
} else {
// Keep gradle plugin version in sync with ub_supportlib-master manifest.
- build_libs.gradle = 'com.android.tools.build:gradle:3.4.0-beta03'
+ build_libs.gradle = 'com.android.tools.build:gradle:3.3.0-rc01'
}
build_libs.lint = [
diff --git a/buildSrc/init.gradle b/buildSrc/init.gradle
index 36c5f72..f00abbc 100644
--- a/buildSrc/init.gradle
+++ b/buildSrc/init.gradle
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+
import androidx.build.BuildServerConfigurationKt
import androidx.build.dependencyTracker.AffectedModuleDetector
import androidx.build.gmaven.GMavenVersionChecker
@@ -92,7 +93,7 @@
// Copy instrumentation test APKs and app APKs into the dist dir
// For test apks, they are uploaded only if we have java test sources.
// For regular app apks, they are uploaded only if they have java sources.
- project.tasks.configureEach { task ->
+ project.tasks.whenTaskAdded { task ->
if (task.name.startsWith("packageDebug")) {
// run this task only if we should run it
def testApk = task.name.contains("AndroidTest")
@@ -141,21 +142,22 @@
}
// copy host side test results to DIST
- project.tasks.withType(Test) { task ->
- def junitReport = task.reports.junitXml
- if (junitReport.enabled) {
- def zipTask = project.tasks.create(
- name: "zipResultsOf${task.name.capitalize()}", type: Zip) {
- destinationDir(BuildServerConfigurationKt.getHostTestResultDirectory(project))
- // first one is always :, drop it.
- archiveName("${project.getPath().split(":").join("_").substring(1)}.zip")
- }
- if (BuildServerConfigurationKt.isRunningOnBuildServer()) {
- task.ignoreFailures = true
- }
- task.finalizedBy zipTask
- task.doFirst {
- zipTask.from(junitReport.destination)
+ project.tasks.whenTaskAdded { task ->
+ if (task instanceof org.gradle.api.tasks.testing.Test) {
+ def junitReport = task.reports.junitXml
+ if (junitReport.enabled) {
+ def zipTask = project.tasks.create(name : "zipResultsOf${task.name.capitalize()}", type : Zip) {
+ destinationDir(BuildServerConfigurationKt.getHostTestResultDirectory(project))
+ // first one is always :, drop it.
+ archiveName("${project.getPath().split(":").join("_").substring(1)}.zip")
+ }
+ if (BuildServerConfigurationKt.isRunningOnBuildServer()) {
+ task.ignoreFailures = true
+ }
+ task.finalizedBy zipTask
+ task.doFirst {
+ zipTask.from(junitReport.destination)
+ }
}
}
}
diff --git a/buildSrc/jetify.gradle b/buildSrc/jetify.gradle
index 95dc049a..2d161d5 100644
--- a/buildSrc/jetify.gradle
+++ b/buildSrc/jetify.gradle
@@ -19,7 +19,7 @@
def standaloneProject = project(":jetifier-standalone")
def jetifierBin = file("${standaloneProject.buildDir}/install/jetifier-standalone/bin/jetifier-standalone")
-def archivesToDejetify = [
+def commonArchivesToDejetify = [
"m2repository/androidx/activity/**",
"m2repository/androidx/annotation/**",
"m2repository/androidx/appcompat/**",
@@ -68,22 +68,54 @@
"m2repository/androidx/vectordrawable/**",
"m2repository/androidx/versionedparcelable/**",
"m2repository/androidx/viewpager/**",
- "m2repository/androidx/viewpager2/**",
- "m2repository/androidx/wear/**",
+ "m2repository/androidx/wear/**"
+]
+
+def extraArchivesForPartialDejetification = [
"m2repository/androidx/media2/**",
"m2repository/androidx/concurrent/**",
"m2repository/androidx/sharetarget/**"
]
+task stripReleasedArchive(type: Zip) {
+ dependsOn tasks[Release.FULL_ARCHIVE_TASK_NAME]
+ from zipTree(project.tasks['createArchive'].archivePath)
+ destinationDir rootProject.buildDir
+ archiveName "stripped_archive.zip"
+ include commonArchivesToDejetify
+
+}
+
task stripArchiveForPartialDejetification(type: Zip) {
dependsOn tasks[Release.FULL_ARCHIVE_TASK_NAME]
from zipTree(project.tasks['createArchive'].archivePath)
destinationDir rootProject.buildDir
archiveName "stripped_archive_partial.zip"
- include archivesToDejetify
+ include commonArchivesToDejetify + extraArchivesForPartialDejetification
}
+task dejetifyArchive(type: Exec) {
+ description "Produces a zip of dejetified artifacts by running Dejetifier against refactored" +
+ " artifacts, for temporary usage by external clients that haven't upgraded to Jetpack" +
+ " yet."
+
+ dependsOn ':jetifier-standalone:installDist'
+ dependsOn project.tasks['stripReleasedArchive']
+ inputs.file project.tasks['stripReleasedArchive'].archivePath
+
+ outputs.file "${BuildServerConfigurationKt.getDistributionDirectory(rootProject).absolutePath}/top-of-tree-m2repository-dejetified-${BuildServerConfigurationKt.getBuildId()}.zip"
+
+ commandLine (
+ "${jetifierBin}",
+ "-i", "${inputs.files.singleFile}",
+ "-o", "${outputs.files.singleFile}",
+ "--log", "warning",
+ "--reversed",
+ "--rebuildTopOfTree"
+ )
+}
+
task partiallyDejetifyArchive(type: Exec) {
description "Produces a zip of partially dejetified artifacts by running Dejetifier against refactored" +
" artifacts, for temporary migration purposes."
diff --git a/buildSrc/lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt b/buildSrc/lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt
index d0d4cb7..b0cfbc4 100644
--- a/buildSrc/lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt
+++ b/buildSrc/lint-checks/src/main/java/androidx/build/lint/AndroidXIssueRegistry.kt
@@ -23,7 +23,6 @@
BanParcelableUsage.ISSUE,
BanKeepAnnotation.ISSUE,
BanTargetApiAnnotation.ISSUE,
- MissingTestSizeAnnotation.ISSUE,
ObsoleteBuildCompatUsageDetector.ISSUE
)
}
diff --git a/buildSrc/lint-checks/src/main/java/androidx/build/lint/MissingTestSizeAnnotation.kt b/buildSrc/lint-checks/src/main/java/androidx/build/lint/MissingTestSizeAnnotation.kt
deleted file mode 100644
index 4c2d9e4..0000000
--- a/buildSrc/lint-checks/src/main/java/androidx/build/lint/MissingTestSizeAnnotation.kt
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2019 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.build.lint
-
-import com.android.tools.lint.client.api.UElementHandler
-import com.android.tools.lint.detector.api.Category
-import com.android.tools.lint.detector.api.Detector
-import com.android.tools.lint.detector.api.Implementation
-import com.android.tools.lint.detector.api.Issue
-import com.android.tools.lint.detector.api.JavaContext
-import com.android.tools.lint.detector.api.Scope
-import com.android.tools.lint.detector.api.Severity
-import com.android.tools.lint.detector.api.SourceCodeScanner
-import org.jetbrains.uast.UClass
-import org.jetbrains.uast.UElement
-import java.util.Collections
-import java.util.EnumSet
-
-class MissingTestSizeAnnotation : Detector(), SourceCodeScanner {
-
- override fun getApplicableUastTypes(): List<Class<out UElement>>? =
- Collections.singletonList(UClass::class.java)
-
- override fun createUastHandler(context: JavaContext): UElementHandler? {
- return TestSizeAnnotationHandler(context)
- }
-
- class TestSizeAnnotationHandler(private val context: JavaContext) : UElementHandler() {
- override fun visitClass(node: UClass) {
- // Ignore any non-test class (missing a @RunWith() annotation)
- val runWith = node.findAnnotation(RUN_WITH) ?: return
- // If the class has @RunWith(JUnit4.class), then it's a host side test and
- // we don't need to enforce annotations here
- if (runWith.attributeValues[0].expression.asRenderString() == JUNIT_RUNNER) {
- return
- }
- node.methods.filter {
- it.hasAnnotation(TEST_ANNOTATION)
- }.forEach { method ->
- val combinedAnnotations = node.annotations + method.annotations
- // Report an issue if neither the test method nor the surrounding class have a
- // valid test size annotation
- if (combinedAnnotations.none { it.qualifiedName in TEST_SIZE_ANNOTATIONS }) {
- context.report(
- ISSUE,
- method,
- context.getNameLocation(method),
- "Missing test size annotation"
- )
- }
- }
- }
- }
-
- companion object {
- const val RUN_WITH = "org.junit.runner.RunWith"
- const val JUNIT_RUNNER = "org.junit.runners.JUnit4"
- const val TEST_ANNOTATION = "org.junit.Test"
- val TEST_SIZE_ANNOTATIONS = listOf(
- "androidx.test.filters.SmallTest",
- "androidx.test.filters.MediumTest",
- "androidx.test.filters.LargeTest",
- "SmallTest",
- "MediumTest",
- "LargeTest"
- )
-
- val ISSUE = Issue.create(
- "MissingTestSizeAnnotation",
- "Missing test size annotation",
- "All tests require a valid test size annotation, on the class or per method." +
- "\nYou must use at least one of: @SmallTest, @MediumTest or @LargeTest." +
- "\nUse @SmallTest for tests that run in under 200ms, @MediumTest for tests " +
- "that run in under 1000ms, and @LargeTest for tests that run for more " +
- "than a second.",
- Category.CORRECTNESS, 5, Severity.ERROR,
- Implementation(
- MissingTestSizeAnnotation::class.java,
- EnumSet.of(Scope.JAVA_FILE, Scope.TEST_SOURCES)
- )
- )
- }
-}
diff --git a/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt b/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt
index e52874a..272f732 100644
--- a/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/AndroidXPlugin.kt
@@ -25,8 +25,7 @@
import androidx.build.checkapi.getLastReleasedApiFileFromDir
import androidx.build.checkapi.hasApiFolder
import androidx.build.dependencyTracker.AffectedModuleDetector
-import androidx.build.dokka.DokkaPublicDocs
-import androidx.build.dokka.DokkaSourceDocs
+import androidx.build.dokka.Dokka
import androidx.build.gradle.getByType
import androidx.build.gradle.isRoot
import androidx.build.jacoco.Jacoco
@@ -37,7 +36,6 @@
import com.android.build.gradle.BaseExtension
import com.android.build.gradle.LibraryExtension
import com.android.build.gradle.LibraryPlugin
-import com.android.build.gradle.internal.tasks.factory.dependsOn
import org.gradle.api.DefaultTask
import org.gradle.api.Task
import org.gradle.api.JavaVersion.VERSION_1_7
@@ -48,9 +46,10 @@
import org.gradle.api.plugins.JavaLibraryPlugin
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.plugins.JavaPluginConvention
-import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.bundling.Jar
+import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.kotlin.dsl.extra
+import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.getPlugin
import org.gradle.kotlin.dsl.withType
import java.util.concurrent.ConcurrentHashMap
@@ -86,9 +85,8 @@
targetCompatibility = VERSION_1_7
}
val verifyDependencyVersionsTask = project.createVerifyDependencyVersionsTask()
- verifyDependencyVersionsTask.configure {
- it.dependsOn(project.tasks.named(JavaPlugin.COMPILE_JAVA_TASK_NAME))
- }
+ val compileJavaTask = project.properties["compileJava"] as JavaCompile
+ verifyDependencyVersionsTask.dependsOn(compileJavaTask)
project.createCheckReleaseReadyTask(listOf(verifyDependencyVersionsTask))
}
is LibraryPlugin -> {
@@ -99,23 +97,17 @@
project.configureVersionFileWriter(extension)
project.configureResourceApiChecks()
val verifyDependencyVersionsTask = project.createVerifyDependencyVersionsTask()
- val checkNoWarningsTask = project.tasks.register(CHECK_NO_WARNINGS_TASK)
- // Only dump dependencies of published projects
- if (project.extra.has("publish")) {
- project.createDumpDependenciesTask()
- }
+ val checkNoWarningsTask = project.tasks.create(CHECK_NO_WARNINGS_TASK)
project.createCheckReleaseReadyTask(listOf(verifyDependencyVersionsTask,
checkNoWarningsTask))
extension.libraryVariants.all { libraryVariant ->
- verifyDependencyVersionsTask.configure { task ->
- task.dependsOn(libraryVariant.javaCompileProvider)
- }
- checkNoWarningsTask.dependsOn(libraryVariant.javaCompileProvider)
- project.gradle.taskGraph.whenReady { executionGraph ->
- if (executionGraph.hasTask(checkNoWarningsTask.get())) {
- libraryVariant.javaCompileProvider.configure { task ->
- task.options.compilerArgs.add("-Werror")
- }
+ val javaCompileTask = libraryVariant
+ .javaCompileProvider.get()
+ verifyDependencyVersionsTask.dependsOn(javaCompileTask)
+ checkNoWarningsTask.dependsOn(javaCompileTask)
+ project.gradle.taskGraph.whenReady {
+ if (it.hasTask(checkNoWarningsTask)) {
+ javaCompileTask.options.compilerArgs.add("-Werror")
}
}
}
@@ -147,25 +139,20 @@
private fun Project.configureRootProject() {
val buildOnServerTask = tasks.create(BUILD_ON_SERVER_TASK)
val buildTestApksTask = tasks.create(BUILD_TEST_APKS)
- project.configureDependencyGraphFileTask()
var projectModules = ConcurrentHashMap<String, String>()
project.extra.set("projects", projectModules)
tasks.all { task ->
if (task.name.startsWith(Release.DIFF_TASK_PREFIX) ||
"distDocs" == task.name ||
+ Dokka.ARCHIVE_TASK_NAME == task.name ||
"partiallyDejetifyArchive" == task.name ||
+ "dejetifyArchive" == task.name ||
CheckExternalDependencyLicensesTask.TASK_NAME == task.name) {
buildOnServerTask.dependsOn(task)
}
}
subprojects { project ->
- if (project.path == ":docs-runner") {
- project.tasks.all { task ->
- if (DokkaPublicDocs.ARCHIVE_TASK_NAME == task.name ||
- DokkaSourceDocs.ARCHIVE_TASK_NAME == task.name) {
- buildOnServerTask.dependsOn(task)
- }
- }
+ if (project.path == ":docs-fake") {
return@subprojects
}
project.tasks.all { task ->
@@ -261,11 +248,8 @@
extension.signingConfigs.getByName("debug").storeFile = SupportConfig.getKeystore(this)
// Disable generating BuildConfig.java
- // TODO remove after https://issuetracker.google.com/72050365
extension.variants.all {
- it.generateBuildConfigProvider.configure {
- it.enabled = false
- }
+ it.generateBuildConfig.enabled = false
}
configureErrorProneForAndroid(extension.variants)
@@ -323,35 +307,11 @@
}
}
- private fun Project.createVerifyDependencyVersionsTask():
- TaskProvider<VerifyDependencyVersionsTask> {
- return project.tasks.register("verifyDependencyVersions",
+ private fun Project.createVerifyDependencyVersionsTask(): DefaultTask {
+ return project.tasks.create("verifyDependencyVersions",
VerifyDependencyVersionsTask::class.java)
}
- // Task that creates a json file of a project's dependencies
- private fun Project.createDumpDependenciesTask():
- TaskProvider<ListProjectDependencyVersionsTask> {
- return project.tasks.register("dumpDependencies",
- ListProjectDependencyVersionsTask::class.java)
- }
-
- // Task that creates a json file of the AndroidX dependency graph (all projects)
- private fun Project.configureDependencyGraphFileTask() {
- project.tasks.register("createDependencyGraphFile",
- DependencyGraphFileTask::class.java) { depGraphTask ->
- subprojects { project ->
- project.tasks.all { dumpDepTask ->
- if ("dumpDependencies" == dumpDepTask.name &&
- dumpDepTask is ListProjectDependencyVersionsTask) {
- depGraphTask.dependsOn(dumpDepTask)
- depGraphTask.projectDepDumpFiles.add(dumpDepTask.outputDepFile)
- }
- }
- }
- }
- }
-
companion object {
const val BUILD_ON_SERVER_TASK = "buildOnServer"
const val BUILD_TEST_APKS = "buildTestApks"
@@ -389,11 +349,10 @@
}
}
-private fun Project.createCheckReleaseReadyTask(taskProviderList: List<TaskProvider<out Task>>) {
- project.tasks.register(AndroidXPlugin.CHECK_RELEASE_READY_TASK) {
- for (taskProvider in taskProviderList) {
- it.dependsOn(taskProvider)
- }
+private fun Project.createCheckReleaseReadyTask(taskList: List<Task>) {
+ val checkReleaseReadyTask = project.tasks.create(AndroidXPlugin.CHECK_RELEASE_READY_TASK)
+ for (task in taskList) {
+ checkReleaseReadyTask.dependsOn(task)
}
}
diff --git a/buildSrc/src/main/kotlin/androidx/build/DiffAndDocs.kt b/buildSrc/src/main/kotlin/androidx/build/DiffAndDocs.kt
index 224130c..d928e9d 100644
--- a/buildSrc/src/main/kotlin/androidx/build/DiffAndDocs.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/DiffAndDocs.kt
@@ -42,7 +42,6 @@
import org.gradle.api.file.FileTree
import org.gradle.api.plugins.JavaBasePlugin
import org.gradle.api.tasks.TaskContainer
-import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.bundling.Zip
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.api.tasks.javadoc.Javadoc
@@ -69,14 +68,14 @@
dacOptions: DacOptions,
additionalRules: List<PublishDocsRules> = emptyList()
) {
- private val anchorTask: TaskProvider<Task>
+ private val anchorTask: Task
private var docsProject: Project? = null
private val rules: List<PublishDocsRules>
- private val docsTasks: MutableMap<String, TaskProvider<GenerateDocsTask>> = mutableMapOf()
- private val aggregateOldApiTxtsTask: TaskProvider<ConcatenateFilesTask>
- private val aggregateNewApiTxtsTask: TaskProvider<ConcatenateFilesTask>
- private val generateDiffsTask: TaskProvider<JDiffTask>
+ private val docsTasks: MutableMap<String, GenerateDocsTask> = mutableMapOf()
+ private val aggregateOldApiTxtsTask: ConcatenateFilesTask
+ private val aggregateNewApiTxtsTask: ConcatenateFilesTask
+ private val generateDiffsTask: JDiffTask
init {
val doclavaConfiguration = root.configurations.create("doclava")
@@ -89,7 +88,7 @@
rules = additionalRules + TIP_OF_TREE
docsProject = root.findProject(":docs-fake")
- anchorTask = root.tasks.register("anchorDocsTask")
+ anchorTask = root.tasks.create("anchorDocsTask")
val generateSdkApiTask = createGenerateSdkApiTask(root, doclavaConfiguration)
val now = LocalDateTime.now()
// The diff output assumes that each library is of the same version,
@@ -113,10 +112,7 @@
taskName = "${it.name}DocsTask",
offline = offline)
docsTasks[it.name] = task
- val createDistDocsTask = createDistDocsTask(root, task, it.name)
- anchorTask.configure {
- it.dependsOn(createDistDocsTask)
- }
+ anchorTask.dependsOn(createDistDocsTask(root, task, it.name))
}
root.tasks.create("generateDocs") { task ->
@@ -127,35 +123,33 @@
val docletClasspath = doclavaConfiguration.resolve()
- aggregateOldApiTxtsTask = root.tasks.register("aggregateOldApiTxts",
- ConcatenateFilesTask::class.java) {
- it.Output = File(root.docsDir(), "previous.txt")
- }
+ aggregateOldApiTxtsTask = root.tasks.create("aggregateOldApiTxts",
+ ConcatenateFilesTask::class.java)
+ aggregateOldApiTxtsTask.Output = File(root.docsDir(), "previous.txt")
- val oldApisTask = root.tasks.register("oldApisXml",
+ val oldApisTask = root.tasks.createWithConfig("oldApisXml",
ApiXmlConversionTask::class.java) {
- it.classpath = root.files(docletClasspath)
- it.dependsOn(doclavaConfiguration)
+ classpath = root.files(docletClasspath)
+ dependsOn(doclavaConfiguration)
- it.inputApiFile = aggregateOldApiTxtsTask.get().Output
- it.dependsOn(aggregateOldApiTxtsTask)
+ inputApiFile = aggregateOldApiTxtsTask.Output
+ dependsOn(aggregateOldApiTxtsTask)
- it.outputApiXmlFile = File(root.docsDir(), "previous.xml")
+ outputApiXmlFile = File(root.docsDir(), "previous.xml")
}
- aggregateNewApiTxtsTask = root.tasks.register("aggregateNewApiTxts",
- ConcatenateFilesTask::class.java) {
- it.Output = File(root.docsDir(), newVersion)
- }
+ aggregateNewApiTxtsTask = root.tasks.create("aggregateNewApiTxts",
+ ConcatenateFilesTask::class.java)
+ aggregateNewApiTxtsTask.Output = File(root.docsDir(), newVersion)
- val newApisTask = root.tasks.register("newApisXml",
+ val newApisTask = root.tasks.createWithConfig("newApisXml",
ApiXmlConversionTask::class.java) {
- it.classpath = root.files(docletClasspath)
+ classpath = root.files(docletClasspath)
- it.inputApiFile = aggregateNewApiTxtsTask.get().Output
- it.dependsOn(aggregateNewApiTxtsTask)
+ inputApiFile = aggregateNewApiTxtsTask.Output
+ dependsOn(aggregateNewApiTxtsTask)
- it.outputApiXmlFile = File(root.docsDir(), "$newVersion.xml")
+ outputApiXmlFile = File(root.docsDir(), "$newVersion.xml")
}
val jdiffConfiguration = root.configurations.create("jdiff")
@@ -168,11 +162,7 @@
newApisTask,
jdiffConfiguration)
- generateDiffsTask.configure { diffTask ->
- docsTasks.values.forEach { docs ->
- diffTask.dependsOn(docs)
- }
- }
+ docsTasks.values.forEach { docs -> generateDiffsTask.dependsOn(docs) }
}
companion object {
@@ -194,7 +184,7 @@
supportRootFolder: File,
dacOptions: DacOptions,
additionalRules: List<PublishDocsRules> = emptyList()
- ): TaskProvider<Task> {
+ ): Task {
Preconditions.checkArgument(root.isRoot, "Must pass the root project")
Preconditions.checkState(root.extensions.findByName(EXT_NAME) == null,
"Cannot initialize DiffAndDocs twice")
@@ -241,8 +231,6 @@
it.exclude("**/*.html")
it.exclude("**/*.kt")
it.exclude("**/META-INF/**")
- it.exclude("**/OWNERS")
- it.exclude("**/NOTICE.txt")
}
root.configurations.remove(configuration)
return tree
@@ -259,13 +247,11 @@
}
}
appExtension.applicationVariants.all { v ->
- val taskProvider = docsTasks[v.flavorName]
- if (v.buildType.name == "release" && taskProvider != null) {
- registerAndroidProjectForDocsTask(taskProvider, v)
- taskProvider.configure {
- it.exclude { fileTreeElement ->
- fileTreeElement.path.endsWith(v.rFile())
- }
+ val task = docsTasks[v.flavorName]
+ if (v.buildType.name == "release" && task != null) {
+ registerAndroidProjectForDocsTask(task, v)
+ task.exclude { fileTreeElement ->
+ fileTreeElement.path.endsWith(v.rFile())
}
}
}
@@ -293,17 +279,13 @@
strategy.stubs?.forEach { path ->
depHandler.add("${rule.name}CompileOnly", root.files(path))
}
- docsTasks[rule.name]!!.configure {
- it.source(prebuiltSources(root, dependency, rule.name, resolvedRule))
- }
+ docsTasks[rule.name]!!.source(prebuiltSources(root, dependency,
+ rule.name, resolvedRule))
}
}
}
- private fun tipOfTreeTasks(
- extension: SupportLibraryExtension,
- setup: (TaskProvider<out DoclavaTask>) -> Unit
- ) {
+ private fun tipOfTreeTasks(extension: SupportLibraryExtension, setup: (DoclavaTask) -> Unit) {
rules.filter { rule -> rule.resolve(extension)?.strategy == TipOfTree }
.mapNotNull { rule -> docsTasks[rule.name] }
.forEach(setup)
@@ -314,7 +296,7 @@
* local API diff generation tasks.
*/
fun registerJavaProject(project: Project, extension: SupportLibraryExtension) {
- val compileJava = project.tasks.named("compileJava", JavaCompile::class.java)
+ val compileJava = project.properties["compileJava"] as JavaCompile
registerPrebuilts(extension)
@@ -335,9 +317,7 @@
registerJavaProjectForDocsTask(tasks.generateLocalDiffs, compileJava)
val generateApiDiffsArchiveTask = createGenerateLocalApiDiffsArchiveTask(project,
tasks.generateLocalDiffs)
- generateApiDiffsArchiveTask.configure {
- it.dependsOn(tasks.generateLocalDiffs)
- }
+ generateApiDiffsArchiveTask.dependsOn(tasks.generateLocalDiffs)
}
/**
@@ -355,10 +335,8 @@
if (variant.name == Release.DEFAULT_PUBLISH_CONFIG) {
// include R.file generated for prebuilts
rules.filter { it.resolve(extension)?.strategy is Prebuilts }.forEach { rule ->
- docsTasks[rule.name]?.configure {
- it.include { fileTreeElement ->
- fileTreeElement.path.endsWith(variant.rFile())
- }
+ docsTasks[rule.name]?.include { fileTreeElement ->
+ fileTreeElement.path.endsWith(variant.rFile())
}
}
@@ -377,9 +355,7 @@
registerAndroidProjectForDocsTask(tasks.generateLocalDiffs, variant)
val generateApiDiffsArchiveTask = createGenerateLocalApiDiffsArchiveTask(project,
tasks.generateLocalDiffs)
- generateApiDiffsArchiveTask.configure {
- it.dependsOn(tasks.generateLocalDiffs)
- }
+ generateApiDiffsArchiveTask.dependsOn(tasks.generateLocalDiffs)
}
}
}
@@ -396,26 +372,19 @@
} else {
extension.project.version()
}
- docsTasks[rules.name]!!.configure { docs ->
- // Track API change history.
- docs.addSinceFilesFrom(project.projectDir)
- // Associate current API surface with the Maven artifact.
- val artifact = "${project.group}:${project.name}:$version"
- docs.addArtifact(checkApiTasks.generateApi.get().apiFile!!.absolutePath, artifact)
- docs.dependsOn(checkApiTasks.generateApi)
- }
+ val docs = docsTasks[rules.name]!!
+ // Track API change history.
+ docs.addSinceFilesFrom(project.projectDir)
+ // Associate current API surface with the Maven artifact.
+ val artifact = "${project.group}:${project.name}:$version"
+ docs.addArtifact(checkApiTasks.generateApi.apiFile!!.absolutePath, artifact)
+ docs.dependsOn(checkApiTasks.generateApi)
}
}
private fun addCheckApiTasksToGraph(tasks: CheckApiTasks) {
- docsTasks.values.forEach { docs ->
- docs.configure {
- it.dependsOn(tasks.generateApi)
- }
- }
- anchorTask.configure {
- it.dependsOn(tasks.checkApi)
- }
+ docsTasks.values.forEach { docs -> docs.dependsOn(tasks.generateApi) }
+ anchorTask.dependsOn(tasks.checkApi)
}
}
@@ -431,18 +400,12 @@
* generated code may be resolved
* </ul>
*/
-private fun registerJavaProjectForDocsTask(
- docsTaskProvider: TaskProvider<out Javadoc>,
- javaCompileTaskProvider: TaskProvider<JavaCompile>
-) {
- docsTaskProvider.configure { docsTask ->
- docsTask.dependsOn(javaCompileTaskProvider)
- var javaCompileTask = javaCompileTaskProvider.get()
- docsTask.source(javaCompileTask.source)
- val project = docsTask.project
- docsTask.classpath += project.files(javaCompileTask.classpath) +
- project.files(javaCompileTask.destinationDir)
- }
+private fun registerJavaProjectForDocsTask(task: Javadoc, javaCompileTask: JavaCompile) {
+ task.dependsOn(javaCompileTask)
+ task.source(javaCompileTask.source)
+ val project = task.project
+ task.classpath += project.files(javaCompileTask.classpath) +
+ project.files(javaCompileTask.destinationDir)
}
/**
@@ -450,25 +413,19 @@
* <p>
* @see #registerJavaProjectForDocsTask
*/
-private fun registerAndroidProjectForDocsTask(
- task: TaskProvider<out Javadoc>,
- releaseVariant: BaseVariant
-) {
+private fun registerAndroidProjectForDocsTask(task: Javadoc, releaseVariant: BaseVariant) {
// This code makes a number of unsafe assumptions about Android Gradle Plugin,
// and there's a good chance that this will break in the near future.
- val javaCompileProvider = releaseVariant.javaCompileProvider
- task.configure {
- it.dependsOn(javaCompileProvider)
- it.include { fileTreeElement ->
- fileTreeElement.name != "R.java" ||
- fileTreeElement.path.endsWith(releaseVariant.rFile())
- }
- it.source(javaCompileProvider.map {
- it.source
- })
- it.classpath += releaseVariant.getCompileClasspath(null) +
- it.project.files(javaCompileProvider.get().destinationDir)
+ @Suppress("DEPRECATION")
+ task.dependsOn(releaseVariant.javaCompile)
+ task.include { fileTreeElement ->
+ fileTreeElement.name != "R.java" || fileTreeElement.path.endsWith(releaseVariant.rFile())
}
+ @Suppress("DEPRECATION")
+ task.source(releaseVariant.javaCompile.source)
+ @Suppress("DEPRECATION")
+ task.classpath += releaseVariant.getCompileClasspath(null) +
+ task.project.files(releaseVariant.javaCompile.destinationDir)
}
/**
@@ -501,57 +458,50 @@
*/
private fun createGenerateDiffsTask(
project: Project,
- oldApiTask: TaskProvider<ApiXmlConversionTask>,
- newApiTask: TaskProvider<ApiXmlConversionTask>,
+ oldApiTask: ApiXmlConversionTask,
+ newApiTask: ApiXmlConversionTask,
jdiffConfig: Configuration
-): TaskProvider<JDiffTask> =
- project.tasks.register("generateDiffs", JDiffTask::class.java) {
- it.apply {
- // Base classpath is Android SDK, sub-projects add their own.
- classpath = androidJarFile(project)
+): JDiffTask =
+ project.tasks.createWithConfig("generateDiffs", JDiffTask::class.java) {
+ // Base classpath is Android SDK, sub-projects add their own.
+ classpath = androidJarFile(project)
- // JDiff properties.
- oldApiXmlFile = oldApiTask.get().outputApiXmlFile
- newApiXmlFile = newApiTask.get().outputApiXmlFile
+ // JDiff properties.
+ oldApiXmlFile = oldApiTask.outputApiXmlFile
+ newApiXmlFile = newApiTask.outputApiXmlFile
- val newApi = newApiXmlFile.name.substringBeforeLast('.')
- val docsDir = File(project.rootProject.docsDir(), "public")
+ val newApi = newApiXmlFile.name.substringBeforeLast('.')
+ val docsDir = File(project.rootProject.docsDir(), "public")
- newJavadocPrefix = "../../../../../reference/"
- destinationDir = File(docsDir,
- "online/sdk/support_api_diff/${project.name}/$newApi")
+ newJavadocPrefix = "../../../../../reference/"
+ destinationDir = File(docsDir, "online/sdk/support_api_diff/${project.name}/$newApi")
- // Javadoc properties.
- docletpath = jdiffConfig.resolve()
- title = "Support Library API Differences Report"
+ // Javadoc properties.
+ docletpath = jdiffConfig.resolve()
+ title = "Support Library API Differences Report"
- exclude("**/R.java")
- dependsOn(oldApiTask, newApiTask, jdiffConfig)
- doLast {
- project.logger.lifecycle("generated diffs into $destinationDir")
- }
+ exclude("**/R.java")
+ dependsOn(oldApiTask, newApiTask, jdiffConfig)
+ doLast {
+ project.logger.lifecycle("generated diffs into $destinationDir")
}
}
// Generates a distribution artifact for online docs.
private fun createDistDocsTask(
project: Project,
- generateDocs: TaskProvider<out DoclavaTask>,
+ generateDocs: DoclavaTask,
ruleName: String = ""
-): TaskProvider<Zip> = project.tasks.register("dist${ruleName}Docs", Zip::class.java) {
- it.apply {
- dependsOn(generateDocs)
- group = JavaBasePlugin.DOCUMENTATION_GROUP
- description = "Generates distribution artifact for d.android.com-style documentation."
- from(generateDocs.map {
- it.destinationDir
- })
- baseName = "android-support-$ruleName-docs"
- version = getBuildId()
- destinationDir = project.getDistributionDirectory()
- doLast {
- logger.lifecycle("'Wrote API reference to $archivePath")
- }
+): Zip = project.tasks.createWithConfig("dist${ruleName}Docs", Zip::class.java) {
+ dependsOn(generateDocs)
+ group = JavaBasePlugin.DOCUMENTATION_GROUP
+ description = "Generates distribution artifact for d.android.com-style documentation."
+ from(generateDocs.destinationDir)
+ baseName = "android-support-$ruleName-docs"
+ version = getBuildId()
+ destinationDir = project.getDistributionDirectory()
+ doLast {
+ logger.lifecycle("'Wrote API reference to $archivePath")
}
}
@@ -593,60 +543,56 @@
destDir: File,
taskName: String = "generateDocs",
offline: Boolean
-): TaskProvider<GenerateDocsTask> =
- project.tasks.register(taskName, GenerateDocsTask::class.java) {
- it.apply {
- dependsOn(generateSdkApiTask, doclavaConfig)
- group = JavaBasePlugin.DOCUMENTATION_GROUP
- description = "Generates d.android.com-style documentation. To generate offline " +
- "docs use \'-PofflineDocs=true\' parameter."
+): GenerateDocsTask =
+ project.tasks.createWithConfig(taskName, GenerateDocsTask::class.java) {
+ dependsOn(generateSdkApiTask, doclavaConfig)
+ group = JavaBasePlugin.DOCUMENTATION_GROUP
+ description = "Generates d.android.com-style documentation. To generate offline docs " +
+ "use \'-PofflineDocs=true\' parameter."
- setDocletpath(doclavaConfig.resolve())
- destinationDir = File(destDir, if (offline) "offline" else "online")
- classpath = androidJarFile(project)
- checksConfig = GENERATE_DOCS_CONFIG
- addSinceFilesFrom(supportRootFolder)
+ setDocletpath(doclavaConfig.resolve())
+ destinationDir = File(destDir, if (offline) "offline" else "online")
+ classpath = androidJarFile(project)
+ checksConfig = GENERATE_DOCS_CONFIG
+ addSinceFilesFrom(supportRootFolder)
- coreJavadocOptions {
- addStringOption("templatedir",
+ coreJavadocOptions {
+ addStringOption("templatedir",
"$supportRootFolder/../../external/doclava/res/assets/templates-sdk")
- addStringOption("samplesdir", "$supportRootFolder/samples")
- addMultilineMultiValueOption("federate").value = listOf(
+ addStringOption("samplesdir", "$supportRootFolder/samples")
+ addMultilineMultiValueOption("federate").value = listOf(
listOf("Android", "https://developer.android.com")
- )
- addMultilineMultiValueOption("federationapi").value = listOf(
+ )
+ addMultilineMultiValueOption("federationapi").value = listOf(
listOf("Android", generateSdkApiTask.apiFile?.absolutePath)
- )
- addMultilineMultiValueOption("hdf").value = listOf(
+ )
+ addMultilineMultiValueOption("hdf").value = listOf(
listOf("android.whichdoc", "online"),
listOf("android.hasSamples", "true"),
listOf("dac", "true")
- )
+ )
- // Specific to reference docs.
- if (!offline) {
- addStringOption("toroot", "/")
- addBooleanOption("devsite", true)
- addBooleanOption("yamlV2", true)
- addStringOption("dac_libraryroot", dacOptions.libraryroot)
- addStringOption("dac_dataname", dacOptions.dataname)
- }
+ // Specific to reference docs.
+ if (!offline) {
+ addStringOption("toroot", "/")
+ addBooleanOption("devsite", true)
+ addBooleanOption("yamlV2", true)
+ addStringOption("dac_libraryroot", dacOptions.libraryroot)
+ addStringOption("dac_dataname", dacOptions.dataname)
}
-
- addArtifactsAndSince()
}
+
+ addArtifactsAndSince()
}
private fun createGenerateLocalApiDiffsArchiveTask(
project: Project,
- diffTask: TaskProvider<JDiffTask>
-): TaskProvider<Zip> = project.tasks.register("generateLocalApiDiffsArchive", Zip::class.java) {
+ diffTask: JDiffTask
+): Zip = project.tasks.createWithConfig("generateLocalApiDiffsArchive", Zip::class.java) {
val docsDir = project.rootProject.docsDir()
- it.from(diffTask.map {
- it.destinationDir
- })
- it.destinationDir = File(docsDir, "online/sdk/support_api_diff/${project.name}")
- it.to("${project.version}.zip")
+ from(diffTask.destinationDir)
+ destinationDir = File(docsDir, "online/sdk/support_api_diff/${project.name}")
+ to("${project.version}.zip")
}
private fun sdkApiFile(project: Project) = File(project.docsDir(), "release/sdk_current.txt")
@@ -665,6 +611,14 @@
private fun androidSrcJarFile(project: Project): File = File(project.sdkPath(),
"platforms/${SupportConfig.COMPILE_SDK_VERSION}/android-stubs-src.jar")
+private fun PublishDocsRules.resolve(extension: SupportLibraryExtension): DocsRule? {
+ val mavenGroup = extension.mavenGroup
+ return if (mavenGroup == null) null else resolve(mavenGroup, extension.project.name)
+}
+
+private fun Prebuilts.dependency(extension: SupportLibraryExtension) =
+ "${extension.mavenGroup}:${extension.project.name}:$version"
+
private fun BaseVariant.rFile() = "${applicationId.replace('.', '/')}/R.java"
// Nasty part. Get rid of that eventually!
diff --git a/buildSrc/src/main/kotlin/androidx/build/ErrorProneConfiguration.kt b/buildSrc/src/main/kotlin/androidx/build/ErrorProneConfiguration.kt
index 10f0a65..a8532b7 100644
--- a/buildSrc/src/main/kotlin/androidx/build/ErrorProneConfiguration.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/ErrorProneConfiguration.kt
@@ -23,10 +23,9 @@
import org.gradle.api.DomainObjectSet
import org.gradle.api.Project
import org.gradle.api.logging.Logging
-import org.gradle.api.plugins.JavaPlugin.COMPILE_JAVA_TASK_NAME
-import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.kotlin.dsl.apply
+import org.gradle.kotlin.dsl.withType
const val ERROR_PRONE_TASK = "runErrorProne"
@@ -35,18 +34,20 @@
fun Project.configureErrorProneForJava() {
val toolChain = createErrorProneToolChain()
- val javaCompileProvider = project.tasks.named(COMPILE_JAVA_TASK_NAME, JavaCompile::class.java)
- log.info("Configuring error-prone for ${project.path}")
- makeErrorProneTask(javaCompileProvider, toolChain)
+ tasks.withType<JavaCompile>().all { task ->
+ log.info("Configuring error-prone for ${task.path}")
+ makeErrorProneTask(task, toolChain)
+ }
}
fun Project.configureErrorProneForAndroid(variants: DomainObjectSet<out BaseVariant>) {
val toolChain = createErrorProneToolChain()
variants.all { variant ->
if (variant.buildType.name == BuilderConstants.DEBUG) {
- val task = variant.javaCompileProvider
+ @Suppress("DEPRECATION")
+ val task = variant.javaCompileProvider.get()
- log.info("Configuring error-prone for ${variant.name}'s java compile")
+ log.info("Configuring error-prone for ${task.path}")
makeErrorProneTask(task, toolChain)
}
}
@@ -105,30 +106,23 @@
* Given a [JavaCompile] task, creates a task that runs the ErrorProne compiler with the same
* settings.
*/
-private fun Project.makeErrorProneTask(
- compileTaskProvider: TaskProvider<JavaCompile>,
- toolChain: ErrorProneToolChain
-) {
- val provider = maybeRegister<JavaCompile>(
- name = ERROR_PRONE_TASK,
- onConfigure = {
- val compileTask = compileTaskProvider.get()
- it.classpath = compileTask.classpath
+private fun Project.makeErrorProneTask(compileTask: JavaCompile, toolChain: ErrorProneToolChain) {
+ if (tasks.findByName(ERROR_PRONE_TASK) != null) {
+ return
+ }
- it.source = compileTask.source
- it.destinationDir = file(buildDir.resolve("errorProne"))
- it.options.compilerArgs = compileTask.options.compilerArgs.toMutableList()
- it.options.annotationProcessorPath = compileTask.options.annotationProcessorPath
- it.options.bootstrapClasspath = compileTask.options.bootstrapClasspath
- it.sourceCompatibility = compileTask.sourceCompatibility
- it.targetCompatibility = compileTask.targetCompatibility
- it.configureWithErrorProne(toolChain)
- it.dependsOn(compileTask.dependsOn)
- },
- onRegister = { errorProneProvider ->
- tasks.named("check").configure {
- it.dependsOn(errorProneProvider)
- }
- }
- )
+ val errorProneTask = tasks.create(ERROR_PRONE_TASK, JavaCompile::class.java)
+ errorProneTask.classpath = compileTask.classpath
+
+ errorProneTask.source = compileTask.source
+ errorProneTask.destinationDir = file(buildDir.resolve("errorProne"))
+ errorProneTask.options.compilerArgs = compileTask.options.compilerArgs.toMutableList()
+ errorProneTask.options.annotationProcessorPath = compileTask.options.annotationProcessorPath
+ errorProneTask.options.bootstrapClasspath = compileTask.options.bootstrapClasspath
+ errorProneTask.sourceCompatibility = compileTask.sourceCompatibility
+ errorProneTask.targetCompatibility = compileTask.targetCompatibility
+ errorProneTask.configureWithErrorProne(toolChain)
+ errorProneTask.dependsOn(compileTask.dependsOn)
+
+ tasks.getByName("check").dependsOn(errorProneTask)
}
diff --git a/buildSrc/src/main/kotlin/androidx/build/LibraryGroups.kt b/buildSrc/src/main/kotlin/androidx/build/LibraryGroups.kt
index 049ca9e..170e2f3 100644
--- a/buildSrc/src/main/kotlin/androidx/build/LibraryGroups.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/LibraryGroups.kt
@@ -24,7 +24,6 @@
const val ANIMATION = "androidx.animation"
const val ANNOTATION = "androidx.annotation"
const val APPCOMPAT = "androidx.appcompat"
- const val ARCH_CORE = "androidx.arch.core"
const val ASYNCLAYOUTINFLATER = "androidx.asynclayoutinflater"
const val BIOMETRIC = "androidx.biometric"
const val BROWSER = "androidx.browser"
@@ -48,40 +47,40 @@
const val GRIDLAYOUT = "androidx.gridlayout"
const val HEIFWRITER = "androidx.heifwriter"
const val INTERPOLATOR = "androidx.interpolator"
- const val JETIFIER = "com.android.tools.build.jetifier"
const val LEANBACK = "androidx.leanback"
const val LEGACY = "androidx.legacy"
- const val LIFECYCLE = "androidx.lifecycle"
const val LOADER = "androidx.loader"
const val LOCALBROADCASTMANAGER = "androidx.localbroadcastmanager"
const val MEDIA = "androidx.media"
const val MEDIA2 = "androidx.media2"
const val MEDIAROUTER = "androidx.mediarouter"
- const val NAVIGATION = "androidx.navigation"
- const val PAGING = "androidx.paging"
const val PALETTE = "androidx.palette"
const val PERCENTLAYOUT = "androidx.percentlayout"
- const val PERSISTENCE = "androidx.sqlite"
const val PREFERENCE = "androidx.preference"
const val PRINT = "androidx.print"
const val RECOMMENDATION = "androidx.recommendation"
const val RECYCLERVIEW = "androidx.recyclerview"
const val SAVEDSTATE = "androidx.savedstate"
- const val SECURITY = "androidx.security"
const val SHARETARGET = "androidx.sharetarget"
const val SLICE = "androidx.slice"
const val REMOTECALLBACK = "androidx.remotecallback"
- const val ROOM = "androidx.room"
const val SLIDINGPANELAYOUT = "androidx.slidingpanelayout"
const val SWIPEREFRESHLAYOUT = "androidx.swiperefreshlayout"
const val TEXTCLASSIFIER = "androidx.textclassifier"
const val TRANSITION = "androidx.transition"
const val TVPROVIDER = "androidx.tvprovider"
const val VECTORDRAWABLE = "androidx.vectordrawable"
- const val VERSIONEDPARCELABLE = "androidx.versionedparcelable"
const val VIEWPAGER = "androidx.viewpager"
const val VIEWPAGER2 = "androidx.viewpager2"
const val WEAR = "androidx.wear"
const val WEBKIT = "androidx.webkit"
+ const val ROOM = "androidx.room"
+ const val PERSISTENCE = "androidx.sqlite"
+ const val LIFECYCLE = "androidx.lifecycle"
+ const val ARCH_CORE = "androidx.arch.core"
+ const val PAGING = "androidx.paging"
+ const val NAVIGATION = "android.arch.navigation"
+ const val JETIFIER = "com.android.tools.build.jetifier"
const val WORKMANAGER = "android.arch.work"
+ const val VERSIONEDPARCELABLE = "androidx.versionedparcelable"
}
diff --git a/buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt b/buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
index 1d39675..61a05c9 100644
--- a/buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/LibraryVersions.kt
@@ -20,83 +20,81 @@
* The list of versions codes of all the libraries in this project.
*/
object LibraryVersions {
- val ACTIVITY = Version("1.0.0-alpha05")
+ val ACTIVITY = Version("1.0.0-alpha04")
val ANIMATION = Version("1.0.0-alpha01")
- val ANIMATION_TESTING = Version("1.1.0-alpha01")
- val ANNOTATION = Version("1.1.0-alpha02")
- val APPCOMPAT = Version("1.1.0-alpha03")
- val ARCH_CORE = Version("2.1.0-alpha01")
+ val ANIMATION_TESTING = Version("1.0.0")
+ val ANNOTATION = Version("1.1.0-alpha01")
+ val APPCOMPAT = Version("1.1.0-alpha02")
+ val ARCH_CORE = Version("2.0.0")
val ARCH_CORE_TESTING = ARCH_CORE
- val ARCH_RUNTIME = Version("2.1.0-alpha01")
- val ASYNCLAYOUTINFLATER = Version("1.1.0-alpha01")
+ val ARCH_RUNTIME = Version("2.0.1-alpha01")
+ val ASYNCLAYOUTINFLATER = Version("1.0.0")
val BENCHMARK = Version("1.0.0-alpha01")
val BIOMETRIC = Version("1.0.0-alpha04")
- val BROWSER = Version("1.1.0-alpha02")
- val CAR = Version("1.0.0-alpha7")
+ val BROWSER = Version("1.0.0")
+ val CAR = Version("1.0.0-alpha6")
val CAR_CLUSTER = Version("1.0.0-alpha5")
val CAR_MODERATOR = Version("1.0.0-alpha1")
- val CARDVIEW = Version("1.1.0-alpha01")
- val COLLECTION = Version("1.1.0-alpha03")
- val CONTENTPAGER = Version("1.1.0-alpha01")
+ val CARDVIEW = Version("1.0.0")
+ val COLLECTION = Version("1.1.0-alpha02")
+ val CONTENTPAGER = Version("1.0.0")
val COORDINATORLAYOUT = Version("1.1.0-alpha02")
- val CORE = Version("1.1.0-alpha05")
- val CURSORADAPTER = Version("1.1.0-alpha01")
- val CUSTOMVIEW = Version("1.1.0-alpha01")
- val DOCUMENTFILE = Version("1.1.0-alpha01")
- val DRAWERLAYOUT = Version("1.1.0-alpha01")
- val DYNAMICANIMATION = Version("1.1.0-alpha01")
- val DYNAMICANIMATION_KTX = Version("1.0.0-alpha02")
- val EMOJI = Version("1.1.0-alpha01")
+ val CORE = Version("1.1.0-alpha04")
+ val CURSORADAPTER = Version("1.0.0")
+ val CUSTOMVIEW = Version("1.0.0")
+ val DOCUMENTFILE = Version("1.0.0")
+ val DRAWERLAYOUT = Version("1.0.0")
+ val DYNAMICANIMATION = Version("1.0.0")
+ val DYNAMICANIMATION_KTX = Version("1.0.0-alpha01")
+ val EMOJI = Version("1.0.0")
val ENTERPRISE = Version("1.0.0-alpha01")
- val EXIFINTERFACE = Version("1.1.0-alpha01")
- val FRAGMENT = Version("1.1.0-alpha05")
+ val EXIFINTERFACE = Version("1.0.0")
+ val FRAGMENT = Version("1.1.0-alpha04")
val FUTURES = Version("1.0.0-alpha03")
val GRIDLAYOUT = Version("1.1.0-alpha01")
- val HEIFWRITER = Version("1.1.0-alpha01")
- val INTERPOLATOR = Version("1.1.0-alpha01")
- val JETIFIER = Version("1.0.0-beta04")
- val LEANBACK = Version("1.1.0-alpha02")
- val LEANBACK_PREFERENCE = Version("1.1.0-alpha02")
- val LEGACY = Version("1.1.0-alpha01")
- val LOCALBROADCASTMANAGER = Version("1.1.0-alpha02")
- val LIFECYCLE = Version("2.1.0-alpha03")
- val LIFECYCLES_COROUTINES = Version("1.0.0-alpha01")
+ val HEIFWRITER = Version("1.0.0")
+ val INTERPOLATOR = Version("1.0.0")
+ val JETIFIER = Version("1.0.0-beta03")
+ val LEANBACK = Version("1.1.0-alpha01")
+ val LEANBACK_PREFERENCE = Version("1.1.0-alpha01")
+ val LEGACY = Version("1.0.0")
+ val LOCALBROADCASTMANAGER = Version("1.1.0-alpha01")
+ val LIFECYCLE = Version("2.1.0-alpha02")
val LIFECYCLES_SAVEDSTATE = Version("1.0.0-alpha01")
val LOADER = Version("1.1.0-beta01")
- val MEDIA = Version("1.1.0-alpha02")
+ val MEDIA = Version("1.1.0-alpha01")
val MEDIA2 = Version("1.0.0-alpha05")
- val MEDIA2_EXOPLAYER = Version("1.0.0-alpha02")
+ val MEDIA2_EXOPLAYER = Version("1.0.0-alpha01")
val MEDIA2_WIDGET = Version("1.0.0-alpha07")
- val MEDIAROUTER = Version("1.1.0-alpha02")
- val NAVIGATION = Version("2.0.0-rc02")
+ val MEDIAROUTER = Version("1.1.0-alpha01")
+ val NAVIGATION = Version("1.0.0-alpha11")
val NAVIGATION_TESTING = Version("1.0.0-alpha08") // Unpublished
val PAGING = Version("2.2.0-alpha01")
val PALETTE = Version("1.1.0-alpha01")
- val PRINT = Version("1.1.0-alpha01")
- val PERCENTLAYOUT = Version("1.1.0-alpha01")
- val PERSISTENCE = Version("2.0.1")
- val PREFERENCE = Version("1.1.0-alpha04")
- val RECOMMENDATION = Version("1.1.0-alpha01")
- val RECYCLERVIEW = Version("1.1.0-alpha03")
+ val PRINT = Version("1.0.0")
+ val PERCENTLAYOUT = Version("1.0.0")
+ val PERSISTENCE = Version("2.0.0")
+ val PREFERENCE = Version("1.1.0-alpha03")
+ val RECOMMENDATION = Version("1.0.0")
+ val RECYCLERVIEW = Version("1.1.0-alpha02")
val REMOTECALLBACK = Version("1.0.0-alpha02")
- val ROOM = Version("2.1.0-alpha05")
- val SAVEDSTATE = Version("1.0.0-alpha02")
- val SECURITY = Version("1.0.0-alpha01")
+ val ROOM = Version("2.1.0-alpha04")
+ val SAVEDSTATE = Version("1.0.0-alpha01")
val SHARETARGET = Version("1.0.0-alpha01")
val SLICE = Version("1.1.0-alpha01")
- val SLICE_BENCHMARK = Version("1.1.0-alpha01")
- val SLICE_BUILDERS_KTX = Version("1.0.0-alpha07")
- val SLIDINGPANELAYOUT = Version("1.1.0-alpha01")
+ val SLICE_BENCHMARK = Version("1.0.0")
+ val SLICE_BUILDERS_KTX = Version("1.0.0-alpha6")
+ val SLIDINGPANELAYOUT = Version("1.0.0")
val SWIPE_REFRESH_LAYOUT = Version("1.1.0-alpha01")
- val TEXTCLASSIFIER = Version("1.0.0-alpha03")
+ val TEXTCLASSIFIER = Version("1.0.0-alpha02")
val TRANSITION = Version("1.1.0-alpha02")
- val TVPROVIDER = Version("1.1.0-alpha01")
- val VECTORDRAWABLE = Version("1.1.0-alpha02")
- val VECTORDRAWABLE_ANIMATED = Version("1.1.0-alpha02")
+ val TVPROVIDER = Version("1.0.0")
+ val VECTORDRAWABLE = Version("1.1.0-alpha01")
+ val VECTORDRAWABLE_ANIMATED = Version("1.1.0-alpha01")
val VERSIONED_PARCELABLE = Version("1.1.0-alpha02")
val VIEWPAGER = Version("1.1.0-alpha01")
- val VIEWPAGER2 = Version("1.0.0-alpha02")
- val WEAR = Version("1.1.0-alpha01")
+ val VIEWPAGER2 = Version("1.0.0-alpha01")
+ val WEAR = Version("1.0.0")
val WEBKIT = Version("1.1.0-alpha01")
- val WORKMANAGER = Version("1.0.0")
+ val WORKMANAGER = Version("1.0.0-beta04")
}
diff --git a/buildSrc/src/main/kotlin/androidx/build/LintConfiguration.kt b/buildSrc/src/main/kotlin/androidx/build/LintConfiguration.kt
index 520fae6..be1d3e8 100644
--- a/buildSrc/src/main/kotlin/androidx/build/LintConfiguration.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/LintConfiguration.kt
@@ -25,13 +25,9 @@
apply(mapOf("plugin" to "com.android.lint"))
// Create fake variant tasks since that is what is invoked on CI and by developers.
- val lintTask = tasks.named("lint")
- tasks.register("lintDebug") {
- it.dependsOn(lintTask)
- }
- tasks.register("lintRelease") {
- it.dependsOn(lintTask)
- }
+ val lintTask = tasks.getByName("lint")
+ tasks.create("lintDebug").dependsOn(lintTask)
+ tasks.create("lintRelease").dependsOn(lintTask)
val lintOptions = extensions.getByType<LintOptions>()
project.configureLint(lintOptions, extension)
diff --git a/buildSrc/src/main/kotlin/androidx/build/ListDependencyVersionsTask.kt b/buildSrc/src/main/kotlin/androidx/build/ListDependencyVersionsTask.kt
deleted file mode 100644
index ac7c020..0000000
--- a/buildSrc/src/main/kotlin/androidx/build/ListDependencyVersionsTask.kt
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (C) 2019 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.build
-
-import org.gradle.api.DefaultTask
-import org.gradle.api.artifacts.ProjectDependency
-import org.gradle.api.artifacts.ExternalModuleDependency
-import org.gradle.api.tasks.TaskAction
-import com.google.gson.Gson
-import com.google.gson.GsonBuilder
-import java.io.File
-import java.lang.StringBuilder
-
-/**
- * Task to create a json file containing the set of all dependencies for each
- * Gradle Configuration of this project
- */
-open class ListProjectDependencyVersionsTask : DefaultTask() {
-
- init {
- group = "Help"
- description = "Creates a json file of the project-specificndependency information in " +
- getProjectDependencyGraphFileName()
- }
-
- // Output Dependency Graph File
- var outputDepFile = File(getProjectDependencyGraphFileName())
-
- data class ArtifactDependency(
- val artifactId: String,
- val groupId: String,
- val version: String,
- val isProjectDependency: Boolean
- )
- data class ResolvedArtifact(
- val artifactId: String,
- val groupId: String,
- val version: String
- ) {
- val prebuiltDependencies: MutableList<ArtifactDependency> = mutableListOf()
- val projectDependency: MutableList<ArtifactDependency> = mutableListOf()
- }
-
- private fun getProjectDependencyGraphDirName(): String {
- return project.buildDir.toString() + "/dependencyGraph"
- }
-
- private fun getProjectDependencyGraphFileName(): String {
- return "${getProjectDependencyGraphDirName()}/${project.name}-dependency-graph.json"
- }
-
- private fun writeJsonToFile(artifact: ResolvedArtifact) {
- // Create the dependencyGraph folder and file in build directory of project
- var outBuildDir = File(getProjectDependencyGraphDirName())
- if (!outBuildDir.exists()) {
- if (!outBuildDir.mkdirs()) {
- throw RuntimeException("Failed to create " +
- "output directory: $outBuildDir")
- }
- }
- if (!outputDepFile.exists()) {
- if (!outputDepFile.createNewFile()) {
- throw RuntimeException("Failed to create " +
- "output dependency dump file: $outputDepFile")
- }
- }
-
- // Create json object from the artifact instance
- val gson = GsonBuilder().setPrettyPrinting().create()
- val jsonArtifact: String = gson.toJson(artifact)
- outputDepFile.writeText(jsonArtifact)
- }
-
- private fun resolveAndCollectDependencies(): ResolvedArtifact {
- val artifact = ResolvedArtifact(project.name.toString(),
- project.group.toString(),
- project.version.toString())
- val dependencySet: MutableSet<String> = mutableSetOf()
- project.configurations.all { configuration ->
- configuration.allDependencies.forEach { dep ->
- // Only consider androidx dependencies
- if (dep.group != null &&
- dep.group.toString().startsWith("androidx.") &&
- !dep.group.toString().startsWith("androidx.test")) {
- val depString: String = "${dep.group}:${dep.name}:${dep.version}"
- if (!(dependencySet.contains(depString))) {
- if (dep is ProjectDependency) {
- artifact.projectDependency.add(
- ArtifactDependency(
- dep.name.toString(),
- dep.group.toString(),
- dep.version.toString(),
- true)
- )
- dependencySet.add(depString)
- } else if (dep is ExternalModuleDependency) {
- artifact.prebuiltDependencies.add(
- ArtifactDependency(
- dep.name.toString(),
- dep.group.toString(),
- dep.version.toString(),
- false)
- )
- dependencySet.add(depString)
- }
- }
- }
- }
- }
- return artifact
- }
-
- /**
- * Task: dumpDependencies
- * Iterates through each configuration of the project and builds the set of all dependencies.
- * Then adds each dependency to the Artifact class as a project or prebuilt dependency. Finally,
- * writes these dependencies to a json file as a json object.
- */
- @TaskAction
- fun dumpDependencies() {
- val resolvedArtifact = resolveAndCollectDependencies()
- writeJsonToFile(resolvedArtifact)
- }
-}
-
-/**
- * Task for a json file of all dependencies for each artifactId
- */
-open class DependencyGraphFileTask : DefaultTask() {
- init {
- group = "Help"
- description = "Creates a json file of the AndroidX dependency graph in" +
- getDependencyGraphFileName()
- }
-
- // List of each project Dependency File where all dependencies were dumped
- var projectDepDumpFiles: MutableList<File> = mutableListOf()
-
- private fun getDependencyGraphDirName(): String {
- return project.buildDir.parentFile.toString() + "/dependencyGraph"
- }
-
- private fun getDependencyGraphFileName(): String {
- return "${getDependencyGraphDirName()}/AndroidXDependencyGraph.json"
- }
-
- private data class DependencyGraph(
- val artifacts: MutableList<ListProjectDependencyVersionsTask.ResolvedArtifact>
- )
-
- /**
- * Reads in file and checks that json is valid
- */
- private fun jsonFileIsValid(jsonFile: File, artifactList: MutableList<String>): Boolean {
- if (!jsonFile.exists()) {
- return(false)
- }
- val gson = Gson()
- val jsonString: String = jsonFile.readText(Charsets.UTF_8)
- val depGraph = gson.fromJson(jsonString, DependencyGraph::class.java)
- depGraph.artifacts.forEach { artifact ->
- if (!(artifactList.contains(artifact.artifactId))) {
- println("Failed to find ${artifact.artifactId} in artifact list!")
- return false
- }
- }
- return true
- }
-
- /**
- * Task: createDependencyGraphFile
- * Create the output file to contain the final complete AndroidX project dependency graph JSON
- * file. Then iterate through the list of input project-specific dependency files, and collect
- * all dependencies as a JSON string. Finally, write this complete dependency graph to a JSON
- * file.
- */
- @TaskAction
- fun createDependencyGraphFile() {
- // Create dependencyGraph folder and complete dependency graphy output file in
- // the support/build directory
- val depGraphDir = File(getDependencyGraphDirName())
- if (!depGraphDir.exists()) {
- if (!depGraphDir.mkdirs()) {
- throw RuntimeException("Failed to find " +
- "create dependency Graph directory: $depGraphDir")
- }
- }
- val depGraphFile = File(getDependencyGraphFileName())
- if (!depGraphFile.exists()) {
- if (!depGraphFile.createNewFile()) {
- throw RuntimeException("Failed to create " +
- "output dependency graph file: $depGraphFile")
- }
- }
-
- // Loop through each file in the list of projectDepGraphFiles and collect all dependency
- // graph data from each of these $project-dependency-graph.json files
- var output = StringBuilder()
- output.append("{ \"artifacts\": [\n")
- var artifactList = mutableListOf<String>()
- projectDepDumpFiles.filter {
- ((it.isFile and (it.name != depGraphFile.name))
- and (it.name.contains("-dependency-graph.json")))
- }.forEach { file ->
- var fileText: String = file.readText(Charsets.UTF_8)
- output.append("$fileText,")
- artifactList.add(file.name.replace("-dependency-graph.json", ""))
- // Delete '-dependency-graph.json' file
- file.delete()
- // Delete parent 'dependencyGraph' directory. It should never be the case that
- // dependencyGraph isn't the parent file, but this check has been added in caution
- if (file.parentFile.name == "dependencyGraph") {
- file.parentFile.delete()
- }
- }
- // Remove final ',' from list (so a null object doesn't get added to list
- output.setLength(output.length - 1)
- output.append("]}")
- depGraphFile.writeText(output.toString(), Charsets.UTF_8)
- if (!jsonFileIsValid(depGraphFile, artifactList)) {
- throw RuntimeException("JSON written to $depGraphFile was invalid.")
- }
- }
-}
diff --git a/buildSrc/src/main/kotlin/androidx/build/ProjectExt.kt b/buildSrc/src/main/kotlin/androidx/build/ProjectExt.kt
deleted file mode 100644
index 8dcfd8d..0000000
--- a/buildSrc/src/main/kotlin/androidx/build/ProjectExt.kt
+++ /dev/null
@@ -1,67 +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.build
-
-import org.gradle.api.Project
-import org.gradle.api.Task
-import org.gradle.api.tasks.TaskProvider
-import java.util.Collections
-import java.util.concurrent.locks.ReentrantLock
-import kotlin.concurrent.withLock
-
-/**
- * Holder class used for lazily registering tasks using the new Lazy task execution API.
- */
-data class LazyTaskRegistry(
- private val names: MutableSet<String> = Collections.synchronizedSet(mutableSetOf())
-) {
- fun <T : Any?> once(name: String, f: () -> T): T? {
- if (names.add(name)) {
- return f()
- }
- return null
- }
-
- companion object {
- private const val KEY = "AndroidXAutoRegisteredTasks"
- private val lock = ReentrantLock()
- fun get(project: Project): LazyTaskRegistry {
- val existing = project.extensions.findByName(KEY) as? LazyTaskRegistry
- if (existing != null) {
- return existing
- }
- return lock.withLock {
- project.extensions.findByName(KEY) as? LazyTaskRegistry
- ?: LazyTaskRegistry().also {
- project.extensions.add(KEY, it)
- }
- }
- }
- }
-}
-
-inline fun <reified T : Task> Project.maybeRegister(
- name: String,
- crossinline onConfigure: (T) -> Unit,
- crossinline onRegister: (TaskProvider<T>) -> Unit
-): TaskProvider<T> {
- @Suppress("UNCHECKED_CAST")
- return LazyTaskRegistry.get(project).once(name) {
- tasks.register(name, T::class.java) {
- onConfigure(it)
- }.also(onRegister)
- } ?: tasks.named(name) as TaskProvider<T>
-}
\ No newline at end of file
diff --git a/buildSrc/src/main/kotlin/androidx/build/PublishDocsRules.kt b/buildSrc/src/main/kotlin/androidx/build/PublishDocsRules.kt
index 9a337e7..0a72695 100644
--- a/buildSrc/src/main/kotlin/androidx/build/PublishDocsRules.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/PublishDocsRules.kt
@@ -25,11 +25,9 @@
import androidx.build.Strategy.TipOfTree
val RELEASE_RULE = docsRules("public", false) {
- prebuilts(LibraryGroups.ACTIVITY, "1.0.0-alpha04")
- prebuilts(LibraryGroups.ANNOTATION, "1.1.0-alpha01")
- ignore(LibraryGroups.APPCOMPAT, "appcompat-resources")
- prebuilts(LibraryGroups.APPCOMPAT, "1.1.0-alpha02")
- prebuilts(LibraryGroups.ARCH_CORE, "2.0.0")
+ prebuilts(LibraryGroups.ACTIVITY, "1.0.0-alpha03")
+ prebuilts(LibraryGroups.ANNOTATION, "1.0.1")
+ prebuilts(LibraryGroups.APPCOMPAT, "1.1.0-alpha01")
prebuilts(LibraryGroups.ASYNCLAYOUTINFLATER, "1.0.0")
prebuilts(LibraryGroups.BIOMETRIC, "biometric", "1.0.0-alpha03")
prebuilts(LibraryGroups.BROWSER, "1.0.0")
@@ -38,36 +36,26 @@
prebuilts(LibraryGroups.CAR, "car", "1.0.0-alpha5")
.addStubs("car/stubs/android.car.jar")
prebuilts(LibraryGroups.CARDVIEW, "1.0.0")
- prebuilts(LibraryGroups.COLLECTION, "1.1.0-alpha02")
+ prebuilts(LibraryGroups.COLLECTION, "1.1.0-alpha01")
prebuilts(LibraryGroups.CONCURRENT, "1.0.0-alpha03")
prebuilts(LibraryGroups.CONTENTPAGER, "1.0.0")
prebuilts(LibraryGroups.COORDINATORLAYOUT, "1.1.0-alpha01")
- prebuilts(LibraryGroups.CORE, "core", "1.1.0-alpha04")
- prebuilts(LibraryGroups.CORE, "core-ktx", "1.1.0-alpha04")
+ prebuilts(LibraryGroups.CORE, "core", "1.1.0-alpha03")
+ prebuilts(LibraryGroups.CORE, "core-ktx", "1.1.0-alpha03")
prebuilts(LibraryGroups.CURSORADAPTER, "1.0.0")
prebuilts(LibraryGroups.CUSTOMVIEW, "1.0.0")
prebuilts(LibraryGroups.DOCUMENTFILE, "1.0.0")
prebuilts(LibraryGroups.DRAWERLAYOUT, "1.0.0")
- prebuilts(LibraryGroups.DYNAMICANIMATION, "dynamicanimation-ktx", "1.0.0-alpha01")
+ ignore(LibraryGroups.DYNAMICANIMATION, "dynamicanimation-ktx")
prebuilts(LibraryGroups.DYNAMICANIMATION, "1.0.0")
prebuilts(LibraryGroups.EMOJI, "1.0.0")
- prebuilts(LibraryGroups.ENTERPRISE, "1.0.0-alpha01")
prebuilts(LibraryGroups.EXIFINTERFACE, "1.0.0")
- prebuilts(LibraryGroups.FRAGMENT, "1.1.0-alpha04")
+ prebuilts(LibraryGroups.FRAGMENT, "1.1.0-alpha02")
prebuilts(LibraryGroups.GRIDLAYOUT, "1.0.0")
prebuilts(LibraryGroups.HEIFWRITER, "1.0.0")
prebuilts(LibraryGroups.INTERPOLATOR, "1.0.0")
- prebuilts(LibraryGroups.LEANBACK, "1.1.0-alpha01")
+ prebuilts(LibraryGroups.LEANBACK, "1.0.0")
prebuilts(LibraryGroups.LEGACY, "1.0.0")
- ignore(LibraryGroups.LIFECYCLE, "lifecycle-savedstate-core")
- ignore(LibraryGroups.LIFECYCLE, "lifecycle-savedstate-fragment")
- ignore(LibraryGroups.LIFECYCLE, "lifecycle-viewmodel-savedstate")
- ignore(LibraryGroups.LIFECYCLE, "lifecycle-viewmodel-fragment")
- ignore(LibraryGroups.LIFECYCLE, "lifecycle-livedata-ktx")
- ignore(LibraryGroups.LIFECYCLE, "lifecycle-livedata-core-ktx")
- ignore(LibraryGroups.LIFECYCLE, "lifecycle-compiler")
- ignore(LibraryGroups.LIFECYCLE, "lifecycle-common-eap")
- prebuilts(LibraryGroups.LIFECYCLE, "2.1.0-alpha02")
prebuilts(LibraryGroups.LOADER, "1.1.0-alpha01")
prebuilts(LibraryGroups.LOCALBROADCASTMANAGER, "1.1.0-alpha01")
prebuilts(LibraryGroups.MEDIA, "media", "1.1.0-alpha01")
@@ -77,20 +65,14 @@
ignore(LibraryGroups.MEDIA2, "media2-exoplayer")
prebuilts(LibraryGroups.MEDIA2, "1.0.0-alpha03")
prebuilts(LibraryGroups.MEDIAROUTER, "1.1.0-alpha01")
- ignore(LibraryGroups.NAVIGATION, "navigation-testing")
- prebuilts(LibraryGroups.NAVIGATION, "2.0.0-rc02")
- prebuilts(LibraryGroups.PAGING, "2.1.0")
prebuilts(LibraryGroups.PALETTE, "1.0.0")
prebuilts(LibraryGroups.PERCENTLAYOUT, "1.0.0")
- prebuilts(LibraryGroups.PERSISTENCE, "2.0.0")
- prebuilts(LibraryGroups.PREFERENCE, "preference-ktx", "1.1.0-alpha03")
- prebuilts(LibraryGroups.PREFERENCE, "1.1.0-alpha03")
+ prebuilts(LibraryGroups.PREFERENCE, "preference-ktx", "1.1.0-alpha02")
+ prebuilts(LibraryGroups.PREFERENCE, "1.1.0-alpha02")
prebuilts(LibraryGroups.PRINT, "1.0.0")
prebuilts(LibraryGroups.RECOMMENDATION, "1.0.0")
- prebuilts(LibraryGroups.RECYCLERVIEW, "recyclerview", "1.1.0-alpha02")
- prebuilts(LibraryGroups.RECYCLERVIEW, "recyclerview-selection", "1.1.0-alpha01")
+ prebuilts(LibraryGroups.RECYCLERVIEW, "1.1.0-alpha01")
prebuilts(LibraryGroups.REMOTECALLBACK, "1.0.0-alpha01")
- prebuilts(LibraryGroups.ROOM, "2.1.0-alpha05")
prebuilts(LibraryGroups.SLICE, "slice-builders", "1.0.0")
prebuilts(LibraryGroups.SLICE, "slice-builders-ktx", "1.0.0-alpha6")
prebuilts(LibraryGroups.SLICE, "slice-core", "1.0.0")
@@ -100,17 +82,30 @@
prebuilts(LibraryGroups.SLICE, "slice-view", "1.0.0")
prebuilts(LibraryGroups.SLIDINGPANELAYOUT, "1.0.0")
prebuilts(LibraryGroups.SWIPEREFRESHLAYOUT, "1.1.0-alpha01")
- prebuilts(LibraryGroups.TEXTCLASSIFIER, "1.0.0-alpha02")
+ prebuilts(LibraryGroups.TEXTCLASSIFIER, "1.0.0-alpha01")
prebuilts(LibraryGroups.TRANSITION, "1.1.0-alpha01")
prebuilts(LibraryGroups.TVPROVIDER, "1.0.0")
prebuilts(LibraryGroups.VECTORDRAWABLE, "1.1.0-alpha01")
prebuilts(LibraryGroups.VECTORDRAWABLE, "vectordrawable-animated", "1.1.0-alpha01")
prebuilts(LibraryGroups.VIEWPAGER, "1.0.0")
- prebuilts(LibraryGroups.VIEWPAGER2, "1.0.0-alpha01")
prebuilts(LibraryGroups.WEAR, "1.0.0")
.addStubs("wear/wear_stubs/com.google.android.wearable-stubs.jar")
prebuilts(LibraryGroups.WEBKIT, "1.0.0")
- prebuilts(LibraryGroups.WORKMANAGER, "1.0.0-rc02")
+ prebuilts(LibraryGroups.ROOM, "2.1.0-alpha04")
+ prebuilts(LibraryGroups.PERSISTENCE, "2.0.0")
+ ignore(LibraryGroups.LIFECYCLE, "lifecycle-savedstate-core")
+ ignore(LibraryGroups.LIFECYCLE, "lifecycle-savedstate-fragment")
+ ignore(LibraryGroups.LIFECYCLE, "lifecycle-viewmodel-savedstate")
+ ignore(LibraryGroups.LIFECYCLE, "lifecycle-viewmodel-fragment")
+ ignore(LibraryGroups.LIFECYCLE, "lifecycle-livedata-ktx")
+ ignore(LibraryGroups.LIFECYCLE, "lifecycle-livedata-core-ktx")
+ ignore(LibraryGroups.LIFECYCLE, "lifecycle-compiler")
+ prebuilts(LibraryGroups.LIFECYCLE, "2.1.0-alpha01")
+ prebuilts(LibraryGroups.ARCH_CORE, "2.0.0")
+ prebuilts(LibraryGroups.PAGING, "2.1.0")
+ ignore(LibraryGroups.NAVIGATION, "navigation-testing")
+ prebuilts(LibraryGroups.NAVIGATION, "1.0.0-alpha11")
+ prebuilts(LibraryGroups.WORKMANAGER, "1.0.0-beta03")
default(Ignore)
}
@@ -244,18 +239,10 @@
}
override fun toString() = "Prebuilts(\"$version\")"
- fun dependency(extension: SupportLibraryExtension): String {
- return "${extension.mavenGroup}:${extension.project.name}:$version"
- }
}
}
class PublishDocsRules(val name: String, val offline: Boolean, private val rules: List<DocsRule>) {
- fun resolve(extension: SupportLibraryExtension): DocsRule? {
- val mavenGroup = extension.mavenGroup
- return if (mavenGroup == null) null else resolve(mavenGroup, extension.project.name)
- }
-
fun resolve(groupName: String, moduleName: String): DocsRule {
return rules.find { it.predicate.apply(groupName, moduleName) } ?: throw Error()
}
diff --git a/buildSrc/src/main/kotlin/androidx/build/Release.kt b/buildSrc/src/main/kotlin/androidx/build/Release.kt
index 8ef06ab..55657a6 100644
--- a/buildSrc/src/main/kotlin/androidx/build/Release.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/Release.kt
@@ -18,7 +18,6 @@
import androidx.build.gmaven.GMavenVersionChecker
import org.gradle.api.Action
import org.gradle.api.Project
-import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.Upload
import org.gradle.api.tasks.bundling.Zip
import java.io.File
@@ -212,12 +211,10 @@
projectName = project.name,
version = version.toString()
)
- val uploadTask = project.tasks.named("uploadArchives", Upload::class.java)
+ val uploadTask = project.tasks.getByName("uploadArchives") as Upload
zipTasks.forEach {
- it.configure {
- it.candidates.add(artifact)
- it.dependsOn(uploadTask)
- }
+ it.candidates.add(artifact)
+ it.dependsOn(uploadTask)
}
}
@@ -258,53 +255,40 @@
/**
* Creates and returns the task that generates the combined gmaven diff file for all projects.
*/
- private fun getGlobalReleaseZipTask(project: Project): TaskProvider<GMavenZipTask> {
+ private fun getGlobalReleaseZipTask(project: Project): GMavenZipTask {
val taskName = "${DIFF_TASK_PREFIX}ForAll"
- return project.rootProject.maybeRegister(
- name = taskName,
- onConfigure = {
- GMavenZipTask.ConfigAction(getParams(project)).execute(it)
- },
- onRegister = {
- }
- )
+ return project.rootProject.tasks.findByName(taskName) as? GMavenZipTask
+ ?: project.rootProject.tasks.create(
+ taskName, GMavenZipTask::class.java,
+ GMavenZipTask.ConfigAction(getParams(project))
+ )
}
/**
* Creates and returns the task that includes all projects regardless of their release status.
*/
- private fun getGlobalFullZipTask(project: Project): TaskProvider<GMavenZipTask> {
- return project.rootProject.maybeRegister(
- name = FULL_ARCHIVE_TASK_NAME,
- onConfigure = {
- GMavenZipTask.ConfigAction(
- getParams(project).copy(
- includeReleased = true,
- includeMetadata = true
- )
- ).execute(it)
- },
- onRegister = {
- }
- )
+ private fun getGlobalFullZipTask(project: Project): GMavenZipTask {
+ val taskName = FULL_ARCHIVE_TASK_NAME
+ return project.rootProject.tasks.findByName(taskName) as? GMavenZipTask
+ ?: project.rootProject.tasks.create(
+ taskName, GMavenZipTask::class.java,
+ GMavenZipTask.ConfigAction(getParams(project).copy(
+ includeReleased = true,
+ includeMetadata = true
+ ))
+ )
}
/**
* Creates and returns the zip task that includes artifacts only in the given maven group.
*/
- private fun getGroupReleaseZipTask(
- project: Project,
- group: String
- ): TaskProvider<GMavenZipTask> {
+ private fun getGroupReleaseZipTask(project: Project, group: String): GMavenZipTask {
val taskName = "${DIFF_TASK_PREFIX}For${groupToTaskNameSuffix(group)}"
- return project.rootProject.maybeRegister(
- name = taskName,
- onConfigure = {
- GMavenZipTask.ConfigAction(getParams(project, group)).execute(it)
- },
- onRegister = {
- }
- )
+ return project.rootProject.tasks.findByName(taskName) as? GMavenZipTask
+ ?: project.rootProject.tasks.create(
+ taskName, GMavenZipTask::class.java,
+ GMavenZipTask.ConfigAction(getParams(project, group))
+ )
}
}
diff --git a/buildSrc/src/main/kotlin/androidx/build/SdkHelper.kt b/buildSrc/src/main/kotlin/androidx/build/SdkHelper.kt
index 39b528f..ca48814 100644
--- a/buildSrc/src/main/kotlin/androidx/build/SdkHelper.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/SdkHelper.kt
@@ -28,13 +28,9 @@
val props = File(supportRoot, "local.properties")
// gradle always deliminate directories with '/' regardless of the OS.
// So convert deliminator here.
- val gradlePath = sdkPath.absolutePath.replace(File.separator, "/")
- val expectedContents = "sdk.dir=$gradlePath"
- if (!props.exists() || props.readText(Charsets.UTF_8).trim() != expectedContents) {
- props.printWriter().use { out ->
- out.println(expectedContents)
- }
- println("updated local.properties")
+ val gradlePath = sdkPath.getAbsolutePath().replace(File.separator, "/")
+ props.printWriter().use { out ->
+ out.println("sdk.dir=$gradlePath")
}
} else {
throw Exception("You are using non androidx-master-dev checkout. You need to check out " +
diff --git a/buildSrc/src/main/kotlin/androidx/build/SourceJarTaskHelper.kt b/buildSrc/src/main/kotlin/androidx/build/SourceJarTaskHelper.kt
index daad28e..ef6ca7a 100644
--- a/buildSrc/src/main/kotlin/androidx/build/SourceJarTaskHelper.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/SourceJarTaskHelper.kt
@@ -33,7 +33,7 @@
return@all // Skip non-release builds.
}
- val sourceJar = tasks.register("sourceJar${variant.name.capitalize()}", Jar::class.java) {
+ val sourceJar = tasks.create("sourceJar${variant.name.capitalize()}", Jar::class.java) {
it.classifier = "sources"
it.from(extension.sourceSets.getByName("main").java.srcDirs)
}
@@ -45,7 +45,7 @@
* Sets up a source jar task for a Java library project.
*/
fun Project.configureSourceJarForJava() {
- val sourceJar = tasks.register("sourceJar", Jar::class.java) {
+ val sourceJar = tasks.create("sourceJar", Jar::class.java) {
it.classifier = "sources"
val convention = convention.getPlugin<JavaPluginConvention>()
diff --git a/buildSrc/src/main/kotlin/androidx/build/SupportAndroidLibraryPlugin.kt b/buildSrc/src/main/kotlin/androidx/build/SupportAndroidLibraryPlugin.kt
index 28f5356..34daccf 100644
--- a/buildSrc/src/main/kotlin/androidx/build/SupportAndroidLibraryPlugin.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/SupportAndroidLibraryPlugin.kt
@@ -39,6 +39,7 @@
val supportLibraryExtension = project.extensions.create("supportLibrary",
SupportLibraryExtension::class.java, project)
+ project.setupVersion(supportLibraryExtension)
project.configureMavenArtifactUpload(supportLibraryExtension)
// Workaround for concurrentfuture
@@ -79,13 +80,12 @@
library.libraryVariants.all { libraryVariant ->
if (libraryVariant.getBuildType().getName().equals("debug")) {
- libraryVariant.javaCompileProvider.configure { javaCompile ->
- if (supportLibraryExtension.failOnUncheckedWarnings) {
- javaCompile.options.compilerArgs.add("-Xlint:unchecked")
- }
- if (supportLibraryExtension.failOnDeprecationWarnings) {
- javaCompile.options.compilerArgs.add("-Xlint:deprecation")
- }
+ val javaCompile = libraryVariant.javaCompileProvider.get()
+ if (supportLibraryExtension.failOnUncheckedWarnings) {
+ javaCompile.options.compilerArgs.add("-Xlint:unchecked")
+ }
+ if (supportLibraryExtension.failOnDeprecationWarnings) {
+ javaCompile.options.compilerArgs.add("-Xlint:deprecation")
}
}
}
diff --git a/buildSrc/src/main/kotlin/androidx/build/SupportJavaLibraryPlugin.kt b/buildSrc/src/main/kotlin/androidx/build/SupportJavaLibraryPlugin.kt
index f8299a0..bc5941d 100644
--- a/buildSrc/src/main/kotlin/androidx/build/SupportJavaLibraryPlugin.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/SupportJavaLibraryPlugin.kt
@@ -34,6 +34,7 @@
val supportLibraryExtension = project.extensions.create("supportLibrary",
SupportLibraryExtension::class.java, project)
+ project.setupVersion(supportLibraryExtension)
project.configureMavenArtifactUpload(supportLibraryExtension)
project.apply(mapOf("plugin" to "java"))
diff --git a/buildSrc/src/main/kotlin/androidx/build/SupportKotlinLibraryPlugin.kt b/buildSrc/src/main/kotlin/androidx/build/SupportKotlinLibraryPlugin.kt
index b5359be3..b84667a 100644
--- a/buildSrc/src/main/kotlin/androidx/build/SupportKotlinLibraryPlugin.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/SupportKotlinLibraryPlugin.kt
@@ -27,6 +27,7 @@
val supportLibraryExtension = project.extensions.create("supportLibrary",
SupportLibraryExtension::class.java, project)
+ project.setupVersion(supportLibraryExtension)
project.configureMavenArtifactUpload(supportLibraryExtension)
project.apply(mapOf("plugin" to "kotlin"))
project.apply(mapOf("plugin" to "kotlin-kapt"))
diff --git a/buildSrc/src/main/kotlin/androidx/build/SupportLibraryExtension.kt b/buildSrc/src/main/kotlin/androidx/build/SupportLibraryExtension.kt
index dd00bb7..a7339b0 100644
--- a/buildSrc/src/main/kotlin/androidx/build/SupportLibraryExtension.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/SupportLibraryExtension.kt
@@ -19,16 +19,13 @@
import groovy.lang.Closure
import org.gradle.api.Project
import java.util.ArrayList
-import kotlin.properties.Delegates
/**
* Extension for [SupportAndroidLibraryPlugin] and [SupportJavaLibraryPlugin].
*/
open class SupportLibraryExtension(val project: Project) {
var name: String? = null
- var mavenVersion: Version? by Delegates.observable<Version?>(null) { _, _, new: Version? ->
- project.version = new?.toString()
- }
+ var mavenVersion: Version? = null
var mavenGroup: String? = null
var description: String? = null
var inceptionYear: String? = null
@@ -41,7 +38,7 @@
var compilationTarget: CompilationTarget = CompilationTarget.DEVICE
var useMetalava = true
- var trackRestrictedAPIs = true
+ var trackRestrictedAPIs = false
/**
* It disables docs generation and api tracking for tooling modules like annotation processors.
diff --git a/buildSrc/src/main/kotlin/androidx/build/VerifyDependencyVersionsTask.kt b/buildSrc/src/main/kotlin/androidx/build/VerifyDependencyVersionsTask.kt
index 2743b7b..0d64ce0 100644
--- a/buildSrc/src/main/kotlin/androidx/build/VerifyDependencyVersionsTask.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/VerifyDependencyVersionsTask.kt
@@ -41,12 +41,10 @@
@TaskAction
fun verifyDependencyVersions() {
project.configurations.all { configuration ->
- if (!configuration.name.toLowerCase().contains("androidtest")) {
- configuration.allDependencies.forEach { dep ->
- if (dep.group != null && dep.group.toString().startsWith("androidx.") &&
+ configuration.allDependencies.forEach { dep ->
+ if (dep.group != null && dep.group.toString().startsWith("androidx.") &&
!dep.group.toString().startsWith("androidx.test")) {
- verifyDependencyVersion(dep)
- }
+ verifyDependencyVersion(dep)
}
}
}
diff --git a/buildSrc/src/main/kotlin/androidx/build/VersionFileWriterTask.kt b/buildSrc/src/main/kotlin/androidx/build/VersionFileWriterTask.kt
index fce3661..7512927 100644
--- a/buildSrc/src/main/kotlin/androidx/build/VersionFileWriterTask.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/VersionFileWriterTask.kt
@@ -55,29 +55,25 @@
* @param project an Android Library project.
*/
fun Project.configureVersionFileWriter(library: LibraryExtension) {
- val writeVersionFile = tasks.register("writeVersionFile",
+ val writeVersionFile = tasks.create("writeVersionFile",
VersionFileWriterTask::class.java)
afterEvaluate {
- writeVersionFile.configure {
- val group = properties["group"] as String
- val artifactId = properties["name"] as String
- val version = properties["version"] as String
+ val group = properties["group"] as String
+ val artifactId = properties["name"] as String
+ val version = properties["version"] as String
- // Add a java resource file to the library jar for version tracking purposes.
- val artifactName = File(
+ // Add a java resource file to the library jar for version tracking purposes.
+ val artifactName = File(
buildDir,
String.format(VERSION_FILE_PATH, group, artifactId))
- it.version = version
- it.outputFile = artifactName
- }
+ writeVersionFile.version = version
+ writeVersionFile.outputFile = artifactName
}
library.libraryVariants.all {
- it.processJavaResourcesProvider.configure {
- it.dependsOn(writeVersionFile)
- }
+ it.processJavaResources.dependsOn(writeVersionFile)
}
val resources = library.sourceSets.getByName("main").resources
@@ -87,4 +83,4 @@
includes.add("META-INF/*.version")
resources.setIncludes(includes)
}
-}
+}
\ No newline at end of file
diff --git a/buildSrc/src/main/kotlin/androidx/build/checkapi/ApiLocation.kt b/buildSrc/src/main/kotlin/androidx/build/checkapi/ApiLocation.kt
index e90c6d1..713ee6c 100644
--- a/buildSrc/src/main/kotlin/androidx/build/checkapi/ApiLocation.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/checkapi/ApiLocation.kt
@@ -20,8 +20,8 @@
import androidx.build.Version
-// An ApiLocation contains the filepath of a public API and restricted API of a library
-data class ApiLocation(
+// A ApiLocation contains the filepath of a public API and restricted API of a library
+data class ApiLocation (
// file specifying the public API of the library
val publicApiFile: File,
// file specifying the restricted API (marked by the RestrictTo annotation) of the library
@@ -44,20 +44,3 @@
}
}
}
-
-// An ApiViolationExclusions contains the paths of the API exclusions files for an API
-data class ApiViolationExclusions(
- val publicApiFile: File,
- val restrictedApiFile: File
-) {
-
- fun files() = listOf(publicApiFile, restrictedApiFile)
-
- companion object {
- fun fromApiLocation(apiLocation: ApiLocation): ApiViolationExclusions {
- val publicExclusionsFile = File(apiLocation.publicApiFile.toString().removeSuffix(".txt") + ".ignore")
- val restrictedExclusionsFile = File(apiLocation.restrictedApiFile.toString().removeSuffix(".txt") + ".ignore")
- return ApiViolationExclusions(publicExclusionsFile, restrictedExclusionsFile)
- }
- }
-}
diff --git a/buildSrc/src/main/kotlin/androidx/build/checkapi/CheckApi.kt b/buildSrc/src/main/kotlin/androidx/build/checkapi/CheckApi.kt
index b770e1a..41d3b4e 100644
--- a/buildSrc/src/main/kotlin/androidx/build/checkapi/CheckApi.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/checkapi/CheckApi.kt
@@ -19,6 +19,7 @@
import androidx.build.SupportLibraryExtension
import androidx.build.Version
import androidx.build.androidJarFile
+import androidx.build.createWithConfig
import androidx.build.doclava.CHECK_API_CONFIG_DEVELOP
import androidx.build.doclava.CHECK_API_CONFIG_PATCH
import androidx.build.doclava.CHECK_API_CONFIG_RELEASE
@@ -31,16 +32,15 @@
import androidx.build.version
import org.gradle.api.GradleException
import org.gradle.api.Project
+import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
import org.gradle.api.plugins.JavaBasePlugin
-import org.gradle.api.provider.Provider
-import org.gradle.api.tasks.TaskProvider
import java.io.File
data class CheckApiTasks(
- val generateApi: TaskProvider<DoclavaTask>,
- val checkApi: TaskProvider<CheckApiTask>,
- val generateLocalDiffs: TaskProvider<JDiffTask>
+ val generateApi: DoclavaTask,
+ val checkApi: CheckApiTask,
+ val generateLocalDiffs: JDiffTask
)
enum class ApiType {
@@ -53,8 +53,8 @@
*/
fun initializeApiChecksForProject(
project: Project,
- aggregateOldApiTxtsTask: TaskProvider<ConcatenateFilesTask>,
- aggregateNewApiTxtsTask: TaskProvider<ConcatenateFilesTask>
+ aggregateOldApiTxtsTask: ConcatenateFilesTask,
+ aggregateNewApiTxtsTask: ConcatenateFilesTask
): CheckApiTasks {
if (!project.hasProperty("docsDir")) {
project.extensions.add("docsDir", File(project.rootProject.docsDir(), project.name))
@@ -64,9 +64,7 @@
val doclavaConfiguration = project.rootProject.configurations.getByName("doclava")
val docletClasspath = doclavaConfiguration.resolve()
val generateApi = createGenerateApiTask(project, docletClasspath)
- generateApi.configure {
- it.dependsOn(doclavaConfiguration)
- }
+ generateApi.dependsOn(doclavaConfiguration)
// for verifying that the API surface has not broken since the last minor release
val lastReleasedApiFile = project.getRequiredCompatibilityApiFile()
@@ -79,20 +77,14 @@
docletClasspath,
CHECK_API_CONFIG_RELEASE,
lastReleasedApiFile,
- generateApi.map {
- it.apiFile!!
- },
+ generateApi.apiFile!!,
whitelistFile)
- checkApiRelease.configure {
- it.dependsOn(generateApi)
- }
+ checkApiRelease.dependsOn(generateApi)
// Allow a comma-delimited list of whitelisted errors.
if (project.hasProperty("ignore")) {
- checkApiRelease.configure {
- it.whitelistErrors = (project.properties["ignore"] as String)
- .split(',').toSet()
- }
+ checkApiRelease.whitelistErrors = (project.properties["ignore"] as String)
+ .split(',').toSet()
}
// Check whether the development API surface has changed.
@@ -103,31 +95,25 @@
docletClasspath,
verifyConfig,
currentApiFile,
- generateApi.map {
- it.apiFile!!
- },
+ generateApi.apiFile!!,
null)
- checkApi.configure {
- it.dependsOn(generateApi, checkApiRelease)
- it.group = JavaBasePlugin.VERIFICATION_GROUP
- it.description = "Verify the API surface."
- }
+ checkApi.dependsOn(generateApi, checkApiRelease)
+
+ checkApi.group = JavaBasePlugin.VERIFICATION_GROUP
+ checkApi.description = "Verify the API surface."
val updateApiTask = createUpdateApiTask(project, checkApiRelease)
- updateApiTask.configure {
- it.dependsOn(checkApiRelease)
- }
+ updateApiTask.dependsOn(checkApiRelease)
val oldApiTxt = getOldApiTxtForDocDiffs(project)
if (oldApiTxt != null) {
- aggregateOldApiTxtsTask.configure {
- it.addInput(project.name, oldApiTxt)
- }
+ aggregateOldApiTxtsTask.addInput(project.name, oldApiTxt)
}
val newApiTxtProvider = getNewApiTxt(project, generateApi)
- aggregateNewApiTxtsTask.configure {
- it.inputs.file(newApiTxtProvider.file)
- it.addInput(project.name, newApiTxtProvider.file.get())
+ aggregateNewApiTxtsTask.inputs.file(newApiTxtProvider.file)
+ aggregateNewApiTxtsTask.addInput(project.name, newApiTxtProvider.file)
+ if (newApiTxtProvider.task != null) {
+ aggregateNewApiTxtsTask.dependsOn(newApiTxtProvider.task)
}
val newApiTask = createNewApiXmlTask(project, generateApi, doclavaConfiguration)
@@ -145,36 +131,33 @@
private fun createGenerateLocalDiffsTask(
project: Project,
- oldApiTask: TaskProvider<ApiXmlConversionTask>,
- newApiTask: TaskProvider<ApiXmlConversionTask>,
+ oldApiTask: ApiXmlConversionTask,
+ newApiTask: ApiXmlConversionTask,
jdiffConfig: Configuration
-): TaskProvider<JDiffTask> =
- project.tasks.register("generateLocalDiffs", JDiffTask::class.java) {
- it.apply {
- // Base classpath is Android SDK, sub-projects add their own.
- classpath = androidJarFile(project)
+): JDiffTask =
+ project.tasks.createWithConfig("generateLocalDiffs", JDiffTask::class.java) {
+ // Base classpath is Android SDK, sub-projects add their own.
+ classpath = androidJarFile(project)
- // JDiff properties.
- oldApiXmlFile = oldApiTask.get().outputApiXmlFile
- newApiXmlFile = newApiTask.get().outputApiXmlFile
+ // JDiff properties.
+ oldApiXmlFile = oldApiTask.outputApiXmlFile
+ newApiXmlFile = newApiTask.outputApiXmlFile
- val newApi = project.processProperty("toApi") ?: project.version
- val docsDir = project.rootProject.docsDir()
+ val newApi = project.processProperty("toApi") ?: project.version
+ val docsDir = project.rootProject.docsDir()
- newJavadocPrefix = "../../../../../reference/"
- destinationDir = File(docsDir,
- "online/sdk/support_api_diff/${project.name}/$newApi")
- // Javadoc properties.
- docletpath = jdiffConfig.resolve()
- title = "AndroidX Library API Differences Report"
+ newJavadocPrefix = "../../../../../reference/"
+ destinationDir = File(docsDir, "online/sdk/support_api_diff/${project.name}/$newApi")
+ // Javadoc properties.
+ docletpath = jdiffConfig.resolve()
+ title = "AndroidX Library API Differences Report"
- exclude("**/BuildConfig.java", "**/R.java")
- dependsOn(oldApiTask, newApiTask, jdiffConfig)
- doFirst {
- println("Generating diffs from api version " +
- "${stripExtension(oldApiTask.get().outputApiXmlFile.name)} " +
- "to api version $newApi")
- }
+ exclude("**/BuildConfig.java", "**/R.java")
+ dependsOn(oldApiTask, newApiTask, jdiffConfig)
+ doFirst {
+ println("Generating diffs from api version " +
+ "${stripExtension(oldApiTask.outputApiXmlFile.name)} " +
+ "to api version $newApi")
}
}
@@ -184,25 +167,23 @@
* for use by JDiff.
*/
private fun createOldApiXml(project: Project, doclavaConfig: Configuration) =
- project.tasks.register("oldApiXml", ApiXmlConversionTask::class.java) {
- it.apply {
- val fromApi = project.processProperty("fromApi")
- classpath = project.files(doclavaConfig.resolve())
- val rootFolder = project.projectDir
- inputApiFile = if (fromApi != null) {
- // Use an explicit API file.
- File(rootFolder, "api/$fromApi.txt")
- } else {
- // Use the most recently released API file.
- getLastReleasedApiFile(rootFolder, Version(project.processProperty("toApi")
+ project.tasks.createWithConfig("oldApiXml", ApiXmlConversionTask::class.java) {
+ val fromApi = project.processProperty("fromApi")
+ classpath = project.files(doclavaConfig.resolve())
+ val rootFolder = project.projectDir
+ inputApiFile = if (fromApi != null) {
+ // Use an explicit API file.
+ File(rootFolder, "api/$fromApi.txt")
+ } else {
+ // Use the most recently released API file.
+ getLastReleasedApiFile(rootFolder, Version(project.processProperty("toApi")
?: project.version.toString()), false, false)
- }
+ }
- outputApiXmlFile = File(project.docsDir(),
+ outputApiXmlFile = File(project.docsDir(),
"release/${stripExtension(inputApiFile?.name ?: "creation")}.xml")
- dependsOn(doclavaConfig)
- }
+ dependsOn(doclavaConfig)
}
/**
@@ -211,26 +192,24 @@
*/
private fun createNewApiXmlTask(
project: Project,
- generateApi: TaskProvider<DoclavaTask>,
+ generateApi: DoclavaTask,
doclavaConfig: Configuration
) =
- project.tasks.register("newApiXml", ApiXmlConversionTask::class.java) {
- it.apply {
- classpath = project.files(doclavaConfig.resolve())
- val toApi = project.processProperty("toApi")
+ project.tasks.createWithConfig("newApiXml", ApiXmlConversionTask::class.java) {
+ classpath = project.files(doclavaConfig.resolve())
+ val toApi = project.processProperty("toApi")
- if (toApi != null && toApi != project.version) {
- // Use an explicit API file.
- inputApiFile = File(project.projectDir, "api/$toApi.txt")
- } else {
- // Use the current API file (e.g. current.txt).
- inputApiFile = generateApi.get().apiFile!!
- dependsOn(generateApi, doclavaConfig)
- }
- // Use either the toApi version, otherwise the most recent version.
- outputApiXmlFile = File(project.docsDir(),
- "release/${toApi ?: project.version}.xml")
+ if (toApi != null && toApi != project.version) {
+ // Use an explicit API file.
+ inputApiFile = File(project.projectDir, "api/$toApi.txt")
+ } else {
+ // Use the current API file (e.g. current.txt).
+ inputApiFile = generateApi.apiFile!!
+ dependsOn(generateApi, doclavaConfig)
}
+ // Use either the toApi version, otherwise the most recent version.
+ outputApiXmlFile = File(project.docsDir(),
+ "release/${toApi ?: project.version}.xml")
}
fun Project.hasApiFolder() = File(projectDir, "api").exists()
@@ -261,21 +240,19 @@
// Creates a new task on the project for generating API files
private fun createGenerateApiTask(project: Project, docletpathParam: Collection<File>) =
- project.tasks.register("generateApi", DoclavaTask::class.java) {
- it.apply {
- // Base classpath is Android SDK, sub-projects add their own.
- classpath = androidJarFile(project)
- apiFile = File(project.docsDir(), "release/${project.name}/current.txt")
- setDocletpath(docletpathParam)
- destinationDir = project.docsDir()
- generateDocs = false
+ project.tasks.createWithConfig("generateApi", DoclavaTask::class.java) {
+ setDocletpath(docletpathParam)
+ destinationDir = project.docsDir()
+ // Base classpath is Android SDK, sub-projects add their own.
+ classpath = androidJarFile(project)
+ apiFile = File(project.docsDir(), "release/${project.name}/current.txt")
+ generateDocs = false
- coreJavadocOptions {
- addBooleanOption("stubsourceonly", true)
- }
-
- exclude("**/R.java")
+ coreJavadocOptions {
+ addBooleanOption("stubsourceonly", true)
}
+
+ exclude("**/R.java")
}
/**
@@ -290,19 +267,17 @@
* finalized and the file already exists
* </ul>
*/
-private fun createUpdateApiTask(project: Project, checkApiRelease: TaskProvider<CheckApiTask>) =
- project.tasks.register("updateApi", UpdateApiTask::class.java) {
- it.apply {
- group = JavaBasePlugin.VERIFICATION_GROUP
- description = "Updates the candidate API file to incorporate valid changes."
- newApiFile = checkApiRelease.get().newApiFile
- oldApiFile = project.getCurrentApiFile()
- whitelistErrors = checkApiRelease.get().whitelistErrors
- whitelistErrorsFile = checkApiRelease.get().whitelistErrorsFile
- doFirst {
- // Replace the expected whitelist with the detected whitelist.
- whitelistErrors = checkApiRelease.get().detectedWhitelistErrors
- }
+private fun createUpdateApiTask(project: Project, checkApiRelease: CheckApiTask) =
+ project.tasks.createWithConfig("updateApi", UpdateApiTask::class.java) {
+ group = JavaBasePlugin.VERIFICATION_GROUP
+ description = "Updates the candidate API file to incorporate valid changes."
+ newApiFile = checkApiRelease.newApiFile
+ oldApiFile = project.getCurrentApiFile()
+ whitelistErrors = checkApiRelease.whitelistErrors
+ whitelistErrorsFile = checkApiRelease.whitelistErrorsFile
+ doFirst {
+ // Replace the expected whitelist with the detected whitelist.
+ whitelistErrors = checkApiRelease.detectedWhitelistErrors
}
}
@@ -426,38 +401,32 @@
docletpath: Collection<File>,
config: ChecksConfig,
oldApi: File?,
- newApi: Provider<File>,
+ newApi: File,
whitelist: File? = null
) =
- project.tasks.register(taskName, CheckApiTask::class.java) {
- it.apply {
- doclavaClasspath = docletpath
- checksConfig = config
- newApiFile = newApi.get()
- oldApiFile = oldApi
- whitelistErrorsFile = whitelist
- doFirst {
- logger.lifecycle("Verifying ${newApi.get().name} " +
- "against ${oldApi?.name ?: "nothing"}...")
- }
+ project.tasks.createWithConfig(taskName, CheckApiTask::class.java) {
+ doclavaClasspath = docletpath
+ checksConfig = config
+ newApiFile = newApi
+ oldApiFile = oldApi
+ whitelistErrorsFile = whitelist
+ doFirst {
+ logger.lifecycle("Verifying ${newApi.name} " +
+ "against ${oldApi?.name ?: "nothing"}...")
}
}
-private fun getNewApiTxt(project: Project, generateApi: TaskProvider<DoclavaTask>): FileProvider {
+private fun getNewApiTxt(project: Project, generateApi: DoclavaTask): FileProvider {
val toApi = project.processProperty("toApi")
return if (toApi != null) {
// Use an explicit API file.
- FileProvider(project.provider {
- File(project.projectDir, "api/$toApi.txt")
- }, null)
+ FileProvider(File(project.projectDir, "api/$toApi.txt"), null)
} else {
// Use the current API file (e.g. current.txt).
- FileProvider(generateApi.map {
- it.apiFile!!
- }, generateApi)
+ FileProvider(generateApi.apiFile!!, generateApi)
}
}
-private data class FileProvider(val file: Provider<File>, val task: TaskProvider<*>?)
+private data class FileProvider(val file: File, val task: Task?)
private fun stripExtension(fileName: String) = fileName.substringBeforeLast('.')
diff --git a/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt b/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
index fd0ae44..86ee4f9 100644
--- a/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/dependencies/Dependencies.kt
@@ -27,11 +27,11 @@
const val DEXMAKER_MOCKITO = "com.linkedin.dexmaker:dexmaker-mockito:2.19.0"
const val ESPRESSO_CONTRIB = "androidx.test.espresso:espresso-contrib:3.1.0"
const val ESPRESSO_CORE = "androidx.test.espresso:espresso-core:3.1.0"
-const val FINDBUGS = "com.google.code.findbugs:jsr305:3.0.2"
+const val FINDBUGS = "com.google.code.findbugs:jsr305:2.0.1"
const val GOOGLE_COMPILE_TESTING = "com.google.testing.compile:compile-testing:0.11"
const val GSON = "com.google.code.gson:gson:2.8.0"
-const val GUAVA = "com.google.guava:guava:27.0.1-jre"
-const val GUAVA_ANDROID = "com.google.guava:guava:27.0.1-android"
+const val GUAVA = "com.google.guava:guava:23.5-jre"
+const val GUAVA_ANDROID = "com.google.guava:guava:23.6-android"
const val GUAVA_LISTENABLE_FUTURE = "com.google.guava:listenablefuture:1.0"
const val INTELLIJ_ANNOTATIONS = "com.intellij:annotations:12.0"
const val JAVAPOET = "com.squareup:javapoet:1.8.0"
@@ -40,10 +40,7 @@
const val KOTLINPOET = "com.squareup:kotlinpoet:1.0.0"
const val KOTLIN_STDLIB = "org.jetbrains.kotlin:kotlin-stdlib:1.3.0"
const val KOTLIN_METADATA = "me.eugeniomarletti.kotlin.metadata:kotlin-metadata:1.4.0"
-const val KOTLIN_METADATA_JVM = "org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.0.5"
-const val KOTLIN_COROUTINES = "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0"
-const val KOTLIN_COROUTINES_CORE = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0"
-const val KOTLIN_COROUTINES_TEST = "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.1.0"
+const val KOTLIN_COROUTINES = "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0"
const val LEAKCANARY_INSTRUMENTATION =
"com.squareup.leakcanary:leakcanary-android-instrumentation:1.6.2"
const val MOCKITO_CORE = "org.mockito:mockito-core:2.19.0"
@@ -56,8 +53,6 @@
const val TEST_RUNNER = "androidx.test:runner:1.1.0"
const val TEST_RULES = "androidx.test:rules:1.1.0"
const val TEST_EXT_JUNIT = "androidx.test.ext:junit:1.0.0"
-const val TEST_EXT_KTX = "androidx.test.ext:junit-ktx:1.1.0"
-const val TEST_UIAUTOMATOR = "androidx.test.uiautomator:uiautomator:2.2.0"
const val TRUTH = "com.google.truth:truth:0.42"
/**
* this Xerial version is newer than we want but we need it to fix
@@ -68,12 +63,11 @@
const val XPP3 = "xpp3:xpp3:1.1.4c"
const val XMLPULL = "xmlpull:xmlpull:1.1.3.1"
-private const val NAV_SUPPORT_VERSION = "1.0.0"
-const val NAV_SUPPORT_COMPAT = "androidx.core:core:$NAV_SUPPORT_VERSION"
-const val NAV_SUPPORT_CORE_UTILS = "androidx.legacy:legacy-support-core-utils:$NAV_SUPPORT_VERSION"
-const val NAV_SUPPORT_DESIGN = "com.google.android.material:material:$NAV_SUPPORT_VERSION"
-const val NAV_SUPPORT_FRAGMENTS = "androidx.fragment:fragment:$NAV_SUPPORT_VERSION"
-const val NAV_SUPPORT_COLLECTIONS = "androidx.collection:collection:$NAV_SUPPORT_VERSION"
+private const val NAV_SUPPORT_VERSION = "28.0.0"
+const val NAV_SUPPORT_COMPAT = "com.android.support:support-compat:$NAV_SUPPORT_VERSION"
+const val NAV_SUPPORT_CORE_UTILS = "com.android.support:support-core-utils:$NAV_SUPPORT_VERSION"
+const val NAV_SUPPORT_DESIGN = "com.android.support:design:$NAV_SUPPORT_VERSION"
+const val NAV_SUPPORT_FRAGMENTS = "com.android.support:support-fragment:$NAV_SUPPORT_VERSION"
private const val SUPPORT_VERSION = "1.0.0"
const val SUPPORT_ANNOTATIONS = "androidx.annotation:annotation:$SUPPORT_VERSION"
@@ -83,12 +77,9 @@
const val SUPPORT_FRAGMENTS = "androidx.fragment:fragment:$SUPPORT_VERSION"
const val SUPPORT_RECYCLERVIEW = "androidx.recyclerview:recyclerview:$SUPPORT_VERSION"
-const val ANDROIDX_ANNOTATION = "androidx.annotation:annotation:1.1.0-alpha02"
const val ANDROIDX_COLLECTION = "androidx.collection:collection:$SUPPORT_VERSION"
const val ANDROIDX_CORE = "androidx.core:core:1.0.0"
const val ANDROIDX_RECYCLERVIEW = "androidx.recyclerview:recyclerview:1.0.0"
-const val ANDROIDX_SQLITE = "androidx.sqlite:sqlite:2.0.1"
-const val ANDROIDX_SQLITE_FRAMEWORK = "androidx.sqlite:sqlite-framework:2.0.1"
// Arch libraries
const val ARCH_LIFECYCLE_RUNTIME = "androidx.lifecycle:lifecycle-runtime:2.0.0"
@@ -103,9 +94,9 @@
const val ARCH_CORE_RUNTIME = "androidx.arch.core:core-runtime:2.0.0"
const val ARCH_CORE_TESTING = "androidx.arch.core:core-testing:2.0.0"
-const val SAFE_ARGS_ANDROID_GRADLE_PLUGIN = "com.android.tools.build:gradle:3.3.0"
-const val SAFE_ARGS_KOTLIN_GRADLE_PLUGIN = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.20"
-const val SAFE_ARGS_NAVIGATION_COMMON = "androidx.navigation:navigation-common:2.0.0-rc02"
+const val SAFE_ARGS_ANDROID_GRADLE_PLUGIN = "com.android.tools.build:gradle:3.2.1"
+const val SAFE_ARGS_KOTLIN_GRADLE_PLUGIN = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.0"
+const val SAFE_ARGS_NAVIGATION_COMMON = "android.arch.navigation:navigation-common:1.0.0-alpha10"
const val ARCH_PAGING_COMMON = "androidx.paging:paging-common:2.0.0"
const val ARCH_PAGING_RUNTIME = "androidx.paging:paging-runtime:2.0.0"
@@ -113,4 +104,4 @@
const val ARCH_ROOM_COMPILER = "androidx.room:room-compiler:2.0.0"
const val ARCH_ROOM_RXJAVA = "androidx.room:room-rxjava2:2.0.0"
-const val ROBOLECTRIC = "org.robolectric:robolectric:4.1"
+const val ROBOLECTRIC = "org.robolectric:robolectric:4.1"
\ No newline at end of file
diff --git a/buildSrc/src/main/kotlin/androidx/build/dependencyTracker/AffectedModuleDetector.kt b/buildSrc/src/main/kotlin/androidx/build/dependencyTracker/AffectedModuleDetector.kt
index 7c3cf36..ad78fb1 100644
--- a/buildSrc/src/main/kotlin/androidx/build/dependencyTracker/AffectedModuleDetector.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/dependencyTracker/AffectedModuleDetector.kt
@@ -20,6 +20,7 @@
import androidx.build.getDistributionDirectory
import androidx.build.gradle.isRoot
import androidx.build.isRunningOnBuildServer
+import com.android.annotations.VisibleForTesting
import org.gradle.BuildAdapter
import org.gradle.api.GradleException
import org.gradle.api.Project
@@ -28,32 +29,11 @@
import org.gradle.api.logging.Logger
/**
- * The subsets we allow the projects to be partitioned into.
- * This is to allow more granular testing. Specifically, to enable running large tests on
- * CHANGED_PROJECTS, and
- *
- * The subsets are:
- * CHANGED_PROJECTS -- The containing projects for any files that were changed in this CL.
- *
- * DEPENDENT_PROJECTS -- Any projects that have a dependency on any of the projects
- * in the CHANGED_PROJECTS set.
- *
- * ALL_AFFECTED_PROJECTS -- The union of CHANGED_PROJECTS and DEPENDENT_PROJECTS,
- * which encompasses all projects that could possibly break due to the changes.
- */
-internal enum class ProjectSubset { DEPENDENT_PROJECTS, CHANGED_PROJECTS, ALL_AFFECTED_PROJECTS }
-
-/**
* A utility class that can discover which files are changed based on git history.
*
* To enable this, you need to pass [ENABLE_ARG] into the build as a command line parameter
* (-P<name>)
*
- * Passing [DEPENDENT_PROJECTS_ARG] will result in only DEPENDENT_PROJECTS being returned (see enum)
- * Passing [CHANGED_PROJECTS_ARG] will behave likewise.
- *
- * If neither of those are passed, [ALL_AFFECTED_PROJECTS] is returned.
- *
* Currently, it checks git logs to find last merge CL to discover where the anchor CL is.
*
* Eventually, we'll move to the props passed down by the build system when it is available.
@@ -71,17 +51,9 @@
private const val ROOT_PROP_NAME = "affectedModuleDetector"
private const val LOG_FILE_NAME = "affected_module_detector_log.txt"
private const val ENABLE_ARG = "androidx.enableAffectedModuleDetection"
- private const val DEPENDENT_PROJECTS_ARG = "androidx.dependentProjects"
- private const val CHANGED_PROJECTS_ARG = "androidx.changedProjects"
@JvmStatic
fun configure(gradle: Gradle, rootProject: Project) {
val enabled = rootProject.hasProperty(ENABLE_ARG)
- val subset = when {
- rootProject.hasProperty(DEPENDENT_PROJECTS_ARG) -> ProjectSubset.DEPENDENT_PROJECTS
- rootProject.hasProperty(CHANGED_PROJECTS_ARG)
- -> ProjectSubset.CHANGED_PROJECTS
- else -> ProjectSubset.ALL_AFFECTED_PROJECTS
- }
val inBuildServer = isRunningOnBuildServer()
if (!enabled && !inBuildServer) {
setInstance(rootProject, AcceptAll())
@@ -102,8 +74,7 @@
AffectedModuleDetectorImpl(
rootProject = rootProject,
logger = logger,
- ignoreUnknownProjects = false,
- projectSubset = subset
+ ignoreUnknownProjects = false
).also {
if (!enabled) {
logger.info("swapping with accept all")
@@ -176,12 +147,12 @@
*
* When a file in a module is changed, all modules that depend on it are considered as changed.
*/
+@VisibleForTesting
internal class AffectedModuleDetectorImpl constructor(
private val rootProject: Project,
private val logger: Logger?,
// used for debugging purposes when we want to ignore non module files
private val ignoreUnknownProjects: Boolean = false,
- private val projectSubset: ProjectSubset = ProjectSubset.ALL_AFFECTED_PROJECTS,
private val injectedGitClient: GitClient? = null
) : AffectedModuleDetector() {
private val git by lazy {
@@ -211,11 +182,7 @@
}
/**
- * By default, finds all modules that are affected by current changes
- *
- * With param dependentProjects, finds only modules dependent on directly changed modules
- *
- * With param changedProjects, finds only directly changed modules
+ * Finds all modules that are affected by current changes.
*
* If it cannot determine the containing module for a file (e.g. buildSrc or root), it
* defaults to all projects unless [ignoreUnknownProjects] is set to true.
@@ -239,11 +206,11 @@
}
}
if (containingProjects.any { it == null }) {
- logger?.info("couldn't find containing file for some projects, returning all projects")
+ logger?.info("couldn't find containing file for some projects, returning ALL")
logger?.info(
"""
if i was going to check for what i've found, i would've returned
- ${expandToDependents(containingProjects.filterNotNull())}
+ ${expandToDependants(containingProjects.filterNotNull())}
""".trimIndent()
)
return allProjects
@@ -252,20 +219,14 @@
ALWAYS_BUILD.any {
project.name.contains(it)
}
- }.toSet()
-
- return alwaysBuild + when (projectSubset) {
- ProjectSubset.DEPENDENT_PROJECTS
- -> expandToDependents(containingProjects) - containingProjects.filterNotNull()
- ProjectSubset.CHANGED_PROJECTS
- -> (containingProjects).filterNotNull().toSet()
- else -> expandToDependents(containingProjects)
}
+ // expand the list to all of their dependants
+ return expandToDependants(containingProjects + alwaysBuild)
}
- private fun expandToDependents(containingProjects: List<Project?>): Set<Project> {
+ private fun expandToDependants(containingProjects: List<Project?>): Set<Project> {
return containingProjects.flatMapTo(mutableSetOf()) {
- dependencyTracker.findAllDependents(it!!)
+ dependencyTracker.findAllDependants(it!!)
}
}
@@ -276,8 +237,7 @@
}
companion object {
- // dummy test to ensure no failure due to "no instrumentation. See b/112645580
- // and b/126377106
- private val ALWAYS_BUILD = setOf("dumb-test")
+ // list of projects that should always be built
+ private val ALWAYS_BUILD = arrayOf("dumb-test", "wear", "media-compat-test", "media2-test")
}
}
\ No newline at end of file
diff --git a/buildSrc/src/main/kotlin/androidx/build/dependencyTracker/DependencyTracker.kt b/buildSrc/src/main/kotlin/androidx/build/dependencyTracker/DependencyTracker.kt
index baec3ce..6808ede 100644
--- a/buildSrc/src/main/kotlin/androidx/build/dependencyTracker/DependencyTracker.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/dependencyTracker/DependencyTracker.kt
@@ -29,7 +29,7 @@
private val rootProject: Project,
private val logger: Logger?
) {
- private val dependentList: Map<Project, Set<Project>> by lazy {
+ private val dependantList: Map<Project, Set<Project>> by lazy {
val result = mutableMapOf<Project, MutableSet<Project>>()
rootProject.subprojects.forEach { project ->
logger?.info("checking ${project.path} for dependencies")
@@ -49,16 +49,16 @@
result
}
- fun findAllDependents(project: Project): Set<Project> {
- logger?.info("finding dependents of ${project.path}")
+ fun findAllDependants(project: Project): Set<Project> {
+ logger?.info("finding dependants of ${project.path}")
val result = mutableSetOf<Project>()
- fun addAllDependents(project: Project) {
+ fun addAllDependants(project: Project) {
if (result.add(project)) {
- dependentList[project]?.forEach(::addAllDependents)
+ dependantList[project]?.forEach(::addAllDependants)
}
}
- addAllDependents(project)
- logger?.info("dependents of ${project.path} is ${result.map {
+ addAllDependants(project)
+ logger?.info("dependants of ${project.path} is ${result.map {
it.path
}}")
return result
diff --git a/buildSrc/src/main/kotlin/androidx/build/doclava/ChecksConfig.kt b/buildSrc/src/main/kotlin/androidx/build/doclava/ChecksConfig.kt
index 7e6e2be..9de15ee 100644
--- a/buildSrc/src/main/kotlin/androidx/build/doclava/ChecksConfig.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/doclava/ChecksConfig.kt
@@ -45,7 +45,7 @@
"If you are adding APIs that should be excluded from the public API surface,\n" +
"consider using package or private visibility. If the API must have public\n" +
"visibility, you may exclude it from public API by using the @hide javadoc\n" +
- "annotation paired with the @RestrictTo(LIBRARY_GROUP_PREFIX) code annotation."
+ "annotation paired with the @RestrictTo(LIBRARY_GROUP) code annotation."
val CHECK_API_CONFIG_RELEASE = ChecksConfig(
onFailMessage =
diff --git a/buildSrc/src/main/kotlin/androidx/build/docs/ConcatenateFilesTask.kt b/buildSrc/src/main/kotlin/androidx/build/docs/ConcatenateFilesTask.kt
index c07ea89..d97c701 100644
--- a/buildSrc/src/main/kotlin/androidx/build/docs/ConcatenateFilesTask.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/docs/ConcatenateFilesTask.kt
@@ -16,10 +16,12 @@
package androidx.build.docs
+import org.gradle.api.Action
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.OutputFile
import java.io.File
+import java.util.SortedMap
open class ConcatenateFilesTask : DefaultTask() {
private var keyedInputs: MutableMap<String, File> = mutableMapOf()
diff --git a/buildSrc/src/main/kotlin/androidx/build/dokka/Dokka.kt b/buildSrc/src/main/kotlin/androidx/build/dokka/Dokka.kt
index 1ebba71..f1ed16e 100644
--- a/buildSrc/src/main/kotlin/androidx/build/dokka/Dokka.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/dokka/Dokka.kt
@@ -14,60 +14,81 @@
* limitations under the License.
*/
-// This file creates tasks for generating documentation using Dokka
+// This file creates tasks for generating documentation from source code using Dokka
// TODO: after DiffAndDocs and Doclava are fully obsoleted and removed, rename this from Dokka to just Docs
package androidx.build.dokka
-import java.io.File
import androidx.build.DiffAndDocs
+import androidx.build.Release
+import androidx.build.SupportLibraryExtension
import androidx.build.getBuildId
import androidx.build.getDistributionDirectory
-import androidx.build.SupportLibraryExtension
+import androidx.build.java.JavaCompileInputs
import com.android.build.gradle.LibraryExtension
import org.gradle.api.Project
+import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.bundling.Zip
import org.gradle.kotlin.dsl.apply
-import org.jetbrains.dokka.gradle.DokkaAndroidPlugin
-import org.jetbrains.dokka.gradle.DokkaAndroidTask
+import org.gradle.kotlin.dsl.getPlugin
+import org.jetbrains.dokka.gradle.DokkaPlugin
+import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.dokka.gradle.PackageOptions
object Dokka {
- fun createDocsTask(
- taskName: String,
- project: Project,
- hiddenPackages: List<String>,
- archiveTaskName: String
- ) {
- project.apply<DokkaAndroidPlugin>()
- if (project.name != "support" && project.name != "docs-runner") {
- throw Exception("Illegal project passed to createDocsTask: " + project.name)
- }
- val docsTask = project.tasks.create(taskName, DokkaAndroidTask::class.java) { docsTask ->
- docsTask.moduleName = project.name
- docsTask.outputDirectory = File(project.buildDir, taskName).absolutePath
+ private val RUNNER_TASK_NAME = "dokka"
+ public val ARCHIVE_TASK_NAME: String = "distDokkaDocs" // TODO(b/72330103) make "generateDocs" be the only archive task once Doclava is fully removed
+ private val ALTERNATE_ARCHIVE_TASK_NAME: String = "generateDocs"
+
+ private val hiddenPackages = listOf(
+ "androidx.core.internal",
+ "androidx.preference.internal",
+ "androidx.wear.internal.widget.drawer",
+ "androidx.webkit.internal",
+ "androidx.work.impl",
+ "androidx.work.impl.background",
+ "androidx.work.impl.background.systemalarm",
+ "androidx.work.impl.background.systemjob",
+ "androidx.work.impl.constraints",
+ "androidx.work.impl.constraints.controllers",
+ "androidx.work.impl.constraints.trackers",
+ "androidx.work.impl.model",
+ "androidx.work.impl.utils",
+ "androidx.work.impl.utils.futures",
+ "androidx.work.impl.utils.taskexecutor"
+ )
+
+ fun getDocsTask(project: Project): DokkaTask {
+ return project.rootProject.getOrCreateDocsTask()
+ }
+
+ @Synchronized
+ fun Project.getOrCreateDocsTask(): DokkaTask {
+ val runnerProject = this
+ if (runnerProject.tasks.findByName(Dokka.RUNNER_TASK_NAME) == null) {
+ project.apply<DokkaPlugin>()
+ val docsTask = project.tasks.getByName(Dokka.RUNNER_TASK_NAME) as DokkaTask
docsTask.outputFormat = "dac"
- docsTask.outlineRoot = "androidx/"
- docsTask.dacRoot = "/reference/kotlin"
- docsTask.moduleName = ""
for (hiddenPackage in hiddenPackages) {
val opts = PackageOptions()
opts.prefix = hiddenPackage
opts.suppress = true
docsTask.perPackageOptions.add(opts)
}
- }
-
- project.tasks.create(archiveTaskName, Zip::class.java) { zipTask ->
- zipTask.dependsOn(docsTask)
- zipTask.description = "Generates documentation artifact for pushing to " +
- "developer.android.com"
- zipTask.from(docsTask.outputDirectory) { copySpec ->
- copySpec.into("reference/kotlin")
+ val archiveTask = project.tasks.create(ARCHIVE_TASK_NAME, Zip::class.java) { task ->
+ task.dependsOn(docsTask)
+ task.description =
+ "Generates documentation artifact for pushing to developer.android.com"
+ task.from(docsTask.outputDirectory)
+ task.baseName = "android-support-dokka-docs"
+ task.version = getBuildId()
+ task.destinationDir = project.getDistributionDirectory()
}
- zipTask.baseName = taskName
- zipTask.version = getBuildId()
- zipTask.destinationDir = project.getDistributionDirectory()
+ if (project.tasks.findByName(ALTERNATE_ARCHIVE_TASK_NAME) == null) {
+ project.tasks.create(ALTERNATE_ARCHIVE_TASK_NAME)
+ }
+ project.tasks.getByName(ALTERNATE_ARCHIVE_TASK_NAME).dependsOn(archiveTask)
}
+ return runnerProject.tasks.getByName(Dokka.RUNNER_TASK_NAME) as DokkaTask
}
fun registerAndroidProject(
@@ -75,17 +96,43 @@
library: LibraryExtension,
extension: SupportLibraryExtension
) {
+ if (extension.toolingProject) {
+ project.logger.info("Project ${project.name} is tooling project; ignoring API tasks.")
+ return
+ }
+ library.libraryVariants.all { variant ->
+ if (variant.name == Release.DEFAULT_PUBLISH_CONFIG) {
+ project.afterEvaluate({
+ val inputs = JavaCompileInputs.fromLibraryVariant(library, variant)
+ registerInputs(inputs, project)
+ })
+ }
+ }
DiffAndDocs.get(project).registerPrebuilts(extension)
- DokkaPublicDocs.registerProject(project, extension)
- DokkaSourceDocs.registerAndroidProject(project, library, extension)
}
fun registerJavaProject(
project: Project,
extension: SupportLibraryExtension
) {
+ if (extension.toolingProject) {
+ project.logger.info("Project ${project.name} is tooling project; ignoring API tasks.")
+ return
+ }
+ val javaPluginConvention = project.convention.getPlugin<JavaPluginConvention>()
+ val mainSourceSet = javaPluginConvention.sourceSets.getByName("main")
+ project.afterEvaluate({
+ val inputs = JavaCompileInputs.fromSourceSet(mainSourceSet, project)
+ registerInputs(inputs, project)
+ })
DiffAndDocs.get(project).registerPrebuilts(extension)
- DokkaPublicDocs.registerProject(project, extension)
- DokkaSourceDocs.registerJavaProject(project, extension)
+ }
+
+ fun registerInputs(inputs: JavaCompileInputs, project: Project) {
+ val docsTask = getDocsTask(project)
+ docsTask.sourceDirs += inputs.sourcePaths
+ docsTask.classpath =
+ docsTask.classpath.plus(inputs.dependencyClasspath).plus(inputs.bootClasspath)
+ docsTask.dependsOn(inputs.dependencyClasspath)
}
}
diff --git a/buildSrc/src/main/kotlin/androidx/build/dokka/DokkaPublicDocs.kt b/buildSrc/src/main/kotlin/androidx/build/dokka/DokkaPublicDocs.kt
deleted file mode 100644
index 7ee82ed..0000000
--- a/buildSrc/src/main/kotlin/androidx/build/dokka/DokkaPublicDocs.kt
+++ /dev/null
@@ -1,224 +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.
- */
-
-// This file sets up building public docs from source jars
-// TODO: after DiffAndDocs and Doclava are fully obsoleted and removed, rename this from DokkaPublicDocs to just PublicDocs
-package androidx.build.dokka
-
-import java.io.File
-import androidx.build.androidJarFile
-import androidx.build.java.JavaCompileInputs
-import androidx.build.SupportLibraryExtension
-import androidx.build.RELEASE_RULE
-import androidx.build.Strategy.Ignore
-import androidx.build.Strategy.Prebuilts
-import org.gradle.api.artifacts.ResolveException
-import org.gradle.api.DefaultTask
-import org.gradle.api.Project
-import org.gradle.api.tasks.TaskAction
-import org.gradle.api.tasks.Copy
-import org.gradle.api.tasks.TaskContainer
-import org.gradle.api.tasks.util.PatternFilterable
-import org.jetbrains.dokka.gradle.DokkaTask
-
-object DokkaPublicDocs {
- public val ARCHIVE_TASK_NAME: String = "distPublicDokkaDocs"
- private val RUNNER_TASK_NAME = "dokkaPublicDocs"
- private val UNZIP_DEPS_TASK_NAME = "unzipDokkaPublicDocsDeps"
-
- public val hiddenPackages = listOf(
- "androidx.core.internal",
- "androidx.preference.internal",
- "androidx.wear.internal.widget.drawer",
- "androidx.webkit.internal",
- "androidx.work.impl",
- "androidx.work.impl.background",
- "androidx.work.impl.background.systemalarm",
- "androidx.work.impl.background.systemjob",
- "androidx.work.impl.constraints",
- "androidx.work.impl.constraints.controllers",
- "androidx.work.impl.constraints.trackers",
- "androidx.work.impl.model",
- "androidx.work.impl.utils",
- "androidx.work.impl.utils.futures",
- "androidx.work.impl.utils.taskexecutor")
-
- fun tryGetRunnerProject(project: Project): Project? {
- return project.rootProject.findProject(":docs-runner")
- }
-
- fun getRunnerProject(project: Project): Project {
- return tryGetRunnerProject(project)!!
- }
-
- fun getDocsTask(project: Project): DokkaTask {
- var runnerProject = getRunnerProject(project)
- return runnerProject.tasks.getOrCreateDocsTask(runnerProject)
- }
-
- fun getUnzipDepsTask(project: Project): LocateJarsTask {
- var runnerProject = getRunnerProject(project)
- return runnerProject.tasks.getByName(DokkaPublicDocs.UNZIP_DEPS_TASK_NAME) as LocateJarsTask
- }
-
- @Synchronized fun TaskContainer.getOrCreateDocsTask(runnerProject: Project): DokkaTask {
- val tasks = this
- if (tasks.findByName(RUNNER_TASK_NAME) == null) {
- Dokka.createDocsTask(RUNNER_TASK_NAME,
- runnerProject,
- hiddenPackages,
- ARCHIVE_TASK_NAME)
- val docsTask = runnerProject.tasks.getByName(RUNNER_TASK_NAME) as DokkaTask
- tasks.create(UNZIP_DEPS_TASK_NAME, LocateJarsTask::class.java) { unzipTask ->
- unzipTask.doLast {
- for (jar in unzipTask.outputJars) {
- docsTask.classpath = docsTask.classpath.plus(runnerProject.file(jar))
- }
- docsTask.classpath += androidJarFile(runnerProject)
- }
- docsTask.dependsOn(unzipTask)
- }
- }
- val docsTask = runnerProject.tasks.getByName(DokkaPublicDocs.RUNNER_TASK_NAME) as DokkaTask
- return docsTask
- }
-
- // specifies that <project> exists and might need us to generate documentation for it
- fun registerProject(
- project: Project,
- extension: SupportLibraryExtension
- ) {
- if (tryGetRunnerProject(project) == null) {
- return
- }
- val projectSourcesLocationType = RELEASE_RULE.resolve(extension)?.strategy
- if (projectSourcesLocationType is Prebuilts) {
- val dependency = projectSourcesLocationType.dependency(extension)
- assignPrebuiltForProject(project, dependency)
- } else if (projectSourcesLocationType != null && projectSourcesLocationType !is Ignore) {
- throw Exception("Unsupported strategy " + projectSourcesLocationType +
- " specified for publishing public docs of project " + extension +
- "; must be Prebuilts or Ignore or null (which means Ignore)")
- }
- }
-
- // specifies that <project> has docs and that those docs come from a prebuilt
- private fun assignPrebuiltForProject(project: Project, dependency: String) {
- registerPrebuilt(dependency, getRunnerProject(project))
- }
-
- // specifies that <dependency> describes an artifact containing sources that we want to include in our generated documentation
- private fun registerPrebuilt(dependency: String, runnerProject: Project): Copy {
- val docsTask = getDocsTask(runnerProject)
-
- // unzip the sources jar
- val unzipTask = getPrebuiltSources(runnerProject, dependency + ":sources")
- val sourceDir = unzipTask.destinationDir
- docsTask.dependsOn(unzipTask)
- docsTask.sourceDirs += sourceDir
-
- // also make a note to unzip any dependencies too
- getUnzipDepsTask(runnerProject).inputDependencies.add(dependency)
-
- return unzipTask
- }
-
- // returns a Copy task that provides source files for the given prebuilt
- private fun getPrebuiltSources(
- runnerProject: Project,
- mavenId: String
- ): Copy {
- val configuration = runnerProject.configurations.detachedConfiguration(
- runnerProject.dependencies.create(mavenId)
- )
- configuration.setTransitive(false)
- val artifacts = try {
- configuration.resolvedConfiguration.resolvedArtifacts
- } catch (e: ResolveException) {
- runnerProject.logger.error("DokkaPublicDocs failed to find prebuilts for $mavenId. " +
- "specified in PublichDocsRules.kt ." +
- "You should either add a prebuilt sources jar, " +
- "or add an overriding \"ignore\" rule into PublishDocsRules.kt")
- throw e
- }
-
- val sanitizedMavenId = mavenId.replace(":", "-")
- val buildDir = runnerProject.buildDir
- val destDir = runnerProject.file("$buildDir/sources-unzipped/$sanitizedMavenId")
- val unzipTask = runnerProject.tasks.create("unzip$sanitizedMavenId", Copy::class.java) {
- it.from(runnerProject.zipTree(configuration.singleFile)
- .matching {
- it.exclude("**/*.MF")
- it.exclude("**/*.aidl")
- it.exclude("**/META-INF/**")
- }
- )
- it.destinationDir = destDir
- // TODO(123020809) remove this filter once it is no longer necessary to prevent Dokka from failing
- val regex = Regex("@attr ref ([^*]*)styleable#([^_*]*)_([^*]*)$")
- it.filter({ line ->
- regex.replace(line, "{@link $1attr#$3}")
- })
- }
-
- return unzipTask
- }
-
- private fun registerInputs(inputs: JavaCompileInputs, project: Project) {
- val docsTask = getDocsTask(project)
- docsTask.sourceDirs += inputs.sourcePaths
- docsTask.classpath = docsTask.classpath.plus(inputs.dependencyClasspath)
- .plus(inputs.bootClasspath)
- docsTask.dependsOn(inputs.dependencyClasspath)
- }
-}
-
-open class LocateJarsTask : DefaultTask() {
- // dependencies to search for .jar files
- val inputDependencies = mutableListOf<String>()
-
- // .jar files found in any dependencies
- val outputJars = mutableListOf<File>()
-
- @TaskAction
- fun Extract() {
- // setup
- val inputDependencies = checkNotNull(inputDependencies) { "inputDependencies not set" }
- val project = this.project
-
- // resolve the dependencies
- var dependenciesArray = inputDependencies.map {
- project.dependencies.create(it)
- }.toTypedArray()
- val artifacts = project.configurations.detachedConfiguration(*dependenciesArray)
- .resolvedConfiguration.resolvedArtifacts
-
- // save the .jar files
- val files = artifacts.map({ artifact -> artifact.file })
- var jars = files.filter({ file -> file.name.endsWith(".jar") })
- outputJars.addAll(jars)
-
- // extract the classes.jar from each .aar file
- var aars = files.filter({ file -> file.name.endsWith(".aar") })
- for (aar in aars) {
- val tree = project.zipTree(aar)
- val classesJar = tree.matching({
- filter: PatternFilterable -> filter.include("classes.jar")
- }).single()
- outputJars.plusAssign(classesJar)
- }
- }
-}
diff --git a/buildSrc/src/main/kotlin/androidx/build/dokka/DokkaSourceDocs.kt b/buildSrc/src/main/kotlin/androidx/build/dokka/DokkaSourceDocs.kt
deleted file mode 100644
index 1e9a29b..0000000
--- a/buildSrc/src/main/kotlin/androidx/build/dokka/DokkaSourceDocs.kt
+++ /dev/null
@@ -1,113 +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.
- */
-
-// This file creates tasks for generating documentation from source code using Dokka
-// TODO: after DiffAndDocs and Doclava are fully obsoleted and removed, rename this from DokkaSourceDocs to just SourceDocs
-package androidx.build.dokka
-
-import androidx.build.java.JavaCompileInputs
-import androidx.build.SupportLibraryExtension
-import androidx.build.Release
-import com.android.build.gradle.LibraryExtension
-import org.gradle.api.Project
-import org.gradle.api.plugins.JavaPluginConvention
-import org.gradle.api.tasks.TaskContainer
-import org.gradle.kotlin.dsl.getPlugin
-import org.jetbrains.dokka.gradle.DokkaTask
-
-object DokkaSourceDocs {
- private val RUNNER_TASK_NAME = "dokkaTipOfTreeDocs"
- public val ARCHIVE_TASK_NAME: String = "distTipOfTreeDokkaDocs"
- // TODO(b/72330103) make "generateDocs" be the only archive task once Doclava is fully removed
- private val ALTERNATE_ARCHIVE_TASK_NAME: String = "generateDocs"
-
- private val hiddenPackages = DokkaPublicDocs.hiddenPackages
-
- fun tryGetRunnerProject(project: Project): Project? {
- return project.rootProject.findProject(":docs-runner")
- }
-
- fun getRunnerProject(project: Project): Project {
- return tryGetRunnerProject(project)!!
- }
-
- fun getDocsTask(project: Project): DokkaTask {
- var runnerProject = getRunnerProject(project)
- return runnerProject.tasks.getOrCreateDocsTask(runnerProject)
- }
-
- @Synchronized fun TaskContainer.getOrCreateDocsTask(runnerProject: Project): DokkaTask {
- val tasks = this
- if (tasks.findByName(DokkaSourceDocs.RUNNER_TASK_NAME) == null) {
- Dokka.createDocsTask(RUNNER_TASK_NAME, runnerProject, hiddenPackages, ARCHIVE_TASK_NAME)
- if (tasks.findByName(DokkaSourceDocs.ALTERNATE_ARCHIVE_TASK_NAME) == null) {
- tasks.create(ALTERNATE_ARCHIVE_TASK_NAME)
- }
- tasks.getByName(ALTERNATE_ARCHIVE_TASK_NAME)
- .dependsOn(tasks.getByName(ARCHIVE_TASK_NAME))
- }
- return tasks.getByName(DokkaSourceDocs.RUNNER_TASK_NAME) as DokkaTask
- }
-
- fun registerAndroidProject(
- project: Project,
- library: LibraryExtension,
- extension: SupportLibraryExtension
- ) {
- if (tryGetRunnerProject(project) == null) {
- return
- }
- if (extension.toolingProject) {
- project.logger.info("Project ${project.name} is tooling project; ignoring API tasks.")
- return
- }
- library.libraryVariants.all { variant ->
- if (variant.name == Release.DEFAULT_PUBLISH_CONFIG) {
- project.afterEvaluate({
- val inputs = JavaCompileInputs.fromLibraryVariant(library, variant)
- registerInputs(inputs, project)
- })
- }
- }
- }
-
- fun registerJavaProject(
- project: Project,
- extension: SupportLibraryExtension
- ) {
- if (tryGetRunnerProject(project) == null) {
- return
- }
- if (extension.toolingProject) {
- project.logger.info("Project ${project.name} is tooling project; ignoring API tasks.")
- return
- }
- val javaPluginConvention = project.convention.getPlugin<JavaPluginConvention>()
- val mainSourceSet = javaPluginConvention.sourceSets.getByName("main")
- project.afterEvaluate({
- val inputs = JavaCompileInputs.fromSourceSet(mainSourceSet, project)
- registerInputs(inputs, project)
- })
- }
-
- fun registerInputs(inputs: JavaCompileInputs, project: Project) {
- val docsTask = getDocsTask(project)
- docsTask.sourceDirs += inputs.sourcePaths
- docsTask.classpath = docsTask.classpath.plus(inputs.dependencyClasspath)
- .plus(inputs.bootClasspath)
- docsTask.dependsOn(inputs.dependencyClasspath)
- }
-}
diff --git a/buildSrc/src/main/kotlin/androidx/build/gmaven/GMavenVersionChecker.kt b/buildSrc/src/main/kotlin/androidx/build/gmaven/GMavenVersionChecker.kt
index 3a16d3f..482d114 100644
--- a/buildSrc/src/main/kotlin/androidx/build/gmaven/GMavenVersionChecker.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/gmaven/GMavenVersionChecker.kt
@@ -130,8 +130,8 @@
* @param artifacts Map of artifact versions keyed by artifact name
*/
private data class GroupVersionData(
- val name: String,
- val artifacts: Map<String, ArtifactVersionData>
+ val name: String,
+ val artifacts: Map<String, ArtifactVersionData>
) {
companion object {
/**
diff --git a/buildSrc/src/main/kotlin/androidx/build/java/JavaCompileInputs.kt b/buildSrc/src/main/kotlin/androidx/build/java/JavaCompileInputs.kt
index ce3eb8d..b9d9738 100644
--- a/buildSrc/src/main/kotlin/androidx/build/java/JavaCompileInputs.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/java/JavaCompileInputs.kt
@@ -22,11 +22,14 @@
import org.gradle.api.attributes.Attribute
import org.gradle.api.file.FileCollection
import org.gradle.api.Project
+import org.gradle.api.Task
import org.gradle.api.tasks.SourceSet
import java.io.File
-// JavaCompileInputs contains the information required to compile Java/Kotlin code
-// This can be helpful for creating Metalava and Dokka tasks with the same settings
+/**
+ * JavaCompileInputs contains the information required to compile Java/Kotlin code
+ * This can be helpful for creating Metalava and Dokka tasks with the same settings
+ */
data class JavaCompileInputs(
// Source files to process
val sourcePaths: Collection<File>,
@@ -38,12 +41,10 @@
val bootClasspath: Collection<File>
) {
companion object {
- // Constructs a JavaCompileInputs from a library and its variant
+ /** Constructs a JavaCompileInputs from a library and its variant */
fun fromLibraryVariant(library: LibraryExtension, variant: BaseVariant): JavaCompileInputs {
- var sourcePaths: Collection<File> = variant.sourceSets.find({ it ->
- it.name == "main"
- })!!.javaDirectories
- val dependencyClasspath = variant.compileConfiguration.incoming.artifactView { config ->
+ var sourcePaths: Collection<File> = variant.sourceSets.find({ it -> it.name == "main" })!!.javaDirectories
+ var dependencyClasspath: FileCollection = variant.compileConfiguration.incoming.artifactView { config ->
config.attributes { container ->
container.attribute(Attribute.of("artifactType", String::class.java), "jar")
}
@@ -53,7 +54,7 @@
return JavaCompileInputs(sourcePaths, dependencyClasspath, bootClasspath)
}
- // Constructs a JavaCompileInputs from a sourceset
+ /** Constructs a JavaCompileInputs from a sourceset */
fun fromSourceSet(sourceSet: SourceSet, project: Project): JavaCompileInputs {
val sourcePaths: Collection<File> = sourceSet.allSource.srcDirs
val dependencyClasspath = sourceSet.compileClasspath
@@ -62,3 +63,4 @@
}
}
}
+
diff --git a/buildSrc/src/main/kotlin/androidx/build/metalava/CheckApiCompatibilityTask.kt b/buildSrc/src/main/kotlin/androidx/build/metalava/CheckApiCompatibilityTask.kt
index d2ee311..84678ba 100644
--- a/buildSrc/src/main/kotlin/androidx/build/metalava/CheckApiCompatibilityTask.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/metalava/CheckApiCompatibilityTask.kt
@@ -17,52 +17,58 @@
package androidx.build.metalava
import androidx.build.checkapi.ApiLocation
-import androidx.build.checkapi.ApiViolationExclusions
+import com.android.build.gradle.BaseExtension
+import com.android.build.gradle.api.BaseVariant
+import org.gradle.api.attributes.Attribute
+import org.gradle.api.file.FileCollection
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.OutputFiles
import org.gradle.api.tasks.TaskAction
import java.io.File
-// Validate an API signature text file against a set of source files.
+/** Validate an API signature text file against a set of source files. */
open class CheckApiCompatibilityTask : MetalavaTask() {
- // Text file from which the API signatures will be obtained.
- var referenceApi: ApiLocation? = null
- // Text file listing violations that should be ignored
- var exclusions: ApiViolationExclusions? = null
+ /**
+ * Text file from which the API signatures will be obtained.
+ */
+ var apiLocation: ApiLocation? = null
- // Whether to confirm that no restricted APIs were removed since the previous release
+ /**
+ * Whether to confirm that no restricted APIs were removed since the previous release
+ */
var checkRestrictedAPIs = false
@InputFiles
- fun getTaskInputs(): List<File> {
+ fun getTaskInputs(): List<File>? {
if (checkRestrictedAPIs) {
- return referenceApi!!.files() + exclusions!!.files()
+ return apiLocation?.files()
}
- return listOf(referenceApi!!.publicApiFile, exclusions!!.publicApiFile)
+ return listOf(apiLocation!!.publicApiFile)
}
- // Declaring outputs prevents Gradle from rerunning this task if the inputs haven't changed
+ /**
+ * Declaring outputs prevents Gradle from rerunning this task if the inputs haven't changed
+ */
@OutputFiles
- fun getTaskOutputs(): List<File> {
- return listOf(referenceApi!!.publicApiFile)
+ fun getTaskOutputs(): List<File>? {
+ return getTaskInputs()
}
@TaskAction
fun exec() {
- val referenceApi = checkNotNull(referenceApi) { "referenceApi not set." }
- val exclusions = checkNotNull(exclusions) { "exclusions not set." }
+ val publicApiFile = checkNotNull(apiLocation?.publicApiFile) { "publicApiFile not set." }
+ val restrictedApiFile = checkNotNull(apiLocation?.restrictedApiFile) { "restrictedApiFile not set." }
check(bootClasspath.isNotEmpty()) { "Android boot classpath not set." }
- checkApiFile(referenceApi.publicApiFile, exclusions.publicApiFile, false)
+ checkApiFile(publicApiFile, false)
if (checkRestrictedAPIs) {
- checkApiFile(referenceApi.restrictedApiFile, exclusions.restrictedApiFile, true)
+ checkApiFile(restrictedApiFile, true)
}
}
- // Confirms that the public API of this library (or the restricted API, if <checkRestrictedAPIs> is set
- // is compatible with <apiFile> except for any exclusions listed in <exclusionsFile>
- fun checkApiFile(apiFile: File, exclusionsFile: File, checkRestrictedAPIs: Boolean) {
+
+ fun checkApiFile(apiFile: File, checkRestrictedApis: Boolean) {
var args = listOf("--classpath",
(bootClasspath + dependencyClasspath!!.files).joinToString(File.pathSeparator),
@@ -72,13 +78,11 @@
"--check-compatibility:api:released",
apiFile.toString(),
- "--warnings-as-errors",
- "--format=v3"
+ "--compatible-output=no",
+ "--omit-common-packages=yes",
+ "--input-kotlin-nulls=yes"
)
- if (exclusionsFile.exists()) {
- args = args + listOf("--baseline", exclusionsFile.toString())
- }
- if (checkRestrictedAPIs) {
+ if (checkRestrictedApis) {
args = args + listOf("--show-annotation", "androidx.annotation.RestrictTo")
}
runWithArgs(args)
diff --git a/buildSrc/src/main/kotlin/androidx/build/metalava/CheckApiEquivalenceTask.kt b/buildSrc/src/main/kotlin/androidx/build/metalava/CheckApiEquivalenceTask.kt
index 474d6d5..bfb7f79 100644
--- a/buildSrc/src/main/kotlin/androidx/build/metalava/CheckApiEquivalenceTask.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/metalava/CheckApiEquivalenceTask.kt
@@ -17,9 +17,14 @@
package androidx.build.metalava
import androidx.build.checkapi.ApiLocation
+import com.android.build.gradle.BaseExtension
+import com.android.build.gradle.api.BaseVariant
import org.apache.commons.io.FileUtils
+import org.gradle.api.attributes.Attribute
import org.gradle.api.DefaultTask
+import org.gradle.api.file.FileCollection
import org.gradle.api.GradleException
+import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.OutputFiles
import org.gradle.api.tasks.TaskAction
diff --git a/buildSrc/src/main/kotlin/androidx/build/metalava/GenerateApiTask.kt b/buildSrc/src/main/kotlin/androidx/build/metalava/GenerateApiTask.kt
index 8ebdcdf..3fce37a 100644
--- a/buildSrc/src/main/kotlin/androidx/build/metalava/GenerateApiTask.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/metalava/GenerateApiTask.kt
@@ -17,7 +17,12 @@
package androidx.build.metalava
import androidx.build.checkapi.ApiLocation
-import org.gradle.api.GradleException
+import com.android.build.gradle.BaseExtension
+import com.android.build.gradle.api.BaseVariant
+import com.google.common.io.Files
+import org.gradle.api.attributes.Attribute
+import org.gradle.api.file.FileCollection
+import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.OutputFiles
import org.gradle.api.tasks.TaskAction
import java.io.File
@@ -57,7 +62,8 @@
"--api",
publicApiFile.toString(),
- "--format=v3",
+ "--compatible-output=no",
+ "--omit-common-packages=yes",
"--output-kotlin-nulls=yes"
)
@@ -77,7 +83,8 @@
"--show-annotation",
"androidx.annotation.RestrictTo",
- "--format=v3",
+ "--compatible-output=no",
+ "--omit-common-packages=yes",
"--output-kotlin-nulls=yes"
)
@@ -89,22 +96,11 @@
fun removeRestrictToLibraryLines(inputFile: File, outputFile: File) {
val outputBuilder = StringBuilder()
val lines = inputFile.readLines()
- var skipScopeUntil: String? = null
for (line in lines) {
- val skip = line.contains("@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY)")
- if (skip && line.endsWith("{")) {
- skipScopeUntil = line.commonPrefixWith(" ") + "}"
- }
- if (!skip && skipScopeUntil == null) {
+ if (!line.contains("@RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY)")) {
outputBuilder.append(line)
outputBuilder.append("\n")
}
- if (line == skipScopeUntil) {
- skipScopeUntil = null
- }
- }
- if (skipScopeUntil != null) {
- throw GradleException("Skipping until `$skipScopeUntil`, but found EOF")
}
outputFile.writeText(outputBuilder.toString())
}
diff --git a/buildSrc/src/main/kotlin/androidx/build/metalava/IgnoreApiChangesTask.kt b/buildSrc/src/main/kotlin/androidx/build/metalava/IgnoreApiChangesTask.kt
deleted file mode 100644
index e65ebd4..0000000
--- a/buildSrc/src/main/kotlin/androidx/build/metalava/IgnoreApiChangesTask.kt
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2019 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.build.metalava
-
-import androidx.build.checkapi.ApiLocation
-import androidx.build.checkapi.ApiViolationExclusions
-import com.google.common.io.Files
-import org.gradle.api.tasks.InputFiles
-import org.gradle.api.tasks.OutputFiles
-import org.gradle.api.tasks.TaskAction
-import java.io.File
-
-// Updates an API tracking exceptions file (api/*.*.*.ignore) to match the current set of violations
-open class IgnoreApiChangesTask : MetalavaTask() {
- // The API that the library is supposed to be compatible with
- var referenceApi: ApiLocation? = null
-
- // The exclusions files (api/*.*.*.ignore) to update
- var exclusions: ApiViolationExclusions? = null
-
- // Whether to update the file having restricted APIs too
- var processRestrictedAPIs = false
-
- // Path of temporary api-changes exemptions file
- var intermediateExclusionsFile: File? = null
-
- @InputFiles
- fun getTaskInputs(): List<File> {
- if (processRestrictedAPIs) {
- return referenceApi!!.files()
- }
- return listOf(referenceApi!!.publicApiFile)
- }
-
- // Declaring outputs prevents Gradle from rerunning this task if the inputs haven't changed
- @OutputFiles
- fun getTaskOutputs(): List<File>? {
- if (processRestrictedAPIs) {
- return exclusions!!.files()
- }
- return listOf(exclusions!!.publicApiFile)
- }
-
- @TaskAction
- fun exec() {
- val referenceApi = checkNotNull(referenceApi) { "referenceApi not set." }
- val exclusions = checkNotNull(exclusions) { "exclusions not set." }
-
- check(bootClasspath.isNotEmpty()) { "Android boot classpath not set." }
-
- updateExclusions(referenceApi.publicApiFile, exclusions.publicApiFile, false)
- if (processRestrictedAPIs && referenceApi.restrictedApiFile.exists()) {
- updateExclusions(referenceApi.restrictedApiFile, exclusions.restrictedApiFile, true)
- }
- }
-
- // Updates the contents of exclusionsFile to specify an exception for every API present in apiFile but not
- // present in the current source path
- fun updateExclusions(apiFile: File, exclusionsFile: File, processRestrictedAPIs: Boolean) {
- val intermediateExclusionsFile = checkNotNull(intermediateExclusionsFile) { "intermediateExclusionsFile not set" }
- intermediateExclusionsFile.parentFile.mkdirs()
- intermediateExclusionsFile.createNewFile()
-
- var args = listOf("--classpath",
- (bootClasspath + dependencyClasspath!!.files).joinToString(File.pathSeparator),
-
- "--source-path",
- sourcePaths.filter { it.exists() }.joinToString(File.pathSeparator),
-
- "--check-compatibility:api:released",
- apiFile.toString(),
-
- "--update-baseline",
- intermediateExclusionsFile.toString(),
- "--baseline", intermediateExclusionsFile.toString(),
- "--pass-baseline-updates",
-
- "--format=v3",
- "--omit-common-packages=yes"
- )
- if (processRestrictedAPIs) {
- args = args + listOf("--show-annotation", "androidx.annotation.RestrictTo")
- }
- runWithArgs(args)
-
- if (intermediateExclusionsFile.length() > 0) {
- Files.copy(intermediateExclusionsFile, exclusionsFile)
- } else {
- if (exclusionsFile.exists()) {
- exclusionsFile.delete()
- }
- }
- }
-}
diff --git a/buildSrc/src/main/kotlin/androidx/build/metalava/Metalava.kt b/buildSrc/src/main/kotlin/androidx/build/metalava/Metalava.kt
index 5afdc24..45263b0 100644
--- a/buildSrc/src/main/kotlin/androidx/build/metalava/Metalava.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/metalava/Metalava.kt
@@ -19,7 +19,6 @@
import androidx.build.AndroidXPlugin.Companion.BUILD_ON_SERVER_TASK
import androidx.build.SupportLibraryExtension
import androidx.build.checkapi.ApiLocation
-import androidx.build.checkapi.ApiViolationExclusions
import androidx.build.checkapi.getCurrentApiLocation
import androidx.build.checkapi.getRequiredCompatibilityApiLocation
import androidx.build.checkapi.hasApiFolder
@@ -37,7 +36,7 @@
object Metalava {
private fun Project.createMetalavaConfiguration(): Configuration {
return configurations.create("metalava") {
- val dependency = dependencies.create("com.android:metalava:1.2.5-SNAPSHOT:shadow@jar")
+ val dependency = dependencies.create("com.android:metalava:1.1.2-SNAPSHOT:shadow@jar")
it.dependencies.add(dependency)
}
}
@@ -116,7 +115,6 @@
task.description = "Generates API files from source"
task.apiLocation = builtApiLocation
task.configuration = metalavaConfiguration
- task.generateRestrictedAPIs = extension.trackRestrictedAPIs
task.dependsOn(metalavaConfiguration)
}
applyInputs(javaCompileInputs, generateApi)
@@ -133,23 +131,13 @@
val lastReleasedApiFile = project.getRequiredCompatibilityApiLocation()
if (lastReleasedApiFile != null) {
val checkApiRelease = project.tasks.create("checkApiRelease", CheckApiCompatibilityTask::class.java) { task ->
- task.configuration = metalavaConfiguration
- task.referenceApi = lastReleasedApiFile
- task.exclusions = ApiViolationExclusions.fromApiLocation(libraryVersionApi)
- task.dependsOn(metalavaConfiguration)
- task.checkRestrictedAPIs = extension.trackRestrictedAPIs
- }
- applyInputs(javaCompileInputs, checkApiRelease)
- checkApi.dependsOn(checkApiRelease)
-
- val updateApiTrackingExceptions = project.tasks.create("ignoreApiChanges", IgnoreApiChangesTask::class.java) { task ->
- task.configuration = metalavaConfiguration
- task.referenceApi = checkApiRelease.referenceApi
- task.exclusions = checkApiRelease.exclusions
- task.processRestrictedAPIs = extension.trackRestrictedAPIs
- task.intermediateExclusionsFile = File(project.docsDir(), "release/${project.name}/api-changes.ignore")
- }
- applyInputs(javaCompileInputs, updateApiTrackingExceptions)
+ task.configuration = metalavaConfiguration
+ task.apiLocation = lastReleasedApiFile
+ task.dependsOn(metalavaConfiguration)
+ task.checkRestrictedAPIs = extension.trackRestrictedAPIs
+ }
+ applyInputs(javaCompileInputs, checkApiRelease)
+ checkApi.dependsOn(checkApiRelease)
}
project.tasks.create("updateApi", UpdateApiTask::class.java) { task ->
diff --git a/buildSrc/src/main/kotlin/androidx/build/metalava/UpdateApiTask.kt b/buildSrc/src/main/kotlin/androidx/build/metalava/UpdateApiTask.kt
index 69a7259..db9457c 100644
--- a/buildSrc/src/main/kotlin/androidx/build/metalava/UpdateApiTask.kt
+++ b/buildSrc/src/main/kotlin/androidx/build/metalava/UpdateApiTask.kt
@@ -17,9 +17,13 @@
package androidx.build.metalava
import androidx.build.checkapi.ApiLocation
+import com.android.build.gradle.BaseExtension
+import com.android.build.gradle.api.BaseVariant
import com.google.common.io.Files
+import org.gradle.api.attributes.Attribute
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
+import org.gradle.api.file.FileCollection
import org.gradle.api.logging.Logger
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.OutputFiles
@@ -86,6 +90,6 @@
}
Files.copy(source, dest)
- logger.lifecycle("Copied $source to $dest")
+ logger.lifecycle("Copied ${source} to ${dest}")
}
}
diff --git a/buildSrc/src/test/kotlin/androidx/build/dependencyTracker/AffectedModuleDetectorImplTest.kt b/buildSrc/src/test/kotlin/androidx/build/dependencyTracker/AffectedModuleDetectorImplTest.kt
index 514f5c6..b012be6 100644
--- a/buildSrc/src/test/kotlin/androidx/build/dependencyTracker/AffectedModuleDetectorImplTest.kt
+++ b/buildSrc/src/test/kotlin/androidx/build/dependencyTracker/AffectedModuleDetectorImplTest.kt
@@ -41,38 +41,11 @@
private lateinit var root: Project
private lateinit var p1: Project
private lateinit var p2: Project
- private lateinit var p3: Project
- private lateinit var p4: Project
- private lateinit var p5: Project
- private lateinit var p6: Project
- private lateinit var p7: Project
@Before
fun init() {
val tmpDir = tmpFolder.root
- /*
-
- Dummy project file tree:
-
- root
- / | \
- p1 p7 p2
- / \
- p3 p5
- / \
- p4 p6
-
- Dependency tree:
-
- p1 p2
- / \ / \
- p3 p5 p6
- /
- p4
-
- */
-
root = ProjectBuilder.builder()
.withProjectDir(tmpDir)
.withName("root")
@@ -87,40 +60,6 @@
.withName("p2")
.withParent(root)
.build()
- p3 = ProjectBuilder.builder()
- .withProjectDir(tmpDir.resolve("p1:p3"))
- .withName("p3")
- .withParent(p1)
- .build()
- val p3config = p3.configurations.create("p3config")
- p3config.dependencies.add(p3.dependencies.project(mutableMapOf("path" to ":p1")))
- p4 = ProjectBuilder.builder()
- .withProjectDir(tmpDir.resolve("p1:p3:p4"))
- .withName("p4")
- .withParent(p3)
- .build()
- val p4config = p4.configurations.create("p4config")
- p4config.dependencies.add(p4.dependencies.project(mutableMapOf("path" to ":p1:p3")))
- p5 = ProjectBuilder.builder()
- .withProjectDir(tmpDir.resolve("p2:p5"))
- .withName("p5")
- .withParent(p2)
- .build()
- val p5config = p5.configurations.create("p5config")
- p5config.dependencies.add(p5.dependencies.project(mutableMapOf("path" to ":p2")))
- p5config.dependencies.add(p5.dependencies.project(mutableMapOf("path" to ":p1:p3")))
- p6 = ProjectBuilder.builder()
- .withProjectDir(tmpDir.resolve("p1:p3:p6"))
- .withName("p6")
- .withParent(p3)
- .build()
- val p6config = p6.configurations.create("p6config")
- p6config.dependencies.add(p6.dependencies.project(mutableMapOf("path" to ":p2")))
- p7 = ProjectBuilder.builder()
- .withProjectDir(tmpDir.resolve("p7"))
- .withName("p7")
- .withParent(root)
- .build()
}
@Test
@@ -129,45 +68,12 @@
rootProject = root,
logger = logger,
ignoreUnknownProjects = false,
- projectSubset = ProjectSubset.ALL_AFFECTED_PROJECTS,
injectedGitClient = MockGitClient(
lastMergeSha = "foo",
changedFiles = emptyList())
)
MatcherAssert.assertThat(detector.affectedProjects, CoreMatchers.`is`(
- setOf(p1, p2, p3, p4, p5, p6, p7)
- ))
- }
-
- @Test
- fun noChangeCLsOnlyDependent() {
- val detector = AffectedModuleDetectorImpl(
- rootProject = root,
- logger = logger,
- ignoreUnknownProjects = false,
- projectSubset = ProjectSubset.DEPENDENT_PROJECTS,
- injectedGitClient = MockGitClient(
- lastMergeSha = "foo",
- changedFiles = emptyList())
- )
- MatcherAssert.assertThat(detector.affectedProjects, CoreMatchers.`is`(
- setOf(p1, p2, p3, p4, p5, p6, p7)
- ))
- }
-
- @Test
- fun noChangeCLsOnlyDirectlyAffected() {
- val detector = AffectedModuleDetectorImpl(
- rootProject = root,
- logger = logger,
- ignoreUnknownProjects = false,
- projectSubset = ProjectSubset.CHANGED_PROJECTS,
- injectedGitClient = MockGitClient(
- lastMergeSha = "foo",
- changedFiles = emptyList())
- )
- MatcherAssert.assertThat(detector.affectedProjects, CoreMatchers.`is`(
- setOf(p1, p2, p3, p4, p5, p6, p7)
+ setOf(p1, p2)
))
}
@@ -177,55 +83,21 @@
rootProject = root,
logger = logger,
ignoreUnknownProjects = false,
- projectSubset = ProjectSubset.ALL_AFFECTED_PROJECTS,
injectedGitClient = MockGitClient(
lastMergeSha = "foo",
changedFiles = listOf(convertToFilePath("p1", "foo.java")))
)
MatcherAssert.assertThat(detector.affectedProjects, CoreMatchers.`is`(
- setOf(p1, p3, p4, p5)
+ setOf(p1)
))
}
@Test
- fun changeInOneOnlyDependent() {
- val detector = AffectedModuleDetectorImpl(
- rootProject = root,
- logger = logger,
- ignoreUnknownProjects = false,
- projectSubset = ProjectSubset.DEPENDENT_PROJECTS,
- injectedGitClient = MockGitClient(
- lastMergeSha = "foo",
- changedFiles = listOf(convertToFilePath("p1", "foo.java")))
- )
- MatcherAssert.assertThat(detector.affectedProjects, CoreMatchers.`is`(
- setOf(p3, p4, p5)
- ))
- }
-
- @Test
- fun changeInOneOnlyDirectlyAffected() {
- val detector = AffectedModuleDetectorImpl(
- rootProject = root,
- logger = logger,
- ignoreUnknownProjects = false,
- projectSubset = ProjectSubset.CHANGED_PROJECTS,
- injectedGitClient = MockGitClient(
- lastMergeSha = "foo",
- changedFiles = listOf(convertToFilePath("p1", "foo.java")))
- )
- MatcherAssert.assertThat(detector.affectedProjects, CoreMatchers.`is`(
- setOf(p1)
- ))
- }
-
- @Test
- fun changeInTwo() {
+ fun changeInBoth() {
val detector = AffectedModuleDetectorImpl(
rootProject = root,
logger = logger,
ignoreUnknownProjects = false,
- projectSubset = ProjectSubset.ALL_AFFECTED_PROJECTS,
injectedGitClient = MockGitClient(
lastMergeSha = "foo",
changedFiles = listOf(
@@ -233,43 +105,7 @@
convertToFilePath("p2", "bar.java")))
)
MatcherAssert.assertThat(detector.affectedProjects, CoreMatchers.`is`(
- setOf(p1, p2, p3, p4, p5, p6)
- ))
- }
-
- @Test
- fun changeInTwoOnlyDependent() {
- val detector = AffectedModuleDetectorImpl(
- rootProject = root,
- logger = logger,
- ignoreUnknownProjects = false,
- projectSubset = ProjectSubset.DEPENDENT_PROJECTS,
- injectedGitClient = MockGitClient(
- lastMergeSha = "foo",
- changedFiles = listOf(
- convertToFilePath("p1", "foo.java"),
- convertToFilePath("p2", "bar.java")))
- )
- MatcherAssert.assertThat(detector.affectedProjects, CoreMatchers.`is`(
- setOf(p3, p4, p5, p6)
- ))
- }
-
- @Test
- fun changeInTwoOnlyDirectlyAffected() {
- val detector = AffectedModuleDetectorImpl(
- rootProject = root,
- logger = logger,
- ignoreUnknownProjects = false,
- projectSubset = ProjectSubset.CHANGED_PROJECTS,
- injectedGitClient = MockGitClient(
- lastMergeSha = "foo",
- changedFiles = listOf(
- convertToFilePath("p1", "foo.java"),
- convertToFilePath("p2", "bar.java")))
- )
- MatcherAssert.assertThat(detector.affectedProjects, CoreMatchers.`is`(
- setOf(p1, p2)
+ setOf(p1, p2)
))
}
@@ -279,45 +115,12 @@
rootProject = root,
logger = logger,
ignoreUnknownProjects = false,
- projectSubset = ProjectSubset.ALL_AFFECTED_PROJECTS,
injectedGitClient = MockGitClient(
lastMergeSha = "foo",
changedFiles = listOf("foo.java"))
)
MatcherAssert.assertThat(detector.affectedProjects, CoreMatchers.`is`(
- setOf(p1, p2, p3, p4, p5, p6, p7)
- ))
- }
-
- @Test
- fun changeInRootOnlyDependent() {
- val detector = AffectedModuleDetectorImpl(
- rootProject = root,
- logger = logger,
- ignoreUnknownProjects = false,
- projectSubset = ProjectSubset.DEPENDENT_PROJECTS,
- injectedGitClient = MockGitClient(
- lastMergeSha = "foo",
- changedFiles = listOf("foo.java"))
- )
- MatcherAssert.assertThat(detector.affectedProjects, CoreMatchers.`is`(
- setOf(p1, p2, p3, p4, p5, p6, p7)
- ))
- }
-
- @Test
- fun changeInRootOnlyDirectlyAffected() {
- val detector = AffectedModuleDetectorImpl(
- rootProject = root,
- logger = logger,
- ignoreUnknownProjects = false,
- projectSubset = ProjectSubset.CHANGED_PROJECTS,
- injectedGitClient = MockGitClient(
- lastMergeSha = "foo",
- changedFiles = listOf("foo.java"))
- )
- MatcherAssert.assertThat(detector.affectedProjects, CoreMatchers.`is`(
- setOf(p1, p2, p3, p4, p5, p6, p7)
+ setOf(p1, p2)
))
}
diff --git a/car/cluster/api/1.0.0-alpha5.txt b/car/cluster/api/1.0.0-alpha5.txt
index bcdbdbb..8b9cf5a 100644
--- a/car/cluster/api/1.0.0-alpha5.txt
+++ b/car/cluster/api/1.0.0-alpha5.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.car.cluster.navigation {
public final class Destination implements androidx.versionedparcelable.VersionedParcelable {
@@ -21,7 +21,7 @@
method public androidx.car.cluster.navigation.Destination.Builder setTraffic(androidx.car.cluster.navigation.Destination.Traffic, androidx.car.cluster.navigation.Destination.Traffic...);
}
- public enum Destination.Traffic {
+ public static enum Destination.Traffic {
enum_constant public static final androidx.car.cluster.navigation.Destination.Traffic HIGH;
enum_constant public static final androidx.car.cluster.navigation.Destination.Traffic LOW;
enum_constant public static final androidx.car.cluster.navigation.Destination.Traffic MEDIUM;
@@ -35,7 +35,7 @@
method public int getMeters();
}
- public enum Distance.Unit {
+ public static enum Distance.Unit {
enum_constant public static final androidx.car.cluster.navigation.Distance.Unit FEET;
enum_constant public static final androidx.car.cluster.navigation.Distance.Unit KILOMETERS;
enum_constant public static final androidx.car.cluster.navigation.Distance.Unit METERS;
@@ -81,7 +81,7 @@
method public androidx.car.cluster.navigation.LaneDirection.Builder setShape(androidx.car.cluster.navigation.LaneDirection.Shape, androidx.car.cluster.navigation.LaneDirection.Shape...);
}
- public enum LaneDirection.Shape {
+ public static enum LaneDirection.Shape {
enum_constant public static final androidx.car.cluster.navigation.LaneDirection.Shape NORMAL_LEFT;
enum_constant public static final androidx.car.cluster.navigation.LaneDirection.Shape NORMAL_RIGHT;
enum_constant public static final androidx.car.cluster.navigation.LaneDirection.Shape SHARP_LEFT;
@@ -114,7 +114,7 @@
method public androidx.car.cluster.navigation.Maneuver.Builder setType(androidx.car.cluster.navigation.Maneuver.Type, androidx.car.cluster.navigation.Maneuver.Type...);
}
- public enum Maneuver.Type {
+ public static enum Maneuver.Type {
enum_constant public static final androidx.car.cluster.navigation.Maneuver.Type DEPART;
enum_constant public static final androidx.car.cluster.navigation.Maneuver.Type DESTINATION;
enum_constant public static final androidx.car.cluster.navigation.Maneuver.Type DESTINATION_LEFT;
@@ -189,7 +189,7 @@
method public androidx.car.cluster.navigation.NavigationState.Builder setServiceStatus(androidx.car.cluster.navigation.NavigationState.ServiceStatus, androidx.car.cluster.navigation.NavigationState.ServiceStatus...);
}
- public enum NavigationState.ServiceStatus {
+ public static enum NavigationState.ServiceStatus {
enum_constant public static final androidx.car.cluster.navigation.NavigationState.ServiceStatus NORMAL;
enum_constant public static final androidx.car.cluster.navigation.NavigationState.ServiceStatus REROUTING;
}
diff --git a/car/cluster/api/current.txt b/car/cluster/api/current.txt
index bcdbdbb..8b9cf5a 100644
--- a/car/cluster/api/current.txt
+++ b/car/cluster/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.car.cluster.navigation {
public final class Destination implements androidx.versionedparcelable.VersionedParcelable {
@@ -21,7 +21,7 @@
method public androidx.car.cluster.navigation.Destination.Builder setTraffic(androidx.car.cluster.navigation.Destination.Traffic, androidx.car.cluster.navigation.Destination.Traffic...);
}
- public enum Destination.Traffic {
+ public static enum Destination.Traffic {
enum_constant public static final androidx.car.cluster.navigation.Destination.Traffic HIGH;
enum_constant public static final androidx.car.cluster.navigation.Destination.Traffic LOW;
enum_constant public static final androidx.car.cluster.navigation.Destination.Traffic MEDIUM;
@@ -35,7 +35,7 @@
method public int getMeters();
}
- public enum Distance.Unit {
+ public static enum Distance.Unit {
enum_constant public static final androidx.car.cluster.navigation.Distance.Unit FEET;
enum_constant public static final androidx.car.cluster.navigation.Distance.Unit KILOMETERS;
enum_constant public static final androidx.car.cluster.navigation.Distance.Unit METERS;
@@ -81,7 +81,7 @@
method public androidx.car.cluster.navigation.LaneDirection.Builder setShape(androidx.car.cluster.navigation.LaneDirection.Shape, androidx.car.cluster.navigation.LaneDirection.Shape...);
}
- public enum LaneDirection.Shape {
+ public static enum LaneDirection.Shape {
enum_constant public static final androidx.car.cluster.navigation.LaneDirection.Shape NORMAL_LEFT;
enum_constant public static final androidx.car.cluster.navigation.LaneDirection.Shape NORMAL_RIGHT;
enum_constant public static final androidx.car.cluster.navigation.LaneDirection.Shape SHARP_LEFT;
@@ -114,7 +114,7 @@
method public androidx.car.cluster.navigation.Maneuver.Builder setType(androidx.car.cluster.navigation.Maneuver.Type, androidx.car.cluster.navigation.Maneuver.Type...);
}
- public enum Maneuver.Type {
+ public static enum Maneuver.Type {
enum_constant public static final androidx.car.cluster.navigation.Maneuver.Type DEPART;
enum_constant public static final androidx.car.cluster.navigation.Maneuver.Type DESTINATION;
enum_constant public static final androidx.car.cluster.navigation.Maneuver.Type DESTINATION_LEFT;
@@ -189,7 +189,7 @@
method public androidx.car.cluster.navigation.NavigationState.Builder setServiceStatus(androidx.car.cluster.navigation.NavigationState.ServiceStatus, androidx.car.cluster.navigation.NavigationState.ServiceStatus...);
}
- public enum NavigationState.ServiceStatus {
+ public static enum NavigationState.ServiceStatus {
enum_constant public static final androidx.car.cluster.navigation.NavigationState.ServiceStatus NORMAL;
enum_constant public static final androidx.car.cluster.navigation.NavigationState.ServiceStatus REROUTING;
}
diff --git a/car/cluster/api/restricted_1.0.0-alpha5.txt b/car/cluster/api/restricted_1.0.0-alpha5.txt
deleted file mode 100644
index 19769fb..0000000
--- a/car/cluster/api/restricted_1.0.0-alpha5.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-// Signature format: 3.0
-package androidx.car.cluster.navigation {
-
- public class ImageReference implements androidx.versionedparcelable.VersionedParcelable {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public String getRawContentUri();
- }
-
- public class RichTextElement implements androidx.versionedparcelable.VersionedParcelable {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public RichTextElement(String, androidx.car.cluster.navigation.ImageReference?);
- }
-
-}
-
diff --git a/car/cluster/api/restricted_current.txt b/car/cluster/api/restricted_current.txt
deleted file mode 100644
index 19769fb..0000000
--- a/car/cluster/api/restricted_current.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-// Signature format: 3.0
-package androidx.car.cluster.navigation {
-
- public class ImageReference implements androidx.versionedparcelable.VersionedParcelable {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public String getRawContentUri();
- }
-
- public class RichTextElement implements androidx.versionedparcelable.VersionedParcelable {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public RichTextElement(String, androidx.car.cluster.navigation.ImageReference?);
- }
-
-}
-
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/Common.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/Common.java
index 0204504..8c83496 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/Common.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/Common.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -31,7 +31,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
final class Common {
/**
* This is a utility class
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/Destination.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/Destination.java
index 8ddceb6..77ee63b 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/Destination.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/Destination.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -66,14 +66,14 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Destination() {
}
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Destination(@NonNull String title, @NonNull String address, @Nullable Distance distance,
@Nullable Time eta, @Nullable LatLng latlng, @Nullable EnumWrapper<Traffic> traffic) {
mTitle = title;
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/Distance.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/Distance.java
index 24d75d1..2c226ce 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/Distance.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/Distance.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
@@ -62,7 +62,7 @@
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Distance() {
}
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/EnumWrapper.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/EnumWrapper.java
index 2957988..a865983 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/EnumWrapper.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/EnumWrapper.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -40,7 +40,7 @@
* @param <T> Enum type to be wrapped.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@VersionedParcelize
final class EnumWrapper<T extends Enum<T>> implements VersionedParcelable {
@ParcelField(1)
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/ImageReference.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/ImageReference.java
index a4a81cb..9e2ede7 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/ImageReference.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/ImageReference.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.net.Uri;
@@ -79,14 +79,14 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
ImageReference() {
}
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
ImageReference(@NonNull String contentUri,
@IntRange(from = 1, to = Integer.MAX_VALUE) int originalWidth,
@IntRange(from = 1, to = Integer.MAX_VALUE) int originalHeight,
@@ -178,7 +178,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@NonNull
public String getRawContentUri() {
String value = Common.nonNullOrEmpty(mContentUri);
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/Lane.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/Lane.java
index e7c410d..6d7e734 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/Lane.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/Lane.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
@@ -44,14 +44,14 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Lane() {
}
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Lane(@NonNull List<LaneDirection> directions) {
mDirections = new ArrayList<>(directions);
}
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/LaneDirection.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/LaneDirection.java
index f7ef806..94c2976 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/LaneDirection.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/LaneDirection.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
@@ -91,14 +91,14 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
LaneDirection() {
}
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
LaneDirection(@NonNull EnumWrapper<Shape> shape, boolean highlighted) {
mShape = shape;
mHighlighted = highlighted;
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/LatLng.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/LatLng.java
index 4371ca4..0c1231e 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/LatLng.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/LatLng.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.location.Location;
@@ -47,7 +47,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
LatLng() {
}
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/Maneuver.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/Maneuver.java
index 42e2bf8..c607ab2 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/Maneuver.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/Maneuver.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
@@ -295,14 +295,14 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Maneuver() {
}
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Maneuver(@NonNull EnumWrapper<Type> type, int roundaboutExitNumber,
@Nullable ImageReference icon) {
mType = type;
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/NavigationState.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/NavigationState.java
index 41fa789..93f3888 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/NavigationState.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/NavigationState.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Parcel;
import android.os.Parcelable;
@@ -74,14 +74,14 @@
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
NavigationState() {
}
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
NavigationState(@NonNull List<Step> steps,
@NonNull List<Destination> destinations,
@Nullable Segment currentSegment,
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/RichText.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/RichText.java
index 60c31c7..f5a2110 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/RichText.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/RichText.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
@@ -43,14 +43,14 @@
* Used by {@link VersionedParcelable}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
RichText() {
}
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
RichText(@NonNull List<RichTextElement> elements) {
mElements = new ArrayList<>(elements);
}
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/RichTextElement.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/RichTextElement.java
index 96cb264..7f7bbc7 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/RichTextElement.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/RichTextElement.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -51,14 +51,14 @@
* Used by {@link VersionedParcelable}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
RichTextElement() {
}
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public RichTextElement(@NonNull String text, @Nullable ImageReference image) {
mText = Preconditions.checkNotNull(text, "A textual representation of this "
+ "element must be provided.");
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/Segment.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/Segment.java
index c600b14..555ec80 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/Segment.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/Segment.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
@@ -39,7 +39,7 @@
* Used by {@link VersionedParcelable}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Segment() {
}
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/Step.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/Step.java
index 8fed212..096f29d 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/Step.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/Step.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -53,14 +53,14 @@
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Step() {
}
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Step(@Nullable Distance distance, @Nullable Maneuver maneuver, @NonNull List<Lane> lanes,
@Nullable ImageReference lanesImage, @Nullable RichText cue) {
mDistance = distance;
@@ -81,8 +81,8 @@
private RichText mCue;
/**
- * Sets the maneuver to be performed on this step, or null if this step doesn't involve a
- * maneuver.
+ * Sets the distance from the current position to the point where this navigation step
+ * should be executed, or null if this step doesn't involve a maneuver.
*
* @return this object for chaining
*/
@@ -93,8 +93,8 @@
}
/**
- * Sets the distance from the current position to the point where this navigation step
- * should be executed, or null if distance to this step is not provided.
+ * Sets the maneuver to be performed on this step, or null if distance to this step is not
+ * provided.
*
* @return this object for chaining
*/
diff --git a/car/cluster/src/main/java/androidx/car/cluster/navigation/Time.java b/car/cluster/src/main/java/androidx/car/cluster/navigation/Time.java
index 44368b8..5bc7589 100644
--- a/car/cluster/src/main/java/androidx/car/cluster/navigation/Time.java
+++ b/car/cluster/src/main/java/androidx/car/cluster/navigation/Time.java
@@ -16,7 +16,7 @@
package androidx.car.cluster.navigation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
@@ -38,7 +38,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@VersionedParcelize
final class Time implements VersionedParcelable {
@ParcelField(1)
@@ -51,7 +51,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Time() {
}
diff --git a/car/core/api/1.0.0-alpha6.txt b/car/core/api/1.0.0-alpha6.txt
index a192354..8b4adef 100644
--- a/car/core/api/1.0.0-alpha6.txt
+++ b/car/core/api/1.0.0-alpha6.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.car.app {
public class CarAlertDialog extends android.app.Dialog {
@@ -82,6 +82,7 @@
}
public class DrawerItemViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements androidx.car.uxrestrictions.OnUxRestrictionsChangedListener {
+ ctor @VisibleForTesting(otherwise=androidx.annotation.VisibleForTesting.PACKAGE_PRIVATE) public DrawerItemViewHolder(android.view.View);
method public android.widget.TextView? getBodyView();
method public android.widget.ImageView? getEndIconView();
method public android.widget.ImageView getIconView();
@@ -247,7 +248,7 @@
method public androidx.car.widget.CarMenuItem.Builder setTitle(CharSequence);
}
- public enum CarMenuItem.DisplayBehavior {
+ public static enum CarMenuItem.DisplayBehavior {
enum_constant public static final androidx.car.widget.CarMenuItem.DisplayBehavior ALWAYS;
enum_constant public static final androidx.car.widget.CarMenuItem.DisplayBehavior IF_ROOM;
enum_constant public static final androidx.car.widget.CarMenuItem.DisplayBehavior NEVER;
@@ -385,8 +386,10 @@
method public int positionOf(android.view.View?);
method public void removeItemDecoration(androidx.recyclerview.widget.RecyclerView.ItemDecoration);
method public void removeOnItemTouchListener(androidx.recyclerview.widget.RecyclerView.OnItemTouchListener);
+ method public void resetMaxPages();
method public void scrollToPosition(int);
method public void setAdapter(androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>);
+ method public void setDefaultMaxPages(int);
method public void setDividerColor(@ColorRes int);
method public void setDividerVisibilityManager(androidx.car.widget.PagedListView.DividerVisibilityManager!);
method public void setDownButtonIcon(android.graphics.drawable.Drawable!);
@@ -403,6 +406,7 @@
method public void setUpButtonIcon(android.graphics.drawable.Drawable!);
method public void showAlphaJump();
method public void snapToPosition(int);
+ field public static final int DEFAULT_MAX_CLICKS = 6; // 0x6
field public static final int UNLIMITED_PAGES = -1; // 0xffffffff
}
@@ -464,6 +468,17 @@
field public static final int PAGE_UP = 0; // 0x0
}
+ public final class PagedSmoothScroller extends androidx.recyclerview.widget.LinearSmoothScroller {
+ ctor public PagedSmoothScroller(android.content.Context!);
+ }
+
+ public class PagedSnapHelper extends androidx.recyclerview.widget.LinearSnapHelper {
+ ctor public PagedSnapHelper(android.content.Context!);
+ method public void attachToRecyclerView(androidx.recyclerview.widget.RecyclerView?);
+ method public boolean isAtEnd(androidx.recyclerview.widget.RecyclerView.LayoutManager!);
+ method public boolean isAtStart(androidx.recyclerview.widget.RecyclerView.LayoutManager!);
+ }
+
public class RadioButtonListItem extends androidx.car.widget.ListItem<androidx.car.widget.RadioButtonListItem.ViewHolder> {
ctor public RadioButtonListItem(android.content.Context);
method public static androidx.car.widget.RadioButtonListItem.ViewHolder createViewHolder(android.view.View);
@@ -554,38 +569,6 @@
method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
}
- public class SwitchListItem extends androidx.car.widget.ListItem<androidx.car.widget.SwitchListItem.ViewHolder> {
- ctor public SwitchListItem(android.content.Context);
- method public static androidx.car.widget.SwitchListItem.ViewHolder createViewHolder(android.view.View!);
- method protected final android.content.Context getContext();
- method public int getViewType();
- method public void onBind(androidx.car.widget.SwitchListItem.ViewHolder!);
- method @CallSuper protected void resolveDirtyState();
- method public void setBody(CharSequence?);
- method public void setClickable(boolean);
- method public void setEnabled(boolean);
- method public void setPrimaryActionEmptyIcon();
- method public void setPrimaryActionIcon(android.graphics.drawable.Icon, int);
- method public void setPrimaryActionNoIcon();
- method public void setShowSwitchDivider(boolean);
- method public void setSwitchOnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener?);
- method public void setSwitchState(boolean);
- method public void setTitle(CharSequence?);
- field public static final int PRIMARY_ACTION_ICON_SIZE_LARGE = 2; // 0x2
- field public static final int PRIMARY_ACTION_ICON_SIZE_MEDIUM = 1; // 0x1
- field public static final int PRIMARY_ACTION_ICON_SIZE_SMALL = 0; // 0x0
- }
-
- public static final class SwitchListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder {
- ctor public SwitchListItem.ViewHolder(android.view.View);
- method public android.widget.TextView getBody();
- method public android.widget.ImageView getPrimaryIcon();
- method public android.widget.Switch getSwitch();
- method public android.view.View getSwitchDivider();
- method public android.widget.TextView getTitle();
- method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
- }
-
public class TextListItem extends androidx.car.widget.ListItem<androidx.car.widget.TextListItem.ViewHolder> {
ctor public TextListItem(android.content.Context);
method public static androidx.car.widget.TextListItem.ViewHolder createViewHolder(android.view.View!);
@@ -607,8 +590,8 @@
method @Deprecated public void setSupplementalIcon(int, boolean, android.view.View.OnClickListener!);
method @Deprecated public void setSupplementalIcon(android.graphics.drawable.Drawable!, boolean, android.view.View.OnClickListener!);
method public void setSupplementalIconOnClickListener(android.view.View.OnClickListener);
- method @Deprecated public void setSwitch(boolean, boolean, android.widget.CompoundButton.OnCheckedChangeListener!);
- method @Deprecated public void setSwitchState(boolean);
+ method public void setSwitch(boolean, boolean, android.widget.CompoundButton.OnCheckedChangeListener!);
+ method public void setSwitchState(boolean);
method public void setTitle(CharSequence!);
field public static final int PRIMARY_ACTION_ICON_SIZE_LARGE = 2; // 0x2
field public static final int PRIMARY_ACTION_ICON_SIZE_MEDIUM = 1; // 0x1
diff --git a/car/core/api/1.0.0-alpha7.txt b/car/core/api/1.0.0-alpha7.txt
deleted file mode 100644
index a192354..0000000
--- a/car/core/api/1.0.0-alpha7.txt
+++ /dev/null
@@ -1,632 +0,0 @@
-// Signature format: 3.0
-package androidx.car.app {
-
- public class CarAlertDialog extends android.app.Dialog {
- }
-
- public static final class CarAlertDialog.Builder {
- ctor public CarAlertDialog.Builder(android.content.Context!);
- method public androidx.car.app.CarAlertDialog! create();
- method public androidx.car.app.CarAlertDialog.Builder! setBody(@StringRes int);
- method public androidx.car.app.CarAlertDialog.Builder! setBody(CharSequence!);
- method public androidx.car.app.CarAlertDialog.Builder! setBodyMovementMethod(android.text.method.MovementMethod?);
- method public androidx.car.app.CarAlertDialog.Builder! setCancelable(boolean);
- method public androidx.car.app.CarAlertDialog.Builder setHeaderIcon(@DrawableRes int);
- method public androidx.car.app.CarAlertDialog.Builder setHeaderIcon(android.graphics.drawable.Icon?);
- method public androidx.car.app.CarAlertDialog.Builder! setNegativeButton(@StringRes int, android.content.DialogInterface.OnClickListener?);
- method public androidx.car.app.CarAlertDialog.Builder! setNegativeButton(CharSequence!, android.content.DialogInterface.OnClickListener?);
- method public androidx.car.app.CarAlertDialog.Builder! setOnCancelListener(android.content.DialogInterface.OnCancelListener!);
- method public androidx.car.app.CarAlertDialog.Builder! setOnDismissListener(android.content.DialogInterface.OnDismissListener!);
- method public androidx.car.app.CarAlertDialog.Builder! setPositiveButton(@StringRes int, android.content.DialogInterface.OnClickListener?);
- method public androidx.car.app.CarAlertDialog.Builder! setPositiveButton(CharSequence!, android.content.DialogInterface.OnClickListener?);
- method public androidx.car.app.CarAlertDialog.Builder! setTitle(@StringRes int);
- method public androidx.car.app.CarAlertDialog.Builder! setTitle(CharSequence!);
- }
-
- public class CarListDialog extends android.app.Dialog {
- }
-
- public static final class CarListDialog.Builder {
- ctor public CarListDialog.Builder(android.content.Context!);
- method public androidx.car.app.CarListDialog! create();
- method public androidx.car.app.CarListDialog.Builder setCancelable(boolean);
- method public androidx.car.app.CarListDialog.Builder setInitialPosition(int);
- method public androidx.car.app.CarListDialog.Builder setItems(CharSequence[], android.content.DialogInterface.OnClickListener?);
- method public androidx.car.app.CarListDialog.Builder setItems(androidx.car.app.CarListDialog.DialogSubSection[], android.content.DialogInterface.OnClickListener?);
- method public androidx.car.app.CarListDialog.Builder setOnCancelListener(android.content.DialogInterface.OnCancelListener!);
- method public androidx.car.app.CarListDialog.Builder setOnDismissListener(android.content.DialogInterface.OnDismissListener!);
- method public androidx.car.app.CarListDialog.Builder setTitle(@StringRes int);
- method public androidx.car.app.CarListDialog.Builder setTitle(CharSequence!);
- }
-
- public static class CarListDialog.DialogSubSection {
- ctor public CarListDialog.DialogSubSection(CharSequence, CharSequence[]);
- method public int getItemCount();
- method public CharSequence[] getItems();
- method public CharSequence getTitle();
- }
-
-}
-
-package androidx.car.drawer {
-
- public abstract class CarDrawerAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.car.drawer.DrawerItemViewHolder> implements androidx.car.widget.PagedListView.ItemCap {
- ctor protected CarDrawerAdapter(android.content.Context!, boolean);
- method public void cleanup();
- method protected abstract int getActualItemCount();
- method public final int getItemCount();
- method public final int getItemViewType(int);
- method public final void onBindViewHolder(androidx.car.drawer.DrawerItemViewHolder!, int);
- method public final androidx.car.drawer.DrawerItemViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
- method protected abstract void populateViewHolder(androidx.car.drawer.DrawerItemViewHolder!, int);
- method public final void setMaxItems(int);
- method public final void setTitle(CharSequence?);
- method public void start();
- method public void stop();
- method protected boolean usesSmallLayout(int);
- }
-
- public class CarDrawerController {
- ctor public CarDrawerController(androidx.drawerlayout.widget.DrawerLayout, androidx.appcompat.app.ActionBarDrawerToggle);
- method public void addDrawerListener(androidx.drawerlayout.widget.DrawerLayout.DrawerListener);
- method public void closeDrawer();
- method public void onConfigurationChanged(android.content.res.Configuration!);
- method public boolean onOptionsItemSelected(android.view.MenuItem!);
- method public void openDrawer();
- method public final void pushAdapter(androidx.car.drawer.CarDrawerAdapter!);
- method public void removeDrawerListener(androidx.drawerlayout.widget.DrawerLayout.DrawerListener);
- method public void scrollToPosition(int);
- method public void setRootAdapter(androidx.car.drawer.CarDrawerAdapter?);
- method public void showLoadingProgressBar(boolean);
- method public void syncState();
- }
-
- public class DrawerItemViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements androidx.car.uxrestrictions.OnUxRestrictionsChangedListener {
- method public android.widget.TextView? getBodyView();
- method public android.widget.ImageView? getEndIconView();
- method public android.widget.ImageView getIconView();
- method public android.widget.TextView getTitleView();
- method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
- }
-
-}
-
-package androidx.car.util {
-
- public class CarUxRestrictionsHelper {
- ctor public CarUxRestrictionsHelper(android.content.Context!, androidx.car.uxrestrictions.OnUxRestrictionsChangedListener);
- method public void start();
- method public void stop();
- }
-
- public class ColumnCalculator {
- method public int getColumnCount();
- method @Px public int getColumnSpanWidth(int);
- method @Px public int getColumnWidth();
- method public int getGutterCount();
- method @Px public int getGutterWidth();
- method public static androidx.car.util.ColumnCalculator! getInstance(android.content.Context!);
- }
-
-}
-
-package androidx.car.uxrestrictions {
-
- public final class CarUxRestrictions {
- ctor public CarUxRestrictions(androidx.car.uxrestrictions.CarUxRestrictions!);
- method public int getActiveRestrictions();
- method public int getMaxContentDepth();
- method public int getMaxCumulativeContentItems();
- method public int getMaxRestrictedStringLength();
- method public long getTimestamp();
- method public boolean hasSameRestrictionsAs(androidx.car.uxrestrictions.CarUxRestrictions!);
- method public boolean isDistractionOptimizationRequired();
- field public static final int UX_RESTRICTIONS_BASELINE = 0; // 0x0
- field public static final int UX_RESTRICTIONS_FULLY_RESTRICTED = 511; // 0x1ff
- field public static final int UX_RESTRICTIONS_LIMIT_CONTENT = 32; // 0x20
- field public static final int UX_RESTRICTIONS_LIMIT_STRING_LENGTH = 4; // 0x4
- field public static final int UX_RESTRICTIONS_NO_DIALPAD = 1; // 0x1
- field public static final int UX_RESTRICTIONS_NO_FILTERING = 2; // 0x2
- field public static final int UX_RESTRICTIONS_NO_KEYBOARD = 8; // 0x8
- field public static final int UX_RESTRICTIONS_NO_SETUP = 64; // 0x40
- field public static final int UX_RESTRICTIONS_NO_TEXT_MESSAGE = 128; // 0x80
- field public static final int UX_RESTRICTIONS_NO_VIDEO = 16; // 0x10
- field public static final int UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION = 256; // 0x100
- }
-
- public static final class CarUxRestrictions.Builder {
- ctor public CarUxRestrictions.Builder(boolean, int, long);
- method public androidx.car.uxrestrictions.CarUxRestrictions build();
- method public androidx.car.uxrestrictions.CarUxRestrictions.Builder setMaxContentDepth(int);
- method public androidx.car.uxrestrictions.CarUxRestrictions.Builder setMaxCumulativeContentItems(int);
- method public androidx.car.uxrestrictions.CarUxRestrictions.Builder setMaxStringLength(int);
- }
-
- public interface OnUxRestrictionsChangedListener {
- method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
- }
-
-}
-
-package androidx.car.widget {
-
- public final class ActionListItem extends androidx.car.widget.ListItem<androidx.car.widget.ActionListItem.ViewHolder> {
- ctor public ActionListItem(android.content.Context);
- method public static androidx.car.widget.ActionListItem.ViewHolder createViewHolder(android.view.View!);
- method protected android.content.Context getContext();
- method public int getViewType();
- method public void onBind(androidx.car.widget.ActionListItem.ViewHolder!);
- method protected void resolveDirtyState();
- method @Deprecated public void setAction(String, boolean, android.view.View.OnClickListener);
- method public void setActionBorderless(boolean);
- method @Deprecated public void setActions(String, boolean, android.view.View.OnClickListener, String, boolean, android.view.View.OnClickListener);
- method public void setBody(CharSequence);
- method public void setEnabled(boolean);
- method public void setOnClickListener(android.view.View.OnClickListener!);
- method public void setPrimaryAction(String, boolean, android.view.View.OnClickListener);
- method public void setPrimaryActionEmptyIcon();
- method public void setPrimaryActionIcon(@DrawableRes int, int);
- method public void setPrimaryActionIcon(android.graphics.drawable.Drawable?, int);
- method public void setPrimaryActionNoIcon();
- method public void setSecondaryAction(String, boolean, android.view.View.OnClickListener);
- method public void setTitle(CharSequence);
- field public static final int PRIMARY_ACTION_ICON_SIZE_LARGE = 2; // 0x2
- field public static final int PRIMARY_ACTION_ICON_SIZE_MEDIUM = 1; // 0x1
- field public static final int PRIMARY_ACTION_ICON_SIZE_SMALL = 0; // 0x0
- }
-
- public static final class ActionListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder {
- ctor public ActionListItem.ViewHolder(android.view.View);
- method public android.widget.TextView getBody();
- method public android.widget.Button getPrimaryAction();
- method public android.view.View getPrimaryActionDivider();
- method public android.widget.ImageView getPrimaryIcon();
- method public android.widget.Button getSecondaryAction();
- method public android.view.View getSecondaryActionDivider();
- method public android.widget.TextView getTitle();
- method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions);
- method public void setActionBorderless(boolean);
- }
-
- public interface AlphaJumpAdapter {
- method public java.util.List<androidx.car.widget.AlphaJumpBucket>! getAlphaJumpBuckets();
- method public void onAlphaJumpEnter();
- method public void onAlphaJumpLeave(androidx.car.widget.AlphaJumpBucket!);
- }
-
- public interface AlphaJumpBucket {
- method public int getIndex();
- method public CharSequence! getLabel();
- method public boolean isEmpty();
- }
-
- public class AlphaJumpBucketer {
- ctor public AlphaJumpBucketer();
- ctor public AlphaJumpBucketer(androidx.car.widget.AlphaJumpBucketer.Bucket[]!);
- method public java.util.List<androidx.car.widget.AlphaJumpBucket>! createBuckets(String[]!);
- method public java.util.List<androidx.car.widget.AlphaJumpBucket>! createBuckets(Iterable<java.lang.String>!);
- method public java.util.List<androidx.car.widget.AlphaJumpBucket>! createBuckets(java.util.Iterator<java.lang.String>!);
- }
-
- public static class AlphaJumpBucketer.Bucket implements androidx.car.widget.AlphaJumpBucket {
- method public int getIndex();
- method public CharSequence! getLabel();
- method public boolean isEmpty();
- }
-
- public class AlphaJumpOverlayView extends androidx.gridlayout.widget.GridLayout {
- ctor public AlphaJumpOverlayView(android.content.Context);
- method public void hide();
- method public void show();
- }
-
- public class CarMenuItem {
- method public androidx.car.widget.CarMenuItem.DisplayBehavior getDisplayBehavior();
- method public android.graphics.drawable.Icon? getIcon();
- method public androidx.car.widget.CarMenuItem.OnClickListener? getOnClickListener();
- method @StyleRes public int getStyleResId();
- method public CharSequence? getTitle();
- method public boolean isCheckable();
- method public boolean isChecked();
- method public boolean isEnabled();
- method public void setChecked(boolean);
- method public void setEnabled(boolean);
- method public void setTitle(CharSequence?);
- }
-
- public static final class CarMenuItem.Builder {
- ctor public CarMenuItem.Builder();
- method public androidx.car.widget.CarMenuItem build();
- method public androidx.car.widget.CarMenuItem.Builder setCheckable(boolean);
- method public androidx.car.widget.CarMenuItem.Builder setChecked(boolean);
- method public androidx.car.widget.CarMenuItem.Builder setDisplayBehavior(androidx.car.widget.CarMenuItem.DisplayBehavior);
- method public androidx.car.widget.CarMenuItem.Builder setEnabled(boolean);
- method public androidx.car.widget.CarMenuItem.Builder setIcon(android.graphics.drawable.Icon);
- method public androidx.car.widget.CarMenuItem.Builder setOnClickListener(androidx.car.widget.CarMenuItem.OnClickListener);
- method public androidx.car.widget.CarMenuItem.Builder setStyle(@StyleRes int);
- method public androidx.car.widget.CarMenuItem.Builder setTitle(CharSequence);
- }
-
- public enum CarMenuItem.DisplayBehavior {
- enum_constant public static final androidx.car.widget.CarMenuItem.DisplayBehavior ALWAYS;
- enum_constant public static final androidx.car.widget.CarMenuItem.DisplayBehavior IF_ROOM;
- enum_constant public static final androidx.car.widget.CarMenuItem.DisplayBehavior NEVER;
- }
-
- public static interface CarMenuItem.OnClickListener {
- method public void onClick(androidx.car.widget.CarMenuItem!);
- }
-
- public class CarToolbar extends android.view.ViewGroup {
- ctor public CarToolbar(android.content.Context!);
- ctor public CarToolbar(android.content.Context!, android.util.AttributeSet!);
- ctor public CarToolbar(android.content.Context!, android.util.AttributeSet!, int);
- ctor public CarToolbar(android.content.Context!, android.util.AttributeSet!, int, int);
- method public java.util.List<androidx.car.widget.CarMenuItem>? getMenuItems();
- method public CharSequence? getSubtitle();
- method public CharSequence! getTitle();
- method public void hideOverflowMenu();
- method public boolean isOverflowMenuShowing();
- method public void setMenuItems(java.util.List<androidx.car.widget.CarMenuItem>?);
- method public void setNavigationIcon(@DrawableRes int);
- method public void setNavigationIcon(android.graphics.drawable.Drawable?);
- method public void setNavigationIconContainerWidth(@Px int);
- method public void setNavigationIconOnClickListener(android.view.View.OnClickListener?);
- method public void setNavigationIconTint(@ColorInt int);
- method public void setNavigationIconTint(android.graphics.ColorFilter?);
- method public void setOverflowIcon(@DrawableRes int);
- method public void setOverflowIcon(android.graphics.drawable.Drawable);
- method public void setSubtitle(@StringRes int);
- method public void setSubtitle(CharSequence?);
- method public void setSubtitleTextAppearance(@StyleRes int);
- method public void setTitle(@StringRes int);
- method public void setTitle(CharSequence!);
- method public void setTitleIcon(@DrawableRes int);
- method public void setTitleIcon(android.graphics.drawable.Drawable?);
- method public void setTitleIconEndMargin(@Px int);
- method public void setTitleIconSize(@Px int);
- method public void setTitleIconStartMargin(@Px int);
- method public void setTitleTextAppearance(@StyleRes int);
- method public void showOverflowMenu();
- }
-
- public final class ColumnCardView extends androidx.cardview.widget.CardView {
- ctor public ColumnCardView(android.content.Context!);
- ctor public ColumnCardView(android.content.Context!, android.util.AttributeSet!);
- ctor public ColumnCardView(android.content.Context!, android.util.AttributeSet!, int);
- method public int getColumnSpan();
- method public void onMeasure(int, int);
- method public void setColumnSpan(int);
- }
-
- public abstract class ListItem<VH extends androidx.car.widget.ListItem.ViewHolder> {
- ctor public ListItem();
- method public final void addViewBinder(androidx.car.widget.ListItem.ViewBinder<VH>!);
- method public final void addViewBinder(androidx.car.widget.ListItem.ViewBinder<VH>!, androidx.car.widget.ListItem.ViewBinder<VH>?);
- method public boolean getShowDivider();
- method public abstract int getViewType();
- method protected boolean isDirty();
- method protected void markClean();
- method protected void markDirty();
- method protected abstract void onBind(VH!);
- method public boolean removeViewBinder(androidx.car.widget.ListItem.ViewBinder<VH>!);
- method protected abstract void resolveDirtyState();
- method public abstract void setEnabled(boolean);
- method public void setShowDivider(boolean);
- }
-
- public static interface ListItem.ViewBinder<VH> {
- method public void bind(VH!);
- }
-
- public abstract static class ListItem.ViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements androidx.car.uxrestrictions.OnUxRestrictionsChangedListener {
- ctor public ListItem.ViewHolder(android.view.View!);
- method public final void addCleanUp(androidx.car.widget.ListItem.ViewBinder<androidx.car.widget.ListItem.ViewHolder>?);
- method public final void cleanUp();
- }
-
- public class ListItemAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.car.widget.ListItem.ViewHolder> implements androidx.car.widget.PagedListView.DividerVisibilityManager androidx.car.widget.PagedListView.ItemCap {
- ctor public ListItemAdapter(android.content.Context, androidx.car.widget.ListItemProvider);
- ctor public ListItemAdapter(android.content.Context, androidx.car.widget.ListItemProvider, int);
- method public android.content.Context getContext();
- method public int getItemCount();
- method public boolean getShowDivider(@IntRange(from=0) int);
- method public void onBindViewHolder(androidx.car.widget.ListItem.ViewHolder!, int);
- method public androidx.car.widget.ListItem.ViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
- method public void registerListItemViewType(@IntRange(from=java.lang.Integer.MIN_VALUE, to=0xffffffff) int, @LayoutRes int, java.util.function.Function<android.view.View,androidx.car.widget.ListItem.ViewHolder>!);
- method public void setMaxItems(int);
- method public void start();
- method public void stop();
- }
-
- public static final class ListItemAdapter.BackgroundStyle {
- field public static final int CARD = 2; // 0x2
- field public static final int NONE = 1; // 0x1
- field public static final int PANEL = 3; // 0x3
- field public static final int SOLID = 0; // 0x0
- }
-
- public abstract class ListItemProvider<VH extends androidx.car.widget.ListItem.ViewHolder> {
- ctor public ListItemProvider();
- method public abstract androidx.car.widget.ListItem<VH> get(int);
- method public abstract int size();
- }
-
- public static class ListItemProvider.ListProvider<VH extends androidx.car.widget.ListItem.ViewHolder> extends androidx.car.widget.ListItemProvider {
- ctor public ListItemProvider.ListProvider(java.util.List<androidx.car.widget.ListItem<VH>>);
- method public androidx.car.widget.ListItem<VH> get(int);
- method public int size();
- }
-
- public class PagedListView extends android.widget.FrameLayout {
- ctor public PagedListView(android.content.Context!);
- ctor public PagedListView(android.content.Context!, android.util.AttributeSet!);
- ctor public PagedListView(android.content.Context!, android.util.AttributeSet!, int);
- ctor public PagedListView(android.content.Context!, android.util.AttributeSet!, int, int);
- method public void addItemDecoration(androidx.recyclerview.widget.RecyclerView.ItemDecoration);
- method public void addOnItemTouchListener(androidx.recyclerview.widget.RecyclerView.OnItemTouchListener);
- method public androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>? getAdapter();
- method public int getListContentBottomOffset();
- method public int getListContentTopOffset();
- method public int getMaxPages();
- method public int getPage(int);
- method public androidx.recyclerview.widget.RecyclerView getRecyclerView();
- method public int getRowsPerPage();
- method public void hideAlphaJump();
- method public boolean isAlphaJumpShown();
- method public boolean isAtEnd();
- method public boolean isAtStart();
- method public boolean isScrollbarThumbEnabled();
- method public void onLayout(boolean, int, int, int, int);
- method public void onRestoreInstanceState(android.os.Parcelable!);
- method public android.os.Parcelable! onSaveInstanceState();
- method public void pageDown();
- method public void pageUp();
- method public int positionOf(android.view.View?);
- method public void removeItemDecoration(androidx.recyclerview.widget.RecyclerView.ItemDecoration);
- method public void removeOnItemTouchListener(androidx.recyclerview.widget.RecyclerView.OnItemTouchListener);
- method public void scrollToPosition(int);
- method public void setAdapter(androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>);
- method public void setDividerColor(@ColorRes int);
- method public void setDividerVisibilityManager(androidx.car.widget.PagedListView.DividerVisibilityManager!);
- method public void setDownButtonIcon(android.graphics.drawable.Drawable!);
- method public void setGutter(@androidx.car.widget.PagedListView.Gutter int);
- method public void setGutterSize(int);
- method public void setItemSpacing(int);
- method public void setListContentBottomOffset(@Px int);
- method public void setListContentTopOffset(@Px int);
- method public void setMaxPages(int);
- method public void setOnScrollListener(androidx.car.widget.PagedListView.OnScrollListener!);
- method public void setScrollBarContainerWidth(int);
- method public void setScrollBarTopMargin(int);
- method public void setScrollbarThumbEnabled(boolean);
- method public void setUpButtonIcon(android.graphics.drawable.Drawable!);
- method public void showAlphaJump();
- method public void snapToPosition(int);
- field public static final int UNLIMITED_PAGES = -1; // 0xffffffff
- }
-
- public static interface PagedListView.DividerVisibilityManager {
- method public boolean getShowDivider(int);
- }
-
- @IntDef({androidx.car.widget.PagedListView.Gutter.NONE, androidx.car.widget.PagedListView.Gutter.START, androidx.car.widget.PagedListView.Gutter.END, androidx.car.widget.PagedListView.Gutter.BOTH}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PagedListView.Gutter {
- field public static final int BOTH = 3; // 0x3
- field public static final int END = 2; // 0x2
- field public static final int NONE = 0; // 0x0
- field public static final int START = 1; // 0x1
- }
-
- public static interface PagedListView.ItemCap {
- method public void setMaxItems(int);
- field public static final int UNLIMITED = -1; // 0xffffffff
- }
-
- public static interface PagedListView.ItemPositionOffset {
- method public void setPositionOffset(int);
- }
-
- public abstract static class PagedListView.OnScrollListener {
- ctor public PagedListView.OnScrollListener();
- method public void onReachBottom();
- method public void onScrollDownButtonClicked();
- method public void onScrollStateChanged(androidx.recyclerview.widget.RecyclerView!, int);
- method public void onScrollUpButtonClicked();
- method public void onScrolled(androidx.recyclerview.widget.RecyclerView!, int, int);
- }
-
- public class PagedScrollBarView extends android.view.ViewGroup {
- ctor public PagedScrollBarView(android.content.Context!);
- ctor public PagedScrollBarView(android.content.Context!, android.util.AttributeSet!);
- ctor public PagedScrollBarView(android.content.Context!, android.util.AttributeSet!, int);
- ctor public PagedScrollBarView(android.content.Context!, android.util.AttributeSet!, int, int);
- method public boolean isDownEnabled();
- method public boolean isDownPressed();
- method public boolean isScrollbarThumbEnabled();
- method public boolean isUpPressed();
- method public void onLayout(boolean, int, int, int, int);
- method public void setButtonRippleBackground(@DrawableRes int);
- method public void setButtonTintColor(@ColorRes int);
- method public void setDownButtonIcon(android.graphics.drawable.Drawable!);
- method public void setDownEnabled(boolean);
- method public void setPaginationListener(androidx.car.widget.PagedScrollBarView.PaginationListener!);
- method public void setParameters(@IntRange(from=0) int, @IntRange(from=0) int, @IntRange(from=0) int, boolean);
- method public void setScrollbarThumbColor(@ColorRes int);
- method public void setScrollbarThumbEnabled(boolean);
- method public void setUpButtonIcon(android.graphics.drawable.Drawable!);
- method public void setUpEnabled(boolean);
- }
-
- public static interface PagedScrollBarView.PaginationListener {
- method public void onAlphaJump();
- method public void onPaginate(int);
- field public static final int PAGE_DOWN = 1; // 0x1
- field public static final int PAGE_UP = 0; // 0x0
- }
-
- public class RadioButtonListItem extends androidx.car.widget.ListItem<androidx.car.widget.RadioButtonListItem.ViewHolder> {
- ctor public RadioButtonListItem(android.content.Context);
- method public static androidx.car.widget.RadioButtonListItem.ViewHolder createViewHolder(android.view.View);
- method protected android.content.Context getContext();
- method public int getViewType();
- method public boolean isChecked();
- method protected void onBind(androidx.car.widget.RadioButtonListItem.ViewHolder!);
- method protected void resolveDirtyState();
- method public void setChecked(boolean);
- method public void setEnabled(boolean);
- method public void setOnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener);
- method public void setPrimaryActionIcon(android.graphics.drawable.Icon, int);
- method public void setShowRadioButtonDivider(boolean);
- method public void setText(CharSequence?);
- method public void setTextStartMargin(@DimenRes int);
- field public static final int PRIMARY_ACTION_ICON_SIZE_LARGE = 2; // 0x2
- field public static final int PRIMARY_ACTION_ICON_SIZE_MEDIUM = 1; // 0x1
- field public static final int PRIMARY_ACTION_ICON_SIZE_SMALL = 0; // 0x0
- }
-
- public static final class RadioButtonListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder {
- ctor public RadioButtonListItem.ViewHolder(android.view.View);
- method public android.view.ViewGroup getContainerLayout();
- method public android.widget.ImageView getPrimaryIcon();
- method public android.widget.RadioButton getRadioButton();
- method public android.view.View getRadioButtonDivider();
- method public android.widget.TextView getText();
- method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
- }
-
- public class SeekbarListItem extends androidx.car.widget.ListItem<androidx.car.widget.SeekbarListItem.ViewHolder> {
- ctor public SeekbarListItem(android.content.Context);
- method public static androidx.car.widget.SeekbarListItem.ViewHolder createViewHolder(android.view.View!);
- method protected android.content.Context getContext();
- method public int getViewType();
- method protected void onBind(androidx.car.widget.SeekbarListItem.ViewHolder!);
- method protected void resolveDirtyState();
- method public void setEnabled(boolean);
- method public void setMax(int);
- method public void setOnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener!);
- method public void setPrimaryActionEmptyIcon();
- method public void setPrimaryActionIcon(android.graphics.drawable.Icon);
- method @Deprecated public void setPrimaryActionIcon(@DrawableRes int);
- method @Deprecated public void setPrimaryActionIcon(android.graphics.drawable.Drawable!);
- method public void setPrimaryActionIconListener(android.view.View.OnClickListener!);
- method public void setProgress(int);
- method public void setSecondaryProgress(int);
- method public void setSupplementalEmptyIcon(boolean);
- method public void setSupplementalIcon(android.graphics.drawable.Icon, boolean);
- method @Deprecated public void setSupplementalIcon(@DrawableRes int, boolean);
- method @Deprecated public void setSupplementalIcon(android.graphics.drawable.Drawable, boolean);
- method public void setSupplementalIconListener(android.view.View.OnClickListener!);
- method public void setText(CharSequence?);
- }
-
- public static final class SeekbarListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder implements androidx.car.uxrestrictions.OnUxRestrictionsChangedListener {
- ctor public SeekbarListItem.ViewHolder(android.view.View!);
- method public android.view.ViewGroup getContainerLayout();
- method public android.widget.ImageView getPrimaryIcon();
- method public android.widget.SeekBar getSeekBar();
- method public android.widget.ImageView getSupplementalIcon();
- method public android.view.View getSupplementalIconDivider();
- method public android.widget.TextView getText();
- method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
- }
-
- public class SubheaderListItem extends androidx.car.widget.ListItem<androidx.car.widget.SubheaderListItem.ViewHolder> {
- ctor public SubheaderListItem(android.content.Context, CharSequence);
- method public static androidx.car.widget.SubheaderListItem.ViewHolder createViewHolder(android.view.View!);
- method protected android.content.Context getContext();
- method public int getViewType();
- method protected void onBind(androidx.car.widget.SubheaderListItem.ViewHolder!);
- method protected void resolveDirtyState();
- method public void setEnabled(boolean);
- method public void setText(CharSequence);
- method public void setTextStartMarginType(@androidx.car.widget.SubheaderListItem.TextStartMarginType int);
- field public static final int TEXT_START_MARGIN_TYPE_LARGE = 2; // 0x2
- field public static final int TEXT_START_MARGIN_TYPE_NONE = 0; // 0x0
- field public static final int TEXT_START_MARGIN_TYPE_SMALL = 1; // 0x1
- }
-
- @IntDef({androidx.car.widget.SubheaderListItem.TEXT_START_MARGIN_TYPE_NONE, androidx.car.widget.SubheaderListItem.TEXT_START_MARGIN_TYPE_LARGE, androidx.car.widget.SubheaderListItem.TEXT_START_MARGIN_TYPE_SMALL}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface SubheaderListItem.TextStartMarginType {
- }
-
- public static final class SubheaderListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder {
- ctor public SubheaderListItem.ViewHolder(android.view.View!);
- method public android.widget.TextView getText();
- method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
- }
-
- public class SwitchListItem extends androidx.car.widget.ListItem<androidx.car.widget.SwitchListItem.ViewHolder> {
- ctor public SwitchListItem(android.content.Context);
- method public static androidx.car.widget.SwitchListItem.ViewHolder createViewHolder(android.view.View!);
- method protected final android.content.Context getContext();
- method public int getViewType();
- method public void onBind(androidx.car.widget.SwitchListItem.ViewHolder!);
- method @CallSuper protected void resolveDirtyState();
- method public void setBody(CharSequence?);
- method public void setClickable(boolean);
- method public void setEnabled(boolean);
- method public void setPrimaryActionEmptyIcon();
- method public void setPrimaryActionIcon(android.graphics.drawable.Icon, int);
- method public void setPrimaryActionNoIcon();
- method public void setShowSwitchDivider(boolean);
- method public void setSwitchOnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener?);
- method public void setSwitchState(boolean);
- method public void setTitle(CharSequence?);
- field public static final int PRIMARY_ACTION_ICON_SIZE_LARGE = 2; // 0x2
- field public static final int PRIMARY_ACTION_ICON_SIZE_MEDIUM = 1; // 0x1
- field public static final int PRIMARY_ACTION_ICON_SIZE_SMALL = 0; // 0x0
- }
-
- public static final class SwitchListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder {
- ctor public SwitchListItem.ViewHolder(android.view.View);
- method public android.widget.TextView getBody();
- method public android.widget.ImageView getPrimaryIcon();
- method public android.widget.Switch getSwitch();
- method public android.view.View getSwitchDivider();
- method public android.widget.TextView getTitle();
- method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
- }
-
- public class TextListItem extends androidx.car.widget.ListItem<androidx.car.widget.TextListItem.ViewHolder> {
- ctor public TextListItem(android.content.Context);
- method public static androidx.car.widget.TextListItem.ViewHolder createViewHolder(android.view.View!);
- method protected android.content.Context getContext();
- method public int getViewType();
- method public void onBind(androidx.car.widget.TextListItem.ViewHolder!);
- method protected void resolveDirtyState();
- method public void setBody(CharSequence!);
- method public void setEnabled(boolean);
- method public void setOnClickListener(android.view.View.OnClickListener!);
- method public void setPrimaryActionEmptyIcon();
- method public void setPrimaryActionIcon(android.graphics.drawable.Icon, int);
- method @Deprecated public void setPrimaryActionIcon(@DrawableRes int, int);
- method @Deprecated public void setPrimaryActionIcon(android.graphics.drawable.Drawable?, int);
- method public void setPrimaryActionNoIcon();
- method public void setSupplementalIcon(android.graphics.drawable.Icon, boolean);
- method @Deprecated public void setSupplementalIcon(int, boolean);
- method @Deprecated public void setSupplementalIcon(android.graphics.drawable.Drawable!, boolean);
- method @Deprecated public void setSupplementalIcon(int, boolean, android.view.View.OnClickListener!);
- method @Deprecated public void setSupplementalIcon(android.graphics.drawable.Drawable!, boolean, android.view.View.OnClickListener!);
- method public void setSupplementalIconOnClickListener(android.view.View.OnClickListener);
- method @Deprecated public void setSwitch(boolean, boolean, android.widget.CompoundButton.OnCheckedChangeListener!);
- method @Deprecated public void setSwitchState(boolean);
- method public void setTitle(CharSequence!);
- field public static final int PRIMARY_ACTION_ICON_SIZE_LARGE = 2; // 0x2
- field public static final int PRIMARY_ACTION_ICON_SIZE_MEDIUM = 1; // 0x1
- field public static final int PRIMARY_ACTION_ICON_SIZE_SMALL = 0; // 0x0
- }
-
- public static final class TextListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder {
- ctor public TextListItem.ViewHolder(android.view.View!);
- method public android.widget.TextView getBody();
- method public android.view.ViewGroup getContainerLayout();
- method public android.widget.ImageView getPrimaryIcon();
- method public android.widget.ImageView getSupplementalIcon();
- method public android.view.View getSupplementalIconDivider();
- method public android.widget.Switch getSwitch();
- method public android.view.View getSwitchDivider();
- method public android.widget.TextView getTitle();
- method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
- }
-
-}
-
diff --git a/car/core/api/current.txt b/car/core/api/current.txt
index a192354..8b4adef 100644
--- a/car/core/api/current.txt
+++ b/car/core/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.car.app {
public class CarAlertDialog extends android.app.Dialog {
@@ -82,6 +82,7 @@
}
public class DrawerItemViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements androidx.car.uxrestrictions.OnUxRestrictionsChangedListener {
+ ctor @VisibleForTesting(otherwise=androidx.annotation.VisibleForTesting.PACKAGE_PRIVATE) public DrawerItemViewHolder(android.view.View);
method public android.widget.TextView? getBodyView();
method public android.widget.ImageView? getEndIconView();
method public android.widget.ImageView getIconView();
@@ -247,7 +248,7 @@
method public androidx.car.widget.CarMenuItem.Builder setTitle(CharSequence);
}
- public enum CarMenuItem.DisplayBehavior {
+ public static enum CarMenuItem.DisplayBehavior {
enum_constant public static final androidx.car.widget.CarMenuItem.DisplayBehavior ALWAYS;
enum_constant public static final androidx.car.widget.CarMenuItem.DisplayBehavior IF_ROOM;
enum_constant public static final androidx.car.widget.CarMenuItem.DisplayBehavior NEVER;
@@ -385,8 +386,10 @@
method public int positionOf(android.view.View?);
method public void removeItemDecoration(androidx.recyclerview.widget.RecyclerView.ItemDecoration);
method public void removeOnItemTouchListener(androidx.recyclerview.widget.RecyclerView.OnItemTouchListener);
+ method public void resetMaxPages();
method public void scrollToPosition(int);
method public void setAdapter(androidx.recyclerview.widget.RecyclerView.Adapter<? extends androidx.recyclerview.widget.RecyclerView.ViewHolder>);
+ method public void setDefaultMaxPages(int);
method public void setDividerColor(@ColorRes int);
method public void setDividerVisibilityManager(androidx.car.widget.PagedListView.DividerVisibilityManager!);
method public void setDownButtonIcon(android.graphics.drawable.Drawable!);
@@ -403,6 +406,7 @@
method public void setUpButtonIcon(android.graphics.drawable.Drawable!);
method public void showAlphaJump();
method public void snapToPosition(int);
+ field public static final int DEFAULT_MAX_CLICKS = 6; // 0x6
field public static final int UNLIMITED_PAGES = -1; // 0xffffffff
}
@@ -464,6 +468,17 @@
field public static final int PAGE_UP = 0; // 0x0
}
+ public final class PagedSmoothScroller extends androidx.recyclerview.widget.LinearSmoothScroller {
+ ctor public PagedSmoothScroller(android.content.Context!);
+ }
+
+ public class PagedSnapHelper extends androidx.recyclerview.widget.LinearSnapHelper {
+ ctor public PagedSnapHelper(android.content.Context!);
+ method public void attachToRecyclerView(androidx.recyclerview.widget.RecyclerView?);
+ method public boolean isAtEnd(androidx.recyclerview.widget.RecyclerView.LayoutManager!);
+ method public boolean isAtStart(androidx.recyclerview.widget.RecyclerView.LayoutManager!);
+ }
+
public class RadioButtonListItem extends androidx.car.widget.ListItem<androidx.car.widget.RadioButtonListItem.ViewHolder> {
ctor public RadioButtonListItem(android.content.Context);
method public static androidx.car.widget.RadioButtonListItem.ViewHolder createViewHolder(android.view.View);
@@ -554,38 +569,6 @@
method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
}
- public class SwitchListItem extends androidx.car.widget.ListItem<androidx.car.widget.SwitchListItem.ViewHolder> {
- ctor public SwitchListItem(android.content.Context);
- method public static androidx.car.widget.SwitchListItem.ViewHolder createViewHolder(android.view.View!);
- method protected final android.content.Context getContext();
- method public int getViewType();
- method public void onBind(androidx.car.widget.SwitchListItem.ViewHolder!);
- method @CallSuper protected void resolveDirtyState();
- method public void setBody(CharSequence?);
- method public void setClickable(boolean);
- method public void setEnabled(boolean);
- method public void setPrimaryActionEmptyIcon();
- method public void setPrimaryActionIcon(android.graphics.drawable.Icon, int);
- method public void setPrimaryActionNoIcon();
- method public void setShowSwitchDivider(boolean);
- method public void setSwitchOnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener?);
- method public void setSwitchState(boolean);
- method public void setTitle(CharSequence?);
- field public static final int PRIMARY_ACTION_ICON_SIZE_LARGE = 2; // 0x2
- field public static final int PRIMARY_ACTION_ICON_SIZE_MEDIUM = 1; // 0x1
- field public static final int PRIMARY_ACTION_ICON_SIZE_SMALL = 0; // 0x0
- }
-
- public static final class SwitchListItem.ViewHolder extends androidx.car.widget.ListItem.ViewHolder {
- ctor public SwitchListItem.ViewHolder(android.view.View);
- method public android.widget.TextView getBody();
- method public android.widget.ImageView getPrimaryIcon();
- method public android.widget.Switch getSwitch();
- method public android.view.View getSwitchDivider();
- method public android.widget.TextView getTitle();
- method public void onUxRestrictionsChanged(androidx.car.uxrestrictions.CarUxRestrictions!);
- }
-
public class TextListItem extends androidx.car.widget.ListItem<androidx.car.widget.TextListItem.ViewHolder> {
ctor public TextListItem(android.content.Context);
method public static androidx.car.widget.TextListItem.ViewHolder createViewHolder(android.view.View!);
@@ -607,8 +590,8 @@
method @Deprecated public void setSupplementalIcon(int, boolean, android.view.View.OnClickListener!);
method @Deprecated public void setSupplementalIcon(android.graphics.drawable.Drawable!, boolean, android.view.View.OnClickListener!);
method public void setSupplementalIconOnClickListener(android.view.View.OnClickListener);
- method @Deprecated public void setSwitch(boolean, boolean, android.widget.CompoundButton.OnCheckedChangeListener!);
- method @Deprecated public void setSwitchState(boolean);
+ method public void setSwitch(boolean, boolean, android.widget.CompoundButton.OnCheckedChangeListener!);
+ method public void setSwitchState(boolean);
method public void setTitle(CharSequence!);
field public static final int PRIMARY_ACTION_ICON_SIZE_LARGE = 2; // 0x2
field public static final int PRIMARY_ACTION_ICON_SIZE_MEDIUM = 1; // 0x1
diff --git a/car/core/api/res-1.0.0-alpha6.txt b/car/core/api/res-1.0.0-alpha6.txt
index 44f230c..df86b7a 100644
--- a/car/core/api/res-1.0.0-alpha6.txt
+++ b/car/core/api/res-1.0.0-alpha6.txt
@@ -32,9 +32,6 @@
style TextAppearance_Car_Body4
style TextAppearance_Car_Body4_Dark
style TextAppearance_Car_Body4_Light
-style TextAppearance_Car_Body4_Medium
-style TextAppearance_Car_Body4_Medium_Dark
-style TextAppearance_Car_Body4_Medium_Light
style TextAppearance_Car_Display1
style TextAppearance_Car_Display2
style TextAppearance_Car_Display3
@@ -68,7 +65,6 @@
style Widget_Car_Button
style Widget_Car_Button_Borderless_Colored
style Widget_Car_Button_DarkText
-style Widget_Car_CarToolbar
style Widget_Car_Checkbox
style Widget_Car_Checkbox_Dark
style Widget_Car_Checkbox_Light
@@ -94,7 +90,6 @@
style Widget_Car_SeekBar
style Widget_Car_SeekBar_Dark
style Widget_Car_SeekBar_Light
-style Widget_Car_TabLayout
style Widget_Car_Toolbar
style Widget_Car_Toolbar_Button_Navigation
style Widget_Car_Toolbar_Button_Navigation_Light
@@ -237,9 +232,6 @@
color car_subtext5_dark
color car_subtext5_light
dimen car_subtext5_size
-dimen car_tab_min_width
-color car_tab_tint
-layout car_tab_view
color car_tint
color car_tint_dark
color car_tint_light
diff --git a/car/core/api/res-1.0.0-alpha7.txt b/car/core/api/res-1.0.0-alpha7.txt
deleted file mode 100644
index 44f230c..0000000
--- a/car/core/api/res-1.0.0-alpha7.txt
+++ /dev/null
@@ -1,306 +0,0 @@
-style CarListVerticalDivider
-style CarPreference
-style CarPreference_Category
-style CarPreference_CheckBoxPreference
-style CarPreference_DialogPreference
-style CarPreference_DialogPreference_EditTextPreference
-style CarPreference_DropDown
-style CarPreference_Information
-style CarPreference_PreferenceScreen
-style CarPreference_SeekBarPreference
-style CarPreference_SwitchPreference
-style CarPreference_SwitchPreferenceCompat
-style CarPreferenceFragment
-style CarPreferenceFragmentList
-style PreferenceThemeOverlayCar
-style TextAppearance_Car
-style TextAppearance_Car_Body1
-style TextAppearance_Car_Body1_Dark
-style TextAppearance_Car_Body1_Light
-style TextAppearance_Car_Body1_Medium
-style TextAppearance_Car_Body1_Medium_Dark
-style TextAppearance_Car_Body1_Medium_Light
-style TextAppearance_Car_Body2
-style TextAppearance_Car_Body2_Dark
-style TextAppearance_Car_Body2_Light
-style TextAppearance_Car_Body3
-style TextAppearance_Car_Body3_Dark
-style TextAppearance_Car_Body3_Light
-style TextAppearance_Car_Body3_Medium
-style TextAppearance_Car_Body3_Medium_Dark
-style TextAppearance_Car_Body3_Medium_Light
-style TextAppearance_Car_Body4
-style TextAppearance_Car_Body4_Dark
-style TextAppearance_Car_Body4_Light
-style TextAppearance_Car_Body4_Medium
-style TextAppearance_Car_Body4_Medium_Dark
-style TextAppearance_Car_Body4_Medium_Light
-style TextAppearance_Car_Display1
-style TextAppearance_Car_Display2
-style TextAppearance_Car_Display3
-style TextAppearance_Car_Display4
-style TextAppearance_Car_Error
-style TextAppearance_Car_Hint
-style TextAppearance_Car_Hint_Light
-style TextAppearance_Car_HintActionBar_Menu
-style TextAppearance_Car_SubText1
-style TextAppearance_Car_SubText2
-style TextAppearance_Car_SubText3
-style TextAppearance_Car_SubText4
-style TextAppearance_Car_SubText5
-style TextAppearance_Car_Subheader
-style Theme_Car_Dark_Dialog
-style Theme_Car_Dark_Dialog_Alert
-style Theme_Car_Dark_NoActionBar
-style Theme_Car_Dark_NoActionBar_Drawer
-style Theme_Car_Dialog
-style Theme_Car_Dialog_Alert
-style Theme_Car_Light_Dialog_Alert
-style Theme_Car_Light_List
-style Theme_Car_Light_List_DarkItems
-style Theme_Car_Light_NoActionBar
-style Theme_Car_Light_NoActionBar_Drawer
-style Theme_Car_List
-style Theme_Car_NoActionBar
-style Theme_Car_NoActionBar_Drawer
-style Widget_Car_ActionButton
-style Widget_Car_ActionButton_Light
-style Widget_Car_Button
-style Widget_Car_Button_Borderless_Colored
-style Widget_Car_Button_DarkText
-style Widget_Car_CarToolbar
-style Widget_Car_Checkbox
-style Widget_Car_Checkbox_Dark
-style Widget_Car_Checkbox_Light
-style Widget_Car_Dialog
-style Widget_Car_Dialog_Body
-style Widget_Car_Dialog_Body_Dark
-style Widget_Car_Dialog_Body_Light
-style Widget_Car_Dialog_Button
-style Widget_Car_Dialog_Title
-style Widget_Car_Dialog_Title_Dark
-style Widget_Car_Dialog_Title_Light
-style Widget_Car_DrawerArrowToggle
-style Widget_Car_EditText
-style Widget_Car_List
-style Widget_Car_List_Dark
-style Widget_Car_List_Light
-style Widget_Car_ListItem
-style Widget_Car_ListItem_Dark
-style Widget_Car_ProgressBar_Horizontal
-style Widget_Car_Scrollbar
-style Widget_Car_Scrollbar_Dark
-style Widget_Car_Scrollbar_Light
-style Widget_Car_SeekBar
-style Widget_Car_SeekBar_Dark
-style Widget_Car_SeekBar_Light
-style Widget_Car_TabLayout
-style Widget_Car_Toolbar
-style Widget_Car_Toolbar_Button_Navigation
-style Widget_Car_Toolbar_Button_Navigation_Light
-style Widget_Car_Toolbar_Light
-attr alignDividerEndTo
-attr alignDividerStartTo
-attr buttonRippleBackground
-attr buttonTintColor
-attr carArrowAnimate
-attr carArrowColor
-attr carArrowHeadLength
-attr carArrowShaftLength
-attr carArrowSize
-attr carArrowThickness
-attr carDialogTheme
-attr carMenuBarSpacing
-attr carMenuBarThickness
-color car_accent
-color car_accent_dark
-color car_accent_light
-dimen car_app_bar_default_elevation
-dimen car_app_bar_height
-dimen car_app_icon_size
-dimen car_application_icon_size
-dimen car_avatar_icon_size
-color car_body1
-color car_body1_dark
-color car_body1_light
-dimen car_body1_size
-color car_body2
-color car_body2_dark
-color car_body2_light
-dimen car_body2_size
-color car_body3
-color car_body3_dark
-color car_body3_light
-dimen car_body3_size
-color car_body4
-color car_body4_dark
-color car_body4_light
-dimen car_body4_size
-dimen car_button_height
-dimen car_button_min_width
-dimen car_button_radius
-color car_card
-color car_card_action_bar
-color car_card_action_bar_dark
-dimen car_card_action_bar_height
-color car_card_action_bar_light
-color car_card_dark
-dimen car_card_header_height
-color car_card_light
-color car_card_ripple_background
-color car_card_ripple_background_dark
-color car_card_ripple_background_light
-dimen car_dialog_action_bar_height
-dimen car_dialog_elevation
-dimen car_dialog_header_height
-color car_display1
-color car_display1_dark
-color car_display1_light
-dimen car_display1_size
-color car_display2
-color car_display2_dark
-color car_display2_light
-dimen car_display2_size
-color car_display3
-color car_display3_dark
-color car_display3_light
-dimen car_display3_size
-color car_display4
-color car_display4_dark
-color car_display4_light
-dimen car_display4_size
-dimen car_double_line_list_item_height
-layout car_drawer
-layout car_drawer_activity
-dimen car_drawer_max_width
-dimen car_fab_icon_size
-dimen car_gutter_width
-dimen car_keyline_1
-dimen car_keyline_1_neg
-dimen car_keyline_2
-dimen car_keyline_2_neg
-dimen car_keyline_3
-dimen car_keyline_3_neg
-dimen car_keyline_4
-dimen car_keyline_4_neg
-dimen car_large_avatar_size
-dimen car_list_dialog_title_elevation
-color car_list_divider
-color car_list_divider_dark
-dimen car_list_divider_height
-color car_list_divider_light
-color car_list_header
-dimen car_margin
-dimen car_navigation_bar_height
-dimen car_padding_0
-dimen car_padding_1
-dimen car_padding_2
-dimen car_padding_3
-dimen car_padding_4
-dimen car_padding_5
-dimen car_padding_6
-dimen car_pill_button_size
-dimen car_primary_icon_size
-dimen car_radius_1
-dimen car_radius_2
-dimen car_radius_3
-dimen car_radius_4
-color car_scrollbar_thumb
-color car_scrollbar_thumb_dark
-color car_scrollbar_thumb_light
-dimen car_secondary_icon_size
-color car_seekbar_track_background
-color car_seekbar_track_background_dark
-color car_seekbar_track_background_light
-color car_seekbar_track_secondary_progress
-dimen car_single_line_list_item_height
-dimen car_status_bar_height
-dimen car_status_bar_icon_size
-dimen car_sub_header_height
-color car_subtext1
-color car_subtext1_dark
-color car_subtext1_light
-dimen car_subtext1_size
-color car_subtext2
-color car_subtext2_dark
-color car_subtext2_light
-dimen car_subtext2_size
-color car_subtext3
-color car_subtext3_dark
-color car_subtext3_light
-dimen car_subtext3_size
-color car_subtext4
-color car_subtext4_dark
-color car_subtext4_light
-dimen car_subtext4_size
-color car_subtext5
-color car_subtext5_dark
-color car_subtext5_light
-dimen car_subtext5_size
-dimen car_tab_min_width
-color car_tab_tint
-layout car_tab_view
-color car_tint
-color car_tint_dark
-color car_tint_light
-dimen car_touch_target_size
-dimen car_vertical_line_divider_height
-dimen car_vertical_line_divider_width
-attr columnSpan
-attr dialogBackgroundColor
-attr dialogBodyStyle
-attr dialogButtonStyle
-attr dialogListTheme
-attr dialogTitleStyle
-attr dividerEndMargin
-attr dividerStartMargin
-attr downButtonIcon
-attr drawerBackButtonId
-attr drawerBackButtonTint
-attr drawerBackgroundColor
-attr drawerHeaderColor
-attr drawerItemBodyTextAppearance
-attr drawerItemTitleTextAppearance
-attr drawerListId
-attr drawerListTheme
-attr drawerNormalLayoutId
-attr drawerProgressId
-attr drawerRippleColor
-attr drawerSmallLayoutId
-attr drawerTitleId
-attr drawerToolbarId
-attr gutter
-attr gutterSize
-attr itemSpacing
-attr listContentTopOffset
-attr listDividerColor
-attr listEndMargin
-attr listItemActionDividerColor
-attr listItemBackgroundColor
-attr listItemBodyTextAppearance
-attr listItemSubheaderTextAppearance
-attr listItemTitleTextAppearance
-attr navigationIcon
-attr navigationIconContainerWidth
-attr navigationIconTint
-attr offsetScrollBar
-attr overflowIcon
-attr pagedListViewStyle
-attr pagedScrollBarViewStyle
-attr scrollBarColor
-attr scrollBarContainerWidth
-attr scrollBarEnabled
-attr scrollBarGravity
-attr scrollBarTopMargin
-attr showPagedListViewDivider
-attr showScrollBarThumb
-attr subtitle
-attr subtitleTextAppearance
-attr title
-attr titleIcon
-attr titleIconEndMargin
-attr titleIconSize
-attr titleIconStartMargin
-attr titleTextAppearance
-attr upButtonIcon
-attr verticallyCenterListContent
diff --git a/car/core/api/restricted_1.0.0-alpha7.txt b/car/core/api/restricted_1.0.0-alpha7.txt
deleted file mode 100644
index 8a43c31..0000000
--- a/car/core/api/restricted_1.0.0-alpha7.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-// Signature format: 3.0
-package androidx.car.navigation.utils {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface Bundlable {
- method public void fromBundle(androidx.car.navigation.utils.BundleMarshaller);
- method public void toBundle(androidx.car.navigation.utils.BundleMarshaller);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class BundleMarshaller {
- ctor public BundleMarshaller();
- method public void applyDelta(android.os.Bundle!);
- method public boolean getBoolean(String);
- method public <T extends androidx.car.navigation.utils.Bundlable> T? getBundlable(String, T?, java.util.function.Supplier<T>);
- method public <T extends androidx.car.navigation.utils.Bundlable> java.util.List<T>? getBundlableList(String, java.util.List<T>?, java.util.function.Supplier<T>);
- method public <T extends androidx.car.navigation.utils.Bundlable> java.util.List<T> getBundlableListNonNull(String, java.util.List<T>, java.util.function.Supplier<T>);
- method public <T extends androidx.car.navigation.utils.Bundlable> T getBundlableNonNull(String, T, java.util.function.Supplier<T>);
- method public android.os.Bundle! getBundle();
- method public android.os.Bundle! getDelta();
- method public double getDouble(String);
- method public <T extends java.lang.Enum<T>> T? getEnum(String, Class<T>);
- method public <T extends java.lang.Enum<T>> T getEnumNonNull(String, Class<T>, T);
- method public float getFloat(String);
- method public int getInt(String);
- method public String? getString(String);
- method public String getStringNonNull(String, String);
- method public void putBoolean(String, boolean);
- method public <T extends androidx.car.navigation.utils.Bundlable> void putBundlable(String, T?);
- method public <T extends androidx.car.navigation.utils.Bundlable> void putBundlableList(String, java.util.List<T>?);
- method public void putDouble(String, double);
- method public <T extends java.lang.Enum<T>> void putEnum(String, T?);
- method public void putFloat(String, float);
- method public void putInt(String, int);
- method public void putString(String, String?);
- method public void resetBundle();
- method public void resetDelta();
- method public void setBundle(android.os.Bundle!);
- }
-
-}
-
-package androidx.car.util {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class CarUxRestrictionsUtils {
- method public static void apply(android.content.Context!, androidx.car.uxrestrictions.CarUxRestrictions!, android.widget.TextView!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DropShadowScrollListener extends androidx.car.widget.PagedListView.OnScrollListener {
- ctor public DropShadowScrollListener(android.view.View!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class GridLayoutManagerUtils {
- method public static int getFirstRowItemCount(androidx.recyclerview.widget.RecyclerView!);
- method public static int getLastItemPositionOnSameRow(android.view.View!, androidx.recyclerview.widget.RecyclerView!);
- method public static int getSpanIndex(android.view.View!);
- method public static boolean isOnLastRow(android.view.View!, androidx.recyclerview.widget.RecyclerView!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ListItemBackgroundResolver {
- method public static void setBackground(android.view.View!, int, int);
- }
-
-}
-
-package androidx.car.uxrestrictions {
-
- public final class CarUxRestrictions {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public CarUxRestrictions(android.car.drivingstate.CarUxRestrictions!);
- }
-
- @IntDef(flag=true, value={androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_BASELINE, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_DIALPAD, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_FILTERING, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_LIMIT_STRING_LENGTH, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_KEYBOARD, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_VIDEO, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_LIMIT_CONTENT, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_SETUP, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_TEXT_MESSAGE, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CarUxRestrictions.CarUxRestrictionsInfo {
- }
-
-}
-
-package androidx.car.widget.itemdecorators {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class BottomOffsetDecoration extends androidx.recyclerview.widget.RecyclerView.ItemDecoration {
- ctor public BottomOffsetDecoration(int);
- method public int getBottomOffset();
- method public void setBottomOffset(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DividerDecoration extends androidx.recyclerview.widget.RecyclerView.ItemDecoration {
- ctor public DividerDecoration(android.content.Context!, int, int, @IdRes int, @IdRes int, @ColorRes int);
- method public void setDividerColor(@ColorRes int);
- method public void setVisibilityManager(androidx.car.widget.PagedListView.DividerVisibilityManager!);
- method public void updateDividerColor();
- field public static final int INVALID_RESOURCE_ID = -1; // 0xffffffff
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ItemSpacingDecoration extends androidx.recyclerview.widget.RecyclerView.ItemDecoration {
- ctor public ItemSpacingDecoration(int);
- method public void setItemSpacing(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TopOffsetDecoration extends androidx.recyclerview.widget.RecyclerView.ItemDecoration {
- ctor public TopOffsetDecoration(int);
- method public int getTopOffset();
- method public void setTopOffset(int);
- }
-
-}
-
diff --git a/car/core/api/restricted_current.txt b/car/core/api/restricted_current.txt
deleted file mode 100644
index 8a43c31..0000000
--- a/car/core/api/restricted_current.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-// Signature format: 3.0
-package androidx.car.navigation.utils {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface Bundlable {
- method public void fromBundle(androidx.car.navigation.utils.BundleMarshaller);
- method public void toBundle(androidx.car.navigation.utils.BundleMarshaller);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class BundleMarshaller {
- ctor public BundleMarshaller();
- method public void applyDelta(android.os.Bundle!);
- method public boolean getBoolean(String);
- method public <T extends androidx.car.navigation.utils.Bundlable> T? getBundlable(String, T?, java.util.function.Supplier<T>);
- method public <T extends androidx.car.navigation.utils.Bundlable> java.util.List<T>? getBundlableList(String, java.util.List<T>?, java.util.function.Supplier<T>);
- method public <T extends androidx.car.navigation.utils.Bundlable> java.util.List<T> getBundlableListNonNull(String, java.util.List<T>, java.util.function.Supplier<T>);
- method public <T extends androidx.car.navigation.utils.Bundlable> T getBundlableNonNull(String, T, java.util.function.Supplier<T>);
- method public android.os.Bundle! getBundle();
- method public android.os.Bundle! getDelta();
- method public double getDouble(String);
- method public <T extends java.lang.Enum<T>> T? getEnum(String, Class<T>);
- method public <T extends java.lang.Enum<T>> T getEnumNonNull(String, Class<T>, T);
- method public float getFloat(String);
- method public int getInt(String);
- method public String? getString(String);
- method public String getStringNonNull(String, String);
- method public void putBoolean(String, boolean);
- method public <T extends androidx.car.navigation.utils.Bundlable> void putBundlable(String, T?);
- method public <T extends androidx.car.navigation.utils.Bundlable> void putBundlableList(String, java.util.List<T>?);
- method public void putDouble(String, double);
- method public <T extends java.lang.Enum<T>> void putEnum(String, T?);
- method public void putFloat(String, float);
- method public void putInt(String, int);
- method public void putString(String, String?);
- method public void resetBundle();
- method public void resetDelta();
- method public void setBundle(android.os.Bundle!);
- }
-
-}
-
-package androidx.car.util {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class CarUxRestrictionsUtils {
- method public static void apply(android.content.Context!, androidx.car.uxrestrictions.CarUxRestrictions!, android.widget.TextView!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DropShadowScrollListener extends androidx.car.widget.PagedListView.OnScrollListener {
- ctor public DropShadowScrollListener(android.view.View!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class GridLayoutManagerUtils {
- method public static int getFirstRowItemCount(androidx.recyclerview.widget.RecyclerView!);
- method public static int getLastItemPositionOnSameRow(android.view.View!, androidx.recyclerview.widget.RecyclerView!);
- method public static int getSpanIndex(android.view.View!);
- method public static boolean isOnLastRow(android.view.View!, androidx.recyclerview.widget.RecyclerView!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ListItemBackgroundResolver {
- method public static void setBackground(android.view.View!, int, int);
- }
-
-}
-
-package androidx.car.uxrestrictions {
-
- public final class CarUxRestrictions {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public CarUxRestrictions(android.car.drivingstate.CarUxRestrictions!);
- }
-
- @IntDef(flag=true, value={androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_BASELINE, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_DIALPAD, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_FILTERING, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_LIMIT_STRING_LENGTH, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_KEYBOARD, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_VIDEO, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_LIMIT_CONTENT, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_SETUP, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_TEXT_MESSAGE, androidx.car.uxrestrictions.CarUxRestrictions.UX_RESTRICTIONS_NO_VOICE_TRANSCRIPTION}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CarUxRestrictions.CarUxRestrictionsInfo {
- }
-
-}
-
-package androidx.car.widget.itemdecorators {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class BottomOffsetDecoration extends androidx.recyclerview.widget.RecyclerView.ItemDecoration {
- ctor public BottomOffsetDecoration(int);
- method public int getBottomOffset();
- method public void setBottomOffset(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DividerDecoration extends androidx.recyclerview.widget.RecyclerView.ItemDecoration {
- ctor public DividerDecoration(android.content.Context!, int, int, @IdRes int, @IdRes int, @ColorRes int);
- method public void setDividerColor(@ColorRes int);
- method public void setVisibilityManager(androidx.car.widget.PagedListView.DividerVisibilityManager!);
- method public void updateDividerColor();
- field public static final int INVALID_RESOURCE_ID = -1; // 0xffffffff
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ItemSpacingDecoration extends androidx.recyclerview.widget.RecyclerView.ItemDecoration {
- ctor public ItemSpacingDecoration(int);
- method public void setItemSpacing(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TopOffsetDecoration extends androidx.recyclerview.widget.RecyclerView.ItemDecoration {
- ctor public TopOffsetDecoration(int);
- method public int getTopOffset();
- method public void setTopOffset(int);
- }
-
-}
-
diff --git a/car/core/build.gradle b/car/core/build.gradle
index 9fba2a1..df5f78c 100644
--- a/car/core/build.gradle
+++ b/car/core/build.gradle
@@ -8,12 +8,12 @@
dependencies {
api(project(":appcompat"))
- api("androidx.cardview:cardview:1.0.0")
- api("androidx.coordinatorlayout:coordinatorlayout:1.0.0")
+ api(project(":cardview"))
+ api(project(":coordinatorlayout"))
api(project(":annotation"))
api(project(":recyclerview"))
- api("androidx.gridlayout:gridlayout:1.0.0")
- api("androidx.preference:preference:1.0.0")
+ api(project(":gridlayout"))
+ api(project(":preference"))
api(CONSTRAINT_LAYOUT, { transitive = true })
api(SUPPORT_DESIGN, libs.exclude_for_material)
diff --git a/car/core/res-public/values/public_colors.xml b/car/core/res-public/values/public_colors.xml
index 1716214..0c3293c 100644
--- a/car/core/res-public/values/public_colors.xml
+++ b/car/core/res-public/values/public_colors.xml
@@ -100,7 +100,4 @@
<public type="color" name="car_accent_dark" />
<public type="color" name="car_accent_light" />
<public type="color" name="car_accent" />
-
- <!-- Tab colors -->
- <public type="color" name="car_tab_tint" />
</resources>
diff --git a/car/core/res-public/values/public_dimens.xml b/car/core/res-public/values/public_dimens.xml
index 208e3af..a984f00 100644
--- a/car/core/res-public/values/public_dimens.xml
+++ b/car/core/res-public/values/public_dimens.xml
@@ -120,7 +120,4 @@
<!-- Drawer max width -->
<public type="dimen" name="car_drawer_max_width" />
-
- <!-- Tabs -->
- <public type="dimen" name="car_tab_min_width" />
</resources>
diff --git a/car/core/res-public/values/public_layouts.xml b/car/core/res-public/values/public_layouts.xml
index 076e473..b345bdb 100644
--- a/car/core/res-public/values/public_layouts.xml
+++ b/car/core/res-public/values/public_layouts.xml
@@ -20,5 +20,4 @@
<!-- Layouts for the drawer -->
<public type="layout" name="car_drawer" />
<public type="layout" name="car_drawer_activity" />
- <public type="layout" name="car_tab_view" />
</resources>
diff --git a/car/core/res-public/values/public_styles.xml b/car/core/res-public/values/public_styles.xml
index 0b1996c..64b549a 100644
--- a/car/core/res-public/values/public_styles.xml
+++ b/car/core/res-public/values/public_styles.xml
@@ -39,11 +39,8 @@
<public type="style" name="TextAppearance.Car.Body3.Dark" />
<public type="style" name="TextAppearance.Car.Body3.Medium.Dark" />
<public type="style" name="TextAppearance.Car.Body4" />
- <public type="style" name="TextAppearance.Car.Body4.Medium" />
<public type="style" name="TextAppearance.Car.Body4.Light" />
- <public type="style" name="TextAppearance.Car.Body4.Medium.Light" />
<public type="style" name="TextAppearance.Car.Body4.Dark" />
- <public type="style" name="TextAppearance.Car.Body4.Medium.Dark" />
<public type="style" name="TextAppearance.Car.SubText1" />
<public type="style" name="TextAppearance.Car.SubText2" />
<public type="style" name="TextAppearance.Car.SubText3" />
@@ -56,8 +53,6 @@
<public type="style" name="TextAppearance.Car.Error" />
<!-- Widgets -->
- <public type="style" name="Widget.Car.TabLayout" />
- <public type="style" name="Widget.Car.CarToolbar" />
<public type="style" name="Widget.Car.Toolbar" />
<public type="style" name="Widget.Car.Toolbar.Light" />
<public type="style" name="Widget.Car.Toolbar.Button.Navigation" />
diff --git a/car/core/res/color/car_tab_tint.xml b/car/core/res/color/car_tab_tint.xml
deleted file mode 100644
index 71e813f..0000000
--- a/car/core/res/color/car_tab_tint.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2019 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.
--->
-<!-- The tinting for tabs in a TabLayout. This color specifies selected color as this is what is
- used to change colors within the TabLayout. -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_enabled="false"
- android:alpha="0.5"
- android:color="@color/car_grey_300"/>
- <item android:state_selected="false"
- android:alpha="0.5"
- android:color="@color/car_grey_300"/>
- <item android:color="@color/car_grey_300"/>
-</selector>
diff --git a/car/core/res/layout/car_list_item_switch_content.xml b/car/core/res/layout/car_list_item_switch_content.xml
deleted file mode 100644
index 5897a78..0000000
--- a/car/core/res/layout/car_list_item_switch_content.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2019 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.
- -->
-<androidx.constraintlayout.widget.ConstraintLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- tools:ignore="MissingConstraints"
- android:id="@+id/container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="@dimen/car_single_line_list_item_height"
- android:foreground="@drawable/car_card_ripple_background" >
-
- <!-- Primary Action. -->
- <ImageView
- android:id="@+id/primary_icon"
- android:layout_width="@dimen/car_single_line_list_item_height"
- android:layout_height="@dimen/car_single_line_list_item_height"
- android:tint="?attr/listItemPrimaryIconTint"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent"/>
-
- <!-- Text. -->
- <TextView
- android:id="@+id/title"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:ellipsize="end"
- android:textAppearance="?attr/listItemTitleTextAppearance"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintBottom_toTopOf="@+id/body"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/barrier"
- app:layout_constraintVertical_chainStyle="packed"/>
-
- <TextView
- android:id="@+id/body"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:textAppearance="?attr/listItemBodyTextAppearance"
- app:layout_constraintTop_toBottomOf="@+id/title"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/barrier"/>
-
- <!-- A barrier between the text and switch. -->
- <androidx.constraintlayout.widget.Barrier
- android:id="@+id/barrier"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- app:barrierDirection="start"
- app:barrierAllowsGoneWidgets="false"
- app:constraint_referenced_ids="switch_divider,switch_widget" />
-
- <!-- Guideline that the switch is centered upon. -->
- <androidx.constraintlayout.widget.Guideline
- android:id="@+id/supplemental_actions_guideline"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- app:layout_constraintGuide_percent="0.5" />
-
- <!-- Switch with divider. -->
- <View
- android:id="@+id/switch_divider"
- android:background="?attr/listItemActionDividerColor"
- android:layout_marginEnd="@dimen/car_padding_4"
- app:layout_constraintTop_toTopOf="@+id/supplemental_actions_guideline"
- app:layout_constraintBottom_toBottomOf="@+id/supplemental_actions_guideline"
- app:layout_constraintEnd_toStartOf="@+id/switch_widget"
- style="@style/CarListVerticalDivider"/>
-
- <Switch
- android:id="@+id/switch_widget"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginEnd="@dimen/car_keyline_1"
- app:layout_constraintTop_toTopOf="@+id/supplemental_actions_guideline"
- app:layout_constraintBottom_toBottomOf="@+id/supplemental_actions_guideline"
- app:layout_constraintEnd_toEndOf="parent"
- style="?attr/switchStyle" />
-</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/car/core/res/layout/car_paged_scrollbar_buttons.xml b/car/core/res/layout/car_paged_scrollbar_buttons.xml
index 3a430e2..36d1642 100644
--- a/car/core/res/layout/car_paged_scrollbar_buttons.xml
+++ b/car/core/res/layout/car_paged_scrollbar_buttons.xml
@@ -21,9 +21,9 @@
<ImageButton
android:id="@+id/page_up"
- android:background="?attr/selectableItemBackgroundBorderless"
android:layout_width="@dimen/car_scroll_bar_button_size"
android:layout_height="@dimen/car_scroll_bar_button_size"
+ android:background="@drawable/car_button_ripple_background"
android:contentDescription="@string/scroll_bar_page_up_button"
android:focusable="false"
android:hapticFeedbackEnabled="false"
@@ -51,9 +51,9 @@
<ImageButton
android:id="@+id/page_down"
- android:background="?attr/selectableItemBackgroundBorderless"
android:layout_width="@dimen/car_scroll_bar_button_size"
android:layout_height="@dimen/car_scroll_bar_button_size"
+ android:background="@drawable/car_button_ripple_background"
android:contentDescription="@string/scroll_bar_page_down_button"
android:focusable="false"
android:hapticFeedbackEnabled="false"
diff --git a/car/core/res/layout/preference_widget_seekbar_material_car.xml b/car/core/res/layout/preference_widget_seekbar_material_car.xml
index 7c281ae..09aca5f 100644
--- a/car/core/res/layout/preference_widget_seekbar_material_car.xml
+++ b/car/core/res/layout/preference_widget_seekbar_material_car.xml
@@ -82,9 +82,9 @@
<TextView
android:id="@+id/seekbar_value"
- android:layout_width="@dimen/car_keyline_3"
+ android:layout_width="@dimen/preference_seekbar_value_width"
android:layout_height="wrap_content"
- android:gravity="end|center_vertical"
+ android:gravity="right|center_vertical"
android:textAppearance="?attr/listItemBodyTextAppearance"
android:fadingEdge="horizontal"
android:scrollbars="none"/>
diff --git a/car/core/res/values/dimens.xml b/car/core/res/values/dimens.xml
index 234df29..a11d9ae 100644
--- a/car/core/res/values/dimens.xml
+++ b/car/core/res/values/dimens.xml
@@ -98,7 +98,7 @@
<dimen name="car_app_bar_default_elevation">8dp</dimen>
<dimen name="car_application_icon_size">44dp</dimen>
<!-- Factor used to scale switches in the CarToolbar -->
- <item name="car_app_bar_switch_scale" format="float" type="dimen">1.4</item>
+ <dimen name="car_app_bar_switch_scale" format="float">1.4</dimen>
<dimen name="car_app_bar_action_icon_bound">40dp</dimen>
<!-- Lists -->
@@ -203,6 +203,4 @@
<!-- list margin won't be necessary after PagedListView is brought in -->
<dimen name="car_preference_list_margin">8dp</dimen>
- <!-- Tabs -->
- <dimen name="car_tab_min_width">140dp</dimen>
</resources>
diff --git a/car/core/res/values/styles.xml b/car/core/res/values/styles.xml
index c3eb2cd..1d2c501 100644
--- a/car/core/res/values/styles.xml
+++ b/car/core/res/values/styles.xml
@@ -133,26 +133,14 @@
<item name="android:textColor">@color/car_body4</item>
</style>
- <style name="TextAppearance.Car.Body4.Medium">
- <item name="android:fontFamily">sans-serif-medium</item>
- </style>
-
<style name="TextAppearance.Car.Body4.Light">
<item name="android:textColor">@color/car_body4_light</item>
</style>
- <style name="TextAppearance.Car.Body4.Medium.Light">
- <item name="android:textColor">@color/car_body4_light</item>
- </style>
-
<style name="TextAppearance.Car.Body4.Dark">
<item name="android:textColor">@color/car_body4_dark</item>
</style>
- <style name="TextAppearance.Car.Body4.Medium.Dark">
- <item name="android:textColor">@color/car_body4_dark</item>
- </style>
-
<style name="TextAppearance.Car.SubText1">
<item name="android:textStyle">normal</item>
<item name="android:textSize">@dimen/car_subtext1_size</item>
@@ -381,25 +369,6 @@
<item name="android:background">@color/car_list_divider</item>
</style>
- <!-- =============== -->
- <!-- TabLayout Style -->
- <!-- =============== -->
- <eat-comment />
-
- <!-- Styling for a TabLayout. This style colors the TabLayout with a dark theme. Make sure to
- also use the layout car_tab_view as the custom view for each tab. -->
- <style name="Widget.Car.TabLayout" parent="Widget.MaterialComponents.TabLayout">
- <item name="android:background">@android:color/black</item>
- <item name="tabRippleColor">@color/car_card_ripple_background_light</item>
- <item name="tabGravity">fill</item>
- <item name="tabTextColor">@color/car_tab_tint</item>
- <item name="tabIndicatorColor">@android:color/transparent</item>
- <item name="tabIndicatorHeight">0dp</item>
- <item name="tabMinWidth">@dimen/car_tab_min_width</item>
- <item name="tabIconTint">@color/car_tab_tint</item>
- <item name="tabTextAppearance">@style/TextAppearance.Car.Body4.Medium.Light</item>
- </style>
-
<!-- =========== -->
<!-- List Styles -->
<!-- =========== -->
diff --git a/car/core/res/values/themes.xml b/car/core/res/values/themes.xml
index e960ba5..c1bfef32 100644
--- a/car/core/res/values/themes.xml
+++ b/car/core/res/values/themes.xml
@@ -44,8 +44,7 @@
<item name="android:progressBackgroundTint">@color/car_seekbar_track_background_dark</item>
<item name="android:progressTint">?attr/android:colorControlActivated</item>
<item name="android:secondaryProgressTint">@color/car_seekbar_track_secondary_progress</item>
- <item name="android:selectableItemBackground">@drawable/car_card_ripple_background_light</item>
- <item name="android:selectableItemBackgroundBorderless">@drawable/car_button_ripple_background_light</item>
+ <item name="android:selectableItemBackground">@drawable/car_card_ripple_background</item>
<item name="android:seekBarStyle">@style/Widget.Car.SeekBar.Light</item>
<item name="android:textColor">@color/car_body1_light</item>
<item name="android:textColorPrimary">@color/car_display1_light</item>
@@ -54,7 +53,7 @@
<item name="android:spinnerStyle">@style/Widget.Spinner.Car</item>
<item name="android:spinnerItemStyle">@style/CarSpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">@style/CarSpinnerItem</item>
- <item name="actionBarItemBackground">@drawable/car_card_ripple_background_light</item>
+ <item name="actionBarItemBackground">@drawable/car_card_ripple_background</item>
<item name="actionBarSize">@dimen/car_app_bar_height</item>
<item name="actionButtonStyle">@style/Widget.Car.ActionButton.Light</item>
<item name="actionMenuTextAppearance">@style/TextAppearance.Car.ActionBar.Menu</item>
@@ -80,10 +79,7 @@
<item name="pagedListViewStyle">@style/Widget.Car.List.Light</item>
<item name="pagedScrollBarViewStyle">@style/Widget.Car.Scrollbar.Light</item>
<item name="seekBarStyle">@style/Widget.Car.SeekBar.Light</item>
- <item name="selectableItemBackground">@drawable/car_card_ripple_background_light</item>
- <item name="selectableItemBackgroundBorderless">@drawable/car_button_ripple_background_light</item>
<item name="switchStyle">@style/Widget.Car.Switch</item>
- <item name="tabStyle">@style/Widget.Car.TabLayout</item>
<item name="checkboxStyle">@style/Widget.Car.CheckBox.Light</item>
<item name="toolbarNavigationButtonStyle">@style/Widget.Car.Toolbar.Button.Navigation.Light</item>
<item name="toolbarStyle">@style/Widget.Car.Toolbar.Light</item>
@@ -118,7 +114,6 @@
<item name="android:progressTint">?attr/android:colorControlActivated</item>
<item name="android:secondaryProgressTint">@color/car_seekbar_track_secondary_progress</item>
<item name="android:selectableItemBackground">@drawable/car_card_ripple_background</item>
- <item name="android:selectableItemBackgroundBorderless">@drawable/car_button_ripple_background</item>
<item name="android:spinnerStyle">@style/Widget.Spinner.Car</item>
<item name="android:spinnerItemStyle">@style/CarSpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">@style/CarSpinnerItem</item>
@@ -153,8 +148,6 @@
<item name="pagedListViewStyle">@style/Widget.Car.List</item>
<item name="pagedScrollBarViewStyle">@style/Widget.Car.Scrollbar</item>
<item name="seekBarStyle">@style/Widget.Car.SeekBar</item>
- <item name="selectableItemBackground">@drawable/car_card_ripple_background</item>
- <item name="selectableItemBackgroundBorderless">@drawable/car_button_ripple_background</item>
<item name="switchStyle">@style/Widget.Car.Switch</item>
<item name="checkboxStyle">@style/Widget.Car.CheckBox</item>
<item name="toolbarNavigationButtonStyle">@style/Widget.Car.Toolbar.Button.Navigation</item>
diff --git a/car/core/src/androidTest/java/androidx/car/drawer/CarDrawerTest.java b/car/core/src/androidTest/java/androidx/car/drawer/CarDrawerTest.java
index 479569e..428a141 100644
--- a/car/core/src/androidTest/java/androidx/car/drawer/CarDrawerTest.java
+++ b/car/core/src/androidTest/java/androidx/car/drawer/CarDrawerTest.java
@@ -34,7 +34,7 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.espresso.contrib.DrawerActions;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.After;
@@ -51,7 +51,7 @@
* drawer, use {@link CarDrawerTestActivity#getDrawerController()}.
*/
@RunWith(AndroidJUnit4.class)
-@SmallTest
+@MediumTest
public final class CarDrawerTest {
// Note that launchActivity is passed "false" here because we only want to create the
// Activity after we checked that the test is being run on an auto device. Otherwise, this will
diff --git a/car/core/src/androidTest/java/androidx/car/util/GridLayoutManagerUtilsTest.java b/car/core/src/androidTest/java/androidx/car/util/GridLayoutManagerUtilsTest.java
index 7fb7d93..90e6a9d 100644
--- a/car/core/src/androidTest/java/androidx/car/util/GridLayoutManagerUtilsTest.java
+++ b/car/core/src/androidTest/java/androidx/car/util/GridLayoutManagerUtilsTest.java
@@ -38,7 +38,7 @@
import androidx.test.espresso.Espresso;
import androidx.test.espresso.IdlingResource;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -54,7 +54,7 @@
/** Unit tests for {@link GridLayoutManagerUtils}. */
@RunWith(AndroidJUnit4.class)
-@SmallTest
+@MediumTest
public final class GridLayoutManagerUtilsTest {
/**
* Used by {@link TestAdapter} to calculate ViewHolder height so N items appear in one page of
diff --git a/car/core/src/androidTest/java/androidx/car/widget/ActionListItemTest.java b/car/core/src/androidTest/java/androidx/car/widget/ActionListItemTest.java
index f708d4b..38fbef4 100644
--- a/car/core/src/androidTest/java/androidx/car/widget/ActionListItemTest.java
+++ b/car/core/src/androidTest/java/androidx/car/widget/ActionListItemTest.java
@@ -46,7 +46,7 @@
import androidx.test.espresso.UiController;
import androidx.test.espresso.ViewAction;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.hamcrest.Matcher;
@@ -65,7 +65,7 @@
* Tests the layout configuration in {@link ActionListItem}.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class ActionListItemTest {
@Rule
public ActivityTestRule<PagedListViewTestActivity> mActivityRule =
diff --git a/car/core/src/androidTest/java/androidx/car/widget/CarToolbarTest.java b/car/core/src/androidTest/java/androidx/car/widget/CarToolbarTest.java
index ce506d6..6a0d978 100644
--- a/car/core/src/androidTest/java/androidx/car/widget/CarToolbarTest.java
+++ b/car/core/src/androidTest/java/androidx/car/widget/CarToolbarTest.java
@@ -18,7 +18,6 @@
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
-import static androidx.test.espresso.assertion.PositionAssertions.isCompletelyLeftOf;
import static androidx.test.espresso.assertion.PositionAssertions.isCompletelyRightOf;
import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
@@ -54,7 +53,7 @@
import androidx.annotation.NonNull;
import androidx.car.test.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -67,16 +66,14 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
-import java.util.List;
/**
* Unit tests for {@link CarToolbar}.
*/
@RunWith(AndroidJUnit4.class)
-@SmallTest
+@MediumTest
public class CarToolbarTest {
@Rule
@@ -311,26 +308,6 @@
}
@Test
- public void testSetMenuItems_NullClearsItems() throws Throwable {
- String actionItemText = "checkable_item_text";
- CarMenuItem actionItem = new CarMenuItem
- .Builder()
- .setTitle(actionItemText)
- .setDisplayBehavior(CarMenuItem.DisplayBehavior.ALWAYS) // Action item
- .build();
-
- mActivityRule.runOnUiThread(() ->
- mToolbar.setMenuItems(Collections.singletonList(actionItem)));
-
- // Wait for item to show.
- InstrumentationRegistry.getInstrumentation().waitForIdleSync();
-
- mActivityRule.runOnUiThread(() -> mToolbar.setMenuItems(null));
-
- onView(withText(actionItemText)).check(doesNotExist());
- }
-
- @Test
public void testActionItemWithIconDisplaysIcon() throws Throwable {
String actionItemText = "action_item_text";
CarMenuItem actionItem = new CarMenuItem
@@ -547,12 +524,10 @@
.setTitle(overflowItemText)
.build();
- mActivityRule.runOnUiThread(() ->
- mToolbar.setMenuItems(Collections.singletonList(overflowItem)));
-
- // Since overflow items are set in onMeasure, need to wait for the views to be laid out.
- InstrumentationRegistry.getInstrumentation().waitForIdleSync();
- mActivityRule.runOnUiThread(() -> mToolbar.showOverflowMenu());
+ mActivityRule.runOnUiThread(() -> {
+ mToolbar.setMenuItems(Collections.singletonList(overflowItem));
+ mToolbar.showOverflowMenu();
+ });
onView(withText(overflowItemText)).inRoot(isDialog()).check(matches(isDisplayed()));
}
@@ -597,138 +572,6 @@
assertTrue(clicked[0]);
}
- @Test
- public void testIfRoomItemDisplayedInOrderProvided() throws Throwable {
- List<CarMenuItem> items = new ArrayList<>();
- String action1Text = "action_item_1";
- items.add(new CarMenuItem
- .Builder()
- .setTitle(action1Text)
- .setDisplayBehavior(CarMenuItem.DisplayBehavior.ALWAYS)
- .build());
-
- String ifRoomItemText = "if_room_item_text";
- items.add(new CarMenuItem
- .Builder()
- .setTitle(ifRoomItemText)
- .setDisplayBehavior(CarMenuItem.DisplayBehavior.IF_ROOM)
- .build());
-
- String action2Text = "action_item_2";
- items.add(new CarMenuItem
- .Builder()
- .setTitle(action2Text)
- .setDisplayBehavior(CarMenuItem.DisplayBehavior.ALWAYS)
- .build());
-
-
- mActivityRule.runOnUiThread(() -> mToolbar.setMenuItems(items));
-
- onView(withText(ifRoomItemText)).check(isCompletelyLeftOf(withText(action1Text)));
- onView(withText(ifRoomItemText)).check(isCompletelyRightOf(withText(action2Text)));
- }
-
- @Test
- public void testIfRoomItemDisplayedIfRoomAvailable() throws Throwable {
- String ifRoomItemText = "if_room_item_text";
- CarMenuItem ifRoomItem = new CarMenuItem
- .Builder()
- .setTitle(ifRoomItemText)
- .setDisplayBehavior(CarMenuItem.DisplayBehavior.IF_ROOM)
- .build();
-
- mActivityRule.runOnUiThread(() ->
- mToolbar.setMenuItems(Collections.singletonList(ifRoomItem)));
-
- onView(withText(ifRoomItemText)).check(matches(isDisplayed()));
- }
-
- @Test
- public void testIfRoomItemAddedToOverflowIfOverCountLimit() throws Throwable {
- List<CarMenuItem> items = new ArrayList<>();
- for (int i = 0; i < CarToolbar.ACTION_ITEM_COUNT_LIMIT; i++) {
- items.add(new CarMenuItem
- .Builder()
- .setDisplayBehavior(CarMenuItem.DisplayBehavior.ALWAYS)
- .build());
- }
-
- String ifRoomItemText = "if_room_item_text";
- items.add(new CarMenuItem
- .Builder()
- .setTitle(ifRoomItemText)
- .setDisplayBehavior(CarMenuItem.DisplayBehavior.IF_ROOM)
- .build());
-
- mActivityRule.runOnUiThread(() -> mToolbar.setMenuItems(items));
-
- onView(withText(ifRoomItemText)).check(doesNotExist());
-
- // Open overflow menu.
- onView(withId(R.id.overflow_menu)).perform(click());
-
- onView(withText(ifRoomItemText)).check(matches(isDisplayed()));
- }
-
- @Test
- public void testIfRoomItemAddedToOverflowIfOverWidthPercentageLimit() throws Throwable {
- // Add just one ALWAYS item with long text so that ACTION_ITEM_COUNT_LIMIT is not reached.
- String longText = mActivity.getString(R.string.over_uxr_text_length_limit);
- List<CarMenuItem> items = new ArrayList<>();
- items.add(new CarMenuItem
- .Builder()
- .setTitle(longText)
- .setDisplayBehavior(CarMenuItem.DisplayBehavior.ALWAYS)
- .build());
- InstrumentationRegistry.getInstrumentation().waitForIdleSync();
-
- String ifRoomItemText = "if_room_item_text";
- items.add(new CarMenuItem
- .Builder()
- .setTitle(ifRoomItemText)
- .setDisplayBehavior(CarMenuItem.DisplayBehavior.IF_ROOM)
- .build());
-
- mActivityRule.runOnUiThread(() -> mToolbar.setMenuItems(items));
-
- onView(withText(ifRoomItemText)).check(doesNotExist());
-
- mActivityRule.runOnUiThread(() -> mToolbar.showOverflowMenu());
-
- onView(withText(ifRoomItemText)).check(matches(isDisplayed()));
- }
-
- @Test
- public void testIfRoomItemPushedFromActionToOverflowIfLimitExceeded() throws Throwable {
- List<CarMenuItem> items = new ArrayList<>();
- items.add(new CarMenuItem
- .Builder()
- .setDisplayBehavior(CarMenuItem.DisplayBehavior.ALWAYS)
- .build());
-
- String ifRoomItemText = "if_room_item_text";
- items.add(new CarMenuItem
- .Builder()
- .setTitle(ifRoomItemText)
- .setDisplayBehavior(CarMenuItem.DisplayBehavior.IF_ROOM)
- .build());
-
- mActivityRule.runOnUiThread(() -> mToolbar.setMenuItems(items));
-
- onView(withText(ifRoomItemText)).check(matches(isDisplayed()));
-
- for (int i = 0; i < CarToolbar.ACTION_ITEM_COUNT_LIMIT - 1; i++) {
- items.add(new CarMenuItem
- .Builder()
- .setDisplayBehavior(CarMenuItem.DisplayBehavior.ALWAYS)
- .build());
- }
- mActivityRule.runOnUiThread(() -> mToolbar.setMenuItems(items));
-
- onView(withText(ifRoomItemText)).check(doesNotExist());
- onView(withId(R.id.overflow_menu)).check(matches(isDisplayed()));
- }
-
private TextView getTitleView() {
return mActivity.findViewById(R.id.title);
}
diff --git a/car/core/src/androidTest/java/androidx/car/widget/ColumnCardViewTest.java b/car/core/src/androidTest/java/androidx/car/widget/ColumnCardViewTest.java
index 91d2868..e1203fd 100644
--- a/car/core/src/androidTest/java/androidx/car/widget/ColumnCardViewTest.java
+++ b/car/core/src/androidTest/java/androidx/car/widget/ColumnCardViewTest.java
@@ -25,7 +25,7 @@
import androidx.car.util.ColumnCalculator;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
@@ -34,7 +34,7 @@
import org.junit.runner.RunWith;
/** Instrumentation unit tests for {@link ColumnCardView}. */
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public final class ColumnCardViewTest {
@Rule
diff --git a/car/core/src/androidTest/java/androidx/car/widget/ListItemAdapterTest.java b/car/core/src/androidTest/java/androidx/car/widget/ListItemAdapterTest.java
index 4a03d87..5c28055 100644
--- a/car/core/src/androidTest/java/androidx/car/widget/ListItemAdapterTest.java
+++ b/car/core/src/androidTest/java/androidx/car/widget/ListItemAdapterTest.java
@@ -28,7 +28,7 @@
import androidx.car.test.R;
import androidx.car.uxrestrictions.CarUxRestrictions;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Assume;
@@ -42,7 +42,7 @@
/** Unit tests for {@link ListItemAdapter}. */
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public final class ListItemAdapterTest {
@Rule
public ActivityTestRule<PagedListViewTestActivity> mActivityRule =
diff --git a/car/core/src/androidTest/java/androidx/car/widget/PagedListViewNoScrollBarTest.java b/car/core/src/androidTest/java/androidx/car/widget/PagedListViewNoScrollBarTest.java
index b18a396..4923daf 100644
--- a/car/core/src/androidTest/java/androidx/car/widget/PagedListViewNoScrollBarTest.java
+++ b/car/core/src/androidTest/java/androidx/car/widget/PagedListViewNoScrollBarTest.java
@@ -38,7 +38,7 @@
import androidx.test.InstrumentationRegistry;
import androidx.test.espresso.IdlingRegistry;
import androidx.test.espresso.IdlingResource;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
@@ -57,7 +57,7 @@
/** Unit tests for a {@link PagedListView} that has scrollbars disabled. */
@RunWith(AndroidJUnit4.class)
-@SmallTest
+@MediumTest
public final class PagedListViewNoScrollBarTest {
/**
* Used by {@link TestAdapter} to calculate ViewHolder height so N items appear in one page of
diff --git a/car/core/src/androidTest/java/androidx/car/widget/PagedListViewTest.java b/car/core/src/androidTest/java/androidx/car/widget/PagedListViewTest.java
index ef41766..8b92b7d 100644
--- a/car/core/src/androidTest/java/androidx/car/widget/PagedListViewTest.java
+++ b/car/core/src/androidTest/java/androidx/car/widget/PagedListViewTest.java
@@ -59,7 +59,7 @@
import androidx.test.espresso.matcher.ViewMatchers;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -79,7 +79,7 @@
/** Unit tests for {@link PagedListView}. */
@RunWith(AndroidJUnit4.class)
-@SmallTest
+@MediumTest
public final class PagedListViewTest {
/**
diff --git a/car/core/src/androidTest/java/androidx/car/widget/RadioButtonListItemTest.java b/car/core/src/androidTest/java/androidx/car/widget/RadioButtonListItemTest.java
index 83d00c1..6174cf5 100644
--- a/car/core/src/androidTest/java/androidx/car/widget/RadioButtonListItemTest.java
+++ b/car/core/src/androidTest/java/androidx/car/widget/RadioButtonListItemTest.java
@@ -38,7 +38,7 @@
import androidx.test.espresso.ViewAction;
import androidx.test.espresso.contrib.RecyclerViewActions;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.hamcrest.Matcher;
@@ -56,7 +56,7 @@
* Tests the layout configuration in {@link RadioButtonListItem}.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class RadioButtonListItemTest {
@Rule
public ActivityTestRule<PagedListViewTestActivity> mActivityRule =
diff --git a/car/core/src/androidTest/java/androidx/car/widget/SeekbarListItemTest.java b/car/core/src/androidTest/java/androidx/car/widget/SeekbarListItemTest.java
index 8e4e7de..540d1f1 100644
--- a/car/core/src/androidTest/java/androidx/car/widget/SeekbarListItemTest.java
+++ b/car/core/src/androidTest/java/androidx/car/widget/SeekbarListItemTest.java
@@ -40,7 +40,7 @@
import androidx.test.espresso.UiController;
import androidx.test.espresso.ViewAction;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.hamcrest.Matcher;
@@ -58,7 +58,7 @@
* Tests the layout configuration in {@link SeekbarListItem}.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class SeekbarListItemTest {
@Rule
diff --git a/car/core/src/androidTest/java/androidx/car/widget/SubheaderListItemTest.java b/car/core/src/androidTest/java/androidx/car/widget/SubheaderListItemTest.java
index 3d5d196..5bd1bb4 100644
--- a/car/core/src/androidTest/java/androidx/car/widget/SubheaderListItemTest.java
+++ b/car/core/src/androidTest/java/androidx/car/widget/SubheaderListItemTest.java
@@ -29,7 +29,7 @@
import androidx.car.test.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Assume;
@@ -46,7 +46,7 @@
* Tests the layout configuration in {@link SubheaderListItem}.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class SubheaderListItemTest {
@Rule
diff --git a/car/core/src/androidTest/java/androidx/car/widget/SwitchListItemTest.java b/car/core/src/androidTest/java/androidx/car/widget/SwitchListItemTest.java
deleted file mode 100644
index cd842bd..0000000
--- a/car/core/src/androidTest/java/androidx/car/widget/SwitchListItemTest.java
+++ /dev/null
@@ -1,836 +0,0 @@
-/*
- * Copyright 2019 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.car.widget;
-
-import static androidx.test.espresso.Espresso.onView;
-import static androidx.test.espresso.action.ViewActions.click;
-import static androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition;
-import static androidx.test.espresso.contrib.RecyclerViewActions.scrollToPosition;
-import static androidx.test.espresso.matcher.ViewMatchers.withId;
-
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.hamcrest.Matchers.greaterThan;
-import static org.hamcrest.Matchers.greaterThanOrEqualTo;
-import static org.hamcrest.Matchers.lessThan;
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.number.IsCloseTo.closeTo;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyBoolean;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.graphics.drawable.Icon;
-import android.text.InputFilter;
-import android.text.TextUtils;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.CompoundButton;
-import android.widget.Switch;
-
-import androidx.car.test.R;
-import androidx.car.util.CarUxRestrictionsTestUtils;
-import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.test.core.app.ApplicationProvider;
-import androidx.test.espresso.UiController;
-import androidx.test.espresso.ViewAction;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
-import androidx.test.platform.app.InstrumentationRegistry;
-import androidx.test.rule.ActivityTestRule;
-
-import org.hamcrest.Matcher;
-import org.junit.Assume;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Locale;
-
-/**
-* Tests the layout configuration and switch functionality of {@link SwitchListItem}.
- */
-@RunWith(AndroidJUnit4.class)
-@LargeTest
-public class SwitchListItemTest {
-
- @Rule
- public ActivityTestRule<PagedListViewTestActivity> mActivityRule =
- new ActivityTestRule<>(PagedListViewTestActivity.class);
-
- private PagedListViewTestActivity mActivity;
- private PagedListView mPagedListView;
- private ListItemAdapter mAdapter;
-
- private boolean isAutoDevice() {
- PackageManager packageManager = mActivityRule.getActivity().getPackageManager();
- return packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE);
- }
-
- @Before
- public void setUp() {
- Assume.assumeTrue(isAutoDevice());
-
- mActivity = mActivityRule.getActivity();
- mPagedListView = mActivity.findViewById(R.id.paged_list_view);
- }
-
- @Test
- public void testDefaultVisibility_EmptyItemShowsSwitch() {
- SwitchListItem item = new SwitchListItem(mActivity);
- setupPagedListView(Arrays.asList(item));
-
- ViewGroup itemView = (ViewGroup)
- mPagedListView.getRecyclerView().getLayoutManager().getChildAt(0);
- int childCount = itemView.getChildCount();
- for (int i = 0; i < childCount; i++) {
- View view = itemView.getChildAt(i);
- // |view| could be container in view holder, so exempt ViewGroup.
- if (view instanceof Switch || view instanceof ViewGroup) {
- assertThat(view.getVisibility(), is(equalTo(View.VISIBLE)));
- } else {
- assertThat("Visibility of view "
- + mActivity.getResources().getResourceEntryName(view.getId())
- + " by default should be GONE.",
- view.getVisibility(), is(equalTo(View.GONE)));
- }
- }
- }
-
- @Test
- public void testItemIsEnabledByDefault() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
-
- List<SwitchListItem> items = Arrays.asList(item0);
- setupPagedListView(items);
-
- assertTrue(getViewHolderAtPosition(0).itemView.isEnabled());
- }
-
- @Test
- public void testDisablingItem() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
-
- List<SwitchListItem> items = Arrays.asList(item0);
- setupPagedListView(items);
-
- item0.setEnabled(false);
- refreshUi();
-
- assertFalse(getViewHolderAtPosition(0).itemView.isEnabled());
- }
-
- @Test
- public void testClickableItem_DefaultNotClickable() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
-
- List<SwitchListItem> items = Arrays.asList(item0);
- setupPagedListView(items);
-
- assertFalse(getViewHolderAtPosition(0).itemView.isClickable());
- }
-
- @Test
- public void testClickableItem_setClickable() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setClickable(true);
-
- List<SwitchListItem> items = Arrays.asList(item0);
- setupPagedListView(items);
-
- assertTrue(getViewHolderAtPosition(0).itemView.isClickable());
- }
-
- @Test
- public void testClickableItem_ClickingTogglesSwitch() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setClickable(true);
-
- List<SwitchListItem> items = Arrays.asList(item0);
- setupPagedListView(items);
-
- onView(withId(R.id.recycler_view)).perform(actionOnItemAtPosition(0, click()));
-
- assertTrue(getViewHolderAtPosition(0).getSwitch().isChecked());
- }
-
- @Test
- public void testSwitchStatePersistsOnRebind() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
- // Switch initially checked.
- item0.setSwitchState(true);
-
- setupPagedListView(Collections.singletonList(item0));
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
-
- toggleChecked(viewHolder.getSwitch());
-
- viewHolder = getViewHolderAtPosition(0);
- assertThat(viewHolder.getSwitch().isChecked(), is(equalTo(false)));
- }
-
- @Test
- public void testSetSwitchState() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setSwitchState(true);
-
- setupPagedListView(Arrays.asList(item0));
-
- item0.setSwitchState(false);
- refreshUi();
-
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
- assertThat(viewHolder.getSwitch().getVisibility(), is(equalTo(View.VISIBLE)));
- assertThat(viewHolder.getSwitch().isChecked(), is(equalTo(false)));
- }
-
- @Test
- public void testSetSwitchStateCallsListener() {
- CompoundButton.OnCheckedChangeListener listener =
- mock(CompoundButton.OnCheckedChangeListener.class);
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setSwitchOnCheckedChangeListener(listener);
-
- setupPagedListView(Collections.singletonList(item0));
-
- item0.setSwitchState(true);
- refreshUi();
- verify(listener).onCheckedChanged(any(CompoundButton.class), eq(true));
- }
-
- @Test
- public void testRefreshingUiDoesNotCallListener() {
- CompoundButton.OnCheckedChangeListener listener =
- mock(CompoundButton.OnCheckedChangeListener.class);
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setSwitchOnCheckedChangeListener(listener);
-
- setupPagedListView(Collections.singletonList(item0));
-
- refreshUi();
- verify(listener, never()).onCheckedChanged(any(CompoundButton.class), anyBoolean());
- }
-
- @Test
- public void testSetSwitchStateBeforeFirstBindCallsListener() {
- CompoundButton.OnCheckedChangeListener listener =
- mock(CompoundButton.OnCheckedChangeListener.class);
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setSwitchOnCheckedChangeListener(listener);
- item0.setSwitchState(true);
-
- setupPagedListView(Collections.singletonList(item0));
-
- verify(listener).onCheckedChanged(any(CompoundButton.class), eq(true));
- }
-
- @Test
- public void testSwitchToggleCallsListener() {
- CompoundButton.OnCheckedChangeListener listener =
- mock(CompoundButton.OnCheckedChangeListener.class);
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setSwitchOnCheckedChangeListener(listener);
-
- setupPagedListView(Collections.singletonList(item0));
-
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
- toggleChecked(viewHolder.getSwitch());
-
- // Expect true because switch defaults to false.
- verify(listener).onCheckedChanged(any(CompoundButton.class), eq(true));
- }
-
- @Test
- public void testSetSwitchStateNotDirtyDoesNotCallListener() {
- CompoundButton.OnCheckedChangeListener listener =
- mock(CompoundButton.OnCheckedChangeListener.class);
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setSwitchState(true);
- item0.setSwitchOnCheckedChangeListener(listener);
-
- setupPagedListView(Collections.singletonList(item0));
-
- item0.setSwitchState(true);
- refreshUi();
-
- verify(listener, never()).onCheckedChanged(any(CompoundButton.class), anyBoolean());
- }
-
- @Test
- public void testCheckingSwitch() {
- final boolean[] clicked = {false};
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setSwitchOnCheckedChangeListener((button, isChecked) -> {
- // Initial value is false.
- assertTrue(isChecked);
- clicked[0] = true;
- });
-
- List<SwitchListItem> items = Arrays.asList(item0);
- setupPagedListView(items);
-
- onView(withId(R.id.recycler_view)).perform(
- actionOnItemAtPosition(0, clickChildViewWithId(R.id.switch_widget)));
- assertTrue(clicked[0]);
- }
-
- @Test
- public void testDividerVisibility() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setShowSwitchDivider(true);
-
- SwitchListItem item1 = new SwitchListItem(mActivity);
- item0.setShowSwitchDivider(false);
-
- List<SwitchListItem> items = Arrays.asList(item0, item1);
- setupPagedListView(items);
-
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
- assertThat(viewHolder.getSwitch().getVisibility(), is(equalTo(View.VISIBLE)));
- assertThat(viewHolder.getSwitch().getVisibility(), is(equalTo(View.VISIBLE)));
-
- viewHolder = getViewHolderAtPosition(1);
- assertThat(viewHolder.getSwitch().getVisibility(), is(equalTo(View.VISIBLE)));
- assertThat(viewHolder.getSwitchDivider().getVisibility(), is(equalTo(View.GONE)));
- }
-
- @Test
- public void testPrimaryActionVisible() {
- SwitchListItem largeIcon = new SwitchListItem(mActivity);
- largeIcon.setPrimaryActionIcon(
- Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_LARGE);
-
- SwitchListItem mediumIcon = new SwitchListItem(mActivity);
- mediumIcon.setPrimaryActionIcon(
- Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_MEDIUM);
-
- SwitchListItem smallIcon = new SwitchListItem(mActivity);
- smallIcon.setPrimaryActionIcon(
- Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_SMALL);
-
- List<SwitchListItem> items = Arrays.asList(largeIcon, mediumIcon, smallIcon);
- setupPagedListView(items);
-
- assertThat(getViewHolderAtPosition(0).getPrimaryIcon().getVisibility(),
- is(equalTo(View.VISIBLE)));
- assertThat(getViewHolderAtPosition(1).getPrimaryIcon().getVisibility(),
- is(equalTo(View.VISIBLE)));
- assertThat(getViewHolderAtPosition(2).getPrimaryIcon().getVisibility(),
- is(equalTo(View.VISIBLE)));
- }
-
- @Test
- public void testTextVisible() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setTitle("title");
-
- SwitchListItem item1 = new SwitchListItem(mActivity);
- item1.setBody("body");
-
- List<SwitchListItem> items = Arrays.asList(item0, item1);
- setupPagedListView(items);
-
- assertThat(getViewHolderAtPosition(0).getTitle().getVisibility(),
- is(equalTo(View.VISIBLE)));
- assertThat(getViewHolderAtPosition(1).getBody().getVisibility(),
- is(equalTo(View.VISIBLE)));
- }
-
- @Test
- public void testTextStartMarginMatchesPrimaryActionType() {
- SwitchListItem largeIcon = new SwitchListItem(mActivity);
- largeIcon.setPrimaryActionIcon(
- Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_LARGE);
-
- SwitchListItem mediumIcon = new SwitchListItem(mActivity);
- mediumIcon.setPrimaryActionIcon(
- Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_MEDIUM);
-
- SwitchListItem smallIcon = new SwitchListItem(mActivity);
- smallIcon.setPrimaryActionIcon(
- Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_SMALL);
-
- SwitchListItem emptyIcon = new SwitchListItem(mActivity);
- emptyIcon.setPrimaryActionEmptyIcon();
-
- SwitchListItem noIcon = new SwitchListItem(mActivity);
- noIcon.setPrimaryActionNoIcon();
-
- List<SwitchListItem> items = Arrays.asList(
- largeIcon, mediumIcon, smallIcon, emptyIcon, noIcon);
- List<Integer> expectedStartMargin = Arrays.asList(
- R.dimen.car_keyline_4, // Large icon.
- R.dimen.car_keyline_3, // Medium icon.
- R.dimen.car_keyline_3, // Small icon.
- R.dimen.car_keyline_3, // Empty icon.
- R.dimen.car_keyline_1); // No icon.
- setupPagedListView(items);
-
- for (int i = 0; i < items.size(); i++) {
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(i);
-
- int expected = ApplicationProvider.getApplicationContext().getResources()
- .getDimensionPixelSize(expectedStartMargin.get(i));
- assertThat(((ViewGroup.MarginLayoutParams) viewHolder.getTitle().getLayoutParams())
- .getMarginStart(), is(equalTo(expected)));
- assertThat(((ViewGroup.MarginLayoutParams) viewHolder.getBody().getLayoutParams())
- .getMarginStart(), is(equalTo(expected)));
- }
- }
-
- @Test
- public void testItemWithOnlyTitleIsSingleLine() {
- // Only space.
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setTitle(" ");
-
- // Underscore.
- SwitchListItem item1 = new SwitchListItem(mActivity);
- item1.setTitle("______");
-
- SwitchListItem item2 = new SwitchListItem(mActivity);
- item2.setTitle("ALL UPPER CASE");
-
- // String wouldn't fit in one line.
- SwitchListItem item3 = new SwitchListItem(mActivity);
- item3.setTitle(ApplicationProvider.getApplicationContext().getResources().getString(
- R.string.over_uxr_text_length_limit));
-
- List<SwitchListItem> items = Arrays.asList(item0, item1, item2, item3);
- setupPagedListView(items);
-
- double singleLineHeight =
- ApplicationProvider.getApplicationContext().getResources().getDimension(
- R.dimen.car_single_line_list_item_height);
-
- LinearLayoutManager layoutManager =
- (LinearLayoutManager) mPagedListView.getRecyclerView().getLayoutManager();
- for (int i = 0; i < items.size(); i++) {
- assertThat((double) layoutManager.findViewByPosition(i).getHeight(),
- is(closeTo(singleLineHeight, 1.0d)));
- }
- }
-
- @Test
- public void testItemWithBodyTextIsAtLeastDoubleLine() {
- // Only space.
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setBody(" ");
-
- // Underscore.
- SwitchListItem item1 = new SwitchListItem(mActivity);
- item1.setBody("____");
-
- // String wouldn't fit in one line.
- SwitchListItem item2 = new SwitchListItem(mActivity);
- item2.setBody(ApplicationProvider.getApplicationContext().getResources().getString(
- R.string.over_uxr_text_length_limit));
-
- List<SwitchListItem> items = Arrays.asList(item0, item1, item2);
- setupPagedListView(items);
-
- final int doubleLineHeight =
- (int) ApplicationProvider.getApplicationContext().getResources().getDimension(
- R.dimen.car_double_line_list_item_height);
-
- LinearLayoutManager layoutManager =
- (LinearLayoutManager) mPagedListView.getRecyclerView().getLayoutManager();
- for (int i = 0; i < items.size(); i++) {
- assertThat(layoutManager.findViewByPosition(i).getHeight(),
- is(greaterThanOrEqualTo(doubleLineHeight)));
- }
- }
-
- @Test
- public void testSetPrimaryActionIcon() {
- SwitchListItem item = new SwitchListItem(mActivity);
- item.setPrimaryActionIcon(
- Icon.createWithResource(mActivity, android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_LARGE);
-
- List<SwitchListItem> items = Arrays.asList(item);
- setupPagedListView(items);
-
- assertThat(getViewHolderAtPosition(0).getPrimaryIcon().getDrawable(), is(notNullValue()));
- }
-
- @Test
- public void testPrimaryIconSizesInIncreasingOrder() {
- SwitchListItem small = new SwitchListItem(mActivity);
- small.setPrimaryActionIcon(
- Icon.createWithResource(mActivity, android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_SMALL);
-
- SwitchListItem medium = new SwitchListItem(mActivity);
- medium.setPrimaryActionIcon(
- Icon.createWithResource(mActivity, android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_MEDIUM);
-
- SwitchListItem large = new SwitchListItem(mActivity);
- large.setPrimaryActionIcon(
- Icon.createWithResource(mActivity, android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_LARGE);
-
- List<SwitchListItem> items = Arrays.asList(small, medium, large);
- setupPagedListView(items);
-
- SwitchListItem.ViewHolder smallVH = getViewHolderAtPosition(0);
- SwitchListItem.ViewHolder mediumVH = getViewHolderAtPosition(1);
- SwitchListItem.ViewHolder largeVH = getViewHolderAtPosition(2);
-
- assertThat(largeVH.getPrimaryIcon().getHeight(), is(greaterThan(
- mediumVH.getPrimaryIcon().getHeight())));
- assertThat(mediumVH.getPrimaryIcon().getHeight(), is(greaterThan(
- smallVH.getPrimaryIcon().getHeight())));
- }
-
- @Test
- public void testLargePrimaryIconHasNoStartMargin() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setPrimaryActionIcon(
- Icon.createWithResource(mActivity, android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_LARGE);
-
- List<SwitchListItem> items = Arrays.asList(item0);
- setupPagedListView(items);
-
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
- assertThat(((ViewGroup.MarginLayoutParams) viewHolder.getPrimaryIcon().getLayoutParams())
- .getMarginStart(), is(equalTo(0)));
- }
-
- @Test
- public void testSmallAndMediumPrimaryIconStartMargin() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setPrimaryActionIcon(
- Icon.createWithResource(mActivity, android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_SMALL);
-
- SwitchListItem item1 = new SwitchListItem(mActivity);
- item1.setPrimaryActionIcon(
- Icon.createWithResource(mActivity, android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_MEDIUM);
-
- List<SwitchListItem> items = Arrays.asList(item0, item1);
- setupPagedListView(items);
-
- int expected =
- ApplicationProvider.getApplicationContext().getResources().getDimensionPixelSize(
- R.dimen.car_keyline_1);
-
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
- assertThat(((ViewGroup.MarginLayoutParams) viewHolder.getPrimaryIcon().getLayoutParams())
- .getMarginStart(), is(equalTo(expected)));
-
- viewHolder = getViewHolderAtPosition(1);
- assertThat(((ViewGroup.MarginLayoutParams) viewHolder.getPrimaryIcon().getLayoutParams())
- .getMarginStart(), is(equalTo(expected)));
- }
-
- @Test
- public void testSmallPrimaryIconTopMarginRemainsTheSameRegardlessOfTextLength() {
- final String longText =
- ApplicationProvider.getApplicationContext().getResources().getString(
- R.string.over_uxr_text_length_limit);
-
- // Single line item.
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setPrimaryActionIcon(
- Icon.createWithResource(mActivity, android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_SMALL);
- item0.setTitle("one line text");
-
- // Double line item with one line text.
- SwitchListItem item1 = new SwitchListItem(mActivity);
- item1.setPrimaryActionIcon(
- Icon.createWithResource(mActivity, android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_SMALL);
- item1.setTitle("one line text");
- item1.setBody("one line text");
-
- // Double line item with long text.
- SwitchListItem item2 = new SwitchListItem(mActivity);
- item2.setPrimaryActionIcon(
- Icon.createWithResource(mActivity, android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_SMALL);
- item2.setTitle("one line text");
- item2.setBody(longText);
-
- // Body text only - long text.
- SwitchListItem item3 = new SwitchListItem(mActivity);
- item3.setPrimaryActionIcon(
- Icon.createWithResource(mActivity, android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_SMALL);
- item3.setBody(longText);
-
- // Body text only - one line text.
- SwitchListItem item4 = new SwitchListItem(mActivity);
- item4.setPrimaryActionIcon(
- Icon.createWithResource(mActivity, android.R.drawable.sym_def_app_icon),
- SwitchListItem.PRIMARY_ACTION_ICON_SIZE_SMALL);
- item4.setBody("one line text");
-
- List<SwitchListItem> items = Arrays.asList(item0, item1, item2, item3, item4);
- setupPagedListView(items);
-
- for (int i = 1; i < items.size(); i++) {
- onView(withId(R.id.recycler_view)).perform(scrollToPosition(i));
- // Implementation uses integer division so it may be off by 1 vs centered vertically.
- assertThat((double) getViewHolderAtPosition(i - 1).getPrimaryIcon().getTop(),
- is(closeTo(
- (double) getViewHolderAtPosition(i).getPrimaryIcon().getTop(), 1.0d)));
- }
- }
-
- @Test
- public void testCustomViewBinderBindsLast() {
- final String updatedTitle = "updated title";
-
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setTitle("original title");
- item0.addViewBinder((viewHolder) -> viewHolder.getTitle().setText(updatedTitle));
-
- List<SwitchListItem> items = Arrays.asList(item0);
- setupPagedListView(items);
-
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
- assertThat(viewHolder.getTitle().getText(), is(equalTo(updatedTitle)));
- }
-
- @Test
- public void testCustomViewBinderOnUnusedViewsHasNoEffect() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.addViewBinder((viewHolder) -> viewHolder.getBody().setText("text"));
-
- List<SwitchListItem> items = Arrays.asList(item0);
- setupPagedListView(items);
-
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
- assertThat(viewHolder.getBody().getVisibility(), is(equalTo(View.GONE)));
- // Custom binder interacts with body but has no effect.
- // Expect card height to remain single line.
- assertThat((double) viewHolder.itemView.getHeight(), is(closeTo(
- ApplicationProvider.getApplicationContext().getResources().getDimension(
- R.dimen.car_single_line_list_item_height), 1.0d)));
- }
-
- @Test
- public void testRevertingViewBinder() throws Throwable {
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setBody("one item");
- item0.addViewBinder(
- (viewHolder) -> viewHolder.getBody().setEllipsize(TextUtils.TruncateAt.END),
- (viewHolder -> viewHolder.getBody().setEllipsize(null)));
-
- List<SwitchListItem> items = Arrays.asList(item0);
- setupPagedListView(items);
-
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
-
- // Bind view holder to a new item - the customization made by item0 should be reverted.
- SwitchListItem item1 = new SwitchListItem(mActivity);
- item1.setBody("new item");
- mActivityRule.runOnUiThread(() -> item1.bind(viewHolder));
-
- assertThat(viewHolder.getBody().getEllipsize(), is(equalTo(null)));
- }
-
- @Test
- public void testRemovingViewBinder() {
- SwitchListItem item0 = new SwitchListItem(mActivity);
- item0.setBody("one item");
- ListItem.ViewBinder<SwitchListItem.ViewHolder> binder =
- (viewHolder) -> viewHolder.getTitle().setEllipsize(TextUtils.TruncateAt.END);
- item0.addViewBinder(binder);
-
- assertTrue(item0.removeViewBinder(binder));
-
- List<SwitchListItem> items = Arrays.asList(item0);
- setupPagedListView(items);
-
- assertThat(getViewHolderAtPosition(0).getBody().getEllipsize(), is(equalTo(null)));
- }
-
- @Test
- public void testUpdateItem() {
- SwitchListItem item = new SwitchListItem(mActivity);
- setupPagedListView(Arrays.asList(item));
-
- String title = "updated title";
- item.setTitle(title);
-
- refreshUi();
-
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
- assertThat(viewHolder.getTitle().getText(), is(equalTo(title)));
- }
-
- @Test
- public void testUxRestrictionsChange() {
- String longText = mActivity.getString(R.string.over_uxr_text_length_limit);
- SwitchListItem item = new SwitchListItem(mActivity);
- item.setBody(longText);
-
- setupPagedListView(Arrays.asList(item));
-
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
- // Default behavior without UXR is unrestricted.
- assertThat(viewHolder.getBody().getText(), is(equalTo(longText)));
-
- viewHolder.onUxRestrictionsChanged(CarUxRestrictionsTestUtils.getFullyRestricted());
- refreshUi();
-
- // Verify that the body text length is limited.
- assertThat(viewHolder.getBody().getText().length(), is(lessThan(longText.length())));
- }
-
- @Test
- public void testUxRestrictionsChangesDoNotAlterExistingInputFilters() {
- InputFilter filter = new InputFilter.AllCaps(Locale.US);
- String bodyText = "body_text";
- SwitchListItem item = new SwitchListItem(mActivity);
- item.setBody(bodyText);
- item.addViewBinder(vh -> vh.getBody().setFilters(new InputFilter[] {filter}));
-
- setupPagedListView(Arrays.asList(item));
-
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
-
- // Toggle UX restrictions between fully restricted and unrestricted should not affect
- // existing filters.
- viewHolder.onUxRestrictionsChanged(CarUxRestrictionsTestUtils.getFullyRestricted());
- refreshUi();
- assertTrue(Arrays.asList(viewHolder.getBody().getFilters()).contains(filter));
-
- viewHolder.onUxRestrictionsChanged(CarUxRestrictionsTestUtils.getBaseline());
- refreshUi();
- assertTrue(Arrays.asList(viewHolder.getBody().getFilters()).contains(filter));
- }
-
- @Test
- public void testDisabledItemDisablesViewHolder() {
- SwitchListItem item = new SwitchListItem(mActivity);
- item.setTitle("title");
- item.setBody("body");
- item.setEnabled(false);
-
- setupPagedListView(Arrays.asList(item));
-
- SwitchListItem.ViewHolder viewHolder = getViewHolderAtPosition(0);
- assertFalse(viewHolder.getTitle().isEnabled());
- assertFalse(viewHolder.getBody().isEnabled());
- assertFalse(viewHolder.getSwitch().isEnabled());
- }
-
- @Test
- public void testDisabledItemDoesNotRespondToClick() {
- // Disabled view will not respond to touch event.
- // Current test setup makes it hard to test, since clickChildViewWithId() directly calls
- // performClick() on a view, bypassing the way UI handles disabled state.
-
- // We are explicitly setting itemView so test it here.
- boolean[] clicked = new boolean[]{false};
- SwitchListItem item = new SwitchListItem(mActivity);
- item.setEnabled(false);
-
- setupPagedListView(Arrays.asList(item));
-
- onView(withId(R.id.recycler_view)).perform(
- actionOnItemAtPosition(0, click()));
-
- assertFalse(clicked[0]);
- }
-
- private Context getContext() {
- return mActivity;
- }
-
- private void refreshUi() {
- try {
- mActivityRule.runOnUiThread(() -> mAdapter.notifyDataSetChanged());
- } catch (Throwable throwable) {
- throwable.printStackTrace();
- throw new RuntimeException(throwable);
- }
- InstrumentationRegistry.getInstrumentation().waitForIdleSync();
- }
-
- private void setupPagedListView(List<SwitchListItem> items) {
- ListItemProvider provider = new ListItemProvider.ListProvider(new ArrayList<>(items));
- try {
- mAdapter = new ListItemAdapter(mActivity, provider);
- mActivityRule.runOnUiThread(() -> mPagedListView.setAdapter(mAdapter));
- } catch (Throwable throwable) {
- throwable.printStackTrace();
- throw new RuntimeException(throwable);
- }
- InstrumentationRegistry.getInstrumentation().waitForIdleSync();
- }
-
- private SwitchListItem.ViewHolder getViewHolderAtPosition(int position) {
- return (SwitchListItem.ViewHolder) mPagedListView.getRecyclerView()
- .findViewHolderForAdapterPosition(position);
- }
-
- private void toggleChecked(CompoundButton button) {
- try {
- mActivityRule.runOnUiThread(button::toggle);
- } catch (Throwable throwable) {
- throwable.printStackTrace();
- throw new RuntimeException(throwable);
- }
- InstrumentationRegistry.getInstrumentation().waitForIdleSync();
- }
-
- private static ViewAction clickChildViewWithId(final int id) {
- return new ViewAction() {
- @Override
- public Matcher<View> getConstraints() {
- return null;
- }
-
- @Override
- public String getDescription() {
- return "Click on a child view with specific id.";
- }
-
- @Override
- public void perform(UiController uiController, View view) {
- View v = view.findViewById(id);
- v.performClick();
- }
- };
- }
-}
diff --git a/car/core/src/androidTest/java/androidx/car/widget/TextListItemTest.java b/car/core/src/androidTest/java/androidx/car/widget/TextListItemTest.java
index daf37a3..fba44e8 100644
--- a/car/core/src/androidTest/java/androidx/car/widget/TextListItemTest.java
+++ b/car/core/src/androidTest/java/androidx/car/widget/TextListItemTest.java
@@ -56,7 +56,7 @@
import androidx.test.espresso.UiController;
import androidx.test.espresso.ViewAction;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.hamcrest.Matcher;
@@ -76,7 +76,7 @@
* Tests the layout configuration in {@link TextListItem}.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class TextListItemTest {
@Rule
@@ -920,7 +920,7 @@
}
@Test
- public void testClickInterceptor_ClickableIfSupplementalIconClickable() {
+ public void testClickInterceptor_ClickableIfSupplmentalIconClickable() {
TextListItem item = new TextListItem(mActivity);
item.setEnabled(true);
@@ -934,7 +934,7 @@
}
@Test
- public void testClickInterceptor_VisibleIfSupplementalIconClickable() {
+ public void testClickInterceptor_VisibleIfSupplmentalIconClickable() {
TextListItem item = new TextListItem(mActivity);
item.setEnabled(true);
@@ -948,7 +948,7 @@
}
@Test
- public void testClickInterceptor_NotClickableIfSupplementalIconNotClickable() {
+ public void testClickInterceptor_NotClickableIfSupplmentalIconNotClickable() {
TextListItem item = new TextListItem(mActivity);
item.setEnabled(true);
@@ -962,7 +962,7 @@
}
@Test
- public void testClickInterceptor_GoneIfSupplementalIconClickable() {
+ public void testClickInterceptor_GoneIfSupplmentalIconClickable() {
TextListItem item = new TextListItem(mActivity);
item.setEnabled(true);
diff --git a/car/core/src/main/java/androidx/car/drawer/CarDrawerController.java b/car/core/src/main/java/androidx/car/drawer/CarDrawerController.java
index afcec38..39fdf42 100644
--- a/car/core/src/main/java/androidx/car/drawer/CarDrawerController.java
+++ b/car/core/src/main/java/androidx/car/drawer/CarDrawerController.java
@@ -111,7 +111,7 @@
theme.resolveAttribute(R.attr.drawerListId, outValue, true)
? outValue.resourceId
: R.id.car_drawer_list);
- mDrawerList.setMaxPages(PagedListView.UNLIMITED_PAGES);
+ mDrawerList.setMaxPages(PagedListView.ItemCap.UNLIMITED);
View toolbar = drawerLayout.findViewById(
theme.resolveAttribute(R.attr.drawerToolbarId, outValue, true)
diff --git a/car/core/src/main/java/androidx/car/navigation/utils/Bundlable.java b/car/core/src/main/java/androidx/car/navigation/utils/Bundlable.java
index d8a2249..65e8bf2 100644
--- a/car/core/src/main/java/androidx/car/navigation/utils/Bundlable.java
+++ b/car/core/src/main/java/androidx/car/navigation/utils/Bundlable.java
@@ -16,7 +16,7 @@
package androidx.car.navigation.utils;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
@@ -85,7 +85,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface Bundlable {
/**
* Serializes this object into a {@link BundleMarshaller} by writing all its fields to it.
diff --git a/car/core/src/main/java/androidx/car/navigation/utils/BundleMarshaller.java b/car/core/src/main/java/androidx/car/navigation/utils/BundleMarshaller.java
index 99eb510..1e6178a 100644
--- a/car/core/src/main/java/androidx/car/navigation/utils/BundleMarshaller.java
+++ b/car/core/src/main/java/androidx/car/navigation/utils/BundleMarshaller.java
@@ -16,7 +16,7 @@
package androidx.car.navigation.utils;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
@@ -55,7 +55,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class BundleMarshaller {
/**
* Separator used to concatenate identifiers when marshalling non-primitive types (e.g. lists
diff --git a/car/core/src/main/java/androidx/car/util/CarUxRestrictionsUtils.java b/car/core/src/main/java/androidx/car/util/CarUxRestrictionsUtils.java
index da265ac..48f3992 100644
--- a/car/core/src/main/java/androidx/car/util/CarUxRestrictionsUtils.java
+++ b/car/core/src/main/java/androidx/car/util/CarUxRestrictionsUtils.java
@@ -16,7 +16,7 @@
package androidx.car.util;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.text.InputFilter;
@@ -34,7 +34,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class CarUxRestrictionsUtils {
private CarUxRestrictionsUtils() {};
diff --git a/car/core/src/main/java/androidx/car/util/DropShadowScrollListener.java b/car/core/src/main/java/androidx/car/util/DropShadowScrollListener.java
index 4d3a4fd..ec4ef2f 100644
--- a/car/core/src/main/java/androidx/car/util/DropShadowScrollListener.java
+++ b/car/core/src/main/java/androidx/car/util/DropShadowScrollListener.java
@@ -36,7 +36,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class DropShadowScrollListener extends PagedListView.OnScrollListener {
private static final String TAG = "DropShadowScrollListener";
private static final int ANIMATION_DURATION_MS = 100;
diff --git a/car/core/src/main/java/androidx/car/util/GridLayoutManagerUtils.java b/car/core/src/main/java/androidx/car/util/GridLayoutManagerUtils.java
index c28053c..79652cc 100644
--- a/car/core/src/main/java/androidx/car/util/GridLayoutManagerUtils.java
+++ b/car/core/src/main/java/androidx/car/util/GridLayoutManagerUtils.java
@@ -16,7 +16,7 @@
package androidx.car.util;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.View;
@@ -33,7 +33,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class GridLayoutManagerUtils {
private GridLayoutManagerUtils() {}
diff --git a/car/core/src/main/java/androidx/car/util/ListItemBackgroundResolver.java b/car/core/src/main/java/androidx/car/util/ListItemBackgroundResolver.java
index f26e034..068592b 100644
--- a/car/core/src/main/java/androidx/car/util/ListItemBackgroundResolver.java
+++ b/car/core/src/main/java/androidx/car/util/ListItemBackgroundResolver.java
@@ -16,7 +16,7 @@
package androidx.car.util;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.View;
@@ -30,7 +30,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ListItemBackgroundResolver {
private ListItemBackgroundResolver() {}
diff --git a/car/core/src/main/java/androidx/car/uxrestrictions/CarUxRestrictions.java b/car/core/src/main/java/androidx/car/uxrestrictions/CarUxRestrictions.java
index 8008597..a6a88d8 100644
--- a/car/core/src/main/java/androidx/car/uxrestrictions/CarUxRestrictions.java
+++ b/car/core/src/main/java/androidx/car/uxrestrictions/CarUxRestrictions.java
@@ -16,7 +16,7 @@
package androidx.car.uxrestrictions;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
@@ -146,7 +146,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef(flag = true,
value = {UX_RESTRICTIONS_BASELINE,
UX_RESTRICTIONS_NO_DIALPAD,
@@ -344,7 +344,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public CarUxRestrictions(android.car.drivingstate.CarUxRestrictions uxRestrictions) {
mTimestamp = uxRestrictions.getTimeStamp();
mIsDistractionOptimizationRequired = uxRestrictions.isRequiresDistractionOptimization();
diff --git a/car/core/src/main/java/androidx/car/widget/CarToolbar.java b/car/core/src/main/java/androidx/car/widget/CarToolbar.java
index 225f0f8..37723db 100644
--- a/car/core/src/main/java/androidx/car/widget/CarToolbar.java
+++ b/car/core/src/main/java/androidx/car/widget/CarToolbar.java
@@ -40,7 +40,6 @@
import androidx.annotation.Px;
import androidx.annotation.StringRes;
import androidx.annotation.StyleRes;
-import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.car.R;
@@ -77,10 +76,6 @@
*/
public class CarToolbar extends ViewGroup {
- // Max number of Action items displayed on the toolbar, only applies to IF_ROOM items.
- @VisibleForTesting
- static final int ACTION_ITEM_COUNT_LIMIT = 4;
-
private static final String TAG = "CarToolbar";
private final ImageButton mNavButtonView;
@@ -109,16 +104,8 @@
private List<CarMenuItem> mMenuItems;
@Nullable
private CarListDialog mOverflowDialog;
- private final List<InflatedMenuItem> mAllMenuItems = new ArrayList<>();
private final List<CarMenuItem> mOverflowMenuItems = new ArrayList<>();
- private final List<View> mToolbarItems = new ArrayList<>();
- // Number of items that are always displayed on the toolbar.
- private int mAlwaysItemCount;
-
- // Minimum width required to show a menu item as action item on the toolbar.
- // This var is used as threshold for showing if_room items, therefore its value is subject
- // to change - DO NOT depend on it.
- private final int mMinActionButtonWidth;
+ private final List<View> mActionViews = new ArrayList<>();
/**
* OnClickListener that handles the overflow dialog clicks by calling the appropriate
@@ -167,8 +154,6 @@
mSubtitleTextView = findViewById(R.id.subtitle);
mOverflowButtonView = findViewById(R.id.overflow_menu);
- mMinActionButtonWidth = res.getDimensionPixelOffset(R.dimen.car_button_min_width);
-
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CarToolbar, defStyleAttr,
/* defStyleRes= */ 0);
try {
@@ -249,31 +234,6 @@
width += navWidth + getHorizontalMargins(mNavButtonView);
}
- mToolbarItems.forEach(this::removeView);
- mToolbarItems.clear();
- mOverflowMenuItems.clear();
-
- // Measure items that will always be shown on the toolbar.
- int alwaysItemsWidth = measureAlwaysItems(width, widthMeasureSpec, childHeightMeasureSpec);
- width += alwaysItemsWidth;
-
- // Decide how many IF_ROOM items to show, and measure them.
- width += measureIfRoomItems(width, alwaysItemsWidth, widthMeasureSpec,
- childHeightMeasureSpec);
-
- // Split the items appropriately based on the display location.
- // Done post measurement to ensure the order in the two lists matches the passed-in items.
- for (InflatedMenuItem inflatedItem : mAllMenuItems) {
- if (inflatedItem.mIsDisplayedOnToolbar) {
- mToolbarItems.add(inflatedItem.mView);
- } else {
- mOverflowMenuItems.add(inflatedItem.mItem);
- }
- }
-
- // Show the overflow menu button if there are any overflow menu items.
- mOverflowButtonView.setVisibility(mOverflowMenuItems.isEmpty() ? GONE : VISIBLE);
-
if (mOverflowButtonView.getVisibility() != GONE) {
int measureSpec = MeasureSpec.makeMeasureSpec(mEdgeButtonIconSize, MeasureSpec.EXACTLY);
mOverflowButtonView.measure(measureSpec, measureSpec);
@@ -281,6 +241,11 @@
+ getHorizontalMargins(mOverflowButtonView);
}
+ for (View view : mActionViews) {
+ measureChild(view, widthMeasureSpec, width, childHeightMeasureSpec, 0);
+ width += view.getMeasuredWidth() + getHorizontalMargins(view);
+ }
+
if (mTitleIconView.getVisibility() != GONE) {
int measureSpec = MeasureSpec.makeMeasureSpec(mTitleIconSize, MeasureSpec.EXACTLY);
mTitleIconView.measure(measureSpec, measureSpec);
@@ -304,74 +269,6 @@
resolveSize(desiredHeight, heightMeasureSpec));
}
- /**
- * Measures ALWAYS menu items and adds them to the layout.
- *
- * @param widthUsed Total width used by other child views so far.
- * @param widthMeasureSpec Parent width measure spec.
- * @param heightMeasureSpec Parent height measure spec.
- * @return Total width occupied by ALWAYS items.
- */
- private int measureAlwaysItems(int widthUsed, int widthMeasureSpec, int heightMeasureSpec) {
- int width = 0;
- for (InflatedMenuItem inflatedItem : mAllMenuItems) {
- if (inflatedItem.mItem.getDisplayBehavior() == CarMenuItem.DisplayBehavior.ALWAYS) {
- View action = inflatedItem.mView;
- measureChild(action, widthMeasureSpec, widthUsed + width, heightMeasureSpec, 0);
- inflatedItem.mIsDisplayedOnToolbar = true;
- addView(action);
-
- width += action.getMeasuredWidth() + getHorizontalMargins(action);
- }
- }
- return width;
- }
-
- /**
- * Measures IF_ROOM menu items and adds them to the layout. Items past
- * {@link #ACTION_ITEM_COUNT_LIMIT} or half the toolbar width will not be measured/added.
- *
- * @param widthUsed Total width used by other child views so far.
- * @param alwaysItemsWidth Total width used by ALWAYS item views.
- * @param widthMeasureSpec Parent width measure spec.
- * @param heightMeasureSpec Parent height measure spec.
- * @return Total width occupied by IF_ROOM items.
- */
- private int measureIfRoomItems(int widthUsed, int alwaysItemsWidth,
- int widthMeasureSpec, int heightMeasureSpec) {
- int width = 0;
-
- // If mode is unspecified, all IF_ROOM items should be measured.
- boolean isWidthUnspecified =
- MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.UNSPECIFIED;
- // If specified, available width for IF_ROOM items. (50% of toolbar)
- int widthCapacity = (MeasureSpec.getSize(widthMeasureSpec) / 2) - alwaysItemsWidth;
- // Count of IF_ROOM items to be displayed on the toolbar.
- int allowedCount = ACTION_ITEM_COUNT_LIMIT - mAlwaysItemCount;
-
- for (InflatedMenuItem inflatedItem : mAllMenuItems) {
- if (allowedCount < 1
- || (!isWidthUnspecified && widthCapacity <= mMinActionButtonWidth)) {
- // Cannot show more IF_ROOM items because either max count is reached, or remaining
- // width is not sufficient.
- break;
- }
- if (inflatedItem.mItem.getDisplayBehavior() == CarMenuItem.DisplayBehavior.IF_ROOM) {
- View action = inflatedItem.mView;
- measureChild(action, widthMeasureSpec, widthUsed + width, heightMeasureSpec, 0);
- int viewWidth = action.getMeasuredWidth() + getHorizontalMargins(action);
- if (isWidthUnspecified || widthCapacity - viewWidth > 0) {
- allowedCount--;
- widthCapacity -= viewWidth;
- width += viewWidth;
- inflatedItem.mIsDisplayedOnToolbar = true;
- addView(action);
- }
- }
- }
- return width;
- }
-
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
int height = bottom - top;
@@ -397,7 +294,7 @@
mOverflowButtonView.getMeasuredWidth());
}
- for (View view : mToolbarItems) {
+ for (View view : mActionViews) {
layoutViewFromRightVerticallyCentered(view, right - layoutRight, height);
layoutRight += view.getMeasuredWidth();
}
@@ -666,32 +563,35 @@
public void setMenuItems(@Nullable List<CarMenuItem> items) {
mMenuItems = items;
- mAllMenuItems.clear();
- mAlwaysItemCount = 0;
+ mOverflowMenuItems.clear();
- if (mMenuItems == null) {
- requestLayout();
- return;
+ // Remove all old action views from the Layout then the list.
+ mActionViews.forEach(this::removeView);
+ mActionViews.clear();
+
+ List<CarMenuItem> actionItems = new ArrayList<>();
+
+ if (mMenuItems != null) {
+ for (CarMenuItem item : mMenuItems) {
+ if (item.getDisplayBehavior() == CarMenuItem.DisplayBehavior.ALWAYS) {
+ actionItems.add(item);
+ } else {
+ // Treat If-Room items as overflow until that behavior is supported.
+ mOverflowMenuItems.add(item);
+ }
+ }
}
- // Create Views for all ALWAYS and IF_ROOM items.
- for (CarMenuItem item : mMenuItems) {
- View action;
- switch (item.getDisplayBehavior()) {
- case ALWAYS:
- mAlwaysItemCount++;
- // Fall-through
- case IF_ROOM:
- action = item.isCheckable() ? createCheckableAction(item) : createAction(item);
- break;
- case NEVER:
- action = null;
- break;
- default:
- throw new IllegalStateException(
- "Unknown display behavior: " + item.getDisplayBehavior());
- }
- mAllMenuItems.add(new InflatedMenuItem(item, action));
+ // Show the overflow menu button if there are any overflow menu items.
+ mOverflowButtonView.setVisibility(mOverflowMenuItems.isEmpty() ? GONE : VISIBLE);
+
+ for (CarMenuItem item : actionItems) {
+ View action = item.isCheckable() ? createCheckableAction(item) : createAction(item);
+ MarginLayoutParams marginLayoutParams =
+ new MarginLayoutParams(LayoutParams.WRAP_CONTENT, mActionButtonHeight);
+ action.setLayoutParams(marginLayoutParams);
+ mActionViews.add(action);
+ addView(action);
}
requestLayout();
}
@@ -714,8 +614,6 @@
private Button createAction(CarMenuItem item) {
Context context = getContext();
Button button = new Button(context, null, 0, item.getStyleResId());
- button.setLayoutParams(
- new MarginLayoutParams(LayoutParams.WRAP_CONTENT, mActionButtonHeight));
CharSequence title = item.getTitle();
button.setText(title);
@@ -782,7 +680,7 @@
* Adds the overflow items to the overflow menu dialog.
*/
private void populateOverflowMenu() {
- if (mOverflowMenuItems.isEmpty()) {
+ if (mOverflowMenuItems == null || mOverflowMenuItems.isEmpty()) {
mOverflowDialog = null;
return;
}
@@ -940,20 +838,4 @@
lp.height);
child.measure(childWidthSpec, childHeightSpec);
}
-
- /**
- * Class that keeps track of a {@link CarMenuItem} and its inflated {@link View}.
- */
- private static class InflatedMenuItem {
- final CarMenuItem mItem;
- @Nullable
- final View mView;
- boolean mIsDisplayedOnToolbar;
-
- // |view| is Nullable since overflow items do not have a View associated with them.
- InflatedMenuItem(@NonNull CarMenuItem item, @Nullable View view) {
- mItem = item;
- mView = view;
- }
- }
}
diff --git a/car/core/src/main/java/androidx/car/widget/ListItemAdapter.java b/car/core/src/main/java/androidx/car/widget/ListItemAdapter.java
index 7c66826..bbc728b 100644
--- a/car/core/src/main/java/androidx/car/widget/ListItemAdapter.java
+++ b/car/core/src/main/java/androidx/car/widget/ListItemAdapter.java
@@ -101,7 +101,6 @@
static final int LIST_ITEM_TYPE_SUBHEADER = 3;
static final int LIST_ITEM_TYPE_ACTION = 4;
static final int LIST_ITEM_TYPE_RADIO = 5;
- static final int LIST_ITEM_TYPE_SWITCH = 6;
private final SparseIntArray mViewHolderLayoutResIds = new SparseIntArray();
@@ -143,8 +142,6 @@
R.layout.car_list_item_action_content, ActionListItem::createViewHolder);
registerListItemViewTypeInternal(LIST_ITEM_TYPE_RADIO,
R.layout.car_list_item_radio_content, RadioButtonListItem::createViewHolder);
- registerListItemViewTypeInternal(LIST_ITEM_TYPE_SWITCH,
- R.layout.car_list_item_switch_content, SwitchListItem::createViewHolder);
mUxRestrictionsHelper =
new CarUxRestrictionsHelper(context, carUxRestrictions -> {
diff --git a/car/core/src/main/java/androidx/car/widget/PagedListView.java b/car/core/src/main/java/androidx/car/widget/PagedListView.java
index f5c1a70..15590a4 100644
--- a/car/core/src/main/java/androidx/car/widget/PagedListView.java
+++ b/car/core/src/main/java/androidx/car/widget/PagedListView.java
@@ -74,6 +74,9 @@
*/
private static final String SAVED_RECYCLER_VIEW_STATE_KEY = "RecyclerViewState";
+ /** Default maximum number of clicks allowed on a list */
+ public static final int DEFAULT_MAX_CLICKS = 6;
+
/**
* Value to pass to {@link #setMaxPages(int)} to indicate there is no restriction on the
* maximum number of pages to show.
@@ -112,10 +115,13 @@
private RecyclerView.Adapter<? extends RecyclerView.ViewHolder> mAdapter;
/** Maximum number of pages to show. */
- private int mMaxPages = UNLIMITED_PAGES;
+ private int mMaxPages;
OnScrollListener mOnScrollListener;
+ /** Number of visible rows per page */
+ private int mDefaultMaxPages = DEFAULT_MAX_CLICKS;
+
/** Used to check if there are more items added to the list. */
private int mLastItemCount;
@@ -237,6 +243,8 @@
attrs, R.styleable.PagedListView, defStyleAttrs, defStyleRes);
mRecyclerView = findViewById(R.id.recycler_view);
+ mMaxPages = getDefaultMaxPages();
+
RecyclerView.LayoutManager layoutManager =
new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false);
mRecyclerView.setLayoutManager(layoutManager);
@@ -705,7 +713,7 @@
* page is defined as the number of items that fit completely on the screen at once.
*
* <p>Passing {@link #UNLIMITED_PAGES} will remove any restrictions on a maximum number
- * of pages. By default, there is no restriction on the number of pages.
+ * of pages.
*
* <p>Note that for any restriction on maximum pages to work, the adapter passed to this
* PagedListView needs to implement {@link ItemCap}.
@@ -738,6 +746,12 @@
return mRowsPerPage;
}
+ /** Resets the maximum number of pages to be shown to be the default. */
+ public void resetMaxPages() {
+ mMaxPages = getDefaultMaxPages();
+ updateMaxItems();
+ }
+
/**
* Adds an {@link RecyclerView.ItemDecoration} to this PagedListView.
*
@@ -961,6 +975,25 @@
mRecyclerView.smoothScrollBy(0, scrollDistance);
}
+ /**
+ * Sets the default number of pages that this PagedListView is limited to.
+ *
+ * @param newDefault The default number of pages. Should be positive.
+ */
+ public void setDefaultMaxPages(int newDefault) {
+ if (newDefault < 0) {
+ return;
+ }
+ mDefaultMaxPages = newDefault;
+ resetMaxPages();
+ }
+
+ /** Returns the default number of pages the list should have */
+ private int getDefaultMaxPages() {
+ // assume list shown in response to a click, so, reduce number of clicks by one
+ return mDefaultMaxPages - 1;
+ }
+
@Override
public void onLayout(boolean changed, int left, int top, int right, int bottom) {
// if a late item is added to the top of the layout after the layout is stabilized, causing
diff --git a/car/core/src/main/java/androidx/car/widget/PagedSmoothScroller.java b/car/core/src/main/java/androidx/car/widget/PagedSmoothScroller.java
index 2cfad2a..4d2f5ef 100644
--- a/car/core/src/main/java/androidx/car/widget/PagedSmoothScroller.java
+++ b/car/core/src/main/java/androidx/car/widget/PagedSmoothScroller.java
@@ -17,14 +17,13 @@
package androidx.car.widget;
import android.content.Context;
+import androidx.recyclerview.widget.LinearSmoothScroller;
+import androidx.recyclerview.widget.RecyclerView;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
-import androidx.recyclerview.widget.LinearSmoothScroller;
-import androidx.recyclerview.widget.RecyclerView;
-
/**
* Custom {@link LinearSmoothScroller} that has:
*
@@ -33,7 +32,7 @@
* <li>Scrolling that snaps to start of a child view.
* </ul>
*/
-final class PagedSmoothScroller extends LinearSmoothScroller {
+public final class PagedSmoothScroller extends LinearSmoothScroller {
private static final float MILLISECONDS_PER_INCH = 150f;
private static final float DECELERATION_TIME_DIVISOR = 0.45f;
diff --git a/car/core/src/main/java/androidx/car/widget/PagedSnapHelper.java b/car/core/src/main/java/androidx/car/widget/PagedSnapHelper.java
index ced97ca..d8b4b9f 100644
--- a/car/core/src/main/java/androidx/car/widget/PagedSnapHelper.java
+++ b/car/core/src/main/java/androidx/car/widget/PagedSnapHelper.java
@@ -37,7 +37,7 @@
* when it appears in the list. The snapping behavior will resume when the large view is scrolled
* off-screen.
*/
-class PagedSnapHelper extends LinearSnapHelper {
+public class PagedSnapHelper extends LinearSnapHelper {
/**
* The percentage of a View that needs to be completely visible for it to be a viable snap
* target.
diff --git a/car/core/src/main/java/androidx/car/widget/SwitchListItem.java b/car/core/src/main/java/androidx/car/widget/SwitchListItem.java
deleted file mode 100644
index d0ae858..0000000
--- a/car/core/src/main/java/androidx/car/widget/SwitchListItem.java
+++ /dev/null
@@ -1,671 +0,0 @@
-/*
- * Copyright 2019 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.car.widget;
-
-import static java.lang.annotation.RetentionPolicy.SOURCE;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.graphics.drawable.Icon;
-import android.os.Handler;
-import android.os.Looper;
-import android.text.TextUtils;
-import android.view.View;
-import android.view.ViewGroup.MarginLayoutParams;
-import android.widget.CompoundButton;
-import android.widget.ImageView;
-import android.widget.Switch;
-import android.widget.TextView;
-
-import androidx.annotation.CallSuper;
-import androidx.annotation.DimenRes;
-import androidx.annotation.Dimension;
-import androidx.annotation.IntDef;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.car.R;
-import androidx.car.util.CarUxRestrictionsUtils;
-import androidx.car.uxrestrictions.CarUxRestrictions;
-import androidx.constraintlayout.widget.ConstraintLayout;
-import androidx.constraintlayout.widget.Guideline;
-
-import java.lang.annotation.Retention;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Class to build a list item with {@link Switch}.
- *
- * <p>An item supports primary action and a switch as supplemental action.
- *
- * <p>An item visually composes of 3 parts; each part may contain multiple views.
- * <ul>
- * <li>{@code Primary Action}: represented by an icon of following types.
- * <ul>
- * <li>Primary Icon - icon size could be large or small.
- * <li>No Icon - no icon is shown.
- * <li>Empty Icon - {@code Text} offsets start space as if there was an icon.
- * </ul>
- * <li>{@code Text}: supports any combination of the following text views.
- * <ul>
- * <li>Title
- * <li>Body
- * </ul>
- * <li>{@code Supplemental Action}: represented by {@link Switch}.
- * </ul>
- *
- * <p>{@code SwitchListItem} binds data to {@link ViewHolder} based on components selected.
- *
- * <p>When conflicting setter methods are called (e.g. setting primary action to both primary icon
- * and no icon), the last called method wins.
- */
-public class SwitchListItem extends ListItem<SwitchListItem.ViewHolder> {
-
- @Retention(SOURCE)
- @IntDef({
- PRIMARY_ACTION_ICON_SIZE_SMALL, PRIMARY_ACTION_ICON_SIZE_MEDIUM,
- PRIMARY_ACTION_ICON_SIZE_LARGE})
- private @interface PrimaryActionIconSize {}
-
- /**
- * Small sized icon is the mostly commonly used size. It's the same as supplemental action icon.
- */
- public static final int PRIMARY_ACTION_ICON_SIZE_SMALL = 0;
- /**
- * Medium sized icon is slightly bigger than {@code SMALL} ones. It is intended for profile
- * pictures (avatar), in which case caller is responsible for passing in a circular image.
- */
- public static final int PRIMARY_ACTION_ICON_SIZE_MEDIUM = 1;
- /**
- * Large sized icon is as tall as a list item with only {@code title} text. It is intended for
- * album art.
- */
- public static final int PRIMARY_ACTION_ICON_SIZE_LARGE = 2;
-
- @Retention(SOURCE)
- @IntDef({
- PRIMARY_ACTION_TYPE_NO_ICON, PRIMARY_ACTION_TYPE_EMPTY_ICON,
- PRIMARY_ACTION_TYPE_ICON})
- private @interface PrimaryActionType {}
-
- private static final int PRIMARY_ACTION_TYPE_NO_ICON = 0;
- private static final int PRIMARY_ACTION_TYPE_EMPTY_ICON = 1;
- private static final int PRIMARY_ACTION_TYPE_ICON = 2;
-
- private final Context mContext;
- private boolean mIsEnabled = true;
- private boolean mIsClickable;
-
- private final List<ViewBinder<ViewHolder>> mBinders = new ArrayList<>();
-
- @PrimaryActionType private int mPrimaryActionType = PRIMARY_ACTION_TYPE_NO_ICON;
- private Icon mPrimaryActionIcon;
- @PrimaryActionIconSize private int mPrimaryActionIconSize = PRIMARY_ACTION_ICON_SIZE_SMALL;
-
- private CharSequence mTitle;
- private CharSequence mBody;
-
- @Dimension
- private final int mSupplementalGuidelineBegin;
-
- private boolean mSwitchChecked;
- /**
- * {@code true} if the checked state of the switch has changed programmatically and
- * {@link #mSwitchOnCheckedChangeListener} needs to be notified.
- */
- private boolean mShouldNotifySwitchChecked;
- private boolean mShowSwitchDivider;
- private CompoundButton.OnCheckedChangeListener mSwitchOnCheckedChangeListener;
-
- /**
- * Creates a {@link ViewHolder}.
- */
- @NonNull
- public static ViewHolder createViewHolder(View itemView) {
- return new ViewHolder(itemView);
- }
-
- public SwitchListItem(@NonNull Context context) {
- mContext = context;
- mSupplementalGuidelineBegin = mContext.getResources().getDimensionPixelSize(
- R.dimen.car_list_item_supplemental_guideline_top);
- markDirty();
- }
-
- /**
- * Used by {@link ListItemAdapter} to choose layout to inflate for view holder.
- */
- @Override
- public int getViewType() {
- return ListItemAdapter.LIST_ITEM_TYPE_SWITCH;
- }
-
- /**
- * Calculates the layout params for views in {@link ViewHolder}.
- */
- @Override
- @CallSuper
- protected void resolveDirtyState() {
- mBinders.clear();
-
- // Create binders that adjust layout params of each view.
- setPrimaryAction();
- setText();
- setSwitch();
- setItemClickable();
- }
-
- /**
- * Hides all views in {@link ViewHolder} then applies ViewBinders to adjust view layout params.
- */
- @Override
- public void onBind(ViewHolder viewHolder) {
- hideSubViews(viewHolder);
- for (ViewBinder binder : mBinders) {
- binder.bind(viewHolder);
- }
-
- for (View v : viewHolder.getWidgetViews()) {
- v.setEnabled(mIsEnabled);
- }
- // SwitchListItem supports clicking on the item so we also update the entire itemView.
- viewHolder.itemView.setEnabled(mIsEnabled);
- }
-
- @Override
- public void setEnabled(boolean enabled) {
- mIsEnabled = enabled;
- }
-
- /**
- * Sets whether the item is clickable. If {@code true}, clicking item toggles the switch.
- */
- public void setClickable(boolean isClickable) {
- mIsClickable = isClickable;
- markDirty();
- }
-
- /**
- * Sets {@code Primary Action} to be represented by an icon.
- *
- * @param icon An icon to set as primary action.
- * @param size small/medium/large. Available as {@link #PRIMARY_ACTION_ICON_SIZE_SMALL},
- * {@link #PRIMARY_ACTION_ICON_SIZE_MEDIUM},
- * {@link #PRIMARY_ACTION_ICON_SIZE_LARGE}.
- */
- public void setPrimaryActionIcon(@NonNull Icon icon, @PrimaryActionIconSize int size) {
- mPrimaryActionType = PRIMARY_ACTION_TYPE_ICON;
- mPrimaryActionIcon = icon;
- mPrimaryActionIconSize = size;
- markDirty();
- }
-
- /**
- * Sets {@code Primary Action} to be empty icon.
- *
- * <p>{@code Text} would have a start margin as if {@code Primary Action} were set to primary
- * icon.
- */
- public void setPrimaryActionEmptyIcon() {
- mPrimaryActionType = PRIMARY_ACTION_TYPE_EMPTY_ICON;
- markDirty();
- }
-
- /**
- * Sets {@code Primary Action} to have no icon. Text would align to the start of item.
- */
- public void setPrimaryActionNoIcon() {
- mPrimaryActionType = PRIMARY_ACTION_TYPE_NO_ICON;
- markDirty();
- }
-
- /**
- * Sets the title of item.
- *
- * <p>Primary text is {@code Title} by default. It can be set by
- * {@link #setBody(CharSequence)}
- *
- * <p>{@code Title} text is limited to one line, and ellipses at the end.
- *
- * @param title text to display as title.
- */
- public void setTitle(@Nullable CharSequence title) {
- mTitle = title;
- markDirty();
- }
-
- /**
- * Sets the body text of item.
- *
- * <p>Text beyond length required by regulation will be truncated.
- *
- * @param body text to be displayed.
- */
- public void setBody(@Nullable CharSequence body) {
- mBody = body;
- markDirty();
- }
-
- /**
- * Sets the state of {@code Switch}.
- *
- * @param isChecked sets the "checked/unchecked, namely on/off" state of switch.
- */
- public void setSwitchState(boolean isChecked) {
- if (mSwitchChecked == isChecked) {
- return;
- }
- mSwitchChecked = isChecked;
- mShouldNotifySwitchChecked = true;
- markDirty();
- }
-
- /**
- * Registers a callback to be invoked when the checked state of switch changes.
- *
- * @param listener callback to be invoked when the checked state shown in the UI changes.
- */
- public void setSwitchOnCheckedChangeListener(
- @Nullable CompoundButton.OnCheckedChangeListener listener) {
- mSwitchOnCheckedChangeListener = listener;
- // This method invalidates previous listener. Reset so that we *only*
- // notify when the checked state changes and not on the initial bind.
- mShouldNotifySwitchChecked = false;
- markDirty();
- }
-
- /**
- * Sets whether to display a vertical bar between switch and text.
- */
- public void setShowSwitchDivider(boolean showSwitchDivider) {
- mShowSwitchDivider = showSwitchDivider;
- markDirty();
- }
-
- @NonNull
- protected final Context getContext() {
- return mContext;
- }
-
- private void hideSubViews(ViewHolder vh) {
- for (View v : vh.getWidgetViews()) {
- v.setVisibility(View.GONE);
- }
- }
-
- private void setPrimaryAction() {
- setPrimaryIconContent();
- setPrimaryIconLayout();
- }
-
- private void setText() {
- setTextContent();
- setTextVerticalMargin();
- setTextStartMargin();
- setTextEndMargin();
- }
-
- private void setPrimaryIconContent() {
- switch (mPrimaryActionType) {
- case PRIMARY_ACTION_TYPE_ICON:
- mBinders.add(vh -> {
- vh.getPrimaryIcon().setVisibility(View.VISIBLE);
- mPrimaryActionIcon.loadDrawableAsync(getContext(),
- drawable -> vh.getPrimaryIcon().setImageDrawable(drawable),
- new Handler(Looper.getMainLooper()));
- });
- break;
- case PRIMARY_ACTION_TYPE_EMPTY_ICON:
- case PRIMARY_ACTION_TYPE_NO_ICON:
- // Do nothing.
- break;
- default:
- throw new IllegalStateException("Unknown primary action type.");
- }
- }
-
- /**
- * Sets the size, start margin, and vertical position of primary icon.
- *
- * <p>Large icon will have no start margin, and always align center vertically.
- *
- * <p>Small/medium icon will have start margin, and uses a top margin such that it is "pinned"
- * at the same position in list item regardless of item height.
- */
- private void setPrimaryIconLayout() {
- if (mPrimaryActionType == PRIMARY_ACTION_TYPE_EMPTY_ICON
- || mPrimaryActionType == PRIMARY_ACTION_TYPE_NO_ICON) {
- return;
- }
-
- // Size of icon.
- @DimenRes int sizeResId;
- switch (mPrimaryActionIconSize) {
- case PRIMARY_ACTION_ICON_SIZE_SMALL:
- sizeResId = R.dimen.car_primary_icon_size;
- break;
- case PRIMARY_ACTION_ICON_SIZE_MEDIUM:
- sizeResId = R.dimen.car_avatar_icon_size;
- break;
- case PRIMARY_ACTION_ICON_SIZE_LARGE:
- sizeResId = R.dimen.car_single_line_list_item_height;
- break;
- default:
- throw new IllegalStateException("Unknown primary action icon size.");
- }
-
- int iconSize = mContext.getResources().getDimensionPixelSize(sizeResId);
-
- // Start margin of icon.
- int startMargin;
- switch (mPrimaryActionIconSize) {
- case PRIMARY_ACTION_ICON_SIZE_SMALL:
- case PRIMARY_ACTION_ICON_SIZE_MEDIUM:
- startMargin = mContext.getResources().getDimensionPixelSize(R.dimen.car_keyline_1);
- break;
- case PRIMARY_ACTION_ICON_SIZE_LARGE:
- startMargin = 0;
- break;
- default:
- throw new IllegalStateException("Unknown primary action icon size.");
- }
-
- mBinders.add(vh -> {
- ConstraintLayout.LayoutParams layoutParams =
- (ConstraintLayout.LayoutParams) vh.getPrimaryIcon().getLayoutParams();
- layoutParams.height = layoutParams.width = iconSize;
- layoutParams.setMarginStart(startMargin);
-
- if (mPrimaryActionIconSize == PRIMARY_ACTION_ICON_SIZE_LARGE) {
- // A large icon is always vertically centered.
- layoutParams.verticalBias = 0.5f;
- layoutParams.topMargin = 0;
- } else {
- // Align the icon to the top of the parent. This allows the topMargin to shift it
- // down relative to the top.
- layoutParams.verticalBias = 0f;
-
- // For all other icon sizes, the icon should be centered within the height of
- // car_double_line_list_item_height. Note: the actual height of the item can be
- // larger than this.
- int itemHeight = mContext.getResources().getDimensionPixelSize(
- R.dimen.car_double_line_list_item_height);
- layoutParams.topMargin = (itemHeight - iconSize) / 2;
- }
-
- vh.getPrimaryIcon().requestLayout();
- });
- }
-
- private void setTextContent() {
- boolean hasTitle = !TextUtils.isEmpty(mTitle);
- boolean hasBody = !TextUtils.isEmpty(mBody);
-
- if (!hasTitle && !hasBody) {
- return;
- }
-
- mBinders.add(vh -> {
- if (hasTitle) {
- vh.getTitle().setVisibility(View.VISIBLE);
- vh.getTitle().setText(mTitle);
- }
-
- if (hasBody) {
- vh.getBody().setVisibility(View.VISIBLE);
- vh.getBody().setText(mBody);
- }
-
- if (hasTitle && !hasBody) {
- // If only title, then center the supplemental actions.
- vh.getSupplementalGuideline().setGuidelineBegin(
- ConstraintLayout.LayoutParams.UNSET);
- vh.getSupplementalGuideline().setGuidelinePercent(0.5f);
- } else {
- // Otherwise, position it a fixed distance from the top.
- vh.getSupplementalGuideline().setGuidelinePercent(
- ConstraintLayout.LayoutParams.UNSET);
- vh.getSupplementalGuideline().setGuidelineBegin(
- mSupplementalGuidelineBegin);
- }
- });
- }
-
- /**
- * Sets start margin of text view depending on icon type.
- */
- private void setTextStartMargin() {
- @DimenRes int startMarginResId;
- switch (mPrimaryActionType) {
- case PRIMARY_ACTION_TYPE_NO_ICON:
- startMarginResId = R.dimen.car_keyline_1;
- break;
- case PRIMARY_ACTION_TYPE_EMPTY_ICON:
- startMarginResId = R.dimen.car_keyline_3;
- break;
- case PRIMARY_ACTION_TYPE_ICON:
- startMarginResId = mPrimaryActionIconSize == PRIMARY_ACTION_ICON_SIZE_LARGE
- ? R.dimen.car_keyline_4
- : R.dimen.car_keyline_3; // Small and medium sized icon.
- break;
- default:
- throw new IllegalStateException("Unknown primary action type.");
- }
- int startMargin = mContext.getResources().getDimensionPixelSize(startMarginResId);
- mBinders.add(vh -> {
- MarginLayoutParams titleLayoutParams =
- (MarginLayoutParams) vh.getTitle().getLayoutParams();
- titleLayoutParams.setMarginStart(startMargin);
- vh.getTitle().requestLayout();
-
- MarginLayoutParams bodyLayoutParams =
- (MarginLayoutParams) vh.getBody().getLayoutParams();
- bodyLayoutParams.setMarginStart(startMargin);
- vh.getBody().requestLayout();
- });
- }
-
- private void setTextEndMargin() {
- int endMargin = mContext.getResources().getDimensionPixelSize(R.dimen.car_padding_4);
-
- mBinders.add(vh -> {
- MarginLayoutParams titleLayoutParams =
- (MarginLayoutParams) vh.getTitle().getLayoutParams();
- titleLayoutParams.setMarginEnd(endMargin);
-
- MarginLayoutParams bodyLayoutParams =
- (MarginLayoutParams) vh.getBody().getLayoutParams();
- bodyLayoutParams.setMarginEnd(endMargin);
- });
- }
-
- /**
- * Sets top/bottom margins of {@code Title} and {@code Body}.
- */
- private void setTextVerticalMargin() {
- // Set all relevant fields in layout params to avoid carried over params when the item
- // gets bound to a recycled view holder.
- if (!TextUtils.isEmpty(mTitle) && TextUtils.isEmpty(mBody)) {
- // Title only - view is aligned center vertically by itself.
- mBinders.add(vh -> {
- MarginLayoutParams layoutParams =
- (MarginLayoutParams) vh.getTitle().getLayoutParams();
- layoutParams.topMargin = 0;
- vh.getTitle().requestLayout();
- });
- } else if (TextUtils.isEmpty(mTitle) && !TextUtils.isEmpty(mBody)) {
- mBinders.add(vh -> {
- // Body uses top and bottom margin.
- int margin = mContext.getResources().getDimensionPixelSize(
- R.dimen.car_padding_3);
- MarginLayoutParams layoutParams =
- (MarginLayoutParams) vh.getBody().getLayoutParams();
- layoutParams.topMargin = margin;
- layoutParams.bottomMargin = margin;
- vh.getBody().requestLayout();
- });
- } else {
- mBinders.add(vh -> {
- Resources resources = mContext.getResources();
- int padding2 = resources.getDimensionPixelSize(R.dimen.car_padding_2);
-
- // Title has a top margin
- MarginLayoutParams titleLayoutParams =
- (MarginLayoutParams) vh.getTitle().getLayoutParams();
- titleLayoutParams.topMargin = padding2;
- vh.getTitle().requestLayout();
-
- // Body is below title with no margin and has bottom margin.
- MarginLayoutParams bodyLayoutParams =
- (MarginLayoutParams) vh.getBody().getLayoutParams();
- bodyLayoutParams.topMargin = 0;
- bodyLayoutParams.bottomMargin = padding2;
- vh.getBody().requestLayout();
- });
- }
- }
-
- /**
- * Sets up view(s) for supplemental action.
- */
- private void setSwitch() {
- mBinders.add(vh -> {
- vh.getSwitch().setVisibility(View.VISIBLE);
- vh.getSwitch().setOnCheckedChangeListener(null);
- vh.getSwitch().setChecked(mSwitchChecked);
- vh.getSwitch().setOnCheckedChangeListener((buttonView, isChecked) -> {
- if (mSwitchOnCheckedChangeListener != null) {
- // The checked state changed via user interaction with the switch.
- mSwitchOnCheckedChangeListener.onCheckedChanged(buttonView, isChecked);
- }
- mSwitchChecked = isChecked;
- });
- if (mShouldNotifySwitchChecked && mSwitchOnCheckedChangeListener != null) {
- // The checked state was changed programmatically.
- mSwitchOnCheckedChangeListener.onCheckedChanged(vh.getSwitch(),
- mSwitchChecked);
- mShouldNotifySwitchChecked = false;
- }
-
- if (mShowSwitchDivider) {
- vh.getSwitchDivider().setVisibility(View.VISIBLE);
- }
- });
- }
-
- private void setItemClickable() {
- mBinders.add(vh -> {
- // If applicable (namely item is clickable), clicking item always toggles the switch.
- vh.itemView.setOnClickListener(v -> vh.getSwitch().toggle());
- vh.itemView.setClickable(mIsClickable);
- });
- }
-
- /**
- * Holds views of SwitchListItem.
- */
- public static final class ViewHolder extends ListItem.ViewHolder {
-
- private final View[] mWidgetViews;
-
- private ImageView mPrimaryIcon;
-
- private TextView mTitle;
- private TextView mBody;
-
- private Guideline mSupplementalGuideline;
-
- private Switch mSwitch;
- private View mSwitchDivider;
-
- /**
- * ViewHolder that contains necessary widgets for {@link SwitchListItem}.
- */
- public ViewHolder(@NonNull View itemView) {
- super(itemView);
-
- mPrimaryIcon = itemView.findViewById(R.id.primary_icon);
-
- mTitle = itemView.findViewById(R.id.title);
- mBody = itemView.findViewById(R.id.body);
-
- mSupplementalGuideline = itemView.findViewById(R.id.supplemental_actions_guideline);
-
- mSwitch = itemView.findViewById(R.id.switch_widget);
- mSwitchDivider = itemView.findViewById(R.id.switch_divider);
-
- int minTouchSize = itemView.getContext().getResources()
- .getDimensionPixelSize(R.dimen.car_touch_target_size);
- MinTouchTargetHelper.ensureThat(mSwitch).hasMinTouchSize(minTouchSize);
-
- // Each line groups relevant child views in an effort to help keep this view array
- // updated with actual child views in the ViewHolder.
- mWidgetViews = new View[] {
- mPrimaryIcon,
- mTitle, mBody,
- mSwitch, mSwitchDivider,
- };
- }
-
- /**
- * Updates child views with current car UX restrictions.
- *
- * <p>{@code Text} might be truncated to meet length limit required by regulation.
- *
- * @param restrictionsInfo current car UX restrictions.
- */
- @Override
- public void onUxRestrictionsChanged(CarUxRestrictions restrictionsInfo) {
- CarUxRestrictionsUtils.apply(itemView.getContext(), restrictionsInfo, getBody());
- }
-
- @NonNull
- public ImageView getPrimaryIcon() {
- return mPrimaryIcon;
- }
-
- @NonNull
- public TextView getTitle() {
- return mTitle;
- }
-
- @NonNull
- public TextView getBody() {
- return mBody;
- }
-
- @NonNull
- public View getSwitchDivider() {
- return mSwitchDivider;
- }
-
- @NonNull
- public Switch getSwitch() {
- return mSwitch;
- }
-
- @NonNull
- Guideline getSupplementalGuideline() {
- return mSupplementalGuideline;
- }
-
- @NonNull
- View[] getWidgetViews() {
- return mWidgetViews;
- }
- }
-}
diff --git a/car/core/src/main/java/androidx/car/widget/TextListItem.java b/car/core/src/main/java/androidx/car/widget/TextListItem.java
index 1b35a1e..1702fbf 100644
--- a/car/core/src/main/java/androidx/car/widget/TextListItem.java
+++ b/car/core/src/main/java/androidx/car/widget/TextListItem.java
@@ -663,6 +663,7 @@
markDirty();
}
+
/**
* Sets {@code Supplemental Action} to be represented by an {@code Supplemental Icon}.
*
@@ -737,10 +738,7 @@
* @param checked initial value for switched.
* @param showDivider whether to display a vertical bar between switch and text.
* @param listener callback to be invoked when the checked state shown in the UI changes.
- *
- * @deprecated Use {@link SwitchListItem} instead.
*/
- @Deprecated
public void setSwitch(boolean checked, boolean showDivider,
CompoundButton.OnCheckedChangeListener listener) {
mSupplementalActionType = SUPPLEMENTAL_ACTION_SWITCH;
@@ -761,10 +759,7 @@
* first to set {@code Supplemental Action} as a {@code Switch}.
*
* @param isChecked sets the "checked/unchecked, namely on/off" state of switch.
- *
- * @deprecated Use {@link SwitchListItem} instead.
*/
- @Deprecated
public void setSwitchState(boolean isChecked) {
if (mSwitchChecked == isChecked) {
return;
diff --git a/car/core/src/main/java/androidx/car/widget/itemdecorators/BottomOffsetDecoration.java b/car/core/src/main/java/androidx/car/widget/itemdecorators/BottomOffsetDecoration.java
index 407835a..81b8dbb 100644
--- a/car/core/src/main/java/androidx/car/widget/itemdecorators/BottomOffsetDecoration.java
+++ b/car/core/src/main/java/androidx/car/widget/itemdecorators/BottomOffsetDecoration.java
@@ -16,7 +16,7 @@
package androidx.car.widget.itemdecorators;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Rect;
import android.view.View;
@@ -32,7 +32,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class BottomOffsetDecoration extends RecyclerView.ItemDecoration {
private int mBottomOffset;
diff --git a/car/core/src/main/java/androidx/car/widget/itemdecorators/DividerDecoration.java b/car/core/src/main/java/androidx/car/widget/itemdecorators/DividerDecoration.java
index 705fded..7a971ad 100644
--- a/car/core/src/main/java/androidx/car/widget/itemdecorators/DividerDecoration.java
+++ b/car/core/src/main/java/androidx/car/widget/itemdecorators/DividerDecoration.java
@@ -16,7 +16,7 @@
package androidx.car.widget.itemdecorators;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Canvas;
@@ -39,7 +39,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class DividerDecoration extends RecyclerView.ItemDecoration {
public static final int INVALID_RESOURCE_ID = -1;
diff --git a/car/core/src/main/java/androidx/car/widget/itemdecorators/ItemSpacingDecoration.java b/car/core/src/main/java/androidx/car/widget/itemdecorators/ItemSpacingDecoration.java
index aa1b10d..5c35395 100644
--- a/car/core/src/main/java/androidx/car/widget/itemdecorators/ItemSpacingDecoration.java
+++ b/car/core/src/main/java/androidx/car/widget/itemdecorators/ItemSpacingDecoration.java
@@ -16,7 +16,7 @@
package androidx.car.widget.itemdecorators;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Rect;
import android.view.View;
@@ -31,7 +31,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ItemSpacingDecoration extends RecyclerView.ItemDecoration {
private int mItemSpacing;
diff --git a/car/core/src/main/java/androidx/car/widget/itemdecorators/TopOffsetDecoration.java b/car/core/src/main/java/androidx/car/widget/itemdecorators/TopOffsetDecoration.java
index 35805fc..0e49957 100644
--- a/car/core/src/main/java/androidx/car/widget/itemdecorators/TopOffsetDecoration.java
+++ b/car/core/src/main/java/androidx/car/widget/itemdecorators/TopOffsetDecoration.java
@@ -16,7 +16,7 @@
package androidx.car.widget.itemdecorators;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Rect;
import android.view.View;
@@ -32,7 +32,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class TopOffsetDecoration extends RecyclerView.ItemDecoration {
private int mTopOffset;
diff --git a/car/core/src/main/res/layout/car_tab_view.xml b/car/core/src/main/res/layout/car_tab_view.xml
deleted file mode 100644
index edf57cd..0000000
--- a/car/core/src/main/res/layout/car_tab_view.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-<!-- A custom view meant to be used in a TabLayout. This tab's icon and text are light-colored for
- adding on top of a dark background. -->
-<RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/car_tab"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:minWidth="@dimen/car_tab_min_width">
-
- <!-- Need to use android:id/icon because TabLayout looks for this. -->
- <ImageView
- android:id="@android:id/icon"
- android:scaleType="fitCenter"
- android:layout_width="@dimen/car_secondary_icon_size"
- android:layout_height="@dimen/car_secondary_icon_size"
- android:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:tint="@color/car_tab_tint" />
-
- <!-- Need to use android:id/text1 because TabLayout looks for this. -->
- <TextView
- android:id="@android:id/text1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/car_padding_0"
- android:layout_below="@android:id/icon"
- android:layout_centerHorizontal="true"
- android:maxLines="1"
- android:textColor="@color/car_tab_tint"
- android:textAppearance="@style/TextAppearance.Car.Body4.Medium.Light" />
-</RelativeLayout>
diff --git a/car/moderator/api/1.0.0-alpha1.txt b/car/moderator/api/1.0.0-alpha1.txt
index 4c31efc..4ba262d 100644
--- a/car/moderator/api/1.0.0-alpha1.txt
+++ b/car/moderator/api/1.0.0-alpha1.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.car.moderator {
public class SpeedBumpView extends android.widget.FrameLayout {
diff --git a/car/moderator/api/current.txt b/car/moderator/api/current.txt
index 4c31efc..4ba262d 100644
--- a/car/moderator/api/current.txt
+++ b/car/moderator/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.car.moderator {
public class SpeedBumpView extends android.widget.FrameLayout {
diff --git a/car/moderator/api/restricted_1.0.0-alpha1.txt b/car/moderator/api/restricted_1.0.0-alpha1.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/car/moderator/api/restricted_1.0.0-alpha1.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/car/moderator/api/restricted_current.txt b/car/moderator/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/car/moderator/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/car/moderator/res/values-as/strings.xml b/car/moderator/res/values-as/strings.xml
deleted file mode 100644
index ad8b096..0000000
--- a/car/moderator/res/values-as/strings.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 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.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="speed_bump_lockout_message" msgid="5540717186175632753">"গাড়ী চলোৱাত ধ্যান দিয়ক"</string>
-</resources>
diff --git a/cardview/api/1.0.0.txt b/cardview/api/1.0.0.txt
index 49fbb11..0882be1 100644
--- a/cardview/api/1.0.0.txt
+++ b/cardview/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.cardview.widget {
public class CardView extends android.widget.FrameLayout {
diff --git a/cardview/api/1.1.0-alpha01.txt b/cardview/api/1.1.0-alpha01.txt
deleted file mode 100644
index 49fbb11..0000000
--- a/cardview/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-// Signature format: 3.0
-package androidx.cardview.widget {
-
- public class CardView extends android.widget.FrameLayout {
- ctor public CardView(android.content.Context);
- ctor public CardView(android.content.Context, android.util.AttributeSet?);
- ctor public CardView(android.content.Context, android.util.AttributeSet?, int);
- method public android.content.res.ColorStateList getCardBackgroundColor();
- method public float getCardElevation();
- method @Px public int getContentPaddingBottom();
- method @Px public int getContentPaddingLeft();
- method @Px public int getContentPaddingRight();
- method @Px public int getContentPaddingTop();
- method public float getMaxCardElevation();
- method public boolean getPreventCornerOverlap();
- method public float getRadius();
- method public boolean getUseCompatPadding();
- method public void setCardBackgroundColor(@ColorInt int);
- method public void setCardBackgroundColor(android.content.res.ColorStateList?);
- method public void setCardElevation(float);
- method public void setContentPadding(@Px int, @Px int, @Px int, @Px int);
- method public void setMaxCardElevation(float);
- method public void setPreventCornerOverlap(boolean);
- method public void setRadius(float);
- method public void setUseCompatPadding(boolean);
- }
-
-}
-
diff --git a/cardview/api/current.txt b/cardview/api/current.txt
index 49fbb11..0882be1 100644
--- a/cardview/api/current.txt
+++ b/cardview/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.cardview.widget {
public class CardView extends android.widget.FrameLayout {
diff --git a/cardview/api/res-1.1.0-alpha01.txt b/cardview/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/cardview/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/cardview/api/restricted_1.0.0.txt b/cardview/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/cardview/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/cardview/api/restricted_1.1.0-alpha01.txt b/cardview/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/cardview/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/cardview/api/restricted_current.txt b/cardview/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/cardview/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/collection/api/1.0.0.txt b/collection/api/1.0.0.txt
index e849a29..36e7843 100644
--- a/collection/api/1.0.0.txt
+++ b/collection/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.collection {
public class ArrayMap<K, V> extends androidx.collection.SimpleArrayMap<K,V> implements java.util.Map<K,V> {
diff --git a/collection/api/1.1.0-alpha01.txt b/collection/api/1.1.0-alpha01.txt
index 5724c87..81bb5ce 100644
--- a/collection/api/1.1.0-alpha01.txt
+++ b/collection/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.collection {
public class ArrayMap<K, V> extends androidx.collection.SimpleArrayMap<K,V> implements java.util.Map<K,V> {
diff --git a/collection/api/1.1.0-alpha02.txt b/collection/api/1.1.0-alpha02.txt
index 179d17f..084fe60 100644
--- a/collection/api/1.1.0-alpha02.txt
+++ b/collection/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.collection {
public class ArrayMap<K, V> extends androidx.collection.SimpleArrayMap<K,V> implements java.util.Map<K,V> {
diff --git a/collection/api/1.1.0-alpha03.txt b/collection/api/1.1.0-alpha03.txt
deleted file mode 100644
index 179d17f..0000000
--- a/collection/api/1.1.0-alpha03.txt
+++ /dev/null
@@ -1,183 +0,0 @@
-// Signature format: 3.0
-package androidx.collection {
-
- public class ArrayMap<K, V> extends androidx.collection.SimpleArrayMap<K,V> implements java.util.Map<K,V> {
- ctor public ArrayMap();
- ctor public ArrayMap(int);
- ctor public ArrayMap(androidx.collection.SimpleArrayMap!);
- method public boolean containsAll(java.util.Collection<?>);
- method public java.util.Set<java.util.Map.Entry<K,V>>! entrySet();
- method public java.util.Set<K>! keySet();
- method public void putAll(java.util.Map<? extends K,? extends V>!);
- method public boolean removeAll(java.util.Collection<?>);
- method public boolean retainAll(java.util.Collection<?>);
- method public java.util.Collection<V>! values();
- }
-
- public final class ArraySet<E> implements java.util.Collection<E> java.util.Set<E> {
- ctor public ArraySet();
- ctor public ArraySet(int);
- ctor public ArraySet(androidx.collection.ArraySet<E>?);
- ctor public ArraySet(java.util.Collection<E>?);
- method public boolean add(E?);
- method public void addAll(androidx.collection.ArraySet<? extends E>);
- method public boolean addAll(java.util.Collection<? extends E>);
- method public void clear();
- method public boolean contains(Object?);
- method public boolean containsAll(java.util.Collection<?>);
- method public void ensureCapacity(int);
- method public int indexOf(Object?);
- method public boolean isEmpty();
- method public java.util.Iterator<E>! iterator();
- method public boolean remove(Object?);
- method public boolean removeAll(androidx.collection.ArraySet<? extends E>);
- method public boolean removeAll(java.util.Collection<?>);
- method public E! removeAt(int);
- method public boolean retainAll(java.util.Collection<?>);
- method public int size();
- method public Object[] toArray();
- method public <T> T[] toArray(T[]);
- method public E? valueAt(int);
- }
-
- public final class CircularArray<E> {
- ctor public CircularArray();
- ctor public CircularArray(int);
- method public void addFirst(E!);
- method public void addLast(E!);
- method public void clear();
- method public E! get(int);
- method public E! getFirst();
- method public E! getLast();
- method public boolean isEmpty();
- method public E! popFirst();
- method public E! popLast();
- method public void removeFromEnd(int);
- method public void removeFromStart(int);
- method public int size();
- }
-
- public final class CircularIntArray {
- ctor public CircularIntArray();
- ctor public CircularIntArray(int);
- method public void addFirst(int);
- method public void addLast(int);
- method public void clear();
- method public int get(int);
- method public int getFirst();
- method public int getLast();
- method public boolean isEmpty();
- method public int popFirst();
- method public int popLast();
- method public void removeFromEnd(int);
- method public void removeFromStart(int);
- method public int size();
- }
-
- public class LongSparseArray<E> implements java.lang.Cloneable {
- ctor public LongSparseArray();
- ctor public LongSparseArray(int);
- method public void append(long, E!);
- method public void clear();
- method public androidx.collection.LongSparseArray<E>! clone();
- method public boolean containsKey(long);
- method public boolean containsValue(E!);
- method @Deprecated public void delete(long);
- method public E? get(long);
- method public E! get(long, E!);
- method public int indexOfKey(long);
- method public int indexOfValue(E!);
- method public boolean isEmpty();
- method public long keyAt(int);
- method public void put(long, E!);
- method public void putAll(androidx.collection.LongSparseArray<? extends E>);
- method public E? putIfAbsent(long, E!);
- method public void remove(long);
- method public boolean remove(long, Object!);
- method public void removeAt(int);
- method public E? replace(long, E!);
- method public boolean replace(long, E!, E!);
- method public void setValueAt(int, E!);
- method public int size();
- method public E! valueAt(int);
- }
-
- public class LruCache<K, V> {
- ctor public LruCache(int);
- method protected V? create(K);
- method public final int createCount();
- method protected void entryRemoved(boolean, K, V, V?);
- method public final void evictAll();
- method public final int evictionCount();
- method public final V? get(K);
- method public final int hitCount();
- method public final int maxSize();
- method public final int missCount();
- method public final V? put(K, V);
- method public final int putCount();
- method public final V? remove(K);
- method public void resize(int);
- method public final int size();
- method protected int sizeOf(K, V);
- method public final java.util.Map<K,V>! snapshot();
- method public final String toString();
- method public void trimToSize(int);
- }
-
- public class SimpleArrayMap<K, V> {
- ctor public SimpleArrayMap();
- ctor public SimpleArrayMap(int);
- ctor public SimpleArrayMap(androidx.collection.SimpleArrayMap<K,V>!);
- method public void clear();
- method public boolean containsKey(Object?);
- method public boolean containsValue(Object!);
- method public void ensureCapacity(int);
- method public V? get(Object!);
- method public V! getOrDefault(Object!, V!);
- method public int indexOfKey(Object?);
- method public boolean isEmpty();
- method public K! keyAt(int);
- method public V? put(K!, V!);
- method public void putAll(androidx.collection.SimpleArrayMap<? extends K,? extends V>);
- method public V? putIfAbsent(K!, V!);
- method public V? remove(Object!);
- method public boolean remove(Object!, Object!);
- method public V! removeAt(int);
- method public V? replace(K!, V!);
- method public boolean replace(K!, V!, V!);
- method public V! setValueAt(int, V!);
- method public int size();
- method public V! valueAt(int);
- }
-
- public class SparseArrayCompat<E> implements java.lang.Cloneable {
- ctor public SparseArrayCompat();
- ctor public SparseArrayCompat(int);
- method public void append(int, E!);
- method public void clear();
- method public androidx.collection.SparseArrayCompat<E>! clone();
- method public boolean containsKey(int);
- method public boolean containsValue(E!);
- method @Deprecated public void delete(int);
- method public E? get(int);
- method public E! get(int, E!);
- method public int indexOfKey(int);
- method public int indexOfValue(E!);
- method public boolean isEmpty();
- method public int keyAt(int);
- method public void put(int, E!);
- method public void putAll(androidx.collection.SparseArrayCompat<? extends E>);
- method public E? putIfAbsent(int, E!);
- method public void remove(int);
- method public boolean remove(int, Object!);
- method public void removeAt(int);
- method public void removeAtRange(int, int);
- method public E? replace(int, E!);
- method public boolean replace(int, E!, E!);
- method public void setValueAt(int, E!);
- method public int size();
- method public E! valueAt(int);
- }
-
-}
-
diff --git a/collection/api/current.txt b/collection/api/current.txt
index 179d17f..084fe60 100644
--- a/collection/api/current.txt
+++ b/collection/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.collection {
public class ArrayMap<K, V> extends androidx.collection.SimpleArrayMap<K,V> implements java.util.Map<K,V> {
diff --git a/collection/api/restricted_1.0.0.txt b/collection/api/restricted_1.0.0.txt
deleted file mode 100644
index 060f224..0000000
--- a/collection/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.collection {
-
- public final class ArraySet<E> {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void append(E!);
- }
-
-}
-
diff --git a/collection/api/restricted_1.1.0-alpha03.txt b/collection/api/restricted_1.1.0-alpha03.txt
deleted file mode 100644
index 7345795..0000000
--- a/collection/api/restricted_1.1.0-alpha03.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.collection {
-
- public final class ArraySet<E> implements java.util.Collection<E> java.util.Set<E> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void append(E!);
- }
-
-}
-
diff --git a/collection/api/restricted_current.txt b/collection/api/restricted_current.txt
deleted file mode 100644
index 7345795..0000000
--- a/collection/api/restricted_current.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.collection {
-
- public final class ArraySet<E> implements java.util.Collection<E> java.util.Set<E> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void append(E!);
- }
-
-}
-
diff --git a/collection/build.gradle b/collection/build.gradle
index 11fac32..4bc2d3a 100644
--- a/collection/build.gradle
+++ b/collection/build.gradle
@@ -23,7 +23,7 @@
}
dependencies {
- compile(project(":annotation"))
+ compile("androidx.annotation:annotation:1.0.0")
annotationProcessor(NULLAWAY)
testCompile(JUNIT)
}
diff --git a/collection/ktx/api/1.0.0.txt b/collection/ktx/api/1.0.0.txt
index c941554..e7606ec 100644
--- a/collection/ktx/api/1.0.0.txt
+++ b/collection/ktx/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.collection {
public final class ArrayMapKt {
diff --git a/collection/ktx/api/1.1.0-alpha01.txt b/collection/ktx/api/1.1.0-alpha01.txt
index 3d7e046..36ae63f 100644
--- a/collection/ktx/api/1.1.0-alpha01.txt
+++ b/collection/ktx/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.collection {
public final class ArrayMapKt {
diff --git a/collection/ktx/api/1.1.0-alpha02.txt b/collection/ktx/api/1.1.0-alpha02.txt
index 3fe6a36..36ae63f 100644
--- a/collection/ktx/api/1.1.0-alpha02.txt
+++ b/collection/ktx/api/1.1.0-alpha02.txt
@@ -1,50 +1,50 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.collection {
public final class ArrayMapKt {
ctor public ArrayMapKt();
- method public static inline <K, V> androidx.collection.ArrayMap<K,V> arrayMapOf();
+ method public static <K, V> androidx.collection.ArrayMap<K,V> arrayMapOf();
method public static <K, V> androidx.collection.ArrayMap<K,V> arrayMapOf(kotlin.Pair<? extends K,? extends V>... pairs);
}
public final class ArraySetKt {
ctor public ArraySetKt();
- method public static inline <T> androidx.collection.ArraySet<T> arraySetOf();
+ method public static <T> androidx.collection.ArraySet<T> arraySetOf();
method public static <T> androidx.collection.ArraySet<T> arraySetOf(T... values);
}
public final class LongSparseArrayKt {
ctor public LongSparseArrayKt();
- method public static inline operator <T> boolean contains(androidx.collection.LongSparseArray<T>, long key);
- method public static inline <T> void forEach(androidx.collection.LongSparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Long,? super T,kotlin.Unit> action);
- method public static inline <T> T! getOrDefault(androidx.collection.LongSparseArray<T>, long key, T! defaultValue);
- method public static inline <T> T! getOrElse(androidx.collection.LongSparseArray<T>, long key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
- method public static inline <T> int getSize(androidx.collection.LongSparseArray<T>);
- method public static inline <T> boolean isNotEmpty(androidx.collection.LongSparseArray<T>);
+ method public static operator <T> boolean contains(androidx.collection.LongSparseArray<T>, long key);
+ method public static <T> void forEach(androidx.collection.LongSparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Long,? super T,kotlin.Unit> action);
+ method public static <T> T! getOrDefault(androidx.collection.LongSparseArray<T>, long key, T! defaultValue);
+ method public static <T> T! getOrElse(androidx.collection.LongSparseArray<T>, long key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
+ method public static <T> int getSize(androidx.collection.LongSparseArray<T>);
+ method public static <T> boolean isNotEmpty(androidx.collection.LongSparseArray<T>);
method public static <T> kotlin.collections.LongIterator keyIterator(androidx.collection.LongSparseArray<T>);
method public static operator <T> androidx.collection.LongSparseArray<T> plus(androidx.collection.LongSparseArray<T>, androidx.collection.LongSparseArray<T> other);
method @Deprecated public static <T> boolean remove(androidx.collection.LongSparseArray<T>, long key, T! value);
- method public static inline operator <T> void set(androidx.collection.LongSparseArray<T>, long key, T! value);
+ method public static operator <T> void set(androidx.collection.LongSparseArray<T>, long key, T! value);
method public static <T> java.util.Iterator<T> valueIterator(androidx.collection.LongSparseArray<T>);
}
public final class LruCacheKt {
ctor public LruCacheKt();
- method public static inline <K, V> androidx.collection.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { (V)null }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
+ method public static <K, V> androidx.collection.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { (V)null }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class SparseArrayKt {
ctor public SparseArrayKt();
- method public static inline operator <T> boolean contains(androidx.collection.SparseArrayCompat<T>, int key);
- method public static inline <T> void forEach(androidx.collection.SparseArrayCompat<T>, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action);
- method public static inline <T> T! getOrDefault(androidx.collection.SparseArrayCompat<T>, int key, T! defaultValue);
- method public static inline <T> T! getOrElse(androidx.collection.SparseArrayCompat<T>, int key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
- method public static inline <T> int getSize(androidx.collection.SparseArrayCompat<T>);
- method public static inline <T> boolean isNotEmpty(androidx.collection.SparseArrayCompat<T>);
+ method public static operator <T> boolean contains(androidx.collection.SparseArrayCompat<T>, int key);
+ method public static <T> void forEach(androidx.collection.SparseArrayCompat<T>, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action);
+ method public static <T> T! getOrDefault(androidx.collection.SparseArrayCompat<T>, int key, T! defaultValue);
+ method public static <T> T! getOrElse(androidx.collection.SparseArrayCompat<T>, int key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
+ method public static <T> int getSize(androidx.collection.SparseArrayCompat<T>);
+ method public static <T> boolean isNotEmpty(androidx.collection.SparseArrayCompat<T>);
method public static <T> kotlin.collections.IntIterator keyIterator(androidx.collection.SparseArrayCompat<T>);
method public static operator <T> androidx.collection.SparseArrayCompat<T> plus(androidx.collection.SparseArrayCompat<T>, androidx.collection.SparseArrayCompat<T> other);
method @Deprecated public static <T> boolean remove(androidx.collection.SparseArrayCompat<T>, int key, T! value);
- method public static inline operator <T> void set(androidx.collection.SparseArrayCompat<T>, int key, T! value);
+ method public static operator <T> void set(androidx.collection.SparseArrayCompat<T>, int key, T! value);
method public static <T> java.util.Iterator<T> valueIterator(androidx.collection.SparseArrayCompat<T>);
}
diff --git a/collection/ktx/api/1.1.0-alpha03.txt b/collection/ktx/api/1.1.0-alpha03.txt
deleted file mode 100644
index 3fe6a36..0000000
--- a/collection/ktx/api/1.1.0-alpha03.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-// Signature format: 3.0
-package androidx.collection {
-
- public final class ArrayMapKt {
- ctor public ArrayMapKt();
- method public static inline <K, V> androidx.collection.ArrayMap<K,V> arrayMapOf();
- method public static <K, V> androidx.collection.ArrayMap<K,V> arrayMapOf(kotlin.Pair<? extends K,? extends V>... pairs);
- }
-
- public final class ArraySetKt {
- ctor public ArraySetKt();
- method public static inline <T> androidx.collection.ArraySet<T> arraySetOf();
- method public static <T> androidx.collection.ArraySet<T> arraySetOf(T... values);
- }
-
- public final class LongSparseArrayKt {
- ctor public LongSparseArrayKt();
- method public static inline operator <T> boolean contains(androidx.collection.LongSparseArray<T>, long key);
- method public static inline <T> void forEach(androidx.collection.LongSparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Long,? super T,kotlin.Unit> action);
- method public static inline <T> T! getOrDefault(androidx.collection.LongSparseArray<T>, long key, T! defaultValue);
- method public static inline <T> T! getOrElse(androidx.collection.LongSparseArray<T>, long key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
- method public static inline <T> int getSize(androidx.collection.LongSparseArray<T>);
- method public static inline <T> boolean isNotEmpty(androidx.collection.LongSparseArray<T>);
- method public static <T> kotlin.collections.LongIterator keyIterator(androidx.collection.LongSparseArray<T>);
- method public static operator <T> androidx.collection.LongSparseArray<T> plus(androidx.collection.LongSparseArray<T>, androidx.collection.LongSparseArray<T> other);
- method @Deprecated public static <T> boolean remove(androidx.collection.LongSparseArray<T>, long key, T! value);
- method public static inline operator <T> void set(androidx.collection.LongSparseArray<T>, long key, T! value);
- method public static <T> java.util.Iterator<T> valueIterator(androidx.collection.LongSparseArray<T>);
- }
-
- public final class LruCacheKt {
- ctor public LruCacheKt();
- method public static inline <K, V> androidx.collection.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { (V)null }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
- }
-
- public final class SparseArrayKt {
- ctor public SparseArrayKt();
- method public static inline operator <T> boolean contains(androidx.collection.SparseArrayCompat<T>, int key);
- method public static inline <T> void forEach(androidx.collection.SparseArrayCompat<T>, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action);
- method public static inline <T> T! getOrDefault(androidx.collection.SparseArrayCompat<T>, int key, T! defaultValue);
- method public static inline <T> T! getOrElse(androidx.collection.SparseArrayCompat<T>, int key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
- method public static inline <T> int getSize(androidx.collection.SparseArrayCompat<T>);
- method public static inline <T> boolean isNotEmpty(androidx.collection.SparseArrayCompat<T>);
- method public static <T> kotlin.collections.IntIterator keyIterator(androidx.collection.SparseArrayCompat<T>);
- method public static operator <T> androidx.collection.SparseArrayCompat<T> plus(androidx.collection.SparseArrayCompat<T>, androidx.collection.SparseArrayCompat<T> other);
- method @Deprecated public static <T> boolean remove(androidx.collection.SparseArrayCompat<T>, int key, T! value);
- method public static inline operator <T> void set(androidx.collection.SparseArrayCompat<T>, int key, T! value);
- method public static <T> java.util.Iterator<T> valueIterator(androidx.collection.SparseArrayCompat<T>);
- }
-
-}
-
diff --git a/collection/ktx/api/current.txt b/collection/ktx/api/current.txt
index 3fe6a36..36ae63f 100644
--- a/collection/ktx/api/current.txt
+++ b/collection/ktx/api/current.txt
@@ -1,50 +1,50 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.collection {
public final class ArrayMapKt {
ctor public ArrayMapKt();
- method public static inline <K, V> androidx.collection.ArrayMap<K,V> arrayMapOf();
+ method public static <K, V> androidx.collection.ArrayMap<K,V> arrayMapOf();
method public static <K, V> androidx.collection.ArrayMap<K,V> arrayMapOf(kotlin.Pair<? extends K,? extends V>... pairs);
}
public final class ArraySetKt {
ctor public ArraySetKt();
- method public static inline <T> androidx.collection.ArraySet<T> arraySetOf();
+ method public static <T> androidx.collection.ArraySet<T> arraySetOf();
method public static <T> androidx.collection.ArraySet<T> arraySetOf(T... values);
}
public final class LongSparseArrayKt {
ctor public LongSparseArrayKt();
- method public static inline operator <T> boolean contains(androidx.collection.LongSparseArray<T>, long key);
- method public static inline <T> void forEach(androidx.collection.LongSparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Long,? super T,kotlin.Unit> action);
- method public static inline <T> T! getOrDefault(androidx.collection.LongSparseArray<T>, long key, T! defaultValue);
- method public static inline <T> T! getOrElse(androidx.collection.LongSparseArray<T>, long key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
- method public static inline <T> int getSize(androidx.collection.LongSparseArray<T>);
- method public static inline <T> boolean isNotEmpty(androidx.collection.LongSparseArray<T>);
+ method public static operator <T> boolean contains(androidx.collection.LongSparseArray<T>, long key);
+ method public static <T> void forEach(androidx.collection.LongSparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Long,? super T,kotlin.Unit> action);
+ method public static <T> T! getOrDefault(androidx.collection.LongSparseArray<T>, long key, T! defaultValue);
+ method public static <T> T! getOrElse(androidx.collection.LongSparseArray<T>, long key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
+ method public static <T> int getSize(androidx.collection.LongSparseArray<T>);
+ method public static <T> boolean isNotEmpty(androidx.collection.LongSparseArray<T>);
method public static <T> kotlin.collections.LongIterator keyIterator(androidx.collection.LongSparseArray<T>);
method public static operator <T> androidx.collection.LongSparseArray<T> plus(androidx.collection.LongSparseArray<T>, androidx.collection.LongSparseArray<T> other);
method @Deprecated public static <T> boolean remove(androidx.collection.LongSparseArray<T>, long key, T! value);
- method public static inline operator <T> void set(androidx.collection.LongSparseArray<T>, long key, T! value);
+ method public static operator <T> void set(androidx.collection.LongSparseArray<T>, long key, T! value);
method public static <T> java.util.Iterator<T> valueIterator(androidx.collection.LongSparseArray<T>);
}
public final class LruCacheKt {
ctor public LruCacheKt();
- method public static inline <K, V> androidx.collection.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { (V)null }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
+ method public static <K, V> androidx.collection.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { (V)null }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class SparseArrayKt {
ctor public SparseArrayKt();
- method public static inline operator <T> boolean contains(androidx.collection.SparseArrayCompat<T>, int key);
- method public static inline <T> void forEach(androidx.collection.SparseArrayCompat<T>, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action);
- method public static inline <T> T! getOrDefault(androidx.collection.SparseArrayCompat<T>, int key, T! defaultValue);
- method public static inline <T> T! getOrElse(androidx.collection.SparseArrayCompat<T>, int key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
- method public static inline <T> int getSize(androidx.collection.SparseArrayCompat<T>);
- method public static inline <T> boolean isNotEmpty(androidx.collection.SparseArrayCompat<T>);
+ method public static operator <T> boolean contains(androidx.collection.SparseArrayCompat<T>, int key);
+ method public static <T> void forEach(androidx.collection.SparseArrayCompat<T>, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action);
+ method public static <T> T! getOrDefault(androidx.collection.SparseArrayCompat<T>, int key, T! defaultValue);
+ method public static <T> T! getOrElse(androidx.collection.SparseArrayCompat<T>, int key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
+ method public static <T> int getSize(androidx.collection.SparseArrayCompat<T>);
+ method public static <T> boolean isNotEmpty(androidx.collection.SparseArrayCompat<T>);
method public static <T> kotlin.collections.IntIterator keyIterator(androidx.collection.SparseArrayCompat<T>);
method public static operator <T> androidx.collection.SparseArrayCompat<T> plus(androidx.collection.SparseArrayCompat<T>, androidx.collection.SparseArrayCompat<T> other);
method @Deprecated public static <T> boolean remove(androidx.collection.SparseArrayCompat<T>, int key, T! value);
- method public static inline operator <T> void set(androidx.collection.SparseArrayCompat<T>, int key, T! value);
+ method public static operator <T> void set(androidx.collection.SparseArrayCompat<T>, int key, T! value);
method public static <T> java.util.Iterator<T> valueIterator(androidx.collection.SparseArrayCompat<T>);
}
diff --git a/collection/ktx/api/restricted_1.0.0.txt b/collection/ktx/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/collection/ktx/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/collection/ktx/api/restricted_1.1.0-alpha03.txt b/collection/ktx/api/restricted_1.1.0-alpha03.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/collection/ktx/api/restricted_1.1.0-alpha03.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/collection/ktx/api/restricted_current.txt b/collection/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/collection/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/collection/src/main/java/androidx/collection/ArraySet.java b/collection/src/main/java/androidx/collection/ArraySet.java
index 7963bbc..60ca0b9 100644
--- a/collection/src/main/java/androidx/collection/ArraySet.java
+++ b/collection/src/main/java/androidx/collection/ArraySet.java
@@ -16,7 +16,7 @@
package androidx.collection;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -410,7 +410,7 @@
* The array must already be large enough to contain the item.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void append(E value) {
final int index = mSize;
final int hash = value == null ? 0 : value.hashCode();
diff --git a/concurrent/futures/api/1.0.0-alpha02.txt b/concurrent/futures/api/1.0.0-alpha02.txt
index cee1ebb..ce255d1 100644
--- a/concurrent/futures/api/1.0.0-alpha02.txt
+++ b/concurrent/futures/api/1.0.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.concurrent.futures {
public abstract class AbstractResolvableFuture<V> implements com.google.common.util.concurrent.ListenableFuture<V> {
diff --git a/concurrent/futures/api/1.0.0-alpha03.txt b/concurrent/futures/api/1.0.0-alpha03.txt
index f187a1b..16dc099 100644
--- a/concurrent/futures/api/1.0.0-alpha03.txt
+++ b/concurrent/futures/api/1.0.0-alpha03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.concurrent.futures {
public abstract class AbstractResolvableFuture<V> implements com.google.common.util.concurrent.ListenableFuture<V> {
diff --git a/concurrent/futures/api/current.txt b/concurrent/futures/api/current.txt
index f187a1b..16dc099 100644
--- a/concurrent/futures/api/current.txt
+++ b/concurrent/futures/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.concurrent.futures {
public abstract class AbstractResolvableFuture<V> implements com.google.common.util.concurrent.ListenableFuture<V> {
diff --git a/concurrent/futures/api/restricted_1.0.0-alpha03.txt b/concurrent/futures/api/restricted_1.0.0-alpha03.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/concurrent/futures/api/restricted_1.0.0-alpha03.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/concurrent/futures/api/restricted_current.txt b/concurrent/futures/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/concurrent/futures/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/content/api/1.0.0.txt b/content/api/1.0.0.txt
index b5241ef..d57af6b 100644
--- a/content/api/1.0.0.txt
+++ b/content/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.contentpager.content {
public class ContentPager {
diff --git a/content/api/1.1.0-alpha01.txt b/content/api/1.1.0-alpha01.txt
deleted file mode 100644
index b5241ef..0000000
--- a/content/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-// Signature format: 3.0
-package androidx.contentpager.content {
-
- public class ContentPager {
- ctor public ContentPager(android.content.ContentResolver!, androidx.contentpager.content.ContentPager.QueryRunner!);
- ctor public ContentPager(android.content.ContentResolver, androidx.contentpager.content.ContentPager.QueryRunner, int);
- method public static android.os.Bundle createArgs(int, int);
- method @MainThread public androidx.contentpager.content.Query query(@RequiresPermission.Read android.net.Uri, String[]?, android.os.Bundle, android.os.CancellationSignal?, androidx.contentpager.content.ContentPager.ContentCallback);
- method @MainThread public void reset();
- field public static final int CURSOR_DISPOSITION_COPIED = 1; // 0x1
- field public static final int CURSOR_DISPOSITION_PAGED = 2; // 0x2
- field public static final int CURSOR_DISPOSITION_REPAGED = 3; // 0x3
- field public static final int CURSOR_DISPOSITION_WRAPPED = 4; // 0x4
- field public static final String EXTRA_HONORED_ARGS = "android.content.extra.HONORED_ARGS";
- field public static final String EXTRA_REQUESTED_LIMIT = "android-support:extra-ignored-limit";
- field public static final String EXTRA_SUGGESTED_LIMIT = "android-support:extra-suggested-limit";
- field public static final String EXTRA_TOTAL_COUNT = "android.content.extra.TOTAL_COUNT";
- field public static final String QUERY_ARG_LIMIT = "android:query-arg-limit";
- field public static final String QUERY_ARG_OFFSET = "android:query-arg-offset";
- }
-
- public static interface ContentPager.ContentCallback {
- method @MainThread public void onCursorReady(androidx.contentpager.content.Query, android.database.Cursor?);
- }
-
- @IntDef({androidx.contentpager.content.ContentPager.CURSOR_DISPOSITION_COPIED, androidx.contentpager.content.ContentPager.CURSOR_DISPOSITION_PAGED, androidx.contentpager.content.ContentPager.CURSOR_DISPOSITION_REPAGED, androidx.contentpager.content.ContentPager.CURSOR_DISPOSITION_WRAPPED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ContentPager.CursorDisposition {
- }
-
- public static interface ContentPager.QueryRunner {
- method public void cancel(androidx.contentpager.content.Query);
- method public boolean isRunning(androidx.contentpager.content.Query);
- method public void query(androidx.contentpager.content.Query, androidx.contentpager.content.ContentPager.QueryRunner.Callback);
- }
-
- public static interface ContentPager.QueryRunner.Callback {
- method public void onQueryFinished(androidx.contentpager.content.Query, android.database.Cursor?);
- method public android.database.Cursor? runQueryInBackground(androidx.contentpager.content.Query);
- }
-
- public final class LoaderQueryRunner implements androidx.contentpager.content.ContentPager.QueryRunner {
- ctor public LoaderQueryRunner(android.content.Context, android.app.LoaderManager);
- method public void cancel(androidx.contentpager.content.Query);
- method public boolean isRunning(androidx.contentpager.content.Query);
- method public void query(androidx.contentpager.content.Query, androidx.contentpager.content.ContentPager.QueryRunner.Callback);
- }
-
- public final class Query {
- method public int getId();
- method public int getLimit();
- method public int getOffset();
- method public android.net.Uri getUri();
- }
-
-}
-
diff --git a/content/api/current.txt b/content/api/current.txt
index b5241ef..d57af6b 100644
--- a/content/api/current.txt
+++ b/content/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.contentpager.content {
public class ContentPager {
diff --git a/content/api/res-1.1.0-alpha01.txt b/content/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/content/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/content/api/restricted_1.0.0.txt b/content/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/content/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/content/api/restricted_1.1.0-alpha01.txt b/content/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/content/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/content/api/restricted_current.txt b/content/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/content/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/content/build.gradle b/content/build.gradle
index b4f1374..5971918 100644
--- a/content/build.gradle
+++ b/content/build.gradle
@@ -25,7 +25,6 @@
dependencies {
api(project(":annotation"))
api(project(":core"))
- implementation(project(":collection"))
androidTestImplementation(JUNIT)
androidTestImplementation(TEST_EXT_JUNIT)
diff --git a/content/src/androidTest/java/androidx/contentpager/content/ContentPagerTest.java b/content/src/androidTest/java/androidx/contentpager/content/ContentPagerTest.java
index f8a66e7..e67db75 100644
--- a/content/src/androidTest/java/androidx/contentpager/content/ContentPagerTest.java
+++ b/content/src/androidTest/java/androidx/contentpager/content/ContentPagerTest.java
@@ -37,7 +37,7 @@
import androidx.annotation.Nullable;
import androidx.contentpager.content.ContentPager.ContentCallback;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
@@ -51,7 +51,7 @@
import java.util.Map;
import java.util.concurrent.TimeUnit;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class ContentPagerTest {
diff --git a/content/src/androidTest/java/androidx/contentpager/content/QueryTest.java b/content/src/androidTest/java/androidx/contentpager/content/QueryTest.java
index d578f1f..67146aa 100644
--- a/content/src/androidTest/java/androidx/contentpager/content/QueryTest.java
+++ b/content/src/androidTest/java/androidx/contentpager/content/QueryTest.java
@@ -23,12 +23,12 @@
import androidx.contentpager.content.ContentPager.ContentCallback;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class QueryTest {
diff --git a/coordinatorlayout/api/1.0.0.txt b/coordinatorlayout/api/1.0.0.txt
index c5a5a15f..37c4526 100644
--- a/coordinatorlayout/api/1.0.0.txt
+++ b/coordinatorlayout/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.coordinatorlayout.widget {
public class CoordinatorLayout extends android.view.ViewGroup implements androidx.core.view.NestedScrollingParent2 {
diff --git a/coordinatorlayout/api/1.1.0-alpha01.txt b/coordinatorlayout/api/1.1.0-alpha01.txt
index 06dd4b4..b4b3d63 100644
--- a/coordinatorlayout/api/1.1.0-alpha01.txt
+++ b/coordinatorlayout/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.coordinatorlayout.widget {
public class CoordinatorLayout extends android.view.ViewGroup implements androidx.core.view.NestedScrollingParent2 androidx.core.view.NestedScrollingParent3 {
diff --git a/coordinatorlayout/api/1.1.0-alpha02.txt b/coordinatorlayout/api/1.1.0-alpha02.txt
index 06dd4b4..b4b3d63 100644
--- a/coordinatorlayout/api/1.1.0-alpha02.txt
+++ b/coordinatorlayout/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.coordinatorlayout.widget {
public class CoordinatorLayout extends android.view.ViewGroup implements androidx.core.view.NestedScrollingParent2 androidx.core.view.NestedScrollingParent3 {
diff --git a/coordinatorlayout/api/current.txt b/coordinatorlayout/api/current.txt
index 06dd4b4..b4b3d63 100644
--- a/coordinatorlayout/api/current.txt
+++ b/coordinatorlayout/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.coordinatorlayout.widget {
public class CoordinatorLayout extends android.view.ViewGroup implements androidx.core.view.NestedScrollingParent2 androidx.core.view.NestedScrollingParent3 {
diff --git a/coordinatorlayout/api/restricted_1.0.0.txt b/coordinatorlayout/api/restricted_1.0.0.txt
deleted file mode 100644
index d673f99..0000000
--- a/coordinatorlayout/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-// Signature format: 3.0
-package androidx.coordinatorlayout.widget {
-
- public class CoordinatorLayout {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final androidx.core.view.WindowInsetsCompat! getLastWindowInsets();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface CoordinatorLayout.DispatchChangeEvent {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final class DirectedAcyclicGraph<T> {
- ctor public DirectedAcyclicGraph();
- method public void addEdge(T, T);
- method public void addNode(T);
- method public void clear();
- method public boolean contains(T);
- method public java.util.List? getIncomingEdges(T);
- method public java.util.List<T>? getOutgoingEdges(T);
- method public java.util.ArrayList<T> getSortedList();
- method public boolean hasOutgoingEdges(T);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class ViewGroupUtils {
- method public static void getDescendantRect(android.view.ViewGroup!, android.view.View!, android.graphics.Rect!);
- }
-
-}
-
diff --git a/coordinatorlayout/api/restricted_1.1.0-alpha02.txt b/coordinatorlayout/api/restricted_1.1.0-alpha02.txt
deleted file mode 100644
index 8b90ee0..0000000
--- a/coordinatorlayout/api/restricted_1.1.0-alpha02.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.coordinatorlayout.widget {
-
- public class CoordinatorLayout extends android.view.ViewGroup implements androidx.core.view.NestedScrollingParent2 androidx.core.view.NestedScrollingParent3 {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final androidx.core.view.WindowInsetsCompat! getLastWindowInsets();
- }
-
- @IntDef({androidx.coordinatorlayout.widget.CoordinatorLayout.EVENT_PRE_DRAW, androidx.coordinatorlayout.widget.CoordinatorLayout.EVENT_NESTED_SCROLL, androidx.coordinatorlayout.widget.CoordinatorLayout.EVENT_VIEW_REMOVED}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CoordinatorLayout.DispatchChangeEvent {
- }
-
-
-
-}
-
diff --git a/coordinatorlayout/api/restricted_current.txt b/coordinatorlayout/api/restricted_current.txt
deleted file mode 100644
index 8b90ee0..0000000
--- a/coordinatorlayout/api/restricted_current.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.coordinatorlayout.widget {
-
- public class CoordinatorLayout extends android.view.ViewGroup implements androidx.core.view.NestedScrollingParent2 androidx.core.view.NestedScrollingParent3 {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final androidx.core.view.WindowInsetsCompat! getLastWindowInsets();
- }
-
- @IntDef({androidx.coordinatorlayout.widget.CoordinatorLayout.EVENT_PRE_DRAW, androidx.coordinatorlayout.widget.CoordinatorLayout.EVENT_NESTED_SCROLL, androidx.coordinatorlayout.widget.CoordinatorLayout.EVENT_VIEW_REMOVED}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CoordinatorLayout.DispatchChangeEvent {
- }
-
-
-
-}
-
diff --git a/coordinatorlayout/build.gradle b/coordinatorlayout/build.gradle
index 7bbacfd..63aaec0 100644
--- a/coordinatorlayout/build.gradle
+++ b/coordinatorlayout/build.gradle
@@ -7,10 +7,8 @@
}
dependencies {
- api(project(":annotation"))
- // TODO: change to 1.1.0-alpha04 after release
- api(project(":core"))
- implementation("androidx.collection:collection:1.0.0")
+ api("androidx.annotation:annotation:1.0.0")
+ api("androidx.core:core:1.1.0-alpha01")
api("androidx.customview:customview:1.0.0")
androidTestImplementation(TEST_EXT_JUNIT)
diff --git a/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorLayoutNestedScrollingParentCompatTest.java b/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorLayoutNestedScrollingParentCompatTest.java
index c9c9e9a..4f09755 100644
--- a/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorLayoutNestedScrollingParentCompatTest.java
+++ b/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorLayoutNestedScrollingParentCompatTest.java
@@ -32,7 +32,7 @@
import androidx.core.view.ViewCompat;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -48,7 +48,7 @@
* {@link CoordinatorLayout.Behavior#onNestedScroll(View, int, int, int, int, int)}
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class CoordinatorLayoutNestedScrollingParentCompatTest {
private static final int WIDTH_AND_HEIGHT = 500;
diff --git a/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorLayoutSortTest.java b/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorLayoutSortTest.java
index 7cda115c..3a93ea2 100644
--- a/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorLayoutSortTest.java
+++ b/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorLayoutSortTest.java
@@ -22,7 +22,7 @@
import android.view.View;
import androidx.coordinatorlayout.testutils.CoordinatorLayoutUtils;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -37,7 +37,7 @@
import java.util.List;
@RunWith(Parameterized.class)
-@SmallTest
+@MediumTest
public class CoordinatorLayoutSortTest {
@Rule
public final ActivityTestRule<CoordinatorLayoutActivity> mActivityTestRule;
diff --git a/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorLayoutTest.java b/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorLayoutTest.java
index 369febe..6abc391 100644
--- a/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorLayoutTest.java
+++ b/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorLayoutTest.java
@@ -56,7 +56,7 @@
import androidx.core.view.WindowInsetsCompat;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
import androidx.test.rule.ActivityTestRule;
@@ -69,7 +69,7 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class CoordinatorLayoutTest {
@Rule
diff --git a/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorSnackbarWithButtonTest.java b/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorSnackbarWithButtonTest.java
index c246488..0c414fd 100644
--- a/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorSnackbarWithButtonTest.java
+++ b/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/CoordinatorSnackbarWithButtonTest.java
@@ -35,7 +35,7 @@
import androidx.test.annotation.UiThreadTest;
import androidx.test.espresso.UiController;
import androidx.test.espresso.ViewAction;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import org.hamcrest.Matcher;
import org.junit.After;
@@ -44,7 +44,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-@LargeTest
+@MediumTest
public class CoordinatorSnackbarWithButtonTest extends BaseDynamicCoordinatorLayoutTest {
private View mBar;
diff --git a/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/DirectedAcyclicGraphTest.java b/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/DirectedAcyclicGraphTest.java
index be3cf9b..623af50 100644
--- a/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/DirectedAcyclicGraphTest.java
+++ b/coordinatorlayout/src/androidTest/java/androidx/coordinatorlayout/widget/DirectedAcyclicGraphTest.java
@@ -22,7 +22,6 @@
import static org.junit.Assert.assertTrue;
import androidx.annotation.NonNull;
-import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -32,7 +31,6 @@
import java.util.List;
@RunWith(JUnit4.class)
-@SmallTest
public class DirectedAcyclicGraphTest {
private DirectedAcyclicGraph<TestNode> mGraph;
diff --git a/coordinatorlayout/src/main/java/androidx/coordinatorlayout/widget/CoordinatorLayout.java b/coordinatorlayout/src/main/java/androidx/coordinatorlayout/widget/CoordinatorLayout.java
index 16bbdcc..50dd925 100644
--- a/coordinatorlayout/src/main/java/androidx/coordinatorlayout/widget/CoordinatorLayout.java
+++ b/coordinatorlayout/src/main/java/androidx/coordinatorlayout/widget/CoordinatorLayout.java
@@ -16,7 +16,7 @@
package androidx.coordinatorlayout.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Resources;
@@ -143,7 +143,7 @@
static final int EVENT_VIEW_REMOVED = 2;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
@IntDef({EVENT_PRE_DRAW, EVENT_NESTED_SCROLL, EVENT_VIEW_REMOVED})
public @interface DispatchChangeEvent {}
@@ -379,7 +379,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public final WindowInsetsCompat getLastWindowInsets() {
return mLastInsets;
}
diff --git a/core/api/1.0.0.txt b/core/api/1.0.0.txt
index 6260316..094ed6c 100644
--- a/core/api/1.0.0.txt
+++ b/core/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.core.accessibilityservice {
public final class AccessibilityServiceInfoCompat {
diff --git a/core/api/1.1.0-alpha01.txt b/core/api/1.1.0-alpha01.txt
index 8f72b28..a5ced49 100644
--- a/core/api/1.1.0-alpha01.txt
+++ b/core/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.core.accessibilityservice {
public final class AccessibilityServiceInfoCompat {
diff --git a/core/api/1.1.0-alpha02.txt b/core/api/1.1.0-alpha02.txt
index 8a00be6..d89f108 100644
--- a/core/api/1.1.0-alpha02.txt
+++ b/core/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.core.accessibilityservice {
public final class AccessibilityServiceInfoCompat {
diff --git a/core/api/1.1.0-alpha03.txt b/core/api/1.1.0-alpha03.txt
index cdd40ca..ff7324a 100644
--- a/core/api/1.1.0-alpha03.txt
+++ b/core/api/1.1.0-alpha03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.core.accessibilityservice {
public final class AccessibilityServiceInfoCompat {
diff --git a/core/api/1.1.0-alpha04.ignore b/core/api/1.1.0-alpha04.ignore
deleted file mode 100644
index 74eb4e8..0000000
--- a/core/api/1.1.0-alpha04.ignore
+++ /dev/null
@@ -1,55 +0,0 @@
-// Baseline format: 1.0
-DeprecationMismatch: androidx.core.app.NotificationCompat.Action.WearableExtender#getCancelLabel():
- Method androidx.core.app.NotificationCompat.Action.WearableExtender.getCancelLabel(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.Action.WearableExtender#getConfirmLabel():
- Method androidx.core.app.NotificationCompat.Action.WearableExtender.getConfirmLabel(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.Action.WearableExtender#getInProgressLabel():
- Method androidx.core.app.NotificationCompat.Action.WearableExtender.getInProgressLabel(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.Action.WearableExtender#setCancelLabel(CharSequence):
- Method androidx.core.app.NotificationCompat.Action.WearableExtender.setCancelLabel(CharSequence): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.Action.WearableExtender#setConfirmLabel(CharSequence):
- Method androidx.core.app.NotificationCompat.Action.WearableExtender.setConfirmLabel(CharSequence): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.Action.WearableExtender#setInProgressLabel(CharSequence):
- Method androidx.core.app.NotificationCompat.Action.WearableExtender.setInProgressLabel(CharSequence): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getContentIcon():
- Method androidx.core.app.NotificationCompat.WearableExtender.getContentIcon(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getContentIconGravity():
- Method androidx.core.app.NotificationCompat.WearableExtender.getContentIconGravity(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getCustomContentHeight():
- Method androidx.core.app.NotificationCompat.WearableExtender.getCustomContentHeight(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getCustomSizePreset():
- Method androidx.core.app.NotificationCompat.WearableExtender.getCustomSizePreset(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getGravity():
- Method androidx.core.app.NotificationCompat.WearableExtender.getGravity(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getHintAvoidBackgroundClipping():
- Method androidx.core.app.NotificationCompat.WearableExtender.getHintAvoidBackgroundClipping(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getHintHideIcon():
- Method androidx.core.app.NotificationCompat.WearableExtender.getHintHideIcon(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getHintScreenTimeout():
- Method androidx.core.app.NotificationCompat.WearableExtender.getHintScreenTimeout(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getHintShowBackgroundOnly():
- Method androidx.core.app.NotificationCompat.WearableExtender.getHintShowBackgroundOnly(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setContentIcon(int):
- Method androidx.core.app.NotificationCompat.WearableExtender.setContentIcon(int): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setContentIconGravity(int):
- Method androidx.core.app.NotificationCompat.WearableExtender.setContentIconGravity(int): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setCustomContentHeight(int):
- Method androidx.core.app.NotificationCompat.WearableExtender.setCustomContentHeight(int): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setCustomSizePreset(int):
- Method androidx.core.app.NotificationCompat.WearableExtender.setCustomSizePreset(int): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setGravity(int):
- Method androidx.core.app.NotificationCompat.WearableExtender.setGravity(int): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setHintAvoidBackgroundClipping(boolean):
- Method androidx.core.app.NotificationCompat.WearableExtender.setHintAvoidBackgroundClipping(boolean): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setHintHideIcon(boolean):
- Method androidx.core.app.NotificationCompat.WearableExtender.setHintHideIcon(boolean): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setHintScreenTimeout(int):
- Method androidx.core.app.NotificationCompat.WearableExtender.setHintScreenTimeout(int): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setHintShowBackgroundOnly(boolean):
- Method androidx.core.app.NotificationCompat.WearableExtender.setHintShowBackgroundOnly(boolean): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-
-
-RemovedDeprecatedMethod: androidx.core.graphics.drawable.IconCompat#createFromIcon(android.graphics.drawable.Icon):
- Removed deprecated method androidx.core.graphics.drawable.IconCompat.createFromIcon(android.graphics.drawable.Icon)
-
-
diff --git a/core/api/1.1.0-alpha04.txt b/core/api/1.1.0-alpha04.txt
index e9cfd20..9a55963 100644
--- a/core/api/1.1.0-alpha04.txt
+++ b/core/api/1.1.0-alpha04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.core.accessibilityservice {
public final class AccessibilityServiceInfoCompat {
@@ -1136,14 +1136,6 @@
}
-package androidx.core.location {
-
- public final class LocationManagerCompat {
- method public static boolean isLocationEnabled(android.location.LocationManager);
- }
-
-}
-
package androidx.core.math {
public class MathUtils {
@@ -2897,8 +2889,6 @@
method public static int getAutoSizeStepGranularity(android.widget.TextView);
method public static int[] getAutoSizeTextAvailableSizes(android.widget.TextView);
method public static int getAutoSizeTextType(android.widget.TextView);
- method public static android.content.res.ColorStateList? getCompoundDrawableTintList(android.widget.TextView);
- method public static android.graphics.PorterDuff.Mode? getCompoundDrawableTintMode(android.widget.TextView);
method public static android.graphics.drawable.Drawable[] getCompoundDrawablesRelative(android.widget.TextView);
method public static int getFirstBaselineToTopHeight(android.widget.TextView);
method public static int getLastBaselineToBottomHeight(android.widget.TextView);
@@ -2908,8 +2898,6 @@
method public static void setAutoSizeTextTypeUniformWithConfiguration(android.widget.TextView, int, int, int, int) throws java.lang.IllegalArgumentException;
method public static void setAutoSizeTextTypeUniformWithPresetSizes(android.widget.TextView, int[], int) throws java.lang.IllegalArgumentException;
method public static void setAutoSizeTextTypeWithDefaults(android.widget.TextView, int);
- method public static void setCompoundDrawableTintList(android.widget.TextView, android.content.res.ColorStateList?);
- method public static void setCompoundDrawableTintMode(android.widget.TextView, android.graphics.PorterDuff.Mode?);
method public static void setCompoundDrawablesRelative(android.widget.TextView, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?);
method public static void setCompoundDrawablesRelativeWithIntrinsicBounds(android.widget.TextView, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?);
method public static void setCompoundDrawablesRelativeWithIntrinsicBounds(android.widget.TextView, @DrawableRes int, @DrawableRes int, @DrawableRes int, @DrawableRes int);
@@ -2931,12 +2919,5 @@
method public void setSupportButtonTintMode(android.graphics.PorterDuff.Mode?);
}
- public interface TintableCompoundDrawablesView {
- method public android.content.res.ColorStateList? getSupportCompoundDrawablesTintList();
- method public android.graphics.PorterDuff.Mode? getSupportCompoundDrawablesTintMode();
- method public void setSupportCompoundDrawablesTintList(android.content.res.ColorStateList?);
- method public void setSupportCompoundDrawablesTintMode(android.graphics.PorterDuff.Mode?);
- }
-
}
diff --git a/core/api/1.1.0-alpha05.ignore b/core/api/1.1.0-alpha05.ignore
deleted file mode 100644
index 441ccd3..0000000
--- a/core/api/1.1.0-alpha05.ignore
+++ /dev/null
@@ -1,3 +0,0 @@
-// Baseline format: 1.0
-RemovedDeprecatedMethod: androidx.core.graphics.drawable.IconCompat#createFromIcon(android.graphics.drawable.Icon):
- Removed deprecated method androidx.core.graphics.drawable.IconCompat.createFromIcon(android.graphics.drawable.Icon)
diff --git a/core/api/1.1.0-alpha05.txt b/core/api/1.1.0-alpha05.txt
deleted file mode 100644
index 0ece2e3..0000000
--- a/core/api/1.1.0-alpha05.txt
+++ /dev/null
@@ -1,2943 +0,0 @@
-// Signature format: 3.0
-package androidx.core.accessibilityservice {
-
- public final class AccessibilityServiceInfoCompat {
- method public static String capabilityToString(int);
- method public static String feedbackTypeToString(int);
- method public static String? flagToString(int);
- method public static int getCapabilities(android.accessibilityservice.AccessibilityServiceInfo);
- method public static String? loadDescription(android.accessibilityservice.AccessibilityServiceInfo, android.content.pm.PackageManager);
- field public static final int CAPABILITY_CAN_FILTER_KEY_EVENTS = 8; // 0x8
- field public static final int CAPABILITY_CAN_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 4; // 0x4
- field public static final int CAPABILITY_CAN_REQUEST_TOUCH_EXPLORATION = 2; // 0x2
- field public static final int CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT = 1; // 0x1
- field public static final int FEEDBACK_ALL_MASK = -1; // 0xffffffff
- field public static final int FEEDBACK_BRAILLE = 32; // 0x20
- field public static final int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 2; // 0x2
- field public static final int FLAG_REPORT_VIEW_IDS = 16; // 0x10
- field public static final int FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY = 8; // 0x8
- field public static final int FLAG_REQUEST_FILTER_KEY_EVENTS = 32; // 0x20
- field public static final int FLAG_REQUEST_TOUCH_EXPLORATION_MODE = 4; // 0x4
- }
-
-}
-
-package androidx.core.app {
-
- public class ActivityCompat extends androidx.core.content.ContextCompat {
- ctor protected ActivityCompat();
- method public static void finishAffinity(android.app.Activity);
- method public static void finishAfterTransition(android.app.Activity);
- method public static android.net.Uri? getReferrer(android.app.Activity);
- method @Deprecated public static boolean invalidateOptionsMenu(android.app.Activity!);
- method public static void postponeEnterTransition(android.app.Activity);
- method public static void recreate(android.app.Activity);
- method public static androidx.core.view.DragAndDropPermissionsCompat? requestDragAndDropPermissions(android.app.Activity!, android.view.DragEvent!);
- method public static void requestPermissions(android.app.Activity, String[], @IntRange(from=0) int);
- method public static <T extends android.view.View> T requireViewById(android.app.Activity, @IdRes int);
- method public static void setEnterSharedElementCallback(android.app.Activity, androidx.core.app.SharedElementCallback?);
- method public static void setExitSharedElementCallback(android.app.Activity, androidx.core.app.SharedElementCallback?);
- method public static void setPermissionCompatDelegate(androidx.core.app.ActivityCompat.PermissionCompatDelegate?);
- method public static boolean shouldShowRequestPermissionRationale(android.app.Activity, String);
- method public static void startActivityForResult(android.app.Activity, android.content.Intent, int, android.os.Bundle?);
- method public static void startIntentSenderForResult(android.app.Activity, android.content.IntentSender, int, android.content.Intent?, int, int, int, android.os.Bundle?) throws android.content.IntentSender.SendIntentException;
- method public static void startPostponedEnterTransition(android.app.Activity);
- }
-
- public static interface ActivityCompat.OnRequestPermissionsResultCallback {
- method public void onRequestPermissionsResult(int, String[], int[]);
- }
-
- public static interface ActivityCompat.PermissionCompatDelegate {
- method public boolean onActivityResult(android.app.Activity, @IntRange(from=0) int, int, android.content.Intent?);
- method public boolean requestPermissions(android.app.Activity, String[], @IntRange(from=0) int);
- }
-
- public final class ActivityManagerCompat {
- method public static boolean isLowRamDevice(android.app.ActivityManager);
- }
-
- public class ActivityOptionsCompat {
- ctor protected ActivityOptionsCompat();
- method public android.graphics.Rect? getLaunchBounds();
- method public static androidx.core.app.ActivityOptionsCompat makeBasic();
- method public static androidx.core.app.ActivityOptionsCompat makeClipRevealAnimation(android.view.View, int, int, int, int);
- method public static androidx.core.app.ActivityOptionsCompat makeCustomAnimation(android.content.Context, int, int);
- method public static androidx.core.app.ActivityOptionsCompat makeScaleUpAnimation(android.view.View, int, int, int, int);
- method public static androidx.core.app.ActivityOptionsCompat makeSceneTransitionAnimation(android.app.Activity, android.view.View, String);
- method public static androidx.core.app.ActivityOptionsCompat makeSceneTransitionAnimation(android.app.Activity, androidx.core.util.Pair<android.view.View,java.lang.String>...!);
- method public static androidx.core.app.ActivityOptionsCompat makeTaskLaunchBehind();
- method public static androidx.core.app.ActivityOptionsCompat makeThumbnailScaleUpAnimation(android.view.View, android.graphics.Bitmap, int, int);
- method public void requestUsageTimeReport(android.app.PendingIntent);
- method public androidx.core.app.ActivityOptionsCompat setLaunchBounds(android.graphics.Rect?);
- method public android.os.Bundle? toBundle();
- method public void update(androidx.core.app.ActivityOptionsCompat);
- field public static final String EXTRA_USAGE_TIME_REPORT = "android.activity.usage_time";
- field public static final String EXTRA_USAGE_TIME_REPORT_PACKAGES = "android.usage_time_packages";
- }
-
- public final class AlarmManagerCompat {
- method public static void setAlarmClock(android.app.AlarmManager, long, android.app.PendingIntent, android.app.PendingIntent);
- method public static void setAndAllowWhileIdle(android.app.AlarmManager, int, long, android.app.PendingIntent);
- method public static void setExact(android.app.AlarmManager, int, long, android.app.PendingIntent);
- method public static void setExactAndAllowWhileIdle(android.app.AlarmManager, int, long, android.app.PendingIntent);
- }
-
- @RequiresApi(28) public class AppComponentFactory extends android.app.AppComponentFactory {
- ctor public AppComponentFactory();
- method public final android.app.Activity! instantiateActivity(ClassLoader!, String!, android.content.Intent!) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
- method public android.app.Activity instantiateActivityCompat(ClassLoader, String, android.content.Intent?) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
- method public final android.app.Application! instantiateApplication(ClassLoader!, String!) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
- method public android.app.Application instantiateApplicationCompat(ClassLoader, String) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
- method public final android.content.ContentProvider! instantiateProvider(ClassLoader!, String!) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
- method public android.content.ContentProvider instantiateProviderCompat(ClassLoader, String) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
- method public final android.content.BroadcastReceiver! instantiateReceiver(ClassLoader!, String!, android.content.Intent!) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
- method public android.content.BroadcastReceiver instantiateReceiverCompat(ClassLoader, String, android.content.Intent?) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
- method public final android.app.Service! instantiateService(ClassLoader!, String!, android.content.Intent!) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
- method public android.app.Service instantiateServiceCompat(ClassLoader, String, android.content.Intent?) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException;
- }
-
- public class AppLaunchChecker {
- ctor @Deprecated public AppLaunchChecker();
- method public static boolean hasStartedFromLauncher(android.content.Context);
- method public static void onActivityCreate(android.app.Activity);
- }
-
- public final class AppOpsManagerCompat {
- method public static int noteOp(android.content.Context, String, int, String);
- method public static int noteOpNoThrow(android.content.Context, String, int, String);
- method public static int noteProxyOp(android.content.Context, String, String);
- method public static int noteProxyOpNoThrow(android.content.Context, String, String);
- method public static String? permissionToOp(String);
- field public static final int MODE_ALLOWED = 0; // 0x0
- field public static final int MODE_DEFAULT = 3; // 0x3
- field public static final int MODE_ERRORED = 2; // 0x2
- field public static final int MODE_IGNORED = 1; // 0x1
- }
-
- public final class BundleCompat {
- method public static android.os.IBinder? getBinder(android.os.Bundle, String?);
- method public static void putBinder(android.os.Bundle, String?, android.os.IBinder?);
- }
-
- public class DialogCompat {
- method public static android.view.View requireViewById(android.app.Dialog, int);
- }
-
- public class FrameMetricsAggregator {
- ctor public FrameMetricsAggregator();
- ctor public FrameMetricsAggregator(int);
- method public void add(android.app.Activity);
- method public android.util.SparseIntArray[]? getMetrics();
- method public android.util.SparseIntArray[]? remove(android.app.Activity);
- method public android.util.SparseIntArray[]? reset();
- method public android.util.SparseIntArray[]? stop();
- field public static final int ANIMATION_DURATION = 256; // 0x100
- field public static final int ANIMATION_INDEX = 8; // 0x8
- field public static final int COMMAND_DURATION = 32; // 0x20
- field public static final int COMMAND_INDEX = 5; // 0x5
- field public static final int DELAY_DURATION = 128; // 0x80
- field public static final int DELAY_INDEX = 7; // 0x7
- field public static final int DRAW_DURATION = 8; // 0x8
- field public static final int DRAW_INDEX = 3; // 0x3
- field public static final int EVERY_DURATION = 511; // 0x1ff
- field public static final int INPUT_DURATION = 2; // 0x2
- field public static final int INPUT_INDEX = 1; // 0x1
- field public static final int LAYOUT_MEASURE_DURATION = 4; // 0x4
- field public static final int LAYOUT_MEASURE_INDEX = 2; // 0x2
- field public static final int SWAP_DURATION = 64; // 0x40
- field public static final int SWAP_INDEX = 6; // 0x6
- field public static final int SYNC_DURATION = 16; // 0x10
- field public static final int SYNC_INDEX = 4; // 0x4
- field public static final int TOTAL_DURATION = 1; // 0x1
- field public static final int TOTAL_INDEX = 0; // 0x0
- }
-
- public abstract class JobIntentService extends android.app.Service {
- ctor public JobIntentService();
- method public static void enqueueWork(android.content.Context, Class, int, android.content.Intent);
- method public static void enqueueWork(android.content.Context, android.content.ComponentName, int, android.content.Intent);
- method public boolean isStopped();
- method public android.os.IBinder! onBind(android.content.Intent);
- method protected abstract void onHandleWork(android.content.Intent);
- method public boolean onStopCurrentWork();
- method public void setInterruptIfStopped(boolean);
- }
-
- public final class NavUtils {
- method public static android.content.Intent? getParentActivityIntent(android.app.Activity);
- method public static android.content.Intent? getParentActivityIntent(android.content.Context, Class<?>) throws android.content.pm.PackageManager.NameNotFoundException;
- method public static android.content.Intent? getParentActivityIntent(android.content.Context, android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
- method public static String? getParentActivityName(android.app.Activity);
- method public static String? getParentActivityName(android.content.Context, android.content.ComponentName) throws android.content.pm.PackageManager.NameNotFoundException;
- method public static void navigateUpFromSameTask(android.app.Activity);
- method public static void navigateUpTo(android.app.Activity, android.content.Intent);
- method public static boolean shouldUpRecreateTask(android.app.Activity, android.content.Intent);
- field public static final String PARENT_ACTIVITY = "android.support.PARENT_ACTIVITY";
- }
-
- public class NotificationCompat {
- ctor @Deprecated public NotificationCompat();
- method public static androidx.core.app.NotificationCompat.Action! getAction(android.app.Notification!, int);
- method public static int getActionCount(android.app.Notification!);
- method public static int getBadgeIconType(android.app.Notification!);
- method public static String! getCategory(android.app.Notification!);
- method public static String! getChannelId(android.app.Notification!);
- method @RequiresApi(19) public static CharSequence! getContentTitle(android.app.Notification!);
- method public static android.os.Bundle? getExtras(android.app.Notification!);
- method public static String! getGroup(android.app.Notification!);
- method public static int getGroupAlertBehavior(android.app.Notification!);
- method @RequiresApi(21) public static java.util.List<androidx.core.app.NotificationCompat.Action>! getInvisibleActions(android.app.Notification!);
- method public static boolean getLocalOnly(android.app.Notification!);
- method public static String! getShortcutId(android.app.Notification!);
- method public static String! getSortKey(android.app.Notification!);
- method public static long getTimeoutAfter(android.app.Notification!);
- method public static boolean isGroupSummary(android.app.Notification!);
- field public static final int BADGE_ICON_LARGE = 2; // 0x2
- field public static final int BADGE_ICON_NONE = 0; // 0x0
- field public static final int BADGE_ICON_SMALL = 1; // 0x1
- field public static final String CATEGORY_ALARM = "alarm";
- field public static final String CATEGORY_CALL = "call";
- field public static final String CATEGORY_EMAIL = "email";
- field public static final String CATEGORY_ERROR = "err";
- field public static final String CATEGORY_EVENT = "event";
- field public static final String CATEGORY_MESSAGE = "msg";
- field public static final String CATEGORY_NAVIGATION = "navigation";
- field public static final String CATEGORY_PROGRESS = "progress";
- field public static final String CATEGORY_PROMO = "promo";
- field public static final String CATEGORY_RECOMMENDATION = "recommendation";
- field public static final String CATEGORY_REMINDER = "reminder";
- field public static final String CATEGORY_SERVICE = "service";
- field public static final String CATEGORY_SOCIAL = "social";
- field public static final String CATEGORY_STATUS = "status";
- field public static final String CATEGORY_SYSTEM = "sys";
- field public static final String CATEGORY_TRANSPORT = "transport";
- field @ColorInt public static final int COLOR_DEFAULT = 0; // 0x0
- field public static final int DEFAULT_ALL = -1; // 0xffffffff
- field public static final int DEFAULT_LIGHTS = 4; // 0x4
- field public static final int DEFAULT_SOUND = 1; // 0x1
- field public static final int DEFAULT_VIBRATE = 2; // 0x2
- field public static final String EXTRA_AUDIO_CONTENTS_URI = "android.audioContents";
- field public static final String EXTRA_BACKGROUND_IMAGE_URI = "android.backgroundImageUri";
- field public static final String EXTRA_BIG_TEXT = "android.bigText";
- field public static final String EXTRA_COMPACT_ACTIONS = "android.compactActions";
- field public static final String EXTRA_CONVERSATION_TITLE = "android.conversationTitle";
- field public static final String EXTRA_HIDDEN_CONVERSATION_TITLE = "android.hiddenConversationTitle";
- field public static final String EXTRA_INFO_TEXT = "android.infoText";
- field public static final String EXTRA_IS_GROUP_CONVERSATION = "android.isGroupConversation";
- field public static final String EXTRA_LARGE_ICON = "android.largeIcon";
- field public static final String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big";
- field public static final String EXTRA_MEDIA_SESSION = "android.mediaSession";
- field public static final String EXTRA_MESSAGES = "android.messages";
- field public static final String EXTRA_MESSAGING_STYLE_USER = "android.messagingStyleUser";
- field public static final String EXTRA_PEOPLE = "android.people";
- field public static final String EXTRA_PICTURE = "android.picture";
- field public static final String EXTRA_PROGRESS = "android.progress";
- field public static final String EXTRA_PROGRESS_INDETERMINATE = "android.progressIndeterminate";
- field public static final String EXTRA_PROGRESS_MAX = "android.progressMax";
- field public static final String EXTRA_REMOTE_INPUT_HISTORY = "android.remoteInputHistory";
- field public static final String EXTRA_SELF_DISPLAY_NAME = "android.selfDisplayName";
- field public static final String EXTRA_SHOW_CHRONOMETER = "android.showChronometer";
- field public static final String EXTRA_SHOW_WHEN = "android.showWhen";
- field public static final String EXTRA_SMALL_ICON = "android.icon";
- field public static final String EXTRA_SUB_TEXT = "android.subText";
- field public static final String EXTRA_SUMMARY_TEXT = "android.summaryText";
- field public static final String EXTRA_TEMPLATE = "android.template";
- field public static final String EXTRA_TEXT = "android.text";
- field public static final String EXTRA_TEXT_LINES = "android.textLines";
- field public static final String EXTRA_TITLE = "android.title";
- field public static final String EXTRA_TITLE_BIG = "android.title.big";
- field public static final int FLAG_AUTO_CANCEL = 16; // 0x10
- field public static final int FLAG_FOREGROUND_SERVICE = 64; // 0x40
- field public static final int FLAG_GROUP_SUMMARY = 512; // 0x200
- field @Deprecated public static final int FLAG_HIGH_PRIORITY = 128; // 0x80
- field public static final int FLAG_INSISTENT = 4; // 0x4
- field public static final int FLAG_LOCAL_ONLY = 256; // 0x100
- field public static final int FLAG_NO_CLEAR = 32; // 0x20
- field public static final int FLAG_ONGOING_EVENT = 2; // 0x2
- field public static final int FLAG_ONLY_ALERT_ONCE = 8; // 0x8
- field public static final int FLAG_SHOW_LIGHTS = 1; // 0x1
- field public static final int GROUP_ALERT_ALL = 0; // 0x0
- field public static final int GROUP_ALERT_CHILDREN = 2; // 0x2
- field public static final int GROUP_ALERT_SUMMARY = 1; // 0x1
- field public static final int PRIORITY_DEFAULT = 0; // 0x0
- field public static final int PRIORITY_HIGH = 1; // 0x1
- field public static final int PRIORITY_LOW = -1; // 0xffffffff
- field public static final int PRIORITY_MAX = 2; // 0x2
- field public static final int PRIORITY_MIN = -2; // 0xfffffffe
- field public static final int STREAM_DEFAULT = -1; // 0xffffffff
- field public static final int VISIBILITY_PRIVATE = 0; // 0x0
- field public static final int VISIBILITY_PUBLIC = 1; // 0x1
- field public static final int VISIBILITY_SECRET = -1; // 0xffffffff
- }
-
- public static class NotificationCompat.Action {
- ctor public NotificationCompat.Action(int, CharSequence!, android.app.PendingIntent!);
- method public android.app.PendingIntent! getActionIntent();
- method public boolean getAllowGeneratedReplies();
- method public androidx.core.app.RemoteInput[]! getDataOnlyRemoteInputs();
- method public android.os.Bundle! getExtras();
- method public int getIcon();
- method public androidx.core.app.RemoteInput[]! getRemoteInputs();
- method @androidx.core.app.NotificationCompat.Action.SemanticAction public int getSemanticAction();
- method public boolean getShowsUserInterface();
- method public CharSequence! getTitle();
- field public static final int SEMANTIC_ACTION_ARCHIVE = 5; // 0x5
- field public static final int SEMANTIC_ACTION_CALL = 10; // 0xa
- field public static final int SEMANTIC_ACTION_DELETE = 4; // 0x4
- field public static final int SEMANTIC_ACTION_MARK_AS_READ = 2; // 0x2
- field public static final int SEMANTIC_ACTION_MARK_AS_UNREAD = 3; // 0x3
- field public static final int SEMANTIC_ACTION_MUTE = 6; // 0x6
- field public static final int SEMANTIC_ACTION_NONE = 0; // 0x0
- field public static final int SEMANTIC_ACTION_REPLY = 1; // 0x1
- field public static final int SEMANTIC_ACTION_THUMBS_DOWN = 9; // 0x9
- field public static final int SEMANTIC_ACTION_THUMBS_UP = 8; // 0x8
- field public static final int SEMANTIC_ACTION_UNMUTE = 7; // 0x7
- field public android.app.PendingIntent! actionIntent;
- field public int icon;
- field public CharSequence! title;
- }
-
- public static final class NotificationCompat.Action.Builder {
- ctor public NotificationCompat.Action.Builder(int, CharSequence!, android.app.PendingIntent!);
- ctor public NotificationCompat.Action.Builder(androidx.core.app.NotificationCompat.Action!);
- method public androidx.core.app.NotificationCompat.Action.Builder! addExtras(android.os.Bundle!);
- method public androidx.core.app.NotificationCompat.Action.Builder! addRemoteInput(androidx.core.app.RemoteInput!);
- method public androidx.core.app.NotificationCompat.Action! build();
- method public androidx.core.app.NotificationCompat.Action.Builder! extend(androidx.core.app.NotificationCompat.Action.Extender!);
- method public android.os.Bundle! getExtras();
- method public androidx.core.app.NotificationCompat.Action.Builder! setAllowGeneratedReplies(boolean);
- method public androidx.core.app.NotificationCompat.Action.Builder! setSemanticAction(@androidx.core.app.NotificationCompat.Action.SemanticAction int);
- method public androidx.core.app.NotificationCompat.Action.Builder! setShowsUserInterface(boolean);
- }
-
- public static interface NotificationCompat.Action.Extender {
- method public androidx.core.app.NotificationCompat.Action.Builder! extend(androidx.core.app.NotificationCompat.Action.Builder!);
- }
-
- @IntDef({androidx.core.app.NotificationCompat.Action.SEMANTIC_ACTION_NONE, androidx.core.app.NotificationCompat.Action.SEMANTIC_ACTION_REPLY, androidx.core.app.NotificationCompat.Action.SEMANTIC_ACTION_MARK_AS_READ, androidx.core.app.NotificationCompat.Action.SEMANTIC_ACTION_MARK_AS_UNREAD, androidx.core.app.NotificationCompat.Action.SEMANTIC_ACTION_DELETE, androidx.core.app.NotificationCompat.Action.SEMANTIC_ACTION_ARCHIVE, androidx.core.app.NotificationCompat.Action.SEMANTIC_ACTION_MUTE, androidx.core.app.NotificationCompat.Action.SEMANTIC_ACTION_UNMUTE, androidx.core.app.NotificationCompat.Action.SEMANTIC_ACTION_THUMBS_UP, androidx.core.app.NotificationCompat.Action.SEMANTIC_ACTION_THUMBS_DOWN, androidx.core.app.NotificationCompat.Action.SEMANTIC_ACTION_CALL}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface NotificationCompat.Action.SemanticAction {
- }
-
- public static final class NotificationCompat.Action.WearableExtender implements androidx.core.app.NotificationCompat.Action.Extender {
- ctor public NotificationCompat.Action.WearableExtender();
- ctor public NotificationCompat.Action.WearableExtender(androidx.core.app.NotificationCompat.Action!);
- method public androidx.core.app.NotificationCompat.Action.WearableExtender! clone();
- method public androidx.core.app.NotificationCompat.Action.Builder! extend(androidx.core.app.NotificationCompat.Action.Builder!);
- method @Deprecated public CharSequence! getCancelLabel();
- method @Deprecated public CharSequence! getConfirmLabel();
- method public boolean getHintDisplayActionInline();
- method public boolean getHintLaunchesActivity();
- method @Deprecated public CharSequence! getInProgressLabel();
- method public boolean isAvailableOffline();
- method public androidx.core.app.NotificationCompat.Action.WearableExtender! setAvailableOffline(boolean);
- method @Deprecated public androidx.core.app.NotificationCompat.Action.WearableExtender! setCancelLabel(CharSequence!);
- method @Deprecated public androidx.core.app.NotificationCompat.Action.WearableExtender! setConfirmLabel(CharSequence!);
- method public androidx.core.app.NotificationCompat.Action.WearableExtender! setHintDisplayActionInline(boolean);
- method public androidx.core.app.NotificationCompat.Action.WearableExtender! setHintLaunchesActivity(boolean);
- method @Deprecated public androidx.core.app.NotificationCompat.Action.WearableExtender! setInProgressLabel(CharSequence!);
- }
-
- public static class NotificationCompat.BigPictureStyle extends androidx.core.app.NotificationCompat.Style {
- ctor public NotificationCompat.BigPictureStyle();
- ctor public NotificationCompat.BigPictureStyle(androidx.core.app.NotificationCompat.Builder!);
- method public androidx.core.app.NotificationCompat.BigPictureStyle! bigLargeIcon(android.graphics.Bitmap!);
- method public androidx.core.app.NotificationCompat.BigPictureStyle! bigPicture(android.graphics.Bitmap!);
- method public androidx.core.app.NotificationCompat.BigPictureStyle! setBigContentTitle(CharSequence!);
- method public androidx.core.app.NotificationCompat.BigPictureStyle! setSummaryText(CharSequence!);
- }
-
- public static class NotificationCompat.BigTextStyle extends androidx.core.app.NotificationCompat.Style {
- ctor public NotificationCompat.BigTextStyle();
- ctor public NotificationCompat.BigTextStyle(androidx.core.app.NotificationCompat.Builder!);
- method public androidx.core.app.NotificationCompat.BigTextStyle! bigText(CharSequence!);
- method public androidx.core.app.NotificationCompat.BigTextStyle! setBigContentTitle(CharSequence!);
- method public androidx.core.app.NotificationCompat.BigTextStyle! setSummaryText(CharSequence!);
- }
-
- public static class NotificationCompat.Builder {
- ctor public NotificationCompat.Builder(android.content.Context, String);
- ctor @Deprecated public NotificationCompat.Builder(android.content.Context!);
- method public androidx.core.app.NotificationCompat.Builder! addAction(int, CharSequence!, android.app.PendingIntent!);
- method public androidx.core.app.NotificationCompat.Builder! addAction(androidx.core.app.NotificationCompat.Action!);
- method public androidx.core.app.NotificationCompat.Builder! addExtras(android.os.Bundle!);
- method @RequiresApi(21) public androidx.core.app.NotificationCompat.Builder! addInvisibleAction(int, CharSequence!, android.app.PendingIntent!);
- method @RequiresApi(21) public androidx.core.app.NotificationCompat.Builder! addInvisibleAction(androidx.core.app.NotificationCompat.Action!);
- method public androidx.core.app.NotificationCompat.Builder! addPerson(String!);
- method public android.app.Notification! build();
- method public androidx.core.app.NotificationCompat.Builder! extend(androidx.core.app.NotificationCompat.Extender!);
- method public android.os.Bundle! getExtras();
- method @Deprecated public android.app.Notification! getNotification();
- method protected static CharSequence! limitCharSequenceLength(CharSequence!);
- method public androidx.core.app.NotificationCompat.Builder! setAutoCancel(boolean);
- method public androidx.core.app.NotificationCompat.Builder! setBadgeIconType(int);
- method public androidx.core.app.NotificationCompat.Builder! setCategory(String!);
- method public androidx.core.app.NotificationCompat.Builder! setChannelId(String);
- method public androidx.core.app.NotificationCompat.Builder! setColor(@ColorInt int);
- method public androidx.core.app.NotificationCompat.Builder! setColorized(boolean);
- method public androidx.core.app.NotificationCompat.Builder! setContent(android.widget.RemoteViews!);
- method public androidx.core.app.NotificationCompat.Builder! setContentInfo(CharSequence!);
- method public androidx.core.app.NotificationCompat.Builder! setContentIntent(android.app.PendingIntent!);
- method public androidx.core.app.NotificationCompat.Builder! setContentText(CharSequence!);
- method public androidx.core.app.NotificationCompat.Builder! setContentTitle(CharSequence!);
- method public androidx.core.app.NotificationCompat.Builder! setCustomBigContentView(android.widget.RemoteViews!);
- method public androidx.core.app.NotificationCompat.Builder! setCustomContentView(android.widget.RemoteViews!);
- method public androidx.core.app.NotificationCompat.Builder! setCustomHeadsUpContentView(android.widget.RemoteViews!);
- method public androidx.core.app.NotificationCompat.Builder! setDefaults(int);
- method public androidx.core.app.NotificationCompat.Builder! setDeleteIntent(android.app.PendingIntent!);
- method public androidx.core.app.NotificationCompat.Builder! setExtras(android.os.Bundle!);
- method public androidx.core.app.NotificationCompat.Builder! setFullScreenIntent(android.app.PendingIntent!, boolean);
- method public androidx.core.app.NotificationCompat.Builder! setGroup(String!);
- method public androidx.core.app.NotificationCompat.Builder! setGroupAlertBehavior(int);
- method public androidx.core.app.NotificationCompat.Builder! setGroupSummary(boolean);
- method public androidx.core.app.NotificationCompat.Builder! setLargeIcon(android.graphics.Bitmap!);
- method public androidx.core.app.NotificationCompat.Builder! setLights(@ColorInt int, int, int);
- method public androidx.core.app.NotificationCompat.Builder! setLocalOnly(boolean);
- method public androidx.core.app.NotificationCompat.Builder! setNumber(int);
- method public androidx.core.app.NotificationCompat.Builder! setOngoing(boolean);
- method public androidx.core.app.NotificationCompat.Builder! setOnlyAlertOnce(boolean);
- method public androidx.core.app.NotificationCompat.Builder! setPriority(int);
- method public androidx.core.app.NotificationCompat.Builder! setProgress(int, int, boolean);
- method public androidx.core.app.NotificationCompat.Builder! setPublicVersion(android.app.Notification!);
- method public androidx.core.app.NotificationCompat.Builder! setRemoteInputHistory(CharSequence[]!);
- method public androidx.core.app.NotificationCompat.Builder! setShortcutId(String!);
- method public androidx.core.app.NotificationCompat.Builder! setShowWhen(boolean);
- method public androidx.core.app.NotificationCompat.Builder! setSmallIcon(int);
- method public androidx.core.app.NotificationCompat.Builder! setSmallIcon(int, int);
- method public androidx.core.app.NotificationCompat.Builder! setSortKey(String!);
- method public androidx.core.app.NotificationCompat.Builder! setSound(android.net.Uri!);
- method public androidx.core.app.NotificationCompat.Builder! setSound(android.net.Uri!, int);
- method public androidx.core.app.NotificationCompat.Builder! setStyle(androidx.core.app.NotificationCompat.Style!);
- method public androidx.core.app.NotificationCompat.Builder! setSubText(CharSequence!);
- method public androidx.core.app.NotificationCompat.Builder! setTicker(CharSequence!);
- method public androidx.core.app.NotificationCompat.Builder! setTicker(CharSequence!, android.widget.RemoteViews!);
- method public androidx.core.app.NotificationCompat.Builder! setTimeoutAfter(long);
- method public androidx.core.app.NotificationCompat.Builder! setUsesChronometer(boolean);
- method public androidx.core.app.NotificationCompat.Builder! setVibrate(long[]!);
- method public androidx.core.app.NotificationCompat.Builder! setVisibility(int);
- method public androidx.core.app.NotificationCompat.Builder! setWhen(long);
- field @Deprecated public java.util.ArrayList<java.lang.String>! mPeople;
- }
-
- public static final class NotificationCompat.CarExtender implements androidx.core.app.NotificationCompat.Extender {
- ctor public NotificationCompat.CarExtender();
- ctor public NotificationCompat.CarExtender(android.app.Notification!);
- method public androidx.core.app.NotificationCompat.Builder! extend(androidx.core.app.NotificationCompat.Builder!);
- method @ColorInt public int getColor();
- method public android.graphics.Bitmap! getLargeIcon();
- method public androidx.core.app.NotificationCompat.CarExtender.UnreadConversation! getUnreadConversation();
- method public androidx.core.app.NotificationCompat.CarExtender! setColor(@ColorInt int);
- method public androidx.core.app.NotificationCompat.CarExtender! setLargeIcon(android.graphics.Bitmap!);
- method public androidx.core.app.NotificationCompat.CarExtender! setUnreadConversation(androidx.core.app.NotificationCompat.CarExtender.UnreadConversation!);
- }
-
- public static class NotificationCompat.CarExtender.UnreadConversation {
- method public long getLatestTimestamp();
- method public String[]! getMessages();
- method public String! getParticipant();
- method public String[]! getParticipants();
- method public android.app.PendingIntent! getReadPendingIntent();
- method public androidx.core.app.RemoteInput! getRemoteInput();
- method public android.app.PendingIntent! getReplyPendingIntent();
- }
-
- public static class NotificationCompat.CarExtender.UnreadConversation.Builder {
- ctor public NotificationCompat.CarExtender.UnreadConversation.Builder(String!);
- method public androidx.core.app.NotificationCompat.CarExtender.UnreadConversation.Builder! addMessage(String!);
- method public androidx.core.app.NotificationCompat.CarExtender.UnreadConversation! build();
- method public androidx.core.app.NotificationCompat.CarExtender.UnreadConversation.Builder! setLatestTimestamp(long);
- method public androidx.core.app.NotificationCompat.CarExtender.UnreadConversation.Builder! setReadPendingIntent(android.app.PendingIntent!);
- method public androidx.core.app.NotificationCompat.CarExtender.UnreadConversation.Builder! setReplyAction(android.app.PendingIntent!, androidx.core.app.RemoteInput!);
- }
-
- public static class NotificationCompat.DecoratedCustomViewStyle extends androidx.core.app.NotificationCompat.Style {
- ctor public NotificationCompat.DecoratedCustomViewStyle();
- }
-
- public static interface NotificationCompat.Extender {
- method public androidx.core.app.NotificationCompat.Builder! extend(androidx.core.app.NotificationCompat.Builder!);
- }
-
- public static class NotificationCompat.InboxStyle extends androidx.core.app.NotificationCompat.Style {
- ctor public NotificationCompat.InboxStyle();
- ctor public NotificationCompat.InboxStyle(androidx.core.app.NotificationCompat.Builder!);
- method public androidx.core.app.NotificationCompat.InboxStyle! addLine(CharSequence!);
- method public androidx.core.app.NotificationCompat.InboxStyle! setBigContentTitle(CharSequence!);
- method public androidx.core.app.NotificationCompat.InboxStyle! setSummaryText(CharSequence!);
- }
-
- public static class NotificationCompat.MessagingStyle extends androidx.core.app.NotificationCompat.Style {
- ctor @Deprecated public NotificationCompat.MessagingStyle(CharSequence);
- ctor public NotificationCompat.MessagingStyle(androidx.core.app.Person);
- method public void addCompatExtras(android.os.Bundle!);
- method @Deprecated public androidx.core.app.NotificationCompat.MessagingStyle! addMessage(CharSequence!, long, CharSequence!);
- method public androidx.core.app.NotificationCompat.MessagingStyle! addMessage(CharSequence!, long, androidx.core.app.Person!);
- method public androidx.core.app.NotificationCompat.MessagingStyle! addMessage(androidx.core.app.NotificationCompat.MessagingStyle.Message!);
- method public static androidx.core.app.NotificationCompat.MessagingStyle? extractMessagingStyleFromNotification(android.app.Notification!);
- method public CharSequence? getConversationTitle();
- method public java.util.List<androidx.core.app.NotificationCompat.MessagingStyle.Message>! getMessages();
- method public androidx.core.app.Person! getUser();
- method @Deprecated public CharSequence! getUserDisplayName();
- method public boolean isGroupConversation();
- method public androidx.core.app.NotificationCompat.MessagingStyle! setConversationTitle(CharSequence?);
- method public androidx.core.app.NotificationCompat.MessagingStyle! setGroupConversation(boolean);
- field public static final int MAXIMUM_RETAINED_MESSAGES = 25; // 0x19
- }
-
- public static final class NotificationCompat.MessagingStyle.Message {
- ctor public NotificationCompat.MessagingStyle.Message(CharSequence!, long, androidx.core.app.Person?);
- ctor @Deprecated public NotificationCompat.MessagingStyle.Message(CharSequence!, long, CharSequence!);
- method public String? getDataMimeType();
- method public android.net.Uri? getDataUri();
- method public android.os.Bundle getExtras();
- method public androidx.core.app.Person? getPerson();
- method @Deprecated public CharSequence? getSender();
- method public CharSequence getText();
- method public long getTimestamp();
- method public androidx.core.app.NotificationCompat.MessagingStyle.Message! setData(String!, android.net.Uri!);
- }
-
- public abstract static class NotificationCompat.Style {
- ctor public NotificationCompat.Style();
- method public android.app.Notification! build();
- method public void setBuilder(androidx.core.app.NotificationCompat.Builder!);
- }
-
- public static final class NotificationCompat.WearableExtender implements androidx.core.app.NotificationCompat.Extender {
- ctor public NotificationCompat.WearableExtender();
- ctor public NotificationCompat.WearableExtender(android.app.Notification!);
- method public androidx.core.app.NotificationCompat.WearableExtender! addAction(androidx.core.app.NotificationCompat.Action!);
- method public androidx.core.app.NotificationCompat.WearableExtender! addActions(java.util.List<androidx.core.app.NotificationCompat.Action>!);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! addPage(android.app.Notification!);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! addPages(java.util.List<android.app.Notification>!);
- method public androidx.core.app.NotificationCompat.WearableExtender! clearActions();
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! clearPages();
- method public androidx.core.app.NotificationCompat.WearableExtender! clone();
- method public androidx.core.app.NotificationCompat.Builder! extend(androidx.core.app.NotificationCompat.Builder!);
- method public java.util.List<androidx.core.app.NotificationCompat.Action>! getActions();
- method @Deprecated public android.graphics.Bitmap! getBackground();
- method public String! getBridgeTag();
- method public int getContentAction();
- method @Deprecated public int getContentIcon();
- method @Deprecated public int getContentIconGravity();
- method public boolean getContentIntentAvailableOffline();
- method @Deprecated public int getCustomContentHeight();
- method @Deprecated public int getCustomSizePreset();
- method public String! getDismissalId();
- method @Deprecated public android.app.PendingIntent! getDisplayIntent();
- method @Deprecated public int getGravity();
- method @Deprecated public boolean getHintAmbientBigPicture();
- method @Deprecated public boolean getHintAvoidBackgroundClipping();
- method public boolean getHintContentIntentLaunchesActivity();
- method @Deprecated public boolean getHintHideIcon();
- method @Deprecated public int getHintScreenTimeout();
- method @Deprecated public boolean getHintShowBackgroundOnly();
- method @Deprecated public java.util.List<android.app.Notification>! getPages();
- method public boolean getStartScrollBottom();
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! setBackground(android.graphics.Bitmap!);
- method public androidx.core.app.NotificationCompat.WearableExtender! setBridgeTag(String!);
- method public androidx.core.app.NotificationCompat.WearableExtender! setContentAction(int);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! setContentIcon(int);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! setContentIconGravity(int);
- method public androidx.core.app.NotificationCompat.WearableExtender! setContentIntentAvailableOffline(boolean);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! setCustomContentHeight(int);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! setCustomSizePreset(int);
- method public androidx.core.app.NotificationCompat.WearableExtender! setDismissalId(String!);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! setDisplayIntent(android.app.PendingIntent!);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! setGravity(int);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! setHintAmbientBigPicture(boolean);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! setHintAvoidBackgroundClipping(boolean);
- method public androidx.core.app.NotificationCompat.WearableExtender! setHintContentIntentLaunchesActivity(boolean);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! setHintHideIcon(boolean);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! setHintScreenTimeout(int);
- method @Deprecated public androidx.core.app.NotificationCompat.WearableExtender! setHintShowBackgroundOnly(boolean);
- method public androidx.core.app.NotificationCompat.WearableExtender! setStartScrollBottom(boolean);
- field @Deprecated public static final int SCREEN_TIMEOUT_LONG = -1; // 0xffffffff
- field @Deprecated public static final int SCREEN_TIMEOUT_SHORT = 0; // 0x0
- field @Deprecated public static final int SIZE_DEFAULT = 0; // 0x0
- field @Deprecated public static final int SIZE_FULL_SCREEN = 5; // 0x5
- field @Deprecated public static final int SIZE_LARGE = 4; // 0x4
- field @Deprecated public static final int SIZE_MEDIUM = 3; // 0x3
- field @Deprecated public static final int SIZE_SMALL = 2; // 0x2
- field @Deprecated public static final int SIZE_XSMALL = 1; // 0x1
- field public static final int UNSET_ACTION_INDEX = -1; // 0xffffffff
- }
-
- public final class NotificationCompatExtras {
- field public static final String EXTRA_ACTION_EXTRAS = "android.support.actionExtras";
- field public static final String EXTRA_GROUP_KEY = "android.support.groupKey";
- field public static final String EXTRA_GROUP_SUMMARY = "android.support.isGroupSummary";
- field public static final String EXTRA_LOCAL_ONLY = "android.support.localOnly";
- field public static final String EXTRA_REMOTE_INPUTS = "android.support.remoteInputs";
- field public static final String EXTRA_SORT_KEY = "android.support.sortKey";
- }
-
- public abstract class NotificationCompatSideChannelService extends android.app.Service {
- ctor public NotificationCompatSideChannelService();
- method public abstract void cancel(String!, int, String!);
- method public abstract void cancelAll(String!);
- method public abstract void notify(String!, int, String!, android.app.Notification!);
- method public android.os.IBinder! onBind(android.content.Intent!);
- }
-
- public final class NotificationManagerCompat {
- method public boolean areNotificationsEnabled();
- method public void cancel(int);
- method public void cancel(String?, int);
- method public void cancelAll();
- method public void createNotificationChannel(android.app.NotificationChannel);
- method public void createNotificationChannelGroup(android.app.NotificationChannelGroup);
- method public void createNotificationChannelGroups(java.util.List<android.app.NotificationChannelGroup>);
- method public void createNotificationChannels(java.util.List<android.app.NotificationChannel>);
- method public void deleteNotificationChannel(String);
- method public void deleteNotificationChannelGroup(String);
- method public static androidx.core.app.NotificationManagerCompat from(android.content.Context);
- method public static java.util.Set<java.lang.String> getEnabledListenerPackages(android.content.Context);
- method public int getImportance();
- method public android.app.NotificationChannel? getNotificationChannel(String);
- method public android.app.NotificationChannelGroup? getNotificationChannelGroup(String);
- method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups();
- method public java.util.List<android.app.NotificationChannel> getNotificationChannels();
- method public void notify(int, android.app.Notification);
- method public void notify(String?, int, android.app.Notification);
- field public static final String ACTION_BIND_SIDE_CHANNEL = "android.support.BIND_NOTIFICATION_SIDE_CHANNEL";
- field public static final String EXTRA_USE_SIDE_CHANNEL = "android.support.useSideChannel";
- field public static final int IMPORTANCE_DEFAULT = 3; // 0x3
- field public static final int IMPORTANCE_HIGH = 4; // 0x4
- field public static final int IMPORTANCE_LOW = 2; // 0x2
- field public static final int IMPORTANCE_MAX = 5; // 0x5
- field public static final int IMPORTANCE_MIN = 1; // 0x1
- field public static final int IMPORTANCE_NONE = 0; // 0x0
- field public static final int IMPORTANCE_UNSPECIFIED = -1000; // 0xfffffc18
- }
-
- public class Person {
- method public static androidx.core.app.Person fromBundle(android.os.Bundle);
- method public androidx.core.graphics.drawable.IconCompat? getIcon();
- method public String? getKey();
- method public CharSequence? getName();
- method public String? getUri();
- method public boolean isBot();
- method public boolean isImportant();
- method public androidx.core.app.Person.Builder toBuilder();
- method public android.os.Bundle toBundle();
- }
-
- public static class Person.Builder {
- ctor public Person.Builder();
- method public androidx.core.app.Person build();
- method public androidx.core.app.Person.Builder setBot(boolean);
- method public androidx.core.app.Person.Builder setIcon(androidx.core.graphics.drawable.IconCompat?);
- method public androidx.core.app.Person.Builder setImportant(boolean);
- method public androidx.core.app.Person.Builder setKey(String?);
- method public androidx.core.app.Person.Builder setName(CharSequence?);
- method public androidx.core.app.Person.Builder setUri(String?);
- }
-
- public final class RemoteActionCompat {
- ctor public RemoteActionCompat(androidx.core.graphics.drawable.IconCompat, CharSequence, CharSequence, android.app.PendingIntent);
- ctor public RemoteActionCompat(androidx.core.app.RemoteActionCompat);
- method public static androidx.core.app.RemoteActionCompat createFromBundle(android.os.Bundle);
- method @RequiresApi(26) public static androidx.core.app.RemoteActionCompat createFromRemoteAction(android.app.RemoteAction);
- method public android.app.PendingIntent getActionIntent();
- method public CharSequence getContentDescription();
- method public androidx.core.graphics.drawable.IconCompat getIcon();
- method public CharSequence getTitle();
- method public boolean isEnabled();
- method public void setEnabled(boolean);
- method public void setShouldShowIcon(boolean);
- method public boolean shouldShowIcon();
- method public android.os.Bundle toBundle();
- method @RequiresApi(26) public android.app.RemoteAction toRemoteAction();
- }
-
- public final class RemoteInput {
- method public static void addDataResultToIntent(androidx.core.app.RemoteInput!, android.content.Intent!, java.util.Map<java.lang.String,android.net.Uri>!);
- method public static void addResultsToIntent(androidx.core.app.RemoteInput[]!, android.content.Intent!, android.os.Bundle!);
- method public boolean getAllowFreeFormInput();
- method public java.util.Set<java.lang.String>! getAllowedDataTypes();
- method public CharSequence[]! getChoices();
- method public static java.util.Map<java.lang.String,android.net.Uri>! getDataResultsFromIntent(android.content.Intent!, String!);
- method public android.os.Bundle! getExtras();
- method public CharSequence! getLabel();
- method public String! getResultKey();
- method public static android.os.Bundle! getResultsFromIntent(android.content.Intent!);
- method public static int getResultsSource(android.content.Intent);
- method public boolean isDataOnly();
- method public static void setResultsSource(android.content.Intent, int);
- field public static final String EXTRA_RESULTS_DATA = "android.remoteinput.resultsData";
- field public static final String RESULTS_CLIP_LABEL = "android.remoteinput.results";
- field public static final int SOURCE_CHOICE = 1; // 0x1
- field public static final int SOURCE_FREE_FORM_INPUT = 0; // 0x0
- }
-
- public static final class RemoteInput.Builder {
- ctor public RemoteInput.Builder(String);
- method public androidx.core.app.RemoteInput.Builder addExtras(android.os.Bundle);
- method public androidx.core.app.RemoteInput build();
- method public android.os.Bundle getExtras();
- method public androidx.core.app.RemoteInput.Builder setAllowDataType(String, boolean);
- method public androidx.core.app.RemoteInput.Builder setAllowFreeFormInput(boolean);
- method public androidx.core.app.RemoteInput.Builder setChoices(CharSequence[]?);
- method public androidx.core.app.RemoteInput.Builder setLabel(CharSequence?);
- }
-
- public final class ServiceCompat {
- method public static void stopForeground(android.app.Service, int);
- field public static final int START_STICKY = 1; // 0x1
- field public static final int STOP_FOREGROUND_DETACH = 2; // 0x2
- field public static final int STOP_FOREGROUND_REMOVE = 1; // 0x1
- }
-
- public final class ShareCompat {
- method public static void configureMenuItem(android.view.MenuItem!, androidx.core.app.ShareCompat.IntentBuilder!);
- method public static void configureMenuItem(android.view.Menu!, int, androidx.core.app.ShareCompat.IntentBuilder!);
- method public static android.content.ComponentName! getCallingActivity(android.app.Activity!);
- method public static String! getCallingPackage(android.app.Activity!);
- field public static final String EXTRA_CALLING_ACTIVITY = "androidx.core.app.EXTRA_CALLING_ACTIVITY";
- field public static final String EXTRA_CALLING_PACKAGE = "androidx.core.app.EXTRA_CALLING_PACKAGE";
- }
-
- public static class ShareCompat.IntentBuilder {
- method public androidx.core.app.ShareCompat.IntentBuilder! addEmailBcc(String!);
- method public androidx.core.app.ShareCompat.IntentBuilder! addEmailBcc(String[]!);
- method public androidx.core.app.ShareCompat.IntentBuilder! addEmailCc(String!);
- method public androidx.core.app.ShareCompat.IntentBuilder! addEmailCc(String[]!);
- method public androidx.core.app.ShareCompat.IntentBuilder! addEmailTo(String!);
- method public androidx.core.app.ShareCompat.IntentBuilder! addEmailTo(String[]!);
- method public androidx.core.app.ShareCompat.IntentBuilder! addStream(android.net.Uri!);
- method public android.content.Intent! createChooserIntent();
- method public static androidx.core.app.ShareCompat.IntentBuilder! from(android.app.Activity!);
- method public android.content.Intent! getIntent();
- method public androidx.core.app.ShareCompat.IntentBuilder! setChooserTitle(CharSequence!);
- method public androidx.core.app.ShareCompat.IntentBuilder! setChooserTitle(@StringRes int);
- method public androidx.core.app.ShareCompat.IntentBuilder! setEmailBcc(String[]!);
- method public androidx.core.app.ShareCompat.IntentBuilder! setEmailCc(String[]!);
- method public androidx.core.app.ShareCompat.IntentBuilder! setEmailTo(String[]!);
- method public androidx.core.app.ShareCompat.IntentBuilder! setHtmlText(String!);
- method public androidx.core.app.ShareCompat.IntentBuilder! setStream(android.net.Uri!);
- method public androidx.core.app.ShareCompat.IntentBuilder! setSubject(String!);
- method public androidx.core.app.ShareCompat.IntentBuilder! setText(CharSequence!);
- method public androidx.core.app.ShareCompat.IntentBuilder! setType(String!);
- method public void startChooser();
- }
-
- public static class ShareCompat.IntentReader {
- method public static androidx.core.app.ShareCompat.IntentReader! from(android.app.Activity!);
- method public android.content.ComponentName! getCallingActivity();
- method public android.graphics.drawable.Drawable! getCallingActivityIcon();
- method public android.graphics.drawable.Drawable! getCallingApplicationIcon();
- method public CharSequence! getCallingApplicationLabel();
- method public String! getCallingPackage();
- method public String[]! getEmailBcc();
- method public String[]! getEmailCc();
- method public String[]! getEmailTo();
- method public String! getHtmlText();
- method public android.net.Uri! getStream();
- method public android.net.Uri! getStream(int);
- method public int getStreamCount();
- method public String! getSubject();
- method public CharSequence! getText();
- method public String! getType();
- method public boolean isMultipleShare();
- method public boolean isShareIntent();
- method public boolean isSingleShare();
- }
-
- public abstract class SharedElementCallback {
- ctor public SharedElementCallback();
- method public android.os.Parcelable! onCaptureSharedElementSnapshot(android.view.View!, android.graphics.Matrix!, android.graphics.RectF!);
- method public android.view.View! onCreateSnapshotView(android.content.Context!, android.os.Parcelable!);
- method public void onMapSharedElements(java.util.List<java.lang.String>!, java.util.Map<java.lang.String,android.view.View>!);
- method public void onRejectSharedElements(java.util.List<android.view.View>!);
- method public void onSharedElementEnd(java.util.List<java.lang.String>!, java.util.List<android.view.View>!, java.util.List<android.view.View>!);
- method public void onSharedElementStart(java.util.List<java.lang.String>!, java.util.List<android.view.View>!, java.util.List<android.view.View>!);
- method public void onSharedElementsArrived(java.util.List<java.lang.String>!, java.util.List<android.view.View>!, androidx.core.app.SharedElementCallback.OnSharedElementsReadyListener!);
- }
-
- public static interface SharedElementCallback.OnSharedElementsReadyListener {
- method public void onSharedElementsReady();
- }
-
- public final class TaskStackBuilder implements java.lang.Iterable<android.content.Intent> {
- method public androidx.core.app.TaskStackBuilder addNextIntent(android.content.Intent);
- method public androidx.core.app.TaskStackBuilder addNextIntentWithParentStack(android.content.Intent);
- method public androidx.core.app.TaskStackBuilder addParentStack(android.app.Activity);
- method public androidx.core.app.TaskStackBuilder addParentStack(Class<?>);
- method public androidx.core.app.TaskStackBuilder! addParentStack(android.content.ComponentName!);
- method public static androidx.core.app.TaskStackBuilder create(android.content.Context);
- method public android.content.Intent? editIntentAt(int);
- method @Deprecated public static androidx.core.app.TaskStackBuilder! from(android.content.Context!);
- method @Deprecated public android.content.Intent! getIntent(int);
- method public int getIntentCount();
- method public android.content.Intent[] getIntents();
- method public android.app.PendingIntent? getPendingIntent(int, int);
- method public android.app.PendingIntent? getPendingIntent(int, int, android.os.Bundle?);
- method @Deprecated public java.util.Iterator<android.content.Intent>! iterator();
- method public void startActivities();
- method public void startActivities(android.os.Bundle?);
- }
-
- public static interface TaskStackBuilder.SupportParentable {
- method public android.content.Intent? getSupportParentActivityIntent();
- }
-
-}
-
-package androidx.core.content {
-
- public final class ContentResolverCompat {
- method public static android.database.Cursor! query(android.content.ContentResolver!, android.net.Uri!, String[]!, String!, String[]!, String!, androidx.core.os.CancellationSignal!);
- }
-
- public class ContextCompat {
- ctor protected ContextCompat();
- method public static int checkSelfPermission(android.content.Context, String);
- method public static android.content.Context? createDeviceProtectedStorageContext(android.content.Context);
- method public static java.io.File! getCodeCacheDir(android.content.Context);
- method @ColorInt public static int getColor(android.content.Context, @ColorRes int);
- method public static android.content.res.ColorStateList? getColorStateList(android.content.Context, @ColorRes int);
- method public static java.io.File? getDataDir(android.content.Context);
- method public static android.graphics.drawable.Drawable? getDrawable(android.content.Context, @DrawableRes int);
- method public static java.io.File[] getExternalCacheDirs(android.content.Context);
- method public static java.io.File[] getExternalFilesDirs(android.content.Context, String?);
- method public static java.util.concurrent.Executor! getMainExecutor(android.content.Context!);
- method public static java.io.File? getNoBackupFilesDir(android.content.Context);
- method public static java.io.File[] getObbDirs(android.content.Context);
- method public static <T> T? getSystemService(android.content.Context, Class<T>);
- method public static String? getSystemServiceName(android.content.Context, Class<?>);
- method public static boolean isDeviceProtectedStorage(android.content.Context);
- method public static boolean startActivities(android.content.Context, android.content.Intent[]);
- method public static boolean startActivities(android.content.Context, android.content.Intent[], android.os.Bundle?);
- method public static void startActivity(android.content.Context, android.content.Intent, android.os.Bundle?);
- method public static void startForegroundService(android.content.Context, android.content.Intent);
- }
-
- public class FileProvider extends android.content.ContentProvider {
- ctor public FileProvider();
- method public int delete(android.net.Uri, String?, String[]?);
- method public String! getType(android.net.Uri);
- method public static android.net.Uri! getUriForFile(android.content.Context, String, java.io.File);
- method public android.net.Uri! insert(android.net.Uri, android.content.ContentValues!);
- method public boolean onCreate();
- method public android.database.Cursor! query(android.net.Uri, String[]?, String?, String[]?, String?);
- method public int update(android.net.Uri, android.content.ContentValues!, String?, String[]?);
- }
-
- public final class IntentCompat {
- method public static android.content.Intent makeMainSelectorActivity(String, String);
- field public static final String CATEGORY_LEANBACK_LAUNCHER = "android.intent.category.LEANBACK_LAUNCHER";
- field public static final String EXTRA_HTML_TEXT = "android.intent.extra.HTML_TEXT";
- field public static final String EXTRA_START_PLAYBACK = "android.intent.extra.START_PLAYBACK";
- }
-
- public final class MimeTypeFilter {
- method public static boolean matches(String?, String);
- method public static String? matches(String?, String[]);
- method public static String? matches(String[]?, String);
- method public static String[] matchesMany(String[]?, String);
- }
-
- public final class PermissionChecker {
- method public static int checkCallingOrSelfPermission(android.content.Context, String);
- method public static int checkCallingPermission(android.content.Context, String, String?);
- method public static int checkPermission(android.content.Context, String, int, int, String?);
- method public static int checkSelfPermission(android.content.Context, String);
- field public static final int PERMISSION_DENIED = -1; // 0xffffffff
- field public static final int PERMISSION_DENIED_APP_OP = -2; // 0xfffffffe
- field public static final int PERMISSION_GRANTED = 0; // 0x0
- }
-
- @Deprecated public final class SharedPreferencesCompat {
- }
-
- @Deprecated public static final class SharedPreferencesCompat.EditorCompat {
- method @Deprecated public void apply(android.content.SharedPreferences.Editor);
- method @Deprecated public static androidx.core.content.SharedPreferencesCompat.EditorCompat! getInstance();
- }
-
-}
-
-package androidx.core.content.pm {
-
- @Deprecated public final class ActivityInfoCompat {
- field @Deprecated public static final int CONFIG_UI_MODE = 512; // 0x200
- }
-
- public final class PackageInfoCompat {
- method public static long getLongVersionCode(android.content.pm.PackageInfo);
- }
-
- public final class PermissionInfoCompat {
- method public static int getProtection(android.content.pm.PermissionInfo);
- method public static int getProtectionFlags(android.content.pm.PermissionInfo);
- }
-
- public class ShortcutInfoCompat {
- method public android.content.ComponentName? getActivity();
- method public java.util.Set<java.lang.String>? getCategories();
- method public CharSequence? getDisabledMessage();
- method public String getId();
- method public android.content.Intent getIntent();
- method public android.content.Intent[] getIntents();
- method public CharSequence? getLongLabel();
- method public CharSequence getShortLabel();
- method @RequiresApi(25) public android.content.pm.ShortcutInfo! toShortcutInfo();
- }
-
- public static class ShortcutInfoCompat.Builder {
- ctor public ShortcutInfoCompat.Builder(android.content.Context, String);
- method public androidx.core.content.pm.ShortcutInfoCompat build();
- method public androidx.core.content.pm.ShortcutInfoCompat.Builder setActivity(android.content.ComponentName);
- method public androidx.core.content.pm.ShortcutInfoCompat.Builder setAlwaysBadged();
- method public androidx.core.content.pm.ShortcutInfoCompat.Builder setCategories(java.util.Set<java.lang.String>);
- method public androidx.core.content.pm.ShortcutInfoCompat.Builder setDisabledMessage(CharSequence);
- method public androidx.core.content.pm.ShortcutInfoCompat.Builder setIcon(androidx.core.graphics.drawable.IconCompat!);
- method public androidx.core.content.pm.ShortcutInfoCompat.Builder setIntent(android.content.Intent);
- method public androidx.core.content.pm.ShortcutInfoCompat.Builder setIntents(android.content.Intent[]);
- method public androidx.core.content.pm.ShortcutInfoCompat.Builder setLongLabel(CharSequence);
- method public androidx.core.content.pm.ShortcutInfoCompat.Builder setLongLived();
- method public androidx.core.content.pm.ShortcutInfoCompat.Builder setPerson(androidx.core.app.Person);
- method public androidx.core.content.pm.ShortcutInfoCompat.Builder setPersons(androidx.core.app.Person[]);
- method public androidx.core.content.pm.ShortcutInfoCompat.Builder setShortLabel(CharSequence);
- }
-
- public class ShortcutManagerCompat {
- method public static boolean addDynamicShortcuts(android.content.Context, java.util.List<androidx.core.content.pm.ShortcutInfoCompat>);
- method public static android.content.Intent createShortcutResultIntent(android.content.Context, androidx.core.content.pm.ShortcutInfoCompat);
- method public static java.util.List<androidx.core.content.pm.ShortcutInfoCompat> getDynamicShortcuts(android.content.Context);
- method public static int getMaxShortcutCountPerActivity(android.content.Context);
- method public static boolean isRequestPinShortcutSupported(android.content.Context);
- method public static void removeAllDynamicShortcuts(android.content.Context);
- method public void removeDynamicShortcuts(android.content.Context, java.util.List<java.lang.String>);
- method public static boolean requestPinShortcut(android.content.Context, androidx.core.content.pm.ShortcutInfoCompat, android.content.IntentSender?);
- method public static boolean updateShortcuts(android.content.Context, java.util.List<androidx.core.content.pm.ShortcutInfoCompat>);
- field public static final String EXTRA_SHORTCUT_ID = "android.intent.extra.shortcut.ID";
- }
-
-}
-
-package androidx.core.content.res {
-
- public final class ConfigurationHelper {
- method public static int getDensityDpi(android.content.res.Resources);
- }
-
- public final class ResourcesCompat {
- method @ColorInt public static int getColor(android.content.res.Resources, @ColorRes int, android.content.res.Resources.Theme?) throws android.content.res.Resources.NotFoundException;
- method public static android.content.res.ColorStateList? getColorStateList(android.content.res.Resources, @ColorRes int, android.content.res.Resources.Theme?) throws android.content.res.Resources.NotFoundException;
- method public static android.graphics.drawable.Drawable? getDrawable(android.content.res.Resources, @DrawableRes int, android.content.res.Resources.Theme?) throws android.content.res.Resources.NotFoundException;
- method public static android.graphics.drawable.Drawable? getDrawableForDensity(android.content.res.Resources, @DrawableRes int, int, android.content.res.Resources.Theme?) throws android.content.res.Resources.NotFoundException;
- method public static float getFloat(android.content.res.Resources, @DimenRes int);
- method public static android.graphics.Typeface? getFont(android.content.Context, @FontRes int) throws android.content.res.Resources.NotFoundException;
- method public static void getFont(android.content.Context, @FontRes int, androidx.core.content.res.ResourcesCompat.FontCallback, android.os.Handler?) throws android.content.res.Resources.NotFoundException;
- }
-
- public abstract static class ResourcesCompat.FontCallback {
- ctor public ResourcesCompat.FontCallback();
- method public abstract void onFontRetrievalFailed(int);
- method public abstract void onFontRetrieved(android.graphics.Typeface);
- }
-
-}
-
-package androidx.core.database {
-
- public final class CursorWindowCompat {
- method public static android.database.CursorWindow create(String?, long);
- }
-
- @Deprecated public final class DatabaseUtilsCompat {
- method @Deprecated public static String[]! appendSelectionArgs(String[]!, String[]!);
- method @Deprecated public static String! concatenateWhere(String!, String!);
- }
-
-}
-
-package androidx.core.database.sqlite {
-
- public final class SQLiteCursorCompat {
- method public static void setFillWindowForwardOnly(android.database.sqlite.SQLiteCursor, boolean);
- }
-
-}
-
-package androidx.core.graphics {
-
- public final class BitmapCompat {
- method public static int getAllocationByteCount(android.graphics.Bitmap);
- method public static boolean hasMipMap(android.graphics.Bitmap);
- method public static void setHasMipMap(android.graphics.Bitmap, boolean);
- }
-
- public final class ColorUtils {
- method @ColorInt public static int HSLToColor(float[]);
- method @ColorInt public static int LABToColor(@FloatRange(from=0.0f, to=100) double, @FloatRange(from=0xffffff80, to=127) double, @FloatRange(from=0xffffff80, to=127) double);
- method public static void LABToXYZ(@FloatRange(from=0.0f, to=100) double, @FloatRange(from=0xffffff80, to=127) double, @FloatRange(from=0xffffff80, to=127) double, double[]);
- method public static void RGBToHSL(@IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int, float[]);
- method public static void RGBToLAB(@IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int, double[]);
- method public static void RGBToXYZ(@IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int, @IntRange(from=0, to=255) int, double[]);
- method @ColorInt public static int XYZToColor(@FloatRange(from=0.0f, to=androidx.core.graphics.ColorUtils.XYZ_WHITE_REFERENCE_X) double, @FloatRange(from=0.0f, to=androidx.core.graphics.ColorUtils.XYZ_WHITE_REFERENCE_Y) double, @FloatRange(from=0.0f, to=androidx.core.graphics.ColorUtils.XYZ_WHITE_REFERENCE_Z) double);
- method public static void XYZToLAB(@FloatRange(from=0.0f, to=androidx.core.graphics.ColorUtils.XYZ_WHITE_REFERENCE_X) double, @FloatRange(from=0.0f, to=androidx.core.graphics.ColorUtils.XYZ_WHITE_REFERENCE_Y) double, @FloatRange(from=0.0f, to=androidx.core.graphics.ColorUtils.XYZ_WHITE_REFERENCE_Z) double, double[]);
- method @ColorInt public static int blendARGB(@ColorInt int, @ColorInt int, @FloatRange(from=0.0, to=1.0) float);
- method public static void blendHSL(float[], float[], @FloatRange(from=0.0, to=1.0) float, float[]);
- method public static void blendLAB(double[], double[], @FloatRange(from=0.0, to=1.0) double, double[]);
- method public static double calculateContrast(@ColorInt int, @ColorInt int);
- method @FloatRange(from=0.0, to=1.0) public static double calculateLuminance(@ColorInt int);
- method public static int calculateMinimumAlpha(@ColorInt int, @ColorInt int, float);
- method public static void colorToHSL(@ColorInt int, float[]);
- method public static void colorToLAB(@ColorInt int, double[]);
- method public static void colorToXYZ(@ColorInt int, double[]);
- method public static int compositeColors(@ColorInt int, @ColorInt int);
- method @RequiresApi(26) public static android.graphics.Color compositeColors(android.graphics.Color, android.graphics.Color);
- method public static double distanceEuclidean(double[], double[]);
- method @ColorInt public static int setAlphaComponent(@ColorInt int, @IntRange(from=0, to=255) int);
- }
-
- public final class PaintCompat {
- method public static boolean hasGlyph(android.graphics.Paint, String);
- }
-
- public final class PathSegment {
- ctor public PathSegment(android.graphics.PointF, float, android.graphics.PointF, float);
- method public android.graphics.PointF getEnd();
- method public float getEndFraction();
- method public android.graphics.PointF getStart();
- method public float getStartFraction();
- }
-
- public final class PathUtils {
- method @RequiresApi(26) public static java.util.Collection<androidx.core.graphics.PathSegment> flatten(android.graphics.Path);
- method @RequiresApi(26) public static java.util.Collection<androidx.core.graphics.PathSegment> flatten(android.graphics.Path, @FloatRange(from=0) float);
- }
-
- public class TypefaceCompat {
- method public static android.graphics.Typeface create(android.content.Context, android.graphics.Typeface?, int);
- }
-
-}
-
-package androidx.core.graphics.drawable {
-
- public final class DrawableCompat {
- method public static void applyTheme(android.graphics.drawable.Drawable, android.content.res.Resources.Theme);
- method public static boolean canApplyTheme(android.graphics.drawable.Drawable);
- method public static void clearColorFilter(android.graphics.drawable.Drawable);
- method public static int getAlpha(android.graphics.drawable.Drawable);
- method public static android.graphics.ColorFilter! getColorFilter(android.graphics.drawable.Drawable);
- method public static int getLayoutDirection(android.graphics.drawable.Drawable);
- method public static void inflate(android.graphics.drawable.Drawable, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public static boolean isAutoMirrored(android.graphics.drawable.Drawable);
- method @Deprecated public static void jumpToCurrentState(android.graphics.drawable.Drawable);
- method public static void setAutoMirrored(android.graphics.drawable.Drawable, boolean);
- method public static void setHotspot(android.graphics.drawable.Drawable, float, float);
- method public static void setHotspotBounds(android.graphics.drawable.Drawable, int, int, int, int);
- method public static boolean setLayoutDirection(android.graphics.drawable.Drawable, int);
- method public static void setTint(android.graphics.drawable.Drawable, @ColorInt int);
- method public static void setTintList(android.graphics.drawable.Drawable, android.content.res.ColorStateList?);
- method public static void setTintMode(android.graphics.drawable.Drawable, android.graphics.PorterDuff.Mode);
- method public static <T extends android.graphics.drawable.Drawable> T! unwrap(android.graphics.drawable.Drawable);
- method public static android.graphics.drawable.Drawable! wrap(android.graphics.drawable.Drawable);
- }
-
- public class IconCompat extends androidx.versionedparcelable.CustomVersionedParcelable {
- method public static androidx.core.graphics.drawable.IconCompat? createFromBundle(android.os.Bundle);
- method @RequiresApi(23) public static androidx.core.graphics.drawable.IconCompat? createFromIcon(android.content.Context, android.graphics.drawable.Icon);
- method public static androidx.core.graphics.drawable.IconCompat! createWithAdaptiveBitmap(android.graphics.Bitmap!);
- method public static androidx.core.graphics.drawable.IconCompat! createWithBitmap(android.graphics.Bitmap!);
- method public static androidx.core.graphics.drawable.IconCompat! createWithContentUri(String!);
- method public static androidx.core.graphics.drawable.IconCompat! createWithContentUri(android.net.Uri!);
- method public static androidx.core.graphics.drawable.IconCompat! createWithData(byte[]!, int, int);
- method public static androidx.core.graphics.drawable.IconCompat! createWithResource(android.content.Context!, @DrawableRes int);
- method @IdRes public int getResId();
- method public String getResPackage();
- method public int getType();
- method public android.net.Uri getUri();
- method public android.graphics.drawable.Drawable! loadDrawable(android.content.Context!);
- method public androidx.core.graphics.drawable.IconCompat! setTint(@ColorInt int);
- method public androidx.core.graphics.drawable.IconCompat! setTintList(android.content.res.ColorStateList!);
- method public androidx.core.graphics.drawable.IconCompat! setTintMode(android.graphics.PorterDuff.Mode!);
- method public android.os.Bundle! toBundle();
- method @RequiresApi(23) public android.graphics.drawable.Icon! toIcon();
- field public static final int TYPE_UNKNOWN = -1; // 0xffffffff
- }
-
- public abstract class RoundedBitmapDrawable extends android.graphics.drawable.Drawable {
- method public void draw(android.graphics.Canvas);
- method public final android.graphics.Bitmap? getBitmap();
- method public float getCornerRadius();
- method public int getGravity();
- method public int getOpacity();
- method public final android.graphics.Paint getPaint();
- method public boolean hasAntiAlias();
- method public boolean hasMipMap();
- method public boolean isCircular();
- method public void setAlpha(int);
- method public void setAntiAlias(boolean);
- method public void setCircular(boolean);
- method public void setColorFilter(android.graphics.ColorFilter!);
- method public void setCornerRadius(float);
- method public void setDither(boolean);
- method public void setGravity(int);
- method public void setMipMap(boolean);
- method public void setTargetDensity(android.graphics.Canvas);
- method public void setTargetDensity(android.util.DisplayMetrics);
- method public void setTargetDensity(int);
- }
-
- public final class RoundedBitmapDrawableFactory {
- method public static androidx.core.graphics.drawable.RoundedBitmapDrawable create(android.content.res.Resources, android.graphics.Bitmap?);
- method public static androidx.core.graphics.drawable.RoundedBitmapDrawable create(android.content.res.Resources, String);
- method public static androidx.core.graphics.drawable.RoundedBitmapDrawable create(android.content.res.Resources, java.io.InputStream);
- }
-
-}
-
-package androidx.core.hardware.display {
-
- public final class DisplayManagerCompat {
- method public android.view.Display? getDisplay(int);
- method public android.view.Display[] getDisplays();
- method public android.view.Display[] getDisplays(String?);
- method public static androidx.core.hardware.display.DisplayManagerCompat getInstance(android.content.Context);
- field public static final String DISPLAY_CATEGORY_PRESENTATION = "android.hardware.display.category.PRESENTATION";
- }
-
-}
-
-package androidx.core.hardware.fingerprint {
-
- @Deprecated public final class FingerprintManagerCompat {
- method @Deprecated @RequiresPermission(android.Manifest.permission.USE_FINGERPRINT) public void authenticate(androidx.core.hardware.fingerprint.FingerprintManagerCompat.CryptoObject?, int, androidx.core.os.CancellationSignal?, androidx.core.hardware.fingerprint.FingerprintManagerCompat.AuthenticationCallback, android.os.Handler?);
- method @Deprecated public static androidx.core.hardware.fingerprint.FingerprintManagerCompat from(android.content.Context);
- method @Deprecated @RequiresPermission(android.Manifest.permission.USE_FINGERPRINT) public boolean hasEnrolledFingerprints();
- method @Deprecated @RequiresPermission(android.Manifest.permission.USE_FINGERPRINT) public boolean isHardwareDetected();
- }
-
- @Deprecated public abstract static class FingerprintManagerCompat.AuthenticationCallback {
- ctor @Deprecated public FingerprintManagerCompat.AuthenticationCallback();
- method @Deprecated public void onAuthenticationError(int, CharSequence!);
- method @Deprecated public void onAuthenticationFailed();
- method @Deprecated public void onAuthenticationHelp(int, CharSequence!);
- method @Deprecated public void onAuthenticationSucceeded(androidx.core.hardware.fingerprint.FingerprintManagerCompat.AuthenticationResult!);
- }
-
- @Deprecated public static final class FingerprintManagerCompat.AuthenticationResult {
- ctor @Deprecated public FingerprintManagerCompat.AuthenticationResult(androidx.core.hardware.fingerprint.FingerprintManagerCompat.CryptoObject!);
- method @Deprecated public androidx.core.hardware.fingerprint.FingerprintManagerCompat.CryptoObject! getCryptoObject();
- }
-
- @Deprecated public static class FingerprintManagerCompat.CryptoObject {
- ctor @Deprecated public FingerprintManagerCompat.CryptoObject(java.security.Signature);
- ctor @Deprecated public FingerprintManagerCompat.CryptoObject(javax.crypto.Cipher);
- ctor @Deprecated public FingerprintManagerCompat.CryptoObject(javax.crypto.Mac);
- method @Deprecated public javax.crypto.Cipher? getCipher();
- method @Deprecated public javax.crypto.Mac? getMac();
- method @Deprecated public java.security.Signature? getSignature();
- }
-
-}
-
-package androidx.core.location {
-
- public final class LocationManagerCompat {
- method public static boolean isLocationEnabled(android.location.LocationManager);
- }
-
-}
-
-package androidx.core.math {
-
- public class MathUtils {
- method public static float clamp(float, float, float);
- method public static double clamp(double, double, double);
- method public static int clamp(int, int, int);
- }
-
-}
-
-package androidx.core.net {
-
- public final class ConnectivityManagerCompat {
- method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public static android.net.NetworkInfo? getNetworkInfoFromBroadcast(android.net.ConnectivityManager, android.content.Intent);
- method public static int getRestrictBackgroundStatus(android.net.ConnectivityManager);
- method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public static boolean isActiveNetworkMetered(android.net.ConnectivityManager);
- field public static final int RESTRICT_BACKGROUND_STATUS_DISABLED = 1; // 0x1
- field public static final int RESTRICT_BACKGROUND_STATUS_ENABLED = 3; // 0x3
- field public static final int RESTRICT_BACKGROUND_STATUS_WHITELISTED = 2; // 0x2
- }
-
- public final class TrafficStatsCompat {
- method @Deprecated public static void clearThreadStatsTag();
- method @Deprecated public static int getThreadStatsTag();
- method @Deprecated public static void incrementOperationCount(int);
- method @Deprecated public static void incrementOperationCount(int, int);
- method @Deprecated public static void setThreadStatsTag(int);
- method public static void tagDatagramSocket(java.net.DatagramSocket) throws java.net.SocketException;
- method @Deprecated public static void tagSocket(java.net.Socket!) throws java.net.SocketException;
- method public static void untagDatagramSocket(java.net.DatagramSocket) throws java.net.SocketException;
- method @Deprecated public static void untagSocket(java.net.Socket!) throws java.net.SocketException;
- }
-
-}
-
-package androidx.core.os {
-
- public class BuildCompat {
- method @Deprecated public static boolean isAtLeastN();
- method @Deprecated public static boolean isAtLeastNMR1();
- method @Deprecated public static boolean isAtLeastO();
- method @Deprecated public static boolean isAtLeastOMR1();
- method @Deprecated public static boolean isAtLeastP();
- method public static boolean isAtLeastQ();
- }
-
- public final class CancellationSignal {
- ctor public CancellationSignal();
- method public void cancel();
- method public Object? getCancellationSignalObject();
- method public boolean isCanceled();
- method public void setOnCancelListener(androidx.core.os.CancellationSignal.OnCancelListener?);
- method public void throwIfCanceled();
- }
-
- public static interface CancellationSignal.OnCancelListener {
- method public void onCancel();
- }
-
- public final class ConfigurationCompat {
- method public static androidx.core.os.LocaleListCompat getLocales(android.content.res.Configuration);
- }
-
- public final class EnvironmentCompat {
- method public static String! getStorageState(java.io.File);
- field public static final String MEDIA_UNKNOWN = "unknown";
- }
-
- public final class HandlerCompat {
- method public static android.os.Handler createAsync(android.os.Looper);
- method public static android.os.Handler createAsync(android.os.Looper, android.os.Handler.Callback);
- method public static boolean postDelayed(android.os.Handler, Runnable, Object?, long);
- }
-
- public final class LocaleListCompat {
- method public static androidx.core.os.LocaleListCompat create(java.util.Locale...);
- method public static androidx.core.os.LocaleListCompat forLanguageTags(String?);
- method public java.util.Locale! get(int);
- method @Size(min=1) public static androidx.core.os.LocaleListCompat getAdjustedDefault();
- method @Size(min=1) public static androidx.core.os.LocaleListCompat getDefault();
- method public static androidx.core.os.LocaleListCompat getEmptyLocaleList();
- method public java.util.Locale? getFirstMatch(String[]);
- method @IntRange(from=0xffffffff) public int indexOf(java.util.Locale!);
- method public boolean isEmpty();
- method @IntRange(from=0) public int size();
- method public String toLanguageTags();
- method public Object? unwrap();
- method @Deprecated @RequiresApi(24) public static androidx.core.os.LocaleListCompat! wrap(Object!);
- method @RequiresApi(24) public static androidx.core.os.LocaleListCompat wrap(android.os.LocaleList);
- }
-
- public final class MessageCompat {
- method public static boolean isAsynchronous(android.os.Message);
- method public static void setAsynchronous(android.os.Message, boolean);
- }
-
- public class OperationCanceledException extends java.lang.RuntimeException {
- ctor public OperationCanceledException();
- ctor public OperationCanceledException(String?);
- }
-
- public final class ParcelCompat {
- method public static boolean readBoolean(android.os.Parcel);
- method public static void writeBoolean(android.os.Parcel, boolean);
- }
-
- @Deprecated public final class ParcelableCompat {
- method @Deprecated public static <T> android.os.Parcelable.Creator<T>! newCreator(androidx.core.os.ParcelableCompatCreatorCallbacks<T>!);
- }
-
- @Deprecated public interface ParcelableCompatCreatorCallbacks<T> {
- method @Deprecated public T! createFromParcel(android.os.Parcel!, ClassLoader!);
- method @Deprecated public T[]! newArray(int);
- }
-
- public final class TraceCompat {
- method public static void beginSection(String);
- method public static void endSection();
- }
-
- public class UserManagerCompat {
- method public static boolean isUserUnlocked(android.content.Context);
- }
-
-}
-
-package androidx.core.provider {
-
- public final class FontRequest {
- ctor public FontRequest(String, String, String, java.util.List<java.util.List<byte[]>>);
- ctor public FontRequest(String, String, String, @ArrayRes int);
- method public java.util.List<java.util.List<byte[]>>? getCertificates();
- method @ArrayRes public int getCertificatesArrayResId();
- method public String getProviderAuthority();
- method public String getProviderPackage();
- method public String getQuery();
- }
-
- public class FontsContractCompat {
- method public static android.graphics.Typeface? buildTypeface(android.content.Context, android.os.CancellationSignal?, androidx.core.provider.FontsContractCompat.FontInfo[]);
- method public static androidx.core.provider.FontsContractCompat.FontFamilyResult fetchFonts(android.content.Context, android.os.CancellationSignal?, androidx.core.provider.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException;
- method public static void requestFont(android.content.Context, androidx.core.provider.FontRequest, androidx.core.provider.FontsContractCompat.FontRequestCallback, android.os.Handler);
- }
-
- public static final class FontsContractCompat.Columns implements android.provider.BaseColumns {
- ctor public FontsContractCompat.Columns();
- field public static final String FILE_ID = "file_id";
- field public static final String ITALIC = "font_italic";
- field public static final String RESULT_CODE = "result_code";
- field public static final int RESULT_CODE_FONT_NOT_FOUND = 1; // 0x1
- field public static final int RESULT_CODE_FONT_UNAVAILABLE = 2; // 0x2
- field public static final int RESULT_CODE_MALFORMED_QUERY = 3; // 0x3
- field public static final int RESULT_CODE_OK = 0; // 0x0
- field public static final String TTC_INDEX = "font_ttc_index";
- field public static final String VARIATION_SETTINGS = "font_variation_settings";
- field public static final String WEIGHT = "font_weight";
- }
-
- public static class FontsContractCompat.FontFamilyResult {
- method public androidx.core.provider.FontsContractCompat.FontInfo[]! getFonts();
- method public int getStatusCode();
- field public static final int STATUS_OK = 0; // 0x0
- field public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2; // 0x2
- field public static final int STATUS_WRONG_CERTIFICATES = 1; // 0x1
- }
-
- public static class FontsContractCompat.FontInfo {
- method public int getResultCode();
- method @IntRange(from=0) public int getTtcIndex();
- method public android.net.Uri getUri();
- method @IntRange(from=1, to=1000) public int getWeight();
- method public boolean isItalic();
- }
-
- public static class FontsContractCompat.FontRequestCallback {
- ctor public FontsContractCompat.FontRequestCallback();
- method public void onTypefaceRequestFailed(int);
- method public void onTypefaceRetrieved(android.graphics.Typeface!);
- field public static final int FAIL_REASON_FONT_LOAD_ERROR = -3; // 0xfffffffd
- field public static final int FAIL_REASON_FONT_NOT_FOUND = 1; // 0x1
- field public static final int FAIL_REASON_FONT_UNAVAILABLE = 2; // 0x2
- field public static final int FAIL_REASON_MALFORMED_QUERY = 3; // 0x3
- field public static final int FAIL_REASON_PROVIDER_NOT_FOUND = -1; // 0xffffffff
- field public static final int FAIL_REASON_SECURITY_VIOLATION = -4; // 0xfffffffc
- field public static final int FAIL_REASON_WRONG_CERTIFICATES = -2; // 0xfffffffe
- }
-
-}
-
-package androidx.core.telephony.mbms {
-
- public final class MbmsHelper {
- method public static CharSequence? getBestNameForService(android.content.Context, android.telephony.mbms.ServiceInfo);
- }
-
-}
-
-package androidx.core.text {
-
- public final class BidiFormatter {
- method public static androidx.core.text.BidiFormatter! getInstance();
- method public static androidx.core.text.BidiFormatter! getInstance(boolean);
- method public static androidx.core.text.BidiFormatter! getInstance(java.util.Locale!);
- method public boolean getStereoReset();
- method public boolean isRtl(String!);
- method public boolean isRtl(CharSequence!);
- method public boolean isRtlContext();
- method public String! unicodeWrap(String!, androidx.core.text.TextDirectionHeuristicCompat!, boolean);
- method public CharSequence! unicodeWrap(CharSequence!, androidx.core.text.TextDirectionHeuristicCompat!, boolean);
- method public String! unicodeWrap(String!, androidx.core.text.TextDirectionHeuristicCompat!);
- method public CharSequence! unicodeWrap(CharSequence!, androidx.core.text.TextDirectionHeuristicCompat!);
- method public String! unicodeWrap(String!, boolean);
- method public CharSequence! unicodeWrap(CharSequence!, boolean);
- method public String! unicodeWrap(String!);
- method public CharSequence! unicodeWrap(CharSequence!);
- }
-
- public static final class BidiFormatter.Builder {
- ctor public BidiFormatter.Builder();
- ctor public BidiFormatter.Builder(boolean);
- ctor public BidiFormatter.Builder(java.util.Locale!);
- method public androidx.core.text.BidiFormatter! build();
- method public androidx.core.text.BidiFormatter.Builder! setTextDirectionHeuristic(androidx.core.text.TextDirectionHeuristicCompat!);
- method public androidx.core.text.BidiFormatter.Builder! stereoReset(boolean);
- }
-
- public final class HtmlCompat {
- method public static android.text.Spanned fromHtml(String, int);
- method public static android.text.Spanned fromHtml(String, int, android.text.Html.ImageGetter?, android.text.Html.TagHandler?);
- method public static String toHtml(android.text.Spanned, int);
- field public static final int FROM_HTML_MODE_COMPACT = 63; // 0x3f
- field public static final int FROM_HTML_MODE_LEGACY = 0; // 0x0
- field public static final int FROM_HTML_OPTION_USE_CSS_COLORS = 256; // 0x100
- field public static final int FROM_HTML_SEPARATOR_LINE_BREAK_BLOCKQUOTE = 32; // 0x20
- field public static final int FROM_HTML_SEPARATOR_LINE_BREAK_DIV = 16; // 0x10
- field public static final int FROM_HTML_SEPARATOR_LINE_BREAK_HEADING = 2; // 0x2
- field public static final int FROM_HTML_SEPARATOR_LINE_BREAK_LIST = 8; // 0x8
- field public static final int FROM_HTML_SEPARATOR_LINE_BREAK_LIST_ITEM = 4; // 0x4
- field public static final int FROM_HTML_SEPARATOR_LINE_BREAK_PARAGRAPH = 1; // 0x1
- field public static final int TO_HTML_PARAGRAPH_LINES_CONSECUTIVE = 0; // 0x0
- field public static final int TO_HTML_PARAGRAPH_LINES_INDIVIDUAL = 1; // 0x1
- }
-
- public final class ICUCompat {
- method public static String? maximizeAndGetScript(java.util.Locale!);
- }
-
- public class PrecomputedTextCompat implements android.text.Spannable {
- method public char charAt(int);
- method public static androidx.core.text.PrecomputedTextCompat! create(CharSequence, androidx.core.text.PrecomputedTextCompat.Params);
- method @IntRange(from=0) public int getParagraphCount();
- method @IntRange(from=0) public int getParagraphEnd(@IntRange(from=0) int);
- method @IntRange(from=0) public int getParagraphStart(@IntRange(from=0) int);
- method public androidx.core.text.PrecomputedTextCompat.Params getParams();
- method public int getSpanEnd(Object!);
- method public int getSpanFlags(Object!);
- method public int getSpanStart(Object!);
- method public <T> T[]! getSpans(int, int, Class<T>!);
- method @UiThread public static java.util.concurrent.Future<androidx.core.text.PrecomputedTextCompat>! getTextFuture(CharSequence, androidx.core.text.PrecomputedTextCompat.Params, java.util.concurrent.Executor?);
- method public int length();
- method public int nextSpanTransition(int, int, Class!);
- method public void removeSpan(Object!);
- method public void setSpan(Object!, int, int, int);
- method public CharSequence! subSequence(int, int);
- }
-
- public static final class PrecomputedTextCompat.Params {
- ctor @RequiresApi(28) public PrecomputedTextCompat.Params(android.text.PrecomputedText.Params);
- method @RequiresApi(23) public int getBreakStrategy();
- method @RequiresApi(23) public int getHyphenationFrequency();
- method @RequiresApi(18) public android.text.TextDirectionHeuristic? getTextDirection();
- method public android.text.TextPaint getTextPaint();
- }
-
- public static class PrecomputedTextCompat.Params.Builder {
- ctor public PrecomputedTextCompat.Params.Builder(android.text.TextPaint);
- method public androidx.core.text.PrecomputedTextCompat.Params build();
- method @RequiresApi(23) public androidx.core.text.PrecomputedTextCompat.Params.Builder! setBreakStrategy(int);
- method @RequiresApi(23) public androidx.core.text.PrecomputedTextCompat.Params.Builder! setHyphenationFrequency(int);
- method @RequiresApi(18) public androidx.core.text.PrecomputedTextCompat.Params.Builder! setTextDirection(android.text.TextDirectionHeuristic);
- }
-
- public interface TextDirectionHeuristicCompat {
- method public boolean isRtl(char[]!, int, int);
- method public boolean isRtl(CharSequence!, int, int);
- }
-
- public final class TextDirectionHeuristicsCompat {
- field public static final androidx.core.text.TextDirectionHeuristicCompat! ANYRTL_LTR;
- field public static final androidx.core.text.TextDirectionHeuristicCompat! FIRSTSTRONG_LTR;
- field public static final androidx.core.text.TextDirectionHeuristicCompat! FIRSTSTRONG_RTL;
- field public static final androidx.core.text.TextDirectionHeuristicCompat! LOCALE;
- field public static final androidx.core.text.TextDirectionHeuristicCompat! LTR;
- field public static final androidx.core.text.TextDirectionHeuristicCompat! RTL;
- }
-
- public final class TextUtilsCompat {
- method public static int getLayoutDirectionFromLocale(java.util.Locale?);
- method public static String htmlEncode(String);
- }
-
-}
-
-package androidx.core.text.util {
-
- public final class LinkifyCompat {
- method public static boolean addLinks(android.text.Spannable, int);
- method public static boolean addLinks(android.widget.TextView, int);
- method public static void addLinks(android.widget.TextView, java.util.regex.Pattern, String?);
- method public static void addLinks(android.widget.TextView, java.util.regex.Pattern, String?, android.text.util.Linkify.MatchFilter?, android.text.util.Linkify.TransformFilter?);
- method public static void addLinks(android.widget.TextView, java.util.regex.Pattern, String?, String[]?, android.text.util.Linkify.MatchFilter?, android.text.util.Linkify.TransformFilter?);
- method public static boolean addLinks(android.text.Spannable, java.util.regex.Pattern, String?);
- method public static boolean addLinks(android.text.Spannable, java.util.regex.Pattern, String?, android.text.util.Linkify.MatchFilter?, android.text.util.Linkify.TransformFilter?);
- method public static boolean addLinks(android.text.Spannable, java.util.regex.Pattern, String?, String[]?, android.text.util.Linkify.MatchFilter?, android.text.util.Linkify.TransformFilter?);
- }
-
-}
-
-package androidx.core.util {
-
- public class AtomicFile {
- ctor public AtomicFile(java.io.File);
- method public void delete();
- method public void failWrite(java.io.FileOutputStream?);
- method public void finishWrite(java.io.FileOutputStream?);
- method public java.io.File getBaseFile();
- method public java.io.FileInputStream openRead() throws java.io.FileNotFoundException;
- method public byte[] readFully() throws java.io.IOException;
- method public java.io.FileOutputStream startWrite() throws java.io.IOException;
- }
-
- public interface Consumer<T> {
- method public void accept(T!);
- }
-
- public class ObjectsCompat {
- method public static boolean equals(Object?, Object?);
- method public static int hash(java.lang.Object...?);
- method public static int hashCode(Object?);
- }
-
- public class Pair<F, S> {
- ctor public Pair(F?, S?);
- method public static <A, B> androidx.core.util.Pair<A,B> create(A?, B?);
- field public final F? first;
- field public final S? second;
- }
-
- public final class PatternsCompat {
- field public static final java.util.regex.Pattern! DOMAIN_NAME;
- field public static final java.util.regex.Pattern! EMAIL_ADDRESS;
- field public static final java.util.regex.Pattern! IP_ADDRESS;
- field public static final java.util.regex.Pattern! WEB_URL;
- }
-
- public final class Pools {
- }
-
- public static interface Pools.Pool<T> {
- method public T? acquire();
- method public boolean release(T);
- }
-
- public static class Pools.SimplePool<T> implements androidx.core.util.Pools.Pool<T> {
- ctor public Pools.SimplePool(int);
- method public T! acquire();
- method public boolean release(T);
- }
-
- public static class Pools.SynchronizedPool<T> extends androidx.core.util.Pools.SimplePool<T> {
- ctor public Pools.SynchronizedPool(int);
- }
-
- public interface Supplier<T> {
- method public T! get();
- }
-
-}
-
-package androidx.core.view {
-
- public class AccessibilityDelegateCompat {
- ctor public AccessibilityDelegateCompat();
- method public boolean dispatchPopulateAccessibilityEvent(android.view.View!, android.view.accessibility.AccessibilityEvent!);
- method public androidx.core.view.accessibility.AccessibilityNodeProviderCompat! getAccessibilityNodeProvider(android.view.View!);
- method public void onInitializeAccessibilityEvent(android.view.View!, android.view.accessibility.AccessibilityEvent!);
- method public void onInitializeAccessibilityNodeInfo(android.view.View!, androidx.core.view.accessibility.AccessibilityNodeInfoCompat!);
- method public void onPopulateAccessibilityEvent(android.view.View!, android.view.accessibility.AccessibilityEvent!);
- method public boolean onRequestSendAccessibilityEvent(android.view.ViewGroup!, android.view.View!, android.view.accessibility.AccessibilityEvent!);
- method public boolean performAccessibilityAction(android.view.View!, int, android.os.Bundle!);
- method public void sendAccessibilityEvent(android.view.View!, int);
- method public void sendAccessibilityEventUnchecked(android.view.View!, android.view.accessibility.AccessibilityEvent!);
- }
-
- public abstract class ActionProvider {
- ctor public ActionProvider(android.content.Context!);
- method public android.content.Context! getContext();
- method public boolean hasSubMenu();
- method public boolean isVisible();
- method public abstract android.view.View! onCreateActionView();
- method public android.view.View! onCreateActionView(android.view.MenuItem!);
- method public boolean onPerformDefaultAction();
- method public void onPrepareSubMenu(android.view.SubMenu!);
- method public boolean overridesItemVisibility();
- method public void refreshVisibility();
- method public void setVisibilityListener(androidx.core.view.ActionProvider.VisibilityListener!);
- }
-
- public static interface ActionProvider.VisibilityListener {
- method public void onActionProviderVisibilityChanged(boolean);
- }
-
- public final class DisplayCutoutCompat {
- ctor public DisplayCutoutCompat(android.graphics.Rect!, java.util.List<android.graphics.Rect>!);
- method public java.util.List<android.graphics.Rect>! getBoundingRects();
- method public int getSafeInsetBottom();
- method public int getSafeInsetLeft();
- method public int getSafeInsetRight();
- method public int getSafeInsetTop();
- }
-
- public final class DragAndDropPermissionsCompat {
- method public void release();
- }
-
- public class DragStartHelper {
- ctor public DragStartHelper(android.view.View!, androidx.core.view.DragStartHelper.OnDragStartListener!);
- method public void attach();
- method public void detach();
- method public void getTouchPosition(android.graphics.Point!);
- method public boolean onLongClick(android.view.View!);
- method public boolean onTouch(android.view.View!, android.view.MotionEvent!);
- }
-
- public static interface DragStartHelper.OnDragStartListener {
- method public boolean onDragStart(android.view.View!, androidx.core.view.DragStartHelper!);
- }
-
- public final class GestureDetectorCompat {
- ctor public GestureDetectorCompat(android.content.Context!, android.view.GestureDetector.OnGestureListener!);
- ctor public GestureDetectorCompat(android.content.Context!, android.view.GestureDetector.OnGestureListener!, android.os.Handler!);
- method public boolean isLongpressEnabled();
- method public boolean onTouchEvent(android.view.MotionEvent!);
- method public void setIsLongpressEnabled(boolean);
- method public void setOnDoubleTapListener(android.view.GestureDetector.OnDoubleTapListener!);
- }
-
- public final class GravityCompat {
- method public static void apply(int, int, int, android.graphics.Rect!, android.graphics.Rect!, int);
- method public static void apply(int, int, int, android.graphics.Rect!, int, int, android.graphics.Rect!, int);
- method public static void applyDisplay(int, android.graphics.Rect!, android.graphics.Rect!, int);
- method public static int getAbsoluteGravity(int, int);
- field public static final int END = 8388613; // 0x800005
- field public static final int RELATIVE_HORIZONTAL_GRAVITY_MASK = 8388615; // 0x800007
- field public static final int RELATIVE_LAYOUT_DIRECTION = 8388608; // 0x800000
- field public static final int START = 8388611; // 0x800003
- }
-
- public final class InputDeviceCompat {
- field public static final int SOURCE_ANY = -256; // 0xffffff00
- field public static final int SOURCE_CLASS_BUTTON = 1; // 0x1
- field public static final int SOURCE_CLASS_JOYSTICK = 16; // 0x10
- field public static final int SOURCE_CLASS_MASK = 255; // 0xff
- field public static final int SOURCE_CLASS_NONE = 0; // 0x0
- field public static final int SOURCE_CLASS_POINTER = 2; // 0x2
- field public static final int SOURCE_CLASS_POSITION = 8; // 0x8
- field public static final int SOURCE_CLASS_TRACKBALL = 4; // 0x4
- field public static final int SOURCE_DPAD = 513; // 0x201
- field public static final int SOURCE_GAMEPAD = 1025; // 0x401
- field public static final int SOURCE_HDMI = 33554433; // 0x2000001
- field public static final int SOURCE_JOYSTICK = 16777232; // 0x1000010
- field public static final int SOURCE_KEYBOARD = 257; // 0x101
- field public static final int SOURCE_MOUSE = 8194; // 0x2002
- field public static final int SOURCE_ROTARY_ENCODER = 4194304; // 0x400000
- field public static final int SOURCE_STYLUS = 16386; // 0x4002
- field public static final int SOURCE_TOUCHPAD = 1048584; // 0x100008
- field public static final int SOURCE_TOUCHSCREEN = 4098; // 0x1002
- field public static final int SOURCE_TOUCH_NAVIGATION = 2097152; // 0x200000
- field public static final int SOURCE_TRACKBALL = 65540; // 0x10004
- field public static final int SOURCE_UNKNOWN = 0; // 0x0
- }
-
- public final class LayoutInflaterCompat {
- method @Deprecated public static androidx.core.view.LayoutInflaterFactory! getFactory(android.view.LayoutInflater!);
- method @Deprecated public static void setFactory(android.view.LayoutInflater, androidx.core.view.LayoutInflaterFactory);
- method public static void setFactory2(android.view.LayoutInflater, android.view.LayoutInflater.Factory2);
- }
-
- @Deprecated public interface LayoutInflaterFactory {
- method @Deprecated public android.view.View! onCreateView(android.view.View!, String!, android.content.Context!, android.util.AttributeSet!);
- }
-
- public final class MarginLayoutParamsCompat {
- method public static int getLayoutDirection(android.view.ViewGroup.MarginLayoutParams!);
- method public static int getMarginEnd(android.view.ViewGroup.MarginLayoutParams!);
- method public static int getMarginStart(android.view.ViewGroup.MarginLayoutParams!);
- method public static boolean isMarginRelative(android.view.ViewGroup.MarginLayoutParams!);
- method public static void resolveLayoutDirection(android.view.ViewGroup.MarginLayoutParams!, int);
- method public static void setLayoutDirection(android.view.ViewGroup.MarginLayoutParams!, int);
- method public static void setMarginEnd(android.view.ViewGroup.MarginLayoutParams!, int);
- method public static void setMarginStart(android.view.ViewGroup.MarginLayoutParams!, int);
- }
-
- public final class MenuCompat {
- method public static void setGroupDividerEnabled(android.view.Menu!, boolean);
- method @Deprecated public static void setShowAsAction(android.view.MenuItem!, int);
- }
-
- public final class MenuItemCompat {
- method @Deprecated public static boolean collapseActionView(android.view.MenuItem!);
- method @Deprecated public static boolean expandActionView(android.view.MenuItem!);
- method public static androidx.core.view.ActionProvider! getActionProvider(android.view.MenuItem!);
- method @Deprecated public static android.view.View! getActionView(android.view.MenuItem!);
- method public static int getAlphabeticModifiers(android.view.MenuItem!);
- method public static CharSequence! getContentDescription(android.view.MenuItem!);
- method public static android.content.res.ColorStateList! getIconTintList(android.view.MenuItem!);
- method public static android.graphics.PorterDuff.Mode! getIconTintMode(android.view.MenuItem!);
- method public static int getNumericModifiers(android.view.MenuItem!);
- method public static CharSequence! getTooltipText(android.view.MenuItem!);
- method @Deprecated public static boolean isActionViewExpanded(android.view.MenuItem!);
- method public static android.view.MenuItem! setActionProvider(android.view.MenuItem!, androidx.core.view.ActionProvider!);
- method @Deprecated public static android.view.MenuItem! setActionView(android.view.MenuItem!, android.view.View!);
- method @Deprecated public static android.view.MenuItem! setActionView(android.view.MenuItem!, int);
- method public static void setAlphabeticShortcut(android.view.MenuItem!, char, int);
- method public static void setContentDescription(android.view.MenuItem!, CharSequence!);
- method public static void setIconTintList(android.view.MenuItem!, android.content.res.ColorStateList!);
- method public static void setIconTintMode(android.view.MenuItem!, android.graphics.PorterDuff.Mode!);
- method public static void setNumericShortcut(android.view.MenuItem!, char, int);
- method @Deprecated public static android.view.MenuItem! setOnActionExpandListener(android.view.MenuItem!, androidx.core.view.MenuItemCompat.OnActionExpandListener!);
- method public static void setShortcut(android.view.MenuItem!, char, char, int, int);
- method @Deprecated public static void setShowAsAction(android.view.MenuItem!, int);
- method public static void setTooltipText(android.view.MenuItem!, CharSequence!);
- field @Deprecated public static final int SHOW_AS_ACTION_ALWAYS = 2; // 0x2
- field @Deprecated public static final int SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW = 8; // 0x8
- field @Deprecated public static final int SHOW_AS_ACTION_IF_ROOM = 1; // 0x1
- field @Deprecated public static final int SHOW_AS_ACTION_NEVER = 0; // 0x0
- field @Deprecated public static final int SHOW_AS_ACTION_WITH_TEXT = 4; // 0x4
- }
-
- @Deprecated public static interface MenuItemCompat.OnActionExpandListener {
- method @Deprecated public boolean onMenuItemActionCollapse(android.view.MenuItem!);
- method @Deprecated public boolean onMenuItemActionExpand(android.view.MenuItem!);
- }
-
- public final class MotionEventCompat {
- method @Deprecated public static int findPointerIndex(android.view.MotionEvent!, int);
- method @Deprecated public static int getActionIndex(android.view.MotionEvent!);
- method @Deprecated public static int getActionMasked(android.view.MotionEvent!);
- method @Deprecated public static float getAxisValue(android.view.MotionEvent!, int);
- method @Deprecated public static float getAxisValue(android.view.MotionEvent!, int, int);
- method @Deprecated public static int getButtonState(android.view.MotionEvent!);
- method @Deprecated public static int getPointerCount(android.view.MotionEvent!);
- method @Deprecated public static int getPointerId(android.view.MotionEvent!, int);
- method @Deprecated public static int getSource(android.view.MotionEvent!);
- method @Deprecated public static float getX(android.view.MotionEvent!, int);
- method @Deprecated public static float getY(android.view.MotionEvent!, int);
- method public static boolean isFromSource(android.view.MotionEvent!, int);
- field @Deprecated public static final int ACTION_HOVER_ENTER = 9; // 0x9
- field @Deprecated public static final int ACTION_HOVER_EXIT = 10; // 0xa
- field @Deprecated public static final int ACTION_HOVER_MOVE = 7; // 0x7
- field @Deprecated public static final int ACTION_MASK = 255; // 0xff
- field @Deprecated public static final int ACTION_POINTER_DOWN = 5; // 0x5
- field @Deprecated public static final int ACTION_POINTER_INDEX_MASK = 65280; // 0xff00
- field @Deprecated public static final int ACTION_POINTER_INDEX_SHIFT = 8; // 0x8
- field @Deprecated public static final int ACTION_POINTER_UP = 6; // 0x6
- field @Deprecated public static final int ACTION_SCROLL = 8; // 0x8
- field @Deprecated public static final int AXIS_BRAKE = 23; // 0x17
- field @Deprecated public static final int AXIS_DISTANCE = 24; // 0x18
- field @Deprecated public static final int AXIS_GAS = 22; // 0x16
- field @Deprecated public static final int AXIS_GENERIC_1 = 32; // 0x20
- field @Deprecated public static final int AXIS_GENERIC_10 = 41; // 0x29
- field @Deprecated public static final int AXIS_GENERIC_11 = 42; // 0x2a
- field @Deprecated public static final int AXIS_GENERIC_12 = 43; // 0x2b
- field @Deprecated public static final int AXIS_GENERIC_13 = 44; // 0x2c
- field @Deprecated public static final int AXIS_GENERIC_14 = 45; // 0x2d
- field @Deprecated public static final int AXIS_GENERIC_15 = 46; // 0x2e
- field @Deprecated public static final int AXIS_GENERIC_16 = 47; // 0x2f
- field @Deprecated public static final int AXIS_GENERIC_2 = 33; // 0x21
- field @Deprecated public static final int AXIS_GENERIC_3 = 34; // 0x22
- field @Deprecated public static final int AXIS_GENERIC_4 = 35; // 0x23
- field @Deprecated public static final int AXIS_GENERIC_5 = 36; // 0x24
- field @Deprecated public static final int AXIS_GENERIC_6 = 37; // 0x25
- field @Deprecated public static final int AXIS_GENERIC_7 = 38; // 0x26
- field @Deprecated public static final int AXIS_GENERIC_8 = 39; // 0x27
- field @Deprecated public static final int AXIS_GENERIC_9 = 40; // 0x28
- field @Deprecated public static final int AXIS_HAT_X = 15; // 0xf
- field @Deprecated public static final int AXIS_HAT_Y = 16; // 0x10
- field @Deprecated public static final int AXIS_HSCROLL = 10; // 0xa
- field @Deprecated public static final int AXIS_LTRIGGER = 17; // 0x11
- field @Deprecated public static final int AXIS_ORIENTATION = 8; // 0x8
- field @Deprecated public static final int AXIS_PRESSURE = 2; // 0x2
- field public static final int AXIS_RELATIVE_X = 27; // 0x1b
- field public static final int AXIS_RELATIVE_Y = 28; // 0x1c
- field @Deprecated public static final int AXIS_RTRIGGER = 18; // 0x12
- field @Deprecated public static final int AXIS_RUDDER = 20; // 0x14
- field @Deprecated public static final int AXIS_RX = 12; // 0xc
- field @Deprecated public static final int AXIS_RY = 13; // 0xd
- field @Deprecated public static final int AXIS_RZ = 14; // 0xe
- field public static final int AXIS_SCROLL = 26; // 0x1a
- field @Deprecated public static final int AXIS_SIZE = 3; // 0x3
- field @Deprecated public static final int AXIS_THROTTLE = 19; // 0x13
- field @Deprecated public static final int AXIS_TILT = 25; // 0x19
- field @Deprecated public static final int AXIS_TOOL_MAJOR = 6; // 0x6
- field @Deprecated public static final int AXIS_TOOL_MINOR = 7; // 0x7
- field @Deprecated public static final int AXIS_TOUCH_MAJOR = 4; // 0x4
- field @Deprecated public static final int AXIS_TOUCH_MINOR = 5; // 0x5
- field @Deprecated public static final int AXIS_VSCROLL = 9; // 0x9
- field @Deprecated public static final int AXIS_WHEEL = 21; // 0x15
- field @Deprecated public static final int AXIS_X = 0; // 0x0
- field @Deprecated public static final int AXIS_Y = 1; // 0x1
- field @Deprecated public static final int AXIS_Z = 11; // 0xb
- field @Deprecated public static final int BUTTON_PRIMARY = 1; // 0x1
- }
-
- public interface NestedScrollingChild {
- method public boolean dispatchNestedFling(float, float, boolean);
- method public boolean dispatchNestedPreFling(float, float);
- method public boolean dispatchNestedPreScroll(int, int, int[]?, int[]?);
- method public boolean dispatchNestedScroll(int, int, int, int, int[]?);
- method public boolean hasNestedScrollingParent();
- method public boolean isNestedScrollingEnabled();
- method public void setNestedScrollingEnabled(boolean);
- method public boolean startNestedScroll(int);
- method public void stopNestedScroll();
- }
-
- public interface NestedScrollingChild2 extends androidx.core.view.NestedScrollingChild {
- method public boolean dispatchNestedPreScroll(int, int, int[]?, int[]?, int);
- method public boolean dispatchNestedScroll(int, int, int, int, int[]?, int);
- method public boolean hasNestedScrollingParent(int);
- method public boolean startNestedScroll(int, int);
- method public void stopNestedScroll(int);
- }
-
- public interface NestedScrollingChild3 extends androidx.core.view.NestedScrollingChild2 {
- method public void dispatchNestedScroll(int, int, int, int, int[]?, int, int[]);
- }
-
- public class NestedScrollingChildHelper {
- ctor public NestedScrollingChildHelper(android.view.View);
- method public boolean dispatchNestedFling(float, float, boolean);
- method public boolean dispatchNestedPreFling(float, float);
- method public boolean dispatchNestedPreScroll(int, int, int[]?, int[]?);
- method public boolean dispatchNestedPreScroll(int, int, int[]?, int[]?, int);
- method public boolean dispatchNestedScroll(int, int, int, int, int[]?);
- method public boolean dispatchNestedScroll(int, int, int, int, int[]?, int);
- method public void dispatchNestedScroll(int, int, int, int, int[]?, int, int[]?);
- method public boolean hasNestedScrollingParent();
- method public boolean hasNestedScrollingParent(int);
- method public boolean isNestedScrollingEnabled();
- method public void onDetachedFromWindow();
- method public void onStopNestedScroll(android.view.View);
- method public void setNestedScrollingEnabled(boolean);
- method public boolean startNestedScroll(int);
- method public boolean startNestedScroll(int, int);
- method public void stopNestedScroll();
- method public void stopNestedScroll(int);
- }
-
- public interface NestedScrollingParent {
- method public int getNestedScrollAxes();
- method public boolean onNestedFling(android.view.View, float, float, boolean);
- method public boolean onNestedPreFling(android.view.View, float, float);
- method public void onNestedPreScroll(android.view.View, int, int, int[]);
- method public void onNestedScroll(android.view.View, int, int, int, int);
- method public void onNestedScrollAccepted(android.view.View, android.view.View, int);
- method public boolean onStartNestedScroll(android.view.View, android.view.View, int);
- method public void onStopNestedScroll(android.view.View);
- }
-
- public interface NestedScrollingParent2 extends androidx.core.view.NestedScrollingParent {
- method public void onNestedPreScroll(android.view.View, int, int, int[], int);
- method public void onNestedScroll(android.view.View, int, int, int, int, int);
- method public void onNestedScrollAccepted(android.view.View, android.view.View, int, int);
- method public boolean onStartNestedScroll(android.view.View, android.view.View, int, int);
- method public void onStopNestedScroll(android.view.View, int);
- }
-
- public interface NestedScrollingParent3 extends androidx.core.view.NestedScrollingParent2 {
- method public void onNestedScroll(android.view.View, int, int, int, int, int, int[]);
- }
-
- public class NestedScrollingParentHelper {
- ctor public NestedScrollingParentHelper(android.view.ViewGroup);
- method public int getNestedScrollAxes();
- method public void onNestedScrollAccepted(android.view.View, android.view.View, int);
- method public void onNestedScrollAccepted(android.view.View, android.view.View, int, int);
- method public void onStopNestedScroll(android.view.View);
- method public void onStopNestedScroll(android.view.View, int);
- }
-
- public interface OnApplyWindowInsetsListener {
- method public androidx.core.view.WindowInsetsCompat! onApplyWindowInsets(android.view.View!, androidx.core.view.WindowInsetsCompat!);
- }
-
- public final class OneShotPreDrawListener implements android.view.View.OnAttachStateChangeListener android.view.ViewTreeObserver.OnPreDrawListener {
- method public static androidx.core.view.OneShotPreDrawListener add(android.view.View, Runnable);
- method public boolean onPreDraw();
- method public void onViewAttachedToWindow(android.view.View!);
- method public void onViewDetachedFromWindow(android.view.View!);
- method public void removeListener();
- }
-
- public final class PointerIconCompat {
- method public static androidx.core.view.PointerIconCompat! create(android.graphics.Bitmap!, float, float);
- method public static androidx.core.view.PointerIconCompat! getSystemIcon(android.content.Context!, int);
- method public static androidx.core.view.PointerIconCompat! load(android.content.res.Resources!, int);
- field public static final int TYPE_ALIAS = 1010; // 0x3f2
- field public static final int TYPE_ALL_SCROLL = 1013; // 0x3f5
- field public static final int TYPE_ARROW = 1000; // 0x3e8
- field public static final int TYPE_CELL = 1006; // 0x3ee
- field public static final int TYPE_CONTEXT_MENU = 1001; // 0x3e9
- field public static final int TYPE_COPY = 1011; // 0x3f3
- field public static final int TYPE_CROSSHAIR = 1007; // 0x3ef
- field public static final int TYPE_DEFAULT = 1000; // 0x3e8
- field public static final int TYPE_GRAB = 1020; // 0x3fc
- field public static final int TYPE_GRABBING = 1021; // 0x3fd
- field public static final int TYPE_HAND = 1002; // 0x3ea
- field public static final int TYPE_HELP = 1003; // 0x3eb
- field public static final int TYPE_HORIZONTAL_DOUBLE_ARROW = 1014; // 0x3f6
- field public static final int TYPE_NO_DROP = 1012; // 0x3f4
- field public static final int TYPE_NULL = 0; // 0x0
- field public static final int TYPE_TEXT = 1008; // 0x3f0
- field public static final int TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW = 1017; // 0x3f9
- field public static final int TYPE_TOP_RIGHT_DIAGONAL_DOUBLE_ARROW = 1016; // 0x3f8
- field public static final int TYPE_VERTICAL_DOUBLE_ARROW = 1015; // 0x3f7
- field public static final int TYPE_VERTICAL_TEXT = 1009; // 0x3f1
- field public static final int TYPE_WAIT = 1004; // 0x3ec
- field public static final int TYPE_ZOOM_IN = 1018; // 0x3fa
- field public static final int TYPE_ZOOM_OUT = 1019; // 0x3fb
- }
-
- public final class ScaleGestureDetectorCompat {
- method @Deprecated public static boolean isQuickScaleEnabled(Object!);
- method public static boolean isQuickScaleEnabled(android.view.ScaleGestureDetector!);
- method @Deprecated public static void setQuickScaleEnabled(Object!, boolean);
- method public static void setQuickScaleEnabled(android.view.ScaleGestureDetector!, boolean);
- }
-
- public interface ScrollingView {
- method public int computeHorizontalScrollExtent();
- method public int computeHorizontalScrollOffset();
- method public int computeHorizontalScrollRange();
- method public int computeVerticalScrollExtent();
- method public int computeVerticalScrollOffset();
- method public int computeVerticalScrollRange();
- }
-
- public interface TintableBackgroundView {
- method public android.content.res.ColorStateList? getSupportBackgroundTintList();
- method public android.graphics.PorterDuff.Mode? getSupportBackgroundTintMode();
- method public void setSupportBackgroundTintList(android.content.res.ColorStateList?);
- method public void setSupportBackgroundTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- @Deprecated public final class VelocityTrackerCompat {
- method @Deprecated public static float getXVelocity(android.view.VelocityTracker!, int);
- method @Deprecated public static float getYVelocity(android.view.VelocityTracker!, int);
- }
-
- public class ViewCompat {
- ctor protected ViewCompat();
- method public static int addAccessibilityAction(android.view.View, CharSequence, androidx.core.view.accessibility.AccessibilityViewCommand);
- method public static void addKeyboardNavigationClusters(android.view.View, java.util.Collection<android.view.View>, int);
- method public static void addOnUnhandledKeyEventListener(android.view.View, androidx.core.view.ViewCompat.OnUnhandledKeyEventListenerCompat);
- method public static androidx.core.view.ViewPropertyAnimatorCompat animate(android.view.View);
- method @Deprecated public static boolean canScrollHorizontally(android.view.View!, int);
- method @Deprecated public static boolean canScrollVertically(android.view.View!, int);
- method public static void cancelDragAndDrop(android.view.View);
- method @Deprecated public static int combineMeasuredStates(int, int);
- method public static androidx.core.view.WindowInsetsCompat! dispatchApplyWindowInsets(android.view.View, androidx.core.view.WindowInsetsCompat!);
- method public static void dispatchFinishTemporaryDetach(android.view.View);
- method public static boolean dispatchNestedFling(android.view.View, float, float, boolean);
- method public static boolean dispatchNestedPreFling(android.view.View, float, float);
- method public static boolean dispatchNestedPreScroll(android.view.View, int, int, int[]?, int[]?);
- method public static boolean dispatchNestedPreScroll(android.view.View, int, int, int[]?, int[]?, int);
- method public static boolean dispatchNestedScroll(android.view.View, int, int, int, int, int[]?);
- method public static void dispatchNestedScroll(android.view.View, int, int, int, int, int[]?, int, int[]);
- method public static boolean dispatchNestedScroll(android.view.View, int, int, int, int, int[]?, int);
- method public static void dispatchStartTemporaryDetach(android.view.View);
- method public static void enableAccessibleClickableSpanSupport(android.view.View!);
- method public static int generateViewId();
- method public static androidx.core.view.AccessibilityDelegateCompat? getAccessibilityDelegate(android.view.View);
- method public static int getAccessibilityLiveRegion(android.view.View);
- method public static androidx.core.view.accessibility.AccessibilityNodeProviderCompat! getAccessibilityNodeProvider(android.view.View);
- method @UiThread public static CharSequence! getAccessibilityPaneTitle(android.view.View!);
- method @Deprecated public static float getAlpha(android.view.View!);
- method public static android.content.res.ColorStateList! getBackgroundTintList(android.view.View);
- method public static android.graphics.PorterDuff.Mode! getBackgroundTintMode(android.view.View);
- method public static android.graphics.Rect? getClipBounds(android.view.View);
- method public static android.view.Display? getDisplay(android.view.View);
- method public static float getElevation(android.view.View);
- method public static boolean getFitsSystemWindows(android.view.View);
- method public static int getImportantForAccessibility(android.view.View);
- method public static int getImportantForAutofill(android.view.View);
- method public static int getLabelFor(android.view.View);
- method @Deprecated public static int getLayerType(android.view.View!);
- method public static int getLayoutDirection(android.view.View);
- method @Deprecated public static android.graphics.Matrix? getMatrix(android.view.View!);
- method @Deprecated public static int getMeasuredHeightAndState(android.view.View!);
- method @Deprecated public static int getMeasuredState(android.view.View!);
- method @Deprecated public static int getMeasuredWidthAndState(android.view.View!);
- method public static int getMinimumHeight(android.view.View);
- method public static int getMinimumWidth(android.view.View);
- method public static int getNextClusterForwardId(android.view.View);
- method @Deprecated public static int getOverScrollMode(android.view.View!);
- method @Px public static int getPaddingEnd(android.view.View);
- method @Px public static int getPaddingStart(android.view.View);
- method public static android.view.ViewParent! getParentForAccessibility(android.view.View);
- method @Deprecated public static float getPivotX(android.view.View!);
- method @Deprecated public static float getPivotY(android.view.View!);
- method @Deprecated public static float getRotation(android.view.View!);
- method @Deprecated public static float getRotationX(android.view.View!);
- method @Deprecated public static float getRotationY(android.view.View!);
- method @Deprecated public static float getScaleX(android.view.View!);
- method @Deprecated public static float getScaleY(android.view.View!);
- method public static int getScrollIndicators(android.view.View);
- method public static String? getTransitionName(android.view.View);
- method @Deprecated public static float getTranslationX(android.view.View!);
- method @Deprecated public static float getTranslationY(android.view.View!);
- method public static float getTranslationZ(android.view.View);
- method public static int getWindowSystemUiVisibility(android.view.View);
- method @Deprecated public static float getX(android.view.View!);
- method @Deprecated public static float getY(android.view.View!);
- method public static float getZ(android.view.View);
- method public static boolean hasAccessibilityDelegate(android.view.View);
- method public static boolean hasExplicitFocusable(android.view.View);
- method public static boolean hasNestedScrollingParent(android.view.View);
- method public static boolean hasNestedScrollingParent(android.view.View, int);
- method public static boolean hasOnClickListeners(android.view.View);
- method public static boolean hasOverlappingRendering(android.view.View);
- method public static boolean hasTransientState(android.view.View);
- method @UiThread public static boolean isAccessibilityHeading(android.view.View!);
- method public static boolean isAttachedToWindow(android.view.View);
- method public static boolean isFocusedByDefault(android.view.View);
- method public static boolean isImportantForAccessibility(android.view.View);
- method public static boolean isImportantForAutofill(android.view.View);
- method public static boolean isInLayout(android.view.View);
- method public static boolean isKeyboardNavigationCluster(android.view.View);
- method public static boolean isLaidOut(android.view.View);
- method public static boolean isLayoutDirectionResolved(android.view.View);
- method public static boolean isNestedScrollingEnabled(android.view.View);
- method @Deprecated public static boolean isOpaque(android.view.View!);
- method public static boolean isPaddingRelative(android.view.View);
- method @UiThread public static boolean isScreenReaderFocusable(android.view.View!);
- method @Deprecated public static void jumpDrawablesToCurrentState(android.view.View!);
- method public static android.view.View! keyboardNavigationClusterSearch(android.view.View, android.view.View!, int);
- method public static void offsetLeftAndRight(android.view.View, int);
- method public static void offsetTopAndBottom(android.view.View, int);
- method public static androidx.core.view.WindowInsetsCompat! onApplyWindowInsets(android.view.View, androidx.core.view.WindowInsetsCompat!);
- method @Deprecated public static void onInitializeAccessibilityEvent(android.view.View!, android.view.accessibility.AccessibilityEvent!);
- method public static void onInitializeAccessibilityNodeInfo(android.view.View, androidx.core.view.accessibility.AccessibilityNodeInfoCompat!);
- method @Deprecated public static void onPopulateAccessibilityEvent(android.view.View!, android.view.accessibility.AccessibilityEvent!);
- method public static boolean performAccessibilityAction(android.view.View, int, android.os.Bundle!);
- method public static void postInvalidateOnAnimation(android.view.View);
- method public static void postInvalidateOnAnimation(android.view.View, int, int, int, int);
- method public static void postOnAnimation(android.view.View, Runnable!);
- method public static void postOnAnimationDelayed(android.view.View, Runnable!, long);
- method public static void removeAccessibilityAction(android.view.View, int);
- method public static void removeOnUnhandledKeyEventListener(android.view.View, androidx.core.view.ViewCompat.OnUnhandledKeyEventListenerCompat);
- method public static void replaceAccessibilityAction(android.view.View, androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat, CharSequence?, androidx.core.view.accessibility.AccessibilityViewCommand?);
- method public static void requestApplyInsets(android.view.View);
- method public static <T extends android.view.View> T requireViewById(android.view.View, @IdRes int);
- method @Deprecated public static int resolveSizeAndState(int, int, int);
- method public static boolean restoreDefaultFocus(android.view.View);
- method public static void setAccessibilityDelegate(android.view.View, androidx.core.view.AccessibilityDelegateCompat!);
- method @UiThread public static void setAccessibilityHeading(android.view.View!, boolean);
- method public static void setAccessibilityLiveRegion(android.view.View, int);
- method @UiThread public static void setAccessibilityPaneTitle(android.view.View!, CharSequence!);
- method @Deprecated public static void setActivated(android.view.View!, boolean);
- method @Deprecated public static void setAlpha(android.view.View!, @FloatRange(from=0.0, to=1.0) float);
- method public static void setAutofillHints(android.view.View, java.lang.String...?);
- method public static void setBackground(android.view.View, android.graphics.drawable.Drawable?);
- method public static void setBackgroundTintList(android.view.View, android.content.res.ColorStateList!);
- method public static void setBackgroundTintMode(android.view.View, android.graphics.PorterDuff.Mode!);
- method @Deprecated public static void setChildrenDrawingOrderEnabled(android.view.ViewGroup!, boolean);
- method public static void setClipBounds(android.view.View, android.graphics.Rect!);
- method public static void setElevation(android.view.View, float);
- method @Deprecated public static void setFitsSystemWindows(android.view.View!, boolean);
- method public static void setFocusedByDefault(android.view.View, boolean);
- method public static void setHasTransientState(android.view.View, boolean);
- method public static void setImportantForAccessibility(android.view.View, int);
- method public static void setImportantForAutofill(android.view.View, int);
- method public static void setKeyboardNavigationCluster(android.view.View, boolean);
- method public static void setLabelFor(android.view.View, @IdRes int);
- method public static void setLayerPaint(android.view.View, android.graphics.Paint!);
- method @Deprecated public static void setLayerType(android.view.View!, int, android.graphics.Paint!);
- method public static void setLayoutDirection(android.view.View, int);
- method public static void setNestedScrollingEnabled(android.view.View, boolean);
- method public static void setNextClusterForwardId(android.view.View, int);
- method public static void setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener!);
- method @Deprecated public static void setOverScrollMode(android.view.View!, int);
- method public static void setPaddingRelative(android.view.View, @Px int, @Px int, @Px int, @Px int);
- method @Deprecated public static void setPivotX(android.view.View!, float);
- method @Deprecated public static void setPivotY(android.view.View!, float);
- method public static void setPointerIcon(android.view.View, androidx.core.view.PointerIconCompat!);
- method @Deprecated public static void setRotation(android.view.View!, float);
- method @Deprecated public static void setRotationX(android.view.View!, float);
- method @Deprecated public static void setRotationY(android.view.View!, float);
- method @Deprecated public static void setSaveFromParentEnabled(android.view.View!, boolean);
- method @Deprecated public static void setScaleX(android.view.View!, float);
- method @Deprecated public static void setScaleY(android.view.View!, float);
- method @UiThread public static void setScreenReaderFocusable(android.view.View!, boolean);
- method public static void setScrollIndicators(android.view.View, int);
- method public static void setScrollIndicators(android.view.View, int, int);
- method public static void setTooltipText(android.view.View, CharSequence?);
- method public static void setTransitionName(android.view.View, String!);
- method @Deprecated public static void setTranslationX(android.view.View!, float);
- method @Deprecated public static void setTranslationY(android.view.View!, float);
- method public static void setTranslationZ(android.view.View, float);
- method @Deprecated public static void setX(android.view.View!, float);
- method @Deprecated public static void setY(android.view.View!, float);
- method public static void setZ(android.view.View, float);
- method public static boolean startDragAndDrop(android.view.View, android.content.ClipData!, android.view.View.DragShadowBuilder!, Object!, int);
- method public static boolean startNestedScroll(android.view.View, int);
- method public static boolean startNestedScroll(android.view.View, int, int);
- method public static void stopNestedScroll(android.view.View);
- method public static void stopNestedScroll(android.view.View, int);
- method public static void updateDragShadow(android.view.View, android.view.View.DragShadowBuilder!);
- field public static final int ACCESSIBILITY_LIVE_REGION_ASSERTIVE = 2; // 0x2
- field public static final int ACCESSIBILITY_LIVE_REGION_NONE = 0; // 0x0
- field public static final int ACCESSIBILITY_LIVE_REGION_POLITE = 1; // 0x1
- field public static final int IMPORTANT_FOR_ACCESSIBILITY_AUTO = 0; // 0x0
- field public static final int IMPORTANT_FOR_ACCESSIBILITY_NO = 2; // 0x2
- field public static final int IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS = 4; // 0x4
- field public static final int IMPORTANT_FOR_ACCESSIBILITY_YES = 1; // 0x1
- field @Deprecated public static final int LAYER_TYPE_HARDWARE = 2; // 0x2
- field @Deprecated public static final int LAYER_TYPE_NONE = 0; // 0x0
- field @Deprecated public static final int LAYER_TYPE_SOFTWARE = 1; // 0x1
- field public static final int LAYOUT_DIRECTION_INHERIT = 2; // 0x2
- field public static final int LAYOUT_DIRECTION_LOCALE = 3; // 0x3
- field public static final int LAYOUT_DIRECTION_LTR = 0; // 0x0
- field public static final int LAYOUT_DIRECTION_RTL = 1; // 0x1
- field @Deprecated public static final int MEASURED_HEIGHT_STATE_SHIFT = 16; // 0x10
- field @Deprecated public static final int MEASURED_SIZE_MASK = 16777215; // 0xffffff
- field @Deprecated public static final int MEASURED_STATE_MASK = -16777216; // 0xff000000
- field @Deprecated public static final int MEASURED_STATE_TOO_SMALL = 16777216; // 0x1000000
- field @Deprecated public static final int OVER_SCROLL_ALWAYS = 0; // 0x0
- field @Deprecated public static final int OVER_SCROLL_IF_CONTENT_SCROLLS = 1; // 0x1
- field @Deprecated public static final int OVER_SCROLL_NEVER = 2; // 0x2
- field public static final int SCROLL_AXIS_HORIZONTAL = 1; // 0x1
- field public static final int SCROLL_AXIS_NONE = 0; // 0x0
- field public static final int SCROLL_AXIS_VERTICAL = 2; // 0x2
- field public static final int SCROLL_INDICATOR_BOTTOM = 2; // 0x2
- field public static final int SCROLL_INDICATOR_END = 32; // 0x20
- field public static final int SCROLL_INDICATOR_LEFT = 4; // 0x4
- field public static final int SCROLL_INDICATOR_RIGHT = 8; // 0x8
- field public static final int SCROLL_INDICATOR_START = 16; // 0x10
- field public static final int SCROLL_INDICATOR_TOP = 1; // 0x1
- field public static final int TYPE_NON_TOUCH = 1; // 0x1
- field public static final int TYPE_TOUCH = 0; // 0x0
- }
-
- public static interface ViewCompat.OnUnhandledKeyEventListenerCompat {
- method public boolean onUnhandledKeyEvent(android.view.View!, android.view.KeyEvent!);
- }
-
- public final class ViewConfigurationCompat {
- method public static float getScaledHorizontalScrollFactor(android.view.ViewConfiguration, android.content.Context);
- method public static int getScaledHoverSlop(android.view.ViewConfiguration!);
- method @Deprecated public static int getScaledPagingTouchSlop(android.view.ViewConfiguration!);
- method public static float getScaledVerticalScrollFactor(android.view.ViewConfiguration, android.content.Context);
- method @Deprecated public static boolean hasPermanentMenuKey(android.view.ViewConfiguration!);
- method public static boolean shouldShowMenuShortcutsWhenKeyboardPresent(android.view.ViewConfiguration!, android.content.Context);
- }
-
- public final class ViewGroupCompat {
- method public static int getLayoutMode(android.view.ViewGroup);
- method public static int getNestedScrollAxes(android.view.ViewGroup);
- method public static boolean isTransitionGroup(android.view.ViewGroup);
- method @Deprecated public static boolean onRequestSendAccessibilityEvent(android.view.ViewGroup!, android.view.View!, android.view.accessibility.AccessibilityEvent!);
- method public static void setLayoutMode(android.view.ViewGroup, int);
- method @Deprecated public static void setMotionEventSplittingEnabled(android.view.ViewGroup!, boolean);
- method public static void setTransitionGroup(android.view.ViewGroup, boolean);
- field public static final int LAYOUT_MODE_CLIP_BOUNDS = 0; // 0x0
- field public static final int LAYOUT_MODE_OPTICAL_BOUNDS = 1; // 0x1
- }
-
- public final class ViewParentCompat {
- method public static void notifySubtreeAccessibilityStateChanged(android.view.ViewParent!, android.view.View!, android.view.View!, int);
- method public static boolean onNestedFling(android.view.ViewParent!, android.view.View!, float, float, boolean);
- method public static boolean onNestedPreFling(android.view.ViewParent!, android.view.View!, float, float);
- method public static void onNestedPreScroll(android.view.ViewParent!, android.view.View!, int, int, int[]!);
- method public static void onNestedPreScroll(android.view.ViewParent!, android.view.View!, int, int, int[]!, int);
- method public static void onNestedScroll(android.view.ViewParent!, android.view.View!, int, int, int, int);
- method public static void onNestedScroll(android.view.ViewParent!, android.view.View!, int, int, int, int, int);
- method public static void onNestedScroll(android.view.ViewParent!, android.view.View!, int, int, int, int, int, int[]);
- method public static void onNestedScrollAccepted(android.view.ViewParent!, android.view.View!, android.view.View!, int);
- method public static void onNestedScrollAccepted(android.view.ViewParent!, android.view.View!, android.view.View!, int, int);
- method public static boolean onStartNestedScroll(android.view.ViewParent!, android.view.View!, android.view.View!, int);
- method public static boolean onStartNestedScroll(android.view.ViewParent!, android.view.View!, android.view.View!, int, int);
- method public static void onStopNestedScroll(android.view.ViewParent!, android.view.View!);
- method public static void onStopNestedScroll(android.view.ViewParent!, android.view.View!, int);
- method @Deprecated public static boolean requestSendAccessibilityEvent(android.view.ViewParent!, android.view.View!, android.view.accessibility.AccessibilityEvent!);
- }
-
- public final class ViewPropertyAnimatorCompat {
- method public androidx.core.view.ViewPropertyAnimatorCompat! alpha(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! alphaBy(float);
- method public void cancel();
- method public long getDuration();
- method public android.view.animation.Interpolator! getInterpolator();
- method public long getStartDelay();
- method public androidx.core.view.ViewPropertyAnimatorCompat! rotation(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! rotationBy(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! rotationX(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! rotationXBy(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! rotationY(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! rotationYBy(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! scaleX(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! scaleXBy(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! scaleY(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! scaleYBy(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! setDuration(long);
- method public androidx.core.view.ViewPropertyAnimatorCompat! setInterpolator(android.view.animation.Interpolator!);
- method public androidx.core.view.ViewPropertyAnimatorCompat! setListener(androidx.core.view.ViewPropertyAnimatorListener!);
- method public androidx.core.view.ViewPropertyAnimatorCompat! setStartDelay(long);
- method public androidx.core.view.ViewPropertyAnimatorCompat! setUpdateListener(androidx.core.view.ViewPropertyAnimatorUpdateListener!);
- method public void start();
- method public androidx.core.view.ViewPropertyAnimatorCompat! translationX(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! translationXBy(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! translationY(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! translationYBy(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! translationZ(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! translationZBy(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! withEndAction(Runnable!);
- method public androidx.core.view.ViewPropertyAnimatorCompat! withLayer();
- method public androidx.core.view.ViewPropertyAnimatorCompat! withStartAction(Runnable!);
- method public androidx.core.view.ViewPropertyAnimatorCompat! x(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! xBy(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! y(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! yBy(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! z(float);
- method public androidx.core.view.ViewPropertyAnimatorCompat! zBy(float);
- }
-
- public interface ViewPropertyAnimatorListener {
- method public void onAnimationCancel(android.view.View!);
- method public void onAnimationEnd(android.view.View!);
- method public void onAnimationStart(android.view.View!);
- }
-
- public class ViewPropertyAnimatorListenerAdapter implements androidx.core.view.ViewPropertyAnimatorListener {
- ctor public ViewPropertyAnimatorListenerAdapter();
- method public void onAnimationCancel(android.view.View!);
- method public void onAnimationEnd(android.view.View!);
- method public void onAnimationStart(android.view.View!);
- }
-
- public interface ViewPropertyAnimatorUpdateListener {
- method public void onAnimationUpdate(android.view.View!);
- }
-
- public final class WindowCompat {
- method public static <T extends android.view.View> T requireViewById(android.view.Window, @IdRes int);
- field public static final int FEATURE_ACTION_BAR = 8; // 0x8
- field public static final int FEATURE_ACTION_BAR_OVERLAY = 9; // 0x9
- field public static final int FEATURE_ACTION_MODE_OVERLAY = 10; // 0xa
- }
-
- public class WindowInsetsCompat {
- ctor public WindowInsetsCompat(androidx.core.view.WindowInsetsCompat!);
- method public androidx.core.view.WindowInsetsCompat! consumeDisplayCutout();
- method public androidx.core.view.WindowInsetsCompat! consumeStableInsets();
- method public androidx.core.view.WindowInsetsCompat! consumeSystemWindowInsets();
- method public androidx.core.view.DisplayCutoutCompat? getDisplayCutout();
- method public int getStableInsetBottom();
- method public int getStableInsetLeft();
- method public int getStableInsetRight();
- method public int getStableInsetTop();
- method public int getSystemWindowInsetBottom();
- method public int getSystemWindowInsetLeft();
- method public int getSystemWindowInsetRight();
- method public int getSystemWindowInsetTop();
- method public boolean hasInsets();
- method public boolean hasStableInsets();
- method public boolean hasSystemWindowInsets();
- method public boolean isConsumed();
- method public boolean isRound();
- method public androidx.core.view.WindowInsetsCompat! replaceSystemWindowInsets(int, int, int, int);
- method public androidx.core.view.WindowInsetsCompat! replaceSystemWindowInsets(android.graphics.Rect!);
- }
-
-}
-
-package androidx.core.view.accessibility {
-
- public final class AccessibilityClickableSpanCompat extends android.text.style.ClickableSpan {
- method public void onClick(android.view.View!);
- }
-
- public final class AccessibilityEventCompat {
- method @Deprecated public static void appendRecord(android.view.accessibility.AccessibilityEvent!, androidx.core.view.accessibility.AccessibilityRecordCompat!);
- method @Deprecated public static androidx.core.view.accessibility.AccessibilityRecordCompat! asRecord(android.view.accessibility.AccessibilityEvent!);
- method public static int getAction(android.view.accessibility.AccessibilityEvent!);
- method public static int getContentChangeTypes(android.view.accessibility.AccessibilityEvent!);
- method public static int getMovementGranularity(android.view.accessibility.AccessibilityEvent!);
- method @Deprecated public static androidx.core.view.accessibility.AccessibilityRecordCompat! getRecord(android.view.accessibility.AccessibilityEvent!, int);
- method @Deprecated public static int getRecordCount(android.view.accessibility.AccessibilityEvent!);
- method public static void setAction(android.view.accessibility.AccessibilityEvent!, int);
- method public static void setContentChangeTypes(android.view.accessibility.AccessibilityEvent!, int);
- method public static void setMovementGranularity(android.view.accessibility.AccessibilityEvent!, int);
- field public static final int CONTENT_CHANGE_TYPE_CONTENT_DESCRIPTION = 4; // 0x4
- field public static final int CONTENT_CHANGE_TYPE_PANE_APPEARED = 16; // 0x10
- field public static final int CONTENT_CHANGE_TYPE_PANE_DISAPPEARED = 32; // 0x20
- field public static final int CONTENT_CHANGE_TYPE_PANE_TITLE = 8; // 0x8
- field public static final int CONTENT_CHANGE_TYPE_SUBTREE = 1; // 0x1
- field public static final int CONTENT_CHANGE_TYPE_TEXT = 2; // 0x2
- field public static final int CONTENT_CHANGE_TYPE_UNDEFINED = 0; // 0x0
- field public static final int TYPES_ALL_MASK = -1; // 0xffffffff
- field public static final int TYPE_ANNOUNCEMENT = 16384; // 0x4000
- field public static final int TYPE_ASSIST_READING_CONTEXT = 16777216; // 0x1000000
- field public static final int TYPE_GESTURE_DETECTION_END = 524288; // 0x80000
- field public static final int TYPE_GESTURE_DETECTION_START = 262144; // 0x40000
- field @Deprecated public static final int TYPE_TOUCH_EXPLORATION_GESTURE_END = 1024; // 0x400
- field @Deprecated public static final int TYPE_TOUCH_EXPLORATION_GESTURE_START = 512; // 0x200
- field public static final int TYPE_TOUCH_INTERACTION_END = 2097152; // 0x200000
- field public static final int TYPE_TOUCH_INTERACTION_START = 1048576; // 0x100000
- field public static final int TYPE_VIEW_ACCESSIBILITY_FOCUSED = 32768; // 0x8000
- field public static final int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED = 65536; // 0x10000
- field public static final int TYPE_VIEW_CONTEXT_CLICKED = 8388608; // 0x800000
- field @Deprecated public static final int TYPE_VIEW_HOVER_ENTER = 128; // 0x80
- field @Deprecated public static final int TYPE_VIEW_HOVER_EXIT = 256; // 0x100
- field @Deprecated public static final int TYPE_VIEW_SCROLLED = 4096; // 0x1000
- field @Deprecated public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 8192; // 0x2000
- field public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY = 131072; // 0x20000
- field public static final int TYPE_WINDOWS_CHANGED = 4194304; // 0x400000
- field @Deprecated public static final int TYPE_WINDOW_CONTENT_CHANGED = 2048; // 0x800
- }
-
- public final class AccessibilityManagerCompat {
- method @Deprecated public static boolean addAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager!, androidx.core.view.accessibility.AccessibilityManagerCompat.AccessibilityStateChangeListener!);
- method public static boolean addTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager!, androidx.core.view.accessibility.AccessibilityManagerCompat.TouchExplorationStateChangeListener!);
- method @Deprecated public static java.util.List<android.accessibilityservice.AccessibilityServiceInfo>! getEnabledAccessibilityServiceList(android.view.accessibility.AccessibilityManager!, int);
- method @Deprecated public static java.util.List<android.accessibilityservice.AccessibilityServiceInfo>! getInstalledAccessibilityServiceList(android.view.accessibility.AccessibilityManager!);
- method @Deprecated public static boolean isTouchExplorationEnabled(android.view.accessibility.AccessibilityManager!);
- method @Deprecated public static boolean removeAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager!, androidx.core.view.accessibility.AccessibilityManagerCompat.AccessibilityStateChangeListener!);
- method public static boolean removeTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager!, androidx.core.view.accessibility.AccessibilityManagerCompat.TouchExplorationStateChangeListener!);
- }
-
- @Deprecated public static interface AccessibilityManagerCompat.AccessibilityStateChangeListener {
- method @Deprecated public void onAccessibilityStateChanged(boolean);
- }
-
- @Deprecated public abstract static class AccessibilityManagerCompat.AccessibilityStateChangeListenerCompat implements androidx.core.view.accessibility.AccessibilityManagerCompat.AccessibilityStateChangeListener {
- ctor @Deprecated public AccessibilityManagerCompat.AccessibilityStateChangeListenerCompat();
- }
-
- public static interface AccessibilityManagerCompat.TouchExplorationStateChangeListener {
- method public void onTouchExplorationStateChanged(boolean);
- }
-
- public class AccessibilityNodeInfoCompat {
- ctor @Deprecated public AccessibilityNodeInfoCompat(Object!);
- method public void addAction(int);
- method public void addAction(androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat!);
- method public void addChild(android.view.View!);
- method public void addChild(android.view.View!, int);
- method public boolean canOpenPopup();
- method public java.util.List<androidx.core.view.accessibility.AccessibilityNodeInfoCompat>! findAccessibilityNodeInfosByText(String!);
- method public java.util.List<androidx.core.view.accessibility.AccessibilityNodeInfoCompat>! findAccessibilityNodeInfosByViewId(String!);
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat! findFocus(int);
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat! focusSearch(int);
- method public java.util.List<androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat>! getActionList();
- method public int getActions();
- method public void getBoundsInParent(android.graphics.Rect!);
- method public void getBoundsInScreen(android.graphics.Rect!);
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat! getChild(int);
- method public int getChildCount();
- method public CharSequence! getClassName();
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat.CollectionInfoCompat! getCollectionInfo();
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat.CollectionItemInfoCompat! getCollectionItemInfo();
- method public CharSequence! getContentDescription();
- method public int getDrawingOrder();
- method public CharSequence! getError();
- method public android.os.Bundle! getExtras();
- method public CharSequence? getHintText();
- method @Deprecated public Object! getInfo();
- method public int getInputType();
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat! getLabelFor();
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat! getLabeledBy();
- method public int getLiveRegion();
- method public int getMaxTextLength();
- method public int getMovementGranularities();
- method public CharSequence! getPackageName();
- method public CharSequence? getPaneTitle();
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat! getParent();
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat.RangeInfoCompat! getRangeInfo();
- method public CharSequence? getRoleDescription();
- method public CharSequence! getText();
- method public int getTextSelectionEnd();
- method public int getTextSelectionStart();
- method public CharSequence? getTooltipText();
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat! getTraversalAfter();
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat! getTraversalBefore();
- method public String! getViewIdResourceName();
- method public androidx.core.view.accessibility.AccessibilityWindowInfoCompat! getWindow();
- method public int getWindowId();
- method public boolean isAccessibilityFocused();
- method public boolean isCheckable();
- method public boolean isChecked();
- method public boolean isClickable();
- method public boolean isContentInvalid();
- method public boolean isContextClickable();
- method public boolean isDismissable();
- method public boolean isEditable();
- method public boolean isEnabled();
- method public boolean isFocusable();
- method public boolean isFocused();
- method public boolean isHeading();
- method public boolean isImportantForAccessibility();
- method public boolean isLongClickable();
- method public boolean isMultiLine();
- method public boolean isPassword();
- method public boolean isScreenReaderFocusable();
- method public boolean isScrollable();
- method public boolean isSelected();
- method public boolean isShowingHintText();
- method public boolean isVisibleToUser();
- method public static androidx.core.view.accessibility.AccessibilityNodeInfoCompat! obtain(android.view.View!);
- method public static androidx.core.view.accessibility.AccessibilityNodeInfoCompat! obtain(android.view.View!, int);
- method public static androidx.core.view.accessibility.AccessibilityNodeInfoCompat! obtain();
- method public static androidx.core.view.accessibility.AccessibilityNodeInfoCompat! obtain(androidx.core.view.accessibility.AccessibilityNodeInfoCompat!);
- method public boolean performAction(int);
- method public boolean performAction(int, android.os.Bundle!);
- method public void recycle();
- method public boolean refresh();
- method public boolean removeAction(androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat!);
- method public boolean removeChild(android.view.View!);
- method public boolean removeChild(android.view.View!, int);
- method public void setAccessibilityFocused(boolean);
- method public void setBoundsInParent(android.graphics.Rect!);
- method public void setBoundsInScreen(android.graphics.Rect!);
- method public void setCanOpenPopup(boolean);
- method public void setCheckable(boolean);
- method public void setChecked(boolean);
- method public void setClassName(CharSequence!);
- method @Deprecated public void setClickable(boolean);
- method public void setCollectionInfo(Object!);
- method public void setCollectionItemInfo(Object!);
- method public void setContentDescription(CharSequence!);
- method public void setContentInvalid(boolean);
- method @Deprecated public void setContextClickable(boolean);
- method public void setDismissable(boolean);
- method public void setDrawingOrder(int);
- method public void setEditable(boolean);
- method public void setEnabled(boolean);
- method public void setError(CharSequence!);
- method @Deprecated public void setFocusable(boolean);
- method public void setFocused(boolean);
- method public void setHeading(boolean);
- method public void setHintText(CharSequence?);
- method public void setImportantForAccessibility(boolean);
- method public void setInputType(int);
- method public void setLabelFor(android.view.View!);
- method public void setLabelFor(android.view.View!, int);
- method public void setLabeledBy(android.view.View!);
- method public void setLabeledBy(android.view.View!, int);
- method public void setLiveRegion(int);
- method @Deprecated public void setLongClickable(boolean);
- method public void setMaxTextLength(int);
- method public void setMovementGranularities(int);
- method public void setMultiLine(boolean);
- method public void setPackageName(CharSequence!);
- method public void setPaneTitle(CharSequence?);
- method public void setParent(android.view.View!);
- method public void setParent(android.view.View!, int);
- method public void setPassword(boolean);
- method public void setRangeInfo(androidx.core.view.accessibility.AccessibilityNodeInfoCompat.RangeInfoCompat!);
- method public void setRoleDescription(CharSequence?);
- method public void setScreenReaderFocusable(boolean);
- method @Deprecated public void setScrollable(boolean);
- method public void setSelected(boolean);
- method public void setShowingHintText(boolean);
- method public void setSource(android.view.View!);
- method public void setSource(android.view.View!, int);
- method public void setText(CharSequence!);
- method public void setTextSelection(int, int);
- method public void setTooltipText(CharSequence?);
- method public void setTraversalAfter(android.view.View!);
- method public void setTraversalAfter(android.view.View!, int);
- method public void setTraversalBefore(android.view.View!);
- method public void setTraversalBefore(android.view.View!, int);
- method public void setViewIdResourceName(String!);
- method public void setVisibleToUser(boolean);
- method public android.view.accessibility.AccessibilityNodeInfo! unwrap();
- method public static androidx.core.view.accessibility.AccessibilityNodeInfoCompat! wrap(android.view.accessibility.AccessibilityNodeInfo);
- field public static final int ACTION_ACCESSIBILITY_FOCUS = 64; // 0x40
- field public static final String ACTION_ARGUMENT_COLUMN_INT = "android.view.accessibility.action.ARGUMENT_COLUMN_INT";
- field public static final String ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN = "ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN";
- field public static final String ACTION_ARGUMENT_HTML_ELEMENT_STRING = "ACTION_ARGUMENT_HTML_ELEMENT_STRING";
- field public static final String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT = "ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT";
- field public static final String ACTION_ARGUMENT_MOVE_WINDOW_X = "ACTION_ARGUMENT_MOVE_WINDOW_X";
- field public static final String ACTION_ARGUMENT_MOVE_WINDOW_Y = "ACTION_ARGUMENT_MOVE_WINDOW_Y";
- field public static final String ACTION_ARGUMENT_PROGRESS_VALUE = "android.view.accessibility.action.ARGUMENT_PROGRESS_VALUE";
- field public static final String ACTION_ARGUMENT_ROW_INT = "android.view.accessibility.action.ARGUMENT_ROW_INT";
- field public static final String ACTION_ARGUMENT_SELECTION_END_INT = "ACTION_ARGUMENT_SELECTION_END_INT";
- field public static final String ACTION_ARGUMENT_SELECTION_START_INT = "ACTION_ARGUMENT_SELECTION_START_INT";
- field public static final String ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE = "ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE";
- field public static final int ACTION_CLEAR_ACCESSIBILITY_FOCUS = 128; // 0x80
- field public static final int ACTION_CLEAR_FOCUS = 2; // 0x2
- field public static final int ACTION_CLEAR_SELECTION = 8; // 0x8
- field public static final int ACTION_CLICK = 16; // 0x10
- field public static final int ACTION_COLLAPSE = 524288; // 0x80000
- field public static final int ACTION_COPY = 16384; // 0x4000
- field public static final int ACTION_CUT = 65536; // 0x10000
- field public static final int ACTION_DISMISS = 1048576; // 0x100000
- field public static final int ACTION_EXPAND = 262144; // 0x40000
- field public static final int ACTION_FOCUS = 1; // 0x1
- field public static final int ACTION_LONG_CLICK = 32; // 0x20
- field public static final int ACTION_NEXT_AT_MOVEMENT_GRANULARITY = 256; // 0x100
- field public static final int ACTION_NEXT_HTML_ELEMENT = 1024; // 0x400
- field public static final int ACTION_PASTE = 32768; // 0x8000
- field public static final int ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY = 512; // 0x200
- field public static final int ACTION_PREVIOUS_HTML_ELEMENT = 2048; // 0x800
- field public static final int ACTION_SCROLL_BACKWARD = 8192; // 0x2000
- field public static final int ACTION_SCROLL_FORWARD = 4096; // 0x1000
- field public static final int ACTION_SELECT = 4; // 0x4
- field public static final int ACTION_SET_SELECTION = 131072; // 0x20000
- field public static final int ACTION_SET_TEXT = 2097152; // 0x200000
- field public static final int FOCUS_ACCESSIBILITY = 2; // 0x2
- field public static final int FOCUS_INPUT = 1; // 0x1
- field public static final int MOVEMENT_GRANULARITY_CHARACTER = 1; // 0x1
- field public static final int MOVEMENT_GRANULARITY_LINE = 4; // 0x4
- field public static final int MOVEMENT_GRANULARITY_PAGE = 16; // 0x10
- field public static final int MOVEMENT_GRANULARITY_PARAGRAPH = 8; // 0x8
- field public static final int MOVEMENT_GRANULARITY_WORD = 2; // 0x2
- }
-
- public static class AccessibilityNodeInfoCompat.AccessibilityActionCompat {
- ctor public AccessibilityNodeInfoCompat.AccessibilityActionCompat(int, CharSequence!);
- method public int getId();
- method public CharSequence! getLabel();
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_ACCESSIBILITY_FOCUS;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_CLEAR_ACCESSIBILITY_FOCUS;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_CLEAR_FOCUS;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_CLEAR_SELECTION;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_CLICK;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_COLLAPSE;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_CONTEXT_CLICK;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_COPY;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_CUT;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_DISMISS;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_EXPAND;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_FOCUS;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_HIDE_TOOLTIP;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_LONG_CLICK;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_MOVE_WINDOW;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_NEXT_AT_MOVEMENT_GRANULARITY;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_NEXT_HTML_ELEMENT;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_PASTE;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_PREVIOUS_HTML_ELEMENT;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SCROLL_BACKWARD;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SCROLL_DOWN;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SCROLL_FORWARD;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SCROLL_LEFT;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SCROLL_RIGHT;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SCROLL_TO_POSITION;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SCROLL_UP;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SELECT;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SET_PROGRESS;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SET_SELECTION;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SET_TEXT;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SHOW_ON_SCREEN;
- field public static final androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! ACTION_SHOW_TOOLTIP;
- }
-
- public static class AccessibilityNodeInfoCompat.CollectionInfoCompat {
- method public int getColumnCount();
- method public int getRowCount();
- method public int getSelectionMode();
- method public boolean isHierarchical();
- method public static androidx.core.view.accessibility.AccessibilityNodeInfoCompat.CollectionInfoCompat! obtain(int, int, boolean, int);
- method public static androidx.core.view.accessibility.AccessibilityNodeInfoCompat.CollectionInfoCompat! obtain(int, int, boolean);
- field public static final int SELECTION_MODE_MULTIPLE = 2; // 0x2
- field public static final int SELECTION_MODE_NONE = 0; // 0x0
- field public static final int SELECTION_MODE_SINGLE = 1; // 0x1
- }
-
- public static class AccessibilityNodeInfoCompat.CollectionItemInfoCompat {
- method public int getColumnIndex();
- method public int getColumnSpan();
- method public int getRowIndex();
- method public int getRowSpan();
- method @Deprecated public boolean isHeading();
- method public boolean isSelected();
- method public static androidx.core.view.accessibility.AccessibilityNodeInfoCompat.CollectionItemInfoCompat! obtain(int, int, int, int, boolean, boolean);
- method public static androidx.core.view.accessibility.AccessibilityNodeInfoCompat.CollectionItemInfoCompat! obtain(int, int, int, int, boolean);
- }
-
- public static class AccessibilityNodeInfoCompat.RangeInfoCompat {
- method public float getCurrent();
- method public float getMax();
- method public float getMin();
- method public int getType();
- method public static androidx.core.view.accessibility.AccessibilityNodeInfoCompat.RangeInfoCompat! obtain(int, float, float, float);
- field public static final int RANGE_TYPE_FLOAT = 1; // 0x1
- field public static final int RANGE_TYPE_INT = 0; // 0x0
- field public static final int RANGE_TYPE_PERCENT = 2; // 0x2
- }
-
- public class AccessibilityNodeProviderCompat {
- ctor public AccessibilityNodeProviderCompat();
- ctor public AccessibilityNodeProviderCompat(Object!);
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat? createAccessibilityNodeInfo(int);
- method public java.util.List<androidx.core.view.accessibility.AccessibilityNodeInfoCompat>? findAccessibilityNodeInfosByText(String!, int);
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat? findFocus(int);
- method public Object! getProvider();
- method public boolean performAction(int, int, android.os.Bundle!);
- field public static final int HOST_VIEW_ID = -1; // 0xffffffff
- }
-
- public class AccessibilityRecordCompat {
- ctor @Deprecated public AccessibilityRecordCompat(Object!);
- method @Deprecated public boolean equals(Object?);
- method @Deprecated public int getAddedCount();
- method @Deprecated public CharSequence! getBeforeText();
- method @Deprecated public CharSequence! getClassName();
- method @Deprecated public CharSequence! getContentDescription();
- method @Deprecated public int getCurrentItemIndex();
- method @Deprecated public int getFromIndex();
- method @Deprecated public Object! getImpl();
- method @Deprecated public int getItemCount();
- method @Deprecated public int getMaxScrollX();
- method public static int getMaxScrollX(android.view.accessibility.AccessibilityRecord!);
- method @Deprecated public int getMaxScrollY();
- method public static int getMaxScrollY(android.view.accessibility.AccessibilityRecord!);
- method @Deprecated public android.os.Parcelable! getParcelableData();
- method @Deprecated public int getRemovedCount();
- method @Deprecated public int getScrollX();
- method @Deprecated public int getScrollY();
- method @Deprecated public androidx.core.view.accessibility.AccessibilityNodeInfoCompat! getSource();
- method @Deprecated public java.util.List<java.lang.CharSequence>! getText();
- method @Deprecated public int getToIndex();
- method @Deprecated public int getWindowId();
- method @Deprecated public int hashCode();
- method @Deprecated public boolean isChecked();
- method @Deprecated public boolean isEnabled();
- method @Deprecated public boolean isFullScreen();
- method @Deprecated public boolean isPassword();
- method @Deprecated public boolean isScrollable();
- method @Deprecated public static androidx.core.view.accessibility.AccessibilityRecordCompat! obtain(androidx.core.view.accessibility.AccessibilityRecordCompat!);
- method @Deprecated public static androidx.core.view.accessibility.AccessibilityRecordCompat! obtain();
- method @Deprecated public void recycle();
- method @Deprecated public void setAddedCount(int);
- method @Deprecated public void setBeforeText(CharSequence!);
- method @Deprecated public void setChecked(boolean);
- method @Deprecated public void setClassName(CharSequence!);
- method @Deprecated public void setContentDescription(CharSequence!);
- method @Deprecated public void setCurrentItemIndex(int);
- method @Deprecated public void setEnabled(boolean);
- method @Deprecated public void setFromIndex(int);
- method @Deprecated public void setFullScreen(boolean);
- method @Deprecated public void setItemCount(int);
- method @Deprecated public void setMaxScrollX(int);
- method public static void setMaxScrollX(android.view.accessibility.AccessibilityRecord!, int);
- method @Deprecated public void setMaxScrollY(int);
- method public static void setMaxScrollY(android.view.accessibility.AccessibilityRecord!, int);
- method @Deprecated public void setParcelableData(android.os.Parcelable!);
- method @Deprecated public void setPassword(boolean);
- method @Deprecated public void setRemovedCount(int);
- method @Deprecated public void setScrollX(int);
- method @Deprecated public void setScrollY(int);
- method @Deprecated public void setScrollable(boolean);
- method @Deprecated public void setSource(android.view.View!);
- method @Deprecated public void setSource(android.view.View!, int);
- method public static void setSource(android.view.accessibility.AccessibilityRecord, android.view.View!, int);
- method @Deprecated public void setToIndex(int);
- }
-
- public interface AccessibilityViewCommand {
- method public boolean perform(android.view.View, androidx.core.view.accessibility.AccessibilityViewCommand.CommandArguments?);
- }
-
- public abstract static class AccessibilityViewCommand.CommandArguments {
- ctor public AccessibilityViewCommand.CommandArguments();
- }
-
- public static final class AccessibilityViewCommand.MoveAtGranularityArguments extends androidx.core.view.accessibility.AccessibilityViewCommand.CommandArguments {
- ctor public AccessibilityViewCommand.MoveAtGranularityArguments();
- method public boolean getExtendSelection();
- method public int getGranularity();
- }
-
- public static final class AccessibilityViewCommand.MoveHtmlArguments extends androidx.core.view.accessibility.AccessibilityViewCommand.CommandArguments {
- ctor public AccessibilityViewCommand.MoveHtmlArguments();
- method public String! getHTMLElement();
- }
-
- public static final class AccessibilityViewCommand.MoveWindowArguments extends androidx.core.view.accessibility.AccessibilityViewCommand.CommandArguments {
- ctor public AccessibilityViewCommand.MoveWindowArguments();
- method public int getX();
- method public int getY();
- }
-
- public static final class AccessibilityViewCommand.ScrollToPositionArguments extends androidx.core.view.accessibility.AccessibilityViewCommand.CommandArguments {
- ctor public AccessibilityViewCommand.ScrollToPositionArguments();
- method public int getColumn();
- method public int getRow();
- }
-
- public static final class AccessibilityViewCommand.SetProgressArguments extends androidx.core.view.accessibility.AccessibilityViewCommand.CommandArguments {
- ctor public AccessibilityViewCommand.SetProgressArguments();
- method public float getProgress();
- }
-
- public static final class AccessibilityViewCommand.SetSelectionArguments extends androidx.core.view.accessibility.AccessibilityViewCommand.CommandArguments {
- ctor public AccessibilityViewCommand.SetSelectionArguments();
- method public int getEnd();
- method public int getStart();
- }
-
- public static final class AccessibilityViewCommand.SetTextArguments extends androidx.core.view.accessibility.AccessibilityViewCommand.CommandArguments {
- ctor public AccessibilityViewCommand.SetTextArguments();
- method public CharSequence! getText();
- }
-
- public class AccessibilityWindowInfoCompat {
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat! getAnchor();
- method public void getBoundsInScreen(android.graphics.Rect!);
- method public androidx.core.view.accessibility.AccessibilityWindowInfoCompat! getChild(int);
- method public int getChildCount();
- method public int getId();
- method public int getLayer();
- method public androidx.core.view.accessibility.AccessibilityWindowInfoCompat! getParent();
- method public androidx.core.view.accessibility.AccessibilityNodeInfoCompat! getRoot();
- method public CharSequence! getTitle();
- method public int getType();
- method public boolean isAccessibilityFocused();
- method public boolean isActive();
- method public boolean isFocused();
- method public static androidx.core.view.accessibility.AccessibilityWindowInfoCompat! obtain();
- method public static androidx.core.view.accessibility.AccessibilityWindowInfoCompat! obtain(androidx.core.view.accessibility.AccessibilityWindowInfoCompat!);
- method public void recycle();
- field public static final int TYPE_ACCESSIBILITY_OVERLAY = 4; // 0x4
- field public static final int TYPE_APPLICATION = 1; // 0x1
- field public static final int TYPE_INPUT_METHOD = 2; // 0x2
- field public static final int TYPE_SPLIT_SCREEN_DIVIDER = 5; // 0x5
- field public static final int TYPE_SYSTEM = 3; // 0x3
- }
-
-}
-
-package androidx.core.view.animation {
-
- public final class PathInterpolatorCompat {
- method public static android.view.animation.Interpolator! create(android.graphics.Path!);
- method public static android.view.animation.Interpolator! create(float, float);
- method public static android.view.animation.Interpolator! create(float, float, float, float);
- }
-
-}
-
-package androidx.core.view.inputmethod {
-
- public final class EditorInfoCompat {
- ctor @Deprecated public EditorInfoCompat();
- method public static String[] getContentMimeTypes(android.view.inputmethod.EditorInfo!);
- method public static void setContentMimeTypes(android.view.inputmethod.EditorInfo, String[]?);
- field public static final int IME_FLAG_FORCE_ASCII = -2147483648; // 0x80000000
- field public static final int IME_FLAG_NO_PERSONALIZED_LEARNING = 16777216; // 0x1000000
- }
-
- public final class InputConnectionCompat {
- ctor @Deprecated public InputConnectionCompat();
- method public static boolean commitContent(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo, androidx.core.view.inputmethod.InputContentInfoCompat, int, android.os.Bundle?);
- method public static android.view.inputmethod.InputConnection createWrapper(android.view.inputmethod.InputConnection, android.view.inputmethod.EditorInfo, androidx.core.view.inputmethod.InputConnectionCompat.OnCommitContentListener);
- field public static final int INPUT_CONTENT_GRANT_READ_URI_PERMISSION = 1; // 0x1
- }
-
- public static interface InputConnectionCompat.OnCommitContentListener {
- method public boolean onCommitContent(androidx.core.view.inputmethod.InputContentInfoCompat!, int, android.os.Bundle!);
- }
-
- public final class InputContentInfoCompat {
- ctor public InputContentInfoCompat(android.net.Uri, android.content.ClipDescription, android.net.Uri?);
- method public android.net.Uri getContentUri();
- method public android.content.ClipDescription getDescription();
- method public android.net.Uri? getLinkUri();
- method public void releasePermission();
- method public void requestPermission();
- method public Object? unwrap();
- method public static androidx.core.view.inputmethod.InputContentInfoCompat? wrap(Object?);
- }
-
-}
-
-package androidx.core.widget {
-
- public abstract class AutoScrollHelper implements android.view.View.OnTouchListener {
- ctor public AutoScrollHelper(android.view.View);
- method public abstract boolean canTargetScrollHorizontally(int);
- method public abstract boolean canTargetScrollVertically(int);
- method public boolean isEnabled();
- method public boolean isExclusive();
- method public boolean onTouch(android.view.View!, android.view.MotionEvent!);
- method public abstract void scrollTargetBy(int, int);
- method public androidx.core.widget.AutoScrollHelper setActivationDelay(int);
- method public androidx.core.widget.AutoScrollHelper setEdgeType(int);
- method public androidx.core.widget.AutoScrollHelper! setEnabled(boolean);
- method public androidx.core.widget.AutoScrollHelper! setExclusive(boolean);
- method public androidx.core.widget.AutoScrollHelper setMaximumEdges(float, float);
- method public androidx.core.widget.AutoScrollHelper setMaximumVelocity(float, float);
- method public androidx.core.widget.AutoScrollHelper setMinimumVelocity(float, float);
- method public androidx.core.widget.AutoScrollHelper setRampDownDuration(int);
- method public androidx.core.widget.AutoScrollHelper setRampUpDuration(int);
- method public androidx.core.widget.AutoScrollHelper setRelativeEdges(float, float);
- method public androidx.core.widget.AutoScrollHelper setRelativeVelocity(float, float);
- field public static final int EDGE_TYPE_INSIDE = 0; // 0x0
- field public static final int EDGE_TYPE_INSIDE_EXTEND = 1; // 0x1
- field public static final int EDGE_TYPE_OUTSIDE = 2; // 0x2
- field public static final float NO_MAX = 3.4028235E38f;
- field public static final float NO_MIN = 0.0f;
- field public static final float RELATIVE_UNSPECIFIED = 0.0f;
- }
-
- public final class CompoundButtonCompat {
- method public static android.graphics.drawable.Drawable? getButtonDrawable(android.widget.CompoundButton);
- method public static android.content.res.ColorStateList? getButtonTintList(android.widget.CompoundButton);
- method public static android.graphics.PorterDuff.Mode? getButtonTintMode(android.widget.CompoundButton);
- method public static void setButtonTintList(android.widget.CompoundButton, android.content.res.ColorStateList?);
- method public static void setButtonTintMode(android.widget.CompoundButton, android.graphics.PorterDuff.Mode?);
- }
-
- public class ContentLoadingProgressBar extends android.widget.ProgressBar {
- ctor public ContentLoadingProgressBar(android.content.Context);
- ctor public ContentLoadingProgressBar(android.content.Context, android.util.AttributeSet?);
- method public void hide();
- method public void onAttachedToWindow();
- method public void onDetachedFromWindow();
- method public void show();
- }
-
- public final class EdgeEffectCompat {
- ctor @Deprecated public EdgeEffectCompat(android.content.Context!);
- method @Deprecated public boolean draw(android.graphics.Canvas!);
- method @Deprecated public void finish();
- method @Deprecated public boolean isFinished();
- method @Deprecated public boolean onAbsorb(int);
- method @Deprecated public boolean onPull(float);
- method @Deprecated public boolean onPull(float, float);
- method public static void onPull(android.widget.EdgeEffect, float, float);
- method @Deprecated public boolean onRelease();
- method @Deprecated public void setSize(int, int);
- }
-
- public class ImageViewCompat {
- method public static android.content.res.ColorStateList? getImageTintList(android.widget.ImageView);
- method public static android.graphics.PorterDuff.Mode? getImageTintMode(android.widget.ImageView);
- method public static void setImageTintList(android.widget.ImageView, android.content.res.ColorStateList?);
- method public static void setImageTintMode(android.widget.ImageView, android.graphics.PorterDuff.Mode?);
- }
-
- public final class ListPopupWindowCompat {
- method @Deprecated public static android.view.View.OnTouchListener! createDragToOpenListener(Object!, android.view.View!);
- method public static android.view.View.OnTouchListener? createDragToOpenListener(android.widget.ListPopupWindow, android.view.View);
- }
-
- public class ListViewAutoScrollHelper extends androidx.core.widget.AutoScrollHelper {
- ctor public ListViewAutoScrollHelper(android.widget.ListView);
- method public boolean canTargetScrollHorizontally(int);
- method public boolean canTargetScrollVertically(int);
- method public void scrollTargetBy(int, int);
- }
-
- public final class ListViewCompat {
- method public static boolean canScrollList(android.widget.ListView, int);
- method public static void scrollListBy(android.widget.ListView, int);
- }
-
- public class NestedScrollView extends android.widget.FrameLayout implements androidx.core.view.NestedScrollingChild3 androidx.core.view.NestedScrollingParent3 androidx.core.view.ScrollingView {
- ctor public NestedScrollView(android.content.Context);
- ctor public NestedScrollView(android.content.Context, android.util.AttributeSet?);
- ctor public NestedScrollView(android.content.Context, android.util.AttributeSet?, int);
- method public boolean arrowScroll(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeHorizontalScrollExtent();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeHorizontalScrollOffset();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeHorizontalScrollRange();
- method protected int computeScrollDeltaToGetChildRectOnScreen(android.graphics.Rect!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeVerticalScrollExtent();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeVerticalScrollOffset();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeVerticalScrollRange();
- method public boolean dispatchNestedPreScroll(int, int, int[]!, int[]!, int);
- method public void dispatchNestedScroll(int, int, int, int, int[]?, int, int[]);
- method public boolean dispatchNestedScroll(int, int, int, int, int[]!, int);
- method public boolean executeKeyEvent(android.view.KeyEvent);
- method public void fling(int);
- method public boolean fullScroll(int);
- method public int getMaxScrollAmount();
- method public boolean hasNestedScrollingParent(int);
- method public boolean isFillViewport();
- method public boolean isSmoothScrollingEnabled();
- method public void onAttachedToWindow();
- method public void onNestedPreScroll(android.view.View, int, int, int[], int);
- method public void onNestedScroll(android.view.View, int, int, int, int, int, int[]);
- method public void onNestedScroll(android.view.View, int, int, int, int, int);
- method public void onNestedScrollAccepted(android.view.View, android.view.View, int, int);
- method public boolean onStartNestedScroll(android.view.View, android.view.View, int, int);
- method public void onStopNestedScroll(android.view.View, int);
- method public boolean pageScroll(int);
- method public void setFillViewport(boolean);
- method public void setOnScrollChangeListener(androidx.core.widget.NestedScrollView.OnScrollChangeListener?);
- method public void setSmoothScrollingEnabled(boolean);
- method public final void smoothScrollBy(int, int);
- method public final void smoothScrollTo(int, int);
- method public boolean startNestedScroll(int, int);
- method public void stopNestedScroll(int);
- }
-
- public static interface NestedScrollView.OnScrollChangeListener {
- method public void onScrollChange(androidx.core.widget.NestedScrollView!, int, int, int, int);
- }
-
- public final class PopupMenuCompat {
- method public static android.view.View.OnTouchListener? getDragToOpenListener(Object);
- }
-
- public final class PopupWindowCompat {
- method public static boolean getOverlapAnchor(android.widget.PopupWindow);
- method public static int getWindowLayoutType(android.widget.PopupWindow);
- method public static void setOverlapAnchor(android.widget.PopupWindow, boolean);
- method public static void setWindowLayoutType(android.widget.PopupWindow, int);
- method public static void showAsDropDown(android.widget.PopupWindow, android.view.View, int, int, int);
- }
-
- @Deprecated public final class ScrollerCompat {
- method @Deprecated public void abortAnimation();
- method @Deprecated public boolean computeScrollOffset();
- method @Deprecated public static androidx.core.widget.ScrollerCompat! create(android.content.Context!);
- method @Deprecated public static androidx.core.widget.ScrollerCompat! create(android.content.Context!, android.view.animation.Interpolator!);
- method @Deprecated public void fling(int, int, int, int, int, int, int, int);
- method @Deprecated public void fling(int, int, int, int, int, int, int, int, int, int);
- method @Deprecated public float getCurrVelocity();
- method @Deprecated public int getCurrX();
- method @Deprecated public int getCurrY();
- method @Deprecated public int getFinalX();
- method @Deprecated public int getFinalY();
- method @Deprecated public boolean isFinished();
- method @Deprecated public boolean isOverScrolled();
- method @Deprecated public void notifyHorizontalEdgeReached(int, int, int);
- method @Deprecated public void notifyVerticalEdgeReached(int, int, int);
- method @Deprecated public boolean springBack(int, int, int, int, int, int);
- method @Deprecated public void startScroll(int, int, int, int);
- method @Deprecated public void startScroll(int, int, int, int, int);
- }
-
- public final class TextViewCompat {
- method public static int getAutoSizeMaxTextSize(android.widget.TextView);
- method public static int getAutoSizeMinTextSize(android.widget.TextView);
- method public static int getAutoSizeStepGranularity(android.widget.TextView);
- method public static int[] getAutoSizeTextAvailableSizes(android.widget.TextView);
- method public static int getAutoSizeTextType(android.widget.TextView);
- method public static android.content.res.ColorStateList? getCompoundDrawableTintList(android.widget.TextView);
- method public static android.graphics.PorterDuff.Mode? getCompoundDrawableTintMode(android.widget.TextView);
- method public static android.graphics.drawable.Drawable[] getCompoundDrawablesRelative(android.widget.TextView);
- method public static int getFirstBaselineToTopHeight(android.widget.TextView);
- method public static int getLastBaselineToBottomHeight(android.widget.TextView);
- method public static int getMaxLines(android.widget.TextView);
- method public static int getMinLines(android.widget.TextView);
- method public static androidx.core.text.PrecomputedTextCompat.Params getTextMetricsParams(android.widget.TextView);
- method public static void setAutoSizeTextTypeUniformWithConfiguration(android.widget.TextView, int, int, int, int) throws java.lang.IllegalArgumentException;
- method public static void setAutoSizeTextTypeUniformWithPresetSizes(android.widget.TextView, int[], int) throws java.lang.IllegalArgumentException;
- method public static void setAutoSizeTextTypeWithDefaults(android.widget.TextView, int);
- method public static void setCompoundDrawableTintList(android.widget.TextView, android.content.res.ColorStateList?);
- method public static void setCompoundDrawableTintMode(android.widget.TextView, android.graphics.PorterDuff.Mode?);
- method public static void setCompoundDrawablesRelative(android.widget.TextView, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?);
- method public static void setCompoundDrawablesRelativeWithIntrinsicBounds(android.widget.TextView, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?);
- method public static void setCompoundDrawablesRelativeWithIntrinsicBounds(android.widget.TextView, @DrawableRes int, @DrawableRes int, @DrawableRes int, @DrawableRes int);
- method public static void setCustomSelectionActionModeCallback(android.widget.TextView, android.view.ActionMode.Callback);
- method public static void setFirstBaselineToTopHeight(android.widget.TextView, @Px @IntRange(from=0) int);
- method public static void setLastBaselineToBottomHeight(android.widget.TextView, @Px @IntRange(from=0) int);
- method public static void setLineHeight(android.widget.TextView, @Px @IntRange(from=0) int);
- method public static void setPrecomputedText(android.widget.TextView, androidx.core.text.PrecomputedTextCompat);
- method public static void setTextAppearance(android.widget.TextView, @StyleRes int);
- method public static void setTextMetricsParams(android.widget.TextView, androidx.core.text.PrecomputedTextCompat.Params);
- field public static final int AUTO_SIZE_TEXT_TYPE_NONE = 0; // 0x0
- field public static final int AUTO_SIZE_TEXT_TYPE_UNIFORM = 1; // 0x1
- }
-
- public interface TintableCompoundButton {
- method public android.content.res.ColorStateList? getSupportButtonTintList();
- method public android.graphics.PorterDuff.Mode? getSupportButtonTintMode();
- method public void setSupportButtonTintList(android.content.res.ColorStateList?);
- method public void setSupportButtonTintMode(android.graphics.PorterDuff.Mode?);
- }
-
- public interface TintableCompoundDrawablesView {
- method public android.content.res.ColorStateList? getSupportCompoundDrawablesTintList();
- method public android.graphics.PorterDuff.Mode? getSupportCompoundDrawablesTintMode();
- method public void setSupportCompoundDrawablesTintList(android.content.res.ColorStateList?);
- method public void setSupportCompoundDrawablesTintMode(android.graphics.PorterDuff.Mode?);
- }
-
-}
-
diff --git a/core/api/current.txt b/core/api/current.txt
index 0ece2e3..9a55963 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.core.accessibilityservice {
public final class AccessibilityServiceInfoCompat {
@@ -31,7 +31,6 @@
method public static android.net.Uri? getReferrer(android.app.Activity);
method @Deprecated public static boolean invalidateOptionsMenu(android.app.Activity!);
method public static void postponeEnterTransition(android.app.Activity);
- method public static void recreate(android.app.Activity);
method public static androidx.core.view.DragAndDropPermissionsCompat? requestDragAndDropPermissions(android.app.Activity!, android.view.DragEvent!);
method public static void requestPermissions(android.app.Activity, String[], @IntRange(from=0) int);
method public static <T extends android.view.View> T requireViewById(android.app.Activity, @IdRes int);
@@ -1137,14 +1136,6 @@
}
-package androidx.core.location {
-
- public final class LocationManagerCompat {
- method public static boolean isLocationEnabled(android.location.LocationManager);
- }
-
-}
-
package androidx.core.math {
public class MathUtils {
@@ -2821,13 +2812,13 @@
ctor public NestedScrollView(android.content.Context, android.util.AttributeSet?);
ctor public NestedScrollView(android.content.Context, android.util.AttributeSet?, int);
method public boolean arrowScroll(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeHorizontalScrollExtent();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeHorizontalScrollOffset();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeHorizontalScrollRange();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public int computeHorizontalScrollExtent();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public int computeHorizontalScrollOffset();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public int computeHorizontalScrollRange();
method protected int computeScrollDeltaToGetChildRectOnScreen(android.graphics.Rect!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeVerticalScrollExtent();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeVerticalScrollOffset();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeVerticalScrollRange();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public int computeVerticalScrollExtent();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public int computeVerticalScrollOffset();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public int computeVerticalScrollRange();
method public boolean dispatchNestedPreScroll(int, int, int[]!, int[]!, int);
method public void dispatchNestedScroll(int, int, int, int, int[]?, int, int[]);
method public boolean dispatchNestedScroll(int, int, int, int, int[]!, int);
@@ -2898,8 +2889,6 @@
method public static int getAutoSizeStepGranularity(android.widget.TextView);
method public static int[] getAutoSizeTextAvailableSizes(android.widget.TextView);
method public static int getAutoSizeTextType(android.widget.TextView);
- method public static android.content.res.ColorStateList? getCompoundDrawableTintList(android.widget.TextView);
- method public static android.graphics.PorterDuff.Mode? getCompoundDrawableTintMode(android.widget.TextView);
method public static android.graphics.drawable.Drawable[] getCompoundDrawablesRelative(android.widget.TextView);
method public static int getFirstBaselineToTopHeight(android.widget.TextView);
method public static int getLastBaselineToBottomHeight(android.widget.TextView);
@@ -2909,8 +2898,6 @@
method public static void setAutoSizeTextTypeUniformWithConfiguration(android.widget.TextView, int, int, int, int) throws java.lang.IllegalArgumentException;
method public static void setAutoSizeTextTypeUniformWithPresetSizes(android.widget.TextView, int[], int) throws java.lang.IllegalArgumentException;
method public static void setAutoSizeTextTypeWithDefaults(android.widget.TextView, int);
- method public static void setCompoundDrawableTintList(android.widget.TextView, android.content.res.ColorStateList?);
- method public static void setCompoundDrawableTintMode(android.widget.TextView, android.graphics.PorterDuff.Mode?);
method public static void setCompoundDrawablesRelative(android.widget.TextView, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?);
method public static void setCompoundDrawablesRelativeWithIntrinsicBounds(android.widget.TextView, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?, android.graphics.drawable.Drawable?);
method public static void setCompoundDrawablesRelativeWithIntrinsicBounds(android.widget.TextView, @DrawableRes int, @DrawableRes int, @DrawableRes int, @DrawableRes int);
@@ -2932,12 +2919,5 @@
method public void setSupportButtonTintMode(android.graphics.PorterDuff.Mode?);
}
- public interface TintableCompoundDrawablesView {
- method public android.content.res.ColorStateList? getSupportCompoundDrawablesTintList();
- method public android.graphics.PorterDuff.Mode? getSupportCompoundDrawablesTintMode();
- method public void setSupportCompoundDrawablesTintList(android.content.res.ColorStateList?);
- method public void setSupportCompoundDrawablesTintMode(android.graphics.PorterDuff.Mode?);
- }
-
}
diff --git a/core/api/res-1.1.0-alpha05.txt b/core/api/res-1.1.0-alpha05.txt
deleted file mode 100644
index e52dd8c..0000000
--- a/core/api/res-1.1.0-alpha05.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-style TextAppearance_Compat_Notification
-style TextAppearance_Compat_Notification_Info
-style TextAppearance_Compat_Notification_Line2
-style TextAppearance_Compat_Notification_Time
-style TextAppearance_Compat_Notification_Title
-attr alpha
-attr font
-attr fontProviderAuthority
-attr fontProviderCerts
-attr fontProviderFetchStrategy
-attr fontProviderFetchTimeout
-attr fontProviderPackage
-attr fontProviderQuery
-attr fontStyle
-attr fontVariationSettings
-attr fontWeight
-attr ttcIndex
diff --git a/core/api/restricted_1.0.0.txt b/core/api/restricted_1.0.0.txt
deleted file mode 100644
index 56af355..0000000
--- a/core/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,584 +0,0 @@
-// Signature format: 3.0
-package android.support.v4.graphics.drawable {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final class IconCompatParcelizer extends androidx.core.graphics.drawable.IconCompatParcelizer {
- ctor public IconCompatParcelizer();
- method public static androidx.core.graphics.drawable.IconCompat! read(androidx.versionedparcelable.VersionedParcel!);
- method public static void write(androidx.core.graphics.drawable.IconCompat!, androidx.versionedparcelable.VersionedParcel!);
- }
-
-}
-
-package android.support.v4.os {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ResultReceiver {
- ctor public ResultReceiver(android.os.Handler!);
- method public int describeContents();
- method protected void onReceiveResult(int, android.os.Bundle!);
- method public void send(int, android.os.Bundle!);
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<android.support.v4.os.ResultReceiver>! CREATOR;
- }
-
-}
-
-package androidx.core.app {
-
- public class ActivityCompat extends androidx.core.content.ContextCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.core.app.ActivityCompat.PermissionCompatDelegate! getPermissionCompatDelegate();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static interface ActivityCompat.RequestPermissionsRequestCodeValidator {
- method public void validateRequestPermissionsRequestCode(int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ComponentActivity implements androidx.core.view.KeyEventDispatcher.Component {
- ctor public ComponentActivity();
- method public boolean dispatchKeyEvent(android.view.KeyEvent!);
- method public boolean dispatchKeyShortcutEvent(android.view.KeyEvent!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public <T extends androidx.core.app.ComponentActivity.ExtraData> T! getExtraData(Class<T>!);
- method public androidx.lifecycle.Lifecycle! getLifecycle();
- method protected void onCreate(android.os.Bundle?);
- method @CallSuper protected void onSaveInstanceState(android.os.Bundle!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void putExtraData(androidx.core.app.ComponentActivity.ExtraData!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean superDispatchKeyEvent(android.view.KeyEvent!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class ComponentActivity.ExtraData {
- ctor public ComponentActivity.ExtraData();
- }
-
- @RequiresApi(api=28) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class CoreComponentFactory {
- ctor public CoreComponentFactory();
- method public android.app.Activity! instantiateActivity(ClassLoader!, String!, android.content.Intent!);
- method public android.app.Application! instantiateApplication(ClassLoader!, String!);
- method public android.content.ContentProvider! instantiateProvider(ClassLoader!, String!);
- method public android.content.BroadcastReceiver! instantiateReceiver(ClassLoader!, String!, android.content.Intent!);
- method public android.app.Service! instantiateService(ClassLoader!, String!, android.content.Intent!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static interface CoreComponentFactory.CompatWrapped {
- method public Object! getWrapper();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface FrameMetricsAggregator.MetricType {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface NotificationBuilderWithBuilderAccessor {
- method public android.app.Notification.Builder! getBuilder();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface NotificationCompat.BadgeIconType {
- }
-
- public static class NotificationCompat.Builder {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.widget.RemoteViews! getBigContentView();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getColor();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.widget.RemoteViews! getContentView();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.widget.RemoteViews! getHeadsUpContentView();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getPriority();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public long getWhenIfShowing();
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public java.util.ArrayList<androidx.core.app.NotificationCompat.Action>! mActions;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.Context! mContext;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface NotificationCompat.GroupAlertBehavior {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface NotificationCompat.NotificationVisibility {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface NotificationCompat.StreamType {
- }
-
- public abstract static class NotificationCompat.Style {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void addCompatExtras(android.os.Bundle!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void apply(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.widget.RemoteViews! applyStandardTemplate(boolean, int, boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void buildIntoRemoteViews(android.widget.RemoteViews!, android.widget.RemoteViews!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.graphics.Bitmap! createColoredBitmap(int, int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.widget.RemoteViews! makeBigContentView(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.widget.RemoteViews! makeContentView(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.widget.RemoteViews! makeHeadsUpContentView(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void restoreFromCompatExtras(android.os.Bundle!);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected androidx.core.app.NotificationCompat.Builder! mBuilder;
- }
-
- public class Person {
- method @RequiresApi(28) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.core.app.Person fromAndroidPerson(android.app.Person);
- method @RequiresApi(28) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.app.Person toAndroidPerson();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface ServiceCompat.StopForegroundFlags {
- }
-
-}
-
-package androidx.core.content {
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface PermissionChecker.PermissionResult {
- }
-
-}
-
-package androidx.core.content.pm {
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface PermissionInfoCompat.Protection {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PermissionInfoCompat.ProtectionFlags {
- }
-
-}
-
-package androidx.core.content.res {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class ColorStateListInflaterCompat {
- method public static android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme?);
- method public static android.content.res.ColorStateList createFromXmlInner(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class ComplexColorCompat {
- method @ColorInt public int getColor();
- method public android.graphics.Shader? getShader();
- method public static androidx.core.content.res.ComplexColorCompat? inflate(android.content.res.Resources, @ColorRes int, android.content.res.Resources.Theme?);
- method public boolean isGradient();
- method public boolean isStateful();
- method public boolean onStateChanged(int[]!);
- method public void setColor(@ColorInt int);
- method public boolean willDraw();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class FontResourcesParserCompat {
- method public static androidx.core.content.res.FontResourcesParserCompat.FamilyResourceEntry? parse(org.xmlpull.v1.XmlPullParser!, android.content.res.Resources!);
- method public static java.util.List<java.util.List<byte[]>>! readCerts(android.content.res.Resources!, @ArrayRes int);
- field public static final int FETCH_STRATEGY_ASYNC = 1; // 0x1
- field public static final int FETCH_STRATEGY_BLOCKING = 0; // 0x0
- field public static final int INFINITE_TIMEOUT_VALUE = -1; // 0xffffffff
- }
-
- public static interface FontResourcesParserCompat.FamilyResourceEntry {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface FontResourcesParserCompat.FetchStrategy {
- }
-
- public static final class FontResourcesParserCompat.FontFamilyFilesResourceEntry implements androidx.core.content.res.FontResourcesParserCompat.FamilyResourceEntry {
- ctor public FontResourcesParserCompat.FontFamilyFilesResourceEntry(androidx.core.content.res.FontResourcesParserCompat.FontFileResourceEntry[]);
- method public androidx.core.content.res.FontResourcesParserCompat.FontFileResourceEntry[] getEntries();
- }
-
- public static final class FontResourcesParserCompat.FontFileResourceEntry {
- ctor public FontResourcesParserCompat.FontFileResourceEntry(String, int, boolean, String?, int, int);
- method public String getFileName();
- method public int getResourceId();
- method public int getTtcIndex();
- method public String? getVariationSettings();
- method public int getWeight();
- method public boolean isItalic();
- }
-
- public static final class FontResourcesParserCompat.ProviderResourceEntry implements androidx.core.content.res.FontResourcesParserCompat.FamilyResourceEntry {
- ctor public FontResourcesParserCompat.ProviderResourceEntry(androidx.core.provider.FontRequest, int, int);
- method public int getFetchStrategy();
- method public androidx.core.provider.FontRequest getRequest();
- method public int getTimeout();
- }
-
- public final class ResourcesCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static android.graphics.Typeface! getFont(android.content.Context, @FontRes int, android.util.TypedValue!, int, androidx.core.content.res.ResourcesCompat.FontCallback?);
- }
-
- public abstract static class ResourcesCompat.FontCallback {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final void callbackFailAsync(int, android.os.Handler?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final void callbackSuccessAsync(android.graphics.Typeface!, android.os.Handler?);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class TypedArrayUtils {
- method public static int getAttr(android.content.Context, int, int);
- method public static boolean getBoolean(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int, boolean);
- method public static android.graphics.drawable.Drawable? getDrawable(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int);
- method public static int getInt(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int, int);
- method public static boolean getNamedBoolean(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, boolean);
- method @ColorInt public static int getNamedColor(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, @ColorInt int);
- method public static androidx.core.content.res.ComplexColorCompat! getNamedComplexColor(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme?, String, @StyleableRes int, @ColorInt int);
- method public static float getNamedFloat(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, float);
- method public static int getNamedInt(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, int);
- method @AnyRes public static int getNamedResourceId(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, @AnyRes int);
- method public static String? getNamedString(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int);
- method @AnyRes public static int getResourceId(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int, @AnyRes int);
- method public static String? getString(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int);
- method public static CharSequence? getText(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int);
- method public static CharSequence[]? getTextArray(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int);
- method public static boolean hasAttribute(org.xmlpull.v1.XmlPullParser, String);
- method public static android.content.res.TypedArray obtainAttributes(android.content.res.Resources, android.content.res.Resources.Theme?, android.util.AttributeSet, int[]);
- method public static android.util.TypedValue? peekNamedValue(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, int);
- }
-
-}
-
-package androidx.core.graphics {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class PathParser {
- method public static boolean canMorph(androidx.core.graphics.PathParser.PathDataNode[]!, androidx.core.graphics.PathParser.PathDataNode[]!);
- method public static androidx.core.graphics.PathParser.PathDataNode[]! createNodesFromPathData(String!);
- method public static android.graphics.Path! createPathFromPathData(String!);
- method public static androidx.core.graphics.PathParser.PathDataNode[]! deepCopyNodes(androidx.core.graphics.PathParser.PathDataNode[]!);
- method public static void updateNodes(androidx.core.graphics.PathParser.PathDataNode[]!, androidx.core.graphics.PathParser.PathDataNode[]!);
- }
-
- public static class PathParser.PathDataNode {
- method public void interpolatePathDataNode(androidx.core.graphics.PathParser.PathDataNode!, androidx.core.graphics.PathParser.PathDataNode!, float);
- method public static void nodesToPath(androidx.core.graphics.PathParser.PathDataNode[]!, android.graphics.Path!);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public float[]! mParams;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public char mType;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class TypefaceCompat {
- method public static android.graphics.Typeface? createFromFontInfo(android.content.Context, android.os.CancellationSignal?, androidx.core.provider.FontsContractCompat.FontInfo[], int);
- method public static android.graphics.Typeface? createFromResourcesFamilyXml(android.content.Context, androidx.core.content.res.FontResourcesParserCompat.FamilyResourceEntry, android.content.res.Resources, int, int, androidx.core.content.res.ResourcesCompat.FontCallback?, android.os.Handler?, boolean);
- method public static android.graphics.Typeface? createFromResourcesFontFile(android.content.Context, android.content.res.Resources, int, String!, int);
- method public static android.graphics.Typeface? findFromCache(android.content.res.Resources, int, int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(26) public class TypefaceCompatApi26Impl {
- ctor public TypefaceCompatApi26Impl();
- method protected android.graphics.Typeface! createFromFamiliesWithDefault(Object!);
- method public android.graphics.Typeface! createFromFontFamilyFilesResourceEntry(android.content.Context!, androidx.core.content.res.FontResourcesParserCompat.FontFamilyFilesResourceEntry!, android.content.res.Resources!, int);
- method public android.graphics.Typeface! createFromFontInfo(android.content.Context!, android.os.CancellationSignal?, androidx.core.provider.FontsContractCompat.FontInfo[], int);
- method public android.graphics.Typeface? createFromResourcesFontFile(android.content.Context!, android.content.res.Resources!, int, String!, int);
- method protected java.lang.reflect.Method! obtainAbortCreationMethod(Class!);
- method protected java.lang.reflect.Method! obtainAddFontFromAssetManagerMethod(Class!);
- method protected java.lang.reflect.Method! obtainAddFontFromBufferMethod(Class!);
- method protected java.lang.reflect.Method! obtainCreateFromFamiliesWithDefaultMethod(Class!);
- method protected Class! obtainFontFamily();
- method protected java.lang.reflect.Constructor! obtainFontFamilyCtor(Class!);
- method protected java.lang.reflect.Method! obtainFreezeMethod(Class!);
- field protected final java.lang.reflect.Method! mAbortCreation;
- field protected final java.lang.reflect.Method! mAddFontFromAssetManager;
- field protected final java.lang.reflect.Method! mAddFontFromBuffer;
- field protected final java.lang.reflect.Method! mCreateFromFamiliesWithDefault;
- field protected final Class! mFontFamily;
- field protected final java.lang.reflect.Constructor! mFontFamilyCtor;
- field protected final java.lang.reflect.Method! mFreeze;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(28) public class TypefaceCompatApi28Impl extends androidx.core.graphics.TypefaceCompatApi26Impl {
- ctor public TypefaceCompatApi28Impl();
- method public android.graphics.Typeface? createFromFontFamilyFilesResourceEntry(android.content.Context!, androidx.core.content.res.FontResourcesParserCompat.FontFamilyFilesResourceEntry!, android.content.res.Resources!, int);
- method public android.graphics.Typeface! createFromFontInfo(android.content.Context!, android.os.CancellationSignal!, androidx.core.provider.FontsContractCompat.FontInfo[], int);
- method public android.graphics.Typeface? createFromResourcesFontFile(android.content.Context!, android.content.res.Resources!, int, String!, int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class TypefaceCompatUtil {
- method public static void closeQuietly(java.io.Closeable!);
- method @RequiresApi(19) public static java.nio.ByteBuffer? copyToDirectBuffer(android.content.Context!, android.content.res.Resources!, int);
- method public static boolean copyToFile(java.io.File!, java.io.InputStream!);
- method public static boolean copyToFile(java.io.File!, android.content.res.Resources!, int);
- method public static java.io.File? getTempFile(android.content.Context!);
- method @RequiresApi(19) public static java.nio.ByteBuffer? mmap(android.content.Context!, android.os.CancellationSignal!, android.net.Uri!);
- }
-
-}
-
-package androidx.core.graphics.drawable {
-
- public class IconCompat {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public IconCompat();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void addToShortcutIntent(android.content.Intent, android.graphics.drawable.Drawable?, android.content.Context);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void checkResource(android.content.Context!);
- method @RequiresApi(23) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.core.graphics.drawable.IconCompat? createFromIcon(android.graphics.drawable.Icon);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static androidx.core.graphics.drawable.IconCompat! createWithResource(android.content.res.Resources!, String!, @DrawableRes int);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public byte[]! mData;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int mInt1;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int mInt2;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.os.Parcelable! mParcelable;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.content.res.ColorStateList! mTintList;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public String! mTintModeStr;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int mType;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface IconCompat.IconType {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class IconCompatParcelizer {
- ctor public IconCompatParcelizer();
- method public static androidx.core.graphics.drawable.IconCompat! read(androidx.versionedparcelable.VersionedParcel!);
- method public static void write(androidx.core.graphics.drawable.IconCompat!, androidx.versionedparcelable.VersionedParcel!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface TintAwareDrawable {
- method public void setTint(@ColorInt int);
- method public void setTintList(android.content.res.ColorStateList!);
- method public void setTintMode(android.graphics.PorterDuff.Mode!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface WrappedDrawable {
- method public android.graphics.drawable.Drawable! getWrappedDrawable();
- method public void setWrappedDrawable(android.graphics.drawable.Drawable!);
- }
-
-}
-
-package androidx.core.internal.view {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface SupportMenu {
- method public void setGroupDividerEnabled(boolean);
- field public static final int CATEGORY_MASK = -65536; // 0xffff0000
- field public static final int CATEGORY_SHIFT = 16; // 0x10
- field public static final int FLAG_KEEP_OPEN_ON_SUBMENU_OPENED = 4; // 0x4
- field public static final int SUPPORTED_MODIFIERS_MASK = 69647; // 0x1100f
- field public static final int USER_MASK = 65535; // 0xffff
- field public static final int USER_SHIFT = 0; // 0x0
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface SupportMenuItem {
- method public boolean collapseActionView();
- method public boolean expandActionView();
- method public android.view.View! getActionView();
- method public int getAlphabeticModifiers();
- method public CharSequence! getContentDescription();
- method public android.content.res.ColorStateList! getIconTintList();
- method public android.graphics.PorterDuff.Mode! getIconTintMode();
- method public int getNumericModifiers();
- method public androidx.core.view.ActionProvider! getSupportActionProvider();
- method public CharSequence! getTooltipText();
- method public boolean isActionViewExpanded();
- method public android.view.MenuItem! setActionView(android.view.View!);
- method public android.view.MenuItem! setActionView(int);
- method public android.view.MenuItem! setAlphabeticShortcut(char, int);
- method public androidx.core.internal.view.SupportMenuItem! setContentDescription(CharSequence!);
- method public android.view.MenuItem! setIconTintList(android.content.res.ColorStateList!);
- method public android.view.MenuItem! setIconTintMode(android.graphics.PorterDuff.Mode!);
- method public android.view.MenuItem! setNumericShortcut(char, int);
- method public android.view.MenuItem! setShortcut(char, char, int, int);
- method public void setShowAsAction(int);
- method public android.view.MenuItem! setShowAsActionFlags(int);
- method public androidx.core.internal.view.SupportMenuItem! setSupportActionProvider(androidx.core.view.ActionProvider!);
- method public androidx.core.internal.view.SupportMenuItem! setTooltipText(CharSequence!);
- field public static final int SHOW_AS_ACTION_ALWAYS = 2; // 0x2
- field public static final int SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW = 8; // 0x8
- field public static final int SHOW_AS_ACTION_IF_ROOM = 1; // 0x1
- field public static final int SHOW_AS_ACTION_NEVER = 0; // 0x0
- field public static final int SHOW_AS_ACTION_WITH_TEXT = 4; // 0x4
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface SupportSubMenu extends androidx.core.internal.view.SupportMenu {
- }
-
-}
-
-package androidx.core.net {
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface ConnectivityManagerCompat.RestrictBackgroundStatus {
- }
-
-}
-
-package androidx.core.provider {
-
- public final class FontRequest {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public String! getIdentifier();
- }
-
- public class FontsContractCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static android.graphics.Typeface! getFontSync(android.content.Context!, androidx.core.provider.FontRequest!, androidx.core.content.res.ResourcesCompat.FontCallback?, android.os.Handler?, boolean, int, int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @VisibleForTesting public static android.content.pm.ProviderInfo? getProvider(android.content.pm.PackageManager, androidx.core.provider.FontRequest, android.content.res.Resources?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public static java.util.Map<android.net.Uri,java.nio.ByteBuffer>! prepareFontData(android.content.Context!, androidx.core.provider.FontsContractCompat.FontInfo[]!, android.os.CancellationSignal!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static void resetCache();
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String PARCEL_FONT_RESULTS = "font_results";
- }
-
- public static class FontsContractCompat.FontFamilyResult {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public FontsContractCompat.FontFamilyResult(int, androidx.core.provider.FontsContractCompat.FontInfo[]?);
- }
-
- public static class FontsContractCompat.FontInfo {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public FontsContractCompat.FontInfo(android.net.Uri, @IntRange(from=0L) int, @IntRange(from=1L, to=1000L) int, boolean, int);
- }
-
- public static class FontsContractCompat.FontRequestCallback {
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final int RESULT_OK = 0; // 0x0
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface FontsContractCompat.FontRequestCallback.FontRequestFailReason {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class SelfDestructiveThread {
- ctor public SelfDestructiveThread(String!, int, int);
- method @VisibleForTesting public int getGeneration();
- method @VisibleForTesting public boolean isRunning();
- method public <T> void postAndReply(java.util.concurrent.Callable<T>!, androidx.core.provider.SelfDestructiveThread.ReplyCallback<T>!);
- method public <T> T! postAndWait(java.util.concurrent.Callable<T>!, int);
- }
-
- public static interface SelfDestructiveThread.ReplyCallback<T> {
- method public void onReply(T!);
- }
-
-}
-
-package androidx.core.text {
-
- public class PrecomputedTextCompat {
- method @RequiresApi(28) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.text.PrecomputedText? getPrecomputedText();
- }
-
-}
-
-package androidx.core.text.util {
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface LinkifyCompat.LinkifyMask {
- }
-
-}
-
-package androidx.core.util {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class DebugUtils {
- method public static void buildShortClassTag(Object!, StringBuilder!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class LogWriter {
- ctor public LogWriter(String!);
- method public void close();
- method public void flush();
- method public void write(char[]!, int, int);
- }
-
- public final class PatternsCompat {
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final java.util.regex.Pattern! AUTOLINK_EMAIL_ADDRESS;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final java.util.regex.Pattern! AUTOLINK_WEB_URL;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class Preconditions {
- method public static void checkArgument(boolean);
- method public static void checkArgument(boolean, Object!);
- method public static float checkArgumentFinite(float, String!);
- method public static float checkArgumentInRange(float, float, float, String!);
- method public static int checkArgumentInRange(int, int, int, String!);
- method public static long checkArgumentInRange(long, long, long, String!);
- method @IntRange(from=0L) public static int checkArgumentNonnegative(int, String!);
- method @IntRange(from=0L) public static int checkArgumentNonnegative(int);
- method public static long checkArgumentNonnegative(long);
- method public static long checkArgumentNonnegative(long, String!);
- method public static int checkArgumentPositive(int, String!);
- method public static float[]! checkArrayElementsInRange(float[]!, float, float, String!);
- method public static <T> T[]! checkArrayElementsNotNull(T[]!, String!);
- method public static <C extends , T> C checkCollectionElementsNotNull(C!, String!);
- method public static <T> java.util.Collection<T>! checkCollectionNotEmpty(java.util.Collection<T>!, String!);
- method public static int checkFlagsArgument(int, int);
- method public static <T> T checkNotNull(T!);
- method public static <T> T checkNotNull(T!, Object!);
- method public static void checkState(boolean, String!);
- method public static void checkState(boolean);
- method public static <T extends > T checkStringNotEmpty(T!);
- method public static <T extends > T checkStringNotEmpty(T!, Object!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class TimeUtils {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static void formatDuration(long, StringBuilder!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static void formatDuration(long, java.io.PrintWriter!, int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static void formatDuration(long, java.io.PrintWriter!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static void formatDuration(long, long, java.io.PrintWriter!);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final int HUNDRED_DAY_FIELD_LEN = 19; // 0x13
- }
-
-}
-
-package androidx.core.view {
-
- public abstract class ActionProvider {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void reset();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSubUiVisibilityListener(androidx.core.view.ActionProvider.SubUiVisibilityListener!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void subUiVisibilityChanged(boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static interface ActionProvider.SubUiVisibilityListener {
- method public void onSubUiVisibilityChanged(boolean);
- }
-
- public final class DragAndDropPermissionsCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.core.view.DragAndDropPermissionsCompat? request(android.app.Activity!, android.view.DragEvent!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class KeyEventDispatcher {
- method public static boolean dispatchBeforeHierarchy(android.view.View, android.view.KeyEvent);
- method public static boolean dispatchKeyEvent(androidx.core.view.KeyEventDispatcher.Component, android.view.View?, android.view.Window.Callback?, android.view.KeyEvent);
- }
-
- public static interface KeyEventDispatcher.Component {
- method public boolean superDispatchKeyEvent(android.view.KeyEvent!);
- }
-
- public final class PointerIconCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public Object! getPointerIcon();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface ViewCompat.FocusDirection {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface ViewCompat.FocusRealDirection {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface ViewCompat.FocusRelativeDirection {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface ViewCompat.NestedScrollType {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface ViewCompat.ScrollAxis {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface ViewCompat.ScrollIndicators {
- }
-
-}
-
-package androidx.core.view.accessibility {
-
- public class AccessibilityNodeInfoCompat {
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int mParentVirtualDescendantId;
- }
-
-}
-
-package androidx.core.widget {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface AutoSizeableTextView {
- method public int getAutoSizeMaxTextSize();
- method public int getAutoSizeMinTextSize();
- method public int getAutoSizeStepGranularity();
- method public int[]! getAutoSizeTextAvailableSizes();
- method public int getAutoSizeTextType();
- method public void setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int);
- method public void setAutoSizeTextTypeUniformWithPresetSizes(int[], int);
- method public void setAutoSizeTextTypeWithDefaults(int);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final boolean PLATFORM_SUPPORTS_AUTOSIZE;
- }
-
- public class NestedScrollView implements androidx.core.view.NestedScrollingChild2 androidx.core.view.NestedScrollingParent2 androidx.core.view.ScrollingView {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int computeHorizontalScrollExtent();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int computeHorizontalScrollOffset();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int computeHorizontalScrollRange();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int computeVerticalScrollExtent();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int computeVerticalScrollOffset();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int computeVerticalScrollRange();
- }
-
- public final class TextViewCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static android.view.ActionMode.Callback wrapCustomSelectionActionModeCallback(android.widget.TextView, android.view.ActionMode.Callback);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface TextViewCompat.AutoSizeTextType {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface TintableImageSourceView {
- method public android.content.res.ColorStateList? getSupportImageTintList();
- method public android.graphics.PorterDuff.Mode? getSupportImageTintMode();
- method public void setSupportImageTintList(android.content.res.ColorStateList?);
- method public void setSupportImageTintMode(android.graphics.PorterDuff.Mode?);
- }
-
-}
-
diff --git a/core/api/restricted_1.1.0-alpha05.ignore b/core/api/restricted_1.1.0-alpha05.ignore
deleted file mode 100644
index bae79eb..0000000
--- a/core/api/restricted_1.1.0-alpha05.ignore
+++ /dev/null
@@ -1,105 +0,0 @@
-// Baseline format: 1.0
-AddedAbstractMethod: androidx.core.internal.view.SupportMenuItem#requiresActionButton():
- Added method androidx.core.internal.view.SupportMenuItem.requiresActionButton()
-AddedAbstractMethod: androidx.core.internal.view.SupportMenuItem#requiresOverflow():
- Added method androidx.core.internal.view.SupportMenuItem.requiresOverflow()
-
-
-DeprecationMismatch: androidx.core.app.NotificationCompat.Action.WearableExtender#getCancelLabel():
- Method androidx.core.app.NotificationCompat.Action.WearableExtender.getCancelLabel(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.Action.WearableExtender#getConfirmLabel():
- Method androidx.core.app.NotificationCompat.Action.WearableExtender.getConfirmLabel(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.Action.WearableExtender#getInProgressLabel():
- Method androidx.core.app.NotificationCompat.Action.WearableExtender.getInProgressLabel(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.Action.WearableExtender#setCancelLabel(CharSequence):
- Method androidx.core.app.NotificationCompat.Action.WearableExtender.setCancelLabel(CharSequence): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.Action.WearableExtender#setConfirmLabel(CharSequence):
- Method androidx.core.app.NotificationCompat.Action.WearableExtender.setConfirmLabel(CharSequence): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.Action.WearableExtender#setInProgressLabel(CharSequence):
- Method androidx.core.app.NotificationCompat.Action.WearableExtender.setInProgressLabel(CharSequence): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getContentIcon():
- Method androidx.core.app.NotificationCompat.WearableExtender.getContentIcon(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getContentIconGravity():
- Method androidx.core.app.NotificationCompat.WearableExtender.getContentIconGravity(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getCustomContentHeight():
- Method androidx.core.app.NotificationCompat.WearableExtender.getCustomContentHeight(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getCustomSizePreset():
- Method androidx.core.app.NotificationCompat.WearableExtender.getCustomSizePreset(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getGravity():
- Method androidx.core.app.NotificationCompat.WearableExtender.getGravity(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getHintAvoidBackgroundClipping():
- Method androidx.core.app.NotificationCompat.WearableExtender.getHintAvoidBackgroundClipping(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getHintHideIcon():
- Method androidx.core.app.NotificationCompat.WearableExtender.getHintHideIcon(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getHintScreenTimeout():
- Method androidx.core.app.NotificationCompat.WearableExtender.getHintScreenTimeout(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#getHintShowBackgroundOnly():
- Method androidx.core.app.NotificationCompat.WearableExtender.getHintShowBackgroundOnly(): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setContentIcon(int):
- Method androidx.core.app.NotificationCompat.WearableExtender.setContentIcon(int): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setContentIconGravity(int):
- Method androidx.core.app.NotificationCompat.WearableExtender.setContentIconGravity(int): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setCustomContentHeight(int):
- Method androidx.core.app.NotificationCompat.WearableExtender.setCustomContentHeight(int): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setCustomSizePreset(int):
- Method androidx.core.app.NotificationCompat.WearableExtender.setCustomSizePreset(int): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setGravity(int):
- Method androidx.core.app.NotificationCompat.WearableExtender.setGravity(int): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setHintAvoidBackgroundClipping(boolean):
- Method androidx.core.app.NotificationCompat.WearableExtender.setHintAvoidBackgroundClipping(boolean): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setHintHideIcon(boolean):
- Method androidx.core.app.NotificationCompat.WearableExtender.setHintHideIcon(boolean): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setHintScreenTimeout(int):
- Method androidx.core.app.NotificationCompat.WearableExtender.setHintScreenTimeout(int): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.core.app.NotificationCompat.WearableExtender#setHintShowBackgroundOnly(boolean):
- Method androidx.core.app.NotificationCompat.WearableExtender.setHintShowBackgroundOnly(boolean): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-
-
-InvalidNullConversion: androidx.core.graphics.TypefaceCompatApi28Impl#createFromFontFamilyFilesResourceEntry(android.content.Context, androidx.core.content.res.FontResourcesParserCompat.FontFamilyFilesResourceEntry, android.content.res.Resources, int):
- Attempted to remove @Nullable annotation from method androidx.core.graphics.TypefaceCompatApi28Impl.createFromFontFamilyFilesResourceEntry(android.content.Context,androidx.core.content.res.FontResourcesParserCompat.FontFamilyFilesResourceEntry,android.content.res.Resources,int)
-
-
-RemovedClass: androidx.core.graphics.PathParser:
- Removed class androidx.core.graphics.PathParser
-RemovedClass: androidx.core.graphics.drawable.IconCompatParcelizer:
- Removed class androidx.core.graphics.drawable.IconCompatParcelizer
-
-
-RemovedInterface: androidx.core.widget.NestedScrollView:
- Class androidx.core.widget.NestedScrollView no longer implements androidx.core.view.NestedScrollingChild2
-
-
-RemovedMethod: androidx.core.app.ComponentActivity#getLifecycle():
- Removed method androidx.core.app.ComponentActivity.getLifecycle()
-RemovedMethod: androidx.core.util.Preconditions#checkArgumentFinite(float, String):
- Removed method androidx.core.util.Preconditions.checkArgumentFinite(float,String)
-RemovedMethod: androidx.core.util.Preconditions#checkArgumentInRange(float, float, float, String):
- Removed method androidx.core.util.Preconditions.checkArgumentInRange(float,float,float,String)
-RemovedMethod: androidx.core.util.Preconditions#checkArgumentInRange(long, long, long, String):
- Removed method androidx.core.util.Preconditions.checkArgumentInRange(long,long,long,String)
-RemovedMethod: androidx.core.util.Preconditions#checkArgumentNonnegative(long):
- Removed method androidx.core.util.Preconditions.checkArgumentNonnegative(long)
-RemovedMethod: androidx.core.util.Preconditions#checkArgumentNonnegative(long, String):
- Removed method androidx.core.util.Preconditions.checkArgumentNonnegative(long,String)
-RemovedMethod: androidx.core.util.Preconditions#checkArgumentPositive(int, String):
- Removed method androidx.core.util.Preconditions.checkArgumentPositive(int,String)
-RemovedMethod: androidx.core.util.Preconditions#checkArrayElementsInRange(float[], float, float, String):
- Removed method androidx.core.util.Preconditions.checkArrayElementsInRange(float[],float,float,String)
-RemovedMethod: androidx.core.util.Preconditions#checkArrayElementsNotNull(T[], String):
- Removed method androidx.core.util.Preconditions.checkArrayElementsNotNull(T[],String)
-RemovedMethod: androidx.core.util.Preconditions#checkCollectionElementsNotNull(C, String):
- Removed method androidx.core.util.Preconditions.checkCollectionElementsNotNull(C,String)
-RemovedMethod: androidx.core.util.Preconditions#checkCollectionNotEmpty(java.util.Collection<T>, String):
- Removed method androidx.core.util.Preconditions.checkCollectionNotEmpty(java.util.Collection<T>,String)
-RemovedMethod: androidx.core.util.Preconditions#checkFlagsArgument(int, int):
- Removed method androidx.core.util.Preconditions.checkFlagsArgument(int,int)
-RemovedMethod: androidx.core.util.Preconditions#checkStringNotEmpty(T):
- Removed method androidx.core.util.Preconditions.checkStringNotEmpty(T)
-RemovedMethod: androidx.core.util.Preconditions#checkStringNotEmpty(T, Object):
- Removed method androidx.core.util.Preconditions.checkStringNotEmpty(T,Object)
-
-
-RemovedPackage: android.support.v4.graphics.drawable:
- Removed package android.support.v4.graphics.drawable
-
-
diff --git a/core/api/restricted_1.1.0-alpha05.txt b/core/api/restricted_1.1.0-alpha05.txt
deleted file mode 100644
index 5baf105..0000000
--- a/core/api/restricted_1.1.0-alpha05.txt
+++ /dev/null
@@ -1,562 +0,0 @@
-// Signature format: 3.0
-package android.support.v4.os {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ResultReceiver implements android.os.Parcelable {
- ctor public ResultReceiver(android.os.Handler!);
- method public int describeContents();
- method protected void onReceiveResult(int, android.os.Bundle!);
- method public void send(int, android.os.Bundle!);
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<android.support.v4.os.ResultReceiver>! CREATOR;
- }
-
-}
-
-package androidx.core.app {
-
- public class ActivityCompat extends androidx.core.content.ContextCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.core.app.ActivityCompat.PermissionCompatDelegate! getPermissionCompatDelegate();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface ActivityCompat.RequestPermissionsRequestCodeValidator {
- method public void validateRequestPermissionsRequestCode(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ComponentActivity extends android.app.Activity implements androidx.core.view.KeyEventDispatcher.Component {
- ctor public ComponentActivity();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public <T extends androidx.core.app.ComponentActivity.ExtraData> T! getExtraData(Class<T>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void putExtraData(androidx.core.app.ComponentActivity.ExtraData!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean superDispatchKeyEvent(android.view.KeyEvent!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class ComponentActivity.ExtraData {
- ctor public ComponentActivity.ExtraData();
- }
-
- @RequiresApi(api=28) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class CoreComponentFactory extends android.app.AppComponentFactory {
- ctor public CoreComponentFactory();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface CoreComponentFactory.CompatWrapped {
- method public Object! getWrapper();
- }
-
- @IntDef(flag=true, value={androidx.core.app.FrameMetricsAggregator.TOTAL_DURATION, androidx.core.app.FrameMetricsAggregator.INPUT_DURATION, androidx.core.app.FrameMetricsAggregator.LAYOUT_MEASURE_DURATION, androidx.core.app.FrameMetricsAggregator.DRAW_DURATION, androidx.core.app.FrameMetricsAggregator.SYNC_DURATION, androidx.core.app.FrameMetricsAggregator.COMMAND_DURATION, androidx.core.app.FrameMetricsAggregator.SWAP_DURATION, androidx.core.app.FrameMetricsAggregator.DELAY_DURATION, androidx.core.app.FrameMetricsAggregator.ANIMATION_DURATION, androidx.core.app.FrameMetricsAggregator.EVERY_DURATION}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface FrameMetricsAggregator.MetricType {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface NotificationBuilderWithBuilderAccessor {
- method public android.app.Notification.Builder! getBuilder();
- }
-
- @IntDef({androidx.core.app.NotificationCompat.BADGE_ICON_NONE, androidx.core.app.NotificationCompat.BADGE_ICON_SMALL, androidx.core.app.NotificationCompat.BADGE_ICON_LARGE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface NotificationCompat.BadgeIconType {
- }
-
- public static class NotificationCompat.Builder {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! getBigContentView();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getColor();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! getContentView();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! getHeadsUpContentView();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getPriority();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public long getWhenIfShowing();
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public java.util.ArrayList<androidx.core.app.NotificationCompat.Action>! mActions;
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.Context! mContext;
- }
-
- @IntDef({androidx.core.app.NotificationCompat.GROUP_ALERT_ALL, androidx.core.app.NotificationCompat.GROUP_ALERT_SUMMARY, androidx.core.app.NotificationCompat.GROUP_ALERT_CHILDREN}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface NotificationCompat.GroupAlertBehavior {
- }
-
- @IntDef({androidx.core.app.NotificationCompat.VISIBILITY_PUBLIC, androidx.core.app.NotificationCompat.VISIBILITY_PRIVATE, androidx.core.app.NotificationCompat.VISIBILITY_SECRET}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface NotificationCompat.NotificationVisibility {
- }
-
- @IntDef({android.media.AudioManager.STREAM_VOICE_CALL, android.media.AudioManager.STREAM_SYSTEM, android.media.AudioManager.STREAM_RING, android.media.AudioManager.STREAM_MUSIC, android.media.AudioManager.STREAM_ALARM, android.media.AudioManager.STREAM_NOTIFICATION, android.media.AudioManager.STREAM_DTMF, android.media.AudioManager.STREAM_ACCESSIBILITY}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface NotificationCompat.StreamType {
- }
-
- public abstract static class NotificationCompat.Style {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void addCompatExtras(android.os.Bundle!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void apply(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! applyStandardTemplate(boolean, int, boolean);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void buildIntoRemoteViews(android.widget.RemoteViews!, android.widget.RemoteViews!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.Bitmap! createColoredBitmap(int, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! makeBigContentView(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! makeContentView(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! makeHeadsUpContentView(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void restoreFromCompatExtras(android.os.Bundle!);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected androidx.core.app.NotificationCompat.Builder! mBuilder;
- }
-
- public class Person {
- method @RequiresApi(28) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.core.app.Person fromAndroidPerson(android.app.Person);
- method @RequiresApi(22) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.core.app.Person fromPersistableBundle(android.os.PersistableBundle);
- method @RequiresApi(28) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.app.Person toAndroidPerson();
- method @RequiresApi(22) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.os.PersistableBundle toPersistableBundle();
- }
-
- @IntDef({androidx.core.app.RemoteInput.SOURCE_FREE_FORM_INPUT, androidx.core.app.RemoteInput.SOURCE_CHOICE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface RemoteInput.Source {
- }
-
- @IntDef(flag=true, value={androidx.core.app.ServiceCompat.STOP_FOREGROUND_REMOVE, androidx.core.app.ServiceCompat.STOP_FOREGROUND_DETACH}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ServiceCompat.StopForegroundFlags {
- }
-
-}
-
-package androidx.core.content {
-
- @IntDef({androidx.core.content.PermissionChecker.PERMISSION_GRANTED, androidx.core.content.PermissionChecker.PERMISSION_DENIED, androidx.core.content.PermissionChecker.PERMISSION_DENIED_APP_OP}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PermissionChecker.PermissionResult {
- }
-
-}
-
-package androidx.core.content.pm {
-
-
-
- public class ShortcutInfoCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.core.graphics.drawable.IconCompat! getIcon();
- }
-
- public static class ShortcutInfoCompat.Builder {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public ShortcutInfoCompat.Builder(androidx.core.content.pm.ShortcutInfoCompat);
- ctor @RequiresApi(25) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public ShortcutInfoCompat.Builder(android.content.Context, android.content.pm.ShortcutInfo);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ShortcutInfoCompatSaver {
- ctor public ShortcutInfoCompatSaver();
- method @AnyThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void>! addShortcuts(java.util.List<androidx.core.content.pm.ShortcutInfoCompat>!);
- method @WorkerThread public java.util.List<androidx.core.content.pm.ShortcutInfoCompat>! getShortcuts() throws java.lang.Exception;
- method @AnyThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void>! removeAllShortcuts();
- method @AnyThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void>! removeShortcuts(java.util.List<java.lang.String>!);
- }
-
-}
-
-package androidx.core.content.res {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class ColorStateListInflaterCompat {
- method public static android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public static android.content.res.ColorStateList createFromXmlInner(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public static android.content.res.ColorStateList? inflate(android.content.res.Resources, @XmlRes int, android.content.res.Resources.Theme?);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class ComplexColorCompat {
- method @ColorInt public int getColor();
- method public android.graphics.Shader? getShader();
- method public static androidx.core.content.res.ComplexColorCompat? inflate(android.content.res.Resources, @ColorRes int, android.content.res.Resources.Theme?);
- method public boolean isGradient();
- method public boolean isStateful();
- method public boolean onStateChanged(int[]!);
- method public void setColor(@ColorInt int);
- method public boolean willDraw();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class FontResourcesParserCompat {
- method public static androidx.core.content.res.FontResourcesParserCompat.FamilyResourceEntry? parse(org.xmlpull.v1.XmlPullParser!, android.content.res.Resources!) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public static java.util.List<java.util.List<byte[]>>! readCerts(android.content.res.Resources!, @ArrayRes int);
- field public static final int FETCH_STRATEGY_ASYNC = 1; // 0x1
- field public static final int FETCH_STRATEGY_BLOCKING = 0; // 0x0
- field public static final int INFINITE_TIMEOUT_VALUE = -1; // 0xffffffff
- }
-
- public static interface FontResourcesParserCompat.FamilyResourceEntry {
- }
-
- @IntDef({androidx.core.content.res.FontResourcesParserCompat.FETCH_STRATEGY_BLOCKING, androidx.core.content.res.FontResourcesParserCompat.FETCH_STRATEGY_ASYNC}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface FontResourcesParserCompat.FetchStrategy {
- }
-
- public static final class FontResourcesParserCompat.FontFamilyFilesResourceEntry implements androidx.core.content.res.FontResourcesParserCompat.FamilyResourceEntry {
- ctor public FontResourcesParserCompat.FontFamilyFilesResourceEntry(androidx.core.content.res.FontResourcesParserCompat.FontFileResourceEntry[]);
- method public androidx.core.content.res.FontResourcesParserCompat.FontFileResourceEntry[] getEntries();
- }
-
- public static final class FontResourcesParserCompat.FontFileResourceEntry {
- ctor public FontResourcesParserCompat.FontFileResourceEntry(String, int, boolean, String?, int, int);
- method public String getFileName();
- method public int getResourceId();
- method public int getTtcIndex();
- method public String? getVariationSettings();
- method public int getWeight();
- method public boolean isItalic();
- }
-
- public static final class FontResourcesParserCompat.ProviderResourceEntry implements androidx.core.content.res.FontResourcesParserCompat.FamilyResourceEntry {
- ctor public FontResourcesParserCompat.ProviderResourceEntry(androidx.core.provider.FontRequest, @androidx.core.content.res.FontResourcesParserCompat.FetchStrategy int, int);
- method @androidx.core.content.res.FontResourcesParserCompat.FetchStrategy public int getFetchStrategy();
- method public androidx.core.provider.FontRequest getRequest();
- method public int getTimeout();
- }
-
- public final class ResourcesCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.graphics.Typeface! getFont(android.content.Context, @FontRes int, android.util.TypedValue!, int, androidx.core.content.res.ResourcesCompat.FontCallback?) throws android.content.res.Resources.NotFoundException;
- }
-
- public abstract static class ResourcesCompat.FontCallback {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final void callbackFailAsync(@androidx.core.provider.FontsContractCompat.FontRequestCallback.FontRequestFailReason int, android.os.Handler?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final void callbackSuccessAsync(android.graphics.Typeface!, android.os.Handler?);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TypedArrayUtils {
- method public static int getAttr(android.content.Context, int, int);
- method public static boolean getBoolean(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int, boolean);
- method public static android.graphics.drawable.Drawable? getDrawable(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int);
- method public static int getInt(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int, int);
- method public static boolean getNamedBoolean(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, boolean);
- method @ColorInt public static int getNamedColor(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, @ColorInt int);
- method public static android.content.res.ColorStateList? getNamedColorStateList(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme?, String, @StyleableRes int);
- method public static androidx.core.content.res.ComplexColorCompat! getNamedComplexColor(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme?, String, @StyleableRes int, @ColorInt int);
- method public static float getNamedFloat(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, float);
- method public static int getNamedInt(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, int);
- method @AnyRes public static int getNamedResourceId(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, @AnyRes int);
- method public static String? getNamedString(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int);
- method @AnyRes public static int getResourceId(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int, @AnyRes int);
- method public static String? getString(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int);
- method public static CharSequence? getText(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int);
- method public static CharSequence[]? getTextArray(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int);
- method public static boolean hasAttribute(org.xmlpull.v1.XmlPullParser, String);
- method public static android.content.res.TypedArray obtainAttributes(android.content.res.Resources, android.content.res.Resources.Theme?, android.util.AttributeSet, int[]);
- method public static android.util.TypedValue? peekNamedValue(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, int);
- }
-
-}
-
-package androidx.core.graphics {
-
- public class TypefaceCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.graphics.Typeface? createFromFontInfo(android.content.Context, android.os.CancellationSignal?, androidx.core.provider.FontsContractCompat.FontInfo[], int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.graphics.Typeface? createFromResourcesFamilyXml(android.content.Context, androidx.core.content.res.FontResourcesParserCompat.FamilyResourceEntry, android.content.res.Resources, int, int, androidx.core.content.res.ResourcesCompat.FontCallback?, android.os.Handler?, boolean);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.graphics.Typeface? createFromResourcesFontFile(android.content.Context, android.content.res.Resources, int, String!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.graphics.Typeface? findFromCache(android.content.res.Resources, int, int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(26) public class TypefaceCompatApi26Impl {
- ctor public TypefaceCompatApi26Impl();
- method protected android.graphics.Typeface? createFromFamiliesWithDefault(Object!);
- method public android.graphics.Typeface? createFromFontFamilyFilesResourceEntry(android.content.Context!, androidx.core.content.res.FontResourcesParserCompat.FontFamilyFilesResourceEntry!, android.content.res.Resources!, int);
- method public android.graphics.Typeface? createFromFontInfo(android.content.Context!, android.os.CancellationSignal?, androidx.core.provider.FontsContractCompat.FontInfo[], int);
- method public android.graphics.Typeface? createFromResourcesFontFile(android.content.Context!, android.content.res.Resources!, int, String!, int);
- method protected java.lang.reflect.Method! obtainAbortCreationMethod(Class!) throws java.lang.NoSuchMethodException;
- method protected java.lang.reflect.Method! obtainAddFontFromAssetManagerMethod(Class!) throws java.lang.NoSuchMethodException;
- method protected java.lang.reflect.Method! obtainAddFontFromBufferMethod(Class!) throws java.lang.NoSuchMethodException;
- method protected java.lang.reflect.Method! obtainCreateFromFamiliesWithDefaultMethod(Class!) throws java.lang.NoSuchMethodException;
- method protected Class! obtainFontFamily() throws java.lang.ClassNotFoundException;
- method protected java.lang.reflect.Constructor! obtainFontFamilyCtor(Class!) throws java.lang.NoSuchMethodException;
- method protected java.lang.reflect.Method! obtainFreezeMethod(Class!) throws java.lang.NoSuchMethodException;
- field protected final java.lang.reflect.Method! mAbortCreation;
- field protected final java.lang.reflect.Method! mAddFontFromAssetManager;
- field protected final java.lang.reflect.Method! mAddFontFromBuffer;
- field protected final java.lang.reflect.Method! mCreateFromFamiliesWithDefault;
- field protected final Class! mFontFamily;
- field protected final java.lang.reflect.Constructor! mFontFamilyCtor;
- field protected final java.lang.reflect.Method! mFreeze;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(28) public class TypefaceCompatApi28Impl extends androidx.core.graphics.TypefaceCompatApi26Impl {
- ctor public TypefaceCompatApi28Impl();
- method public android.graphics.Typeface! createFromFontFamilyFilesResourceEntry(android.content.Context!, androidx.core.content.res.FontResourcesParserCompat.FontFamilyFilesResourceEntry!, android.content.res.Resources!, int);
- method public android.graphics.Typeface! createFromFontInfo(android.content.Context!, android.os.CancellationSignal!, androidx.core.provider.FontsContractCompat.FontInfo[], int);
- method public android.graphics.Typeface? createFromResourcesFontFile(android.content.Context!, android.content.res.Resources!, int, String!, int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TypefaceCompatUtil {
- method public static void closeQuietly(java.io.Closeable!);
- method @RequiresApi(19) public static java.nio.ByteBuffer? copyToDirectBuffer(android.content.Context!, android.content.res.Resources!, int);
- method public static boolean copyToFile(java.io.File!, java.io.InputStream!);
- method public static boolean copyToFile(java.io.File!, android.content.res.Resources!, int);
- method public static java.io.File? getTempFile(android.content.Context!);
- method @RequiresApi(19) public static java.nio.ByteBuffer? mmap(android.content.Context!, android.os.CancellationSignal!, android.net.Uri!);
- }
-
-}
-
-package androidx.core.graphics.drawable {
-
- public class IconCompat extends androidx.versionedparcelable.CustomVersionedParcelable {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void addToShortcutIntent(android.content.Intent, android.graphics.drawable.Drawable?, android.content.Context);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void checkResource(android.content.Context!);
- method @RequiresApi(23) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.core.graphics.drawable.IconCompat? createFromIcon(android.graphics.drawable.Icon);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.core.graphics.drawable.IconCompat! createWithResource(android.content.res.Resources!, String!, @DrawableRes int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.Bitmap? getBitmap();
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int mType;
- }
-
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface TintAwareDrawable {
- method public void setTint(@ColorInt int);
- method public void setTintList(android.content.res.ColorStateList!);
- method public void setTintMode(android.graphics.PorterDuff.Mode!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface WrappedDrawable {
- method public android.graphics.drawable.Drawable! getWrappedDrawable();
- method public void setWrappedDrawable(android.graphics.drawable.Drawable!);
- }
-
-}
-
-package androidx.core.internal.view {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface SupportMenu extends android.view.Menu {
- method public void setGroupDividerEnabled(boolean);
- field public static final int CATEGORY_MASK = -65536; // 0xffff0000
- field public static final int CATEGORY_SHIFT = 16; // 0x10
- field public static final int FLAG_KEEP_OPEN_ON_SUBMENU_OPENED = 4; // 0x4
- field public static final int SUPPORTED_MODIFIERS_MASK = 69647; // 0x1100f
- field public static final int USER_MASK = 65535; // 0xffff
- field public static final int USER_SHIFT = 0; // 0x0
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface SupportMenuItem extends android.view.MenuItem {
- method public int getAlphabeticModifiers();
- method public CharSequence! getContentDescription();
- method public android.content.res.ColorStateList! getIconTintList();
- method public android.graphics.PorterDuff.Mode! getIconTintMode();
- method public int getNumericModifiers();
- method public androidx.core.view.ActionProvider! getSupportActionProvider();
- method public CharSequence! getTooltipText();
- method public boolean requiresActionButton();
- method public boolean requiresOverflow();
- method public android.view.MenuItem! setAlphabeticShortcut(char, int);
- method public androidx.core.internal.view.SupportMenuItem! setContentDescription(CharSequence!);
- method public android.view.MenuItem! setIconTintList(android.content.res.ColorStateList!);
- method public android.view.MenuItem! setIconTintMode(android.graphics.PorterDuff.Mode!);
- method public android.view.MenuItem! setNumericShortcut(char, int);
- method public android.view.MenuItem! setShortcut(char, char, int, int);
- method public androidx.core.internal.view.SupportMenuItem! setSupportActionProvider(androidx.core.view.ActionProvider!);
- method public androidx.core.internal.view.SupportMenuItem! setTooltipText(CharSequence!);
- field public static final int SHOW_AS_ACTION_ALWAYS = 2; // 0x2
- field public static final int SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW = 8; // 0x8
- field public static final int SHOW_AS_ACTION_IF_ROOM = 1; // 0x1
- field public static final int SHOW_AS_ACTION_NEVER = 0; // 0x0
- field public static final int SHOW_AS_ACTION_WITH_TEXT = 4; // 0x4
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface SupportSubMenu extends androidx.core.internal.view.SupportMenu android.view.SubMenu {
- }
-
-}
-
-package androidx.core.net {
-
- @IntDef({androidx.core.net.ConnectivityManagerCompat.RESTRICT_BACKGROUND_STATUS_DISABLED, androidx.core.net.ConnectivityManagerCompat.RESTRICT_BACKGROUND_STATUS_WHITELISTED, androidx.core.net.ConnectivityManagerCompat.RESTRICT_BACKGROUND_STATUS_ENABLED}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ConnectivityManagerCompat.RestrictBackgroundStatus {
- }
-
-}
-
-package androidx.core.provider {
-
- public final class FontRequest {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public String! getIdentifier();
- }
-
- public class FontsContractCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.graphics.Typeface! getFontSync(android.content.Context!, androidx.core.provider.FontRequest!, androidx.core.content.res.ResourcesCompat.FontCallback?, android.os.Handler?, boolean, int, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @VisibleForTesting public static android.content.pm.ProviderInfo? getProvider(android.content.pm.PackageManager, androidx.core.provider.FontRequest, android.content.res.Resources?) throws android.content.pm.PackageManager.NameNotFoundException;
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public static java.util.Map<android.net.Uri,java.nio.ByteBuffer>! prepareFontData(android.content.Context!, androidx.core.provider.FontsContractCompat.FontInfo[]!, android.os.CancellationSignal!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static void resetCache();
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARCEL_FONT_RESULTS = "font_results";
- }
-
- public static class FontsContractCompat.FontFamilyResult {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public FontsContractCompat.FontFamilyResult(int, androidx.core.provider.FontsContractCompat.FontInfo[]?);
- }
-
- public static class FontsContractCompat.FontInfo {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public FontsContractCompat.FontInfo(android.net.Uri, @IntRange(from=0) int, @IntRange(from=1, to=1000) int, boolean, int);
- }
-
- public static class FontsContractCompat.FontRequestCallback {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int RESULT_OK = 0; // 0x0
- }
-
- @IntDef({androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_PROVIDER_NOT_FOUND, androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_FONT_LOAD_ERROR, androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_FONT_NOT_FOUND, androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_FONT_UNAVAILABLE, androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_MALFORMED_QUERY, androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_WRONG_CERTIFICATES, androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_SECURITY_VIOLATION, androidx.core.provider.FontsContractCompat.FontRequestCallback.RESULT_OK}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface FontsContractCompat.FontRequestCallback.FontRequestFailReason {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class SelfDestructiveThread {
- ctor public SelfDestructiveThread(String!, int, int);
- method @VisibleForTesting public int getGeneration();
- method @VisibleForTesting public boolean isRunning();
- method public <T> void postAndReply(java.util.concurrent.Callable<T>!, androidx.core.provider.SelfDestructiveThread.ReplyCallback<T>!);
- method public <T> T! postAndWait(java.util.concurrent.Callable<T>!, int) throws java.lang.InterruptedException;
- }
-
- public static interface SelfDestructiveThread.ReplyCallback<T> {
- method public void onReply(T!);
- }
-
-}
-
-package androidx.core.text {
-
- public class PrecomputedTextCompat implements android.text.Spannable {
- method @RequiresApi(28) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.text.PrecomputedText? getPrecomputedText();
- }
-
- public static final class PrecomputedTextCompat.Params {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean equalsWithoutTextDirection(androidx.core.text.PrecomputedTextCompat.Params);
- }
-
-}
-
-package androidx.core.text.util {
-
- @IntDef(flag=true, value={android.text.util.Linkify.WEB_URLS, android.text.util.Linkify.EMAIL_ADDRESSES, android.text.util.Linkify.PHONE_NUMBERS, android.text.util.Linkify.MAP_ADDRESSES, android.text.util.Linkify.ALL}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface LinkifyCompat.LinkifyMask {
- }
-
-}
-
-package androidx.core.util {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DebugUtils {
- method public static void buildShortClassTag(Object!, StringBuilder!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class LogWriter extends java.io.Writer {
- ctor public LogWriter(String!);
- method public void close();
- method public void flush();
- method public void write(char[]!, int, int);
- }
-
- public final class PatternsCompat {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final java.util.regex.Pattern! AUTOLINK_EMAIL_ADDRESS;
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final java.util.regex.Pattern! AUTOLINK_WEB_URL;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class Preconditions {
- method public static void checkArgument(boolean);
- method public static void checkArgument(boolean, Object);
- method public static int checkArgumentInRange(int, int, int, String);
- method @IntRange(from=0) public static int checkArgumentNonnegative(int, String?);
- method @IntRange(from=0) public static int checkArgumentNonnegative(int);
- method public static <T> T checkNotNull(T?);
- method public static <T> T checkNotNull(T?, Object);
- method public static void checkState(boolean, String?);
- method public static void checkState(boolean);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class TimeUtils {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static void formatDuration(long, StringBuilder!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static void formatDuration(long, java.io.PrintWriter!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static void formatDuration(long, java.io.PrintWriter!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static void formatDuration(long, long, java.io.PrintWriter!);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int HUNDRED_DAY_FIELD_LEN = 19; // 0x13
- }
-
-}
-
-package androidx.core.view {
-
- public class AccessibilityDelegateCompat {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public AccessibilityDelegateCompat(android.view.View.AccessibilityDelegate!);
- }
-
- public abstract class ActionProvider {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void reset();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSubUiVisibilityListener(androidx.core.view.ActionProvider.SubUiVisibilityListener!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void subUiVisibilityChanged(boolean);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface ActionProvider.SubUiVisibilityListener {
- method public void onSubUiVisibilityChanged(boolean);
- }
-
- public final class DragAndDropPermissionsCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.core.view.DragAndDropPermissionsCompat? request(android.app.Activity!, android.view.DragEvent!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class KeyEventDispatcher {
- method public static boolean dispatchBeforeHierarchy(android.view.View, android.view.KeyEvent);
- method public static boolean dispatchKeyEvent(androidx.core.view.KeyEventDispatcher.Component, android.view.View?, android.view.Window.Callback?, android.view.KeyEvent);
- }
-
- public static interface KeyEventDispatcher.Component {
- method public boolean superDispatchKeyEvent(android.view.KeyEvent!);
- }
-
- public final class PointerIconCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public Object! getPointerIcon();
- }
-
- @IntDef({android.view.View.FOCUS_LEFT, android.view.View.FOCUS_UP, android.view.View.FOCUS_RIGHT, android.view.View.FOCUS_DOWN, android.view.View.FOCUS_FORWARD, android.view.View.FOCUS_BACKWARD}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ViewCompat.FocusDirection {
- }
-
- @IntDef({android.view.View.FOCUS_LEFT, android.view.View.FOCUS_UP, android.view.View.FOCUS_RIGHT, android.view.View.FOCUS_DOWN}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ViewCompat.FocusRealDirection {
- }
-
- @IntDef({android.view.View.FOCUS_FORWARD, android.view.View.FOCUS_BACKWARD}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ViewCompat.FocusRelativeDirection {
- }
-
- @IntDef({androidx.core.view.ViewCompat.TYPE_TOUCH, androidx.core.view.ViewCompat.TYPE_NON_TOUCH}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ViewCompat.NestedScrollType {
- }
-
- @IntDef(value={androidx.core.view.ViewCompat.SCROLL_AXIS_NONE, androidx.core.view.ViewCompat.SCROLL_AXIS_HORIZONTAL, androidx.core.view.ViewCompat.SCROLL_AXIS_VERTICAL}, flag=true) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ViewCompat.ScrollAxis {
- }
-
- @IntDef(flag=true, value={androidx.core.view.ViewCompat.SCROLL_INDICATOR_TOP, androidx.core.view.ViewCompat.SCROLL_INDICATOR_BOTTOM, androidx.core.view.ViewCompat.SCROLL_INDICATOR_LEFT, androidx.core.view.ViewCompat.SCROLL_INDICATOR_RIGHT, androidx.core.view.ViewCompat.SCROLL_INDICATOR_START, androidx.core.view.ViewCompat.SCROLL_INDICATOR_END}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ViewCompat.ScrollIndicators {
- }
-
-}
-
-package androidx.core.view.accessibility {
-
- public final class AccessibilityClickableSpanCompat extends android.text.style.ClickableSpan {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public AccessibilityClickableSpanCompat(int, androidx.core.view.accessibility.AccessibilityNodeInfoCompat!, int);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String SPAN_ID = "ACCESSIBILITY_CLICKABLE_SPAN_ID";
- }
-
- public class AccessibilityNodeInfoCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void addSpansToExtras(CharSequence!, android.view.View!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.text.style.ClickableSpan[]! getClickableSpans(CharSequence!);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int mParentVirtualDescendantId;
- }
-
- public static class AccessibilityNodeInfoCompat.AccessibilityActionCompat {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public AccessibilityNodeInfoCompat.AccessibilityActionCompat(int, CharSequence!, androidx.core.view.accessibility.AccessibilityViewCommand!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! createReplacementAction(CharSequence!, androidx.core.view.accessibility.AccessibilityViewCommand!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean perform(android.view.View!, android.os.Bundle!);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected final androidx.core.view.accessibility.AccessibilityViewCommand! mCommand;
- }
-
- public abstract static class AccessibilityViewCommand.CommandArguments {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setBundle(android.os.Bundle!);
- }
-
-}
-
-package androidx.core.widget {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface AutoSizeableTextView {
- method public int getAutoSizeMaxTextSize();
- method public int getAutoSizeMinTextSize();
- method public int getAutoSizeStepGranularity();
- method public int[]! getAutoSizeTextAvailableSizes();
- method @androidx.core.widget.TextViewCompat.AutoSizeTextType public int getAutoSizeTextType();
- method public void setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int) throws java.lang.IllegalArgumentException;
- method public void setAutoSizeTextTypeUniformWithPresetSizes(int[], int) throws java.lang.IllegalArgumentException;
- method public void setAutoSizeTextTypeWithDefaults(@androidx.core.widget.TextViewCompat.AutoSizeTextType int);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final boolean PLATFORM_SUPPORTS_AUTOSIZE;
- }
-
- public class NestedScrollView extends android.widget.FrameLayout implements androidx.core.view.NestedScrollingChild3 androidx.core.view.NestedScrollingParent3 androidx.core.view.ScrollingView {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeHorizontalScrollExtent();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeHorizontalScrollOffset();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeHorizontalScrollRange();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeVerticalScrollExtent();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeVerticalScrollOffset();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeVerticalScrollRange();
- }
-
- public final class TextViewCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.view.ActionMode.Callback wrapCustomSelectionActionModeCallback(android.widget.TextView, android.view.ActionMode.Callback);
- }
-
- @IntDef({androidx.core.widget.TextViewCompat.AUTO_SIZE_TEXT_TYPE_NONE, androidx.core.widget.TextViewCompat.AUTO_SIZE_TEXT_TYPE_UNIFORM}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface TextViewCompat.AutoSizeTextType {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface TintableImageSourceView {
- method public android.content.res.ColorStateList? getSupportImageTintList();
- method public android.graphics.PorterDuff.Mode? getSupportImageTintMode();
- method public void setSupportImageTintList(android.content.res.ColorStateList?);
- method public void setSupportImageTintMode(android.graphics.PorterDuff.Mode?);
- }
-
-}
-
diff --git a/core/api/restricted_current.txt b/core/api/restricted_current.txt
deleted file mode 100644
index 5baf105..0000000
--- a/core/api/restricted_current.txt
+++ /dev/null
@@ -1,562 +0,0 @@
-// Signature format: 3.0
-package android.support.v4.os {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ResultReceiver implements android.os.Parcelable {
- ctor public ResultReceiver(android.os.Handler!);
- method public int describeContents();
- method protected void onReceiveResult(int, android.os.Bundle!);
- method public void send(int, android.os.Bundle!);
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<android.support.v4.os.ResultReceiver>! CREATOR;
- }
-
-}
-
-package androidx.core.app {
-
- public class ActivityCompat extends androidx.core.content.ContextCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.core.app.ActivityCompat.PermissionCompatDelegate! getPermissionCompatDelegate();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface ActivityCompat.RequestPermissionsRequestCodeValidator {
- method public void validateRequestPermissionsRequestCode(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ComponentActivity extends android.app.Activity implements androidx.core.view.KeyEventDispatcher.Component {
- ctor public ComponentActivity();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public <T extends androidx.core.app.ComponentActivity.ExtraData> T! getExtraData(Class<T>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void putExtraData(androidx.core.app.ComponentActivity.ExtraData!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean superDispatchKeyEvent(android.view.KeyEvent!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class ComponentActivity.ExtraData {
- ctor public ComponentActivity.ExtraData();
- }
-
- @RequiresApi(api=28) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class CoreComponentFactory extends android.app.AppComponentFactory {
- ctor public CoreComponentFactory();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface CoreComponentFactory.CompatWrapped {
- method public Object! getWrapper();
- }
-
- @IntDef(flag=true, value={androidx.core.app.FrameMetricsAggregator.TOTAL_DURATION, androidx.core.app.FrameMetricsAggregator.INPUT_DURATION, androidx.core.app.FrameMetricsAggregator.LAYOUT_MEASURE_DURATION, androidx.core.app.FrameMetricsAggregator.DRAW_DURATION, androidx.core.app.FrameMetricsAggregator.SYNC_DURATION, androidx.core.app.FrameMetricsAggregator.COMMAND_DURATION, androidx.core.app.FrameMetricsAggregator.SWAP_DURATION, androidx.core.app.FrameMetricsAggregator.DELAY_DURATION, androidx.core.app.FrameMetricsAggregator.ANIMATION_DURATION, androidx.core.app.FrameMetricsAggregator.EVERY_DURATION}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface FrameMetricsAggregator.MetricType {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface NotificationBuilderWithBuilderAccessor {
- method public android.app.Notification.Builder! getBuilder();
- }
-
- @IntDef({androidx.core.app.NotificationCompat.BADGE_ICON_NONE, androidx.core.app.NotificationCompat.BADGE_ICON_SMALL, androidx.core.app.NotificationCompat.BADGE_ICON_LARGE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface NotificationCompat.BadgeIconType {
- }
-
- public static class NotificationCompat.Builder {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! getBigContentView();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getColor();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! getContentView();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! getHeadsUpContentView();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getPriority();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public long getWhenIfShowing();
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public java.util.ArrayList<androidx.core.app.NotificationCompat.Action>! mActions;
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.Context! mContext;
- }
-
- @IntDef({androidx.core.app.NotificationCompat.GROUP_ALERT_ALL, androidx.core.app.NotificationCompat.GROUP_ALERT_SUMMARY, androidx.core.app.NotificationCompat.GROUP_ALERT_CHILDREN}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface NotificationCompat.GroupAlertBehavior {
- }
-
- @IntDef({androidx.core.app.NotificationCompat.VISIBILITY_PUBLIC, androidx.core.app.NotificationCompat.VISIBILITY_PRIVATE, androidx.core.app.NotificationCompat.VISIBILITY_SECRET}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface NotificationCompat.NotificationVisibility {
- }
-
- @IntDef({android.media.AudioManager.STREAM_VOICE_CALL, android.media.AudioManager.STREAM_SYSTEM, android.media.AudioManager.STREAM_RING, android.media.AudioManager.STREAM_MUSIC, android.media.AudioManager.STREAM_ALARM, android.media.AudioManager.STREAM_NOTIFICATION, android.media.AudioManager.STREAM_DTMF, android.media.AudioManager.STREAM_ACCESSIBILITY}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface NotificationCompat.StreamType {
- }
-
- public abstract static class NotificationCompat.Style {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void addCompatExtras(android.os.Bundle!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void apply(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! applyStandardTemplate(boolean, int, boolean);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void buildIntoRemoteViews(android.widget.RemoteViews!, android.widget.RemoteViews!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.Bitmap! createColoredBitmap(int, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! makeBigContentView(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! makeContentView(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.widget.RemoteViews! makeHeadsUpContentView(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void restoreFromCompatExtras(android.os.Bundle!);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected androidx.core.app.NotificationCompat.Builder! mBuilder;
- }
-
- public class Person {
- method @RequiresApi(28) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.core.app.Person fromAndroidPerson(android.app.Person);
- method @RequiresApi(22) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.core.app.Person fromPersistableBundle(android.os.PersistableBundle);
- method @RequiresApi(28) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.app.Person toAndroidPerson();
- method @RequiresApi(22) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.os.PersistableBundle toPersistableBundle();
- }
-
- @IntDef({androidx.core.app.RemoteInput.SOURCE_FREE_FORM_INPUT, androidx.core.app.RemoteInput.SOURCE_CHOICE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface RemoteInput.Source {
- }
-
- @IntDef(flag=true, value={androidx.core.app.ServiceCompat.STOP_FOREGROUND_REMOVE, androidx.core.app.ServiceCompat.STOP_FOREGROUND_DETACH}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ServiceCompat.StopForegroundFlags {
- }
-
-}
-
-package androidx.core.content {
-
- @IntDef({androidx.core.content.PermissionChecker.PERMISSION_GRANTED, androidx.core.content.PermissionChecker.PERMISSION_DENIED, androidx.core.content.PermissionChecker.PERMISSION_DENIED_APP_OP}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PermissionChecker.PermissionResult {
- }
-
-}
-
-package androidx.core.content.pm {
-
-
-
- public class ShortcutInfoCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.core.graphics.drawable.IconCompat! getIcon();
- }
-
- public static class ShortcutInfoCompat.Builder {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public ShortcutInfoCompat.Builder(androidx.core.content.pm.ShortcutInfoCompat);
- ctor @RequiresApi(25) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public ShortcutInfoCompat.Builder(android.content.Context, android.content.pm.ShortcutInfo);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ShortcutInfoCompatSaver {
- ctor public ShortcutInfoCompatSaver();
- method @AnyThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void>! addShortcuts(java.util.List<androidx.core.content.pm.ShortcutInfoCompat>!);
- method @WorkerThread public java.util.List<androidx.core.content.pm.ShortcutInfoCompat>! getShortcuts() throws java.lang.Exception;
- method @AnyThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void>! removeAllShortcuts();
- method @AnyThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void>! removeShortcuts(java.util.List<java.lang.String>!);
- }
-
-}
-
-package androidx.core.content.res {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class ColorStateListInflaterCompat {
- method public static android.content.res.ColorStateList createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public static android.content.res.ColorStateList createFromXmlInner(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme?) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public static android.content.res.ColorStateList? inflate(android.content.res.Resources, @XmlRes int, android.content.res.Resources.Theme?);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class ComplexColorCompat {
- method @ColorInt public int getColor();
- method public android.graphics.Shader? getShader();
- method public static androidx.core.content.res.ComplexColorCompat? inflate(android.content.res.Resources, @ColorRes int, android.content.res.Resources.Theme?);
- method public boolean isGradient();
- method public boolean isStateful();
- method public boolean onStateChanged(int[]!);
- method public void setColor(@ColorInt int);
- method public boolean willDraw();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class FontResourcesParserCompat {
- method public static androidx.core.content.res.FontResourcesParserCompat.FamilyResourceEntry? parse(org.xmlpull.v1.XmlPullParser!, android.content.res.Resources!) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public static java.util.List<java.util.List<byte[]>>! readCerts(android.content.res.Resources!, @ArrayRes int);
- field public static final int FETCH_STRATEGY_ASYNC = 1; // 0x1
- field public static final int FETCH_STRATEGY_BLOCKING = 0; // 0x0
- field public static final int INFINITE_TIMEOUT_VALUE = -1; // 0xffffffff
- }
-
- public static interface FontResourcesParserCompat.FamilyResourceEntry {
- }
-
- @IntDef({androidx.core.content.res.FontResourcesParserCompat.FETCH_STRATEGY_BLOCKING, androidx.core.content.res.FontResourcesParserCompat.FETCH_STRATEGY_ASYNC}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface FontResourcesParserCompat.FetchStrategy {
- }
-
- public static final class FontResourcesParserCompat.FontFamilyFilesResourceEntry implements androidx.core.content.res.FontResourcesParserCompat.FamilyResourceEntry {
- ctor public FontResourcesParserCompat.FontFamilyFilesResourceEntry(androidx.core.content.res.FontResourcesParserCompat.FontFileResourceEntry[]);
- method public androidx.core.content.res.FontResourcesParserCompat.FontFileResourceEntry[] getEntries();
- }
-
- public static final class FontResourcesParserCompat.FontFileResourceEntry {
- ctor public FontResourcesParserCompat.FontFileResourceEntry(String, int, boolean, String?, int, int);
- method public String getFileName();
- method public int getResourceId();
- method public int getTtcIndex();
- method public String? getVariationSettings();
- method public int getWeight();
- method public boolean isItalic();
- }
-
- public static final class FontResourcesParserCompat.ProviderResourceEntry implements androidx.core.content.res.FontResourcesParserCompat.FamilyResourceEntry {
- ctor public FontResourcesParserCompat.ProviderResourceEntry(androidx.core.provider.FontRequest, @androidx.core.content.res.FontResourcesParserCompat.FetchStrategy int, int);
- method @androidx.core.content.res.FontResourcesParserCompat.FetchStrategy public int getFetchStrategy();
- method public androidx.core.provider.FontRequest getRequest();
- method public int getTimeout();
- }
-
- public final class ResourcesCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.graphics.Typeface! getFont(android.content.Context, @FontRes int, android.util.TypedValue!, int, androidx.core.content.res.ResourcesCompat.FontCallback?) throws android.content.res.Resources.NotFoundException;
- }
-
- public abstract static class ResourcesCompat.FontCallback {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final void callbackFailAsync(@androidx.core.provider.FontsContractCompat.FontRequestCallback.FontRequestFailReason int, android.os.Handler?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final void callbackSuccessAsync(android.graphics.Typeface!, android.os.Handler?);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TypedArrayUtils {
- method public static int getAttr(android.content.Context, int, int);
- method public static boolean getBoolean(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int, boolean);
- method public static android.graphics.drawable.Drawable? getDrawable(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int);
- method public static int getInt(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int, int);
- method public static boolean getNamedBoolean(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, boolean);
- method @ColorInt public static int getNamedColor(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, @ColorInt int);
- method public static android.content.res.ColorStateList? getNamedColorStateList(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme?, String, @StyleableRes int);
- method public static androidx.core.content.res.ComplexColorCompat! getNamedComplexColor(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, android.content.res.Resources.Theme?, String, @StyleableRes int, @ColorInt int);
- method public static float getNamedFloat(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, float);
- method public static int getNamedInt(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, int);
- method @AnyRes public static int getNamedResourceId(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int, @AnyRes int);
- method public static String? getNamedString(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, @StyleableRes int);
- method @AnyRes public static int getResourceId(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int, @AnyRes int);
- method public static String? getString(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int);
- method public static CharSequence? getText(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int);
- method public static CharSequence[]? getTextArray(android.content.res.TypedArray, @StyleableRes int, @StyleableRes int);
- method public static boolean hasAttribute(org.xmlpull.v1.XmlPullParser, String);
- method public static android.content.res.TypedArray obtainAttributes(android.content.res.Resources, android.content.res.Resources.Theme?, android.util.AttributeSet, int[]);
- method public static android.util.TypedValue? peekNamedValue(android.content.res.TypedArray, org.xmlpull.v1.XmlPullParser, String, int);
- }
-
-}
-
-package androidx.core.graphics {
-
- public class TypefaceCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.graphics.Typeface? createFromFontInfo(android.content.Context, android.os.CancellationSignal?, androidx.core.provider.FontsContractCompat.FontInfo[], int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.graphics.Typeface? createFromResourcesFamilyXml(android.content.Context, androidx.core.content.res.FontResourcesParserCompat.FamilyResourceEntry, android.content.res.Resources, int, int, androidx.core.content.res.ResourcesCompat.FontCallback?, android.os.Handler?, boolean);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.graphics.Typeface? createFromResourcesFontFile(android.content.Context, android.content.res.Resources, int, String!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.graphics.Typeface? findFromCache(android.content.res.Resources, int, int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(26) public class TypefaceCompatApi26Impl {
- ctor public TypefaceCompatApi26Impl();
- method protected android.graphics.Typeface? createFromFamiliesWithDefault(Object!);
- method public android.graphics.Typeface? createFromFontFamilyFilesResourceEntry(android.content.Context!, androidx.core.content.res.FontResourcesParserCompat.FontFamilyFilesResourceEntry!, android.content.res.Resources!, int);
- method public android.graphics.Typeface? createFromFontInfo(android.content.Context!, android.os.CancellationSignal?, androidx.core.provider.FontsContractCompat.FontInfo[], int);
- method public android.graphics.Typeface? createFromResourcesFontFile(android.content.Context!, android.content.res.Resources!, int, String!, int);
- method protected java.lang.reflect.Method! obtainAbortCreationMethod(Class!) throws java.lang.NoSuchMethodException;
- method protected java.lang.reflect.Method! obtainAddFontFromAssetManagerMethod(Class!) throws java.lang.NoSuchMethodException;
- method protected java.lang.reflect.Method! obtainAddFontFromBufferMethod(Class!) throws java.lang.NoSuchMethodException;
- method protected java.lang.reflect.Method! obtainCreateFromFamiliesWithDefaultMethod(Class!) throws java.lang.NoSuchMethodException;
- method protected Class! obtainFontFamily() throws java.lang.ClassNotFoundException;
- method protected java.lang.reflect.Constructor! obtainFontFamilyCtor(Class!) throws java.lang.NoSuchMethodException;
- method protected java.lang.reflect.Method! obtainFreezeMethod(Class!) throws java.lang.NoSuchMethodException;
- field protected final java.lang.reflect.Method! mAbortCreation;
- field protected final java.lang.reflect.Method! mAddFontFromAssetManager;
- field protected final java.lang.reflect.Method! mAddFontFromBuffer;
- field protected final java.lang.reflect.Method! mCreateFromFamiliesWithDefault;
- field protected final Class! mFontFamily;
- field protected final java.lang.reflect.Constructor! mFontFamilyCtor;
- field protected final java.lang.reflect.Method! mFreeze;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(28) public class TypefaceCompatApi28Impl extends androidx.core.graphics.TypefaceCompatApi26Impl {
- ctor public TypefaceCompatApi28Impl();
- method public android.graphics.Typeface! createFromFontFamilyFilesResourceEntry(android.content.Context!, androidx.core.content.res.FontResourcesParserCompat.FontFamilyFilesResourceEntry!, android.content.res.Resources!, int);
- method public android.graphics.Typeface! createFromFontInfo(android.content.Context!, android.os.CancellationSignal!, androidx.core.provider.FontsContractCompat.FontInfo[], int);
- method public android.graphics.Typeface? createFromResourcesFontFile(android.content.Context!, android.content.res.Resources!, int, String!, int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TypefaceCompatUtil {
- method public static void closeQuietly(java.io.Closeable!);
- method @RequiresApi(19) public static java.nio.ByteBuffer? copyToDirectBuffer(android.content.Context!, android.content.res.Resources!, int);
- method public static boolean copyToFile(java.io.File!, java.io.InputStream!);
- method public static boolean copyToFile(java.io.File!, android.content.res.Resources!, int);
- method public static java.io.File? getTempFile(android.content.Context!);
- method @RequiresApi(19) public static java.nio.ByteBuffer? mmap(android.content.Context!, android.os.CancellationSignal!, android.net.Uri!);
- }
-
-}
-
-package androidx.core.graphics.drawable {
-
- public class IconCompat extends androidx.versionedparcelable.CustomVersionedParcelable {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void addToShortcutIntent(android.content.Intent, android.graphics.drawable.Drawable?, android.content.Context);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void checkResource(android.content.Context!);
- method @RequiresApi(23) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.core.graphics.drawable.IconCompat? createFromIcon(android.graphics.drawable.Icon);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.core.graphics.drawable.IconCompat! createWithResource(android.content.res.Resources!, String!, @DrawableRes int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.graphics.Bitmap? getBitmap();
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int mType;
- }
-
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface TintAwareDrawable {
- method public void setTint(@ColorInt int);
- method public void setTintList(android.content.res.ColorStateList!);
- method public void setTintMode(android.graphics.PorterDuff.Mode!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface WrappedDrawable {
- method public android.graphics.drawable.Drawable! getWrappedDrawable();
- method public void setWrappedDrawable(android.graphics.drawable.Drawable!);
- }
-
-}
-
-package androidx.core.internal.view {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface SupportMenu extends android.view.Menu {
- method public void setGroupDividerEnabled(boolean);
- field public static final int CATEGORY_MASK = -65536; // 0xffff0000
- field public static final int CATEGORY_SHIFT = 16; // 0x10
- field public static final int FLAG_KEEP_OPEN_ON_SUBMENU_OPENED = 4; // 0x4
- field public static final int SUPPORTED_MODIFIERS_MASK = 69647; // 0x1100f
- field public static final int USER_MASK = 65535; // 0xffff
- field public static final int USER_SHIFT = 0; // 0x0
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface SupportMenuItem extends android.view.MenuItem {
- method public int getAlphabeticModifiers();
- method public CharSequence! getContentDescription();
- method public android.content.res.ColorStateList! getIconTintList();
- method public android.graphics.PorterDuff.Mode! getIconTintMode();
- method public int getNumericModifiers();
- method public androidx.core.view.ActionProvider! getSupportActionProvider();
- method public CharSequence! getTooltipText();
- method public boolean requiresActionButton();
- method public boolean requiresOverflow();
- method public android.view.MenuItem! setAlphabeticShortcut(char, int);
- method public androidx.core.internal.view.SupportMenuItem! setContentDescription(CharSequence!);
- method public android.view.MenuItem! setIconTintList(android.content.res.ColorStateList!);
- method public android.view.MenuItem! setIconTintMode(android.graphics.PorterDuff.Mode!);
- method public android.view.MenuItem! setNumericShortcut(char, int);
- method public android.view.MenuItem! setShortcut(char, char, int, int);
- method public androidx.core.internal.view.SupportMenuItem! setSupportActionProvider(androidx.core.view.ActionProvider!);
- method public androidx.core.internal.view.SupportMenuItem! setTooltipText(CharSequence!);
- field public static final int SHOW_AS_ACTION_ALWAYS = 2; // 0x2
- field public static final int SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW = 8; // 0x8
- field public static final int SHOW_AS_ACTION_IF_ROOM = 1; // 0x1
- field public static final int SHOW_AS_ACTION_NEVER = 0; // 0x0
- field public static final int SHOW_AS_ACTION_WITH_TEXT = 4; // 0x4
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface SupportSubMenu extends androidx.core.internal.view.SupportMenu android.view.SubMenu {
- }
-
-}
-
-package androidx.core.net {
-
- @IntDef({androidx.core.net.ConnectivityManagerCompat.RESTRICT_BACKGROUND_STATUS_DISABLED, androidx.core.net.ConnectivityManagerCompat.RESTRICT_BACKGROUND_STATUS_WHITELISTED, androidx.core.net.ConnectivityManagerCompat.RESTRICT_BACKGROUND_STATUS_ENABLED}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ConnectivityManagerCompat.RestrictBackgroundStatus {
- }
-
-}
-
-package androidx.core.provider {
-
- public final class FontRequest {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public String! getIdentifier();
- }
-
- public class FontsContractCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.graphics.Typeface! getFontSync(android.content.Context!, androidx.core.provider.FontRequest!, androidx.core.content.res.ResourcesCompat.FontCallback?, android.os.Handler?, boolean, int, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @VisibleForTesting public static android.content.pm.ProviderInfo? getProvider(android.content.pm.PackageManager, androidx.core.provider.FontRequest, android.content.res.Resources?) throws android.content.pm.PackageManager.NameNotFoundException;
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public static java.util.Map<android.net.Uri,java.nio.ByteBuffer>! prepareFontData(android.content.Context!, androidx.core.provider.FontsContractCompat.FontInfo[]!, android.os.CancellationSignal!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static void resetCache();
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARCEL_FONT_RESULTS = "font_results";
- }
-
- public static class FontsContractCompat.FontFamilyResult {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public FontsContractCompat.FontFamilyResult(int, androidx.core.provider.FontsContractCompat.FontInfo[]?);
- }
-
- public static class FontsContractCompat.FontInfo {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public FontsContractCompat.FontInfo(android.net.Uri, @IntRange(from=0) int, @IntRange(from=1, to=1000) int, boolean, int);
- }
-
- public static class FontsContractCompat.FontRequestCallback {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int RESULT_OK = 0; // 0x0
- }
-
- @IntDef({androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_PROVIDER_NOT_FOUND, androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_FONT_LOAD_ERROR, androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_FONT_NOT_FOUND, androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_FONT_UNAVAILABLE, androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_MALFORMED_QUERY, androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_WRONG_CERTIFICATES, androidx.core.provider.FontsContractCompat.FontRequestCallback.FAIL_REASON_SECURITY_VIOLATION, androidx.core.provider.FontsContractCompat.FontRequestCallback.RESULT_OK}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface FontsContractCompat.FontRequestCallback.FontRequestFailReason {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class SelfDestructiveThread {
- ctor public SelfDestructiveThread(String!, int, int);
- method @VisibleForTesting public int getGeneration();
- method @VisibleForTesting public boolean isRunning();
- method public <T> void postAndReply(java.util.concurrent.Callable<T>!, androidx.core.provider.SelfDestructiveThread.ReplyCallback<T>!);
- method public <T> T! postAndWait(java.util.concurrent.Callable<T>!, int) throws java.lang.InterruptedException;
- }
-
- public static interface SelfDestructiveThread.ReplyCallback<T> {
- method public void onReply(T!);
- }
-
-}
-
-package androidx.core.text {
-
- public class PrecomputedTextCompat implements android.text.Spannable {
- method @RequiresApi(28) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.text.PrecomputedText? getPrecomputedText();
- }
-
- public static final class PrecomputedTextCompat.Params {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean equalsWithoutTextDirection(androidx.core.text.PrecomputedTextCompat.Params);
- }
-
-}
-
-package androidx.core.text.util {
-
- @IntDef(flag=true, value={android.text.util.Linkify.WEB_URLS, android.text.util.Linkify.EMAIL_ADDRESSES, android.text.util.Linkify.PHONE_NUMBERS, android.text.util.Linkify.MAP_ADDRESSES, android.text.util.Linkify.ALL}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface LinkifyCompat.LinkifyMask {
- }
-
-}
-
-package androidx.core.util {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DebugUtils {
- method public static void buildShortClassTag(Object!, StringBuilder!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class LogWriter extends java.io.Writer {
- ctor public LogWriter(String!);
- method public void close();
- method public void flush();
- method public void write(char[]!, int, int);
- }
-
- public final class PatternsCompat {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final java.util.regex.Pattern! AUTOLINK_EMAIL_ADDRESS;
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final java.util.regex.Pattern! AUTOLINK_WEB_URL;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class Preconditions {
- method public static void checkArgument(boolean);
- method public static void checkArgument(boolean, Object);
- method public static int checkArgumentInRange(int, int, int, String);
- method @IntRange(from=0) public static int checkArgumentNonnegative(int, String?);
- method @IntRange(from=0) public static int checkArgumentNonnegative(int);
- method public static <T> T checkNotNull(T?);
- method public static <T> T checkNotNull(T?, Object);
- method public static void checkState(boolean, String?);
- method public static void checkState(boolean);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class TimeUtils {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static void formatDuration(long, StringBuilder!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static void formatDuration(long, java.io.PrintWriter!, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static void formatDuration(long, java.io.PrintWriter!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static void formatDuration(long, long, java.io.PrintWriter!);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int HUNDRED_DAY_FIELD_LEN = 19; // 0x13
- }
-
-}
-
-package androidx.core.view {
-
- public class AccessibilityDelegateCompat {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public AccessibilityDelegateCompat(android.view.View.AccessibilityDelegate!);
- }
-
- public abstract class ActionProvider {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void reset();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSubUiVisibilityListener(androidx.core.view.ActionProvider.SubUiVisibilityListener!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void subUiVisibilityChanged(boolean);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface ActionProvider.SubUiVisibilityListener {
- method public void onSubUiVisibilityChanged(boolean);
- }
-
- public final class DragAndDropPermissionsCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.core.view.DragAndDropPermissionsCompat? request(android.app.Activity!, android.view.DragEvent!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class KeyEventDispatcher {
- method public static boolean dispatchBeforeHierarchy(android.view.View, android.view.KeyEvent);
- method public static boolean dispatchKeyEvent(androidx.core.view.KeyEventDispatcher.Component, android.view.View?, android.view.Window.Callback?, android.view.KeyEvent);
- }
-
- public static interface KeyEventDispatcher.Component {
- method public boolean superDispatchKeyEvent(android.view.KeyEvent!);
- }
-
- public final class PointerIconCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public Object! getPointerIcon();
- }
-
- @IntDef({android.view.View.FOCUS_LEFT, android.view.View.FOCUS_UP, android.view.View.FOCUS_RIGHT, android.view.View.FOCUS_DOWN, android.view.View.FOCUS_FORWARD, android.view.View.FOCUS_BACKWARD}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ViewCompat.FocusDirection {
- }
-
- @IntDef({android.view.View.FOCUS_LEFT, android.view.View.FOCUS_UP, android.view.View.FOCUS_RIGHT, android.view.View.FOCUS_DOWN}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ViewCompat.FocusRealDirection {
- }
-
- @IntDef({android.view.View.FOCUS_FORWARD, android.view.View.FOCUS_BACKWARD}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ViewCompat.FocusRelativeDirection {
- }
-
- @IntDef({androidx.core.view.ViewCompat.TYPE_TOUCH, androidx.core.view.ViewCompat.TYPE_NON_TOUCH}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ViewCompat.NestedScrollType {
- }
-
- @IntDef(value={androidx.core.view.ViewCompat.SCROLL_AXIS_NONE, androidx.core.view.ViewCompat.SCROLL_AXIS_HORIZONTAL, androidx.core.view.ViewCompat.SCROLL_AXIS_VERTICAL}, flag=true) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ViewCompat.ScrollAxis {
- }
-
- @IntDef(flag=true, value={androidx.core.view.ViewCompat.SCROLL_INDICATOR_TOP, androidx.core.view.ViewCompat.SCROLL_INDICATOR_BOTTOM, androidx.core.view.ViewCompat.SCROLL_INDICATOR_LEFT, androidx.core.view.ViewCompat.SCROLL_INDICATOR_RIGHT, androidx.core.view.ViewCompat.SCROLL_INDICATOR_START, androidx.core.view.ViewCompat.SCROLL_INDICATOR_END}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ViewCompat.ScrollIndicators {
- }
-
-}
-
-package androidx.core.view.accessibility {
-
- public final class AccessibilityClickableSpanCompat extends android.text.style.ClickableSpan {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public AccessibilityClickableSpanCompat(int, androidx.core.view.accessibility.AccessibilityNodeInfoCompat!, int);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String SPAN_ID = "ACCESSIBILITY_CLICKABLE_SPAN_ID";
- }
-
- public class AccessibilityNodeInfoCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void addSpansToExtras(CharSequence!, android.view.View!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.text.style.ClickableSpan[]! getClickableSpans(CharSequence!);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int mParentVirtualDescendantId;
- }
-
- public static class AccessibilityNodeInfoCompat.AccessibilityActionCompat {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public AccessibilityNodeInfoCompat.AccessibilityActionCompat(int, CharSequence!, androidx.core.view.accessibility.AccessibilityViewCommand!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat! createReplacementAction(CharSequence!, androidx.core.view.accessibility.AccessibilityViewCommand!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean perform(android.view.View!, android.os.Bundle!);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected final androidx.core.view.accessibility.AccessibilityViewCommand! mCommand;
- }
-
- public abstract static class AccessibilityViewCommand.CommandArguments {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setBundle(android.os.Bundle!);
- }
-
-}
-
-package androidx.core.widget {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface AutoSizeableTextView {
- method public int getAutoSizeMaxTextSize();
- method public int getAutoSizeMinTextSize();
- method public int getAutoSizeStepGranularity();
- method public int[]! getAutoSizeTextAvailableSizes();
- method @androidx.core.widget.TextViewCompat.AutoSizeTextType public int getAutoSizeTextType();
- method public void setAutoSizeTextTypeUniformWithConfiguration(int, int, int, int) throws java.lang.IllegalArgumentException;
- method public void setAutoSizeTextTypeUniformWithPresetSizes(int[], int) throws java.lang.IllegalArgumentException;
- method public void setAutoSizeTextTypeWithDefaults(@androidx.core.widget.TextViewCompat.AutoSizeTextType int);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final boolean PLATFORM_SUPPORTS_AUTOSIZE;
- }
-
- public class NestedScrollView extends android.widget.FrameLayout implements androidx.core.view.NestedScrollingChild3 androidx.core.view.NestedScrollingParent3 androidx.core.view.ScrollingView {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeHorizontalScrollExtent();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeHorizontalScrollOffset();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeHorizontalScrollRange();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeVerticalScrollExtent();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeVerticalScrollOffset();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int computeVerticalScrollRange();
- }
-
- public final class TextViewCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.view.ActionMode.Callback wrapCustomSelectionActionModeCallback(android.widget.TextView, android.view.ActionMode.Callback);
- }
-
- @IntDef({androidx.core.widget.TextViewCompat.AUTO_SIZE_TEXT_TYPE_NONE, androidx.core.widget.TextViewCompat.AUTO_SIZE_TEXT_TYPE_UNIFORM}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface TextViewCompat.AutoSizeTextType {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface TintableImageSourceView {
- method public android.content.res.ColorStateList? getSupportImageTintList();
- method public android.graphics.PorterDuff.Mode? getSupportImageTintMode();
- method public void setSupportImageTintList(android.content.res.ColorStateList?);
- method public void setSupportImageTintMode(android.graphics.PorterDuff.Mode?);
- }
-
-}
-
diff --git a/core/build.gradle b/core/build.gradle
index a17073f..5111400 100644
--- a/core/build.gradle
+++ b/core/build.gradle
@@ -7,10 +7,10 @@
}
dependencies {
- api(project(":annotation"))
+ api("androidx.annotation:annotation:1.0.1")
implementation("androidx.collection:collection:1.0.0")
api(ARCH_LIFECYCLE_RUNTIME, libs.exclude_annotations_transitive)
- api(project(":versionedparcelable"))
+ api('androidx.versionedparcelable:versionedparcelable:1.1.0-alpha01')
api(GUAVA_LISTENABLE_FUTURE)
implementation("androidx.concurrent:concurrent-futures:1.0.0-alpha02")
diff --git a/core/ktx/api/1.0.0.txt b/core/ktx/api/1.0.0.txt
index ecfc1f3..6813932 100644
--- a/core/ktx/api/1.0.0.txt
+++ b/core/ktx/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.core.animation {
public final class AnimatorKt {
diff --git a/core/ktx/api/1.1.0-alpha02.txt b/core/ktx/api/1.1.0-alpha02.txt
index ecfc1f3..6813932 100644
--- a/core/ktx/api/1.1.0-alpha02.txt
+++ b/core/ktx/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.core.animation {
public final class AnimatorKt {
diff --git a/core/ktx/api/1.1.0-alpha03.txt b/core/ktx/api/1.1.0-alpha03.txt
index ecfc1f3..6813932 100644
--- a/core/ktx/api/1.1.0-alpha03.txt
+++ b/core/ktx/api/1.1.0-alpha03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.core.animation {
public final class AnimatorKt {
diff --git a/core/ktx/api/1.1.0-alpha04.txt b/core/ktx/api/1.1.0-alpha04.txt
index 63739d2..6813932 100644
--- a/core/ktx/api/1.1.0-alpha04.txt
+++ b/core/ktx/api/1.1.0-alpha04.txt
@@ -1,16 +1,16 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.core.animation {
public final class AnimatorKt {
ctor public AnimatorKt();
- method public static inline android.animation.Animator.AnimatorListener addListener(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onRepeat = {});
- method @RequiresApi(19) public static inline android.animation.Animator.AnimatorPauseListener addPauseListener(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onPause = {});
- method public static inline android.animation.Animator.AnimatorListener doOnCancel(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method public static inline android.animation.Animator.AnimatorListener doOnEnd(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.animation.Animator.AnimatorPauseListener doOnPause(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method public static inline android.animation.Animator.AnimatorListener doOnRepeat(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.animation.Animator.AnimatorPauseListener doOnResume(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method public static inline android.animation.Animator.AnimatorListener doOnStart(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
+ method public static android.animation.Animator.AnimatorListener addListener(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onRepeat = {});
+ method @RequiresApi(19) public static android.animation.Animator.AnimatorPauseListener addPauseListener(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onPause = {});
+ method public static android.animation.Animator.AnimatorListener doOnCancel(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
+ method public static android.animation.Animator.AnimatorListener doOnEnd(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.animation.Animator.AnimatorPauseListener doOnPause(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
+ method public static android.animation.Animator.AnimatorListener doOnRepeat(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.animation.Animator.AnimatorPauseListener doOnResume(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
+ method public static android.animation.Animator.AnimatorListener doOnStart(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
}
}
@@ -24,14 +24,13 @@
public final class ContextKt {
ctor public ContextKt();
- method public static inline <reified T> T! getSystemService(android.content.Context);
- method public static inline void withStyledAttributes(android.content.Context, android.util.AttributeSet? set = null, int[] attrs, @AttrRes int defStyleAttr = 0, @StyleRes int defStyleRes = 0, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,kotlin.Unit> block);
- method public static inline void withStyledAttributes(android.content.Context, @StyleRes int resourceId, int[] attrs, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,kotlin.Unit> block);
+ method public static void withStyledAttributes(android.content.Context, android.util.AttributeSet? set = null, int[] attrs, @AttrRes int defStyleAttr = 0, @StyleRes int defStyleRes = 0, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,kotlin.Unit> block);
+ method public static void withStyledAttributes(android.content.Context, @StyleRes int resourceId, int[] attrs, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,kotlin.Unit> block);
}
public final class SharedPreferencesKt {
ctor public SharedPreferencesKt();
- method public static inline void edit(android.content.SharedPreferences, boolean commit = false, kotlin.jvm.functions.Function1<? super android.content.SharedPreferences.Editor,kotlin.Unit> action);
+ method public static void edit(android.content.SharedPreferences, boolean commit = false, kotlin.jvm.functions.Function1<? super android.content.SharedPreferences.Editor,kotlin.Unit> action);
}
}
@@ -55,7 +54,7 @@
method public static String getStringOrThrow(android.content.res.TypedArray, @StyleableRes int index);
method public static CharSequence[] getTextArrayOrThrow(android.content.res.TypedArray, @StyleableRes int index);
method public static CharSequence getTextOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method public static inline <R> R! use(android.content.res.TypedArray, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,? extends R> block);
+ method public static <R> R! use(android.content.res.TypedArray, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,? extends R> block);
}
}
@@ -64,13 +63,13 @@
public final class CursorKt {
ctor public CursorKt();
- method public static inline byte[]? getBlobOrNull(android.database.Cursor, int index);
- method public static inline Double? getDoubleOrNull(android.database.Cursor, int index);
- method public static inline Float? getFloatOrNull(android.database.Cursor, int index);
- method public static inline Integer? getIntOrNull(android.database.Cursor, int index);
- method public static inline Long? getLongOrNull(android.database.Cursor, int index);
- method public static inline Short? getShortOrNull(android.database.Cursor, int index);
- method public static inline String? getStringOrNull(android.database.Cursor, int index);
+ method public static byte[]? getBlobOrNull(android.database.Cursor, int index);
+ method public static Double? getDoubleOrNull(android.database.Cursor, int index);
+ method public static Float? getFloatOrNull(android.database.Cursor, int index);
+ method public static Integer? getIntOrNull(android.database.Cursor, int index);
+ method public static Long? getLongOrNull(android.database.Cursor, int index);
+ method public static Short? getShortOrNull(android.database.Cursor, int index);
+ method public static String? getStringOrNull(android.database.Cursor, int index);
}
}
@@ -79,7 +78,7 @@
public final class SQLiteDatabaseKt {
ctor public SQLiteDatabaseKt();
- method public static inline <T> T! transaction(android.database.sqlite.SQLiteDatabase, boolean exclusive = true, kotlin.jvm.functions.Function1<? super android.database.sqlite.SQLiteDatabase,? extends T> body);
+ method public static <T> T! transaction(android.database.sqlite.SQLiteDatabase, boolean exclusive = true, kotlin.jvm.functions.Function1<? super android.database.sqlite.SQLiteDatabase,? extends T> body);
}
}
@@ -88,187 +87,187 @@
public final class BitmapKt {
ctor public BitmapKt();
- method public static inline android.graphics.Bitmap applyCanvas(android.graphics.Bitmap, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline operator boolean contains(android.graphics.Bitmap, android.graphics.Point p);
- method public static inline operator boolean contains(android.graphics.Bitmap, android.graphics.PointF p);
- method public static inline android.graphics.Bitmap createBitmap(int width, int height, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888);
- method @RequiresApi(26) public static inline android.graphics.Bitmap createBitmap(int width, int height, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888, boolean hasAlpha = true, android.graphics.ColorSpace colorSpace = ColorSpace.get(ColorSpace.Named.SRGB));
- method public static inline operator int get(android.graphics.Bitmap, int x, int y);
- method public static inline android.graphics.Bitmap scale(android.graphics.Bitmap, int width, int height, boolean filter = true);
- method public static inline operator void set(android.graphics.Bitmap, int x, int y, @ColorInt int color);
+ method public static android.graphics.Bitmap applyCanvas(android.graphics.Bitmap, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static operator boolean contains(android.graphics.Bitmap, android.graphics.Point p);
+ method public static operator boolean contains(android.graphics.Bitmap, android.graphics.PointF p);
+ method public static android.graphics.Bitmap createBitmap(int width, int height, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888);
+ method @RequiresApi(26) public static android.graphics.Bitmap createBitmap(int width, int height, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888, boolean hasAlpha = true, android.graphics.ColorSpace colorSpace = ColorSpace.get(ColorSpace.Named.SRGB));
+ method public static operator int get(android.graphics.Bitmap, int x, int y);
+ method public static android.graphics.Bitmap scale(android.graphics.Bitmap, int width, int height, boolean filter = true);
+ method public static operator void set(android.graphics.Bitmap, int x, int y, @ColorInt int color);
}
public final class CanvasKt {
ctor public CanvasKt();
- method public static inline void withClip(android.graphics.Canvas, android.graphics.Rect clipRect, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withClip(android.graphics.Canvas, android.graphics.RectF clipRect, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withClip(android.graphics.Canvas, int left, int top, int right, int bottom, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withClip(android.graphics.Canvas, float left, float top, float right, float bottom, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withClip(android.graphics.Canvas, android.graphics.Path clipPath, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withMatrix(android.graphics.Canvas, android.graphics.Matrix matrix = android.graphics.Matrix(), kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withRotation(android.graphics.Canvas, float degrees = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withSave(android.graphics.Canvas, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withScale(android.graphics.Canvas, float x = 1.0f, float y = 1.0f, float pivotX = 0.0f, float pivotY = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withSkew(android.graphics.Canvas, float x = 0.0f, float y = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withTranslation(android.graphics.Canvas, float x = 0.0f, float y = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withClip(android.graphics.Canvas, android.graphics.Rect clipRect, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withClip(android.graphics.Canvas, android.graphics.RectF clipRect, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withClip(android.graphics.Canvas, int left, int top, int right, int bottom, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withClip(android.graphics.Canvas, float left, float top, float right, float bottom, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withClip(android.graphics.Canvas, android.graphics.Path clipPath, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withMatrix(android.graphics.Canvas, android.graphics.Matrix matrix = android.graphics.Matrix(), kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withRotation(android.graphics.Canvas, float degrees = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withSave(android.graphics.Canvas, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withScale(android.graphics.Canvas, float x = 1.0f, float y = 1.0f, float pivotX = 0.0f, float pivotY = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withSkew(android.graphics.Canvas, float x = 0.0f, float y = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withTranslation(android.graphics.Canvas, float x = 0.0f, float y = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
}
public final class ColorKt {
ctor public ColorKt();
- method @RequiresApi(26) public static inline operator float component1(android.graphics.Color);
- method public static inline operator int component1(int);
- method @RequiresApi(26) public static inline operator float component1(long);
- method @RequiresApi(26) public static inline operator float component2(android.graphics.Color);
- method public static inline operator int component2(int);
- method @RequiresApi(26) public static inline operator float component2(long);
- method @RequiresApi(26) public static inline operator float component3(android.graphics.Color);
- method public static inline operator int component3(int);
- method @RequiresApi(26) public static inline operator float component3(long);
- method @RequiresApi(26) public static inline operator float component4(android.graphics.Color);
- method public static inline operator int component4(int);
- method @RequiresApi(26) public static inline operator float component4(long);
- method @ColorLong @RequiresApi(26) public static inline infix long convertTo(int, android.graphics.ColorSpace.Named colorSpace);
- method @ColorLong @RequiresApi(26) public static inline infix long convertTo(int, android.graphics.ColorSpace colorSpace);
- method @ColorLong @RequiresApi(26) public static inline infix long convertTo(long, android.graphics.ColorSpace.Named colorSpace);
- method @ColorLong @RequiresApi(26) public static inline infix long convertTo(long, android.graphics.ColorSpace colorSpace);
- method @RequiresApi(26) public static inline infix android.graphics.Color! convertTo(android.graphics.Color, android.graphics.ColorSpace.Named colorSpace);
- method @RequiresApi(26) public static inline infix android.graphics.Color! convertTo(android.graphics.Color, android.graphics.ColorSpace colorSpace);
- method public static inline int getAlpha(int);
- method @RequiresApi(26) public static inline float getAlpha(long);
- method public static inline int getBlue(int);
- method @RequiresApi(26) public static inline float getBlue(long);
- method @RequiresApi(26) public static inline android.graphics.ColorSpace getColorSpace(long);
- method public static inline int getGreen(int);
- method @RequiresApi(26) public static inline float getGreen(long);
- method @RequiresApi(26) public static inline float getLuminance(int);
- method @RequiresApi(26) public static inline float getLuminance(long);
- method public static inline int getRed(int);
- method @RequiresApi(26) public static inline float getRed(long);
- method @RequiresApi(26) public static inline boolean isSrgb(long);
- method @RequiresApi(26) public static inline boolean isWideGamut(long);
+ method @RequiresApi(26) public static operator float component1(android.graphics.Color);
+ method public static operator int component1(int);
+ method @RequiresApi(26) public static operator float component1(long);
+ method @RequiresApi(26) public static operator float component2(android.graphics.Color);
+ method public static operator int component2(int);
+ method @RequiresApi(26) public static operator float component2(long);
+ method @RequiresApi(26) public static operator float component3(android.graphics.Color);
+ method public static operator int component3(int);
+ method @RequiresApi(26) public static operator float component3(long);
+ method @RequiresApi(26) public static operator float component4(android.graphics.Color);
+ method public static operator int component4(int);
+ method @RequiresApi(26) public static operator float component4(long);
+ method @RequiresApi(26) @ColorLong public static infix long convertTo(int, android.graphics.ColorSpace.Named colorSpace);
+ method @RequiresApi(26) @ColorLong public static infix long convertTo(int, android.graphics.ColorSpace colorSpace);
+ method @RequiresApi(26) @ColorLong public static infix long convertTo(long, android.graphics.ColorSpace.Named colorSpace);
+ method @RequiresApi(26) @ColorLong public static infix long convertTo(long, android.graphics.ColorSpace colorSpace);
+ method @RequiresApi(26) public static infix android.graphics.Color! convertTo(android.graphics.Color, android.graphics.ColorSpace.Named colorSpace);
+ method @RequiresApi(26) public static infix android.graphics.Color! convertTo(android.graphics.Color, android.graphics.ColorSpace colorSpace);
+ method public static int getAlpha(int);
+ method @RequiresApi(26) public static float getAlpha(long);
+ method public static int getBlue(int);
+ method @RequiresApi(26) public static float getBlue(long);
+ method @RequiresApi(26) public static android.graphics.ColorSpace getColorSpace(long);
+ method public static int getGreen(int);
+ method @RequiresApi(26) public static float getGreen(long);
+ method @RequiresApi(26) public static float getLuminance(int);
+ method @RequiresApi(26) public static float getLuminance(long);
+ method public static int getRed(int);
+ method @RequiresApi(26) public static float getRed(long);
+ method @RequiresApi(26) public static boolean isSrgb(long);
+ method @RequiresApi(26) public static boolean isWideGamut(long);
method @RequiresApi(26) public static operator android.graphics.Color plus(android.graphics.Color, android.graphics.Color c);
- method @RequiresApi(26) public static inline android.graphics.Color toColor(int);
- method @RequiresApi(26) public static inline android.graphics.Color toColor(long);
- method @ColorInt @RequiresApi(26) public static inline int toColorInt(long);
- method @ColorInt public static inline int toColorInt(String);
- method @ColorLong @RequiresApi(26) public static inline long toColorLong(int);
+ method @RequiresApi(26) public static android.graphics.Color toColor(int);
+ method @RequiresApi(26) public static android.graphics.Color toColor(long);
+ method @RequiresApi(26) @ColorInt public static int toColorInt(long);
+ method @ColorInt public static int toColorInt(String);
+ method @RequiresApi(26) @ColorLong public static long toColorLong(int);
}
public final class ImageDecoderKt {
ctor public ImageDecoderKt();
- method @RequiresApi(28) public static inline android.graphics.Bitmap decodeBitmap(android.graphics.ImageDecoder.Source, kotlin.jvm.functions.Function3<? super android.graphics.ImageDecoder,? super android.graphics.ImageDecoder.ImageInfo,? super android.graphics.ImageDecoder.Source,kotlin.Unit> action);
- method @RequiresApi(28) public static inline android.graphics.drawable.Drawable decodeDrawable(android.graphics.ImageDecoder.Source, kotlin.jvm.functions.Function3<? super android.graphics.ImageDecoder,? super android.graphics.ImageDecoder.ImageInfo,? super android.graphics.ImageDecoder.Source,kotlin.Unit> action);
+ method @RequiresApi(28) public static android.graphics.Bitmap decodeBitmap(android.graphics.ImageDecoder.Source, kotlin.jvm.functions.Function3<? super android.graphics.ImageDecoder,? super android.graphics.ImageDecoder.ImageInfo,? super android.graphics.ImageDecoder.Source,kotlin.Unit> action);
+ method @RequiresApi(28) public static android.graphics.drawable.Drawable decodeDrawable(android.graphics.ImageDecoder.Source, kotlin.jvm.functions.Function3<? super android.graphics.ImageDecoder,? super android.graphics.ImageDecoder.ImageInfo,? super android.graphics.ImageDecoder.Source,kotlin.Unit> action);
}
public final class MatrixKt {
ctor public MatrixKt();
method public static android.graphics.Matrix rotationMatrix(float degrees, float px = 0.0f, float py = 0.0f);
method public static android.graphics.Matrix scaleMatrix(float sx = 1.0f, float sy = 1.0f);
- method public static inline operator android.graphics.Matrix times(android.graphics.Matrix, android.graphics.Matrix m);
+ method public static operator android.graphics.Matrix times(android.graphics.Matrix, android.graphics.Matrix m);
method public static android.graphics.Matrix translationMatrix(float tx = 0.0f, float ty = 0.0f);
- method public static inline float[] values(android.graphics.Matrix);
+ method public static float[] values(android.graphics.Matrix);
}
public final class PathKt {
ctor public PathKt();
- method @RequiresApi(19) public static inline infix android.graphics.Path and(android.graphics.Path, android.graphics.Path p);
+ method @RequiresApi(19) public static infix android.graphics.Path and(android.graphics.Path, android.graphics.Path p);
method @RequiresApi(26) public static Iterable<androidx.core.graphics.PathSegment> flatten(android.graphics.Path, float error = 0.5f);
- method @RequiresApi(19) public static inline operator android.graphics.Path minus(android.graphics.Path, android.graphics.Path p);
- method @RequiresApi(19) public static inline infix android.graphics.Path or(android.graphics.Path, android.graphics.Path p);
- method @RequiresApi(19) public static inline operator android.graphics.Path plus(android.graphics.Path, android.graphics.Path p);
- method @RequiresApi(19) public static inline infix android.graphics.Path xor(android.graphics.Path, android.graphics.Path p);
+ method @RequiresApi(19) public static operator android.graphics.Path minus(android.graphics.Path, android.graphics.Path p);
+ method @RequiresApi(19) public static infix android.graphics.Path or(android.graphics.Path, android.graphics.Path p);
+ method @RequiresApi(19) public static operator android.graphics.Path plus(android.graphics.Path, android.graphics.Path p);
+ method @RequiresApi(19) public static infix android.graphics.Path xor(android.graphics.Path, android.graphics.Path p);
}
public final class PictureKt {
ctor public PictureKt();
- method public static inline android.graphics.Picture record(android.graphics.Picture, int width, int height, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static android.graphics.Picture record(android.graphics.Picture, int width, int height, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
}
public final class PointKt {
ctor public PointKt();
- method public static inline operator int component1(android.graphics.Point);
- method public static inline operator float component1(android.graphics.PointF);
- method public static inline operator int component2(android.graphics.Point);
- method public static inline operator float component2(android.graphics.PointF);
- method public static inline operator android.graphics.Point minus(android.graphics.Point, android.graphics.Point p);
- method public static inline operator android.graphics.PointF minus(android.graphics.PointF, android.graphics.PointF p);
- method public static inline operator android.graphics.Point minus(android.graphics.Point, int xy);
- method public static inline operator android.graphics.PointF minus(android.graphics.PointF, float xy);
- method public static inline operator android.graphics.Point plus(android.graphics.Point, android.graphics.Point p);
- method public static inline operator android.graphics.PointF plus(android.graphics.PointF, android.graphics.PointF p);
- method public static inline operator android.graphics.Point plus(android.graphics.Point, int xy);
- method public static inline operator android.graphics.PointF plus(android.graphics.PointF, float xy);
- method public static inline android.graphics.Point toPoint(android.graphics.PointF);
- method public static inline android.graphics.PointF toPointF(android.graphics.Point);
- method public static inline operator android.graphics.Point unaryMinus(android.graphics.Point);
- method public static inline operator android.graphics.PointF unaryMinus(android.graphics.PointF);
+ method public static operator int component1(android.graphics.Point);
+ method public static operator float component1(android.graphics.PointF);
+ method public static operator int component2(android.graphics.Point);
+ method public static operator float component2(android.graphics.PointF);
+ method public static operator android.graphics.Point minus(android.graphics.Point, android.graphics.Point p);
+ method public static operator android.graphics.PointF minus(android.graphics.PointF, android.graphics.PointF p);
+ method public static operator android.graphics.Point minus(android.graphics.Point, int xy);
+ method public static operator android.graphics.PointF minus(android.graphics.PointF, float xy);
+ method public static operator android.graphics.Point plus(android.graphics.Point, android.graphics.Point p);
+ method public static operator android.graphics.PointF plus(android.graphics.PointF, android.graphics.PointF p);
+ method public static operator android.graphics.Point plus(android.graphics.Point, int xy);
+ method public static operator android.graphics.PointF plus(android.graphics.PointF, float xy);
+ method public static android.graphics.Point toPoint(android.graphics.PointF);
+ method public static android.graphics.PointF toPointF(android.graphics.Point);
+ method public static operator android.graphics.Point unaryMinus(android.graphics.Point);
+ method public static operator android.graphics.PointF unaryMinus(android.graphics.PointF);
}
public final class PorterDuffKt {
ctor public PorterDuffKt();
- method public static inline android.graphics.PorterDuffColorFilter toColorFilter(android.graphics.PorterDuff.Mode, int color);
- method public static inline android.graphics.PorterDuffXfermode toXfermode(android.graphics.PorterDuff.Mode);
+ method public static android.graphics.PorterDuffColorFilter toColorFilter(android.graphics.PorterDuff.Mode, int color);
+ method public static android.graphics.PorterDuffXfermode toXfermode(android.graphics.PorterDuff.Mode);
}
public final class RectKt {
ctor public RectKt();
- method public static inline infix android.graphics.Rect and(android.graphics.Rect, android.graphics.Rect r);
- method public static inline infix android.graphics.RectF and(android.graphics.RectF, android.graphics.RectF r);
- method public static inline operator int component1(android.graphics.Rect);
- method public static inline operator float component1(android.graphics.RectF);
- method public static inline operator int component2(android.graphics.Rect);
- method public static inline operator float component2(android.graphics.RectF);
- method public static inline operator int component3(android.graphics.Rect);
- method public static inline operator float component3(android.graphics.RectF);
- method public static inline operator int component4(android.graphics.Rect);
- method public static inline operator float component4(android.graphics.RectF);
- method public static inline operator boolean contains(android.graphics.Rect, android.graphics.Point p);
- method public static inline operator boolean contains(android.graphics.RectF, android.graphics.PointF p);
- method public static inline operator android.graphics.Region minus(android.graphics.Rect, android.graphics.Rect r);
- method public static inline operator android.graphics.Region minus(android.graphics.RectF, android.graphics.RectF r);
- method public static inline operator android.graphics.Rect minus(android.graphics.Rect, int xy);
- method public static inline operator android.graphics.RectF minus(android.graphics.RectF, float xy);
- method public static inline operator android.graphics.Rect minus(android.graphics.Rect, android.graphics.Point xy);
- method public static inline operator android.graphics.RectF minus(android.graphics.RectF, android.graphics.PointF xy);
- method public static inline infix android.graphics.Rect or(android.graphics.Rect, android.graphics.Rect r);
- method public static inline infix android.graphics.RectF or(android.graphics.RectF, android.graphics.RectF r);
- method public static inline operator android.graphics.Rect plus(android.graphics.Rect, android.graphics.Rect r);
- method public static inline operator android.graphics.RectF plus(android.graphics.RectF, android.graphics.RectF r);
- method public static inline operator android.graphics.Rect plus(android.graphics.Rect, int xy);
- method public static inline operator android.graphics.RectF plus(android.graphics.RectF, float xy);
- method public static inline operator android.graphics.Rect plus(android.graphics.Rect, android.graphics.Point xy);
- method public static inline operator android.graphics.RectF plus(android.graphics.RectF, android.graphics.PointF xy);
- method public static inline android.graphics.Rect toRect(android.graphics.RectF);
- method public static inline android.graphics.RectF toRectF(android.graphics.Rect);
- method public static inline android.graphics.Region toRegion(android.graphics.Rect);
- method public static inline android.graphics.Region toRegion(android.graphics.RectF);
- method public static inline android.graphics.RectF transform(android.graphics.RectF, android.graphics.Matrix m);
- method public static inline infix android.graphics.Region xor(android.graphics.Rect, android.graphics.Rect r);
- method public static inline infix android.graphics.Region xor(android.graphics.RectF, android.graphics.RectF r);
+ method public static infix android.graphics.Rect and(android.graphics.Rect, android.graphics.Rect r);
+ method public static infix android.graphics.RectF and(android.graphics.RectF, android.graphics.RectF r);
+ method public static operator int component1(android.graphics.Rect);
+ method public static operator float component1(android.graphics.RectF);
+ method public static operator int component2(android.graphics.Rect);
+ method public static operator float component2(android.graphics.RectF);
+ method public static operator int component3(android.graphics.Rect);
+ method public static operator float component3(android.graphics.RectF);
+ method public static operator int component4(android.graphics.Rect);
+ method public static operator float component4(android.graphics.RectF);
+ method public static operator boolean contains(android.graphics.Rect, android.graphics.Point p);
+ method public static operator boolean contains(android.graphics.RectF, android.graphics.PointF p);
+ method public static operator android.graphics.Region minus(android.graphics.Rect, android.graphics.Rect r);
+ method public static operator android.graphics.Region minus(android.graphics.RectF, android.graphics.RectF r);
+ method public static operator android.graphics.Rect minus(android.graphics.Rect, int xy);
+ method public static operator android.graphics.RectF minus(android.graphics.RectF, float xy);
+ method public static operator android.graphics.Rect minus(android.graphics.Rect, android.graphics.Point xy);
+ method public static operator android.graphics.RectF minus(android.graphics.RectF, android.graphics.PointF xy);
+ method public static infix android.graphics.Rect or(android.graphics.Rect, android.graphics.Rect r);
+ method public static infix android.graphics.RectF or(android.graphics.RectF, android.graphics.RectF r);
+ method public static operator android.graphics.Rect plus(android.graphics.Rect, android.graphics.Rect r);
+ method public static operator android.graphics.RectF plus(android.graphics.RectF, android.graphics.RectF r);
+ method public static operator android.graphics.Rect plus(android.graphics.Rect, int xy);
+ method public static operator android.graphics.RectF plus(android.graphics.RectF, float xy);
+ method public static operator android.graphics.Rect plus(android.graphics.Rect, android.graphics.Point xy);
+ method public static operator android.graphics.RectF plus(android.graphics.RectF, android.graphics.PointF xy);
+ method public static android.graphics.Rect toRect(android.graphics.RectF);
+ method public static android.graphics.RectF toRectF(android.graphics.Rect);
+ method public static android.graphics.Region toRegion(android.graphics.Rect);
+ method public static android.graphics.Region toRegion(android.graphics.RectF);
+ method public static android.graphics.RectF transform(android.graphics.RectF, android.graphics.Matrix m);
+ method public static infix android.graphics.Region xor(android.graphics.Rect, android.graphics.Rect r);
+ method public static infix android.graphics.Region xor(android.graphics.RectF, android.graphics.RectF r);
}
public final class RegionKt {
ctor public RegionKt();
- method public static inline infix android.graphics.Region and(android.graphics.Region, android.graphics.Rect r);
- method public static inline infix android.graphics.Region and(android.graphics.Region, android.graphics.Region r);
- method public static inline operator boolean contains(android.graphics.Region, android.graphics.Point p);
- method public static inline void forEach(android.graphics.Region, kotlin.jvm.functions.Function1<? super android.graphics.Rect,kotlin.Unit> action);
+ method public static infix android.graphics.Region and(android.graphics.Region, android.graphics.Rect r);
+ method public static infix android.graphics.Region and(android.graphics.Region, android.graphics.Region r);
+ method public static operator boolean contains(android.graphics.Region, android.graphics.Point p);
+ method public static void forEach(android.graphics.Region, kotlin.jvm.functions.Function1<? super android.graphics.Rect,kotlin.Unit> action);
method public static operator java.util.Iterator<android.graphics.Rect> iterator(android.graphics.Region);
- method public static inline operator android.graphics.Region minus(android.graphics.Region, android.graphics.Rect r);
- method public static inline operator android.graphics.Region minus(android.graphics.Region, android.graphics.Region r);
- method public static inline operator android.graphics.Region not(android.graphics.Region);
- method public static inline infix android.graphics.Region or(android.graphics.Region, android.graphics.Rect r);
- method public static inline infix android.graphics.Region or(android.graphics.Region, android.graphics.Region r);
- method public static inline operator android.graphics.Region plus(android.graphics.Region, android.graphics.Rect r);
- method public static inline operator android.graphics.Region plus(android.graphics.Region, android.graphics.Region r);
- method public static inline operator android.graphics.Region unaryMinus(android.graphics.Region);
- method public static inline infix android.graphics.Region xor(android.graphics.Region, android.graphics.Rect r);
- method public static inline infix android.graphics.Region xor(android.graphics.Region, android.graphics.Region r);
+ method public static operator android.graphics.Region minus(android.graphics.Region, android.graphics.Rect r);
+ method public static operator android.graphics.Region minus(android.graphics.Region, android.graphics.Region r);
+ method public static operator android.graphics.Region not(android.graphics.Region);
+ method public static infix android.graphics.Region or(android.graphics.Region, android.graphics.Rect r);
+ method public static infix android.graphics.Region or(android.graphics.Region, android.graphics.Region r);
+ method public static operator android.graphics.Region plus(android.graphics.Region, android.graphics.Rect r);
+ method public static operator android.graphics.Region plus(android.graphics.Region, android.graphics.Region r);
+ method public static operator android.graphics.Region unaryMinus(android.graphics.Region);
+ method public static infix android.graphics.Region xor(android.graphics.Region, android.graphics.Rect r);
+ method public static infix android.graphics.Region xor(android.graphics.Region, android.graphics.Region r);
}
public final class ShaderKt {
ctor public ShaderKt();
- method public static inline void transform(android.graphics.Shader, kotlin.jvm.functions.Function1<? super android.graphics.Matrix,kotlin.Unit> block);
+ method public static void transform(android.graphics.Shader, kotlin.jvm.functions.Function1<? super android.graphics.Matrix,kotlin.Unit> block);
}
}
@@ -277,13 +276,13 @@
public final class BitmapDrawableKt {
ctor public BitmapDrawableKt();
- method public static inline android.graphics.drawable.BitmapDrawable toDrawable(android.graphics.Bitmap, android.content.res.Resources resources);
+ method public static android.graphics.drawable.BitmapDrawable toDrawable(android.graphics.Bitmap, android.content.res.Resources resources);
}
public final class ColorDrawableKt {
ctor public ColorDrawableKt();
- method public static inline android.graphics.drawable.ColorDrawable toDrawable(int);
- method @RequiresApi(26) public static inline android.graphics.drawable.ColorDrawable toDrawable(android.graphics.Color);
+ method public static android.graphics.drawable.ColorDrawable toDrawable(int);
+ method @RequiresApi(26) public static android.graphics.drawable.ColorDrawable toDrawable(android.graphics.Color);
}
public final class DrawableKt {
@@ -294,10 +293,10 @@
public final class IconKt {
ctor public IconKt();
- method @RequiresApi(26) public static inline android.graphics.drawable.Icon toAdaptiveIcon(android.graphics.Bitmap);
- method @RequiresApi(26) public static inline android.graphics.drawable.Icon toIcon(android.graphics.Bitmap);
- method @RequiresApi(26) public static inline android.graphics.drawable.Icon toIcon(android.net.Uri);
- method @RequiresApi(26) public static inline android.graphics.drawable.Icon toIcon(byte[]);
+ method @RequiresApi(26) public static android.graphics.drawable.Icon toAdaptiveIcon(android.graphics.Bitmap);
+ method @RequiresApi(26) public static android.graphics.drawable.Icon toIcon(android.graphics.Bitmap);
+ method @RequiresApi(26) public static android.graphics.drawable.Icon toIcon(android.net.Uri);
+ method @RequiresApi(26) public static android.graphics.drawable.Icon toIcon(byte[]);
}
}
@@ -306,8 +305,8 @@
public final class LocationKt {
ctor public LocationKt();
- method public static inline operator double component1(android.location.Location);
- method public static inline operator double component2(android.location.Location);
+ method public static operator double component1(android.location.Location);
+ method public static operator double component2(android.location.Location);
}
}
@@ -317,8 +316,8 @@
public final class UriKt {
ctor public UriKt();
method public static java.io.File toFile(android.net.Uri);
- method public static inline android.net.Uri toUri(String);
- method public static inline android.net.Uri toUri(java.io.File);
+ method public static android.net.Uri toUri(String);
+ method public static android.net.Uri toUri(java.io.File);
}
}
@@ -332,8 +331,8 @@
public final class HandlerKt {
ctor public HandlerKt();
- method public static inline Runnable postAtTime(android.os.Handler, long uptimeMillis, Object? token = null, kotlin.jvm.functions.Function0<kotlin.Unit> action);
- method public static inline Runnable postDelayed(android.os.Handler, long delayInMillis, Object? token = null, kotlin.jvm.functions.Function0<kotlin.Unit> action);
+ method public static Runnable postAtTime(android.os.Handler, long uptimeMillis, Object? token = null, kotlin.jvm.functions.Function0<kotlin.Unit> action);
+ method public static Runnable postDelayed(android.os.Handler, long delayInMillis, Object? token = null, kotlin.jvm.functions.Function0<kotlin.Unit> action);
}
public final class PersistableBundleKt {
@@ -343,7 +342,7 @@
public final class TraceKt {
ctor public TraceKt();
- method public static inline <T> T! trace(String sectionName, kotlin.jvm.functions.Function0<? extends T> block);
+ method public static <T> T! trace(String sectionName, kotlin.jvm.functions.Function0<? extends T> block);
}
}
@@ -352,54 +351,53 @@
public final class CharSequenceKt {
ctor public CharSequenceKt();
- method public static inline boolean isDigitsOnly(CharSequence);
- method public static inline int trimmedLength(CharSequence);
+ method public static boolean isDigitsOnly(CharSequence);
+ method public static int trimmedLength(CharSequence);
}
public final class HtmlKt {
ctor public HtmlKt();
- method public static inline android.text.Spanned parseAsHtml(String, int flags = 0, android.text.Html.ImageGetter? imageGetter = null, android.text.Html.TagHandler? tagHandler = null);
- method public static inline String toHtml(android.text.Spanned, int option = 0);
+ method public static android.text.Spanned parseAsHtml(String, int flags = 0, android.text.Html.ImageGetter? imageGetter = null, android.text.Html.TagHandler? tagHandler = null);
+ method public static String toHtml(android.text.Spanned, int option = 0);
}
public final class LocaleKt {
ctor public LocaleKt();
- method @RequiresApi(17) public static inline int getLayoutDirection(java.util.Locale);
+ method @RequiresApi(17) public static int getLayoutDirection(java.util.Locale);
}
public final class SpannableStringBuilderKt {
ctor public SpannableStringBuilderKt();
- method public static inline android.text.SpannableStringBuilder backgroundColor(android.text.SpannableStringBuilder, @ColorInt int color, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder bold(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannedString buildSpannedString(kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder color(android.text.SpannableStringBuilder, @ColorInt int color, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder inSpans(android.text.SpannableStringBuilder, Object[] spans, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder inSpans(android.text.SpannableStringBuilder, Object span, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder italic(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder scale(android.text.SpannableStringBuilder, float proportion, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder strikeThrough(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder subscript(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder superscript(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder underline(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder backgroundColor(android.text.SpannableStringBuilder, @ColorInt int color, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder bold(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannedString buildSpannedString(kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder color(android.text.SpannableStringBuilder, @ColorInt int color, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder inSpans(android.text.SpannableStringBuilder, Object[] spans, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder inSpans(android.text.SpannableStringBuilder, Object span, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder italic(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder scale(android.text.SpannableStringBuilder, float proportion, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder strikeThrough(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder subscript(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder superscript(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder underline(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
}
public final class SpannableStringKt {
ctor public SpannableStringKt();
- method public static inline void clearSpans(android.text.Spannable);
- method public static inline operator void set(android.text.Spannable, int start, int end, Object span);
- method public static inline operator void set(android.text.Spannable, kotlin.ranges.IntRange range, Object span);
- method public static inline android.text.Spannable toSpannable(CharSequence);
+ method public static void clearSpans(android.text.Spannable);
+ method public static operator void set(android.text.Spannable, int start, int end, Object span);
+ method public static operator void set(android.text.Spannable, kotlin.ranges.IntRange range, Object span);
+ method public static android.text.Spannable toSpannable(CharSequence);
}
public final class SpannedStringKt {
ctor public SpannedStringKt();
- method public static inline <reified T> T[]! getSpans(android.text.Spanned, int start = 0, int end = length);
- method public static inline android.text.Spanned toSpanned(CharSequence);
+ method public static android.text.Spanned toSpanned(CharSequence);
}
public final class StringKt {
ctor public StringKt();
- method public static inline String htmlEncode(String);
+ method public static String htmlEncode(String);
}
}
@@ -408,12 +406,12 @@
public final class TransitionKt {
ctor public TransitionKt();
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener addListener(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onPause = {});
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnCancel(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnEnd(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnPause(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnResume(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnStart(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.transition.Transition.TransitionListener addListener(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onPause = {});
+ method @RequiresApi(19) public static android.transition.Transition.TransitionListener doOnCancel(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.transition.Transition.TransitionListener doOnEnd(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.transition.Transition.TransitionListener doOnPause(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.transition.Transition.TransitionListener doOnResume(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.transition.Transition.TransitionListener doOnStart(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
}
}
@@ -422,144 +420,144 @@
public final class AtomicFileKt {
ctor public AtomicFileKt();
- method @RequiresApi(17) public static inline byte[] readBytes(android.util.AtomicFile);
+ method @RequiresApi(17) public static byte[] readBytes(android.util.AtomicFile);
method @RequiresApi(17) public static String readText(android.util.AtomicFile, java.nio.charset.Charset charset = Charsets.UTF_8);
- method @RequiresApi(17) public static inline void tryWrite(android.util.AtomicFile, kotlin.jvm.functions.Function1<? super java.io.FileOutputStream,kotlin.Unit> block);
+ method @RequiresApi(17) public static void tryWrite(android.util.AtomicFile, kotlin.jvm.functions.Function1<? super java.io.FileOutputStream,kotlin.Unit> block);
method @RequiresApi(17) public static void writeBytes(android.util.AtomicFile, byte[] array);
method @RequiresApi(17) public static void writeText(android.util.AtomicFile, String text, java.nio.charset.Charset charset = Charsets.UTF_8);
}
public final class HalfKt {
ctor public HalfKt();
- method @RequiresApi(26) public static inline android.util.Half toHalf(short);
- method @RequiresApi(26) public static inline android.util.Half toHalf(float);
- method @RequiresApi(26) public static inline android.util.Half toHalf(double);
- method @RequiresApi(26) public static inline android.util.Half toHalf(String);
+ method @RequiresApi(26) public static android.util.Half toHalf(short);
+ method @RequiresApi(26) public static android.util.Half toHalf(float);
+ method @RequiresApi(26) public static android.util.Half toHalf(double);
+ method @RequiresApi(26) public static android.util.Half toHalf(String);
}
public final class LongSparseArrayKt {
ctor public LongSparseArrayKt();
- method @RequiresApi(16) public static inline operator <T> boolean contains(android.util.LongSparseArray<T>, long key);
- method @RequiresApi(16) public static inline <T> boolean containsKey(android.util.LongSparseArray<T>, long key);
- method @RequiresApi(16) public static inline <T> boolean containsValue(android.util.LongSparseArray<T>, T! value);
- method @RequiresApi(16) public static inline <T> void forEach(android.util.LongSparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Long,? super T,kotlin.Unit> action);
- method @RequiresApi(16) public static inline <T> T! getOrDefault(android.util.LongSparseArray<T>, long key, T! defaultValue);
- method @RequiresApi(16) public static inline <T> T! getOrElse(android.util.LongSparseArray<T>, long key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
- method @RequiresApi(16) public static inline <T> int getSize(android.util.LongSparseArray<T>);
- method @RequiresApi(16) public static inline <T> boolean isEmpty(android.util.LongSparseArray<T>);
- method @RequiresApi(16) public static inline <T> boolean isNotEmpty(android.util.LongSparseArray<T>);
+ method @RequiresApi(16) public static operator <T> boolean contains(android.util.LongSparseArray<T>, long key);
+ method @RequiresApi(16) public static <T> boolean containsKey(android.util.LongSparseArray<T>, long key);
+ method @RequiresApi(16) public static <T> boolean containsValue(android.util.LongSparseArray<T>, T! value);
+ method @RequiresApi(16) public static <T> void forEach(android.util.LongSparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Long,? super T,kotlin.Unit> action);
+ method @RequiresApi(16) public static <T> T! getOrDefault(android.util.LongSparseArray<T>, long key, T! defaultValue);
+ method @RequiresApi(16) public static <T> T! getOrElse(android.util.LongSparseArray<T>, long key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
+ method @RequiresApi(16) public static <T> int getSize(android.util.LongSparseArray<T>);
+ method @RequiresApi(16) public static <T> boolean isEmpty(android.util.LongSparseArray<T>);
+ method @RequiresApi(16) public static <T> boolean isNotEmpty(android.util.LongSparseArray<T>);
method @RequiresApi(16) public static <T> kotlin.collections.LongIterator keyIterator(android.util.LongSparseArray<T>);
method @RequiresApi(16) public static operator <T> android.util.LongSparseArray<T> plus(android.util.LongSparseArray<T>, android.util.LongSparseArray<T> other);
method @RequiresApi(16) public static <T> void putAll(android.util.LongSparseArray<T>, android.util.LongSparseArray<T> other);
method @RequiresApi(16) public static <T> boolean remove(android.util.LongSparseArray<T>, long key, T! value);
- method @RequiresApi(16) public static inline operator <T> void set(android.util.LongSparseArray<T>, long key, T! value);
+ method @RequiresApi(16) public static operator <T> void set(android.util.LongSparseArray<T>, long key, T! value);
method @RequiresApi(16) public static <T> java.util.Iterator<T> valueIterator(android.util.LongSparseArray<T>);
}
public final class LruCacheKt {
ctor public LruCacheKt();
- method public static inline <K, V> android.util.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { (V)null }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
+ method public static <K, V> android.util.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { (V)null }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class PairKt {
ctor public PairKt();
- method public static inline operator <F, S> F! component1(android.util.Pair<F,S>);
- method public static inline operator <F, S> S! component2(android.util.Pair<F,S>);
- method public static inline <F, S> android.util.Pair<F,S> toAndroidPair(kotlin.Pair<? extends F,? extends S>);
- method public static inline <F, S> kotlin.Pair<F,S> toKotlinPair(android.util.Pair<F,S>);
+ method public static operator <F, S> F! component1(android.util.Pair<F,S>);
+ method public static operator <F, S> S! component2(android.util.Pair<F,S>);
+ method public static <F, S> android.util.Pair<F,S> toAndroidPair(kotlin.Pair<? extends F,? extends S>);
+ method public static <F, S> kotlin.Pair<F,S> toKotlinPair(android.util.Pair<F,S>);
}
public final class RangeKt {
ctor public RangeKt();
- method @RequiresApi(21) public static inline infix <T extends java.lang.Comparable<? super T>> android.util.Range<T> and(android.util.Range<T>, android.util.Range<T> other);
- method @RequiresApi(21) public static inline operator <T extends java.lang.Comparable<? super T>> android.util.Range<T> plus(android.util.Range<T>, T value);
- method @RequiresApi(21) public static inline operator <T extends java.lang.Comparable<? super T>> android.util.Range<T> plus(android.util.Range<T>, android.util.Range<T> other);
- method @RequiresApi(21) public static inline infix <T extends java.lang.Comparable<? super T>> android.util.Range<T> rangeTo(T, T that);
+ method @RequiresApi(21) public static infix <T extends java.lang.Comparable<? super T>> android.util.Range<T> and(android.util.Range<T>, android.util.Range<T> other);
+ method @RequiresApi(21) public static operator <T extends java.lang.Comparable<? super T>> android.util.Range<T> plus(android.util.Range<T>, T value);
+ method @RequiresApi(21) public static operator <T extends java.lang.Comparable<? super T>> android.util.Range<T> plus(android.util.Range<T>, android.util.Range<T> other);
+ method @RequiresApi(21) public static infix <T extends java.lang.Comparable<? super T>> android.util.Range<T> rangeTo(T, T that);
method @RequiresApi(21) public static <T extends java.lang.Comparable<? super T>> kotlin.ranges.ClosedRange<T> toClosedRange(android.util.Range<T>);
method @RequiresApi(21) public static <T extends java.lang.Comparable<? super T>> android.util.Range<T> toRange(kotlin.ranges.ClosedRange<T>);
}
public final class SizeKt {
ctor public SizeKt();
- method @RequiresApi(21) public static inline operator int component1(android.util.Size);
- method @RequiresApi(21) public static inline operator float component1(android.util.SizeF);
- method @RequiresApi(21) public static inline operator int component2(android.util.Size);
- method @RequiresApi(21) public static inline operator float component2(android.util.SizeF);
+ method @RequiresApi(21) public static operator int component1(android.util.Size);
+ method @RequiresApi(21) public static operator float component1(android.util.SizeF);
+ method @RequiresApi(21) public static operator int component2(android.util.Size);
+ method @RequiresApi(21) public static operator float component2(android.util.SizeF);
}
public final class SparseArrayKt {
ctor public SparseArrayKt();
- method public static inline operator <T> boolean contains(android.util.SparseArray<T>, int key);
- method public static inline <T> boolean containsKey(android.util.SparseArray<T>, int key);
- method public static inline <T> boolean containsValue(android.util.SparseArray<T>, T! value);
- method public static inline <T> void forEach(android.util.SparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action);
- method public static inline <T> T! getOrDefault(android.util.SparseArray<T>, int key, T! defaultValue);
- method public static inline <T> T! getOrElse(android.util.SparseArray<T>, int key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
- method public static inline <T> int getSize(android.util.SparseArray<T>);
- method public static inline <T> boolean isEmpty(android.util.SparseArray<T>);
- method public static inline <T> boolean isNotEmpty(android.util.SparseArray<T>);
+ method public static operator <T> boolean contains(android.util.SparseArray<T>, int key);
+ method public static <T> boolean containsKey(android.util.SparseArray<T>, int key);
+ method public static <T> boolean containsValue(android.util.SparseArray<T>, T! value);
+ method public static <T> void forEach(android.util.SparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action);
+ method public static <T> T! getOrDefault(android.util.SparseArray<T>, int key, T! defaultValue);
+ method public static <T> T! getOrElse(android.util.SparseArray<T>, int key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
+ method public static <T> int getSize(android.util.SparseArray<T>);
+ method public static <T> boolean isEmpty(android.util.SparseArray<T>);
+ method public static <T> boolean isNotEmpty(android.util.SparseArray<T>);
method public static <T> kotlin.collections.IntIterator keyIterator(android.util.SparseArray<T>);
method public static operator <T> android.util.SparseArray<T> plus(android.util.SparseArray<T>, android.util.SparseArray<T> other);
method public static <T> void putAll(android.util.SparseArray<T>, android.util.SparseArray<T> other);
method public static <T> boolean remove(android.util.SparseArray<T>, int key, T! value);
- method public static inline operator <T> void set(android.util.SparseArray<T>, int key, T! value);
+ method public static operator <T> void set(android.util.SparseArray<T>, int key, T! value);
method public static <T> java.util.Iterator<T> valueIterator(android.util.SparseArray<T>);
}
public final class SparseBooleanArrayKt {
ctor public SparseBooleanArrayKt();
- method public static inline operator boolean contains(android.util.SparseBooleanArray, int key);
- method public static inline boolean containsKey(android.util.SparseBooleanArray, int key);
- method public static inline boolean containsValue(android.util.SparseBooleanArray, boolean value);
- method public static inline void forEach(android.util.SparseBooleanArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Boolean,kotlin.Unit> action);
- method public static inline boolean getOrDefault(android.util.SparseBooleanArray, int key, boolean defaultValue);
- method public static inline boolean getOrElse(android.util.SparseBooleanArray, int key, kotlin.jvm.functions.Function0<java.lang.Boolean> defaultValue);
- method public static inline int getSize(android.util.SparseBooleanArray);
- method public static inline boolean isEmpty(android.util.SparseBooleanArray);
- method public static inline boolean isNotEmpty(android.util.SparseBooleanArray);
+ method public static operator boolean contains(android.util.SparseBooleanArray, int key);
+ method public static boolean containsKey(android.util.SparseBooleanArray, int key);
+ method public static boolean containsValue(android.util.SparseBooleanArray, boolean value);
+ method public static void forEach(android.util.SparseBooleanArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Boolean,kotlin.Unit> action);
+ method public static boolean getOrDefault(android.util.SparseBooleanArray, int key, boolean defaultValue);
+ method public static boolean getOrElse(android.util.SparseBooleanArray, int key, kotlin.jvm.functions.Function0<java.lang.Boolean> defaultValue);
+ method public static int getSize(android.util.SparseBooleanArray);
+ method public static boolean isEmpty(android.util.SparseBooleanArray);
+ method public static boolean isNotEmpty(android.util.SparseBooleanArray);
method public static kotlin.collections.IntIterator keyIterator(android.util.SparseBooleanArray);
method public static operator android.util.SparseBooleanArray plus(android.util.SparseBooleanArray, android.util.SparseBooleanArray other);
method public static void putAll(android.util.SparseBooleanArray, android.util.SparseBooleanArray other);
method public static boolean remove(android.util.SparseBooleanArray, int key, boolean value);
- method public static inline operator void set(android.util.SparseBooleanArray, int key, boolean value);
+ method public static operator void set(android.util.SparseBooleanArray, int key, boolean value);
method public static kotlin.collections.BooleanIterator valueIterator(android.util.SparseBooleanArray);
}
public final class SparseIntArrayKt {
ctor public SparseIntArrayKt();
- method public static inline operator boolean contains(android.util.SparseIntArray, int key);
- method public static inline boolean containsKey(android.util.SparseIntArray, int key);
- method public static inline boolean containsValue(android.util.SparseIntArray, int value);
- method public static inline void forEach(android.util.SparseIntArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
- method public static inline int getOrDefault(android.util.SparseIntArray, int key, int defaultValue);
- method public static inline int getOrElse(android.util.SparseIntArray, int key, kotlin.jvm.functions.Function0<java.lang.Integer> defaultValue);
- method public static inline int getSize(android.util.SparseIntArray);
- method public static inline boolean isEmpty(android.util.SparseIntArray);
- method public static inline boolean isNotEmpty(android.util.SparseIntArray);
+ method public static operator boolean contains(android.util.SparseIntArray, int key);
+ method public static boolean containsKey(android.util.SparseIntArray, int key);
+ method public static boolean containsValue(android.util.SparseIntArray, int value);
+ method public static void forEach(android.util.SparseIntArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
+ method public static int getOrDefault(android.util.SparseIntArray, int key, int defaultValue);
+ method public static int getOrElse(android.util.SparseIntArray, int key, kotlin.jvm.functions.Function0<java.lang.Integer> defaultValue);
+ method public static int getSize(android.util.SparseIntArray);
+ method public static boolean isEmpty(android.util.SparseIntArray);
+ method public static boolean isNotEmpty(android.util.SparseIntArray);
method public static kotlin.collections.IntIterator keyIterator(android.util.SparseIntArray);
method public static operator android.util.SparseIntArray plus(android.util.SparseIntArray, android.util.SparseIntArray other);
method public static void putAll(android.util.SparseIntArray, android.util.SparseIntArray other);
method public static boolean remove(android.util.SparseIntArray, int key, int value);
- method public static inline operator void set(android.util.SparseIntArray, int key, int value);
+ method public static operator void set(android.util.SparseIntArray, int key, int value);
method public static kotlin.collections.IntIterator valueIterator(android.util.SparseIntArray);
}
public final class SparseLongArrayKt {
ctor public SparseLongArrayKt();
- method @RequiresApi(18) public static inline operator boolean contains(android.util.SparseLongArray, int key);
- method @RequiresApi(18) public static inline boolean containsKey(android.util.SparseLongArray, int key);
- method @RequiresApi(18) public static inline boolean containsValue(android.util.SparseLongArray, long value);
- method @RequiresApi(18) public static inline void forEach(android.util.SparseLongArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Long,kotlin.Unit> action);
- method @RequiresApi(18) public static inline long getOrDefault(android.util.SparseLongArray, int key, long defaultValue);
- method @RequiresApi(18) public static inline long getOrElse(android.util.SparseLongArray, int key, kotlin.jvm.functions.Function0<java.lang.Long> defaultValue);
- method @RequiresApi(18) public static inline int getSize(android.util.SparseLongArray);
- method @RequiresApi(18) public static inline boolean isEmpty(android.util.SparseLongArray);
- method @RequiresApi(18) public static inline boolean isNotEmpty(android.util.SparseLongArray);
+ method @RequiresApi(18) public static operator boolean contains(android.util.SparseLongArray, int key);
+ method @RequiresApi(18) public static boolean containsKey(android.util.SparseLongArray, int key);
+ method @RequiresApi(18) public static boolean containsValue(android.util.SparseLongArray, long value);
+ method @RequiresApi(18) public static void forEach(android.util.SparseLongArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Long,kotlin.Unit> action);
+ method @RequiresApi(18) public static long getOrDefault(android.util.SparseLongArray, int key, long defaultValue);
+ method @RequiresApi(18) public static long getOrElse(android.util.SparseLongArray, int key, kotlin.jvm.functions.Function0<java.lang.Long> defaultValue);
+ method @RequiresApi(18) public static int getSize(android.util.SparseLongArray);
+ method @RequiresApi(18) public static boolean isEmpty(android.util.SparseLongArray);
+ method @RequiresApi(18) public static boolean isNotEmpty(android.util.SparseLongArray);
method @RequiresApi(18) public static kotlin.collections.IntIterator keyIterator(android.util.SparseLongArray);
method @RequiresApi(18) public static operator android.util.SparseLongArray plus(android.util.SparseLongArray, android.util.SparseLongArray other);
method @RequiresApi(18) public static void putAll(android.util.SparseLongArray, android.util.SparseLongArray other);
method @RequiresApi(18) public static boolean remove(android.util.SparseLongArray, int key, long value);
- method @RequiresApi(18) public static inline operator void set(android.util.SparseLongArray, int key, long value);
+ method @RequiresApi(18) public static operator void set(android.util.SparseLongArray, int key, long value);
method @RequiresApi(18) public static kotlin.collections.LongIterator valueIterator(android.util.SparseLongArray);
}
@@ -570,60 +568,59 @@
public final class MenuKt {
ctor public MenuKt();
method public static operator boolean contains(android.view.Menu, android.view.MenuItem item);
- method public static inline void forEach(android.view.Menu, kotlin.jvm.functions.Function1<? super android.view.MenuItem,kotlin.Unit> action);
- method public static inline void forEachIndexed(android.view.Menu, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super android.view.MenuItem,kotlin.Unit> action);
- method public static inline operator android.view.MenuItem get(android.view.Menu, int index);
+ method public static void forEach(android.view.Menu, kotlin.jvm.functions.Function1<? super android.view.MenuItem,kotlin.Unit> action);
+ method public static void forEachIndexed(android.view.Menu, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super android.view.MenuItem,kotlin.Unit> action);
+ method public static operator android.view.MenuItem get(android.view.Menu, int index);
method public static kotlin.sequences.Sequence<android.view.MenuItem> getChildren(android.view.Menu);
- method public static inline int getSize(android.view.Menu);
- method public static inline boolean isEmpty(android.view.Menu);
- method public static inline boolean isNotEmpty(android.view.Menu);
+ method public static int getSize(android.view.Menu);
+ method public static boolean isEmpty(android.view.Menu);
+ method public static boolean isNotEmpty(android.view.Menu);
method public static operator java.util.Iterator<android.view.MenuItem> iterator(android.view.Menu);
- method public static inline operator void minusAssign(android.view.Menu, android.view.MenuItem item);
+ method public static operator void minusAssign(android.view.Menu, android.view.MenuItem item);
}
public final class ViewGroupKt {
ctor public ViewGroupKt();
- method public static inline operator boolean contains(android.view.ViewGroup, android.view.View view);
- method public static inline void forEach(android.view.ViewGroup, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
- method public static inline void forEachIndexed(android.view.ViewGroup, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super android.view.View,kotlin.Unit> action);
+ method public static operator boolean contains(android.view.ViewGroup, android.view.View view);
+ method public static void forEach(android.view.ViewGroup, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
+ method public static void forEachIndexed(android.view.ViewGroup, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super android.view.View,kotlin.Unit> action);
method public static operator android.view.View get(android.view.ViewGroup, int index);
method public static kotlin.sequences.Sequence<android.view.View> getChildren(android.view.ViewGroup);
- method public static inline int getSize(android.view.ViewGroup);
- method public static inline boolean isEmpty(android.view.ViewGroup);
- method public static inline boolean isNotEmpty(android.view.ViewGroup);
+ method public static int getSize(android.view.ViewGroup);
+ method public static boolean isEmpty(android.view.ViewGroup);
+ method public static boolean isNotEmpty(android.view.ViewGroup);
method public static operator java.util.Iterator<android.view.View> iterator(android.view.ViewGroup);
- method public static inline operator void minusAssign(android.view.ViewGroup, android.view.View view);
- method public static inline operator void plusAssign(android.view.ViewGroup, android.view.View view);
- method public static inline void setMargins(android.view.ViewGroup.MarginLayoutParams, @Px int size);
- method public static inline void updateMargins(android.view.ViewGroup.MarginLayoutParams, @Px int left = android.view.ViewGroup.MarginLayoutParams.leftMargin, @Px int top = android.view.ViewGroup.MarginLayoutParams.topMargin, @Px int right = android.view.ViewGroup.MarginLayoutParams.rightMargin, @Px int bottom = android.view.ViewGroup.MarginLayoutParams.bottomMargin);
- method @RequiresApi(17) public static inline void updateMarginsRelative(android.view.ViewGroup.MarginLayoutParams, @Px int start = marginStart, @Px int top = android.view.ViewGroup.MarginLayoutParams.topMargin, @Px int end = marginEnd, @Px int bottom = android.view.ViewGroup.MarginLayoutParams.bottomMargin);
+ method public static operator void minusAssign(android.view.ViewGroup, android.view.View view);
+ method public static operator void plusAssign(android.view.ViewGroup, android.view.View view);
+ method public static void setMargins(android.view.ViewGroup.MarginLayoutParams, @Px int size);
+ method public static void updateMargins(android.view.ViewGroup.MarginLayoutParams, @Px int left = android.view.ViewGroup.MarginLayoutParams.leftMargin, @Px int top = android.view.ViewGroup.MarginLayoutParams.topMargin, @Px int right = android.view.ViewGroup.MarginLayoutParams.rightMargin, @Px int bottom = android.view.ViewGroup.MarginLayoutParams.bottomMargin);
+ method @RequiresApi(17) public static void updateMarginsRelative(android.view.ViewGroup.MarginLayoutParams, @Px int start = marginStart, @Px int top = android.view.ViewGroup.MarginLayoutParams.topMargin, @Px int end = marginEnd, @Px int bottom = android.view.ViewGroup.MarginLayoutParams.bottomMargin);
}
public final class ViewKt {
ctor public ViewKt();
- method public static inline void doOnLayout(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
- method public static inline void doOnNextLayout(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
- method public static inline androidx.core.view.OneShotPreDrawListener doOnPreDraw(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
+ method public static void doOnLayout(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
+ method public static void doOnNextLayout(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
+ method public static androidx.core.view.OneShotPreDrawListener doOnPreDraw(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
method public static android.graphics.Bitmap drawToBitmap(android.view.View, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888);
- method public static inline int getMarginBottom(android.view.View);
- method public static inline int getMarginEnd(android.view.View);
- method public static inline int getMarginLeft(android.view.View);
- method public static inline int getMarginRight(android.view.View);
- method public static inline int getMarginStart(android.view.View);
- method public static inline int getMarginTop(android.view.View);
- method public static inline boolean isGone(android.view.View);
- method public static inline boolean isInvisible(android.view.View);
- method public static inline boolean isVisible(android.view.View);
- method public static inline Runnable postDelayed(android.view.View, long delayInMillis, kotlin.jvm.functions.Function0<kotlin.Unit> action);
- method @RequiresApi(16) public static inline Runnable postOnAnimationDelayed(android.view.View, long delayInMillis, kotlin.jvm.functions.Function0<kotlin.Unit> action);
- method public static inline void setGone(android.view.View, boolean value);
- method public static inline void setInvisible(android.view.View, boolean value);
- method public static inline void setPadding(android.view.View, @Px int size);
- method public static inline void setVisible(android.view.View, boolean value);
- method public static inline void updateLayoutParams(android.view.View, kotlin.jvm.functions.Function1<? super android.view.ViewGroup.LayoutParams,kotlin.Unit> block);
- method public static inline <reified T extends android.view.ViewGroup.LayoutParams> void updateLayoutParamsTyped(android.view.View, kotlin.jvm.functions.Function1<? super T,kotlin.Unit>! block);
- method public static inline void updatePadding(android.view.View, @Px int left = paddingLeft, @Px int top = paddingTop, @Px int right = paddingRight, @Px int bottom = paddingBottom);
- method @RequiresApi(17) public static inline void updatePaddingRelative(android.view.View, @Px int start = paddingStart, @Px int top = paddingTop, @Px int end = paddingEnd, @Px int bottom = paddingBottom);
+ method public static int getMarginBottom(android.view.View);
+ method public static int getMarginEnd(android.view.View);
+ method public static int getMarginLeft(android.view.View);
+ method public static int getMarginRight(android.view.View);
+ method public static int getMarginStart(android.view.View);
+ method public static int getMarginTop(android.view.View);
+ method public static boolean isGone(android.view.View);
+ method public static boolean isInvisible(android.view.View);
+ method public static boolean isVisible(android.view.View);
+ method public static Runnable postDelayed(android.view.View, long delayInMillis, kotlin.jvm.functions.Function0<kotlin.Unit> action);
+ method @RequiresApi(16) public static Runnable postOnAnimationDelayed(android.view.View, long delayInMillis, kotlin.jvm.functions.Function0<kotlin.Unit> action);
+ method public static void setGone(android.view.View, boolean value);
+ method public static void setInvisible(android.view.View, boolean value);
+ method public static void setPadding(android.view.View, @Px int size);
+ method public static void setVisible(android.view.View, boolean value);
+ method public static void updateLayoutParams(android.view.View, kotlin.jvm.functions.Function1<? super android.view.ViewGroup.LayoutParams,kotlin.Unit> block);
+ method public static void updatePadding(android.view.View, @Px int left = paddingLeft, @Px int top = paddingTop, @Px int right = paddingRight, @Px int bottom = paddingBottom);
+ method @RequiresApi(17) public static void updatePaddingRelative(android.view.View, @Px int start = paddingStart, @Px int top = paddingTop, @Px int end = paddingEnd, @Px int bottom = paddingBottom);
}
}
@@ -632,10 +629,10 @@
public final class TextViewKt {
ctor public TextViewKt();
- method public static inline android.text.TextWatcher addTextChangedListener(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> beforeTextChanged = { _, _, _, _ -> }, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> onTextChanged = { _, _, _, _ -> }, kotlin.jvm.functions.Function1<? super android.text.Editable,kotlin.Unit> afterTextChanged = {});
- method public static inline android.text.TextWatcher doAfterTextChanged(android.widget.TextView, kotlin.jvm.functions.Function1<? super android.text.Editable,kotlin.Unit> action);
- method public static inline android.text.TextWatcher doBeforeTextChanged(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
- method public static inline android.text.TextWatcher doOnTextChanged(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
+ method public static android.text.TextWatcher addTextChangedListener(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> beforeTextChanged = { _, _, _, _ -> }, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> onTextChanged = { _, _, _, _ -> }, kotlin.jvm.functions.Function1<? super android.text.Editable,kotlin.Unit> afterTextChanged = {});
+ method public static android.text.TextWatcher doAfterTextChanged(android.widget.TextView, kotlin.jvm.functions.Function1<? super android.text.Editable,kotlin.Unit> action);
+ method public static android.text.TextWatcher doBeforeTextChanged(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
+ method public static android.text.TextWatcher doOnTextChanged(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
}
}
diff --git a/core/ktx/api/1.1.0-alpha05.txt b/core/ktx/api/1.1.0-alpha05.txt
deleted file mode 100644
index 63739d2..0000000
--- a/core/ktx/api/1.1.0-alpha05.txt
+++ /dev/null
@@ -1,642 +0,0 @@
-// Signature format: 3.0
-package androidx.core.animation {
-
- public final class AnimatorKt {
- ctor public AnimatorKt();
- method public static inline android.animation.Animator.AnimatorListener addListener(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onRepeat = {});
- method @RequiresApi(19) public static inline android.animation.Animator.AnimatorPauseListener addPauseListener(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onPause = {});
- method public static inline android.animation.Animator.AnimatorListener doOnCancel(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method public static inline android.animation.Animator.AnimatorListener doOnEnd(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.animation.Animator.AnimatorPauseListener doOnPause(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method public static inline android.animation.Animator.AnimatorListener doOnRepeat(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.animation.Animator.AnimatorPauseListener doOnResume(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method public static inline android.animation.Animator.AnimatorListener doOnStart(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- }
-
-}
-
-package androidx.core.content {
-
- public final class ContentValuesKt {
- ctor public ContentValuesKt();
- method public static android.content.ContentValues contentValuesOf(kotlin.Pair<java.lang.String,?>... pairs);
- }
-
- public final class ContextKt {
- ctor public ContextKt();
- method public static inline <reified T> T! getSystemService(android.content.Context);
- method public static inline void withStyledAttributes(android.content.Context, android.util.AttributeSet? set = null, int[] attrs, @AttrRes int defStyleAttr = 0, @StyleRes int defStyleRes = 0, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,kotlin.Unit> block);
- method public static inline void withStyledAttributes(android.content.Context, @StyleRes int resourceId, int[] attrs, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,kotlin.Unit> block);
- }
-
- public final class SharedPreferencesKt {
- ctor public SharedPreferencesKt();
- method public static inline void edit(android.content.SharedPreferences, boolean commit = false, kotlin.jvm.functions.Function1<? super android.content.SharedPreferences.Editor,kotlin.Unit> action);
- }
-
-}
-
-package androidx.core.content.res {
-
- public final class TypedArrayKt {
- ctor public TypedArrayKt();
- method public static boolean getBooleanOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method @ColorInt public static int getColorOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method public static android.content.res.ColorStateList getColorStateListOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method public static float getDimensionOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method @Dimension public static int getDimensionPixelOffsetOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method @Dimension public static int getDimensionPixelSizeOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method public static android.graphics.drawable.Drawable getDrawableOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method public static float getFloatOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method @RequiresApi(26) public static android.graphics.Typeface getFontOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method public static int getIntOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method public static int getIntegerOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method @AnyRes public static int getResourceIdOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method public static String getStringOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method public static CharSequence[] getTextArrayOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method public static CharSequence getTextOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method public static inline <R> R! use(android.content.res.TypedArray, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,? extends R> block);
- }
-
-}
-
-package androidx.core.database {
-
- public final class CursorKt {
- ctor public CursorKt();
- method public static inline byte[]? getBlobOrNull(android.database.Cursor, int index);
- method public static inline Double? getDoubleOrNull(android.database.Cursor, int index);
- method public static inline Float? getFloatOrNull(android.database.Cursor, int index);
- method public static inline Integer? getIntOrNull(android.database.Cursor, int index);
- method public static inline Long? getLongOrNull(android.database.Cursor, int index);
- method public static inline Short? getShortOrNull(android.database.Cursor, int index);
- method public static inline String? getStringOrNull(android.database.Cursor, int index);
- }
-
-}
-
-package androidx.core.database.sqlite {
-
- public final class SQLiteDatabaseKt {
- ctor public SQLiteDatabaseKt();
- method public static inline <T> T! transaction(android.database.sqlite.SQLiteDatabase, boolean exclusive = true, kotlin.jvm.functions.Function1<? super android.database.sqlite.SQLiteDatabase,? extends T> body);
- }
-
-}
-
-package androidx.core.graphics {
-
- public final class BitmapKt {
- ctor public BitmapKt();
- method public static inline android.graphics.Bitmap applyCanvas(android.graphics.Bitmap, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline operator boolean contains(android.graphics.Bitmap, android.graphics.Point p);
- method public static inline operator boolean contains(android.graphics.Bitmap, android.graphics.PointF p);
- method public static inline android.graphics.Bitmap createBitmap(int width, int height, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888);
- method @RequiresApi(26) public static inline android.graphics.Bitmap createBitmap(int width, int height, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888, boolean hasAlpha = true, android.graphics.ColorSpace colorSpace = ColorSpace.get(ColorSpace.Named.SRGB));
- method public static inline operator int get(android.graphics.Bitmap, int x, int y);
- method public static inline android.graphics.Bitmap scale(android.graphics.Bitmap, int width, int height, boolean filter = true);
- method public static inline operator void set(android.graphics.Bitmap, int x, int y, @ColorInt int color);
- }
-
- public final class CanvasKt {
- ctor public CanvasKt();
- method public static inline void withClip(android.graphics.Canvas, android.graphics.Rect clipRect, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withClip(android.graphics.Canvas, android.graphics.RectF clipRect, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withClip(android.graphics.Canvas, int left, int top, int right, int bottom, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withClip(android.graphics.Canvas, float left, float top, float right, float bottom, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withClip(android.graphics.Canvas, android.graphics.Path clipPath, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withMatrix(android.graphics.Canvas, android.graphics.Matrix matrix = android.graphics.Matrix(), kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withRotation(android.graphics.Canvas, float degrees = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withSave(android.graphics.Canvas, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withScale(android.graphics.Canvas, float x = 1.0f, float y = 1.0f, float pivotX = 0.0f, float pivotY = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withSkew(android.graphics.Canvas, float x = 0.0f, float y = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withTranslation(android.graphics.Canvas, float x = 0.0f, float y = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- }
-
- public final class ColorKt {
- ctor public ColorKt();
- method @RequiresApi(26) public static inline operator float component1(android.graphics.Color);
- method public static inline operator int component1(int);
- method @RequiresApi(26) public static inline operator float component1(long);
- method @RequiresApi(26) public static inline operator float component2(android.graphics.Color);
- method public static inline operator int component2(int);
- method @RequiresApi(26) public static inline operator float component2(long);
- method @RequiresApi(26) public static inline operator float component3(android.graphics.Color);
- method public static inline operator int component3(int);
- method @RequiresApi(26) public static inline operator float component3(long);
- method @RequiresApi(26) public static inline operator float component4(android.graphics.Color);
- method public static inline operator int component4(int);
- method @RequiresApi(26) public static inline operator float component4(long);
- method @ColorLong @RequiresApi(26) public static inline infix long convertTo(int, android.graphics.ColorSpace.Named colorSpace);
- method @ColorLong @RequiresApi(26) public static inline infix long convertTo(int, android.graphics.ColorSpace colorSpace);
- method @ColorLong @RequiresApi(26) public static inline infix long convertTo(long, android.graphics.ColorSpace.Named colorSpace);
- method @ColorLong @RequiresApi(26) public static inline infix long convertTo(long, android.graphics.ColorSpace colorSpace);
- method @RequiresApi(26) public static inline infix android.graphics.Color! convertTo(android.graphics.Color, android.graphics.ColorSpace.Named colorSpace);
- method @RequiresApi(26) public static inline infix android.graphics.Color! convertTo(android.graphics.Color, android.graphics.ColorSpace colorSpace);
- method public static inline int getAlpha(int);
- method @RequiresApi(26) public static inline float getAlpha(long);
- method public static inline int getBlue(int);
- method @RequiresApi(26) public static inline float getBlue(long);
- method @RequiresApi(26) public static inline android.graphics.ColorSpace getColorSpace(long);
- method public static inline int getGreen(int);
- method @RequiresApi(26) public static inline float getGreen(long);
- method @RequiresApi(26) public static inline float getLuminance(int);
- method @RequiresApi(26) public static inline float getLuminance(long);
- method public static inline int getRed(int);
- method @RequiresApi(26) public static inline float getRed(long);
- method @RequiresApi(26) public static inline boolean isSrgb(long);
- method @RequiresApi(26) public static inline boolean isWideGamut(long);
- method @RequiresApi(26) public static operator android.graphics.Color plus(android.graphics.Color, android.graphics.Color c);
- method @RequiresApi(26) public static inline android.graphics.Color toColor(int);
- method @RequiresApi(26) public static inline android.graphics.Color toColor(long);
- method @ColorInt @RequiresApi(26) public static inline int toColorInt(long);
- method @ColorInt public static inline int toColorInt(String);
- method @ColorLong @RequiresApi(26) public static inline long toColorLong(int);
- }
-
- public final class ImageDecoderKt {
- ctor public ImageDecoderKt();
- method @RequiresApi(28) public static inline android.graphics.Bitmap decodeBitmap(android.graphics.ImageDecoder.Source, kotlin.jvm.functions.Function3<? super android.graphics.ImageDecoder,? super android.graphics.ImageDecoder.ImageInfo,? super android.graphics.ImageDecoder.Source,kotlin.Unit> action);
- method @RequiresApi(28) public static inline android.graphics.drawable.Drawable decodeDrawable(android.graphics.ImageDecoder.Source, kotlin.jvm.functions.Function3<? super android.graphics.ImageDecoder,? super android.graphics.ImageDecoder.ImageInfo,? super android.graphics.ImageDecoder.Source,kotlin.Unit> action);
- }
-
- public final class MatrixKt {
- ctor public MatrixKt();
- method public static android.graphics.Matrix rotationMatrix(float degrees, float px = 0.0f, float py = 0.0f);
- method public static android.graphics.Matrix scaleMatrix(float sx = 1.0f, float sy = 1.0f);
- method public static inline operator android.graphics.Matrix times(android.graphics.Matrix, android.graphics.Matrix m);
- method public static android.graphics.Matrix translationMatrix(float tx = 0.0f, float ty = 0.0f);
- method public static inline float[] values(android.graphics.Matrix);
- }
-
- public final class PathKt {
- ctor public PathKt();
- method @RequiresApi(19) public static inline infix android.graphics.Path and(android.graphics.Path, android.graphics.Path p);
- method @RequiresApi(26) public static Iterable<androidx.core.graphics.PathSegment> flatten(android.graphics.Path, float error = 0.5f);
- method @RequiresApi(19) public static inline operator android.graphics.Path minus(android.graphics.Path, android.graphics.Path p);
- method @RequiresApi(19) public static inline infix android.graphics.Path or(android.graphics.Path, android.graphics.Path p);
- method @RequiresApi(19) public static inline operator android.graphics.Path plus(android.graphics.Path, android.graphics.Path p);
- method @RequiresApi(19) public static inline infix android.graphics.Path xor(android.graphics.Path, android.graphics.Path p);
- }
-
- public final class PictureKt {
- ctor public PictureKt();
- method public static inline android.graphics.Picture record(android.graphics.Picture, int width, int height, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- }
-
- public final class PointKt {
- ctor public PointKt();
- method public static inline operator int component1(android.graphics.Point);
- method public static inline operator float component1(android.graphics.PointF);
- method public static inline operator int component2(android.graphics.Point);
- method public static inline operator float component2(android.graphics.PointF);
- method public static inline operator android.graphics.Point minus(android.graphics.Point, android.graphics.Point p);
- method public static inline operator android.graphics.PointF minus(android.graphics.PointF, android.graphics.PointF p);
- method public static inline operator android.graphics.Point minus(android.graphics.Point, int xy);
- method public static inline operator android.graphics.PointF minus(android.graphics.PointF, float xy);
- method public static inline operator android.graphics.Point plus(android.graphics.Point, android.graphics.Point p);
- method public static inline operator android.graphics.PointF plus(android.graphics.PointF, android.graphics.PointF p);
- method public static inline operator android.graphics.Point plus(android.graphics.Point, int xy);
- method public static inline operator android.graphics.PointF plus(android.graphics.PointF, float xy);
- method public static inline android.graphics.Point toPoint(android.graphics.PointF);
- method public static inline android.graphics.PointF toPointF(android.graphics.Point);
- method public static inline operator android.graphics.Point unaryMinus(android.graphics.Point);
- method public static inline operator android.graphics.PointF unaryMinus(android.graphics.PointF);
- }
-
- public final class PorterDuffKt {
- ctor public PorterDuffKt();
- method public static inline android.graphics.PorterDuffColorFilter toColorFilter(android.graphics.PorterDuff.Mode, int color);
- method public static inline android.graphics.PorterDuffXfermode toXfermode(android.graphics.PorterDuff.Mode);
- }
-
- public final class RectKt {
- ctor public RectKt();
- method public static inline infix android.graphics.Rect and(android.graphics.Rect, android.graphics.Rect r);
- method public static inline infix android.graphics.RectF and(android.graphics.RectF, android.graphics.RectF r);
- method public static inline operator int component1(android.graphics.Rect);
- method public static inline operator float component1(android.graphics.RectF);
- method public static inline operator int component2(android.graphics.Rect);
- method public static inline operator float component2(android.graphics.RectF);
- method public static inline operator int component3(android.graphics.Rect);
- method public static inline operator float component3(android.graphics.RectF);
- method public static inline operator int component4(android.graphics.Rect);
- method public static inline operator float component4(android.graphics.RectF);
- method public static inline operator boolean contains(android.graphics.Rect, android.graphics.Point p);
- method public static inline operator boolean contains(android.graphics.RectF, android.graphics.PointF p);
- method public static inline operator android.graphics.Region minus(android.graphics.Rect, android.graphics.Rect r);
- method public static inline operator android.graphics.Region minus(android.graphics.RectF, android.graphics.RectF r);
- method public static inline operator android.graphics.Rect minus(android.graphics.Rect, int xy);
- method public static inline operator android.graphics.RectF minus(android.graphics.RectF, float xy);
- method public static inline operator android.graphics.Rect minus(android.graphics.Rect, android.graphics.Point xy);
- method public static inline operator android.graphics.RectF minus(android.graphics.RectF, android.graphics.PointF xy);
- method public static inline infix android.graphics.Rect or(android.graphics.Rect, android.graphics.Rect r);
- method public static inline infix android.graphics.RectF or(android.graphics.RectF, android.graphics.RectF r);
- method public static inline operator android.graphics.Rect plus(android.graphics.Rect, android.graphics.Rect r);
- method public static inline operator android.graphics.RectF plus(android.graphics.RectF, android.graphics.RectF r);
- method public static inline operator android.graphics.Rect plus(android.graphics.Rect, int xy);
- method public static inline operator android.graphics.RectF plus(android.graphics.RectF, float xy);
- method public static inline operator android.graphics.Rect plus(android.graphics.Rect, android.graphics.Point xy);
- method public static inline operator android.graphics.RectF plus(android.graphics.RectF, android.graphics.PointF xy);
- method public static inline android.graphics.Rect toRect(android.graphics.RectF);
- method public static inline android.graphics.RectF toRectF(android.graphics.Rect);
- method public static inline android.graphics.Region toRegion(android.graphics.Rect);
- method public static inline android.graphics.Region toRegion(android.graphics.RectF);
- method public static inline android.graphics.RectF transform(android.graphics.RectF, android.graphics.Matrix m);
- method public static inline infix android.graphics.Region xor(android.graphics.Rect, android.graphics.Rect r);
- method public static inline infix android.graphics.Region xor(android.graphics.RectF, android.graphics.RectF r);
- }
-
- public final class RegionKt {
- ctor public RegionKt();
- method public static inline infix android.graphics.Region and(android.graphics.Region, android.graphics.Rect r);
- method public static inline infix android.graphics.Region and(android.graphics.Region, android.graphics.Region r);
- method public static inline operator boolean contains(android.graphics.Region, android.graphics.Point p);
- method public static inline void forEach(android.graphics.Region, kotlin.jvm.functions.Function1<? super android.graphics.Rect,kotlin.Unit> action);
- method public static operator java.util.Iterator<android.graphics.Rect> iterator(android.graphics.Region);
- method public static inline operator android.graphics.Region minus(android.graphics.Region, android.graphics.Rect r);
- method public static inline operator android.graphics.Region minus(android.graphics.Region, android.graphics.Region r);
- method public static inline operator android.graphics.Region not(android.graphics.Region);
- method public static inline infix android.graphics.Region or(android.graphics.Region, android.graphics.Rect r);
- method public static inline infix android.graphics.Region or(android.graphics.Region, android.graphics.Region r);
- method public static inline operator android.graphics.Region plus(android.graphics.Region, android.graphics.Rect r);
- method public static inline operator android.graphics.Region plus(android.graphics.Region, android.graphics.Region r);
- method public static inline operator android.graphics.Region unaryMinus(android.graphics.Region);
- method public static inline infix android.graphics.Region xor(android.graphics.Region, android.graphics.Rect r);
- method public static inline infix android.graphics.Region xor(android.graphics.Region, android.graphics.Region r);
- }
-
- public final class ShaderKt {
- ctor public ShaderKt();
- method public static inline void transform(android.graphics.Shader, kotlin.jvm.functions.Function1<? super android.graphics.Matrix,kotlin.Unit> block);
- }
-
-}
-
-package androidx.core.graphics.drawable {
-
- public final class BitmapDrawableKt {
- ctor public BitmapDrawableKt();
- method public static inline android.graphics.drawable.BitmapDrawable toDrawable(android.graphics.Bitmap, android.content.res.Resources resources);
- }
-
- public final class ColorDrawableKt {
- ctor public ColorDrawableKt();
- method public static inline android.graphics.drawable.ColorDrawable toDrawable(int);
- method @RequiresApi(26) public static inline android.graphics.drawable.ColorDrawable toDrawable(android.graphics.Color);
- }
-
- public final class DrawableKt {
- ctor public DrawableKt();
- method public static android.graphics.Bitmap toBitmap(android.graphics.drawable.Drawable, @Px int width = intrinsicWidth, @Px int height = intrinsicHeight, android.graphics.Bitmap.Config? config = null);
- method public static void updateBounds(android.graphics.drawable.Drawable, @Px int left = android.graphics.Rect.left, @Px int top = android.graphics.Rect.top, @Px int right = android.graphics.Rect.right, @Px int bottom = android.graphics.Rect.bottom);
- }
-
- public final class IconKt {
- ctor public IconKt();
- method @RequiresApi(26) public static inline android.graphics.drawable.Icon toAdaptiveIcon(android.graphics.Bitmap);
- method @RequiresApi(26) public static inline android.graphics.drawable.Icon toIcon(android.graphics.Bitmap);
- method @RequiresApi(26) public static inline android.graphics.drawable.Icon toIcon(android.net.Uri);
- method @RequiresApi(26) public static inline android.graphics.drawable.Icon toIcon(byte[]);
- }
-
-}
-
-package androidx.core.location {
-
- public final class LocationKt {
- ctor public LocationKt();
- method public static inline operator double component1(android.location.Location);
- method public static inline operator double component2(android.location.Location);
- }
-
-}
-
-package androidx.core.net {
-
- public final class UriKt {
- ctor public UriKt();
- method public static java.io.File toFile(android.net.Uri);
- method public static inline android.net.Uri toUri(String);
- method public static inline android.net.Uri toUri(java.io.File);
- }
-
-}
-
-package androidx.core.os {
-
- public final class BundleKt {
- ctor public BundleKt();
- method public static android.os.Bundle bundleOf(kotlin.Pair<java.lang.String,?>... pairs);
- }
-
- public final class HandlerKt {
- ctor public HandlerKt();
- method public static inline Runnable postAtTime(android.os.Handler, long uptimeMillis, Object? token = null, kotlin.jvm.functions.Function0<kotlin.Unit> action);
- method public static inline Runnable postDelayed(android.os.Handler, long delayInMillis, Object? token = null, kotlin.jvm.functions.Function0<kotlin.Unit> action);
- }
-
- public final class PersistableBundleKt {
- ctor public PersistableBundleKt();
- method @RequiresApi(21) public static android.os.PersistableBundle persistableBundleOf(kotlin.Pair<java.lang.String,?>... pairs);
- }
-
- public final class TraceKt {
- ctor public TraceKt();
- method public static inline <T> T! trace(String sectionName, kotlin.jvm.functions.Function0<? extends T> block);
- }
-
-}
-
-package androidx.core.text {
-
- public final class CharSequenceKt {
- ctor public CharSequenceKt();
- method public static inline boolean isDigitsOnly(CharSequence);
- method public static inline int trimmedLength(CharSequence);
- }
-
- public final class HtmlKt {
- ctor public HtmlKt();
- method public static inline android.text.Spanned parseAsHtml(String, int flags = 0, android.text.Html.ImageGetter? imageGetter = null, android.text.Html.TagHandler? tagHandler = null);
- method public static inline String toHtml(android.text.Spanned, int option = 0);
- }
-
- public final class LocaleKt {
- ctor public LocaleKt();
- method @RequiresApi(17) public static inline int getLayoutDirection(java.util.Locale);
- }
-
- public final class SpannableStringBuilderKt {
- ctor public SpannableStringBuilderKt();
- method public static inline android.text.SpannableStringBuilder backgroundColor(android.text.SpannableStringBuilder, @ColorInt int color, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder bold(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannedString buildSpannedString(kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder color(android.text.SpannableStringBuilder, @ColorInt int color, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder inSpans(android.text.SpannableStringBuilder, Object[] spans, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder inSpans(android.text.SpannableStringBuilder, Object span, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder italic(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder scale(android.text.SpannableStringBuilder, float proportion, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder strikeThrough(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder subscript(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder superscript(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder underline(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- }
-
- public final class SpannableStringKt {
- ctor public SpannableStringKt();
- method public static inline void clearSpans(android.text.Spannable);
- method public static inline operator void set(android.text.Spannable, int start, int end, Object span);
- method public static inline operator void set(android.text.Spannable, kotlin.ranges.IntRange range, Object span);
- method public static inline android.text.Spannable toSpannable(CharSequence);
- }
-
- public final class SpannedStringKt {
- ctor public SpannedStringKt();
- method public static inline <reified T> T[]! getSpans(android.text.Spanned, int start = 0, int end = length);
- method public static inline android.text.Spanned toSpanned(CharSequence);
- }
-
- public final class StringKt {
- ctor public StringKt();
- method public static inline String htmlEncode(String);
- }
-
-}
-
-package androidx.core.transition {
-
- public final class TransitionKt {
- ctor public TransitionKt();
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener addListener(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onPause = {});
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnCancel(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnEnd(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnPause(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnResume(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnStart(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- }
-
-}
-
-package androidx.core.util {
-
- public final class AtomicFileKt {
- ctor public AtomicFileKt();
- method @RequiresApi(17) public static inline byte[] readBytes(android.util.AtomicFile);
- method @RequiresApi(17) public static String readText(android.util.AtomicFile, java.nio.charset.Charset charset = Charsets.UTF_8);
- method @RequiresApi(17) public static inline void tryWrite(android.util.AtomicFile, kotlin.jvm.functions.Function1<? super java.io.FileOutputStream,kotlin.Unit> block);
- method @RequiresApi(17) public static void writeBytes(android.util.AtomicFile, byte[] array);
- method @RequiresApi(17) public static void writeText(android.util.AtomicFile, String text, java.nio.charset.Charset charset = Charsets.UTF_8);
- }
-
- public final class HalfKt {
- ctor public HalfKt();
- method @RequiresApi(26) public static inline android.util.Half toHalf(short);
- method @RequiresApi(26) public static inline android.util.Half toHalf(float);
- method @RequiresApi(26) public static inline android.util.Half toHalf(double);
- method @RequiresApi(26) public static inline android.util.Half toHalf(String);
- }
-
- public final class LongSparseArrayKt {
- ctor public LongSparseArrayKt();
- method @RequiresApi(16) public static inline operator <T> boolean contains(android.util.LongSparseArray<T>, long key);
- method @RequiresApi(16) public static inline <T> boolean containsKey(android.util.LongSparseArray<T>, long key);
- method @RequiresApi(16) public static inline <T> boolean containsValue(android.util.LongSparseArray<T>, T! value);
- method @RequiresApi(16) public static inline <T> void forEach(android.util.LongSparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Long,? super T,kotlin.Unit> action);
- method @RequiresApi(16) public static inline <T> T! getOrDefault(android.util.LongSparseArray<T>, long key, T! defaultValue);
- method @RequiresApi(16) public static inline <T> T! getOrElse(android.util.LongSparseArray<T>, long key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
- method @RequiresApi(16) public static inline <T> int getSize(android.util.LongSparseArray<T>);
- method @RequiresApi(16) public static inline <T> boolean isEmpty(android.util.LongSparseArray<T>);
- method @RequiresApi(16) public static inline <T> boolean isNotEmpty(android.util.LongSparseArray<T>);
- method @RequiresApi(16) public static <T> kotlin.collections.LongIterator keyIterator(android.util.LongSparseArray<T>);
- method @RequiresApi(16) public static operator <T> android.util.LongSparseArray<T> plus(android.util.LongSparseArray<T>, android.util.LongSparseArray<T> other);
- method @RequiresApi(16) public static <T> void putAll(android.util.LongSparseArray<T>, android.util.LongSparseArray<T> other);
- method @RequiresApi(16) public static <T> boolean remove(android.util.LongSparseArray<T>, long key, T! value);
- method @RequiresApi(16) public static inline operator <T> void set(android.util.LongSparseArray<T>, long key, T! value);
- method @RequiresApi(16) public static <T> java.util.Iterator<T> valueIterator(android.util.LongSparseArray<T>);
- }
-
- public final class LruCacheKt {
- ctor public LruCacheKt();
- method public static inline <K, V> android.util.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { (V)null }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
- }
-
- public final class PairKt {
- ctor public PairKt();
- method public static inline operator <F, S> F! component1(android.util.Pair<F,S>);
- method public static inline operator <F, S> S! component2(android.util.Pair<F,S>);
- method public static inline <F, S> android.util.Pair<F,S> toAndroidPair(kotlin.Pair<? extends F,? extends S>);
- method public static inline <F, S> kotlin.Pair<F,S> toKotlinPair(android.util.Pair<F,S>);
- }
-
- public final class RangeKt {
- ctor public RangeKt();
- method @RequiresApi(21) public static inline infix <T extends java.lang.Comparable<? super T>> android.util.Range<T> and(android.util.Range<T>, android.util.Range<T> other);
- method @RequiresApi(21) public static inline operator <T extends java.lang.Comparable<? super T>> android.util.Range<T> plus(android.util.Range<T>, T value);
- method @RequiresApi(21) public static inline operator <T extends java.lang.Comparable<? super T>> android.util.Range<T> plus(android.util.Range<T>, android.util.Range<T> other);
- method @RequiresApi(21) public static inline infix <T extends java.lang.Comparable<? super T>> android.util.Range<T> rangeTo(T, T that);
- method @RequiresApi(21) public static <T extends java.lang.Comparable<? super T>> kotlin.ranges.ClosedRange<T> toClosedRange(android.util.Range<T>);
- method @RequiresApi(21) public static <T extends java.lang.Comparable<? super T>> android.util.Range<T> toRange(kotlin.ranges.ClosedRange<T>);
- }
-
- public final class SizeKt {
- ctor public SizeKt();
- method @RequiresApi(21) public static inline operator int component1(android.util.Size);
- method @RequiresApi(21) public static inline operator float component1(android.util.SizeF);
- method @RequiresApi(21) public static inline operator int component2(android.util.Size);
- method @RequiresApi(21) public static inline operator float component2(android.util.SizeF);
- }
-
- public final class SparseArrayKt {
- ctor public SparseArrayKt();
- method public static inline operator <T> boolean contains(android.util.SparseArray<T>, int key);
- method public static inline <T> boolean containsKey(android.util.SparseArray<T>, int key);
- method public static inline <T> boolean containsValue(android.util.SparseArray<T>, T! value);
- method public static inline <T> void forEach(android.util.SparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action);
- method public static inline <T> T! getOrDefault(android.util.SparseArray<T>, int key, T! defaultValue);
- method public static inline <T> T! getOrElse(android.util.SparseArray<T>, int key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
- method public static inline <T> int getSize(android.util.SparseArray<T>);
- method public static inline <T> boolean isEmpty(android.util.SparseArray<T>);
- method public static inline <T> boolean isNotEmpty(android.util.SparseArray<T>);
- method public static <T> kotlin.collections.IntIterator keyIterator(android.util.SparseArray<T>);
- method public static operator <T> android.util.SparseArray<T> plus(android.util.SparseArray<T>, android.util.SparseArray<T> other);
- method public static <T> void putAll(android.util.SparseArray<T>, android.util.SparseArray<T> other);
- method public static <T> boolean remove(android.util.SparseArray<T>, int key, T! value);
- method public static inline operator <T> void set(android.util.SparseArray<T>, int key, T! value);
- method public static <T> java.util.Iterator<T> valueIterator(android.util.SparseArray<T>);
- }
-
- public final class SparseBooleanArrayKt {
- ctor public SparseBooleanArrayKt();
- method public static inline operator boolean contains(android.util.SparseBooleanArray, int key);
- method public static inline boolean containsKey(android.util.SparseBooleanArray, int key);
- method public static inline boolean containsValue(android.util.SparseBooleanArray, boolean value);
- method public static inline void forEach(android.util.SparseBooleanArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Boolean,kotlin.Unit> action);
- method public static inline boolean getOrDefault(android.util.SparseBooleanArray, int key, boolean defaultValue);
- method public static inline boolean getOrElse(android.util.SparseBooleanArray, int key, kotlin.jvm.functions.Function0<java.lang.Boolean> defaultValue);
- method public static inline int getSize(android.util.SparseBooleanArray);
- method public static inline boolean isEmpty(android.util.SparseBooleanArray);
- method public static inline boolean isNotEmpty(android.util.SparseBooleanArray);
- method public static kotlin.collections.IntIterator keyIterator(android.util.SparseBooleanArray);
- method public static operator android.util.SparseBooleanArray plus(android.util.SparseBooleanArray, android.util.SparseBooleanArray other);
- method public static void putAll(android.util.SparseBooleanArray, android.util.SparseBooleanArray other);
- method public static boolean remove(android.util.SparseBooleanArray, int key, boolean value);
- method public static inline operator void set(android.util.SparseBooleanArray, int key, boolean value);
- method public static kotlin.collections.BooleanIterator valueIterator(android.util.SparseBooleanArray);
- }
-
- public final class SparseIntArrayKt {
- ctor public SparseIntArrayKt();
- method public static inline operator boolean contains(android.util.SparseIntArray, int key);
- method public static inline boolean containsKey(android.util.SparseIntArray, int key);
- method public static inline boolean containsValue(android.util.SparseIntArray, int value);
- method public static inline void forEach(android.util.SparseIntArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
- method public static inline int getOrDefault(android.util.SparseIntArray, int key, int defaultValue);
- method public static inline int getOrElse(android.util.SparseIntArray, int key, kotlin.jvm.functions.Function0<java.lang.Integer> defaultValue);
- method public static inline int getSize(android.util.SparseIntArray);
- method public static inline boolean isEmpty(android.util.SparseIntArray);
- method public static inline boolean isNotEmpty(android.util.SparseIntArray);
- method public static kotlin.collections.IntIterator keyIterator(android.util.SparseIntArray);
- method public static operator android.util.SparseIntArray plus(android.util.SparseIntArray, android.util.SparseIntArray other);
- method public static void putAll(android.util.SparseIntArray, android.util.SparseIntArray other);
- method public static boolean remove(android.util.SparseIntArray, int key, int value);
- method public static inline operator void set(android.util.SparseIntArray, int key, int value);
- method public static kotlin.collections.IntIterator valueIterator(android.util.SparseIntArray);
- }
-
- public final class SparseLongArrayKt {
- ctor public SparseLongArrayKt();
- method @RequiresApi(18) public static inline operator boolean contains(android.util.SparseLongArray, int key);
- method @RequiresApi(18) public static inline boolean containsKey(android.util.SparseLongArray, int key);
- method @RequiresApi(18) public static inline boolean containsValue(android.util.SparseLongArray, long value);
- method @RequiresApi(18) public static inline void forEach(android.util.SparseLongArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Long,kotlin.Unit> action);
- method @RequiresApi(18) public static inline long getOrDefault(android.util.SparseLongArray, int key, long defaultValue);
- method @RequiresApi(18) public static inline long getOrElse(android.util.SparseLongArray, int key, kotlin.jvm.functions.Function0<java.lang.Long> defaultValue);
- method @RequiresApi(18) public static inline int getSize(android.util.SparseLongArray);
- method @RequiresApi(18) public static inline boolean isEmpty(android.util.SparseLongArray);
- method @RequiresApi(18) public static inline boolean isNotEmpty(android.util.SparseLongArray);
- method @RequiresApi(18) public static kotlin.collections.IntIterator keyIterator(android.util.SparseLongArray);
- method @RequiresApi(18) public static operator android.util.SparseLongArray plus(android.util.SparseLongArray, android.util.SparseLongArray other);
- method @RequiresApi(18) public static void putAll(android.util.SparseLongArray, android.util.SparseLongArray other);
- method @RequiresApi(18) public static boolean remove(android.util.SparseLongArray, int key, long value);
- method @RequiresApi(18) public static inline operator void set(android.util.SparseLongArray, int key, long value);
- method @RequiresApi(18) public static kotlin.collections.LongIterator valueIterator(android.util.SparseLongArray);
- }
-
-}
-
-package androidx.core.view {
-
- public final class MenuKt {
- ctor public MenuKt();
- method public static operator boolean contains(android.view.Menu, android.view.MenuItem item);
- method public static inline void forEach(android.view.Menu, kotlin.jvm.functions.Function1<? super android.view.MenuItem,kotlin.Unit> action);
- method public static inline void forEachIndexed(android.view.Menu, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super android.view.MenuItem,kotlin.Unit> action);
- method public static inline operator android.view.MenuItem get(android.view.Menu, int index);
- method public static kotlin.sequences.Sequence<android.view.MenuItem> getChildren(android.view.Menu);
- method public static inline int getSize(android.view.Menu);
- method public static inline boolean isEmpty(android.view.Menu);
- method public static inline boolean isNotEmpty(android.view.Menu);
- method public static operator java.util.Iterator<android.view.MenuItem> iterator(android.view.Menu);
- method public static inline operator void minusAssign(android.view.Menu, android.view.MenuItem item);
- }
-
- public final class ViewGroupKt {
- ctor public ViewGroupKt();
- method public static inline operator boolean contains(android.view.ViewGroup, android.view.View view);
- method public static inline void forEach(android.view.ViewGroup, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
- method public static inline void forEachIndexed(android.view.ViewGroup, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super android.view.View,kotlin.Unit> action);
- method public static operator android.view.View get(android.view.ViewGroup, int index);
- method public static kotlin.sequences.Sequence<android.view.View> getChildren(android.view.ViewGroup);
- method public static inline int getSize(android.view.ViewGroup);
- method public static inline boolean isEmpty(android.view.ViewGroup);
- method public static inline boolean isNotEmpty(android.view.ViewGroup);
- method public static operator java.util.Iterator<android.view.View> iterator(android.view.ViewGroup);
- method public static inline operator void minusAssign(android.view.ViewGroup, android.view.View view);
- method public static inline operator void plusAssign(android.view.ViewGroup, android.view.View view);
- method public static inline void setMargins(android.view.ViewGroup.MarginLayoutParams, @Px int size);
- method public static inline void updateMargins(android.view.ViewGroup.MarginLayoutParams, @Px int left = android.view.ViewGroup.MarginLayoutParams.leftMargin, @Px int top = android.view.ViewGroup.MarginLayoutParams.topMargin, @Px int right = android.view.ViewGroup.MarginLayoutParams.rightMargin, @Px int bottom = android.view.ViewGroup.MarginLayoutParams.bottomMargin);
- method @RequiresApi(17) public static inline void updateMarginsRelative(android.view.ViewGroup.MarginLayoutParams, @Px int start = marginStart, @Px int top = android.view.ViewGroup.MarginLayoutParams.topMargin, @Px int end = marginEnd, @Px int bottom = android.view.ViewGroup.MarginLayoutParams.bottomMargin);
- }
-
- public final class ViewKt {
- ctor public ViewKt();
- method public static inline void doOnLayout(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
- method public static inline void doOnNextLayout(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
- method public static inline androidx.core.view.OneShotPreDrawListener doOnPreDraw(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
- method public static android.graphics.Bitmap drawToBitmap(android.view.View, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888);
- method public static inline int getMarginBottom(android.view.View);
- method public static inline int getMarginEnd(android.view.View);
- method public static inline int getMarginLeft(android.view.View);
- method public static inline int getMarginRight(android.view.View);
- method public static inline int getMarginStart(android.view.View);
- method public static inline int getMarginTop(android.view.View);
- method public static inline boolean isGone(android.view.View);
- method public static inline boolean isInvisible(android.view.View);
- method public static inline boolean isVisible(android.view.View);
- method public static inline Runnable postDelayed(android.view.View, long delayInMillis, kotlin.jvm.functions.Function0<kotlin.Unit> action);
- method @RequiresApi(16) public static inline Runnable postOnAnimationDelayed(android.view.View, long delayInMillis, kotlin.jvm.functions.Function0<kotlin.Unit> action);
- method public static inline void setGone(android.view.View, boolean value);
- method public static inline void setInvisible(android.view.View, boolean value);
- method public static inline void setPadding(android.view.View, @Px int size);
- method public static inline void setVisible(android.view.View, boolean value);
- method public static inline void updateLayoutParams(android.view.View, kotlin.jvm.functions.Function1<? super android.view.ViewGroup.LayoutParams,kotlin.Unit> block);
- method public static inline <reified T extends android.view.ViewGroup.LayoutParams> void updateLayoutParamsTyped(android.view.View, kotlin.jvm.functions.Function1<? super T,kotlin.Unit>! block);
- method public static inline void updatePadding(android.view.View, @Px int left = paddingLeft, @Px int top = paddingTop, @Px int right = paddingRight, @Px int bottom = paddingBottom);
- method @RequiresApi(17) public static inline void updatePaddingRelative(android.view.View, @Px int start = paddingStart, @Px int top = paddingTop, @Px int end = paddingEnd, @Px int bottom = paddingBottom);
- }
-
-}
-
-package androidx.core.widget {
-
- public final class TextViewKt {
- ctor public TextViewKt();
- method public static inline android.text.TextWatcher addTextChangedListener(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> beforeTextChanged = { _, _, _, _ -> }, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> onTextChanged = { _, _, _, _ -> }, kotlin.jvm.functions.Function1<? super android.text.Editable,kotlin.Unit> afterTextChanged = {});
- method public static inline android.text.TextWatcher doAfterTextChanged(android.widget.TextView, kotlin.jvm.functions.Function1<? super android.text.Editable,kotlin.Unit> action);
- method public static inline android.text.TextWatcher doBeforeTextChanged(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
- method public static inline android.text.TextWatcher doOnTextChanged(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
- }
-
-}
-
diff --git a/core/ktx/api/current.txt b/core/ktx/api/current.txt
index 63739d2..6813932 100644
--- a/core/ktx/api/current.txt
+++ b/core/ktx/api/current.txt
@@ -1,16 +1,16 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.core.animation {
public final class AnimatorKt {
ctor public AnimatorKt();
- method public static inline android.animation.Animator.AnimatorListener addListener(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onRepeat = {});
- method @RequiresApi(19) public static inline android.animation.Animator.AnimatorPauseListener addPauseListener(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onPause = {});
- method public static inline android.animation.Animator.AnimatorListener doOnCancel(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method public static inline android.animation.Animator.AnimatorListener doOnEnd(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.animation.Animator.AnimatorPauseListener doOnPause(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method public static inline android.animation.Animator.AnimatorListener doOnRepeat(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.animation.Animator.AnimatorPauseListener doOnResume(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
- method public static inline android.animation.Animator.AnimatorListener doOnStart(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
+ method public static android.animation.Animator.AnimatorListener addListener(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onRepeat = {});
+ method @RequiresApi(19) public static android.animation.Animator.AnimatorPauseListener addPauseListener(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> onPause = {});
+ method public static android.animation.Animator.AnimatorListener doOnCancel(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
+ method public static android.animation.Animator.AnimatorListener doOnEnd(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.animation.Animator.AnimatorPauseListener doOnPause(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
+ method public static android.animation.Animator.AnimatorListener doOnRepeat(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.animation.Animator.AnimatorPauseListener doOnResume(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
+ method public static android.animation.Animator.AnimatorListener doOnStart(android.animation.Animator, kotlin.jvm.functions.Function1<? super android.animation.Animator,kotlin.Unit> action);
}
}
@@ -24,14 +24,13 @@
public final class ContextKt {
ctor public ContextKt();
- method public static inline <reified T> T! getSystemService(android.content.Context);
- method public static inline void withStyledAttributes(android.content.Context, android.util.AttributeSet? set = null, int[] attrs, @AttrRes int defStyleAttr = 0, @StyleRes int defStyleRes = 0, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,kotlin.Unit> block);
- method public static inline void withStyledAttributes(android.content.Context, @StyleRes int resourceId, int[] attrs, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,kotlin.Unit> block);
+ method public static void withStyledAttributes(android.content.Context, android.util.AttributeSet? set = null, int[] attrs, @AttrRes int defStyleAttr = 0, @StyleRes int defStyleRes = 0, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,kotlin.Unit> block);
+ method public static void withStyledAttributes(android.content.Context, @StyleRes int resourceId, int[] attrs, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,kotlin.Unit> block);
}
public final class SharedPreferencesKt {
ctor public SharedPreferencesKt();
- method public static inline void edit(android.content.SharedPreferences, boolean commit = false, kotlin.jvm.functions.Function1<? super android.content.SharedPreferences.Editor,kotlin.Unit> action);
+ method public static void edit(android.content.SharedPreferences, boolean commit = false, kotlin.jvm.functions.Function1<? super android.content.SharedPreferences.Editor,kotlin.Unit> action);
}
}
@@ -55,7 +54,7 @@
method public static String getStringOrThrow(android.content.res.TypedArray, @StyleableRes int index);
method public static CharSequence[] getTextArrayOrThrow(android.content.res.TypedArray, @StyleableRes int index);
method public static CharSequence getTextOrThrow(android.content.res.TypedArray, @StyleableRes int index);
- method public static inline <R> R! use(android.content.res.TypedArray, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,? extends R> block);
+ method public static <R> R! use(android.content.res.TypedArray, kotlin.jvm.functions.Function1<? super android.content.res.TypedArray,? extends R> block);
}
}
@@ -64,13 +63,13 @@
public final class CursorKt {
ctor public CursorKt();
- method public static inline byte[]? getBlobOrNull(android.database.Cursor, int index);
- method public static inline Double? getDoubleOrNull(android.database.Cursor, int index);
- method public static inline Float? getFloatOrNull(android.database.Cursor, int index);
- method public static inline Integer? getIntOrNull(android.database.Cursor, int index);
- method public static inline Long? getLongOrNull(android.database.Cursor, int index);
- method public static inline Short? getShortOrNull(android.database.Cursor, int index);
- method public static inline String? getStringOrNull(android.database.Cursor, int index);
+ method public static byte[]? getBlobOrNull(android.database.Cursor, int index);
+ method public static Double? getDoubleOrNull(android.database.Cursor, int index);
+ method public static Float? getFloatOrNull(android.database.Cursor, int index);
+ method public static Integer? getIntOrNull(android.database.Cursor, int index);
+ method public static Long? getLongOrNull(android.database.Cursor, int index);
+ method public static Short? getShortOrNull(android.database.Cursor, int index);
+ method public static String? getStringOrNull(android.database.Cursor, int index);
}
}
@@ -79,7 +78,7 @@
public final class SQLiteDatabaseKt {
ctor public SQLiteDatabaseKt();
- method public static inline <T> T! transaction(android.database.sqlite.SQLiteDatabase, boolean exclusive = true, kotlin.jvm.functions.Function1<? super android.database.sqlite.SQLiteDatabase,? extends T> body);
+ method public static <T> T! transaction(android.database.sqlite.SQLiteDatabase, boolean exclusive = true, kotlin.jvm.functions.Function1<? super android.database.sqlite.SQLiteDatabase,? extends T> body);
}
}
@@ -88,187 +87,187 @@
public final class BitmapKt {
ctor public BitmapKt();
- method public static inline android.graphics.Bitmap applyCanvas(android.graphics.Bitmap, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline operator boolean contains(android.graphics.Bitmap, android.graphics.Point p);
- method public static inline operator boolean contains(android.graphics.Bitmap, android.graphics.PointF p);
- method public static inline android.graphics.Bitmap createBitmap(int width, int height, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888);
- method @RequiresApi(26) public static inline android.graphics.Bitmap createBitmap(int width, int height, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888, boolean hasAlpha = true, android.graphics.ColorSpace colorSpace = ColorSpace.get(ColorSpace.Named.SRGB));
- method public static inline operator int get(android.graphics.Bitmap, int x, int y);
- method public static inline android.graphics.Bitmap scale(android.graphics.Bitmap, int width, int height, boolean filter = true);
- method public static inline operator void set(android.graphics.Bitmap, int x, int y, @ColorInt int color);
+ method public static android.graphics.Bitmap applyCanvas(android.graphics.Bitmap, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static operator boolean contains(android.graphics.Bitmap, android.graphics.Point p);
+ method public static operator boolean contains(android.graphics.Bitmap, android.graphics.PointF p);
+ method public static android.graphics.Bitmap createBitmap(int width, int height, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888);
+ method @RequiresApi(26) public static android.graphics.Bitmap createBitmap(int width, int height, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888, boolean hasAlpha = true, android.graphics.ColorSpace colorSpace = ColorSpace.get(ColorSpace.Named.SRGB));
+ method public static operator int get(android.graphics.Bitmap, int x, int y);
+ method public static android.graphics.Bitmap scale(android.graphics.Bitmap, int width, int height, boolean filter = true);
+ method public static operator void set(android.graphics.Bitmap, int x, int y, @ColorInt int color);
}
public final class CanvasKt {
ctor public CanvasKt();
- method public static inline void withClip(android.graphics.Canvas, android.graphics.Rect clipRect, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withClip(android.graphics.Canvas, android.graphics.RectF clipRect, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withClip(android.graphics.Canvas, int left, int top, int right, int bottom, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withClip(android.graphics.Canvas, float left, float top, float right, float bottom, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withClip(android.graphics.Canvas, android.graphics.Path clipPath, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withMatrix(android.graphics.Canvas, android.graphics.Matrix matrix = android.graphics.Matrix(), kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withRotation(android.graphics.Canvas, float degrees = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withSave(android.graphics.Canvas, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withScale(android.graphics.Canvas, float x = 1.0f, float y = 1.0f, float pivotX = 0.0f, float pivotY = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withSkew(android.graphics.Canvas, float x = 0.0f, float y = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
- method public static inline void withTranslation(android.graphics.Canvas, float x = 0.0f, float y = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withClip(android.graphics.Canvas, android.graphics.Rect clipRect, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withClip(android.graphics.Canvas, android.graphics.RectF clipRect, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withClip(android.graphics.Canvas, int left, int top, int right, int bottom, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withClip(android.graphics.Canvas, float left, float top, float right, float bottom, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withClip(android.graphics.Canvas, android.graphics.Path clipPath, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withMatrix(android.graphics.Canvas, android.graphics.Matrix matrix = android.graphics.Matrix(), kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withRotation(android.graphics.Canvas, float degrees = 0.0f, float pivotX = 0.0f, float pivotY = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withSave(android.graphics.Canvas, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withScale(android.graphics.Canvas, float x = 1.0f, float y = 1.0f, float pivotX = 0.0f, float pivotY = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withSkew(android.graphics.Canvas, float x = 0.0f, float y = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static void withTranslation(android.graphics.Canvas, float x = 0.0f, float y = 0.0f, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
}
public final class ColorKt {
ctor public ColorKt();
- method @RequiresApi(26) public static inline operator float component1(android.graphics.Color);
- method public static inline operator int component1(int);
- method @RequiresApi(26) public static inline operator float component1(long);
- method @RequiresApi(26) public static inline operator float component2(android.graphics.Color);
- method public static inline operator int component2(int);
- method @RequiresApi(26) public static inline operator float component2(long);
- method @RequiresApi(26) public static inline operator float component3(android.graphics.Color);
- method public static inline operator int component3(int);
- method @RequiresApi(26) public static inline operator float component3(long);
- method @RequiresApi(26) public static inline operator float component4(android.graphics.Color);
- method public static inline operator int component4(int);
- method @RequiresApi(26) public static inline operator float component4(long);
- method @ColorLong @RequiresApi(26) public static inline infix long convertTo(int, android.graphics.ColorSpace.Named colorSpace);
- method @ColorLong @RequiresApi(26) public static inline infix long convertTo(int, android.graphics.ColorSpace colorSpace);
- method @ColorLong @RequiresApi(26) public static inline infix long convertTo(long, android.graphics.ColorSpace.Named colorSpace);
- method @ColorLong @RequiresApi(26) public static inline infix long convertTo(long, android.graphics.ColorSpace colorSpace);
- method @RequiresApi(26) public static inline infix android.graphics.Color! convertTo(android.graphics.Color, android.graphics.ColorSpace.Named colorSpace);
- method @RequiresApi(26) public static inline infix android.graphics.Color! convertTo(android.graphics.Color, android.graphics.ColorSpace colorSpace);
- method public static inline int getAlpha(int);
- method @RequiresApi(26) public static inline float getAlpha(long);
- method public static inline int getBlue(int);
- method @RequiresApi(26) public static inline float getBlue(long);
- method @RequiresApi(26) public static inline android.graphics.ColorSpace getColorSpace(long);
- method public static inline int getGreen(int);
- method @RequiresApi(26) public static inline float getGreen(long);
- method @RequiresApi(26) public static inline float getLuminance(int);
- method @RequiresApi(26) public static inline float getLuminance(long);
- method public static inline int getRed(int);
- method @RequiresApi(26) public static inline float getRed(long);
- method @RequiresApi(26) public static inline boolean isSrgb(long);
- method @RequiresApi(26) public static inline boolean isWideGamut(long);
+ method @RequiresApi(26) public static operator float component1(android.graphics.Color);
+ method public static operator int component1(int);
+ method @RequiresApi(26) public static operator float component1(long);
+ method @RequiresApi(26) public static operator float component2(android.graphics.Color);
+ method public static operator int component2(int);
+ method @RequiresApi(26) public static operator float component2(long);
+ method @RequiresApi(26) public static operator float component3(android.graphics.Color);
+ method public static operator int component3(int);
+ method @RequiresApi(26) public static operator float component3(long);
+ method @RequiresApi(26) public static operator float component4(android.graphics.Color);
+ method public static operator int component4(int);
+ method @RequiresApi(26) public static operator float component4(long);
+ method @RequiresApi(26) @ColorLong public static infix long convertTo(int, android.graphics.ColorSpace.Named colorSpace);
+ method @RequiresApi(26) @ColorLong public static infix long convertTo(int, android.graphics.ColorSpace colorSpace);
+ method @RequiresApi(26) @ColorLong public static infix long convertTo(long, android.graphics.ColorSpace.Named colorSpace);
+ method @RequiresApi(26) @ColorLong public static infix long convertTo(long, android.graphics.ColorSpace colorSpace);
+ method @RequiresApi(26) public static infix android.graphics.Color! convertTo(android.graphics.Color, android.graphics.ColorSpace.Named colorSpace);
+ method @RequiresApi(26) public static infix android.graphics.Color! convertTo(android.graphics.Color, android.graphics.ColorSpace colorSpace);
+ method public static int getAlpha(int);
+ method @RequiresApi(26) public static float getAlpha(long);
+ method public static int getBlue(int);
+ method @RequiresApi(26) public static float getBlue(long);
+ method @RequiresApi(26) public static android.graphics.ColorSpace getColorSpace(long);
+ method public static int getGreen(int);
+ method @RequiresApi(26) public static float getGreen(long);
+ method @RequiresApi(26) public static float getLuminance(int);
+ method @RequiresApi(26) public static float getLuminance(long);
+ method public static int getRed(int);
+ method @RequiresApi(26) public static float getRed(long);
+ method @RequiresApi(26) public static boolean isSrgb(long);
+ method @RequiresApi(26) public static boolean isWideGamut(long);
method @RequiresApi(26) public static operator android.graphics.Color plus(android.graphics.Color, android.graphics.Color c);
- method @RequiresApi(26) public static inline android.graphics.Color toColor(int);
- method @RequiresApi(26) public static inline android.graphics.Color toColor(long);
- method @ColorInt @RequiresApi(26) public static inline int toColorInt(long);
- method @ColorInt public static inline int toColorInt(String);
- method @ColorLong @RequiresApi(26) public static inline long toColorLong(int);
+ method @RequiresApi(26) public static android.graphics.Color toColor(int);
+ method @RequiresApi(26) public static android.graphics.Color toColor(long);
+ method @RequiresApi(26) @ColorInt public static int toColorInt(long);
+ method @ColorInt public static int toColorInt(String);
+ method @RequiresApi(26) @ColorLong public static long toColorLong(int);
}
public final class ImageDecoderKt {
ctor public ImageDecoderKt();
- method @RequiresApi(28) public static inline android.graphics.Bitmap decodeBitmap(android.graphics.ImageDecoder.Source, kotlin.jvm.functions.Function3<? super android.graphics.ImageDecoder,? super android.graphics.ImageDecoder.ImageInfo,? super android.graphics.ImageDecoder.Source,kotlin.Unit> action);
- method @RequiresApi(28) public static inline android.graphics.drawable.Drawable decodeDrawable(android.graphics.ImageDecoder.Source, kotlin.jvm.functions.Function3<? super android.graphics.ImageDecoder,? super android.graphics.ImageDecoder.ImageInfo,? super android.graphics.ImageDecoder.Source,kotlin.Unit> action);
+ method @RequiresApi(28) public static android.graphics.Bitmap decodeBitmap(android.graphics.ImageDecoder.Source, kotlin.jvm.functions.Function3<? super android.graphics.ImageDecoder,? super android.graphics.ImageDecoder.ImageInfo,? super android.graphics.ImageDecoder.Source,kotlin.Unit> action);
+ method @RequiresApi(28) public static android.graphics.drawable.Drawable decodeDrawable(android.graphics.ImageDecoder.Source, kotlin.jvm.functions.Function3<? super android.graphics.ImageDecoder,? super android.graphics.ImageDecoder.ImageInfo,? super android.graphics.ImageDecoder.Source,kotlin.Unit> action);
}
public final class MatrixKt {
ctor public MatrixKt();
method public static android.graphics.Matrix rotationMatrix(float degrees, float px = 0.0f, float py = 0.0f);
method public static android.graphics.Matrix scaleMatrix(float sx = 1.0f, float sy = 1.0f);
- method public static inline operator android.graphics.Matrix times(android.graphics.Matrix, android.graphics.Matrix m);
+ method public static operator android.graphics.Matrix times(android.graphics.Matrix, android.graphics.Matrix m);
method public static android.graphics.Matrix translationMatrix(float tx = 0.0f, float ty = 0.0f);
- method public static inline float[] values(android.graphics.Matrix);
+ method public static float[] values(android.graphics.Matrix);
}
public final class PathKt {
ctor public PathKt();
- method @RequiresApi(19) public static inline infix android.graphics.Path and(android.graphics.Path, android.graphics.Path p);
+ method @RequiresApi(19) public static infix android.graphics.Path and(android.graphics.Path, android.graphics.Path p);
method @RequiresApi(26) public static Iterable<androidx.core.graphics.PathSegment> flatten(android.graphics.Path, float error = 0.5f);
- method @RequiresApi(19) public static inline operator android.graphics.Path minus(android.graphics.Path, android.graphics.Path p);
- method @RequiresApi(19) public static inline infix android.graphics.Path or(android.graphics.Path, android.graphics.Path p);
- method @RequiresApi(19) public static inline operator android.graphics.Path plus(android.graphics.Path, android.graphics.Path p);
- method @RequiresApi(19) public static inline infix android.graphics.Path xor(android.graphics.Path, android.graphics.Path p);
+ method @RequiresApi(19) public static operator android.graphics.Path minus(android.graphics.Path, android.graphics.Path p);
+ method @RequiresApi(19) public static infix android.graphics.Path or(android.graphics.Path, android.graphics.Path p);
+ method @RequiresApi(19) public static operator android.graphics.Path plus(android.graphics.Path, android.graphics.Path p);
+ method @RequiresApi(19) public static infix android.graphics.Path xor(android.graphics.Path, android.graphics.Path p);
}
public final class PictureKt {
ctor public PictureKt();
- method public static inline android.graphics.Picture record(android.graphics.Picture, int width, int height, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
+ method public static android.graphics.Picture record(android.graphics.Picture, int width, int height, kotlin.jvm.functions.Function1<? super android.graphics.Canvas,kotlin.Unit> block);
}
public final class PointKt {
ctor public PointKt();
- method public static inline operator int component1(android.graphics.Point);
- method public static inline operator float component1(android.graphics.PointF);
- method public static inline operator int component2(android.graphics.Point);
- method public static inline operator float component2(android.graphics.PointF);
- method public static inline operator android.graphics.Point minus(android.graphics.Point, android.graphics.Point p);
- method public static inline operator android.graphics.PointF minus(android.graphics.PointF, android.graphics.PointF p);
- method public static inline operator android.graphics.Point minus(android.graphics.Point, int xy);
- method public static inline operator android.graphics.PointF minus(android.graphics.PointF, float xy);
- method public static inline operator android.graphics.Point plus(android.graphics.Point, android.graphics.Point p);
- method public static inline operator android.graphics.PointF plus(android.graphics.PointF, android.graphics.PointF p);
- method public static inline operator android.graphics.Point plus(android.graphics.Point, int xy);
- method public static inline operator android.graphics.PointF plus(android.graphics.PointF, float xy);
- method public static inline android.graphics.Point toPoint(android.graphics.PointF);
- method public static inline android.graphics.PointF toPointF(android.graphics.Point);
- method public static inline operator android.graphics.Point unaryMinus(android.graphics.Point);
- method public static inline operator android.graphics.PointF unaryMinus(android.graphics.PointF);
+ method public static operator int component1(android.graphics.Point);
+ method public static operator float component1(android.graphics.PointF);
+ method public static operator int component2(android.graphics.Point);
+ method public static operator float component2(android.graphics.PointF);
+ method public static operator android.graphics.Point minus(android.graphics.Point, android.graphics.Point p);
+ method public static operator android.graphics.PointF minus(android.graphics.PointF, android.graphics.PointF p);
+ method public static operator android.graphics.Point minus(android.graphics.Point, int xy);
+ method public static operator android.graphics.PointF minus(android.graphics.PointF, float xy);
+ method public static operator android.graphics.Point plus(android.graphics.Point, android.graphics.Point p);
+ method public static operator android.graphics.PointF plus(android.graphics.PointF, android.graphics.PointF p);
+ method public static operator android.graphics.Point plus(android.graphics.Point, int xy);
+ method public static operator android.graphics.PointF plus(android.graphics.PointF, float xy);
+ method public static android.graphics.Point toPoint(android.graphics.PointF);
+ method public static android.graphics.PointF toPointF(android.graphics.Point);
+ method public static operator android.graphics.Point unaryMinus(android.graphics.Point);
+ method public static operator android.graphics.PointF unaryMinus(android.graphics.PointF);
}
public final class PorterDuffKt {
ctor public PorterDuffKt();
- method public static inline android.graphics.PorterDuffColorFilter toColorFilter(android.graphics.PorterDuff.Mode, int color);
- method public static inline android.graphics.PorterDuffXfermode toXfermode(android.graphics.PorterDuff.Mode);
+ method public static android.graphics.PorterDuffColorFilter toColorFilter(android.graphics.PorterDuff.Mode, int color);
+ method public static android.graphics.PorterDuffXfermode toXfermode(android.graphics.PorterDuff.Mode);
}
public final class RectKt {
ctor public RectKt();
- method public static inline infix android.graphics.Rect and(android.graphics.Rect, android.graphics.Rect r);
- method public static inline infix android.graphics.RectF and(android.graphics.RectF, android.graphics.RectF r);
- method public static inline operator int component1(android.graphics.Rect);
- method public static inline operator float component1(android.graphics.RectF);
- method public static inline operator int component2(android.graphics.Rect);
- method public static inline operator float component2(android.graphics.RectF);
- method public static inline operator int component3(android.graphics.Rect);
- method public static inline operator float component3(android.graphics.RectF);
- method public static inline operator int component4(android.graphics.Rect);
- method public static inline operator float component4(android.graphics.RectF);
- method public static inline operator boolean contains(android.graphics.Rect, android.graphics.Point p);
- method public static inline operator boolean contains(android.graphics.RectF, android.graphics.PointF p);
- method public static inline operator android.graphics.Region minus(android.graphics.Rect, android.graphics.Rect r);
- method public static inline operator android.graphics.Region minus(android.graphics.RectF, android.graphics.RectF r);
- method public static inline operator android.graphics.Rect minus(android.graphics.Rect, int xy);
- method public static inline operator android.graphics.RectF minus(android.graphics.RectF, float xy);
- method public static inline operator android.graphics.Rect minus(android.graphics.Rect, android.graphics.Point xy);
- method public static inline operator android.graphics.RectF minus(android.graphics.RectF, android.graphics.PointF xy);
- method public static inline infix android.graphics.Rect or(android.graphics.Rect, android.graphics.Rect r);
- method public static inline infix android.graphics.RectF or(android.graphics.RectF, android.graphics.RectF r);
- method public static inline operator android.graphics.Rect plus(android.graphics.Rect, android.graphics.Rect r);
- method public static inline operator android.graphics.RectF plus(android.graphics.RectF, android.graphics.RectF r);
- method public static inline operator android.graphics.Rect plus(android.graphics.Rect, int xy);
- method public static inline operator android.graphics.RectF plus(android.graphics.RectF, float xy);
- method public static inline operator android.graphics.Rect plus(android.graphics.Rect, android.graphics.Point xy);
- method public static inline operator android.graphics.RectF plus(android.graphics.RectF, android.graphics.PointF xy);
- method public static inline android.graphics.Rect toRect(android.graphics.RectF);
- method public static inline android.graphics.RectF toRectF(android.graphics.Rect);
- method public static inline android.graphics.Region toRegion(android.graphics.Rect);
- method public static inline android.graphics.Region toRegion(android.graphics.RectF);
- method public static inline android.graphics.RectF transform(android.graphics.RectF, android.graphics.Matrix m);
- method public static inline infix android.graphics.Region xor(android.graphics.Rect, android.graphics.Rect r);
- method public static inline infix android.graphics.Region xor(android.graphics.RectF, android.graphics.RectF r);
+ method public static infix android.graphics.Rect and(android.graphics.Rect, android.graphics.Rect r);
+ method public static infix android.graphics.RectF and(android.graphics.RectF, android.graphics.RectF r);
+ method public static operator int component1(android.graphics.Rect);
+ method public static operator float component1(android.graphics.RectF);
+ method public static operator int component2(android.graphics.Rect);
+ method public static operator float component2(android.graphics.RectF);
+ method public static operator int component3(android.graphics.Rect);
+ method public static operator float component3(android.graphics.RectF);
+ method public static operator int component4(android.graphics.Rect);
+ method public static operator float component4(android.graphics.RectF);
+ method public static operator boolean contains(android.graphics.Rect, android.graphics.Point p);
+ method public static operator boolean contains(android.graphics.RectF, android.graphics.PointF p);
+ method public static operator android.graphics.Region minus(android.graphics.Rect, android.graphics.Rect r);
+ method public static operator android.graphics.Region minus(android.graphics.RectF, android.graphics.RectF r);
+ method public static operator android.graphics.Rect minus(android.graphics.Rect, int xy);
+ method public static operator android.graphics.RectF minus(android.graphics.RectF, float xy);
+ method public static operator android.graphics.Rect minus(android.graphics.Rect, android.graphics.Point xy);
+ method public static operator android.graphics.RectF minus(android.graphics.RectF, android.graphics.PointF xy);
+ method public static infix android.graphics.Rect or(android.graphics.Rect, android.graphics.Rect r);
+ method public static infix android.graphics.RectF or(android.graphics.RectF, android.graphics.RectF r);
+ method public static operator android.graphics.Rect plus(android.graphics.Rect, android.graphics.Rect r);
+ method public static operator android.graphics.RectF plus(android.graphics.RectF, android.graphics.RectF r);
+ method public static operator android.graphics.Rect plus(android.graphics.Rect, int xy);
+ method public static operator android.graphics.RectF plus(android.graphics.RectF, float xy);
+ method public static operator android.graphics.Rect plus(android.graphics.Rect, android.graphics.Point xy);
+ method public static operator android.graphics.RectF plus(android.graphics.RectF, android.graphics.PointF xy);
+ method public static android.graphics.Rect toRect(android.graphics.RectF);
+ method public static android.graphics.RectF toRectF(android.graphics.Rect);
+ method public static android.graphics.Region toRegion(android.graphics.Rect);
+ method public static android.graphics.Region toRegion(android.graphics.RectF);
+ method public static android.graphics.RectF transform(android.graphics.RectF, android.graphics.Matrix m);
+ method public static infix android.graphics.Region xor(android.graphics.Rect, android.graphics.Rect r);
+ method public static infix android.graphics.Region xor(android.graphics.RectF, android.graphics.RectF r);
}
public final class RegionKt {
ctor public RegionKt();
- method public static inline infix android.graphics.Region and(android.graphics.Region, android.graphics.Rect r);
- method public static inline infix android.graphics.Region and(android.graphics.Region, android.graphics.Region r);
- method public static inline operator boolean contains(android.graphics.Region, android.graphics.Point p);
- method public static inline void forEach(android.graphics.Region, kotlin.jvm.functions.Function1<? super android.graphics.Rect,kotlin.Unit> action);
+ method public static infix android.graphics.Region and(android.graphics.Region, android.graphics.Rect r);
+ method public static infix android.graphics.Region and(android.graphics.Region, android.graphics.Region r);
+ method public static operator boolean contains(android.graphics.Region, android.graphics.Point p);
+ method public static void forEach(android.graphics.Region, kotlin.jvm.functions.Function1<? super android.graphics.Rect,kotlin.Unit> action);
method public static operator java.util.Iterator<android.graphics.Rect> iterator(android.graphics.Region);
- method public static inline operator android.graphics.Region minus(android.graphics.Region, android.graphics.Rect r);
- method public static inline operator android.graphics.Region minus(android.graphics.Region, android.graphics.Region r);
- method public static inline operator android.graphics.Region not(android.graphics.Region);
- method public static inline infix android.graphics.Region or(android.graphics.Region, android.graphics.Rect r);
- method public static inline infix android.graphics.Region or(android.graphics.Region, android.graphics.Region r);
- method public static inline operator android.graphics.Region plus(android.graphics.Region, android.graphics.Rect r);
- method public static inline operator android.graphics.Region plus(android.graphics.Region, android.graphics.Region r);
- method public static inline operator android.graphics.Region unaryMinus(android.graphics.Region);
- method public static inline infix android.graphics.Region xor(android.graphics.Region, android.graphics.Rect r);
- method public static inline infix android.graphics.Region xor(android.graphics.Region, android.graphics.Region r);
+ method public static operator android.graphics.Region minus(android.graphics.Region, android.graphics.Rect r);
+ method public static operator android.graphics.Region minus(android.graphics.Region, android.graphics.Region r);
+ method public static operator android.graphics.Region not(android.graphics.Region);
+ method public static infix android.graphics.Region or(android.graphics.Region, android.graphics.Rect r);
+ method public static infix android.graphics.Region or(android.graphics.Region, android.graphics.Region r);
+ method public static operator android.graphics.Region plus(android.graphics.Region, android.graphics.Rect r);
+ method public static operator android.graphics.Region plus(android.graphics.Region, android.graphics.Region r);
+ method public static operator android.graphics.Region unaryMinus(android.graphics.Region);
+ method public static infix android.graphics.Region xor(android.graphics.Region, android.graphics.Rect r);
+ method public static infix android.graphics.Region xor(android.graphics.Region, android.graphics.Region r);
}
public final class ShaderKt {
ctor public ShaderKt();
- method public static inline void transform(android.graphics.Shader, kotlin.jvm.functions.Function1<? super android.graphics.Matrix,kotlin.Unit> block);
+ method public static void transform(android.graphics.Shader, kotlin.jvm.functions.Function1<? super android.graphics.Matrix,kotlin.Unit> block);
}
}
@@ -277,13 +276,13 @@
public final class BitmapDrawableKt {
ctor public BitmapDrawableKt();
- method public static inline android.graphics.drawable.BitmapDrawable toDrawable(android.graphics.Bitmap, android.content.res.Resources resources);
+ method public static android.graphics.drawable.BitmapDrawable toDrawable(android.graphics.Bitmap, android.content.res.Resources resources);
}
public final class ColorDrawableKt {
ctor public ColorDrawableKt();
- method public static inline android.graphics.drawable.ColorDrawable toDrawable(int);
- method @RequiresApi(26) public static inline android.graphics.drawable.ColorDrawable toDrawable(android.graphics.Color);
+ method public static android.graphics.drawable.ColorDrawable toDrawable(int);
+ method @RequiresApi(26) public static android.graphics.drawable.ColorDrawable toDrawable(android.graphics.Color);
}
public final class DrawableKt {
@@ -294,10 +293,10 @@
public final class IconKt {
ctor public IconKt();
- method @RequiresApi(26) public static inline android.graphics.drawable.Icon toAdaptiveIcon(android.graphics.Bitmap);
- method @RequiresApi(26) public static inline android.graphics.drawable.Icon toIcon(android.graphics.Bitmap);
- method @RequiresApi(26) public static inline android.graphics.drawable.Icon toIcon(android.net.Uri);
- method @RequiresApi(26) public static inline android.graphics.drawable.Icon toIcon(byte[]);
+ method @RequiresApi(26) public static android.graphics.drawable.Icon toAdaptiveIcon(android.graphics.Bitmap);
+ method @RequiresApi(26) public static android.graphics.drawable.Icon toIcon(android.graphics.Bitmap);
+ method @RequiresApi(26) public static android.graphics.drawable.Icon toIcon(android.net.Uri);
+ method @RequiresApi(26) public static android.graphics.drawable.Icon toIcon(byte[]);
}
}
@@ -306,8 +305,8 @@
public final class LocationKt {
ctor public LocationKt();
- method public static inline operator double component1(android.location.Location);
- method public static inline operator double component2(android.location.Location);
+ method public static operator double component1(android.location.Location);
+ method public static operator double component2(android.location.Location);
}
}
@@ -317,8 +316,8 @@
public final class UriKt {
ctor public UriKt();
method public static java.io.File toFile(android.net.Uri);
- method public static inline android.net.Uri toUri(String);
- method public static inline android.net.Uri toUri(java.io.File);
+ method public static android.net.Uri toUri(String);
+ method public static android.net.Uri toUri(java.io.File);
}
}
@@ -332,8 +331,8 @@
public final class HandlerKt {
ctor public HandlerKt();
- method public static inline Runnable postAtTime(android.os.Handler, long uptimeMillis, Object? token = null, kotlin.jvm.functions.Function0<kotlin.Unit> action);
- method public static inline Runnable postDelayed(android.os.Handler, long delayInMillis, Object? token = null, kotlin.jvm.functions.Function0<kotlin.Unit> action);
+ method public static Runnable postAtTime(android.os.Handler, long uptimeMillis, Object? token = null, kotlin.jvm.functions.Function0<kotlin.Unit> action);
+ method public static Runnable postDelayed(android.os.Handler, long delayInMillis, Object? token = null, kotlin.jvm.functions.Function0<kotlin.Unit> action);
}
public final class PersistableBundleKt {
@@ -343,7 +342,7 @@
public final class TraceKt {
ctor public TraceKt();
- method public static inline <T> T! trace(String sectionName, kotlin.jvm.functions.Function0<? extends T> block);
+ method public static <T> T! trace(String sectionName, kotlin.jvm.functions.Function0<? extends T> block);
}
}
@@ -352,54 +351,53 @@
public final class CharSequenceKt {
ctor public CharSequenceKt();
- method public static inline boolean isDigitsOnly(CharSequence);
- method public static inline int trimmedLength(CharSequence);
+ method public static boolean isDigitsOnly(CharSequence);
+ method public static int trimmedLength(CharSequence);
}
public final class HtmlKt {
ctor public HtmlKt();
- method public static inline android.text.Spanned parseAsHtml(String, int flags = 0, android.text.Html.ImageGetter? imageGetter = null, android.text.Html.TagHandler? tagHandler = null);
- method public static inline String toHtml(android.text.Spanned, int option = 0);
+ method public static android.text.Spanned parseAsHtml(String, int flags = 0, android.text.Html.ImageGetter? imageGetter = null, android.text.Html.TagHandler? tagHandler = null);
+ method public static String toHtml(android.text.Spanned, int option = 0);
}
public final class LocaleKt {
ctor public LocaleKt();
- method @RequiresApi(17) public static inline int getLayoutDirection(java.util.Locale);
+ method @RequiresApi(17) public static int getLayoutDirection(java.util.Locale);
}
public final class SpannableStringBuilderKt {
ctor public SpannableStringBuilderKt();
- method public static inline android.text.SpannableStringBuilder backgroundColor(android.text.SpannableStringBuilder, @ColorInt int color, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder bold(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannedString buildSpannedString(kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder color(android.text.SpannableStringBuilder, @ColorInt int color, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder inSpans(android.text.SpannableStringBuilder, Object[] spans, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder inSpans(android.text.SpannableStringBuilder, Object span, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder italic(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder scale(android.text.SpannableStringBuilder, float proportion, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder strikeThrough(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder subscript(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder superscript(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
- method public static inline android.text.SpannableStringBuilder underline(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder backgroundColor(android.text.SpannableStringBuilder, @ColorInt int color, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder bold(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannedString buildSpannedString(kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder color(android.text.SpannableStringBuilder, @ColorInt int color, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder inSpans(android.text.SpannableStringBuilder, Object[] spans, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder inSpans(android.text.SpannableStringBuilder, Object span, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder italic(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder scale(android.text.SpannableStringBuilder, float proportion, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder strikeThrough(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder subscript(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder superscript(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
+ method public static android.text.SpannableStringBuilder underline(android.text.SpannableStringBuilder, kotlin.jvm.functions.Function1<? super android.text.SpannableStringBuilder,kotlin.Unit> builderAction);
}
public final class SpannableStringKt {
ctor public SpannableStringKt();
- method public static inline void clearSpans(android.text.Spannable);
- method public static inline operator void set(android.text.Spannable, int start, int end, Object span);
- method public static inline operator void set(android.text.Spannable, kotlin.ranges.IntRange range, Object span);
- method public static inline android.text.Spannable toSpannable(CharSequence);
+ method public static void clearSpans(android.text.Spannable);
+ method public static operator void set(android.text.Spannable, int start, int end, Object span);
+ method public static operator void set(android.text.Spannable, kotlin.ranges.IntRange range, Object span);
+ method public static android.text.Spannable toSpannable(CharSequence);
}
public final class SpannedStringKt {
ctor public SpannedStringKt();
- method public static inline <reified T> T[]! getSpans(android.text.Spanned, int start = 0, int end = length);
- method public static inline android.text.Spanned toSpanned(CharSequence);
+ method public static android.text.Spanned toSpanned(CharSequence);
}
public final class StringKt {
ctor public StringKt();
- method public static inline String htmlEncode(String);
+ method public static String htmlEncode(String);
}
}
@@ -408,12 +406,12 @@
public final class TransitionKt {
ctor public TransitionKt();
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener addListener(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onPause = {});
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnCancel(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnEnd(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnPause(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnResume(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
- method @RequiresApi(19) public static inline android.transition.Transition.TransitionListener doOnStart(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.transition.Transition.TransitionListener addListener(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onEnd = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onStart = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onCancel = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onResume = {}, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> onPause = {});
+ method @RequiresApi(19) public static android.transition.Transition.TransitionListener doOnCancel(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.transition.Transition.TransitionListener doOnEnd(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.transition.Transition.TransitionListener doOnPause(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.transition.Transition.TransitionListener doOnResume(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
+ method @RequiresApi(19) public static android.transition.Transition.TransitionListener doOnStart(android.transition.Transition, kotlin.jvm.functions.Function1<? super android.transition.Transition,kotlin.Unit> action);
}
}
@@ -422,144 +420,144 @@
public final class AtomicFileKt {
ctor public AtomicFileKt();
- method @RequiresApi(17) public static inline byte[] readBytes(android.util.AtomicFile);
+ method @RequiresApi(17) public static byte[] readBytes(android.util.AtomicFile);
method @RequiresApi(17) public static String readText(android.util.AtomicFile, java.nio.charset.Charset charset = Charsets.UTF_8);
- method @RequiresApi(17) public static inline void tryWrite(android.util.AtomicFile, kotlin.jvm.functions.Function1<? super java.io.FileOutputStream,kotlin.Unit> block);
+ method @RequiresApi(17) public static void tryWrite(android.util.AtomicFile, kotlin.jvm.functions.Function1<? super java.io.FileOutputStream,kotlin.Unit> block);
method @RequiresApi(17) public static void writeBytes(android.util.AtomicFile, byte[] array);
method @RequiresApi(17) public static void writeText(android.util.AtomicFile, String text, java.nio.charset.Charset charset = Charsets.UTF_8);
}
public final class HalfKt {
ctor public HalfKt();
- method @RequiresApi(26) public static inline android.util.Half toHalf(short);
- method @RequiresApi(26) public static inline android.util.Half toHalf(float);
- method @RequiresApi(26) public static inline android.util.Half toHalf(double);
- method @RequiresApi(26) public static inline android.util.Half toHalf(String);
+ method @RequiresApi(26) public static android.util.Half toHalf(short);
+ method @RequiresApi(26) public static android.util.Half toHalf(float);
+ method @RequiresApi(26) public static android.util.Half toHalf(double);
+ method @RequiresApi(26) public static android.util.Half toHalf(String);
}
public final class LongSparseArrayKt {
ctor public LongSparseArrayKt();
- method @RequiresApi(16) public static inline operator <T> boolean contains(android.util.LongSparseArray<T>, long key);
- method @RequiresApi(16) public static inline <T> boolean containsKey(android.util.LongSparseArray<T>, long key);
- method @RequiresApi(16) public static inline <T> boolean containsValue(android.util.LongSparseArray<T>, T! value);
- method @RequiresApi(16) public static inline <T> void forEach(android.util.LongSparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Long,? super T,kotlin.Unit> action);
- method @RequiresApi(16) public static inline <T> T! getOrDefault(android.util.LongSparseArray<T>, long key, T! defaultValue);
- method @RequiresApi(16) public static inline <T> T! getOrElse(android.util.LongSparseArray<T>, long key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
- method @RequiresApi(16) public static inline <T> int getSize(android.util.LongSparseArray<T>);
- method @RequiresApi(16) public static inline <T> boolean isEmpty(android.util.LongSparseArray<T>);
- method @RequiresApi(16) public static inline <T> boolean isNotEmpty(android.util.LongSparseArray<T>);
+ method @RequiresApi(16) public static operator <T> boolean contains(android.util.LongSparseArray<T>, long key);
+ method @RequiresApi(16) public static <T> boolean containsKey(android.util.LongSparseArray<T>, long key);
+ method @RequiresApi(16) public static <T> boolean containsValue(android.util.LongSparseArray<T>, T! value);
+ method @RequiresApi(16) public static <T> void forEach(android.util.LongSparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Long,? super T,kotlin.Unit> action);
+ method @RequiresApi(16) public static <T> T! getOrDefault(android.util.LongSparseArray<T>, long key, T! defaultValue);
+ method @RequiresApi(16) public static <T> T! getOrElse(android.util.LongSparseArray<T>, long key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
+ method @RequiresApi(16) public static <T> int getSize(android.util.LongSparseArray<T>);
+ method @RequiresApi(16) public static <T> boolean isEmpty(android.util.LongSparseArray<T>);
+ method @RequiresApi(16) public static <T> boolean isNotEmpty(android.util.LongSparseArray<T>);
method @RequiresApi(16) public static <T> kotlin.collections.LongIterator keyIterator(android.util.LongSparseArray<T>);
method @RequiresApi(16) public static operator <T> android.util.LongSparseArray<T> plus(android.util.LongSparseArray<T>, android.util.LongSparseArray<T> other);
method @RequiresApi(16) public static <T> void putAll(android.util.LongSparseArray<T>, android.util.LongSparseArray<T> other);
method @RequiresApi(16) public static <T> boolean remove(android.util.LongSparseArray<T>, long key, T! value);
- method @RequiresApi(16) public static inline operator <T> void set(android.util.LongSparseArray<T>, long key, T! value);
+ method @RequiresApi(16) public static operator <T> void set(android.util.LongSparseArray<T>, long key, T! value);
method @RequiresApi(16) public static <T> java.util.Iterator<T> valueIterator(android.util.LongSparseArray<T>);
}
public final class LruCacheKt {
ctor public LruCacheKt();
- method public static inline <K, V> android.util.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { (V)null }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
+ method public static <K, V> android.util.LruCache<K,V> lruCache(int maxSize, kotlin.jvm.functions.Function2<? super K,? super V,java.lang.Integer> sizeOf = { _, _ -> 1 }, kotlin.jvm.functions.Function1<? super K,? extends V> create = { (V)null }, kotlin.jvm.functions.Function4<? super java.lang.Boolean,? super K,? super V,? super V,kotlin.Unit> onEntryRemoved = { _, _, _, _ -> });
}
public final class PairKt {
ctor public PairKt();
- method public static inline operator <F, S> F! component1(android.util.Pair<F,S>);
- method public static inline operator <F, S> S! component2(android.util.Pair<F,S>);
- method public static inline <F, S> android.util.Pair<F,S> toAndroidPair(kotlin.Pair<? extends F,? extends S>);
- method public static inline <F, S> kotlin.Pair<F,S> toKotlinPair(android.util.Pair<F,S>);
+ method public static operator <F, S> F! component1(android.util.Pair<F,S>);
+ method public static operator <F, S> S! component2(android.util.Pair<F,S>);
+ method public static <F, S> android.util.Pair<F,S> toAndroidPair(kotlin.Pair<? extends F,? extends S>);
+ method public static <F, S> kotlin.Pair<F,S> toKotlinPair(android.util.Pair<F,S>);
}
public final class RangeKt {
ctor public RangeKt();
- method @RequiresApi(21) public static inline infix <T extends java.lang.Comparable<? super T>> android.util.Range<T> and(android.util.Range<T>, android.util.Range<T> other);
- method @RequiresApi(21) public static inline operator <T extends java.lang.Comparable<? super T>> android.util.Range<T> plus(android.util.Range<T>, T value);
- method @RequiresApi(21) public static inline operator <T extends java.lang.Comparable<? super T>> android.util.Range<T> plus(android.util.Range<T>, android.util.Range<T> other);
- method @RequiresApi(21) public static inline infix <T extends java.lang.Comparable<? super T>> android.util.Range<T> rangeTo(T, T that);
+ method @RequiresApi(21) public static infix <T extends java.lang.Comparable<? super T>> android.util.Range<T> and(android.util.Range<T>, android.util.Range<T> other);
+ method @RequiresApi(21) public static operator <T extends java.lang.Comparable<? super T>> android.util.Range<T> plus(android.util.Range<T>, T value);
+ method @RequiresApi(21) public static operator <T extends java.lang.Comparable<? super T>> android.util.Range<T> plus(android.util.Range<T>, android.util.Range<T> other);
+ method @RequiresApi(21) public static infix <T extends java.lang.Comparable<? super T>> android.util.Range<T> rangeTo(T, T that);
method @RequiresApi(21) public static <T extends java.lang.Comparable<? super T>> kotlin.ranges.ClosedRange<T> toClosedRange(android.util.Range<T>);
method @RequiresApi(21) public static <T extends java.lang.Comparable<? super T>> android.util.Range<T> toRange(kotlin.ranges.ClosedRange<T>);
}
public final class SizeKt {
ctor public SizeKt();
- method @RequiresApi(21) public static inline operator int component1(android.util.Size);
- method @RequiresApi(21) public static inline operator float component1(android.util.SizeF);
- method @RequiresApi(21) public static inline operator int component2(android.util.Size);
- method @RequiresApi(21) public static inline operator float component2(android.util.SizeF);
+ method @RequiresApi(21) public static operator int component1(android.util.Size);
+ method @RequiresApi(21) public static operator float component1(android.util.SizeF);
+ method @RequiresApi(21) public static operator int component2(android.util.Size);
+ method @RequiresApi(21) public static operator float component2(android.util.SizeF);
}
public final class SparseArrayKt {
ctor public SparseArrayKt();
- method public static inline operator <T> boolean contains(android.util.SparseArray<T>, int key);
- method public static inline <T> boolean containsKey(android.util.SparseArray<T>, int key);
- method public static inline <T> boolean containsValue(android.util.SparseArray<T>, T! value);
- method public static inline <T> void forEach(android.util.SparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action);
- method public static inline <T> T! getOrDefault(android.util.SparseArray<T>, int key, T! defaultValue);
- method public static inline <T> T! getOrElse(android.util.SparseArray<T>, int key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
- method public static inline <T> int getSize(android.util.SparseArray<T>);
- method public static inline <T> boolean isEmpty(android.util.SparseArray<T>);
- method public static inline <T> boolean isNotEmpty(android.util.SparseArray<T>);
+ method public static operator <T> boolean contains(android.util.SparseArray<T>, int key);
+ method public static <T> boolean containsKey(android.util.SparseArray<T>, int key);
+ method public static <T> boolean containsValue(android.util.SparseArray<T>, T! value);
+ method public static <T> void forEach(android.util.SparseArray<T>, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super T,kotlin.Unit> action);
+ method public static <T> T! getOrDefault(android.util.SparseArray<T>, int key, T! defaultValue);
+ method public static <T> T! getOrElse(android.util.SparseArray<T>, int key, kotlin.jvm.functions.Function0<? extends T> defaultValue);
+ method public static <T> int getSize(android.util.SparseArray<T>);
+ method public static <T> boolean isEmpty(android.util.SparseArray<T>);
+ method public static <T> boolean isNotEmpty(android.util.SparseArray<T>);
method public static <T> kotlin.collections.IntIterator keyIterator(android.util.SparseArray<T>);
method public static operator <T> android.util.SparseArray<T> plus(android.util.SparseArray<T>, android.util.SparseArray<T> other);
method public static <T> void putAll(android.util.SparseArray<T>, android.util.SparseArray<T> other);
method public static <T> boolean remove(android.util.SparseArray<T>, int key, T! value);
- method public static inline operator <T> void set(android.util.SparseArray<T>, int key, T! value);
+ method public static operator <T> void set(android.util.SparseArray<T>, int key, T! value);
method public static <T> java.util.Iterator<T> valueIterator(android.util.SparseArray<T>);
}
public final class SparseBooleanArrayKt {
ctor public SparseBooleanArrayKt();
- method public static inline operator boolean contains(android.util.SparseBooleanArray, int key);
- method public static inline boolean containsKey(android.util.SparseBooleanArray, int key);
- method public static inline boolean containsValue(android.util.SparseBooleanArray, boolean value);
- method public static inline void forEach(android.util.SparseBooleanArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Boolean,kotlin.Unit> action);
- method public static inline boolean getOrDefault(android.util.SparseBooleanArray, int key, boolean defaultValue);
- method public static inline boolean getOrElse(android.util.SparseBooleanArray, int key, kotlin.jvm.functions.Function0<java.lang.Boolean> defaultValue);
- method public static inline int getSize(android.util.SparseBooleanArray);
- method public static inline boolean isEmpty(android.util.SparseBooleanArray);
- method public static inline boolean isNotEmpty(android.util.SparseBooleanArray);
+ method public static operator boolean contains(android.util.SparseBooleanArray, int key);
+ method public static boolean containsKey(android.util.SparseBooleanArray, int key);
+ method public static boolean containsValue(android.util.SparseBooleanArray, boolean value);
+ method public static void forEach(android.util.SparseBooleanArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Boolean,kotlin.Unit> action);
+ method public static boolean getOrDefault(android.util.SparseBooleanArray, int key, boolean defaultValue);
+ method public static boolean getOrElse(android.util.SparseBooleanArray, int key, kotlin.jvm.functions.Function0<java.lang.Boolean> defaultValue);
+ method public static int getSize(android.util.SparseBooleanArray);
+ method public static boolean isEmpty(android.util.SparseBooleanArray);
+ method public static boolean isNotEmpty(android.util.SparseBooleanArray);
method public static kotlin.collections.IntIterator keyIterator(android.util.SparseBooleanArray);
method public static operator android.util.SparseBooleanArray plus(android.util.SparseBooleanArray, android.util.SparseBooleanArray other);
method public static void putAll(android.util.SparseBooleanArray, android.util.SparseBooleanArray other);
method public static boolean remove(android.util.SparseBooleanArray, int key, boolean value);
- method public static inline operator void set(android.util.SparseBooleanArray, int key, boolean value);
+ method public static operator void set(android.util.SparseBooleanArray, int key, boolean value);
method public static kotlin.collections.BooleanIterator valueIterator(android.util.SparseBooleanArray);
}
public final class SparseIntArrayKt {
ctor public SparseIntArrayKt();
- method public static inline operator boolean contains(android.util.SparseIntArray, int key);
- method public static inline boolean containsKey(android.util.SparseIntArray, int key);
- method public static inline boolean containsValue(android.util.SparseIntArray, int value);
- method public static inline void forEach(android.util.SparseIntArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
- method public static inline int getOrDefault(android.util.SparseIntArray, int key, int defaultValue);
- method public static inline int getOrElse(android.util.SparseIntArray, int key, kotlin.jvm.functions.Function0<java.lang.Integer> defaultValue);
- method public static inline int getSize(android.util.SparseIntArray);
- method public static inline boolean isEmpty(android.util.SparseIntArray);
- method public static inline boolean isNotEmpty(android.util.SparseIntArray);
+ method public static operator boolean contains(android.util.SparseIntArray, int key);
+ method public static boolean containsKey(android.util.SparseIntArray, int key);
+ method public static boolean containsValue(android.util.SparseIntArray, int value);
+ method public static void forEach(android.util.SparseIntArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
+ method public static int getOrDefault(android.util.SparseIntArray, int key, int defaultValue);
+ method public static int getOrElse(android.util.SparseIntArray, int key, kotlin.jvm.functions.Function0<java.lang.Integer> defaultValue);
+ method public static int getSize(android.util.SparseIntArray);
+ method public static boolean isEmpty(android.util.SparseIntArray);
+ method public static boolean isNotEmpty(android.util.SparseIntArray);
method public static kotlin.collections.IntIterator keyIterator(android.util.SparseIntArray);
method public static operator android.util.SparseIntArray plus(android.util.SparseIntArray, android.util.SparseIntArray other);
method public static void putAll(android.util.SparseIntArray, android.util.SparseIntArray other);
method public static boolean remove(android.util.SparseIntArray, int key, int value);
- method public static inline operator void set(android.util.SparseIntArray, int key, int value);
+ method public static operator void set(android.util.SparseIntArray, int key, int value);
method public static kotlin.collections.IntIterator valueIterator(android.util.SparseIntArray);
}
public final class SparseLongArrayKt {
ctor public SparseLongArrayKt();
- method @RequiresApi(18) public static inline operator boolean contains(android.util.SparseLongArray, int key);
- method @RequiresApi(18) public static inline boolean containsKey(android.util.SparseLongArray, int key);
- method @RequiresApi(18) public static inline boolean containsValue(android.util.SparseLongArray, long value);
- method @RequiresApi(18) public static inline void forEach(android.util.SparseLongArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Long,kotlin.Unit> action);
- method @RequiresApi(18) public static inline long getOrDefault(android.util.SparseLongArray, int key, long defaultValue);
- method @RequiresApi(18) public static inline long getOrElse(android.util.SparseLongArray, int key, kotlin.jvm.functions.Function0<java.lang.Long> defaultValue);
- method @RequiresApi(18) public static inline int getSize(android.util.SparseLongArray);
- method @RequiresApi(18) public static inline boolean isEmpty(android.util.SparseLongArray);
- method @RequiresApi(18) public static inline boolean isNotEmpty(android.util.SparseLongArray);
+ method @RequiresApi(18) public static operator boolean contains(android.util.SparseLongArray, int key);
+ method @RequiresApi(18) public static boolean containsKey(android.util.SparseLongArray, int key);
+ method @RequiresApi(18) public static boolean containsValue(android.util.SparseLongArray, long value);
+ method @RequiresApi(18) public static void forEach(android.util.SparseLongArray, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super java.lang.Long,kotlin.Unit> action);
+ method @RequiresApi(18) public static long getOrDefault(android.util.SparseLongArray, int key, long defaultValue);
+ method @RequiresApi(18) public static long getOrElse(android.util.SparseLongArray, int key, kotlin.jvm.functions.Function0<java.lang.Long> defaultValue);
+ method @RequiresApi(18) public static int getSize(android.util.SparseLongArray);
+ method @RequiresApi(18) public static boolean isEmpty(android.util.SparseLongArray);
+ method @RequiresApi(18) public static boolean isNotEmpty(android.util.SparseLongArray);
method @RequiresApi(18) public static kotlin.collections.IntIterator keyIterator(android.util.SparseLongArray);
method @RequiresApi(18) public static operator android.util.SparseLongArray plus(android.util.SparseLongArray, android.util.SparseLongArray other);
method @RequiresApi(18) public static void putAll(android.util.SparseLongArray, android.util.SparseLongArray other);
method @RequiresApi(18) public static boolean remove(android.util.SparseLongArray, int key, long value);
- method @RequiresApi(18) public static inline operator void set(android.util.SparseLongArray, int key, long value);
+ method @RequiresApi(18) public static operator void set(android.util.SparseLongArray, int key, long value);
method @RequiresApi(18) public static kotlin.collections.LongIterator valueIterator(android.util.SparseLongArray);
}
@@ -570,60 +568,59 @@
public final class MenuKt {
ctor public MenuKt();
method public static operator boolean contains(android.view.Menu, android.view.MenuItem item);
- method public static inline void forEach(android.view.Menu, kotlin.jvm.functions.Function1<? super android.view.MenuItem,kotlin.Unit> action);
- method public static inline void forEachIndexed(android.view.Menu, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super android.view.MenuItem,kotlin.Unit> action);
- method public static inline operator android.view.MenuItem get(android.view.Menu, int index);
+ method public static void forEach(android.view.Menu, kotlin.jvm.functions.Function1<? super android.view.MenuItem,kotlin.Unit> action);
+ method public static void forEachIndexed(android.view.Menu, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super android.view.MenuItem,kotlin.Unit> action);
+ method public static operator android.view.MenuItem get(android.view.Menu, int index);
method public static kotlin.sequences.Sequence<android.view.MenuItem> getChildren(android.view.Menu);
- method public static inline int getSize(android.view.Menu);
- method public static inline boolean isEmpty(android.view.Menu);
- method public static inline boolean isNotEmpty(android.view.Menu);
+ method public static int getSize(android.view.Menu);
+ method public static boolean isEmpty(android.view.Menu);
+ method public static boolean isNotEmpty(android.view.Menu);
method public static operator java.util.Iterator<android.view.MenuItem> iterator(android.view.Menu);
- method public static inline operator void minusAssign(android.view.Menu, android.view.MenuItem item);
+ method public static operator void minusAssign(android.view.Menu, android.view.MenuItem item);
}
public final class ViewGroupKt {
ctor public ViewGroupKt();
- method public static inline operator boolean contains(android.view.ViewGroup, android.view.View view);
- method public static inline void forEach(android.view.ViewGroup, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
- method public static inline void forEachIndexed(android.view.ViewGroup, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super android.view.View,kotlin.Unit> action);
+ method public static operator boolean contains(android.view.ViewGroup, android.view.View view);
+ method public static void forEach(android.view.ViewGroup, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
+ method public static void forEachIndexed(android.view.ViewGroup, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super android.view.View,kotlin.Unit> action);
method public static operator android.view.View get(android.view.ViewGroup, int index);
method public static kotlin.sequences.Sequence<android.view.View> getChildren(android.view.ViewGroup);
- method public static inline int getSize(android.view.ViewGroup);
- method public static inline boolean isEmpty(android.view.ViewGroup);
- method public static inline boolean isNotEmpty(android.view.ViewGroup);
+ method public static int getSize(android.view.ViewGroup);
+ method public static boolean isEmpty(android.view.ViewGroup);
+ method public static boolean isNotEmpty(android.view.ViewGroup);
method public static operator java.util.Iterator<android.view.View> iterator(android.view.ViewGroup);
- method public static inline operator void minusAssign(android.view.ViewGroup, android.view.View view);
- method public static inline operator void plusAssign(android.view.ViewGroup, android.view.View view);
- method public static inline void setMargins(android.view.ViewGroup.MarginLayoutParams, @Px int size);
- method public static inline void updateMargins(android.view.ViewGroup.MarginLayoutParams, @Px int left = android.view.ViewGroup.MarginLayoutParams.leftMargin, @Px int top = android.view.ViewGroup.MarginLayoutParams.topMargin, @Px int right = android.view.ViewGroup.MarginLayoutParams.rightMargin, @Px int bottom = android.view.ViewGroup.MarginLayoutParams.bottomMargin);
- method @RequiresApi(17) public static inline void updateMarginsRelative(android.view.ViewGroup.MarginLayoutParams, @Px int start = marginStart, @Px int top = android.view.ViewGroup.MarginLayoutParams.topMargin, @Px int end = marginEnd, @Px int bottom = android.view.ViewGroup.MarginLayoutParams.bottomMargin);
+ method public static operator void minusAssign(android.view.ViewGroup, android.view.View view);
+ method public static operator void plusAssign(android.view.ViewGroup, android.view.View view);
+ method public static void setMargins(android.view.ViewGroup.MarginLayoutParams, @Px int size);
+ method public static void updateMargins(android.view.ViewGroup.MarginLayoutParams, @Px int left = android.view.ViewGroup.MarginLayoutParams.leftMargin, @Px int top = android.view.ViewGroup.MarginLayoutParams.topMargin, @Px int right = android.view.ViewGroup.MarginLayoutParams.rightMargin, @Px int bottom = android.view.ViewGroup.MarginLayoutParams.bottomMargin);
+ method @RequiresApi(17) public static void updateMarginsRelative(android.view.ViewGroup.MarginLayoutParams, @Px int start = marginStart, @Px int top = android.view.ViewGroup.MarginLayoutParams.topMargin, @Px int end = marginEnd, @Px int bottom = android.view.ViewGroup.MarginLayoutParams.bottomMargin);
}
public final class ViewKt {
ctor public ViewKt();
- method public static inline void doOnLayout(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
- method public static inline void doOnNextLayout(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
- method public static inline androidx.core.view.OneShotPreDrawListener doOnPreDraw(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
+ method public static void doOnLayout(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
+ method public static void doOnNextLayout(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
+ method public static androidx.core.view.OneShotPreDrawListener doOnPreDraw(android.view.View, kotlin.jvm.functions.Function1<? super android.view.View,kotlin.Unit> action);
method public static android.graphics.Bitmap drawToBitmap(android.view.View, android.graphics.Bitmap.Config config = android.graphics.Bitmap.Config.ARGB_8888);
- method public static inline int getMarginBottom(android.view.View);
- method public static inline int getMarginEnd(android.view.View);
- method public static inline int getMarginLeft(android.view.View);
- method public static inline int getMarginRight(android.view.View);
- method public static inline int getMarginStart(android.view.View);
- method public static inline int getMarginTop(android.view.View);
- method public static inline boolean isGone(android.view.View);
- method public static inline boolean isInvisible(android.view.View);
- method public static inline boolean isVisible(android.view.View);
- method public static inline Runnable postDelayed(android.view.View, long delayInMillis, kotlin.jvm.functions.Function0<kotlin.Unit> action);
- method @RequiresApi(16) public static inline Runnable postOnAnimationDelayed(android.view.View, long delayInMillis, kotlin.jvm.functions.Function0<kotlin.Unit> action);
- method public static inline void setGone(android.view.View, boolean value);
- method public static inline void setInvisible(android.view.View, boolean value);
- method public static inline void setPadding(android.view.View, @Px int size);
- method public static inline void setVisible(android.view.View, boolean value);
- method public static inline void updateLayoutParams(android.view.View, kotlin.jvm.functions.Function1<? super android.view.ViewGroup.LayoutParams,kotlin.Unit> block);
- method public static inline <reified T extends android.view.ViewGroup.LayoutParams> void updateLayoutParamsTyped(android.view.View, kotlin.jvm.functions.Function1<? super T,kotlin.Unit>! block);
- method public static inline void updatePadding(android.view.View, @Px int left = paddingLeft, @Px int top = paddingTop, @Px int right = paddingRight, @Px int bottom = paddingBottom);
- method @RequiresApi(17) public static inline void updatePaddingRelative(android.view.View, @Px int start = paddingStart, @Px int top = paddingTop, @Px int end = paddingEnd, @Px int bottom = paddingBottom);
+ method public static int getMarginBottom(android.view.View);
+ method public static int getMarginEnd(android.view.View);
+ method public static int getMarginLeft(android.view.View);
+ method public static int getMarginRight(android.view.View);
+ method public static int getMarginStart(android.view.View);
+ method public static int getMarginTop(android.view.View);
+ method public static boolean isGone(android.view.View);
+ method public static boolean isInvisible(android.view.View);
+ method public static boolean isVisible(android.view.View);
+ method public static Runnable postDelayed(android.view.View, long delayInMillis, kotlin.jvm.functions.Function0<kotlin.Unit> action);
+ method @RequiresApi(16) public static Runnable postOnAnimationDelayed(android.view.View, long delayInMillis, kotlin.jvm.functions.Function0<kotlin.Unit> action);
+ method public static void setGone(android.view.View, boolean value);
+ method public static void setInvisible(android.view.View, boolean value);
+ method public static void setPadding(android.view.View, @Px int size);
+ method public static void setVisible(android.view.View, boolean value);
+ method public static void updateLayoutParams(android.view.View, kotlin.jvm.functions.Function1<? super android.view.ViewGroup.LayoutParams,kotlin.Unit> block);
+ method public static void updatePadding(android.view.View, @Px int left = paddingLeft, @Px int top = paddingTop, @Px int right = paddingRight, @Px int bottom = paddingBottom);
+ method @RequiresApi(17) public static void updatePaddingRelative(android.view.View, @Px int start = paddingStart, @Px int top = paddingTop, @Px int end = paddingEnd, @Px int bottom = paddingBottom);
}
}
@@ -632,10 +629,10 @@
public final class TextViewKt {
ctor public TextViewKt();
- method public static inline android.text.TextWatcher addTextChangedListener(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> beforeTextChanged = { _, _, _, _ -> }, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> onTextChanged = { _, _, _, _ -> }, kotlin.jvm.functions.Function1<? super android.text.Editable,kotlin.Unit> afterTextChanged = {});
- method public static inline android.text.TextWatcher doAfterTextChanged(android.widget.TextView, kotlin.jvm.functions.Function1<? super android.text.Editable,kotlin.Unit> action);
- method public static inline android.text.TextWatcher doBeforeTextChanged(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
- method public static inline android.text.TextWatcher doOnTextChanged(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
+ method public static android.text.TextWatcher addTextChangedListener(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> beforeTextChanged = { _, _, _, _ -> }, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> onTextChanged = { _, _, _, _ -> }, kotlin.jvm.functions.Function1<? super android.text.Editable,kotlin.Unit> afterTextChanged = {});
+ method public static android.text.TextWatcher doAfterTextChanged(android.widget.TextView, kotlin.jvm.functions.Function1<? super android.text.Editable,kotlin.Unit> action);
+ method public static android.text.TextWatcher doBeforeTextChanged(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
+ method public static android.text.TextWatcher doOnTextChanged(android.widget.TextView, kotlin.jvm.functions.Function4<? super java.lang.CharSequence,? super java.lang.Integer,? super java.lang.Integer,? super java.lang.Integer,kotlin.Unit> action);
}
}
diff --git a/core/ktx/api/res-1.1.0-alpha05.txt b/core/ktx/api/res-1.1.0-alpha05.txt
deleted file mode 100644
index e69de29..0000000
--- a/core/ktx/api/res-1.1.0-alpha05.txt
+++ /dev/null
diff --git a/core/ktx/api/restricted_1.0.0.txt b/core/ktx/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/core/ktx/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/core/ktx/api/restricted_1.1.0-alpha05.txt b/core/ktx/api/restricted_1.1.0-alpha05.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/core/ktx/api/restricted_1.1.0-alpha05.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/core/ktx/api/restricted_current.txt b/core/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/core/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/core/ktx/src/androidTest/java/androidx/core/content/ContextTest.kt b/core/ktx/src/androidTest/java/androidx/core/content/ContextTest.kt
index d733203..0fb2adf 100644
--- a/core/ktx/src/androidTest/java/androidx/core/content/ContextTest.kt
+++ b/core/ktx/src/androidTest/java/androidx/core/content/ContextTest.kt
@@ -21,13 +21,11 @@
import androidx.core.getAttributeSet
import androidx.test.core.app.ApplicationProvider
import androidx.test.filters.SdkSuppress
-import androidx.test.filters.SmallTest
import org.junit.Assert.assertEquals
import org.junit.Assert.assertSame
import org.junit.Assert.assertTrue
import org.junit.Test
-@SmallTest
class ContextTest {
private val context = ApplicationProvider.getApplicationContext() as android.content.Context
diff --git a/core/ktx/src/androidTest/java/androidx/core/content/res/TypedArrayTest.kt b/core/ktx/src/androidTest/java/androidx/core/content/res/TypedArrayTest.kt
index d3e33ac..deab214 100644
--- a/core/ktx/src/androidTest/java/androidx/core/content/res/TypedArrayTest.kt
+++ b/core/ktx/src/androidTest/java/androidx/core/content/res/TypedArrayTest.kt
@@ -21,14 +21,12 @@
import androidx.test.core.app.ApplicationProvider
import androidx.test.filters.SdkSuppress
import androidx.core.ktx.test.R
-import androidx.test.filters.SmallTest
import androidx.testutils.assertThrows
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertTrue
import org.junit.Test
-@SmallTest
class TypedArrayTest {
private val context = ApplicationProvider.getApplicationContext() as android.content.Context
diff --git a/core/ktx/src/androidTest/java/androidx/core/transition/TransitionTest.kt b/core/ktx/src/androidTest/java/androidx/core/transition/TransitionTest.kt
index d30a4e5..dff228c 100644
--- a/core/ktx/src/androidTest/java/androidx/core/transition/TransitionTest.kt
+++ b/core/ktx/src/androidTest/java/androidx/core/transition/TransitionTest.kt
@@ -24,7 +24,6 @@
import android.widget.ImageView
import androidx.core.TestActivity
import androidx.core.ktx.test.R
-import androidx.test.filters.MediumTest
import androidx.test.filters.SdkSuppress
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
@@ -37,7 +36,6 @@
import java.util.concurrent.atomic.AtomicBoolean
@SdkSuppress(minSdkVersion = 19)
-@MediumTest
class TransitionTest {
@JvmField @Rule val rule = ActivityTestRule<TestActivity>(TestActivity::class.java)
diff --git a/core/ktx/src/androidTest/java/androidx/core/util/HalfTest.kt b/core/ktx/src/androidTest/java/androidx/core/util/HalfTest.kt
index c024ed1..1948d0d 100644
--- a/core/ktx/src/androidTest/java/androidx/core/util/HalfTest.kt
+++ b/core/ktx/src/androidTest/java/androidx/core/util/HalfTest.kt
@@ -16,14 +16,12 @@
package androidx.core.util
-import android.util.Half
import androidx.test.filters.SdkSuppress
-import androidx.test.filters.SmallTest
+import android.util.Half
import org.junit.Assert.assertEquals
import org.junit.Test
@SdkSuppress(minSdkVersion = 26)
-@SmallTest
class HalfTest {
@Test fun shortToHalf() = assertEquals(Half(1.toShort()), 1.toShort().toHalf())
diff --git a/core/ktx/src/androidTest/java/androidx/core/widget/TextViewTest.kt b/core/ktx/src/androidTest/java/androidx/core/widget/TextViewTest.kt
index b076ce8..80eeb61 100644
--- a/core/ktx/src/androidTest/java/androidx/core/widget/TextViewTest.kt
+++ b/core/ktx/src/androidTest/java/androidx/core/widget/TextViewTest.kt
@@ -20,14 +20,14 @@
import androidx.test.annotation.UiThreadTest
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
import java.util.concurrent.atomic.AtomicBoolean
@RunWith(AndroidJUnit4::class)
-@LargeTest
+@SmallTest
class TextViewTest {
private val context = ApplicationProvider.getApplicationContext() as android.content.Context
diff --git a/core/res/values-as/strings.xml b/core/res/values-as/strings.xml
deleted file mode 100644
index 3039039..0000000
--- a/core/res/values-as/strings.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Copyright (C) 2017 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.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="status_bar_notification_info_overflow" msgid="8106346172024741305">"৯৯৯+"</string>
-</resources>
diff --git a/core/src/androidTest/AndroidManifest.xml b/core/src/androidTest/AndroidManifest.xml
index 073a161..02eb330 100644
--- a/core/src/androidTest/AndroidManifest.xml
+++ b/core/src/androidTest/AndroidManifest.xml
@@ -49,7 +49,6 @@
android:icon="@drawable/test_drawable_blue"/>
<activity android:name="androidx.core.app.TestComponentActivity"/>
- <activity android:name="androidx.core.app.TestActivityWithLifecycle"/>
<activity android:name="androidx.core.view.DragStartHelperTestActivity"/>
diff --git a/core/src/androidTest/java/androidx/core/app/ActivityCompatRecreateTestCase.java b/core/src/androidTest/java/androidx/core/app/ActivityCompatRecreateTestCase.java
deleted file mode 100644
index d803f53..0000000
--- a/core/src/androidTest/java/androidx/core/app/ActivityCompatRecreateTestCase.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright 2019 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.core.app;
-
-import static androidx.testutils.LifecycleOwnerUtils.waitUntilState;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotSame;
-
-import android.app.Instrumentation;
-import android.content.Intent;
-
-import androidx.lifecycle.Lifecycle;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
-import androidx.test.platform.app.InstrumentationRegistry;
-import androidx.test.rule.ActivityTestRule;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@LargeTest
-@RunWith(AndroidJUnit4.class)
-public class ActivityCompatRecreateTestCase {
- @Rule
- public final ActivityTestRule<TestActivityWithLifecycle> mActivityTestRule;
-
- public ActivityCompatRecreateTestCase() {
- mActivityTestRule = new ActivityTestRule<>(TestActivityWithLifecycle.class);
- }
-
- @Test
- public void testRecreate() throws Throwable {
- final TestActivityWithLifecycle firstActivity = mActivityTestRule.getActivity();
-
- // Wait and assert that the Activity is resumed
- waitUntilState(firstActivity, mActivityTestRule, Lifecycle.State.RESUMED);
-
- // Now recreate() the activity
- mActivityTestRule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- ActivityCompat.recreate(firstActivity);
- }
- });
- // Wait until the original activity is destroyed
- waitUntilState(firstActivity, mActivityTestRule, Lifecycle.State.DESTROYED);
-
- // Assert that the recreated Activity is resumed
- final TestActivityWithLifecycle newActivity = mActivityTestRule.getActivity();
- assertNotSame(firstActivity, newActivity);
- assertEquals(Lifecycle.State.RESUMED, newActivity.getLifecycle().getCurrentState());
- }
-
- @Test
- public void testRecreateWhenStopped() throws Throwable {
- final TestActivityWithLifecycle firstActivity = mActivityTestRule.getActivity();
- final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
-
- // Assert that the activity is resumed currently
- waitUntilState(firstActivity, mActivityTestRule, Lifecycle.State.RESUMED);
-
- // Start a new Activity, so that the first Activity goes into the background
- final Intent intent = new Intent(firstActivity, TestActivityWithLifecycle.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- final TestActivityWithLifecycle fgActivity =
- (TestActivityWithLifecycle) instrumentation.startActivitySync(intent);
-
- // Now wait until the new activity is resumed, and the original activity is stopped
- waitUntilState(fgActivity, mActivityTestRule, Lifecycle.State.RESUMED);
- waitUntilState(firstActivity, mActivityTestRule, Lifecycle.State.CREATED);
-
- // Now recreate() the stopped activity
- mActivityTestRule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- ActivityCompat.recreate(firstActivity);
- }
- });
-
- // Wait and assert that the original activity in the background is destroyed
- // (since it is being recreated)
- waitUntilState(firstActivity, mActivityTestRule, Lifecycle.State.DESTROYED);
-
- // Now finish the foreground activity and wait until it is destroyed,
- // allowing the recreated activity to come to the foreground
- fgActivity.finish();
- waitUntilState(fgActivity, mActivityTestRule, Lifecycle.State.DESTROYED);
-
- // Assert that the activity was recreated and is resumed
- final TestActivityWithLifecycle recreatedActivity = mActivityTestRule.getActivity();
- assertNotSame(firstActivity, recreatedActivity);
- // Assert that the recreated Activity is resumed
- waitUntilState(recreatedActivity, mActivityTestRule, Lifecycle.State.RESUMED);
- }
-}
diff --git a/core/src/androidTest/java/androidx/core/app/ActivityCompatTest.java b/core/src/androidTest/java/androidx/core/app/ActivityCompatTest.java
index 61e47ef..10f729d 100644
--- a/core/src/androidTest/java/androidx/core/app/ActivityCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/app/ActivityCompatTest.java
@@ -32,13 +32,13 @@
import androidx.core.app.ActivityCompat.PermissionCompatDelegate;
import androidx.core.test.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class ActivityCompatTest extends BaseInstrumentationTestCase<TestActivity> {
public ActivityCompatTest() {
diff --git a/core/src/androidTest/java/androidx/core/app/ComponentActivityTest.java b/core/src/androidTest/java/androidx/core/app/ComponentActivityTest.java
index cda201b..bb1a508 100644
--- a/core/src/androidTest/java/androidx/core/app/ComponentActivityTest.java
+++ b/core/src/androidTest/java/androidx/core/app/ComponentActivityTest.java
@@ -21,14 +21,14 @@
import android.support.v4.BaseInstrumentationTestCase;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class ComponentActivityTest extends BaseInstrumentationTestCase<TestComponentActivity> {
private ComponentActivity mComponentActivity;
private TestExtraData mTestExtraData;
diff --git a/core/src/androidTest/java/androidx/core/app/FrameMetricsAggregatorTest.java b/core/src/androidTest/java/androidx/core/app/FrameMetricsAggregatorTest.java
index b2e2d27..2ea188c 100644
--- a/core/src/androidTest/java/androidx/core/app/FrameMetricsAggregatorTest.java
+++ b/core/src/androidTest/java/androidx/core/app/FrameMetricsAggregatorTest.java
@@ -26,7 +26,7 @@
import android.util.SparseIntArray;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -49,7 +49,7 @@
}
@Test
- @LargeTest
+ @MediumTest
public void testFrameMetrics() throws Throwable {
FrameMetricsAggregator metrics = new FrameMetricsAggregator();
diff --git a/core/src/androidTest/java/androidx/core/app/NotificationManagerCompatTest.java b/core/src/androidTest/java/androidx/core/app/NotificationManagerCompatTest.java
index d42badbf..d1819a4 100644
--- a/core/src/androidTest/java/androidx/core/app/NotificationManagerCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/app/NotificationManagerCompatTest.java
@@ -32,8 +32,8 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
-import androidx.test.filters.SmallTest;
import org.junit.AfterClass;
import org.junit.Before;
@@ -46,7 +46,7 @@
@RunWith(AndroidJUnit4.class)
-@SmallTest
+@MediumTest
public class NotificationManagerCompatTest {
private static final String TAG = NotificationManagerCompatTest.class.getSimpleName();
diff --git a/core/src/androidTest/java/androidx/core/app/RemoteInputTest.java b/core/src/androidTest/java/androidx/core/app/RemoteInputTest.java
index 16004b1..01354fe 100644
--- a/core/src/androidTest/java/androidx/core/app/RemoteInputTest.java
+++ b/core/src/androidTest/java/androidx/core/app/RemoteInputTest.java
@@ -27,8 +27,8 @@
import android.support.v4.BaseInstrumentationTestCase;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -37,7 +37,7 @@
import java.util.Map;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class RemoteInputTest extends BaseInstrumentationTestCase<TestActivity> {
private static final String RESULT_KEY = "result_key"; // value doesn't matter
private static final String MIME_TYPE = "mimeType"; // value doesn't matter
diff --git a/core/src/androidTest/java/androidx/core/app/TestActivityWithLifecycle.java b/core/src/androidTest/java/androidx/core/app/TestActivityWithLifecycle.java
deleted file mode 100644
index ccce935..0000000
--- a/core/src/androidTest/java/androidx/core/app/TestActivityWithLifecycle.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2019 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.core.app;
-
-import android.os.Bundle;
-import android.view.WindowManager;
-
-import androidx.activity.ComponentActivity;
-import androidx.core.test.R;
-
-public class TestActivityWithLifecycle extends ComponentActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
- setContentView(R.layout.activity_compat_activity);
- }
-}
diff --git a/core/src/androidTest/java/androidx/core/content/ContextCompatTest.java b/core/src/androidTest/java/androidx/core/content/ContextCompatTest.java
index d728332..6ce7b39e 100644
--- a/core/src/androidTest/java/androidx/core/content/ContextCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/content/ContextCompatTest.java
@@ -135,15 +135,15 @@
import android.view.textservice.TextServicesManager;
import androidx.core.test.R;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
import java.util.concurrent.atomic.AtomicBoolean;
-@LargeTest
+@SmallTest
public class ContextCompatTest extends BaseInstrumentationTestCase<ThemedYellowActivity> {
private Context mContext;
diff --git a/core/src/androidTest/java/androidx/core/content/pm/ShortcutInfoCompatTest.java b/core/src/androidTest/java/androidx/core/content/pm/ShortcutInfoCompatTest.java
index 66a741f..94eb2ed 100644
--- a/core/src/androidTest/java/androidx/core/content/pm/ShortcutInfoCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/content/pm/ShortcutInfoCompatTest.java
@@ -41,8 +41,8 @@
import androidx.core.test.R;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -51,7 +51,7 @@
import java.util.HashSet;
import java.util.Set;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class ShortcutInfoCompatTest {
diff --git a/core/src/androidTest/java/androidx/core/content/pm/ShortcutManagerCompatTest.java b/core/src/androidTest/java/androidx/core/content/pm/ShortcutManagerCompatTest.java
index 2bd3620..711a825 100644
--- a/core/src/androidTest/java/androidx/core/content/pm/ShortcutManagerCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/content/pm/ShortcutManagerCompatTest.java
@@ -51,8 +51,8 @@
import androidx.core.graphics.drawable.IconCompat;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -85,7 +85,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = 26)
public void testIsRequestPinShortcutSupported_v26() throws Throwable {
ShortcutManager mockShortcutManager = mock(ShortcutManager.class);
@@ -99,7 +99,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = 26)
public void testRequestPinShortcut_v26() throws Throwable {
ShortcutManager mockShortcutManager = mock(ShortcutManager.class);
@@ -115,7 +115,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = 26)
public void testCreateShortcutResultIntent_v26() throws Throwable {
ShortcutManager mockShortcutManager = mock(ShortcutManager.class);
@@ -133,7 +133,7 @@
assertEquals("test-id", captor.getValue().getId());
}
- @MediumTest
+ @SmallTest
@Test
@SdkSuppress(maxSdkVersion = 25)
public void testIsRequestPinShortcutSupported_v4() throws Throwable {
@@ -188,7 +188,7 @@
assertNotNull(callback.blockingGetIntent());
}
- @MediumTest
+ @SmallTest
@Test
@SdkSuppress(maxSdkVersion = 25)
public void testCreateShortcutResultIntent_v4() throws Throwable {
diff --git a/core/src/androidTest/java/androidx/core/graphics/DrawableCompatTest.java b/core/src/androidTest/java/androidx/core/graphics/DrawableCompatTest.java
index 043d6c3..d72374d 100644
--- a/core/src/androidTest/java/androidx/core/graphics/DrawableCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/graphics/DrawableCompatTest.java
@@ -34,13 +34,13 @@
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
public class DrawableCompatTest {
@Test
public void testDrawableWrap() {
diff --git a/core/src/androidTest/java/androidx/core/os/HandlerCompatTest.java b/core/src/androidTest/java/androidx/core/os/HandlerCompatTest.java
index a934359..f54af5b 100644
--- a/core/src/androidTest/java/androidx/core/os/HandlerCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/os/HandlerCompatTest.java
@@ -26,8 +26,8 @@
import android.os.HandlerThread;
import android.os.Message;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -38,7 +38,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference;
-@MediumTest
+@SmallTest
public final class HandlerCompatTest {
private final HandlerThread mThread = new HandlerThread("handler-compat-test");
diff --git a/core/src/androidTest/java/androidx/core/provider/FontsContractCompatTest.java b/core/src/androidTest/java/androidx/core/provider/FontsContractCompatTest.java
index a5dee37..d53f84b 100644
--- a/core/src/androidTest/java/androidx/core/provider/FontsContractCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/provider/FontsContractCompatTest.java
@@ -47,7 +47,7 @@
import androidx.core.provider.FontsContractCompat.FontFamilyResult;
import androidx.core.provider.FontsContractCompat.FontInfo;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.After;
@@ -66,7 +66,7 @@
* Unit tests for {@link FontsContractCompat}.
*/
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
public class FontsContractCompatTest {
private static final String AUTHORITY = "androidx.core.provider.fonts.font";
private static final String PACKAGE = "androidx.core.test";
diff --git a/core/src/androidTest/java/androidx/core/telephony/mbms/MbmsHelperTest.java b/core/src/androidTest/java/androidx/core/telephony/mbms/MbmsHelperTest.java
index 0cb564c..a25a398 100644
--- a/core/src/androidTest/java/androidx/core/telephony/mbms/MbmsHelperTest.java
+++ b/core/src/androidTest/java/androidx/core/telephony/mbms/MbmsHelperTest.java
@@ -30,8 +30,8 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -44,7 +44,7 @@
@RunWith(AndroidJUnit4.class)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
-@MediumTest
+@SmallTest
public class MbmsHelperTest{
@Test
public void testNameMatchFound() {
diff --git a/core/src/androidTest/java/androidx/core/text/IcuCompatTest.java b/core/src/androidTest/java/androidx/core/text/IcuCompatTest.java
index b1a7500..2b9efd6 100644
--- a/core/src/androidTest/java/androidx/core/text/IcuCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/text/IcuCompatTest.java
@@ -18,8 +18,9 @@
import static org.junit.Assert.assertEquals;
+import android.os.Build;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SdkSuppress;
import androidx.test.filters.SmallTest;
import org.junit.Test;
@@ -34,13 +35,11 @@
@Test
public void testMaximizeAndGetScript() {
assertEquals("Latn", ICUCompat.maximizeAndGetScript(new Locale("en", "US")));
- }
- @Test
- @SdkSuppress(minSdkVersion = 21)
- public void testMaximizeAndGetScriptWithScriptTag() {
// Script tags were added to java.util.Locale only on API 21.
- assertEquals("Visp", ICUCompat.maximizeAndGetScript(Locale.forLanguageTag("en-Visp-US")));
+ if (Build.VERSION.SDK_INT >= 21) {
+ assertEquals(
+ "Visp", ICUCompat.maximizeAndGetScript(Locale.forLanguageTag("en-Visp-US")));
+ }
}
-
}
diff --git a/core/src/androidTest/java/androidx/core/view/DragStartHelperTest.java b/core/src/androidTest/java/androidx/core/view/DragStartHelperTest.java
index 0a78acb..8d0ce23 100644
--- a/core/src/androidTest/java/androidx/core/view/DragStartHelperTest.java
+++ b/core/src/androidTest/java/androidx/core/view/DragStartHelperTest.java
@@ -37,15 +37,11 @@
import androidx.annotation.NonNull;
import androidx.core.test.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
-import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Rule;
-import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatcher;
import org.mockito.InOrder;
@@ -165,9 +161,9 @@
mDragSource = mActivityRule.getActivity().findViewById(R.id.drag_source);
}
- @Ignore("Temporarily disabled due to b/110483469")
- @SmallTest
- @Test
+ // Temporarily disabled due to b/110483469
+ // @SmallTest
+ // @Test
public void mouseClick() throws Throwable {
final DragStartListener listener = createListener(true);
final DragStartHelper helper = createDragStartHelper(listener);
@@ -180,9 +176,9 @@
verifyNoMoreInteractions(listener);
}
- @Ignore("Temporarily disabled due to b/110483469")
- @SmallTest
- @Test
+ // Temporarily disabled due to b/110483469
+ // @SmallTest
+ // @Test
public void mousePressWithSecondaryButton() throws Throwable {
final DragStartListener listener = createListener(true);
final DragStartHelper helper = createDragStartHelper(listener);
@@ -197,9 +193,9 @@
verifyNoMoreInteractions(listener);
}
- @Ignore("Temporarily disabled due to b/110483469")
- @SmallTest
- @Test
+ // Temporarily disabled due to b/110483469
+ // @SmallTest
+ // @Test
public void mouseDrag() throws Throwable {
final DragStartListener listener = createListener(true);
final DragStartHelper helper = createDragStartHelper(listener);
@@ -216,9 +212,9 @@
verifyNoMoreInteractions(listener);
}
- @Ignore("Temporarily disabled due to b/110483469")
- @SmallTest
- @Test
+ // Temporarily disabled due to b/110483469
+ // @SmallTest
+ // @Test
public void mouseDragWithNonprimaryButton() throws Throwable {
final DragStartListener listener = createListener(true);
final DragStartHelper helper = createDragStartHelper(listener);
@@ -236,9 +232,9 @@
verifyNoMoreInteractions(listener);
}
- @Ignore("Temporarily disabled due to b/110483469")
- @SmallTest
- @Test
+ // Temporarily disabled due to b/110483469
+ // @SmallTest
+ // @Test
public void mouseDragUsingTouchListener() throws Throwable {
final DragStartListener listener = createListener(true);
final DragStartHelper helper = createDragStartHelper(listener);
@@ -262,9 +258,9 @@
verifyNoMoreInteractions(listener);
}
- @Ignore("Temporarily disabled due to b/110483469")
- @SmallTest
- @Test
+ // Temporarily disabled due to b/110483469
+ // @SmallTest
+ // @Test
public void mouseDragWhenListenerReturnsFalse() throws Throwable {
final DragStartListener listener = createListener(false);
final DragStartHelper helper = createDragStartHelper(listener);
@@ -286,9 +282,9 @@
inOrder.verifyNoMoreInteractions();
}
- @Ignore("Temporarily disabled due to b/110483469")
- @LargeTest
- @Test
+ // Temporarily disabled due to b/110483469
+ // @LargeTest
+ // @Test
public void mouseLongPress() throws Throwable {
final DragStartListener listener = createListener(true);
final DragStartHelper helper = createDragStartHelper(listener);
@@ -303,9 +299,9 @@
verifyNoMoreInteractions(listener);
}
- @Ignore("Temporarily disabled due to b/110483469")
- @SmallTest
- @Test
+ // Temporarily disabled due to b/110483469
+ // @SmallTest
+ // @Test
public void touchDrag() throws Throwable {
final DragStartListener listener = createListener(false);
final DragStartHelper helper = createDragStartHelper(listener);
@@ -320,9 +316,9 @@
verifyNoMoreInteractions(listener);
}
- @Ignore("Temporarily disabled due to b/110483469")
- @SmallTest
- @Test
+ // Temporarily disabled due to b/110483469
+ // @SmallTest
+ // @Test
public void touchTap() throws Throwable {
final DragStartListener listener = createListener(false);
final DragStartHelper helper = createDragStartHelper(listener);
@@ -335,9 +331,9 @@
verifyNoMoreInteractions(listener);
}
- @Ignore("Temporarily disabled due to b/110483469")
- @LargeTest
- @Test
+ // Temporarily disabled due to b/110483469
+ // @LargeTest
+ // @Test
public void touchLongPress() throws Throwable {
final DragStartListener listener = createListener(true);
final DragStartHelper helper = createDragStartHelper(listener);
@@ -352,9 +348,9 @@
verifyNoMoreInteractions(listener);
}
- @Ignore("Temporarily disabled due to b/110483469")
- @LargeTest
- @Test
+ // Temporarily disabled due to b/110483469
+ // @LargeTest
+ // @Test
public void touchLongPressUsingLongClickListener() throws Throwable {
final DragStartListener listener = createListener(true);
diff --git a/core/src/androidTest/java/androidx/core/view/NestedScrollingChildHelperTest.java b/core/src/androidTest/java/androidx/core/view/NestedScrollingChildHelperTest.java
index 849ee9c..4271c4d 100644
--- a/core/src/androidTest/java/androidx/core/view/NestedScrollingChildHelperTest.java
+++ b/core/src/androidTest/java/androidx/core/view/NestedScrollingChildHelperTest.java
@@ -33,14 +33,14 @@
import androidx.core.widget.NestedScrollView;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class NestedScrollingChildHelperTest {
private NestedScrollingChildHelper mNestedScrollingChildHelper;
diff --git a/core/src/androidTest/java/androidx/core/view/PointerIconCompatTest.java b/core/src/androidTest/java/androidx/core/view/PointerIconCompatTest.java
index c3df6d4..14f1c60 100644
--- a/core/src/androidTest/java/androidx/core/view/PointerIconCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/view/PointerIconCompatTest.java
@@ -29,8 +29,8 @@
import androidx.core.test.R;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -38,7 +38,7 @@
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.N)
public class PointerIconCompatTest extends BaseInstrumentationTestCase<ViewCompatActivity> {
diff --git a/core/src/androidTest/java/androidx/core/view/ViewCompatTest.java b/core/src/androidTest/java/androidx/core/view/ViewCompatTest.java
index 1a70d65..1a223f7 100644
--- a/core/src/androidTest/java/androidx/core/view/ViewCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/view/ViewCompatTest.java
@@ -37,7 +37,7 @@
import androidx.annotation.Nullable;
import androidx.core.test.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
import org.junit.Before;
@@ -48,7 +48,7 @@
import java.util.Set;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@MediumTest
public class ViewCompatTest extends BaseInstrumentationTestCase<ViewCompatActivity> {
private View mView;
diff --git a/core/src/androidTest/java/androidx/core/widget/ListViewCompatTest.java b/core/src/androidTest/java/androidx/core/widget/ListViewCompatTest.java
index 313f431..4baf161 100644
--- a/core/src/androidTest/java/androidx/core/widget/ListViewCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/widget/ListViewCompatTest.java
@@ -33,7 +33,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.test.R;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
@@ -42,7 +42,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-@MediumTest
+@SmallTest
public class ListViewCompatTest extends BaseInstrumentationTestCase<ListViewTestActivity> {
private ListView mListView;
diff --git a/core/src/androidTest/java/androidx/core/widget/NestedScrollViewNestedScrollingChildTest.java b/core/src/androidTest/java/androidx/core/widget/NestedScrollViewNestedScrollingChildTest.java
index 30e89c1..7efa3c6 100644
--- a/core/src/androidTest/java/androidx/core/widget/NestedScrollViewNestedScrollingChildTest.java
+++ b/core/src/androidTest/java/androidx/core/widget/NestedScrollViewNestedScrollingChildTest.java
@@ -42,7 +42,7 @@
import androidx.core.view.ViewCompat;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.testutils.Direction;
import androidx.testutils.FlingData;
import androidx.testutils.MotionEventData;
@@ -63,7 +63,7 @@
* version of the nested scroll parents correctly.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class NestedScrollViewNestedScrollingChildTest {
private NestedScrollingSpyView mParentSpy;
diff --git a/core/src/androidTest/java/androidx/core/widget/NestedScrollViewNestedScrollingParent2Test.java b/core/src/androidTest/java/androidx/core/widget/NestedScrollViewNestedScrollingParent2Test.java
index 69ae791..756b3f4 100644
--- a/core/src/androidTest/java/androidx/core/widget/NestedScrollViewNestedScrollingParent2Test.java
+++ b/core/src/androidTest/java/androidx/core/widget/NestedScrollViewNestedScrollingParent2Test.java
@@ -41,7 +41,7 @@
import androidx.core.view.ViewCompat;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -52,7 +52,7 @@
* {@link androidx.core.view.NestedScrollingParent} and {@link NestedScrollingParent2} correctly.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class NestedScrollViewNestedScrollingParent2Test {
private NestedScrollView mNestedScrollView;
diff --git a/core/src/androidTest/java/androidx/core/widget/NestedScrollViewNestedScrollingParent3Test.java b/core/src/androidTest/java/androidx/core/widget/NestedScrollViewNestedScrollingParent3Test.java
index 0d0f797..f4b3dc0 100644
--- a/core/src/androidTest/java/androidx/core/widget/NestedScrollViewNestedScrollingParent3Test.java
+++ b/core/src/androidTest/java/androidx/core/widget/NestedScrollViewNestedScrollingParent3Test.java
@@ -38,7 +38,7 @@
import androidx.core.view.ViewCompat;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -48,7 +48,7 @@
* {@link NestedScrollingParent3} correctly.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class NestedScrollViewNestedScrollingParent3Test {
private NestedScrollView mNestedScrollView;
diff --git a/core/src/androidTest/java/androidx/core/widget/TextViewCompatTest.java b/core/src/androidTest/java/androidx/core/widget/TextViewCompatTest.java
index 2a9a40b..c7d56f2 100644
--- a/core/src/androidTest/java/androidx/core/widget/TextViewCompatTest.java
+++ b/core/src/androidTest/java/androidx/core/widget/TextViewCompatTest.java
@@ -18,7 +18,8 @@
import static android.support.v4.testutils.LayoutDirectionActions.setLayoutDirection;
import static android.support.v4.testutils.TextViewActions.setCompoundDrawablesRelative;
-import static android.support.v4.testutils.TextViewActions.setCompoundDrawablesRelativeWithIntrinsicBounds;
+import static android.support.v4.testutils.TextViewActions
+ .setCompoundDrawablesRelativeWithIntrinsicBounds;
import static android.support.v4.testutils.TextViewActions.setMaxLines;
import static android.support.v4.testutils.TextViewActions.setMinLines;
import static android.support.v4.testutils.TextViewActions.setText;
@@ -65,8 +66,8 @@
import androidx.core.text.PrecomputedTextCompat;
import androidx.core.view.ViewCompat;
import androidx.test.annotation.UiThreadTest;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -77,7 +78,7 @@
import java.util.Arrays;
import java.util.List;
-@LargeTest
+@SmallTest
public class TextViewCompatTest extends BaseInstrumentationTestCase<TextViewTestActivity> {
private static final String TAG = "TextViewCompatTest";
diff --git a/core/src/main/java/android/support/v4/os/ResultReceiver.java b/core/src/main/java/android/support/v4/os/ResultReceiver.java
index 6342046..ae233ca 100644
--- a/core/src/main/java/android/support/v4/os/ResultReceiver.java
+++ b/core/src/main/java/android/support/v4/os/ResultReceiver.java
@@ -16,7 +16,7 @@
package android.support.v4.os;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.os.Bundle;
@@ -41,7 +41,7 @@
* break if your process goes away for any reason, etc.</p>
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("BanParcelableUsage")
public class ResultReceiver implements Parcelable {
final boolean mLocal;
diff --git a/core/src/main/java/androidx/core/app/ActivityCompat.java b/core/src/main/java/androidx/core/app/ActivityCompat.java
index 523f70d..74b043b 100644
--- a/core/src/main/java/androidx/core/app/ActivityCompat.java
+++ b/core/src/main/java/androidx/core/app/ActivityCompat.java
@@ -135,7 +135,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public interface RequestPermissionsRequestCodeValidator {
void validateRequestPermissionsRequestCode(int requestCode);
}
@@ -164,7 +164,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static PermissionCompatDelegate getPermissionCompatDelegate() {
return sDelegate;
}
@@ -565,25 +565,6 @@
return DragAndDropPermissionsCompat.request(activity, dragEvent);
}
- /**
- * Cause the given Activity to be recreated with a new instance. This version of the method
- * allows a consistent behavior across API levels, emulating what happens on Android Pie (and
- * newer) when running on older platforms.
- *
- * @param activity The activity to recreate
- */
- public static void recreate(@NonNull Activity activity) {
- // On Android P and later we can safely rely on the platform recreate()
- if (Build.VERSION.SDK_INT >= 28) {
- activity.recreate();
- } else {
- if (!ActivityRecreator.recreate(activity)) {
- // If ActivityRecreator did not start a recreation, we'll just invoke the platform
- activity.recreate();
- }
- }
- }
-
@RequiresApi(21)
private static class SharedElementCallback21Impl extends android.app.SharedElementCallback {
private final SharedElementCallback mCallback;
diff --git a/core/src/main/java/androidx/core/app/ActivityRecreator.java b/core/src/main/java/androidx/core/app/ActivityRecreator.java
deleted file mode 100644
index 5462a61..0000000
--- a/core/src/main/java/androidx/core/app/ActivityRecreator.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * Copyright 2019 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.core.app;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-
-import android.app.Activity;
-import android.app.Application;
-import android.app.Application.ActivityLifecycleCallbacks;
-import android.content.res.Configuration;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.IBinder;
-import android.os.Looper;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RestrictTo;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.List;
-
-/**
- * The goal here is to get common (and correct) behavior around Activity recreation for all API
- * versions up until P, where the behavior was specified to be useful and implemented to match the
- * specification. On API 26 and 27, recreate() doesn't actually recreate the Activity if it's
- * not in the foreground; it will be recreated when the user next interacts with it. This has a few
- * undesirable consequences:
- *
- * <p>1. It's impossible to recreate multiple activities at once, which means that activities in the
- * background will observe the new configuration before they're recreated. If we keep them on the
- * old configuration, we have two conflicting configurations active in the app, which leads to
- * logging skew.
- *
- * <p>2. Recreation occurs in the critical path of user interaction - re-inflating a bunch of views
- * isn't free, and we'd rather do it when we're in the background than when the user is staring at
- * the screen waiting to see us.
- *
- * <p>On API < 26, recreate() was implemented with a single call to a private method on
- * ActivityThread. That method still exists in 26 and 27, so we can use reflection to call it and
- * get the exact same behavior as < 26. However, that behavior has problems itself. When
- * an Activity in the background is recreated, it goes through: destroy -> create -> start ->
- * resume -> pause and doesn't stop. This is a violation of the contract for onStart/onStop,
- * but that might be palatable if it didn't also have the effect of preventing new configurations
- * from being applied - since the Activity doesn't go through onStop, our tracking of whether
- * our app is visible thinks we're always visible, and thus can't do another recreation later.
- *
- * <p>The fix for this is to add the missing onStop() call, by using reflection to call into
- * ActivityThread.
- *
- * @hide
- */
-@RestrictTo(LIBRARY)
-@SuppressWarnings("PrivateApi")
-final class ActivityRecreator {
- private ActivityRecreator() {}
-
- // android.app.ActivityThread
- protected static final Class<?> activityThreadClass;
- // Activity.mMainThread
- protected static final Field mainThreadField;
- // Activity.mToken. This object is an identifier that is the same between multiple instances of
- //the same underlying Activity.
- protected static final Field tokenField;
- // On API 25, a third param was added to performStopActivity
- protected static final Method performStopActivity3ParamsMethod;
- // Before API 25, performStopActivity had two params
- protected static final Method performStopActivity2ParamsMethod;
- // ActivityThread.requestRelaunchActivity
- protected static final Method requestRelaunchActivityMethod;
-
- private static final Handler mainHandler = new Handler(Looper.getMainLooper());
-
- static {
- activityThreadClass = getActivityThreadClass();
- mainThreadField = getMainThreadField();
- tokenField = getTokenField();
- performStopActivity3ParamsMethod = getPerformStopActivity3Params(activityThreadClass);
- performStopActivity2ParamsMethod = getPerformStopActivity2Params(activityThreadClass);
- requestRelaunchActivityMethod = getRequestRelaunchActivityMethod(activityThreadClass);
- }
-
- /**
- * Equivalent to {@link Activity#recreate}, but working around a number of platform bugs.
- *
- * @return true if a recreate() task was successfully scheduled.
- */
- static boolean recreate(@NonNull final Activity activity) {
- // On Android O and later we can rely on the platform recreate()
- if (Build.VERSION.SDK_INT >= 28) {
- activity.recreate();
- return true;
- }
-
- // API 26 needs this workaround but it's not possible because our reflective lookup failed.
- if (needsRelaunchCall() && requestRelaunchActivityMethod == null) {
- return false;
- }
- // All versions of android so far need this workaround, but it's not possible because our
- // reflective lookup failed.
- if (performStopActivity2ParamsMethod == null && performStopActivity3ParamsMethod == null) {
- return false;
- }
- try {
- final Object token = tokenField.get(activity);
- if (token == null) {
- return false;
- }
- Object activityThread = mainThreadField.get(activity);
- if (activityThread == null) {
- return false;
- }
-
- final Application application = activity.getApplication();
- final LifecycleCheckCallbacks callbacks = new LifecycleCheckCallbacks(activity);
- application.registerActivityLifecycleCallbacks(callbacks);
-
- /*
- * Runnables scheduled before/after recreate() will run before and after the Runnables
- * scheduled by recreate(). This allows us to bound the time where mActivity lifecycle
- * events that could be caused by recreate() run - that way we can detect onPause()
- * from the new Activity instance, and schedule onStop to run immediately after it.
- */
- mainHandler.post(new Runnable() {
- @Override
- public void run() {
- callbacks.currentlyRecreatingToken = token;
- }
- });
-
- try {
- if (needsRelaunchCall()) {
- requestRelaunchActivityMethod.invoke(activityThread,
- token, null, null, 0, false, null, null, false, false);
- } else {
- activity.recreate();
- }
- return true;
- } finally {
- mainHandler.post(new Runnable() {
- @Override
- public void run() {
- // Since we're calling hidden API, it's entirely possible for it to
- // simply do nothing;
- // if that's the case, make sure to unregister so we don't leak memory
- // waiting for an event that will never happen.
- application.unregisterActivityLifecycleCallbacks(callbacks);
- }
- });
- }
- } catch (Throwable t) {
- handleReflectiveException(t);
- return false;
- }
- }
-
- private static final class LifecycleCheckCallbacks implements ActivityLifecycleCallbacks {
- Object currentlyRecreatingToken;
-
- private Activity mActivity;
- private boolean mStarted = false;
- private boolean mDestroyed = false;
- private boolean mStopQueued = false;
-
- LifecycleCheckCallbacks(@NonNull Activity aboutToRecreate) {
- mActivity = aboutToRecreate;
- }
-
- @Override
- public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
- }
-
- @Override
- public void onActivityStarted(Activity activity) {
- // If we see a start call on the original mActivity instance, then the mActivity
- // starting event executed between our call to recreate() and the actual
- // recreation of the mActivity. In that case, a stop() call should not be scheduled.
- if (mActivity == activity) {
- mStarted = true;
- }
- }
-
- @Override
- public void onActivityResumed(Activity activity) {
- }
-
- @Override
- public void onActivityPaused(Activity activity) {
- if (mDestroyed // Original mActivity must be gone
- && !mStopQueued // Don't schedule stop twice for one recreate() call
- && !mStarted
- // Don't schedule stop if the original instance starting raced with recreate()
- && queueOnStopIfNecessary(currentlyRecreatingToken, activity)) {
- mStopQueued = true;
- // Don't retain this object longer than necessary
- currentlyRecreatingToken = null;
- }
- }
-
- @Override
- public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
- }
-
- @Override
- public void onActivityStopped(Activity activity) {
- // Not possible to get a start/stop pair in the same UI thread loop
- }
-
- @Override
- public void onActivityDestroyed(Activity activity) {
- if (mActivity == activity) {
- // Once the original mActivity instance is mDestroyed, we don't need to compare to
- // it any
- // longer, and we don't want to retain it any longer than necessary.
- mActivity = null;
- mDestroyed = true;
- }
- }
- }
-
- /**
- * Returns true if a stop call was scheduled successfully
- */
- protected static boolean queueOnStopIfNecessary(
- Object currentlyRecreatingToken, Activity activity) {
- try {
- final Object token = tokenField.get(activity);
- if (token != currentlyRecreatingToken) {
- return false;
- }
- final Object activityThread = mainThreadField.get(activity);
- // These operations are posted at the front of the queue, so that operations
- // scheduled from onCreate, onStart etc run after the onStop call - this should
- // cause any redundant loads to be immediately cancelled.
- mainHandler.postAtFrontOfQueue(new Runnable() {
- @Override
- public void run() {
- try {
- if (performStopActivity3ParamsMethod != null) {
- performStopActivity3ParamsMethod.invoke(activityThread,
- token, false, "AppCompat recreation");
- } else {
- performStopActivity2ParamsMethod.invoke(activityThread,
- token, false);
- }
- } catch (RuntimeException e) {
- // If an mActivity throws from onStop, don't swallow it
- if (e.getClass() == RuntimeException.class
- && e.getMessage() != null
- && e.getMessage().startsWith("Unable to stop")) {
- throw e;
- } else {
- handleReflectiveException(e);
- }
- // Otherwise just swallow it - we're calling random private methods,
- // there's no
- // guarantee on how they'll behave.
- } catch (Throwable t) {
- handleReflectiveException(t);
- }
- }
- });
- } catch (Throwable t) {
- handleReflectiveException(t);
- }
- return true;
- }
-
- private static Method getPerformStopActivity3Params(Class<?> activityThreadClass) {
- if (activityThreadClass == null) {
- return null;
- }
- try {
- Method performStop = activityThreadClass.getDeclaredMethod("performStopActivity",
- IBinder.class, boolean.class, String.class);
- performStop.setAccessible(true);
- return performStop;
- } catch (Throwable t) {
- handleReflectiveException(t);
- return null;
- }
- }
-
- private static Method getPerformStopActivity2Params(Class<?> activityThreadClass) {
- if (activityThreadClass == null) {
- return null;
- }
- try {
- Method performStop = activityThreadClass.getDeclaredMethod("performStopActivity",
- IBinder.class, boolean.class);
- performStop.setAccessible(true);
- return performStop;
- } catch (Throwable t) {
- handleReflectiveException(t);
- return null;
- }
- }
-
- private static boolean needsRelaunchCall() {
- return Build.VERSION.SDK_INT == 26 || Build.VERSION.SDK_INT == 27;
- }
-
- private static Method getRequestRelaunchActivityMethod(Class<?> activityThreadClass) {
- if (!needsRelaunchCall() || activityThreadClass == null) {
- return null;
- }
- try {
- Method relaunch = activityThreadClass.getDeclaredMethod(
- "requestRelaunchActivity",
- IBinder.class,
- List.class,
- List.class,
- int.class,
- boolean.class,
- Configuration.class,
- Configuration.class,
- boolean.class,
- boolean.class);
- relaunch.setAccessible(true);
- return relaunch;
- } catch (Throwable t) {
- handleReflectiveException(t);
- return null;
- }
- }
-
- private static Field getMainThreadField() {
- try {
- Field mainThreadField = Activity.class.getDeclaredField("mMainThread");
- mainThreadField.setAccessible(true);
- return mainThreadField;
- } catch (Throwable t) {
- handleReflectiveException(t);
- return null;
- }
- }
-
- private static Field getTokenField() {
- try {
- Field tokenField = Activity.class.getDeclaredField("mToken");
- tokenField.setAccessible(true);
- return tokenField;
- } catch (Throwable t) {
- handleReflectiveException(t);
- return null;
- }
- }
-
- private static Class<?> getActivityThreadClass() {
- try {
- return Class.forName("android.app.ActivityThread");
- } catch (Throwable t) {
- handleReflectiveException(t);
- return null;
- }
- }
-
- protected static void handleReflectiveException(Throwable t) {
- t.printStackTrace();
- }
-}
diff --git a/core/src/main/java/androidx/core/app/ComponentActivity.java b/core/src/main/java/androidx/core/app/ComponentActivity.java
index 864c4d8..c9d3d92 100644
--- a/core/src/main/java/androidx/core/app/ComponentActivity.java
+++ b/core/src/main/java/androidx/core/app/ComponentActivity.java
@@ -16,7 +16,7 @@
package androidx.core.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Activity;
import android.view.KeyEvent;
@@ -35,7 +35,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ComponentActivity extends Activity
implements KeyEventDispatcher.Component {
/**
@@ -55,7 +55,7 @@
* @see #getExtraData
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void putExtraData(ExtraData extraData) {
mExtraDataMap.put(extraData.getClass(), extraData);
}
@@ -66,7 +66,7 @@
* @see #putExtraData
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public <T extends ExtraData> T getExtraData(Class<T> extraDataClass) {
return (T) mExtraDataMap.get(extraDataClass);
}
@@ -74,7 +74,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public boolean superDispatchKeyEvent(KeyEvent event) {
return super.dispatchKeyEvent(event);
@@ -101,7 +101,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class ExtraData {
}
}
diff --git a/core/src/main/java/androidx/core/app/CoreComponentFactory.java b/core/src/main/java/androidx/core/app/CoreComponentFactory.java
index a74d729..d179bc0 100644
--- a/core/src/main/java/androidx/core/app/CoreComponentFactory.java
+++ b/core/src/main/java/androidx/core/app/CoreComponentFactory.java
@@ -33,7 +33,7 @@
* @hide
*/
@RequiresApi(api = 28)
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class CoreComponentFactory extends AppComponentFactory {
@Override
public Activity instantiateActivity(ClassLoader cl, String className, Intent intent)
@@ -81,7 +81,7 @@
* on certain API levels.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public interface CompatWrapped {
/**
* Called while this class is being instantiated by the OS.
diff --git a/core/src/main/java/androidx/core/app/FrameMetricsAggregator.java b/core/src/main/java/androidx/core/app/FrameMetricsAggregator.java
index e335980..9aa5c31 100644
--- a/core/src/main/java/androidx/core/app/FrameMetricsAggregator.java
+++ b/core/src/main/java/androidx/core/app/FrameMetricsAggregator.java
@@ -17,7 +17,7 @@
package androidx.core.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Activity;
import android.os.Build;
@@ -172,7 +172,7 @@
private FrameMetricsBaseImpl mInstance;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
@IntDef(
flag = true,
diff --git a/core/src/main/java/androidx/core/app/NotificationBuilderWithBuilderAccessor.java b/core/src/main/java/androidx/core/app/NotificationBuilderWithBuilderAccessor.java
index 61ad3fc..f779eb2 100644
--- a/core/src/main/java/androidx/core/app/NotificationBuilderWithBuilderAccessor.java
+++ b/core/src/main/java/androidx/core/app/NotificationBuilderWithBuilderAccessor.java
@@ -16,7 +16,7 @@
package androidx.core.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Notification;
@@ -29,7 +29,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface NotificationBuilderWithBuilderAccessor {
Notification.Builder getBuilder();
}
diff --git a/core/src/main/java/androidx/core/app/NotificationCompat.java b/core/src/main/java/androidx/core/app/NotificationCompat.java
index 17053d9..036de01 100644
--- a/core/src/main/java/androidx/core/app/NotificationCompat.java
+++ b/core/src/main/java/androidx/core/app/NotificationCompat.java
@@ -16,7 +16,7 @@
package androidx.core.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static java.lang.annotation.RetentionPolicy.SOURCE;
@@ -457,7 +457,7 @@
public static final int COLOR_DEFAULT = Color.TRANSPARENT;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({AudioManager.STREAM_VOICE_CALL, AudioManager.STREAM_SYSTEM, AudioManager.STREAM_RING,
AudioManager.STREAM_MUSIC, AudioManager.STREAM_ALARM, AudioManager.STREAM_NOTIFICATION,
AudioManager.STREAM_DTMF, AudioManager.STREAM_ACCESSIBILITY})
@@ -465,7 +465,7 @@
public @interface StreamType {}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(SOURCE)
@IntDef({VISIBILITY_PUBLIC, VISIBILITY_PRIVATE, VISIBILITY_SECRET})
public @interface NotificationVisibility {}
@@ -576,7 +576,7 @@
/** @hide */
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({BADGE_ICON_NONE, BADGE_ICON_SMALL, BADGE_ICON_LARGE})
public @interface BadgeIconType {}
/**
@@ -598,7 +598,7 @@
/** @hide */
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({GROUP_ALERT_ALL, GROUP_ALERT_SUMMARY, GROUP_ALERT_CHILDREN})
public @interface GroupAlertBehavior {}
@@ -667,11 +667,11 @@
// extender.
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Context mContext;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ArrayList<Action> mActions = new ArrayList<>();
// Invisible actions are stored in the CarExtender bundle without actually being owned by
@@ -1601,7 +1601,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public RemoteViews getContentView() {
return mContentView;
}
@@ -1609,7 +1609,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public RemoteViews getBigContentView() {
return mBigContentView;
}
@@ -1617,7 +1617,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public RemoteViews getHeadsUpContentView() {
return mHeadsUpContentView;
}
@@ -1627,7 +1627,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public long getWhenIfShowing() {
return mShowWhen ? mNotification.when : 0;
}
@@ -1637,7 +1637,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public int getPriority() {
return mPriority;
}
@@ -1647,7 +1647,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public int getColor() {
return mColor;
}
@@ -1664,7 +1664,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected Builder mBuilder;
CharSequence mBigContentTitle;
CharSequence mSummaryText;
@@ -1693,7 +1693,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
// TODO: implement for all styles
public void apply(NotificationBuilderWithBuilderAccessor builder) {
}
@@ -1701,7 +1701,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public RemoteViews makeContentView(NotificationBuilderWithBuilderAccessor builder) {
return null;
}
@@ -1709,7 +1709,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public RemoteViews makeBigContentView(NotificationBuilderWithBuilderAccessor builder) {
return null;
}
@@ -1717,7 +1717,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public RemoteViews makeHeadsUpContentView(NotificationBuilderWithBuilderAccessor builder) {
return null;
}
@@ -1725,7 +1725,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
// TODO: implement for all styles
public void addCompatExtras(Bundle extras) {
}
@@ -1733,7 +1733,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
// TODO: implement for all styles
protected void restoreFromCompatExtras(Bundle extras) {
}
@@ -1741,7 +1741,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public RemoteViews applyStandardTemplate(boolean showSmallIcon,
int resId, boolean fitIn1U) {
Resources res = mBuilder.mContext.getResources();
@@ -1889,7 +1889,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Bitmap createColoredBitmap(int iconId, int color) {
return createColoredBitmap(iconId, color, 0);
}
@@ -1926,7 +1926,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void buildIntoRemoteViews(RemoteViews outerView,
RemoteViews innerView) {
// this needs to be done fore the other calls, since otherwise we might hide the wrong
@@ -2036,7 +2036,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void apply(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 16) {
@@ -2115,7 +2115,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void apply(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 16) {
@@ -2380,7 +2380,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void apply(NotificationBuilderWithBuilderAccessor builder) {
// This is called because we need to apply legacy logic before writing MessagingInfo
@@ -2559,7 +2559,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
protected void restoreFromCompatExtras(Bundle extras) {
mMessages.clear();
@@ -2888,7 +2888,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void apply(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 16) {
@@ -2943,7 +2943,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void apply(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 24) {
@@ -2954,7 +2954,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public RemoteViews makeContentView(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 24) {
@@ -2971,7 +2971,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public RemoteViews makeBigContentView(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 24) {
@@ -2992,7 +2992,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public RemoteViews makeHeadsUpContentView(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 24) {
@@ -3553,8 +3553,6 @@
*
* @param label the label to display while the action is being prepared to execute
* @return this object for method chaining
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public WearableExtender setInProgressLabel(CharSequence label) {
@@ -3567,8 +3565,6 @@
* the action. This is usually a 'ing' verb ending in ellipsis like "Sending..."
*
* @return the label to display while the action is being prepared to execute
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public CharSequence getInProgressLabel() {
@@ -3581,8 +3577,6 @@
*
* @param label the label to confirm the action should be executed
* @return this object for method chaining
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public WearableExtender setConfirmLabel(CharSequence label) {
@@ -3595,8 +3589,6 @@
* This is usually an imperative verb like "Send".
*
* @return the label to confirm the action should be executed
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public CharSequence getConfirmLabel() {
@@ -3609,8 +3601,6 @@
*
* @param label the label to display to cancel the action
* @return this object for method chaining
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public WearableExtender setCancelLabel(CharSequence label) {
@@ -3623,8 +3613,6 @@
* This is usually an imperative verb like "Cancel".
*
* @return the label to display to cancel the action
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public CharSequence getCancelLabel() {
@@ -4260,8 +4248,6 @@
/**
* Set an icon that goes with the content of this notification.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public WearableExtender setContentIcon(int icon) {
@@ -4271,8 +4257,6 @@
/**
* Get an icon that goes with the content of this notification.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public int getContentIcon() {
@@ -4284,8 +4268,6 @@
* Supported values include {@link android.view.Gravity#START} and
* {@link android.view.Gravity#END}. The default value is {@link android.view.Gravity#END}.
* @see #setContentIcon
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public WearableExtender setContentIconGravity(int contentIconGravity) {
@@ -4298,8 +4280,6 @@
* Supported values include {@link android.view.Gravity#START} and
* {@link android.view.Gravity#END}. The default value is {@link android.view.Gravity#END}.
* @see #getContentIcon
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public int getContentIconGravity() {
@@ -4339,8 +4319,6 @@
* Supported values include {@link android.view.Gravity#TOP},
* {@link android.view.Gravity#CENTER_VERTICAL} and {@link android.view.Gravity#BOTTOM}.
* The default value is {@link android.view.Gravity#BOTTOM}.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public WearableExtender setGravity(int gravity) {
@@ -4353,8 +4331,6 @@
* Supported values include {@link android.view.Gravity#TOP},
* {@link android.view.Gravity#CENTER_VERTICAL} and {@link android.view.Gravity#BOTTOM}.
* The default value is {@link android.view.Gravity#BOTTOM}.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public int getGravity() {
@@ -4369,8 +4345,6 @@
* using {@link NotificationCompat.WearableExtender#setDisplayIntent}. Check the
* documentation for the preset in question. See also
* {@link #setCustomContentHeight} and {@link #getCustomSizePreset}.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public WearableExtender setCustomSizePreset(int sizePreset) {
@@ -4385,8 +4359,6 @@
* <p>Some custom size presets are only applicable for custom display notifications created
* using {@link #setDisplayIntent}. Check the documentation for the preset in question.
* See also {@link #setCustomContentHeight} and {@link #setCustomSizePreset}.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public int getCustomSizePreset() {
@@ -4399,8 +4371,6 @@
* using {@link NotificationCompat.WearableExtender#setDisplayIntent}. See also
* {@link NotificationCompat.WearableExtender#setCustomSizePreset} and
* {@link #getCustomContentHeight}.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public WearableExtender setCustomContentHeight(int height) {
@@ -4413,8 +4383,6 @@
* <p>This option is only available for custom display notifications created
* using {@link #setDisplayIntent}. See also {@link #setCustomSizePreset} and
* {@link #setCustomContentHeight}.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public int getCustomContentHeight() {
@@ -4466,8 +4434,6 @@
* Set a hint that this notification's icon should not be displayed.
* @param hintHideIcon {@code true} to hide the icon, {@code false} otherwise.
* @return this object for method chaining
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public WearableExtender setHintHideIcon(boolean hintHideIcon) {
@@ -4479,8 +4445,6 @@
* Get a hint that this notification's icon should not be displayed.
* @return {@code true} if this icon should not be displayed, false otherwise.
* The default value is {@code false} if this was never set.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public boolean getHintHideIcon() {
@@ -4491,8 +4455,6 @@
* Set a visual hint that only the background image of this notification should be
* displayed, and other semantic content should be hidden. This hint is only applicable
* to sub-pages added using {@link #addPage}.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public WearableExtender setHintShowBackgroundOnly(boolean hintShowBackgroundOnly) {
@@ -4504,8 +4466,6 @@
* Get a visual hint that only the background image of this notification should be
* displayed, and other semantic content should be hidden. This hint is only applicable
* to sub-pages added using {@link NotificationCompat.WearableExtender#addPage}.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public boolean getHintShowBackgroundOnly() {
@@ -4518,8 +4478,6 @@
* ratio of the image. This can be useful for images like barcodes or qr codes.
* @param hintAvoidBackgroundClipping {@code true} to avoid clipping if possible.
* @return this object for method chaining
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public WearableExtender setHintAvoidBackgroundClipping(
@@ -4534,8 +4492,6 @@
* ratio of the image. This can be useful for images like barcodes or qr codes.
* @return {@code true} if it's ok if the background is clipped on the screen, false
* otherwise. The default value is {@code false} if this was never set.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public boolean getHintAvoidBackgroundClipping() {
@@ -4548,8 +4504,6 @@
* @param timeout The requested screen timeout in milliseconds. Can also be either
* {@link #SCREEN_TIMEOUT_SHORT} or {@link #SCREEN_TIMEOUT_LONG}.
* @return this object for method chaining
- *
- * @deprecated This method has no effect.
*/
@Deprecated
public WearableExtender setHintScreenTimeout(int timeout) {
@@ -4562,8 +4516,6 @@
* when this notification is displayed.
* @return the duration in milliseconds if > 0, or either one of the sentinel values
* {@link #SCREEN_TIMEOUT_SHORT} or {@link #SCREEN_TIMEOUT_LONG}.
- *
- * @deprecated This method has no effect starting with Wear 2.0.
*/
@Deprecated
public int getHintScreenTimeout() {
@@ -4703,13 +4655,13 @@
*/
public static final class CarExtender implements Extender {
/** @hide **/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
static final String EXTRA_CAR_EXTENDER = "android.car.EXTENSIONS";
private static final String EXTRA_LARGE_ICON = "large_icon";
private static final String EXTRA_CONVERSATION = "car_conversation";
private static final String EXTRA_COLOR = "app_color";
/** @hide **/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
static final String EXTRA_INVISIBLE_ACTIONS = "invisible_actions";
private static final String KEY_AUTHOR = "author";
diff --git a/core/src/main/java/androidx/core/app/NotificationCompatBuilder.java b/core/src/main/java/androidx/core/app/NotificationCompatBuilder.java
index ca2a3b7..6ec420a 100644
--- a/core/src/main/java/androidx/core/app/NotificationCompatBuilder.java
+++ b/core/src/main/java/androidx/core/app/NotificationCompatBuilder.java
@@ -16,7 +16,7 @@
package androidx.core.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.core.app.NotificationCompat.DEFAULT_SOUND;
import static androidx.core.app.NotificationCompat.DEFAULT_VIBRATE;
import static androidx.core.app.NotificationCompat.FLAG_GROUP_SUMMARY;
@@ -41,7 +41,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
class NotificationCompatBuilder implements NotificationBuilderWithBuilderAccessor {
private final Notification.Builder mBuilder;
private final NotificationCompat.Builder mBuilderCompat;
diff --git a/core/src/main/java/androidx/core/app/Person.java b/core/src/main/java/androidx/core/app/Person.java
index 44f5c9c..2b210eb 100644
--- a/core/src/main/java/androidx/core/app/Person.java
+++ b/core/src/main/java/androidx/core/app/Person.java
@@ -16,7 +16,7 @@
package androidx.core.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
import android.os.PersistableBundle;
@@ -63,7 +63,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@NonNull
@RequiresApi(22)
public static Person fromPersistableBundle(@NonNull PersistableBundle bundle) {
@@ -81,7 +81,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@RequiresApi(28)
@NonNull
public static Person fromAndroidPerson(@NonNull android.app.Person person) {
@@ -144,7 +144,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@NonNull
@RequiresApi(22)
public PersistableBundle toPersistableBundle() {
@@ -168,7 +168,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@NonNull
@RequiresApi(28)
public android.app.Person toAndroidPerson() {
diff --git a/core/src/main/java/androidx/core/app/RemoteInput.java b/core/src/main/java/androidx/core/app/RemoteInput.java
index e579efd..8a98cac 100644
--- a/core/src/main/java/androidx/core/app/RemoteInput.java
+++ b/core/src/main/java/androidx/core/app/RemoteInput.java
@@ -57,7 +57,7 @@
/** @hide */
@IntDef({SOURCE_FREE_FORM_INPUT, SOURCE_CHOICE})
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
public @interface Source {}
diff --git a/core/src/main/java/androidx/core/app/ServiceCompat.java b/core/src/main/java/androidx/core/app/ServiceCompat.java
index f7d8ac4..65a4c0e 100644
--- a/core/src/main/java/androidx/core/app/ServiceCompat.java
+++ b/core/src/main/java/androidx/core/app/ServiceCompat.java
@@ -16,7 +16,7 @@
package androidx.core.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Notification;
import android.app.Service;
@@ -78,7 +78,7 @@
public static final int STOP_FOREGROUND_DETACH = 1<<1;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef(flag = true,
value = {
STOP_FOREGROUND_REMOVE,
diff --git a/core/src/main/java/androidx/core/content/PermissionChecker.java b/core/src/main/java/androidx/core/content/PermissionChecker.java
index 20697c7..62dae8c 100644
--- a/core/src/main/java/androidx/core/content/PermissionChecker.java
+++ b/core/src/main/java/androidx/core/content/PermissionChecker.java
@@ -16,7 +16,7 @@
package androidx.core.content;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -67,7 +67,7 @@
public static final int PERMISSION_DENIED_APP_OP = PackageManager.PERMISSION_DENIED - 1;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({PERMISSION_GRANTED,
PERMISSION_DENIED,
PERMISSION_DENIED_APP_OP})
diff --git a/core/src/main/java/androidx/core/content/pm/ShortcutInfoCompat.java b/core/src/main/java/androidx/core/content/pm/ShortcutInfoCompat.java
index 9c903f0..27f7bf44 100644
--- a/core/src/main/java/androidx/core/content/pm/ShortcutInfoCompat.java
+++ b/core/src/main/java/androidx/core/content/pm/ShortcutInfoCompat.java
@@ -15,7 +15,7 @@
*/
package androidx.core.content.pm;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ComponentName;
import android.content.Context;
@@ -99,7 +99,7 @@
* @hide
*/
@RequiresApi(22)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
private PersistableBundle buildExtrasBundle() {
PersistableBundle bundle = new PersistableBundle();
if (mPersons != null && mPersons.length > 0) {
@@ -227,7 +227,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public IconCompat getIcon() {
return mIcon;
}
@@ -236,7 +236,7 @@
* @hide
*/
@RequiresApi(25)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@VisibleForTesting
@Nullable
static Person[] getPersonsFromExtra(@NonNull PersistableBundle bundle) {
@@ -257,7 +257,7 @@
* @hide
*/
@RequiresApi(25)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@VisibleForTesting
@Nullable
static boolean getLongLivedFromExtra(@NonNull PersistableBundle bundle) {
@@ -283,7 +283,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Builder(@NonNull ShortcutInfoCompat shortcutInfo) {
mInfo = new ShortcutInfoCompat();
mInfo.mContext = shortcutInfo.mContext;
@@ -308,7 +308,7 @@
* @hide
*/
@RequiresApi(25)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Builder(@NonNull Context context, @NonNull ShortcutInfo shortcutInfo) {
mInfo = new ShortcutInfoCompat();
mInfo.mContext = context;
diff --git a/core/src/main/java/androidx/core/content/pm/ShortcutInfoCompatSaver.java b/core/src/main/java/androidx/core/content/pm/ShortcutInfoCompatSaver.java
index 4bda3a7..b5381f9 100644
--- a/core/src/main/java/androidx/core/content/pm/ShortcutInfoCompatSaver.java
+++ b/core/src/main/java/androidx/core/content/pm/ShortcutInfoCompatSaver.java
@@ -16,7 +16,7 @@
package androidx.core.content.pm;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.AnyThread;
import androidx.annotation.RestrictTo;
@@ -34,7 +34,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ShortcutInfoCompatSaver {
@AnyThread
public ListenableFuture<Void> addShortcuts(List<ShortcutInfoCompat> shortcuts) {
diff --git a/core/src/main/java/androidx/core/content/res/ColorStateListInflaterCompat.java b/core/src/main/java/androidx/core/content/res/ColorStateListInflaterCompat.java
index 0f90a91..2afb43c 100644
--- a/core/src/main/java/androidx/core/content/res/ColorStateListInflaterCompat.java
+++ b/core/src/main/java/androidx/core/content/res/ColorStateListInflaterCompat.java
@@ -16,7 +16,7 @@
package androidx.core.content.res;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.res.ColorStateList;
import android.content.res.Resources;
@@ -43,7 +43,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class ColorStateListInflaterCompat {
private ColorStateListInflaterCompat() {
diff --git a/core/src/main/java/androidx/core/content/res/ComplexColorCompat.java b/core/src/main/java/androidx/core/content/res/ComplexColorCompat.java
index 0dcd6b7..d21771c 100644
--- a/core/src/main/java/androidx/core/content/res/ComplexColorCompat.java
+++ b/core/src/main/java/androidx/core/content/res/ComplexColorCompat.java
@@ -18,7 +18,7 @@
import static android.graphics.Color.TRANSPARENT;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.res.ColorStateList;
@@ -50,7 +50,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class ComplexColorCompat {
private static final String LOG_TAG = "ComplexColorCompat";
diff --git a/core/src/main/java/androidx/core/content/res/FontResourcesParserCompat.java b/core/src/main/java/androidx/core/content/res/FontResourcesParserCompat.java
index 79c1625..5a6554a 100644
--- a/core/src/main/java/androidx/core/content/res/FontResourcesParserCompat.java
+++ b/core/src/main/java/androidx/core/content/res/FontResourcesParserCompat.java
@@ -16,7 +16,7 @@
package androidx.core.content.res;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.res.Resources;
import android.content.res.TypedArray;
@@ -48,7 +48,7 @@
* Parser for xml type font resources.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class FontResourcesParserCompat {
private static final int NORMAL_WEIGHT = 400;
private static final int ITALIC = 1;
diff --git a/core/src/main/java/androidx/core/content/res/GradientColorInflaterCompat.java b/core/src/main/java/androidx/core/content/res/GradientColorInflaterCompat.java
index eaa38ac..e38be52 100644
--- a/core/src/main/java/androidx/core/content/res/GradientColorInflaterCompat.java
+++ b/core/src/main/java/androidx/core/content/res/GradientColorInflaterCompat.java
@@ -21,7 +21,7 @@
import static android.graphics.drawable.GradientDrawable.RADIAL_GRADIENT;
import static android.graphics.drawable.GradientDrawable.SWEEP_GRADIENT;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.res.Resources;
import android.content.res.TypedArray;
@@ -51,7 +51,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
final class GradientColorInflaterCompat {
@IntDef({TILE_MODE_CLAMP, TILE_MODE_REPEAT, TILE_MODE_MIRROR})
diff --git a/core/src/main/java/androidx/core/content/res/ResourcesCompat.java b/core/src/main/java/androidx/core/content/res/ResourcesCompat.java
index 63dbdb0..0b0141f 100644
--- a/core/src/main/java/androidx/core/content/res/ResourcesCompat.java
+++ b/core/src/main/java/androidx/core/content/res/ResourcesCompat.java
@@ -18,7 +18,7 @@
import static android.os.Build.VERSION.SDK_INT;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -262,7 +262,7 @@
* null.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public final void callbackSuccessAsync(final Typeface typeface, @Nullable Handler handler) {
if (handler == null) {
handler = new Handler(Looper.getMainLooper());
@@ -280,7 +280,7 @@
* null.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public final void callbackFailAsync(
@FontRequestFailReason final int reason, @Nullable Handler handler) {
if (handler == null) {
@@ -330,7 +330,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static Typeface getFont(@NonNull Context context, @FontRes int id, TypedValue value,
int style, @Nullable FontCallback fontCallback) throws NotFoundException {
if (context.isRestricted()) {
diff --git a/core/src/main/java/androidx/core/content/res/TypedArrayUtils.java b/core/src/main/java/androidx/core/content/res/TypedArrayUtils.java
index edacea2..db9e88a 100644
--- a/core/src/main/java/androidx/core/content/res/TypedArrayUtils.java
+++ b/core/src/main/java/androidx/core/content/res/TypedArrayUtils.java
@@ -15,7 +15,7 @@
*/
package androidx.core.content.res;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.ColorStateList;
@@ -45,7 +45,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class TypedArrayUtils {
private static final String NAMESPACE = "http://schemas.android.com/apk/res/android";
diff --git a/core/src/main/java/androidx/core/graphics/TypefaceCompat.java b/core/src/main/java/androidx/core/graphics/TypefaceCompat.java
index a55a4134..9257c71 100644
--- a/core/src/main/java/androidx/core/graphics/TypefaceCompat.java
+++ b/core/src/main/java/androidx/core/graphics/TypefaceCompat.java
@@ -16,7 +16,7 @@
package androidx.core.graphics;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Resources;
@@ -71,7 +71,7 @@
* @hide
*/
@Nullable
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static Typeface findFromCache(@NonNull Resources resources, int id, int style) {
return sTypefaceCache.get(createResourceUid(resources, id, style));
}
@@ -95,7 +95,7 @@
* @hide
*/
@Nullable
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static Typeface createFromResourcesFamilyXml(
@NonNull Context context, @NonNull FamilyResourceEntry entry,
@NonNull Resources resources, int id, int style,
@@ -136,7 +136,7 @@
* @hide
*/
@Nullable
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static Typeface createFromResourcesFontFile(
@NonNull Context context, @NonNull Resources resources, int id, String path,
int style) {
@@ -154,7 +154,7 @@
* @hide
*/
@Nullable
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static Typeface createFromFontInfo(@NonNull Context context,
@Nullable CancellationSignal cancellationSignal, @NonNull FontInfo[] fonts, int style) {
return sTypefaceCompatImpl.createFromFontInfo(context, cancellationSignal, fonts, style);
diff --git a/core/src/main/java/androidx/core/graphics/TypefaceCompatApi21Impl.java b/core/src/main/java/androidx/core/graphics/TypefaceCompatApi21Impl.java
index b544dcf..843f9e3 100644
--- a/core/src/main/java/androidx/core/graphics/TypefaceCompatApi21Impl.java
+++ b/core/src/main/java/androidx/core/graphics/TypefaceCompatApi21Impl.java
@@ -16,7 +16,7 @@
package androidx.core.graphics;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ContentResolver;
import android.content.Context;
@@ -49,7 +49,7 @@
* Implementation of the Typeface compat methods for API 21 and above.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(21)
class TypefaceCompatApi21Impl extends TypefaceCompatBaseImpl {
private static final String TAG = "TypefaceCompatApi21Impl";
diff --git a/core/src/main/java/androidx/core/graphics/TypefaceCompatApi24Impl.java b/core/src/main/java/androidx/core/graphics/TypefaceCompatApi24Impl.java
index 59bc562..9ca9845 100644
--- a/core/src/main/java/androidx/core/graphics/TypefaceCompatApi24Impl.java
+++ b/core/src/main/java/androidx/core/graphics/TypefaceCompatApi24Impl.java
@@ -16,7 +16,7 @@
package androidx.core.graphics;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Resources;
@@ -46,7 +46,7 @@
* Implementation of the Typeface compat methods for API 24 and above.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(24)
class TypefaceCompatApi24Impl extends TypefaceCompatBaseImpl {
private static final String TAG = "TypefaceCompatApi24Impl";
diff --git a/core/src/main/java/androidx/core/graphics/TypefaceCompatApi26Impl.java b/core/src/main/java/androidx/core/graphics/TypefaceCompatApi26Impl.java
index 84ca5ae..569b901 100644
--- a/core/src/main/java/androidx/core/graphics/TypefaceCompatApi26Impl.java
+++ b/core/src/main/java/androidx/core/graphics/TypefaceCompatApi26Impl.java
@@ -16,7 +16,7 @@
package androidx.core.graphics;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ContentResolver;
import android.content.Context;
@@ -49,7 +49,7 @@
* Implementation of the Typeface compat methods for API 26 and above.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(26)
public class TypefaceCompatApi26Impl extends TypefaceCompatApi21Impl {
private static final String TAG = "TypefaceCompatApi26Impl";
diff --git a/core/src/main/java/androidx/core/graphics/TypefaceCompatApi28Impl.java b/core/src/main/java/androidx/core/graphics/TypefaceCompatApi28Impl.java
index 4bc2756..5703675 100644
--- a/core/src/main/java/androidx/core/graphics/TypefaceCompatApi28Impl.java
+++ b/core/src/main/java/androidx/core/graphics/TypefaceCompatApi28Impl.java
@@ -16,7 +16,7 @@
package androidx.core.graphics;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Typeface;
@@ -31,7 +31,7 @@
* Implementation of the Typeface compat methods for API 28 and above.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(28)
public class TypefaceCompatApi28Impl extends TypefaceCompatApi26Impl {
private static final String CREATE_FROM_FAMILIES_WITH_DEFAULT_METHOD =
diff --git a/core/src/main/java/androidx/core/graphics/TypefaceCompatBaseImpl.java b/core/src/main/java/androidx/core/graphics/TypefaceCompatBaseImpl.java
index 2a717ec..221aaa8 100644
--- a/core/src/main/java/androidx/core/graphics/TypefaceCompatBaseImpl.java
+++ b/core/src/main/java/androidx/core/graphics/TypefaceCompatBaseImpl.java
@@ -16,7 +16,7 @@
package androidx.core.graphics;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Resources;
@@ -41,7 +41,7 @@
* Implementation of the Typeface compat methods for API 14 and above.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
class TypefaceCompatBaseImpl {
private static final String TAG = "TypefaceCompatBaseImpl";
private static final int INVALID_KEY = 0;
diff --git a/core/src/main/java/androidx/core/graphics/TypefaceCompatUtil.java b/core/src/main/java/androidx/core/graphics/TypefaceCompatUtil.java
index 1e6ca0e..128af4a 100644
--- a/core/src/main/java/androidx/core/graphics/TypefaceCompatUtil.java
+++ b/core/src/main/java/androidx/core/graphics/TypefaceCompatUtil.java
@@ -16,7 +16,7 @@
package androidx.core.graphics;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ContentResolver;
import android.content.Context;
@@ -45,7 +45,7 @@
* Utility methods for TypefaceCompat.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class TypefaceCompatUtil {
private static final String TAG = "TypefaceCompatUtil";
diff --git a/core/src/main/java/androidx/core/graphics/drawable/IconCompat.java b/core/src/main/java/androidx/core/graphics/drawable/IconCompat.java
index 845ef0c..ae03add 100644
--- a/core/src/main/java/androidx/core/graphics/drawable/IconCompat.java
+++ b/core/src/main/java/androidx/core/graphics/drawable/IconCompat.java
@@ -23,7 +23,7 @@
import static android.graphics.drawable.Icon.TYPE_URI;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.ActivityManager;
import android.content.ContentResolver;
@@ -122,7 +122,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY)
@ParcelField(value = 1,
defaultValue = "androidx.core.graphics.drawable.IconCompat.TYPE_UNKNOWN")
public int mType = TYPE_UNKNOWN;
@@ -201,7 +201,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY)
public static IconCompat createWithResource(Resources r, String pkg, @DrawableRes int resId) {
if (pkg == null) {
throw new IllegalArgumentException("Package must not be null.");
@@ -372,7 +372,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Nullable
public Bitmap getBitmap() {
if (mType == TYPE_UNKNOWN && Build.VERSION.SDK_INT >= 23) {
@@ -484,7 +484,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void checkResource(Context context) {
if (mType == TYPE_RESOURCE) {
String resPackage = (String) mObj1;
@@ -611,7 +611,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@SuppressWarnings("deprecation")
public void addToShortcutIntent(@NonNull Intent outIntent, @Nullable Drawable badge,
@NonNull Context c) {
@@ -887,7 +887,7 @@
* Creates an IconCompat from an Icon.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@RequiresApi(23)
@Nullable
public static IconCompat createFromIcon(@NonNull Icon icon) {
diff --git a/core/src/main/java/androidx/core/graphics/drawable/TintAwareDrawable.java b/core/src/main/java/androidx/core/graphics/drawable/TintAwareDrawable.java
index 4cc224f..651ab87 100644
--- a/core/src/main/java/androidx/core/graphics/drawable/TintAwareDrawable.java
+++ b/core/src/main/java/androidx/core/graphics/drawable/TintAwareDrawable.java
@@ -16,7 +16,7 @@
package androidx.core.graphics.drawable;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
@@ -30,7 +30,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface TintAwareDrawable {
void setTint(@ColorInt int tint);
void setTintList(ColorStateList tint);
diff --git a/core/src/main/java/androidx/core/graphics/drawable/WrappedDrawable.java b/core/src/main/java/androidx/core/graphics/drawable/WrappedDrawable.java
index 270264b..ff6de25 100644
--- a/core/src/main/java/androidx/core/graphics/drawable/WrappedDrawable.java
+++ b/core/src/main/java/androidx/core/graphics/drawable/WrappedDrawable.java
@@ -16,7 +16,7 @@
package androidx.core.graphics.drawable;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.drawable.Drawable;
@@ -28,7 +28,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface WrappedDrawable {
Drawable getWrappedDrawable();
void setWrappedDrawable(Drawable drawable);
diff --git a/core/src/main/java/androidx/core/internal/package-info.java b/core/src/main/java/androidx/core/internal/package-info.java
index 743237e..d7498be 100644
--- a/core/src/main/java/androidx/core/internal/package-info.java
+++ b/core/src/main/java/androidx/core/internal/package-info.java
@@ -1,9 +1,9 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
package androidx.core.internal;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
\ No newline at end of file
diff --git a/core/src/main/java/androidx/core/internal/view/SupportMenu.java b/core/src/main/java/androidx/core/internal/view/SupportMenu.java
index b3f70a0..db10567 100644
--- a/core/src/main/java/androidx/core/internal/view/SupportMenu.java
+++ b/core/src/main/java/androidx/core/internal/view/SupportMenu.java
@@ -16,7 +16,7 @@
package androidx.core.internal.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.KeyEvent;
@@ -31,7 +31,7 @@
* @see android.view.Menu
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface SupportMenu extends android.view.Menu {
/**
diff --git a/core/src/main/java/androidx/core/internal/view/SupportMenuItem.java b/core/src/main/java/androidx/core/internal/view/SupportMenuItem.java
index 53a8d6b..784e16e 100644
--- a/core/src/main/java/androidx/core/internal/view/SupportMenuItem.java
+++ b/core/src/main/java/androidx/core/internal/view/SupportMenuItem.java
@@ -16,7 +16,7 @@
package androidx.core.internal.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
@@ -36,7 +36,7 @@
* @see android.view.MenuItem
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface SupportMenuItem extends android.view.MenuItem {
/*
* These should be kept in sync with attrs.xml enum constants for showAsAction
diff --git a/core/src/main/java/androidx/core/internal/view/SupportSubMenu.java b/core/src/main/java/androidx/core/internal/view/SupportSubMenu.java
index fb8cb46..7ebb9d5 100644
--- a/core/src/main/java/androidx/core/internal/view/SupportSubMenu.java
+++ b/core/src/main/java/androidx/core/internal/view/SupportSubMenu.java
@@ -16,7 +16,7 @@
package androidx.core.internal.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
@@ -29,6 +29,6 @@
* @see android.view.SubMenu
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface SupportSubMenu extends SupportMenu, android.view.SubMenu {
}
diff --git a/core/src/main/java/androidx/core/location/LocationManagerCompat.java b/core/src/main/java/androidx/core/location/LocationManagerCompat.java
deleted file mode 100644
index 71f2c24..0000000
--- a/core/src/main/java/androidx/core/location/LocationManagerCompat.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2019 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.core.location;
-
-import android.location.LocationManager;
-import android.os.Build.VERSION;
-import android.os.Build.VERSION_CODES;
-
-import androidx.annotation.NonNull;
-
-/**
- * Helper for accessing features in {@link LocationManager}.
- */
-public final class LocationManagerCompat {
-
- /**
- * Returns the current enabled/disabled state of location.
- *
- * @return true if location is enabled and false if location is disabled.
- */
- public static boolean isLocationEnabled(@NonNull LocationManager locationManager) {
- if (VERSION.SDK_INT >= VERSION_CODES.P) {
- return locationManager.isLocationEnabled();
- } else {
- // NOTE: for KitKat and above, it's preferable to use the proper API at the time to get
- // the location mode, Secure.getInt(context, LOCATION_MODE, LOCATION_MODE_OFF). however,
- // this requires a context we don't have directly (we could either ask the client to
- // pass one in, or use reflection to get it from the location manager), and since KitKat
- // and above remained backwards compatible, we can fallback to pre-kitkat behavior.
-
- return locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)
- || locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
- }
- }
-
- private LocationManagerCompat() {}
-}
diff --git a/core/src/main/java/androidx/core/net/ConnectivityManagerCompat.java b/core/src/main/java/androidx/core/net/ConnectivityManagerCompat.java
index ff286af..333e9d3 100644
--- a/core/src/main/java/androidx/core/net/ConnectivityManagerCompat.java
+++ b/core/src/main/java/androidx/core/net/ConnectivityManagerCompat.java
@@ -26,7 +26,7 @@
import static android.net.ConnectivityManager.TYPE_WIFI;
import static android.net.ConnectivityManager.TYPE_WIMAX;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Intent;
import android.net.ConnectivityManager;
@@ -47,7 +47,7 @@
*/
public final class ConnectivityManagerCompat {
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
@IntDef(value = {
RESTRICT_BACKGROUND_STATUS_DISABLED,
diff --git a/core/src/main/java/androidx/core/provider/FontRequest.java b/core/src/main/java/androidx/core/provider/FontRequest.java
index 6fb880e..c539a04 100644
--- a/core/src/main/java/androidx/core/provider/FontRequest.java
+++ b/core/src/main/java/androidx/core/provider/FontRequest.java
@@ -16,7 +16,7 @@
package androidx.core.provider;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.util.Base64;
@@ -138,7 +138,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public String getIdentifier() {
return mIdentifier;
}
diff --git a/core/src/main/java/androidx/core/provider/FontsContractCompat.java b/core/src/main/java/androidx/core/provider/FontsContractCompat.java
index 7ac8df7..b6e7b4a 100644
--- a/core/src/main/java/androidx/core/provider/FontsContractCompat.java
+++ b/core/src/main/java/androidx/core/provider/FontsContractCompat.java
@@ -16,7 +16,7 @@
package androidx.core.provider;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.ContentResolver;
@@ -156,16 +156,16 @@
* returned to the ResultReceiver in getFont.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String PARCEL_FONT_RESULTS = "font_results";
// Error codes internal to the system, which can not come from a provider. To keep the number
// space open for new provider codes, these should all be negative numbers.
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
/* package */ static final int RESULT_CODE_PROVIDER_NOT_FOUND = -1;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
/* package */ static final int RESULT_CODE_WRONG_CERTIFICATES = -2;
// Note -3 is used by FontRequestCallback to indicate the font failed to load.
@@ -218,13 +218,13 @@
* Used for tests, should not be used otherwise.
* @hide
**/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static void resetCache() {
sTypefaceCache.evictAll();
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static Typeface getFontSync(final Context context, final FontRequest request,
final @Nullable ResourcesCompat.FontCallback fontCallback,
final @Nullable Handler handler, boolean isBlockingFetch, int timeout,
@@ -340,7 +340,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public FontInfo(@NonNull Uri uri, @IntRange(from = 0) int ttcIndex,
@IntRange(from = 1, to = 1000) int weight,
boolean italic, int resultCode) {
@@ -414,7 +414,7 @@
public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({STATUS_OK, STATUS_WRONG_CERTIFICATES, STATUS_UNEXPECTED_DATA_PROVIDED})
@Retention(RetentionPolicy.SOURCE)
@interface FontResultStatus {}
@@ -423,7 +423,7 @@
private final FontInfo[] mFonts;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public FontFamilyResult(@FontResultStatus int statusCode, @Nullable FontInfo[] fonts) {
mStatusCode = statusCode;
mFonts = fonts;
@@ -443,7 +443,7 @@
*/
public static class FontRequestCallback {
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int RESULT_OK = Columns.RESULT_CODE_OK;
/**
* Constant returned by {@link #onTypefaceRequestFailed(int)} signaling that the given
@@ -482,7 +482,7 @@
public static final int FAIL_REASON_MALFORMED_QUERY = Columns.RESULT_CODE_MALFORMED_QUERY;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({ FAIL_REASON_PROVIDER_NOT_FOUND, FAIL_REASON_FONT_LOAD_ERROR,
FAIL_REASON_FONT_NOT_FOUND, FAIL_REASON_FONT_UNAVAILABLE,
FAIL_REASON_MALFORMED_QUERY, FAIL_REASON_WRONG_CERTIFICATES,
@@ -673,7 +673,7 @@
* @return A map from {@link Uri} to {@link ByteBuffer}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
public static Map<Uri, ByteBuffer> prepareFontData(Context context, FontInfo[] fonts,
CancellationSignal cancellationSignal) {
@@ -728,7 +728,7 @@
/** @hide */
@VisibleForTesting
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static @Nullable ProviderInfo getProvider(@NonNull PackageManager packageManager,
@NonNull FontRequest request, @Nullable Resources resources)
throws PackageManager.NameNotFoundException {
diff --git a/core/src/main/java/androidx/core/provider/SelfDestructiveThread.java b/core/src/main/java/androidx/core/provider/SelfDestructiveThread.java
index 5575676..bf17e31 100644
--- a/core/src/main/java/androidx/core/provider/SelfDestructiveThread.java
+++ b/core/src/main/java/androidx/core/provider/SelfDestructiveThread.java
@@ -17,7 +17,7 @@
package androidx.core.provider;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Handler;
import android.os.HandlerThread;
@@ -39,7 +39,7 @@
* finished.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class SelfDestructiveThread {
private final Object mLock = new Object();
diff --git a/core/src/main/java/androidx/core/text/HtmlCompat.java b/core/src/main/java/androidx/core/text/HtmlCompat.java
index 8d9b932..265f90a 100644
--- a/core/src/main/java/androidx/core/text/HtmlCompat.java
+++ b/core/src/main/java/androidx/core/text/HtmlCompat.java
@@ -16,7 +16,7 @@
package androidx.core.text;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static java.lang.annotation.RetentionPolicy.SOURCE;
@@ -122,7 +122,7 @@
FROM_HTML_MODE_COMPACT,
FROM_HTML_MODE_LEGACY
}, flag = true)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(SOURCE)
@interface FromHtmlFlags {
}
@@ -132,7 +132,7 @@
TO_HTML_PARAGRAPH_LINES_CONSECUTIVE,
TO_HTML_PARAGRAPH_LINES_INDIVIDUAL
})
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(SOURCE)
@interface ToHtmlOptions {
}
diff --git a/core/src/main/java/androidx/core/text/ICUCompat.java b/core/src/main/java/androidx/core/text/ICUCompat.java
index b1260b2..25143d6 100644
--- a/core/src/main/java/androidx/core/text/ICUCompat.java
+++ b/core/src/main/java/androidx/core/text/ICUCompat.java
@@ -16,7 +16,6 @@
package androidx.core.text;
-import android.icu.util.ULocale;
import android.os.Build;
import android.util.Log;
@@ -33,7 +32,16 @@
private static Method sAddLikelySubtagsMethod;
static {
- if (Build.VERSION.SDK_INT < 21) {
+ if (Build.VERSION.SDK_INT >= 21) {
+ try {
+ // This class should always exist on API-21 since it's CTS tested.
+ final Class<?> clazz = Class.forName("libcore.icu.ICU");
+ sAddLikelySubtagsMethod = clazz.getMethod("addLikelySubtags",
+ new Class[]{ Locale.class });
+ } catch (Exception e) {
+ throw new IllegalStateException(e);
+ }
+ } else {
try {
final Class<?> clazz = Class.forName("libcore.icu.ICU");
if (clazz != null) {
@@ -49,15 +57,6 @@
// Nothing we can do here, we just log the exception
Log.w(TAG, e);
}
- } else if (Build.VERSION.SDK_INT < 24) {
- try {
- // This class should always exist on API-21 since it's CTS tested.
- final Class<?> clazz = Class.forName("libcore.icu.ICU");
- sAddLikelySubtagsMethod = clazz.getMethod("addLikelySubtags",
- new Class[]{ Locale.class });
- } catch (Exception e) {
- throw new IllegalStateException(e);
- }
}
}
@@ -86,10 +85,7 @@
*/
@Nullable
public static String maximizeAndGetScript(Locale locale) {
- if (Build.VERSION.SDK_INT >= 24) {
- ULocale uLocale = ULocale.addLikelySubtags(ULocale.forLocale(locale));
- return uLocale.getScript();
- } else if (Build.VERSION.SDK_INT >= 21) {
+ if (Build.VERSION.SDK_INT >= 21) {
try {
final Object[] args = new Object[] { locale };
return ((Locale) sAddLikelySubtagsMethod.invoke(null, args)).getScript();
diff --git a/core/src/main/java/androidx/core/text/PrecomputedTextCompat.java b/core/src/main/java/androidx/core/text/PrecomputedTextCompat.java
index 66d1a3e..34b2047 100644
--- a/core/src/main/java/androidx/core/text/PrecomputedTextCompat.java
+++ b/core/src/main/java/androidx/core/text/PrecomputedTextCompat.java
@@ -16,7 +16,7 @@
package androidx.core.text;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Build;
import android.text.Layout;
@@ -260,7 +260,7 @@
* Similar to equals but don't compare text direction
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean equalsWithoutTextDirection(@NonNull Params other) {
if (mWrapped != null) {
@@ -495,7 +495,7 @@
* Returns the underlying original text if the text is PrecomputedText.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@RequiresApi(28)
public @Nullable PrecomputedText getPrecomputedText() {
if (mText instanceof PrecomputedText) {
diff --git a/core/src/main/java/androidx/core/text/util/FindAddress.java b/core/src/main/java/androidx/core/text/util/FindAddress.java
index baad256..2bd2e5f 100644
--- a/core/src/main/java/androidx/core/text/util/FindAddress.java
+++ b/core/src/main/java/androidx/core/text/util/FindAddress.java
@@ -16,7 +16,7 @@
package androidx.core.text.util;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
@@ -32,7 +32,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
class FindAddress {
private static class ZipRange {
int mLow;
diff --git a/core/src/main/java/androidx/core/text/util/LinkifyCompat.java b/core/src/main/java/androidx/core/text/util/LinkifyCompat.java
index 493c688..3e86b63 100644
--- a/core/src/main/java/androidx/core/text/util/LinkifyCompat.java
+++ b/core/src/main/java/androidx/core/text/util/LinkifyCompat.java
@@ -16,7 +16,7 @@
package androidx.core.text.util;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.os.Build;
@@ -80,7 +80,7 @@
};
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef(flag = true, value = { Linkify.WEB_URLS, Linkify.EMAIL_ADDRESSES, Linkify.PHONE_NUMBERS,
Linkify.MAP_ADDRESSES, Linkify.ALL })
@Retention(RetentionPolicy.SOURCE)
diff --git a/core/src/main/java/androidx/core/util/DebugUtils.java b/core/src/main/java/androidx/core/util/DebugUtils.java
index 7b0d9be..20486f2 100644
--- a/core/src/main/java/androidx/core/util/DebugUtils.java
+++ b/core/src/main/java/androidx/core/util/DebugUtils.java
@@ -16,7 +16,7 @@
package androidx.core.util;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
@@ -25,7 +25,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class DebugUtils {
public static void buildShortClassTag(Object cls, StringBuilder out) {
diff --git a/core/src/main/java/androidx/core/util/LogWriter.java b/core/src/main/java/androidx/core/util/LogWriter.java
index 4359659..52eef6a 100644
--- a/core/src/main/java/androidx/core/util/LogWriter.java
+++ b/core/src/main/java/androidx/core/util/LogWriter.java
@@ -16,7 +16,7 @@
package androidx.core.util;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.util.Log;
@@ -29,7 +29,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class LogWriter extends Writer {
private final String mTag;
private StringBuilder mBuilder = new StringBuilder(128);
diff --git a/core/src/main/java/androidx/core/util/PatternsCompat.java b/core/src/main/java/androidx/core/util/PatternsCompat.java
index 41e0c394..a0ea74a 100644
--- a/core/src/main/java/androidx/core/util/PatternsCompat.java
+++ b/core/src/main/java/androidx/core/util/PatternsCompat.java
@@ -16,7 +16,7 @@
package androidx.core.util;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
@@ -299,7 +299,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final Pattern AUTOLINK_WEB_URL = Pattern.compile(
"(" + WEB_URL_WITH_PROTOCOL + "|" + WEB_URL_WITHOUT_PROTOCOL + ")");
@@ -328,7 +328,7 @@
* and the special characters #&~!^`{}/=$*?| that are included in RFC5321.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final Pattern AUTOLINK_EMAIL_ADDRESS = Pattern.compile("(" + WORD_BOUNDARY +
"(?:" + EMAIL_ADDRESS_LOCAL_PART + "@" + EMAIL_ADDRESS_DOMAIN + ")" +
WORD_BOUNDARY + ")"
diff --git a/core/src/main/java/androidx/core/util/Preconditions.java b/core/src/main/java/androidx/core/util/Preconditions.java
index aa32684..2cae25a 100644
--- a/core/src/main/java/androidx/core/util/Preconditions.java
+++ b/core/src/main/java/androidx/core/util/Preconditions.java
@@ -29,7 +29,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public final class Preconditions {
public static void checkArgument(boolean expression) {
if (!expression) {
diff --git a/core/src/main/java/androidx/core/util/TimeUtils.java b/core/src/main/java/androidx/core/util/TimeUtils.java
index 206d372..8950ea5c 100644
--- a/core/src/main/java/androidx/core/util/TimeUtils.java
+++ b/core/src/main/java/androidx/core/util/TimeUtils.java
@@ -16,7 +16,7 @@
package androidx.core.util;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
@@ -27,10 +27,10 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class TimeUtils {
/** @hide Field length that can hold 999 days of time */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int HUNDRED_DAY_FIELD_LEN = 19;
private static final int SECONDS_PER_MINUTE = 60;
@@ -149,7 +149,7 @@
}
/** @hide Just for debugging; not internationalized. */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static void formatDuration(long duration, StringBuilder builder) {
synchronized (sFormatSync) {
int len = formatDurationLocked(duration, 0);
@@ -158,7 +158,7 @@
}
/** @hide Just for debugging; not internationalized. */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static void formatDuration(long duration, PrintWriter pw, int fieldLen) {
synchronized (sFormatSync) {
int len = formatDurationLocked(duration, fieldLen);
@@ -167,13 +167,13 @@
}
/** @hide Just for debugging; not internationalized. */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static void formatDuration(long duration, PrintWriter pw) {
formatDuration(duration, pw, 0);
}
/** @hide Just for debugging; not internationalized. */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static void formatDuration(long time, long now, PrintWriter pw) {
if (time == 0) {
pw.print("--");
diff --git a/core/src/main/java/androidx/core/view/AccessibilityDelegateCompat.java b/core/src/main/java/androidx/core/view/AccessibilityDelegateCompat.java
index 640c588..1db8f22 100644
--- a/core/src/main/java/androidx/core/view/AccessibilityDelegateCompat.java
+++ b/core/src/main/java/androidx/core/view/AccessibilityDelegateCompat.java
@@ -16,7 +16,7 @@
package androidx.core.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Build;
import android.os.Bundle;
@@ -142,7 +142,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public AccessibilityDelegateCompat(AccessibilityDelegate originalDelegate) {
mOriginalDelegate = originalDelegate;
mBridge = new AccessibilityDelegateAdapter(this);
diff --git a/core/src/main/java/androidx/core/view/ActionProvider.java b/core/src/main/java/androidx/core/view/ActionProvider.java
index 8282642..0cd19f0 100644
--- a/core/src/main/java/androidx/core/view/ActionProvider.java
+++ b/core/src/main/java/androidx/core/view/ActionProvider.java
@@ -16,7 +16,7 @@
package androidx.core.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.util.Log;
@@ -274,7 +274,7 @@
*
* @hide Pending future API approval
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void subUiVisibilityChanged(boolean isVisible) {
if (mSubUiVisibilityListener != null) {
mSubUiVisibilityListener.onSubUiVisibilityChanged(isVisible);
@@ -284,7 +284,7 @@
/**
* @hide Internal use only
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setSubUiVisibilityListener(SubUiVisibilityListener listener) {
mSubUiVisibilityListener = listener;
}
@@ -307,7 +307,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void reset() {
mVisibilityListener = null;
mSubUiVisibilityListener = null;
@@ -316,7 +316,7 @@
/**
* @hide Internal use only
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public interface SubUiVisibilityListener {
void onSubUiVisibilityChanged(boolean isVisible);
diff --git a/core/src/main/java/androidx/core/view/DragAndDropPermissionsCompat.java b/core/src/main/java/androidx/core/view/DragAndDropPermissionsCompat.java
index a301729..3f2e787 100644
--- a/core/src/main/java/androidx/core/view/DragAndDropPermissionsCompat.java
+++ b/core/src/main/java/androidx/core/view/DragAndDropPermissionsCompat.java
@@ -16,7 +16,7 @@
package androidx.core.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Activity;
import android.os.Build;
@@ -38,7 +38,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Nullable
public static DragAndDropPermissionsCompat request(Activity activity, DragEvent dragEvent) {
if (Build.VERSION.SDK_INT >= 24) {
diff --git a/core/src/main/java/androidx/core/view/KeyEventDispatcher.java b/core/src/main/java/androidx/core/view/KeyEventDispatcher.java
index 820d463..2dffda8 100644
--- a/core/src/main/java/androidx/core/view/KeyEventDispatcher.java
+++ b/core/src/main/java/androidx/core/view/KeyEventDispatcher.java
@@ -40,7 +40,7 @@
* This must be used for some core compatibility features to function fully.
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class KeyEventDispatcher {
// reflection accessors
private static boolean sActionBarFieldsFetched = false;
diff --git a/core/src/main/java/androidx/core/view/PointerIconCompat.java b/core/src/main/java/androidx/core/view/PointerIconCompat.java
index 7d23936..54e55d7 100644
--- a/core/src/main/java/androidx/core/view/PointerIconCompat.java
+++ b/core/src/main/java/androidx/core/view/PointerIconCompat.java
@@ -18,7 +18,7 @@
import static android.os.Build.VERSION.SDK_INT;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Resources;
@@ -111,7 +111,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Object getPointerIcon() {
return mPointerIcon;
}
diff --git a/core/src/main/java/androidx/core/view/ViewCompat.java b/core/src/main/java/androidx/core/view/ViewCompat.java
index f5925bd..fdeaa5b 100644
--- a/core/src/main/java/androidx/core/view/ViewCompat.java
+++ b/core/src/main/java/androidx/core/view/ViewCompat.java
@@ -16,7 +16,7 @@
package androidx.core.view;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
@@ -86,20 +86,20 @@
private static final String TAG = "ViewCompat";
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({View.FOCUS_LEFT, View.FOCUS_UP, View.FOCUS_RIGHT, View.FOCUS_DOWN,
View.FOCUS_FORWARD, View.FOCUS_BACKWARD})
@Retention(RetentionPolicy.SOURCE)
public @interface FocusDirection {}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({View.FOCUS_LEFT, View.FOCUS_UP, View.FOCUS_RIGHT, View.FOCUS_DOWN})
@Retention(RetentionPolicy.SOURCE)
public @interface FocusRealDirection {}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({View.FOCUS_FORWARD, View.FOCUS_BACKWARD})
@Retention(RetentionPolicy.SOURCE)
public @interface FocusRelativeDirection {}
@@ -352,7 +352,7 @@
*/
@IntDef(value = {SCROLL_AXIS_NONE, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_VERTICAL}, flag = true)
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface ScrollAxis {}
/**
@@ -375,7 +375,7 @@
*/
@IntDef({TYPE_TOUCH, TYPE_NON_TOUCH})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface NestedScrollType {}
/**
@@ -390,7 +390,7 @@
public static final int TYPE_NON_TOUCH = 1;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
@IntDef(flag = true,
value = {
diff --git a/core/src/main/java/androidx/core/view/accessibility/AccessibilityClickableSpanCompat.java b/core/src/main/java/androidx/core/view/accessibility/AccessibilityClickableSpanCompat.java
index 4d1ddd67..9a79391 100644
--- a/core/src/main/java/androidx/core/view/accessibility/AccessibilityClickableSpanCompat.java
+++ b/core/src/main/java/androidx/core/view/accessibility/AccessibilityClickableSpanCompat.java
@@ -15,7 +15,7 @@
*/
package androidx.core.view.accessibility;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
import android.text.style.ClickableSpan;
@@ -41,7 +41,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String SPAN_ID = "ACCESSIBILITY_CLICKABLE_SPAN_ID";
/**
@@ -49,7 +49,7 @@
* @param nodeInfoCompat The nodeInfoCompat to be associated with this span.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public AccessibilityClickableSpanCompat(int originalClickableSpanId,
AccessibilityNodeInfoCompat nodeInfoCompat, int clickableSpanActionId) {
mOriginalClickableSpanId = originalClickableSpanId;
diff --git a/core/src/main/java/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java b/core/src/main/java/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java
index 2f784ae..ef4b19b 100644
--- a/core/src/main/java/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java
+++ b/core/src/main/java/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java
@@ -16,7 +16,7 @@
package androidx.core.view.accessibility;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Rect;
import android.os.Build;
@@ -510,7 +510,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected final AccessibilityViewCommand mCommand;
/**
@@ -531,7 +531,7 @@
* @param command The command performed when the service requests the action
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public AccessibilityActionCompat(int actionId, CharSequence label,
AccessibilityViewCommand command) {
this(null, actionId, label, command, null);
@@ -594,7 +594,7 @@
* @param arguments Optional action arguments.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean perform(View view, Bundle arguments) {
if (mCommand != null) {
CommandArguments viewCommandArgument = null;
@@ -618,7 +618,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public AccessibilityActionCompat createReplacementAction(CharSequence label,
AccessibilityViewCommand command) {
return new AccessibilityActionCompat(null, mId, label, command,
@@ -1040,7 +1040,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public int mParentVirtualDescendantId = -1;
// Actions introduced in IceCreamSandwich
@@ -2472,7 +2472,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void addSpansToExtras(CharSequence text, View view) {
if (Build.VERSION.SDK_INT >= 19 && Build.VERSION.SDK_INT < 26) {
clearExtrasSpans();
@@ -2508,7 +2508,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static ClickableSpan[] getClickableSpans(CharSequence text) {
if (text instanceof Spanned) {
Spanned spanned = (Spanned) text;
diff --git a/core/src/main/java/androidx/core/view/accessibility/AccessibilityViewCommand.java b/core/src/main/java/androidx/core/view/accessibility/AccessibilityViewCommand.java
index 00bf9ba..37037a0 100644
--- a/core/src/main/java/androidx/core/view/accessibility/AccessibilityViewCommand.java
+++ b/core/src/main/java/androidx/core/view/accessibility/AccessibilityViewCommand.java
@@ -16,7 +16,7 @@
package androidx.core.view.accessibility;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
import android.view.View;
@@ -51,7 +51,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setBundle(Bundle bundle) {
mBundle = bundle;
}
diff --git a/core/src/main/java/androidx/core/view/inputmethod/InputConnectionCompat.java b/core/src/main/java/androidx/core/view/inputmethod/InputConnectionCompat.java
index 220a989..ce1b502 100644
--- a/core/src/main/java/androidx/core/view/inputmethod/InputConnectionCompat.java
+++ b/core/src/main/java/androidx/core/view/inputmethod/InputConnectionCompat.java
@@ -131,7 +131,7 @@
*
* <p>Make sure that the content provider owning the Uri sets the
* {@link android.R.attr#grantUriPermissions grantUriPermissions} attribute in its manifest or
- * included the {@code <grant-uri-permissions>} tag.</p>
+ * included the {@code <grant-uri-permissions>} tag.</p>
*
* <p>Supported only on API >= 25.</p>
*
diff --git a/core/src/main/java/androidx/core/widget/AutoSizeableTextView.java b/core/src/main/java/androidx/core/widget/AutoSizeableTextView.java
index 315f298..93994c5 100644
--- a/core/src/main/java/androidx/core/widget/AutoSizeableTextView.java
+++ b/core/src/main/java/androidx/core/widget/AutoSizeableTextView.java
@@ -16,7 +16,7 @@
package androidx.core.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Build;
import android.util.TypedValue;
@@ -30,12 +30,12 @@
*
* @hide Internal use only
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface AutoSizeableTextView {
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
boolean PLATFORM_SUPPORTS_AUTOSIZE = Build.VERSION.SDK_INT >= 27;
/**
diff --git a/core/src/main/java/androidx/core/widget/ImageViewCompat.java b/core/src/main/java/androidx/core/widget/ImageViewCompat.java
index 61fb20b..3ec5b88 100644
--- a/core/src/main/java/androidx/core/widget/ImageViewCompat.java
+++ b/core/src/main/java/androidx/core/widget/ImageViewCompat.java
@@ -54,7 +54,9 @@
// Work around a bug in L that did not update the state of the image source
// after applying the tint
Drawable imageViewDrawable = view.getDrawable();
- if ((imageViewDrawable != null) && (view.getImageTintList() != null)) {
+ boolean hasTint = (view.getImageTintList() != null)
+ && (view.getImageTintMode() != null);
+ if ((imageViewDrawable != null) && hasTint) {
if (imageViewDrawable.isStateful()) {
imageViewDrawable.setState(view.getDrawableState());
}
@@ -92,7 +94,9 @@
// Work around a bug in L that did not update the state of the image source
// after applying the tint
Drawable imageViewDrawable = view.getDrawable();
- if ((imageViewDrawable != null) && (view.getImageTintList() != null)) {
+ boolean hasTint = (view.getImageTintList() != null)
+ && (view.getImageTintMode() != null);
+ if ((imageViewDrawable != null) && hasTint) {
if (imageViewDrawable.isStateful()) {
imageViewDrawable.setState(view.getDrawableState());
}
diff --git a/core/src/main/java/androidx/core/widget/NestedScrollView.java b/core/src/main/java/androidx/core/widget/NestedScrollView.java
index cc8ee0c..944d86d 100644
--- a/core/src/main/java/androidx/core/widget/NestedScrollView.java
+++ b/core/src/main/java/androidx/core/widget/NestedScrollView.java
@@ -17,7 +17,7 @@
package androidx.core.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.TypedArray;
@@ -1447,7 +1447,7 @@
* children.</p>
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int computeVerticalScrollRange() {
final int count = getChildCount();
@@ -1471,35 +1471,35 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int computeVerticalScrollOffset() {
return Math.max(0, super.computeVerticalScrollOffset());
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int computeVerticalScrollExtent() {
return super.computeVerticalScrollExtent();
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int computeHorizontalScrollRange() {
return super.computeHorizontalScrollRange();
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int computeHorizontalScrollOffset() {
return super.computeHorizontalScrollOffset();
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public int computeHorizontalScrollExtent() {
return super.computeHorizontalScrollExtent();
diff --git a/core/src/main/java/androidx/core/widget/TextViewCompat.java b/core/src/main/java/androidx/core/widget/TextViewCompat.java
index 9597110..86476ce 100644
--- a/core/src/main/java/androidx/core/widget/TextViewCompat.java
+++ b/core/src/main/java/androidx/core/widget/TextViewCompat.java
@@ -24,16 +24,14 @@
import static android.view.View.TEXT_DIRECTION_LTR;
import static android.view.View.TEXT_DIRECTION_RTL;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
-import android.content.res.ColorStateList;
import android.graphics.Paint;
-import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.icu.text.DecimalFormatSymbols;
import android.os.Build;
@@ -90,7 +88,7 @@
public static final int AUTO_SIZE_TEXT_TYPE_UNIFORM = TextView.AUTO_SIZE_TEXT_TYPE_UNIFORM;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({AUTO_SIZE_TEXT_TYPE_NONE, AUTO_SIZE_TEXT_TYPE_UNIFORM})
@Retention(RetentionPolicy.SOURCE)
public @interface AutoSizeTextType {}
@@ -511,7 +509,7 @@
* @see #setCustomSelectionActionModeCallback(TextView, ActionMode.Callback)
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@NonNull
public static ActionMode.Callback wrapCustomSelectionActionModeCallback(
@NonNull final TextView textView,
@@ -974,73 +972,4 @@
return TEXT_DIRECTION_FIRST_STRONG;
}
}
-
- /**
- * Applies a tint to any compound drawables.
- * <p>
- * This will always take effect when running on API v23 or newer. When running on platforms
- * previous to API v23, it will only take effect if {@code textView} implements the
- * {@code TintableCompoundDrawablesView} interface.
- */
- public static void setCompoundDrawableTintList(@NonNull TextView textView,
- @Nullable ColorStateList tint) {
- Preconditions.checkNotNull(textView);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- textView.setCompoundDrawableTintList(tint);
- } else if (textView instanceof TintableCompoundDrawablesView) {
- ((TintableCompoundDrawablesView) textView).setSupportCompoundDrawablesTintList(tint);
- }
- }
-
- /**
- * Return the tint applied to any compound drawables.
- * <p>
- * Only returns meaningful info when running on API v23 or newer, or if {@code textView}
- * implements the {@code TintableCompoundDrawablesView} interface.
- */
- @Nullable
- public static ColorStateList getCompoundDrawableTintList(@NonNull TextView textView) {
- Preconditions.checkNotNull(textView);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- return textView.getCompoundDrawableTintList();
- } else if (textView instanceof TintableCompoundDrawablesView) {
- return ((TintableCompoundDrawablesView) textView).getSupportCompoundDrawablesTintList();
- }
- return null;
- }
-
- /**
- * Applies a tint mode to any compound drawables.
- * <p>
- * This will always take effect when running on API v23 or newer. When running on platforms
- * previous to API v23, it will only take effect if {@code textView} implements the
- * {@code TintableCompoundDrawablesView} interface.
- */
- public static void setCompoundDrawableTintMode(@NonNull TextView textView,
- @Nullable PorterDuff.Mode tintMode) {
- Preconditions.checkNotNull(textView);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- textView.setCompoundDrawableTintMode(tintMode);
- } else if (textView instanceof TintableCompoundDrawablesView) {
- ((TintableCompoundDrawablesView) textView).setSupportCompoundDrawablesTintMode(
- tintMode);
- }
- }
-
- /**
- * Return the tint mode applied to any compound drawables.
- * <p>
- * Only returns meaningful info when running on API v23 or newer, or if {@code textView}
- * implements the {@code TintableCompoundDrawablesView} interface.
- */
- @Nullable
- public static PorterDuff.Mode getCompoundDrawableTintMode(@NonNull TextView textView) {
- Preconditions.checkNotNull(textView);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- return textView.getCompoundDrawableTintMode();
- } else if (textView instanceof TintableCompoundDrawablesView) {
- return ((TintableCompoundDrawablesView) textView).getSupportCompoundDrawablesTintMode();
- }
- return null;
- }
}
diff --git a/core/src/main/java/androidx/core/widget/TintableCompoundDrawablesView.java b/core/src/main/java/androidx/core/widget/TintableCompoundDrawablesView.java
deleted file mode 100644
index 212d603..0000000
--- a/core/src/main/java/androidx/core/widget/TintableCompoundDrawablesView.java
+++ /dev/null
@@ -1,73 +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.core.widget;
-
-import android.content.res.ColorStateList;
-import android.graphics.PorterDuff;
-
-import androidx.annotation.Nullable;
-
-/**
- * Interface which allows {@link android.widget.TextView} and subclasses to tint compound drawables
- * with {@link TextViewCompat} when running on API v22 devices or lower.
- */
-public interface TintableCompoundDrawablesView {
- /**
- * Applies a tint to the compound drawables. Does not modify the
- * current tint mode, which is {@link PorterDuff.Mode#SRC_IN} by default.
- * <p>
- * Subsequent calls to
- * {@link android.widget.TextView#setCompoundDrawables(Drawable, Drawable, Drawable, Drawable)}
- * and related methods will automatically mutate the drawables and apply
- * the specified tint and tint mode.
- *
- * @param tint the tint to apply, may be {@code null} to clear tint
- * @see #getSupportCompoundDrawablesTintList()
- */
- void setSupportCompoundDrawablesTintList(@Nullable ColorStateList tint);
-
- /**
- * Return the tint applied to the compound drawables, if specified.
- *
- * @return the tint applied to the compound drawables
- */
- @Nullable
- ColorStateList getSupportCompoundDrawablesTintList();
-
- /**
- * Specifies the blending mode used to apply the tint specified by
- * {@link #setSupportCompoundDrawablesTintList(ColorStateList)} to the compound
- * drawables. The default mode is {@link PorterDuff.Mode#SRC_IN}.
- *
- * @param tintMode the blending mode used to apply the tint, may be
- * {@code null} to clear tint
- * @see #getSupportCompoundDrawablesTintMode()
- * @see #setSupportCompoundDrawablesTintList(ColorStateList)
- */
- void setSupportCompoundDrawablesTintMode(@Nullable PorterDuff.Mode tintMode);
-
- /**
- * Returns the blending mode used to apply the tint to the compound
- * drawables, if specified.
- *
- * @return the blending mode used to apply the tint to the compound
- * drawables
- * @see #setSupportCompoundDrawablesTintMode(PorterDuff.Mode)
- */
- @Nullable
- PorterDuff.Mode getSupportCompoundDrawablesTintMode();
-}
diff --git a/core/src/main/java/androidx/core/widget/TintableImageSourceView.java b/core/src/main/java/androidx/core/widget/TintableImageSourceView.java
index 1bf8732..63cfa92 100644
--- a/core/src/main/java/androidx/core/widget/TintableImageSourceView.java
+++ b/core/src/main/java/androidx/core/widget/TintableImageSourceView.java
@@ -16,7 +16,7 @@
package androidx.core.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
@@ -30,7 +30,7 @@
*
* @hide Internal use only
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface TintableImageSourceView {
/**
diff --git a/cursoradapter/api/1.0.0.txt b/cursoradapter/api/1.0.0.txt
index f70e257..691a875 100644
--- a/cursoradapter/api/1.0.0.txt
+++ b/cursoradapter/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.cursoradapter.widget {
public abstract class CursorAdapter extends android.widget.BaseAdapter implements android.widget.Filterable {
diff --git a/cursoradapter/api/1.1.0-alpha01.txt b/cursoradapter/api/1.1.0-alpha01.txt
deleted file mode 100644
index f70e257..0000000
--- a/cursoradapter/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-// Signature format: 3.0
-package androidx.cursoradapter.widget {
-
- public abstract class CursorAdapter extends android.widget.BaseAdapter implements android.widget.Filterable {
- ctor @Deprecated public CursorAdapter(android.content.Context!, android.database.Cursor!);
- ctor public CursorAdapter(android.content.Context!, android.database.Cursor!, boolean);
- ctor public CursorAdapter(android.content.Context!, android.database.Cursor!, int);
- method public abstract void bindView(android.view.View!, android.content.Context!, android.database.Cursor!);
- method public void changeCursor(android.database.Cursor!);
- method public CharSequence! convertToString(android.database.Cursor!);
- method public int getCount();
- method public android.database.Cursor! getCursor();
- method public android.widget.Filter! getFilter();
- method public android.widget.FilterQueryProvider! getFilterQueryProvider();
- method public Object! getItem(int);
- method public long getItemId(int);
- method public android.view.View! getView(int, android.view.View!, android.view.ViewGroup!);
- method @Deprecated protected void init(android.content.Context!, android.database.Cursor!, boolean);
- method public android.view.View! newDropDownView(android.content.Context!, android.database.Cursor!, android.view.ViewGroup!);
- method public abstract android.view.View! newView(android.content.Context!, android.database.Cursor!, android.view.ViewGroup!);
- method protected void onContentChanged();
- method public android.database.Cursor! runQueryOnBackgroundThread(CharSequence!);
- method public void setFilterQueryProvider(android.widget.FilterQueryProvider!);
- method public android.database.Cursor! swapCursor(android.database.Cursor!);
- field @Deprecated public static final int FLAG_AUTO_REQUERY = 1; // 0x1
- field public static final int FLAG_REGISTER_CONTENT_OBSERVER = 2; // 0x2
- }
-
- public abstract class ResourceCursorAdapter extends androidx.cursoradapter.widget.CursorAdapter {
- ctor @Deprecated public ResourceCursorAdapter(android.content.Context!, int, android.database.Cursor!);
- ctor @Deprecated public ResourceCursorAdapter(android.content.Context!, int, android.database.Cursor!, boolean);
- ctor public ResourceCursorAdapter(android.content.Context!, int, android.database.Cursor!, int);
- method public android.view.View! newView(android.content.Context!, android.database.Cursor!, android.view.ViewGroup!);
- method public void setDropDownViewResource(int);
- method public void setViewResource(int);
- }
-
- public class SimpleCursorAdapter extends androidx.cursoradapter.widget.ResourceCursorAdapter {
- ctor @Deprecated public SimpleCursorAdapter(android.content.Context!, int, android.database.Cursor!, String[]!, int[]!);
- ctor public SimpleCursorAdapter(android.content.Context!, int, android.database.Cursor!, String[]!, int[]!, int);
- method public void bindView(android.view.View!, android.content.Context!, android.database.Cursor!);
- method public void changeCursorAndColumns(android.database.Cursor!, String[]!, int[]!);
- method public androidx.cursoradapter.widget.SimpleCursorAdapter.CursorToStringConverter! getCursorToStringConverter();
- method public int getStringConversionColumn();
- method public androidx.cursoradapter.widget.SimpleCursorAdapter.ViewBinder! getViewBinder();
- method public void setCursorToStringConverter(androidx.cursoradapter.widget.SimpleCursorAdapter.CursorToStringConverter!);
- method public void setStringConversionColumn(int);
- method public void setViewBinder(androidx.cursoradapter.widget.SimpleCursorAdapter.ViewBinder!);
- method public void setViewImage(android.widget.ImageView!, String!);
- method public void setViewText(android.widget.TextView!, String!);
- }
-
- public static interface SimpleCursorAdapter.CursorToStringConverter {
- method public CharSequence! convertToString(android.database.Cursor!);
- }
-
- public static interface SimpleCursorAdapter.ViewBinder {
- method public boolean setViewValue(android.view.View!, android.database.Cursor!, int);
- }
-
-}
-
diff --git a/cursoradapter/api/current.txt b/cursoradapter/api/current.txt
index f70e257..691a875 100644
--- a/cursoradapter/api/current.txt
+++ b/cursoradapter/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.cursoradapter.widget {
public abstract class CursorAdapter extends android.widget.BaseAdapter implements android.widget.Filterable {
diff --git a/cursoradapter/api/res-1.1.0-alpha01.txt b/cursoradapter/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/cursoradapter/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/cursoradapter/api/restricted_1.0.0.txt b/cursoradapter/api/restricted_1.0.0.txt
deleted file mode 100644
index 1afaa3d..0000000
--- a/cursoradapter/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-// Signature format: 3.0
-package androidx.cursoradapter.widget {
-
- public abstract class CursorAdapter {
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected boolean mAutoRequery;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected androidx.cursoradapter.widget.CursorAdapter.ChangeObserver! mChangeObserver;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected android.content.Context! mContext;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected android.database.Cursor! mCursor;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected androidx.cursoradapter.widget.CursorFilter! mCursorFilter;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected android.database.DataSetObserver! mDataSetObserver;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected boolean mDataValid;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected android.widget.FilterQueryProvider! mFilterQueryProvider;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected int mRowIDColumn;
- }
-
- public class SimpleCursorAdapter extends androidx.cursoradapter.widget.ResourceCursorAdapter {
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected int[]! mFrom;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected int[]! mTo;
- }
-
-}
-
diff --git a/cursoradapter/build.gradle b/cursoradapter/build.gradle
index b137fc9..3e3cdbb 100644
--- a/cursoradapter/build.gradle
+++ b/cursoradapter/build.gradle
@@ -17,5 +17,4 @@
inceptionYear = "2018"
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
- trackRestrictedAPIs = false
}
diff --git a/cursoradapter/src/main/java/androidx/cursoradapter/widget/CursorAdapter.java b/cursoradapter/src/main/java/androidx/cursoradapter/widget/CursorAdapter.java
index 8f875af..39f547f 100644
--- a/cursoradapter/src/main/java/androidx/cursoradapter/widget/CursorAdapter.java
+++ b/cursoradapter/src/main/java/androidx/cursoradapter/widget/CursorAdapter.java
@@ -16,7 +16,7 @@
package androidx.cursoradapter.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.database.ContentObserver;
@@ -46,55 +46,55 @@
* This field should be made private, so it is hidden from the SDK.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected boolean mDataValid;
/**
* This field should be made private, so it is hidden from the SDK.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected boolean mAutoRequery;
/**
* This field should be made private, so it is hidden from the SDK.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected Cursor mCursor;
/**
* This field should be made private, so it is hidden from the SDK.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected Context mContext;
/**
* This field should be made private, so it is hidden from the SDK.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected int mRowIDColumn;
/**
* This field should be made private, so it is hidden from the SDK.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected ChangeObserver mChangeObserver;
/**
* This field should be made private, so it is hidden from the SDK.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected DataSetObserver mDataSetObserver;
/**
* This field should be made private, so it is hidden from the SDK.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected CursorFilter mCursorFilter;
/**
* This field should be made private, so it is hidden from the SDK.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected FilterQueryProvider mFilterQueryProvider;
/**
diff --git a/cursoradapter/src/main/java/androidx/cursoradapter/widget/SimpleCursorAdapter.java b/cursoradapter/src/main/java/androidx/cursoradapter/widget/SimpleCursorAdapter.java
index 219b03d..20537fd 100644
--- a/cursoradapter/src/main/java/androidx/cursoradapter/widget/SimpleCursorAdapter.java
+++ b/cursoradapter/src/main/java/androidx/cursoradapter/widget/SimpleCursorAdapter.java
@@ -16,7 +16,7 @@
package androidx.cursoradapter.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.database.Cursor;
@@ -40,14 +40,14 @@
* This field should be made private, so it is hidden from the SDK.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected int[] mFrom;
/**
* A list of View ids representing the views to which the data must be bound.
* This field should be made private, so it is hidden from the SDK.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected int[] mTo;
private int mStringConversionColumn = -1;
diff --git a/customview/api/1.0.0.txt b/customview/api/1.0.0.txt
index d5249c0..03155c6 100644
--- a/customview/api/1.0.0.txt
+++ b/customview/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.customview.view {
public abstract class AbsSavedState implements android.os.Parcelable {
diff --git a/customview/api/1.1.0-alpha01.txt b/customview/api/1.1.0-alpha01.txt
deleted file mode 100644
index d5249c0..0000000
--- a/customview/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-// Signature format: 3.0
-package androidx.customview.view {
-
- public abstract class AbsSavedState implements android.os.Parcelable {
- ctor protected AbsSavedState(android.os.Parcelable);
- ctor protected AbsSavedState(android.os.Parcel);
- ctor protected AbsSavedState(android.os.Parcel, ClassLoader?);
- method public int describeContents();
- method public final android.os.Parcelable? getSuperState();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<androidx.customview.view.AbsSavedState>! CREATOR;
- field public static final androidx.customview.view.AbsSavedState! EMPTY_STATE;
- }
-
-}
-
-package androidx.customview.widget {
-
- public abstract class ExploreByTouchHelper extends androidx.core.view.AccessibilityDelegateCompat {
- ctor public ExploreByTouchHelper(android.view.View);
- method public final boolean clearKeyboardFocusForVirtualView(int);
- method public final boolean dispatchHoverEvent(android.view.MotionEvent);
- method public final boolean dispatchKeyEvent(android.view.KeyEvent);
- method public final int getAccessibilityFocusedVirtualViewId();
- method @Deprecated public int getFocusedVirtualView();
- method public final int getKeyboardFocusedVirtualViewId();
- method protected abstract int getVirtualViewAt(float, float);
- method protected abstract void getVisibleVirtualViews(java.util.List<java.lang.Integer>!);
- method public final void invalidateRoot();
- method public final void invalidateVirtualView(int);
- method public final void invalidateVirtualView(int, int);
- method public final void onFocusChanged(boolean, int, android.graphics.Rect?);
- method protected abstract boolean onPerformActionForVirtualView(int, int, android.os.Bundle?);
- method protected void onPopulateEventForHost(android.view.accessibility.AccessibilityEvent);
- method protected void onPopulateEventForVirtualView(int, android.view.accessibility.AccessibilityEvent);
- method protected void onPopulateNodeForHost(androidx.core.view.accessibility.AccessibilityNodeInfoCompat);
- method protected abstract void onPopulateNodeForVirtualView(int, androidx.core.view.accessibility.AccessibilityNodeInfoCompat);
- method protected void onVirtualViewKeyboardFocusChanged(int, boolean);
- method public final boolean requestKeyboardFocusForVirtualView(int);
- method public final boolean sendEventForVirtualView(int, int);
- field public static final int HOST_ID = -1; // 0xffffffff
- field public static final int INVALID_ID = -2147483648; // 0x80000000
- }
-
- public class ViewDragHelper {
- method public void abort();
- method protected boolean canScroll(android.view.View, boolean, int, int, int, int);
- method public void cancel();
- method public void captureChildView(android.view.View, int);
- method public boolean checkTouchSlop(int);
- method public boolean checkTouchSlop(int, int);
- method public boolean continueSettling(boolean);
- method public static androidx.customview.widget.ViewDragHelper! create(android.view.ViewGroup, androidx.customview.widget.ViewDragHelper.Callback);
- method public static androidx.customview.widget.ViewDragHelper! create(android.view.ViewGroup, float, androidx.customview.widget.ViewDragHelper.Callback);
- method public android.view.View? findTopChildUnder(int, int);
- method public void flingCapturedView(int, int, int, int);
- method public int getActivePointerId();
- method public android.view.View? getCapturedView();
- method @Px public int getEdgeSize();
- method public float getMinVelocity();
- method @Px public int getTouchSlop();
- method public int getViewDragState();
- method public boolean isCapturedViewUnder(int, int);
- method public boolean isEdgeTouched(int);
- method public boolean isEdgeTouched(int, int);
- method public boolean isPointerDown(int);
- method public boolean isViewUnder(android.view.View?, int, int);
- method public void processTouchEvent(android.view.MotionEvent);
- method public void setEdgeTrackingEnabled(int);
- method public void setMinVelocity(float);
- method public boolean settleCapturedViewAt(int, int);
- method public boolean shouldInterceptTouchEvent(android.view.MotionEvent);
- method public boolean smoothSlideViewTo(android.view.View, int, int);
- field public static final int DIRECTION_ALL = 3; // 0x3
- field public static final int DIRECTION_HORIZONTAL = 1; // 0x1
- field public static final int DIRECTION_VERTICAL = 2; // 0x2
- field public static final int EDGE_ALL = 15; // 0xf
- field public static final int EDGE_BOTTOM = 8; // 0x8
- field public static final int EDGE_LEFT = 1; // 0x1
- field public static final int EDGE_RIGHT = 2; // 0x2
- field public static final int EDGE_TOP = 4; // 0x4
- field public static final int INVALID_POINTER = -1; // 0xffffffff
- field public static final int STATE_DRAGGING = 1; // 0x1
- field public static final int STATE_IDLE = 0; // 0x0
- field public static final int STATE_SETTLING = 2; // 0x2
- }
-
- public abstract static class ViewDragHelper.Callback {
- ctor public ViewDragHelper.Callback();
- method public int clampViewPositionHorizontal(android.view.View, int, int);
- method public int clampViewPositionVertical(android.view.View, int, int);
- method public int getOrderedChildIndex(int);
- method public int getViewHorizontalDragRange(android.view.View);
- method public int getViewVerticalDragRange(android.view.View);
- method public void onEdgeDragStarted(int, int);
- method public boolean onEdgeLock(int);
- method public void onEdgeTouched(int, int);
- method public void onViewCaptured(android.view.View, int);
- method public void onViewDragStateChanged(int);
- method public void onViewPositionChanged(android.view.View, int, int, @Px int, @Px int);
- method public void onViewReleased(android.view.View, float, float);
- method public abstract boolean tryCaptureView(android.view.View, int);
- }
-
-}
-
diff --git a/customview/api/current.txt b/customview/api/current.txt
index d5249c0..03155c6 100644
--- a/customview/api/current.txt
+++ b/customview/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.customview.view {
public abstract class AbsSavedState implements android.os.Parcelable {
diff --git a/customview/api/res-1.1.0-alpha01.txt b/customview/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/customview/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/customview/api/restricted_1.0.0.txt b/customview/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/customview/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/customview/api/restricted_1.1.0-alpha01.txt b/customview/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/customview/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/customview/api/restricted_current.txt b/customview/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/customview/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/customview/build.gradle b/customview/build.gradle
index b3eb22e..15bbf9c 100644
--- a/customview/build.gradle
+++ b/customview/build.gradle
@@ -9,7 +9,6 @@
dependencies {
api(project(":annotation"))
api(project(":core"))
- implementation(project(":collection"))
androidTestImplementation(JUNIT)
androidTestImplementation(TEST_EXT_JUNIT)
diff --git a/customview/src/androidTest/java/androidx/customview/widget/ExploreByTouchHelperTest.java b/customview/src/androidTest/java/androidx/customview/widget/ExploreByTouchHelperTest.java
index e61467a..aec280e 100644
--- a/customview/src/androidTest/java/androidx/customview/widget/ExploreByTouchHelperTest.java
+++ b/customview/src/androidTest/java/androidx/customview/widget/ExploreByTouchHelperTest.java
@@ -30,7 +30,7 @@
import androidx.customview.test.R;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
@@ -40,7 +40,7 @@
import java.util.List;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class ExploreByTouchHelperTest {
@Rule
diff --git a/development/checkstyle/config/support-lib.xml b/development/checkstyle/config/support-lib.xml
index 49ecc5c..cb0b24f 100644
--- a/development/checkstyle/config/support-lib.xml
+++ b/development/checkstyle/config/support-lib.xml
@@ -38,5 +38,9 @@
<property name="messageKey" value="annotation.missing.hide" />
<message key="annotation.missing.hide" value="Must include both @RestrictTo annotation and @hide Javadoc tag."/>
</module>
+ <!-- Custom support library check for methods with @Test to have test size annotation -->
+ <module name="com.android.support.checkstyle.TestSizeAnnotationCheck">
+ <property name="severity" value="error" />
+ </module>
</module>
</module>
diff --git a/development/checkstyle/src/com/android/support/checkstyle/TestSizeAnnotationCheck.java b/development/checkstyle/src/com/android/support/checkstyle/TestSizeAnnotationCheck.java
new file mode 100644
index 0000000..33a97e6
--- /dev/null
+++ b/development/checkstyle/src/com/android/support/checkstyle/TestSizeAnnotationCheck.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2017 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 com.android.support.checkstyle;
+
+import com.puppycrawl.tools.checkstyle.api.AbstractCheck;
+import com.puppycrawl.tools.checkstyle.api.DetailAST;
+import com.puppycrawl.tools.checkstyle.api.TokenTypes;
+import com.puppycrawl.tools.checkstyle.utils.AnnotationUtility;
+
+/**
+ * A check that verifies that all the methods marked with @Test have a matching test size
+ * annotation such as @SmallTest, @MediumTest or @LargeTest. This is needed to make sure
+ * that newly added tests get run in the automated test runner.
+ */
+public class TestSizeAnnotationCheck extends AbstractCheck {
+ private static final String SMALL_TEST = "SmallTest";
+ private static final String MEDIUM_TEST = "MediumTest";
+ private static final String LARGE_TEST = "LargeTest";
+ private static final String TEST = "Test";
+ private static final String RUN_WITH = "RunWith";
+ private static final String JUNIT4 = "JUnit4";
+
+ private static final String MESSAGE = "Method with @Test annotation must have a @SmallTest, "
+ + "@MediumTest, or @LargeTest annotation. See https://goo.gl/c2I0WP for recommended "
+ + "timeouts";
+
+ @Override
+ public int[] getDefaultTokens() {
+ return new int[]{TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF};
+ }
+
+ @Override
+ public int[] getAcceptableTokens() {
+ return getDefaultTokens();
+ }
+
+ @Override
+ public int[] getRequiredTokens() {
+ return getDefaultTokens();
+ }
+
+ @Override
+ public void visitToken(DetailAST ast) {
+ if (isJUnit4Runner(ast)) {
+ // Tests that run with JUnit4 do not require test size annotations.
+ return;
+ }
+ final boolean classHasTestSizeAnnotation =
+ AnnotationUtility.containsAnnotation(ast, SMALL_TEST)
+ || AnnotationUtility.containsAnnotation(ast, MEDIUM_TEST)
+ || AnnotationUtility.containsAnnotation(ast, LARGE_TEST);
+
+ DetailAST objBlock = ast.findFirstToken(TokenTypes.OBJBLOCK);
+ for (DetailAST child = objBlock.getFirstChild();
+ child != null; child = child.getNextSibling()) {
+ if (child.getType() == TokenTypes.METHOD_DEF
+ && AnnotationUtility.containsAnnotation(child, TEST)) {
+ final boolean methodHasTestSizeAnnotation =
+ AnnotationUtility.containsAnnotation(child, SMALL_TEST)
+ || AnnotationUtility.containsAnnotation(child, MEDIUM_TEST)
+ || AnnotationUtility.containsAnnotation(child, LARGE_TEST);
+ if (!classHasTestSizeAnnotation && !methodHasTestSizeAnnotation) {
+ log(child.getLineNo(), MESSAGE);
+ }
+ }
+ }
+ }
+
+ /**
+ * Checks whether this test class is annotated with @RunWith(JUnit4.class).
+ */
+ private boolean isJUnit4Runner(DetailAST ast) {
+ DetailAST runner = AnnotationUtility.getAnnotation(ast, RUN_WITH);
+
+ // We make an assumption that @RunWith annotation will have this structure:
+ // @RunWith
+ // |
+ // EXPR
+ // |
+ // -----DOT-------
+ // / \
+ // Runner name class
+
+ if (runner == null // There is no @RunWith annotation
+ || runner.findFirstToken(TokenTypes.EXPR) == null // Annotation has no value.
+ || runner.findFirstToken(TokenTypes.EXPR).getFirstChild() == null
+ || runner.findFirstToken(TokenTypes.EXPR).getFirstChild().getFirstChild() == null) {
+ return false;
+ }
+ return JUNIT4.equals(
+ runner.findFirstToken(TokenTypes.EXPR).getFirstChild().getFirstChild().getText());
+ }
+}
diff --git a/development/update_library_versions.py b/development/update_library_versions.py
index 1f2ba6b..5fff9cc 100755
--- a/development/update_library_versions.py
+++ b/development/update_library_versions.py
@@ -159,9 +159,6 @@
else:
return version, changed
-def artifactId_to_kotlin_macro(artifactId):
- return artifactId.replace('-','_').upper()
-
def update_artifact_version(lv_lines, artifact):
num_lines = len(lv_lines)
for i in range(num_lines):
@@ -173,7 +170,7 @@
new_version, ver_was_updated = increment_alpha_beta_version(artifact.version)
if ver_was_updated:
# Only modify line if the version was actually changed
- lv_lines[i] =" val " + artifactId_to_kotlin_macro(artifactId) + " = Version(\"" + new_version + "\")\n"
+ lv_lines[i] =" val " + artifactId.upper() + " = Version(\"" + new_version + "\")\n"
summary_log.append("Updated %s to FROM %s TO %s" % (artifactId.upper(), artifact.version, new_version))
# Assert incremented version doesn't exist
if does_exist_on_gmaven(artifact.groupId, artifact.artifactId, new_version):
diff --git a/docs-runner/build.gradle b/docs-runner/build.gradle
deleted file mode 100644
index 33fbe95..0000000
--- a/docs-runner/build.gradle
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright 2019 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.
- */
-
-// Empty project from which to run Dokka to generate public documentation
-// from .jar files containing sources
diff --git a/documentfile/OWNERS b/documentfile/OWNERS
deleted file mode 100644
index d194753..0000000
--- a/documentfile/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-jsharkey@android.com
diff --git a/documentfile/api/1.0.0.txt b/documentfile/api/1.0.0.txt
index 0571177..eb18f37 100644
--- a/documentfile/api/1.0.0.txt
+++ b/documentfile/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.documentfile.provider {
public abstract class DocumentFile {
diff --git a/documentfile/api/1.1.0-alpha01.txt b/documentfile/api/1.1.0-alpha01.txt
deleted file mode 100644
index 0571177..0000000
--- a/documentfile/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-// Signature format: 3.0
-package androidx.documentfile.provider {
-
- public abstract class DocumentFile {
- method public abstract boolean canRead();
- method public abstract boolean canWrite();
- method public abstract androidx.documentfile.provider.DocumentFile? createDirectory(String);
- method public abstract androidx.documentfile.provider.DocumentFile? createFile(String, String);
- method public abstract boolean delete();
- method public abstract boolean exists();
- method public androidx.documentfile.provider.DocumentFile? findFile(String);
- method public static androidx.documentfile.provider.DocumentFile fromFile(java.io.File);
- method public static androidx.documentfile.provider.DocumentFile? fromSingleUri(android.content.Context, android.net.Uri);
- method public static androidx.documentfile.provider.DocumentFile? fromTreeUri(android.content.Context, android.net.Uri);
- method public abstract String? getName();
- method public androidx.documentfile.provider.DocumentFile? getParentFile();
- method public abstract String? getType();
- method public abstract android.net.Uri getUri();
- method public abstract boolean isDirectory();
- method public static boolean isDocumentUri(android.content.Context, android.net.Uri?);
- method public abstract boolean isFile();
- method public abstract boolean isVirtual();
- method public abstract long lastModified();
- method public abstract long length();
- method public abstract androidx.documentfile.provider.DocumentFile[] listFiles();
- method public abstract boolean renameTo(String);
- }
-
-}
-
diff --git a/documentfile/api/current.txt b/documentfile/api/current.txt
index 0571177..eb18f37 100644
--- a/documentfile/api/current.txt
+++ b/documentfile/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.documentfile.provider {
public abstract class DocumentFile {
diff --git a/documentfile/api/res-1.1.0-alpha01.txt b/documentfile/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/documentfile/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/documentfile/api/restricted_1.0.0.txt b/documentfile/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/documentfile/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/documentfile/api/restricted_1.1.0-alpha01.txt b/documentfile/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/documentfile/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/documentfile/api/restricted_current.txt b/documentfile/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/documentfile/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/documentfile/build.gradle b/documentfile/build.gradle
index 13ea2df..5d57db5 100644
--- a/documentfile/build.gradle
+++ b/documentfile/build.gradle
@@ -10,10 +10,6 @@
api(project(":annotation"))
annotationProcessor(NULLAWAY)
-
- androidTestImplementation(TEST_EXT_JUNIT)
- androidTestImplementation(TEST_CORE)
- androidTestImplementation(TEST_RUNNER)
}
supportLibrary {
diff --git a/documentfile/src/androidTest/java/androidx/documentfile/provider/DocumentFileTest.java b/documentfile/src/androidTest/java/androidx/documentfile/provider/DocumentFileTest.java
deleted file mode 100644
index 98d4edc..0000000
--- a/documentfile/src/androidTest/java/androidx/documentfile/provider/DocumentFileTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2019 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.documentfile.provider;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
-
-import android.content.Context;
-import android.net.Uri;
-
-import androidx.test.core.app.ApplicationProvider;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SdkSuppress;
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public class DocumentFileTest {
- private static final Uri CONTENT_TREE_ROOT_URI =
- Uri.parse("content://com.android.externalstorage.documents/tree/primary%3A");
- private static final Uri EXT_ROOT_TREE_URI =
- Uri.parse(CONTENT_TREE_ROOT_URI + "/document/primary%3A");
-
- private static final Uri DOWNLOAD_URI =
- Uri.parse(CONTENT_TREE_ROOT_URI + "/document/primary%3ADownload");
-
- @Test
- @SdkSuppress(minSdkVersion = 21)
- public void testFromTreeUriUsesFullDocumentId() {
- Context context = ApplicationProvider.getApplicationContext();
- DocumentFile rootDoc = DocumentFile.fromTreeUri(context, CONTENT_TREE_ROOT_URI);
- assertThat(rootDoc.getUri(), equalTo(EXT_ROOT_TREE_URI));
-
- DocumentFile subDirDoc = DocumentFile.fromTreeUri(context, DOWNLOAD_URI);
- assertThat(subDirDoc.getUri(), equalTo(DOWNLOAD_URI));
- }
-}
diff --git a/documentfile/src/main/java/androidx/documentfile/provider/DocumentFile.java b/documentfile/src/main/java/androidx/documentfile/provider/DocumentFile.java
index 1ad8df4..43b5a18 100644
--- a/documentfile/src/main/java/androidx/documentfile/provider/DocumentFile.java
+++ b/documentfile/src/main/java/androidx/documentfile/provider/DocumentFile.java
@@ -133,13 +133,9 @@
@Nullable
public static DocumentFile fromTreeUri(@NonNull Context context, @NonNull Uri treeUri) {
if (Build.VERSION.SDK_INT >= 21) {
- String documentId = DocumentsContract.getTreeDocumentId(treeUri);
- if (DocumentsContract.isDocumentUri(context, treeUri)) {
- documentId = DocumentsContract.getDocumentId(treeUri);
- }
return new TreeDocumentFile(null, context,
DocumentsContract.buildDocumentUriUsingTree(treeUri,
- documentId));
+ DocumentsContract.getTreeDocumentId(treeUri)));
} else {
return null;
}
diff --git a/drawerlayout/api/1.0.0.txt b/drawerlayout/api/1.0.0.txt
index da9d098..4bb8cc2 100644
--- a/drawerlayout/api/1.0.0.txt
+++ b/drawerlayout/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.drawerlayout.widget {
public class DrawerLayout extends android.view.ViewGroup {
diff --git a/drawerlayout/api/1.1.0-alpha01.txt b/drawerlayout/api/1.1.0-alpha01.txt
deleted file mode 100644
index da9d098..0000000
--- a/drawerlayout/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-// Signature format: 3.0
-package androidx.drawerlayout.widget {
-
- public class DrawerLayout extends android.view.ViewGroup {
- ctor public DrawerLayout(android.content.Context);
- ctor public DrawerLayout(android.content.Context, android.util.AttributeSet?);
- ctor public DrawerLayout(android.content.Context, android.util.AttributeSet?, int);
- method public void addDrawerListener(androidx.drawerlayout.widget.DrawerLayout.DrawerListener);
- method public void closeDrawer(android.view.View);
- method public void closeDrawer(android.view.View, boolean);
- method public void closeDrawer(int);
- method public void closeDrawer(int, boolean);
- method public void closeDrawers();
- method public float getDrawerElevation();
- method public int getDrawerLockMode(int);
- method public int getDrawerLockMode(android.view.View);
- method public CharSequence? getDrawerTitle(int);
- method public android.graphics.drawable.Drawable? getStatusBarBackgroundDrawable();
- method public boolean isDrawerOpen(android.view.View);
- method public boolean isDrawerOpen(int);
- method public boolean isDrawerVisible(android.view.View);
- method public boolean isDrawerVisible(int);
- method public void onDraw(android.graphics.Canvas!);
- method public void openDrawer(android.view.View);
- method public void openDrawer(android.view.View, boolean);
- method public void openDrawer(int);
- method public void openDrawer(int, boolean);
- method public void removeDrawerListener(androidx.drawerlayout.widget.DrawerLayout.DrawerListener);
- method public void setDrawerElevation(float);
- method @Deprecated public void setDrawerListener(androidx.drawerlayout.widget.DrawerLayout.DrawerListener!);
- method public void setDrawerLockMode(int);
- method public void setDrawerLockMode(int, int);
- method public void setDrawerLockMode(int, android.view.View);
- method public void setDrawerShadow(android.graphics.drawable.Drawable!, int);
- method public void setDrawerShadow(@DrawableRes int, int);
- method public void setDrawerTitle(int, CharSequence?);
- method public void setScrimColor(@ColorInt int);
- method public void setStatusBarBackground(android.graphics.drawable.Drawable?);
- method public void setStatusBarBackground(int);
- method public void setStatusBarBackgroundColor(@ColorInt int);
- field public static final int LOCK_MODE_LOCKED_CLOSED = 1; // 0x1
- field public static final int LOCK_MODE_LOCKED_OPEN = 2; // 0x2
- field public static final int LOCK_MODE_UNDEFINED = 3; // 0x3
- field public static final int LOCK_MODE_UNLOCKED = 0; // 0x0
- field public static final int STATE_DRAGGING = 1; // 0x1
- field public static final int STATE_IDLE = 0; // 0x0
- field public static final int STATE_SETTLING = 2; // 0x2
- }
-
- public static interface DrawerLayout.DrawerListener {
- method public void onDrawerClosed(android.view.View);
- method public void onDrawerOpened(android.view.View);
- method public void onDrawerSlide(android.view.View, float);
- method public void onDrawerStateChanged(int);
- }
-
- public static class DrawerLayout.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
- ctor public DrawerLayout.LayoutParams(android.content.Context, android.util.AttributeSet?);
- ctor public DrawerLayout.LayoutParams(int, int);
- ctor public DrawerLayout.LayoutParams(int, int, int);
- ctor public DrawerLayout.LayoutParams(androidx.drawerlayout.widget.DrawerLayout.LayoutParams);
- ctor public DrawerLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
- ctor public DrawerLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
- field public int gravity;
- }
-
- protected static class DrawerLayout.SavedState extends androidx.customview.view.AbsSavedState {
- ctor public DrawerLayout.SavedState(android.os.Parcel, ClassLoader?);
- ctor public DrawerLayout.SavedState(android.os.Parcelable);
- field public static final android.os.Parcelable.Creator<androidx.drawerlayout.widget.DrawerLayout.SavedState>! CREATOR;
- }
-
- public abstract static class DrawerLayout.SimpleDrawerListener implements androidx.drawerlayout.widget.DrawerLayout.DrawerListener {
- ctor public DrawerLayout.SimpleDrawerListener();
- method public void onDrawerClosed(android.view.View!);
- method public void onDrawerOpened(android.view.View!);
- method public void onDrawerSlide(android.view.View!, float);
- method public void onDrawerStateChanged(int);
- }
-
-}
-
diff --git a/drawerlayout/api/current.txt b/drawerlayout/api/current.txt
index da9d098..4bb8cc2 100644
--- a/drawerlayout/api/current.txt
+++ b/drawerlayout/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.drawerlayout.widget {
public class DrawerLayout extends android.view.ViewGroup {
diff --git a/drawerlayout/api/res-1.1.0-alpha01.txt b/drawerlayout/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/drawerlayout/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/drawerlayout/api/restricted_1.0.0.txt b/drawerlayout/api/restricted_1.0.0.txt
deleted file mode 100644
index 1bedd22..0000000
--- a/drawerlayout/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.drawerlayout.widget {
-
- public class DrawerLayout {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setChildInsets(Object!, boolean);
- }
-
-}
-
diff --git a/drawerlayout/api/restricted_1.1.0-alpha01.txt b/drawerlayout/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index 4e22348..0000000
--- a/drawerlayout/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.drawerlayout.widget {
-
- public class DrawerLayout extends android.view.ViewGroup {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setChildInsets(Object!, boolean);
- }
-
-}
-
diff --git a/drawerlayout/api/restricted_current.txt b/drawerlayout/api/restricted_current.txt
deleted file mode 100644
index 4e22348..0000000
--- a/drawerlayout/api/restricted_current.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.drawerlayout.widget {
-
- public class DrawerLayout extends android.view.ViewGroup {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setChildInsets(Object!, boolean);
- }
-
-}
-
diff --git a/drawerlayout/src/main/java/androidx/drawerlayout/widget/DrawerLayout.java b/drawerlayout/src/main/java/androidx/drawerlayout/widget/DrawerLayout.java
index 7bbaf62..22e61b9 100644
--- a/drawerlayout/src/main/java/androidx/drawerlayout/widget/DrawerLayout.java
+++ b/drawerlayout/src/main/java/androidx/drawerlayout/widget/DrawerLayout.java
@@ -17,7 +17,7 @@
package androidx.drawerlayout.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -192,10 +192,6 @@
private static final boolean SET_DRAWER_SHADOW_FROM_ELEVATION =
Build.VERSION.SDK_INT >= 21;
- /** Class name may be obfuscated by Proguard. Hardcode the string for accessibility usage. */
- private static final String ACCESSIBILITY_CLASS_NAME =
- "androidx.drawerlayout.widget.DrawerLayout";
-
private final ChildAccessibilityDelegate mChildAccessibilityDelegate =
new ChildAccessibilityDelegate();
private float mDrawerElevation;
@@ -403,7 +399,7 @@
* @hide Internal use only; called to apply window insets when configured
* with fitsSystemWindows="true"
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setChildInsets(Object insets, boolean draw) {
mLastInsets = insets;
mDrawStatusBarBackground = draw;
@@ -2356,7 +2352,7 @@
addChildrenForAccessibility(info, (ViewGroup) host);
}
- info.setClassName(ACCESSIBILITY_CLASS_NAME);
+ info.setClassName(DrawerLayout.class.getName());
// This view reports itself as focusable so that it can intercept
// the back button, but we should prevent this view from reporting
@@ -2370,7 +2366,7 @@
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(host, event);
- event.setClassName(ACCESSIBILITY_CLASS_NAME);
+ event.setClassName(DrawerLayout.class.getName());
}
@Override
diff --git a/dynamic-animation/api/1.0.0.txt b/dynamic-animation/api/1.0.0.txt
index 9a947b0..5903cec 100644
--- a/dynamic-animation/api/1.0.0.txt
+++ b/dynamic-animation/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.dynamicanimation.animation {
public abstract class DynamicAnimation<T extends androidx.dynamicanimation.animation.DynamicAnimation<T>> {
diff --git a/dynamic-animation/api/1.1.0-alpha01.txt b/dynamic-animation/api/1.1.0-alpha01.txt
deleted file mode 100644
index 9a947b0..0000000
--- a/dynamic-animation/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,104 +0,0 @@
-// Signature format: 3.0
-package androidx.dynamicanimation.animation {
-
- public abstract class DynamicAnimation<T extends androidx.dynamicanimation.animation.DynamicAnimation<T>> {
- method public T! addEndListener(androidx.dynamicanimation.animation.DynamicAnimation.OnAnimationEndListener!);
- method public T! addUpdateListener(androidx.dynamicanimation.animation.DynamicAnimation.OnAnimationUpdateListener!);
- method public void cancel();
- method public float getMinimumVisibleChange();
- method public boolean isRunning();
- method public void removeEndListener(androidx.dynamicanimation.animation.DynamicAnimation.OnAnimationEndListener!);
- method public void removeUpdateListener(androidx.dynamicanimation.animation.DynamicAnimation.OnAnimationUpdateListener!);
- method public T! setMaxValue(float);
- method public T! setMinValue(float);
- method public T! setMinimumVisibleChange(@FloatRange(from=0.0, fromInclusive=false) float);
- method public T! setStartValue(float);
- method public T! setStartVelocity(float);
- method public void start();
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! ALPHA;
- field public static final float MIN_VISIBLE_CHANGE_ALPHA = 0.00390625f;
- field public static final float MIN_VISIBLE_CHANGE_PIXELS = 1.0f;
- field public static final float MIN_VISIBLE_CHANGE_ROTATION_DEGREES = 0.1f;
- field public static final float MIN_VISIBLE_CHANGE_SCALE = 0.002f;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! ROTATION;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! ROTATION_X;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! ROTATION_Y;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! SCALE_X;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! SCALE_Y;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! SCROLL_X;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! SCROLL_Y;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! TRANSLATION_X;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! TRANSLATION_Y;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! TRANSLATION_Z;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! X;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! Y;
- field public static final androidx.dynamicanimation.animation.DynamicAnimation.ViewProperty! Z;
- }
-
- public static interface DynamicAnimation.OnAnimationEndListener {
- method public void onAnimationEnd(androidx.dynamicanimation.animation.DynamicAnimation!, boolean, float, float);
- }
-
- public static interface DynamicAnimation.OnAnimationUpdateListener {
- method public void onAnimationUpdate(androidx.dynamicanimation.animation.DynamicAnimation!, float, float);
- }
-
- public abstract static class DynamicAnimation.ViewProperty extends androidx.dynamicanimation.animation.FloatPropertyCompat<android.view.View> {
- }
-
- public final class FlingAnimation extends androidx.dynamicanimation.animation.DynamicAnimation<androidx.dynamicanimation.animation.FlingAnimation> {
- ctor public FlingAnimation(androidx.dynamicanimation.animation.FloatValueHolder!);
- ctor public FlingAnimation(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K>!);
- method public float getFriction();
- method public androidx.dynamicanimation.animation.FlingAnimation! setFriction(@FloatRange(from=0.0, fromInclusive=false) float);
- method public androidx.dynamicanimation.animation.FlingAnimation! setMaxValue(float);
- method public androidx.dynamicanimation.animation.FlingAnimation! setMinValue(float);
- method public androidx.dynamicanimation.animation.FlingAnimation! setStartVelocity(float);
- }
-
- public abstract class FloatPropertyCompat<T> {
- ctor public FloatPropertyCompat(String!);
- method @RequiresApi(24) public static <T> androidx.dynamicanimation.animation.FloatPropertyCompat<T>! createFloatPropertyCompat(android.util.FloatProperty<T>!);
- method public abstract float getValue(T!);
- method public abstract void setValue(T!, float);
- }
-
- public final class FloatValueHolder {
- ctor public FloatValueHolder();
- ctor public FloatValueHolder(float);
- method public float getValue();
- method public void setValue(float);
- }
-
- public final class SpringAnimation extends androidx.dynamicanimation.animation.DynamicAnimation<androidx.dynamicanimation.animation.SpringAnimation> {
- ctor public SpringAnimation(androidx.dynamicanimation.animation.FloatValueHolder!);
- ctor public SpringAnimation(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K>!);
- ctor public SpringAnimation(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K>!, float);
- method public void animateToFinalPosition(float);
- method public boolean canSkipToEnd();
- method public androidx.dynamicanimation.animation.SpringForce! getSpring();
- method public androidx.dynamicanimation.animation.SpringAnimation! setSpring(androidx.dynamicanimation.animation.SpringForce!);
- method public void skipToEnd();
- }
-
- public final class SpringForce {
- ctor public SpringForce();
- ctor public SpringForce(float);
- method public float getDampingRatio();
- method public float getFinalPosition();
- method public float getStiffness();
- method public androidx.dynamicanimation.animation.SpringForce! setDampingRatio(@FloatRange(from=0.0) float);
- method public androidx.dynamicanimation.animation.SpringForce! setFinalPosition(float);
- method public androidx.dynamicanimation.animation.SpringForce! setStiffness(@FloatRange(from=0.0, fromInclusive=false) float);
- field public static final float DAMPING_RATIO_HIGH_BOUNCY = 0.2f;
- field public static final float DAMPING_RATIO_LOW_BOUNCY = 0.75f;
- field public static final float DAMPING_RATIO_MEDIUM_BOUNCY = 0.5f;
- field public static final float DAMPING_RATIO_NO_BOUNCY = 1.0f;
- field public static final float STIFFNESS_HIGH = 10000.0f;
- field public static final float STIFFNESS_LOW = 200.0f;
- field public static final float STIFFNESS_MEDIUM = 1500.0f;
- field public static final float STIFFNESS_VERY_LOW = 50.0f;
- }
-
-}
-
diff --git a/dynamic-animation/api/current.txt b/dynamic-animation/api/current.txt
index 9a947b0..5903cec 100644
--- a/dynamic-animation/api/current.txt
+++ b/dynamic-animation/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.dynamicanimation.animation {
public abstract class DynamicAnimation<T extends androidx.dynamicanimation.animation.DynamicAnimation<T>> {
diff --git a/dynamic-animation/api/res-1.1.0-alpha01.txt b/dynamic-animation/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/dynamic-animation/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/dynamic-animation/api/restricted_1.0.0.txt b/dynamic-animation/api/restricted_1.0.0.txt
deleted file mode 100644
index e6d67f3..0000000
--- a/dynamic-animation/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.dynamicanimation.animation {
-
- public abstract class DynamicAnimation<T extends androidx.dynamicanimation.animation.DynamicAnimation<T>> {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean doAnimationFrame(long);
- }
-
- public final class SpringForce {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public float getAcceleration(float, float);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean isAtEquilibrium(float, float);
- }
-
-}
-
diff --git a/dynamic-animation/api/restricted_1.1.0-alpha01.txt b/dynamic-animation/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index bedb84d..0000000
--- a/dynamic-animation/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-// Signature format: 3.0
-package androidx.dynamicanimation.animation {
-
- public abstract class DynamicAnimation<T extends androidx.dynamicanimation.animation.DynamicAnimation<T>> {
- }
-
- public final class SpringForce {
- }
-
-}
-
diff --git a/dynamic-animation/api/restricted_current.txt b/dynamic-animation/api/restricted_current.txt
deleted file mode 100644
index bedb84d..0000000
--- a/dynamic-animation/api/restricted_current.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-// Signature format: 3.0
-package androidx.dynamicanimation.animation {
-
- public abstract class DynamicAnimation<T extends androidx.dynamicanimation.animation.DynamicAnimation<T>> {
- }
-
- public final class SpringForce {
- }
-
-}
-
diff --git a/dynamic-animation/ktx/api/1.0.0-alpha01.txt b/dynamic-animation/ktx/api/1.0.0-alpha01.txt
index cda5dad..fe2c248 100644
--- a/dynamic-animation/ktx/api/1.0.0-alpha01.txt
+++ b/dynamic-animation/ktx/api/1.0.0-alpha01.txt
@@ -1,11 +1,11 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.dynamicanimation.animation {
public final class DynamicAnimationKt {
ctor public DynamicAnimationKt();
- method public static inline <K> androidx.dynamicanimation.animation.FlingAnimation flingAnimationOf(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K> property);
- method public static inline <K> androidx.dynamicanimation.animation.SpringAnimation springAnimationOf(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K> property, float finalPosition = Float.NaN);
- method public static inline androidx.dynamicanimation.animation.SpringAnimation withSpringForceProperties(androidx.dynamicanimation.animation.SpringAnimation, kotlin.jvm.functions.Function1<? super androidx.dynamicanimation.animation.SpringForce,kotlin.Unit> func);
+ method public static <K> androidx.dynamicanimation.animation.FlingAnimation flingAnimationOf(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K> property);
+ method public static <K> androidx.dynamicanimation.animation.SpringAnimation springAnimationOf(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K> property, float finalPosition = Float.NaN);
+ method public static androidx.dynamicanimation.animation.SpringAnimation withSpringForceProperties(androidx.dynamicanimation.animation.SpringAnimation, kotlin.jvm.functions.Function1<? super androidx.dynamicanimation.animation.SpringForce,kotlin.Unit> func);
}
}
diff --git a/dynamic-animation/ktx/api/1.0.0-alpha02.txt b/dynamic-animation/ktx/api/1.0.0-alpha02.txt
deleted file mode 100644
index cda5dad..0000000
--- a/dynamic-animation/ktx/api/1.0.0-alpha02.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-// Signature format: 3.0
-package androidx.dynamicanimation.animation {
-
- public final class DynamicAnimationKt {
- ctor public DynamicAnimationKt();
- method public static inline <K> androidx.dynamicanimation.animation.FlingAnimation flingAnimationOf(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K> property);
- method public static inline <K> androidx.dynamicanimation.animation.SpringAnimation springAnimationOf(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K> property, float finalPosition = Float.NaN);
- method public static inline androidx.dynamicanimation.animation.SpringAnimation withSpringForceProperties(androidx.dynamicanimation.animation.SpringAnimation, kotlin.jvm.functions.Function1<? super androidx.dynamicanimation.animation.SpringForce,kotlin.Unit> func);
- }
-
-}
-
diff --git a/dynamic-animation/ktx/api/current.txt b/dynamic-animation/ktx/api/current.txt
index cda5dad..fe2c248 100644
--- a/dynamic-animation/ktx/api/current.txt
+++ b/dynamic-animation/ktx/api/current.txt
@@ -1,11 +1,11 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.dynamicanimation.animation {
public final class DynamicAnimationKt {
ctor public DynamicAnimationKt();
- method public static inline <K> androidx.dynamicanimation.animation.FlingAnimation flingAnimationOf(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K> property);
- method public static inline <K> androidx.dynamicanimation.animation.SpringAnimation springAnimationOf(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K> property, float finalPosition = Float.NaN);
- method public static inline androidx.dynamicanimation.animation.SpringAnimation withSpringForceProperties(androidx.dynamicanimation.animation.SpringAnimation, kotlin.jvm.functions.Function1<? super androidx.dynamicanimation.animation.SpringForce,kotlin.Unit> func);
+ method public static <K> androidx.dynamicanimation.animation.FlingAnimation flingAnimationOf(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K> property);
+ method public static <K> androidx.dynamicanimation.animation.SpringAnimation springAnimationOf(K!, androidx.dynamicanimation.animation.FloatPropertyCompat<K> property, float finalPosition = Float.NaN);
+ method public static androidx.dynamicanimation.animation.SpringAnimation withSpringForceProperties(androidx.dynamicanimation.animation.SpringAnimation, kotlin.jvm.functions.Function1<? super androidx.dynamicanimation.animation.SpringForce,kotlin.Unit> func);
}
}
diff --git a/dynamic-animation/ktx/api/res-1.0.0-alpha02.txt b/dynamic-animation/ktx/api/res-1.0.0-alpha02.txt
deleted file mode 100644
index e69de29..0000000
--- a/dynamic-animation/ktx/api/res-1.0.0-alpha02.txt
+++ /dev/null
diff --git a/dynamic-animation/ktx/api/restricted_1.0.0-alpha02.txt b/dynamic-animation/ktx/api/restricted_1.0.0-alpha02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/dynamic-animation/ktx/api/restricted_1.0.0-alpha02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/dynamic-animation/ktx/api/restricted_current.txt b/dynamic-animation/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/dynamic-animation/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/dynamic-animation/src/androidTest/java/androidx/dynamicanimation/tests/FlingTests.java b/dynamic-animation/src/androidTest/java/androidx/dynamicanimation/tests/FlingTests.java
index b51ce7d..a00d048 100644
--- a/dynamic-animation/src/androidTest/java/androidx/dynamicanimation/tests/FlingTests.java
+++ b/dynamic-animation/src/androidTest/java/androidx/dynamicanimation/tests/FlingTests.java
@@ -32,7 +32,7 @@
import androidx.dynamicanimation.animation.FloatValueHolder;
import androidx.dynamicanimation.test.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -44,7 +44,7 @@
import org.mockito.internal.matchers.GreaterThan;
import org.mockito.internal.matchers.LessThan;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class FlingTests {
@Rule
diff --git a/emoji/appcompat/api/1.0.0.txt b/emoji/appcompat/api/1.0.0.txt
index a164fb7..f5a3c05 100644
--- a/emoji/appcompat/api/1.0.0.txt
+++ b/emoji/appcompat/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.emoji.widget {
public class EmojiAppCompatButton extends androidx.appcompat.widget.AppCompatButton {
diff --git a/emoji/appcompat/api/1.1.0-alpha01.txt b/emoji/appcompat/api/1.1.0-alpha01.txt
deleted file mode 100644
index a164fb7..0000000
--- a/emoji/appcompat/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-// Signature format: 3.0
-package androidx.emoji.widget {
-
- public class EmojiAppCompatButton extends androidx.appcompat.widget.AppCompatButton {
- ctor public EmojiAppCompatButton(android.content.Context!);
- ctor public EmojiAppCompatButton(android.content.Context!, android.util.AttributeSet!);
- ctor public EmojiAppCompatButton(android.content.Context!, android.util.AttributeSet!, int);
- }
-
- public class EmojiAppCompatEditText extends androidx.appcompat.widget.AppCompatEditText {
- ctor public EmojiAppCompatEditText(android.content.Context!);
- ctor public EmojiAppCompatEditText(android.content.Context!, android.util.AttributeSet!);
- ctor public EmojiAppCompatEditText(android.content.Context!, android.util.AttributeSet!, int);
- method public int getMaxEmojiCount();
- method public void setMaxEmojiCount(@IntRange(from=0) int);
- }
-
- public class EmojiAppCompatTextView extends androidx.appcompat.widget.AppCompatTextView {
- ctor public EmojiAppCompatTextView(android.content.Context!);
- ctor public EmojiAppCompatTextView(android.content.Context!, android.util.AttributeSet!);
- ctor public EmojiAppCompatTextView(android.content.Context!, android.util.AttributeSet!, int);
- }
-
-}
-
diff --git a/emoji/appcompat/api/current.txt b/emoji/appcompat/api/current.txt
index a164fb7..f5a3c05 100644
--- a/emoji/appcompat/api/current.txt
+++ b/emoji/appcompat/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.emoji.widget {
public class EmojiAppCompatButton extends androidx.appcompat.widget.AppCompatButton {
diff --git a/emoji/appcompat/api/res-1.1.0-alpha01.txt b/emoji/appcompat/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/emoji/appcompat/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/emoji/appcompat/api/restricted_1.0.0.txt b/emoji/appcompat/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/emoji/appcompat/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/emoji/appcompat/api/restricted_1.1.0-alpha01.txt b/emoji/appcompat/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/emoji/appcompat/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/emoji/appcompat/api/restricted_current.txt b/emoji/appcompat/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/emoji/appcompat/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/emoji/bundled/api/1.0.0.txt b/emoji/bundled/api/1.0.0.txt
index 7fe3afc..d1f77a5 100644
--- a/emoji/bundled/api/1.0.0.txt
+++ b/emoji/bundled/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.emoji.bundled {
public class BundledEmojiCompatConfig extends androidx.emoji.text.EmojiCompat.Config {
diff --git a/emoji/bundled/api/1.1.0-alpha01.txt b/emoji/bundled/api/1.1.0-alpha01.txt
deleted file mode 100644
index 7fe3afc..0000000
--- a/emoji/bundled/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.emoji.bundled {
-
- public class BundledEmojiCompatConfig extends androidx.emoji.text.EmojiCompat.Config {
- ctor public BundledEmojiCompatConfig(android.content.Context);
- }
-
-}
-
diff --git a/emoji/bundled/api/current.txt b/emoji/bundled/api/current.txt
index 7fe3afc..d1f77a5 100644
--- a/emoji/bundled/api/current.txt
+++ b/emoji/bundled/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.emoji.bundled {
public class BundledEmojiCompatConfig extends androidx.emoji.text.EmojiCompat.Config {
diff --git a/emoji/bundled/api/res-1.1.0-alpha01.txt b/emoji/bundled/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/emoji/bundled/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/emoji/bundled/api/restricted_1.0.0.txt b/emoji/bundled/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/emoji/bundled/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/emoji/bundled/api/restricted_1.1.0-alpha01.txt b/emoji/bundled/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/emoji/bundled/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/emoji/bundled/api/restricted_current.txt b/emoji/bundled/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/emoji/bundled/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/emoji/core/api/1.0.0.txt b/emoji/core/api/1.0.0.txt
index 4f5d70e..83b830a 100644
--- a/emoji/core/api/1.0.0.txt
+++ b/emoji/core/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.emoji.text {
@AnyThread public class EmojiCompat {
diff --git a/emoji/core/api/1.1.0-alpha01.txt b/emoji/core/api/1.1.0-alpha01.txt
deleted file mode 100644
index 4f5d70e..0000000
--- a/emoji/core/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,142 +0,0 @@
-// Signature format: 3.0
-package androidx.emoji.text {
-
- @AnyThread public class EmojiCompat {
- method public static androidx.emoji.text.EmojiCompat! get();
- method public String getAssetSignature();
- method public int getLoadState();
- method public static boolean handleDeleteSurroundingText(android.view.inputmethod.InputConnection, android.text.Editable, @IntRange(from=0) int, @IntRange(from=0) int, boolean);
- method public static boolean handleOnKeyDown(android.text.Editable, int, android.view.KeyEvent!);
- method public boolean hasEmojiGlyph(CharSequence);
- method public boolean hasEmojiGlyph(CharSequence, @IntRange(from=0) int);
- method public static androidx.emoji.text.EmojiCompat! init(androidx.emoji.text.EmojiCompat.Config);
- method public void load();
- method @CheckResult public CharSequence! process(CharSequence);
- method @CheckResult public CharSequence! process(CharSequence, @IntRange(from=0) int, @IntRange(from=0) int);
- method @CheckResult public CharSequence! process(CharSequence, @IntRange(from=0) int, @IntRange(from=0) int, @IntRange(from=0) int);
- method @CheckResult public CharSequence! process(CharSequence, @IntRange(from=0) int, @IntRange(from=0) int, @IntRange(from=0) int, int);
- method public void registerInitCallback(androidx.emoji.text.EmojiCompat.InitCallback);
- method public void unregisterInitCallback(androidx.emoji.text.EmojiCompat.InitCallback);
- field public static final String EDITOR_INFO_METAVERSION_KEY = "android.support.text.emoji.emojiCompat_metadataVersion";
- field public static final String EDITOR_INFO_REPLACE_ALL_KEY = "android.support.text.emoji.emojiCompat_replaceAll";
- field public static final int LOAD_STATE_DEFAULT = 3; // 0x3
- field public static final int LOAD_STATE_FAILED = 2; // 0x2
- field public static final int LOAD_STATE_LOADING = 0; // 0x0
- field public static final int LOAD_STATE_SUCCEEDED = 1; // 0x1
- field public static final int LOAD_STRATEGY_DEFAULT = 0; // 0x0
- field public static final int LOAD_STRATEGY_MANUAL = 1; // 0x1
- field public static final int REPLACE_STRATEGY_ALL = 1; // 0x1
- field public static final int REPLACE_STRATEGY_DEFAULT = 0; // 0x0
- field public static final int REPLACE_STRATEGY_NON_EXISTENT = 2; // 0x2
- }
-
- public abstract static class EmojiCompat.Config {
- ctor protected EmojiCompat.Config(androidx.emoji.text.EmojiCompat.MetadataRepoLoader);
- method protected final androidx.emoji.text.EmojiCompat.MetadataRepoLoader! getMetadataRepoLoader();
- method public androidx.emoji.text.EmojiCompat.Config! registerInitCallback(androidx.emoji.text.EmojiCompat.InitCallback);
- method public androidx.emoji.text.EmojiCompat.Config! setEmojiSpanIndicatorColor(@ColorInt int);
- method public androidx.emoji.text.EmojiCompat.Config! setEmojiSpanIndicatorEnabled(boolean);
- method public androidx.emoji.text.EmojiCompat.Config! setMetadataLoadStrategy(int);
- method public androidx.emoji.text.EmojiCompat.Config! setReplaceAll(boolean);
- method public androidx.emoji.text.EmojiCompat.Config! setUseEmojiAsDefaultStyle(boolean);
- method public androidx.emoji.text.EmojiCompat.Config! setUseEmojiAsDefaultStyle(boolean, java.util.List<java.lang.Integer>?);
- method public androidx.emoji.text.EmojiCompat.Config! unregisterInitCallback(androidx.emoji.text.EmojiCompat.InitCallback);
- }
-
- public abstract static class EmojiCompat.InitCallback {
- ctor public EmojiCompat.InitCallback();
- method public void onFailed(Throwable?);
- method public void onInitialized();
- }
-
- public static interface EmojiCompat.MetadataRepoLoader {
- method public void load(androidx.emoji.text.EmojiCompat.MetadataRepoLoaderCallback);
- }
-
- public abstract static class EmojiCompat.MetadataRepoLoaderCallback {
- ctor public EmojiCompat.MetadataRepoLoaderCallback();
- method public abstract void onFailed(Throwable?);
- method public abstract void onLoaded(androidx.emoji.text.MetadataRepo);
- }
-
- @RequiresApi(19) public abstract class EmojiSpan extends android.text.style.ReplacementSpan {
- method public int getSize(android.graphics.Paint, CharSequence!, int, int, android.graphics.Paint.FontMetricsInt!);
- }
-
- public class FontRequestEmojiCompatConfig extends androidx.emoji.text.EmojiCompat.Config {
- ctor public FontRequestEmojiCompatConfig(android.content.Context, androidx.core.provider.FontRequest);
- method public androidx.emoji.text.FontRequestEmojiCompatConfig! setHandler(android.os.Handler!);
- method public androidx.emoji.text.FontRequestEmojiCompatConfig! setRetryPolicy(androidx.emoji.text.FontRequestEmojiCompatConfig.RetryPolicy!);
- }
-
- public static class FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy extends androidx.emoji.text.FontRequestEmojiCompatConfig.RetryPolicy {
- ctor public FontRequestEmojiCompatConfig.ExponentialBackoffRetryPolicy(long);
- method public long getRetryDelay();
- }
-
- public abstract static class FontRequestEmojiCompatConfig.RetryPolicy {
- ctor public FontRequestEmojiCompatConfig.RetryPolicy();
- method public abstract long getRetryDelay();
- }
-
- @AnyThread @RequiresApi(19) public final class MetadataRepo {
- method public static androidx.emoji.text.MetadataRepo! create(android.graphics.Typeface, java.io.InputStream) throws java.io.IOException;
- method public static androidx.emoji.text.MetadataRepo! create(android.graphics.Typeface, java.nio.ByteBuffer) throws java.io.IOException;
- method public static androidx.emoji.text.MetadataRepo! create(android.content.res.AssetManager, String!) throws java.io.IOException;
- }
-
-}
-
-package androidx.emoji.widget {
-
- public class EmojiButton extends android.widget.Button {
- ctor public EmojiButton(android.content.Context!);
- ctor public EmojiButton(android.content.Context!, android.util.AttributeSet!);
- ctor public EmojiButton(android.content.Context!, android.util.AttributeSet!, int);
- ctor @RequiresApi(android.os.Build.VERSION_CODES.LOLLIPOP) public EmojiButton(android.content.Context!, android.util.AttributeSet!, int, int);
- }
-
- public class EmojiEditText extends android.widget.EditText {
- ctor public EmojiEditText(android.content.Context!);
- ctor public EmojiEditText(android.content.Context!, android.util.AttributeSet!);
- ctor public EmojiEditText(android.content.Context!, android.util.AttributeSet!, int);
- ctor @RequiresApi(android.os.Build.VERSION_CODES.LOLLIPOP) public EmojiEditText(android.content.Context!, android.util.AttributeSet!, int, int);
- method public int getMaxEmojiCount();
- method public void setMaxEmojiCount(@IntRange(from=0) int);
- }
-
- public final class EmojiEditTextHelper {
- ctor public EmojiEditTextHelper(android.widget.EditText);
- method public android.text.method.KeyListener getKeyListener(android.text.method.KeyListener);
- method public int getMaxEmojiCount();
- method public android.view.inputmethod.InputConnection? onCreateInputConnection(android.view.inputmethod.InputConnection?, android.view.inputmethod.EditorInfo);
- method public void setMaxEmojiCount(@IntRange(from=0) int);
- }
-
- public class EmojiExtractTextLayout extends android.widget.LinearLayout {
- ctor public EmojiExtractTextLayout(android.content.Context!);
- ctor public EmojiExtractTextLayout(android.content.Context!, android.util.AttributeSet?);
- ctor public EmojiExtractTextLayout(android.content.Context!, android.util.AttributeSet?, int);
- ctor @RequiresApi(api=android.os.Build.VERSION_CODES.LOLLIPOP) public EmojiExtractTextLayout(android.content.Context!, android.util.AttributeSet!, int, int);
- method public int getEmojiReplaceStrategy();
- method public void onUpdateExtractingViews(android.inputmethodservice.InputMethodService!, android.view.inputmethod.EditorInfo!);
- method public void setEmojiReplaceStrategy(int);
- }
-
- public class EmojiTextView extends android.widget.TextView {
- ctor public EmojiTextView(android.content.Context!);
- ctor public EmojiTextView(android.content.Context!, android.util.AttributeSet!);
- ctor public EmojiTextView(android.content.Context!, android.util.AttributeSet!, int);
- ctor @RequiresApi(api=android.os.Build.VERSION_CODES.LOLLIPOP) public EmojiTextView(android.content.Context!, android.util.AttributeSet!, int, int);
- }
-
- public final class EmojiTextViewHelper {
- ctor public EmojiTextViewHelper(android.widget.TextView);
- method public android.text.InputFilter[] getFilters(android.text.InputFilter[]);
- method public void setAllCaps(boolean);
- method public void updateTransformationMethod();
- method public android.text.method.TransformationMethod? wrapTransformationMethod(android.text.method.TransformationMethod?);
- }
-
-}
-
diff --git a/emoji/core/api/current.txt b/emoji/core/api/current.txt
index 4f5d70e..83b830a 100644
--- a/emoji/core/api/current.txt
+++ b/emoji/core/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.emoji.text {
@AnyThread public class EmojiCompat {
diff --git a/emoji/core/api/res-1.1.0-alpha01.txt b/emoji/core/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index 8bc8423..0000000
--- a/emoji/core/api/res-1.1.0-alpha01.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-attr emojiReplaceStrategy
-attr maxEmojiCount
diff --git a/emoji/core/api/restricted_1.0.0.txt b/emoji/core/api/restricted_1.0.0.txt
deleted file mode 100644
index 614c829..0000000
--- a/emoji/core/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,122 +0,0 @@
-// Signature format: 3.0
-package androidx.emoji.text {
-
- @AnyThread public class EmojiCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @VisibleForTesting public static androidx.emoji.text.EmojiCompat! reset(androidx.emoji.text.EmojiCompat.Config);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @VisibleForTesting public static androidx.emoji.text.EmojiCompat! reset(androidx.emoji.text.EmojiCompat!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void updateEditorInfoAttrs(android.view.inputmethod.EditorInfo);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface EmojiCompat.LoadState {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface EmojiCompat.LoadStrategy {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface EmojiCompat.ReplaceStrategy {
- }
-
- @AnyThread @RequiresApi(19) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class EmojiMetadata {
- method public void draw(android.graphics.Canvas, float, float, android.graphics.Paint);
- method public int getCodepointAt(int);
- method public int getCodepointsLength();
- method public short getCompatAdded();
- method public int getHasGlyph();
- method public short getHeight();
- method public int getId();
- method public short getSdkAdded();
- method public android.graphics.Typeface! getTypeface();
- method public short getWidth();
- method public boolean isDefaultEmoji();
- method public void setHasGlyph(boolean);
- method public String toString();
- field public static final int HAS_GLYPH_ABSENT = 1; // 0x1
- field public static final int HAS_GLYPH_EXISTS = 2; // 0x2
- field public static final int HAS_GLYPH_UNKNOWN = 0; // 0x0
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EmojiMetadata.HasGlyph {
- }
-
- @RequiresApi(19) public abstract class EmojiSpan {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @VisibleForTesting public final int getId();
- }
-
- public class FontRequestEmojiCompatConfig extends androidx.emoji.text.EmojiCompat.Config {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public FontRequestEmojiCompatConfig(android.content.Context, androidx.core.provider.FontRequest, androidx.emoji.text.FontRequestEmojiCompatConfig.FontProviderHelper);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class FontRequestEmojiCompatConfig.FontProviderHelper {
- ctor public FontRequestEmojiCompatConfig.FontProviderHelper();
- method public android.graphics.Typeface! buildTypeface(android.content.Context, androidx.core.provider.FontsContractCompat.FontInfo);
- method public androidx.core.provider.FontsContractCompat.FontFamilyResult! fetchFonts(android.content.Context, androidx.core.provider.FontRequest);
- method public void registerObserver(android.content.Context, android.net.Uri, android.database.ContentObserver);
- method public void unregisterObserver(android.content.Context, android.database.ContentObserver);
- }
-
- @AnyThread @RequiresApi(19) public final class MetadataRepo {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public char[]! getEmojiCharArray();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.text.emoji.flatbuffer.MetadataList! getMetadataList();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public final class TypefaceEmojiSpan extends androidx.emoji.text.EmojiSpan {
- ctor public TypefaceEmojiSpan(androidx.emoji.text.EmojiMetadata!);
- method public void draw(android.graphics.Canvas, CharSequence!, @IntRange(from=0L) int, @IntRange(from=0L) int, float, int, int, int, android.graphics.Paint);
- }
-
-}
-
-package androidx.emoji.widget {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class EditTextAttributeHelper {
- ctor public EditTextAttributeHelper(android.view.View, android.util.AttributeSet!, int, int);
- method public int getMaxEmojiCount();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class EmojiExtractEditText {
- ctor public EmojiExtractEditText(android.content.Context!);
- ctor public EmojiExtractEditText(android.content.Context!, android.util.AttributeSet!);
- ctor public EmojiExtractEditText(android.content.Context!, android.util.AttributeSet!, int);
- ctor @RequiresApi(21) public EmojiExtractEditText(android.content.Context!, android.util.AttributeSet!, int, int);
- method public int getEmojiReplaceStrategy();
- method public int getMaxEmojiCount();
- method public android.view.inputmethod.InputConnection! onCreateInputConnection(android.view.inputmethod.EditorInfo!);
- method public void setCustomSelectionActionModeCallback(android.view.ActionMode.Callback!);
- method public void setEmojiReplaceStrategy(int);
- method public void setKeyListener(android.text.method.KeyListener?);
- method public void setMaxEmojiCount(@IntRange(from=0L) int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ExtractButtonCompat {
- ctor public ExtractButtonCompat(android.content.Context!);
- ctor public ExtractButtonCompat(android.content.Context!, android.util.AttributeSet!);
- ctor public ExtractButtonCompat(android.content.Context!, android.util.AttributeSet!, int);
- ctor @RequiresApi(api=21) public ExtractButtonCompat(android.content.Context!, android.util.AttributeSet!, int, int);
- method public boolean hasWindowFocus();
- method public void setCustomSelectionActionModeCallback(android.view.ActionMode.Callback!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class SpannableBuilder {
- method public android.text.SpannableStringBuilder! append(CharSequence!);
- method public android.text.SpannableStringBuilder! append(char);
- method public android.text.SpannableStringBuilder! append(CharSequence!, int, int);
- method public android.text.SpannableStringBuilder! append(CharSequence!, Object!, int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void beginBatchEdit();
- method public android.text.SpannableStringBuilder! delete(int, int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void endBatchEdit();
- method public int getSpanEnd(Object!);
- method public int getSpanFlags(Object!);
- method public int getSpanStart(Object!);
- method public <T> T[]! getSpans(int, int, Class<T>!);
- method public android.text.SpannableStringBuilder! insert(int, CharSequence!);
- method public android.text.SpannableStringBuilder! insert(int, CharSequence!, int, int);
- method public int nextSpanTransition(int, int, Class!);
- method public void removeSpan(Object!);
- method public android.text.SpannableStringBuilder! replace(int, int, CharSequence!);
- method public android.text.SpannableStringBuilder! replace(int, int, CharSequence!, int, int);
- method public void setSpan(Object!, int, int, int);
- method public CharSequence! subSequence(int, int);
- }
-
-}
-
diff --git a/emoji/core/api/restricted_1.1.0-alpha01.txt b/emoji/core/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index 1cf30a0..0000000
--- a/emoji/core/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-// Signature format: 3.0
-package androidx.emoji.text {
-
- @AnyThread public class EmojiCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @VisibleForTesting public static androidx.emoji.text.EmojiCompat! reset(androidx.emoji.text.EmojiCompat.Config);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @VisibleForTesting public static androidx.emoji.text.EmojiCompat! reset(androidx.emoji.text.EmojiCompat!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void updateEditorInfoAttrs(android.view.inputmethod.EditorInfo);
- }
-
- @IntDef({androidx.emoji.text.EmojiCompat.LOAD_STATE_DEFAULT, androidx.emoji.text.EmojiCompat.LOAD_STATE_LOADING, androidx.emoji.text.EmojiCompat.LOAD_STATE_SUCCEEDED, androidx.emoji.text.EmojiCompat.LOAD_STATE_FAILED}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EmojiCompat.LoadState {
- }
-
- @IntDef({androidx.emoji.text.EmojiCompat.LOAD_STRATEGY_DEFAULT, androidx.emoji.text.EmojiCompat.LOAD_STRATEGY_MANUAL}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EmojiCompat.LoadStrategy {
- }
-
- @IntDef({androidx.emoji.text.EmojiCompat.REPLACE_STRATEGY_DEFAULT, androidx.emoji.text.EmojiCompat.REPLACE_STRATEGY_NON_EXISTENT, androidx.emoji.text.EmojiCompat.REPLACE_STRATEGY_ALL}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EmojiCompat.ReplaceStrategy {
- }
-
- @AnyThread @RequiresApi(19) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class EmojiMetadata {
- method public void draw(android.graphics.Canvas, float, float, android.graphics.Paint);
- method public int getCodepointAt(int);
- method public int getCodepointsLength();
- method public short getCompatAdded();
- method @androidx.emoji.text.EmojiMetadata.HasGlyph public int getHasGlyph();
- method public short getHeight();
- method public int getId();
- method public short getSdkAdded();
- method public android.graphics.Typeface! getTypeface();
- method public short getWidth();
- method public boolean isDefaultEmoji();
- method public void setHasGlyph(boolean);
- field public static final int HAS_GLYPH_ABSENT = 1; // 0x1
- field public static final int HAS_GLYPH_EXISTS = 2; // 0x2
- field public static final int HAS_GLYPH_UNKNOWN = 0; // 0x0
- }
-
- @IntDef({androidx.emoji.text.EmojiMetadata.HAS_GLYPH_UNKNOWN, androidx.emoji.text.EmojiMetadata.HAS_GLYPH_ABSENT, androidx.emoji.text.EmojiMetadata.HAS_GLYPH_EXISTS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EmojiMetadata.HasGlyph {
- }
-
- @RequiresApi(19) public abstract class EmojiSpan extends android.text.style.ReplacementSpan {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @VisibleForTesting public final int getId();
- }
-
- public class FontRequestEmojiCompatConfig extends androidx.emoji.text.EmojiCompat.Config {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public FontRequestEmojiCompatConfig(android.content.Context, androidx.core.provider.FontRequest, androidx.emoji.text.FontRequestEmojiCompatConfig.FontProviderHelper);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class FontRequestEmojiCompatConfig.FontProviderHelper {
- ctor public FontRequestEmojiCompatConfig.FontProviderHelper();
- method public android.graphics.Typeface! buildTypeface(android.content.Context, androidx.core.provider.FontsContractCompat.FontInfo) throws android.content.pm.PackageManager.NameNotFoundException;
- method public androidx.core.provider.FontsContractCompat.FontFamilyResult! fetchFonts(android.content.Context, androidx.core.provider.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException;
- method public void registerObserver(android.content.Context, android.net.Uri, android.database.ContentObserver);
- method public void unregisterObserver(android.content.Context, android.database.ContentObserver);
- }
-
- @AnyThread @RequiresApi(19) public final class MetadataRepo {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public char[]! getEmojiCharArray();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.text.emoji.flatbuffer.MetadataList! getMetadataList();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public final class TypefaceEmojiSpan extends androidx.emoji.text.EmojiSpan {
- ctor public TypefaceEmojiSpan(androidx.emoji.text.EmojiMetadata!);
- method public void draw(android.graphics.Canvas, CharSequence!, @IntRange(from=0) int, @IntRange(from=0) int, float, int, int, int, android.graphics.Paint);
- }
-
-}
-
-package androidx.emoji.widget {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class EditTextAttributeHelper {
- ctor public EditTextAttributeHelper(android.view.View, android.util.AttributeSet!, int, int);
- method public int getMaxEmojiCount();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class EmojiExtractEditText extends android.inputmethodservice.ExtractEditText {
- ctor public EmojiExtractEditText(android.content.Context!);
- ctor public EmojiExtractEditText(android.content.Context!, android.util.AttributeSet!);
- ctor public EmojiExtractEditText(android.content.Context!, android.util.AttributeSet!, int);
- ctor @RequiresApi(android.os.Build.VERSION_CODES.LOLLIPOP) public EmojiExtractEditText(android.content.Context!, android.util.AttributeSet!, int, int);
- method public int getEmojiReplaceStrategy();
- method public int getMaxEmojiCount();
- method public void setEmojiReplaceStrategy(@androidx.emoji.text.EmojiCompat.ReplaceStrategy int);
- method public void setMaxEmojiCount(@IntRange(from=0) int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ExtractButtonCompat extends android.widget.Button {
- ctor public ExtractButtonCompat(android.content.Context!);
- ctor public ExtractButtonCompat(android.content.Context!, android.util.AttributeSet!);
- ctor public ExtractButtonCompat(android.content.Context!, android.util.AttributeSet!, int);
- ctor @RequiresApi(api=android.os.Build.VERSION_CODES.LOLLIPOP) public ExtractButtonCompat(android.content.Context!, android.util.AttributeSet!, int, int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class SpannableBuilder extends android.text.SpannableStringBuilder {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void beginBatchEdit();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void endBatchEdit();
- }
-
-}
-
diff --git a/emoji/core/api/restricted_current.txt b/emoji/core/api/restricted_current.txt
deleted file mode 100644
index 1cf30a0..0000000
--- a/emoji/core/api/restricted_current.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-// Signature format: 3.0
-package androidx.emoji.text {
-
- @AnyThread public class EmojiCompat {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @VisibleForTesting public static androidx.emoji.text.EmojiCompat! reset(androidx.emoji.text.EmojiCompat.Config);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @VisibleForTesting public static androidx.emoji.text.EmojiCompat! reset(androidx.emoji.text.EmojiCompat!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void updateEditorInfoAttrs(android.view.inputmethod.EditorInfo);
- }
-
- @IntDef({androidx.emoji.text.EmojiCompat.LOAD_STATE_DEFAULT, androidx.emoji.text.EmojiCompat.LOAD_STATE_LOADING, androidx.emoji.text.EmojiCompat.LOAD_STATE_SUCCEEDED, androidx.emoji.text.EmojiCompat.LOAD_STATE_FAILED}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EmojiCompat.LoadState {
- }
-
- @IntDef({androidx.emoji.text.EmojiCompat.LOAD_STRATEGY_DEFAULT, androidx.emoji.text.EmojiCompat.LOAD_STRATEGY_MANUAL}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EmojiCompat.LoadStrategy {
- }
-
- @IntDef({androidx.emoji.text.EmojiCompat.REPLACE_STRATEGY_DEFAULT, androidx.emoji.text.EmojiCompat.REPLACE_STRATEGY_NON_EXISTENT, androidx.emoji.text.EmojiCompat.REPLACE_STRATEGY_ALL}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EmojiCompat.ReplaceStrategy {
- }
-
- @AnyThread @RequiresApi(19) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class EmojiMetadata {
- method public void draw(android.graphics.Canvas, float, float, android.graphics.Paint);
- method public int getCodepointAt(int);
- method public int getCodepointsLength();
- method public short getCompatAdded();
- method @androidx.emoji.text.EmojiMetadata.HasGlyph public int getHasGlyph();
- method public short getHeight();
- method public int getId();
- method public short getSdkAdded();
- method public android.graphics.Typeface! getTypeface();
- method public short getWidth();
- method public boolean isDefaultEmoji();
- method public void setHasGlyph(boolean);
- field public static final int HAS_GLYPH_ABSENT = 1; // 0x1
- field public static final int HAS_GLYPH_EXISTS = 2; // 0x2
- field public static final int HAS_GLYPH_UNKNOWN = 0; // 0x0
- }
-
- @IntDef({androidx.emoji.text.EmojiMetadata.HAS_GLYPH_UNKNOWN, androidx.emoji.text.EmojiMetadata.HAS_GLYPH_ABSENT, androidx.emoji.text.EmojiMetadata.HAS_GLYPH_EXISTS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface EmojiMetadata.HasGlyph {
- }
-
- @RequiresApi(19) public abstract class EmojiSpan extends android.text.style.ReplacementSpan {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @VisibleForTesting public final int getId();
- }
-
- public class FontRequestEmojiCompatConfig extends androidx.emoji.text.EmojiCompat.Config {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public FontRequestEmojiCompatConfig(android.content.Context, androidx.core.provider.FontRequest, androidx.emoji.text.FontRequestEmojiCompatConfig.FontProviderHelper);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class FontRequestEmojiCompatConfig.FontProviderHelper {
- ctor public FontRequestEmojiCompatConfig.FontProviderHelper();
- method public android.graphics.Typeface! buildTypeface(android.content.Context, androidx.core.provider.FontsContractCompat.FontInfo) throws android.content.pm.PackageManager.NameNotFoundException;
- method public androidx.core.provider.FontsContractCompat.FontFamilyResult! fetchFonts(android.content.Context, androidx.core.provider.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException;
- method public void registerObserver(android.content.Context, android.net.Uri, android.database.ContentObserver);
- method public void unregisterObserver(android.content.Context, android.database.ContentObserver);
- }
-
- @AnyThread @RequiresApi(19) public final class MetadataRepo {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public char[]! getEmojiCharArray();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.text.emoji.flatbuffer.MetadataList! getMetadataList();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public final class TypefaceEmojiSpan extends androidx.emoji.text.EmojiSpan {
- ctor public TypefaceEmojiSpan(androidx.emoji.text.EmojiMetadata!);
- method public void draw(android.graphics.Canvas, CharSequence!, @IntRange(from=0) int, @IntRange(from=0) int, float, int, int, int, android.graphics.Paint);
- }
-
-}
-
-package androidx.emoji.widget {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class EditTextAttributeHelper {
- ctor public EditTextAttributeHelper(android.view.View, android.util.AttributeSet!, int, int);
- method public int getMaxEmojiCount();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class EmojiExtractEditText extends android.inputmethodservice.ExtractEditText {
- ctor public EmojiExtractEditText(android.content.Context!);
- ctor public EmojiExtractEditText(android.content.Context!, android.util.AttributeSet!);
- ctor public EmojiExtractEditText(android.content.Context!, android.util.AttributeSet!, int);
- ctor @RequiresApi(android.os.Build.VERSION_CODES.LOLLIPOP) public EmojiExtractEditText(android.content.Context!, android.util.AttributeSet!, int, int);
- method public int getEmojiReplaceStrategy();
- method public int getMaxEmojiCount();
- method public void setEmojiReplaceStrategy(@androidx.emoji.text.EmojiCompat.ReplaceStrategy int);
- method public void setMaxEmojiCount(@IntRange(from=0) int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ExtractButtonCompat extends android.widget.Button {
- ctor public ExtractButtonCompat(android.content.Context!);
- ctor public ExtractButtonCompat(android.content.Context!, android.util.AttributeSet!);
- ctor public ExtractButtonCompat(android.content.Context!, android.util.AttributeSet!, int);
- ctor @RequiresApi(api=android.os.Build.VERSION_CODES.LOLLIPOP) public ExtractButtonCompat(android.content.Context!, android.util.AttributeSet!, int, int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class SpannableBuilder extends android.text.SpannableStringBuilder {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void beginBatchEdit();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void endBatchEdit();
- }
-
-}
-
diff --git a/emoji/core/build.gradle b/emoji/core/build.gradle
index e0ac029..08bccb1 100644
--- a/emoji/core/build.gradle
+++ b/emoji/core/build.gradle
@@ -23,7 +23,6 @@
api files(configurations.repackage)
api(project(":core"))
- implementation(project(':collection'))
androidTestImplementation(TEST_EXT_JUNIT)
androidTestImplementation(TEST_CORE)
diff --git a/emoji/core/src/androidTest/java/androidx/emoji/text/AllEmojisTest.java b/emoji/core/src/androidTest/java/androidx/emoji/text/AllEmojisTest.java
index e2c267a..a94d6c2 100644
--- a/emoji/core/src/androidTest/java/androidx/emoji/text/AllEmojisTest.java
+++ b/emoji/core/src/androidTest/java/androidx/emoji/text/AllEmojisTest.java
@@ -28,8 +28,8 @@
import androidx.core.graphics.PaintCompat;
import androidx.emoji.util.TestString;
import androidx.test.core.app.ApplicationProvider;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -47,7 +47,7 @@
* Reads raw/allemojis.txt which includes all the emojis known to human kind and tests that
* EmojiCompat creates EmojiSpans for each one of them.
*/
-@LargeTest
+@SmallTest
@RunWith(Parameterized.class)
@SdkSuppress(minSdkVersion = 19)
public class AllEmojisTest {
diff --git a/emoji/core/src/androidTest/java/androidx/emoji/text/ConfigTest.java b/emoji/core/src/androidTest/java/androidx/emoji/text/ConfigTest.java
index ca93bae..bd0e5ac 100644
--- a/emoji/core/src/androidTest/java/androidx/emoji/text/ConfigTest.java
+++ b/emoji/core/src/androidTest/java/androidx/emoji/text/ConfigTest.java
@@ -36,15 +36,15 @@
import androidx.emoji.util.TestString;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class ConfigTest {
diff --git a/emoji/core/src/androidTest/java/androidx/emoji/text/EmojiCompatTest.java b/emoji/core/src/androidTest/java/androidx/emoji/text/EmojiCompatTest.java
index 3d35935..6b7ffdf 100644
--- a/emoji/core/src/androidTest/java/androidx/emoji/text/EmojiCompatTest.java
+++ b/emoji/core/src/androidTest/java/androidx/emoji/text/EmojiCompatTest.java
@@ -76,8 +76,8 @@
import androidx.emoji.util.Emoji.EmojiMapping;
import androidx.emoji.util.TestString;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Before;
@@ -90,7 +90,7 @@
import java.util.List;
import java.util.Set;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class EmojiCompatTest {
diff --git a/emoji/core/src/androidTest/java/androidx/emoji/text/EmojiSpanTest.java b/emoji/core/src/androidTest/java/androidx/emoji/text/EmojiSpanTest.java
index 14b349b..61a3f71 100644
--- a/emoji/core/src/androidTest/java/androidx/emoji/text/EmojiSpanTest.java
+++ b/emoji/core/src/androidTest/java/androidx/emoji/text/EmojiSpanTest.java
@@ -30,8 +30,8 @@
import android.text.TextPaint;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -39,7 +39,7 @@
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
@SdkSuppress(minSdkVersion = 19)
public class EmojiSpanTest {
diff --git a/emoji/core/src/androidTest/java/androidx/emoji/text/FontRequestEmojiCompatConfigTest.java b/emoji/core/src/androidTest/java/androidx/emoji/text/FontRequestEmojiCompatConfigTest.java
index 48a8e8a..5db5aa7 100644
--- a/emoji/core/src/androidTest/java/androidx/emoji/text/FontRequestEmojiCompatConfigTest.java
+++ b/emoji/core/src/androidTest/java/androidx/emoji/text/FontRequestEmojiCompatConfigTest.java
@@ -55,8 +55,8 @@
import androidx.core.provider.FontsContractCompat.FontInfo;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -72,7 +72,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class FontRequestEmojiCompatConfigTest {
private static final int DEFAULT_TIMEOUT_MILLIS = 3000;
diff --git a/emoji/core/src/androidTest/java/androidx/emoji/text/InitCallbackTest.java b/emoji/core/src/androidTest/java/androidx/emoji/text/InitCallbackTest.java
index 7e14adc..435384d 100644
--- a/emoji/core/src/androidTest/java/androidx/emoji/text/InitCallbackTest.java
+++ b/emoji/core/src/androidTest/java/androidx/emoji/text/InitCallbackTest.java
@@ -24,14 +24,14 @@
import androidx.annotation.NonNull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class InitCallbackTest {
diff --git a/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiEditTextHelperTest.java b/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiEditTextHelperTest.java
index b4004e0..79bed4a 100644
--- a/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiEditTextHelperTest.java
+++ b/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiEditTextHelperTest.java
@@ -35,15 +35,15 @@
import androidx.emoji.text.EmojiCompat;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
@SdkSuppress(minSdkVersion = 19)
public class EmojiEditTextHelperTest {
diff --git a/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiEditTextTest.java b/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiEditTextTest.java
index 000df34..faa4ad1 100644
--- a/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiEditTextTest.java
+++ b/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiEditTextTest.java
@@ -32,8 +32,8 @@
import androidx.emoji.util.TestString;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
-import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -43,7 +43,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class EmojiEditTextTest {
diff --git a/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiEditableFactoryTest.java b/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiEditableFactoryTest.java
index 2b7d4f7..31d8280 100644
--- a/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiEditableFactoryTest.java
+++ b/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiEditableFactoryTest.java
@@ -32,12 +32,12 @@
import androidx.emoji.text.EmojiSpan;
import androidx.emoji.text.TypefaceEmojiSpan;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class EmojiEditableFactoryTest {
diff --git a/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiInputConnectionTest.java b/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiInputConnectionTest.java
index 33e62e9..77101b3 100644
--- a/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiInputConnectionTest.java
+++ b/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiInputConnectionTest.java
@@ -43,8 +43,8 @@
import androidx.emoji.util.Emoji;
import androidx.emoji.util.TestString;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Before;
@@ -52,7 +52,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
@SdkSuppress(minSdkVersion = 19)
public class EmojiInputConnectionTest {
diff --git a/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiInputFilterTest.java b/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiInputFilterTest.java
index e832fa4..32d9068 100644
--- a/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiInputFilterTest.java
+++ b/emoji/core/src/androidTest/java/androidx/emoji/widget/EmojiInputFilterTest.java
@@ -36,13 +36,13 @@
import androidx.emoji.text.EmojiCompat;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class EmojiInputFilterTest {
diff --git a/emoji/core/src/androidTest/java/androidx/emoji/widget/SpannableBuilderTest.java b/emoji/core/src/androidTest/java/androidx/emoji/widget/SpannableBuilderTest.java
index 0c27ee6..302957c 100644
--- a/emoji/core/src/androidTest/java/androidx/emoji/widget/SpannableBuilderTest.java
+++ b/emoji/core/src/androidTest/java/androidx/emoji/widget/SpannableBuilderTest.java
@@ -41,13 +41,13 @@
import androidx.emoji.text.EmojiSpan;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class SpannableBuilderTest {
diff --git a/emoji/core/src/main/java/androidx/emoji/text/EmojiCompat.java b/emoji/core/src/main/java/androidx/emoji/text/EmojiCompat.java
index de9bb19..9e4b58b 100644
--- a/emoji/core/src/main/java/androidx/emoji/text/EmojiCompat.java
+++ b/emoji/core/src/main/java/androidx/emoji/text/EmojiCompat.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.text;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Color;
import android.os.Build;
@@ -129,7 +129,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({LOAD_STATE_DEFAULT, LOAD_STATE_LOADING, LOAD_STATE_SUCCEEDED, LOAD_STATE_FAILED})
@Retention(RetentionPolicy.SOURCE)
public @interface LoadState {
@@ -157,7 +157,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({REPLACE_STRATEGY_DEFAULT, REPLACE_STRATEGY_NON_EXISTENT, REPLACE_STRATEGY_ALL})
@Retention(RetentionPolicy.SOURCE)
public @interface ReplaceStrategy {
@@ -181,7 +181,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({LOAD_STRATEGY_DEFAULT, LOAD_STRATEGY_MANUAL})
@Retention(RetentionPolicy.SOURCE)
public @interface LoadStrategy {
@@ -190,7 +190,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
static final int EMOJI_COUNT_UNLIMITED = Integer.MAX_VALUE;
private static final Object sInstanceLock = new Object();
@@ -309,7 +309,7 @@
* @hide
*/
@SuppressWarnings("GuardedBy")
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@VisibleForTesting
public static EmojiCompat reset(@NonNull final Config config) {
synchronized (sInstanceLock) {
@@ -324,7 +324,7 @@
* @hide
*/
@SuppressWarnings("GuardedBy")
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@VisibleForTesting
public static EmojiCompat reset(final EmojiCompat emojiCompat) {
synchronized (sInstanceLock) {
@@ -338,7 +338,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@VisibleForTesting
void setGlyphChecker(@NonNull final EmojiProcessor.GlyphChecker glyphChecker) {
mHelper.setGlyphChecker(glyphChecker);
@@ -506,7 +506,7 @@
* @return whether a background should be drawn for the emoji.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
boolean isEmojiSpanIndicatorEnabled() {
return mEmojiSpanIndicatorEnabled;
}
@@ -515,7 +515,7 @@
* @return whether a background should be drawn for the emoji.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ColorInt int getEmojiSpanIndicatorColor() {
return mEmojiSpanIndicatorColor;
}
@@ -803,7 +803,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void updateEditorInfoAttrs(@NonNull final EditorInfo outAttrs) {
//noinspection ConstantConditions
if (isInitialized() && outAttrs != null && outAttrs.extras != null) {
@@ -816,7 +816,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
static class SpanFactory {
/**
diff --git a/emoji/core/src/main/java/androidx/emoji/text/EmojiMetadata.java b/emoji/core/src/main/java/androidx/emoji/text/EmojiMetadata.java
index ea0a187..64cde41 100644
--- a/emoji/core/src/main/java/androidx/emoji/text/EmojiMetadata.java
+++ b/emoji/core/src/main/java/androidx/emoji/text/EmojiMetadata.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.text;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Canvas;
import android.graphics.Paint;
@@ -38,7 +38,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@AnyThread
@RequiresApi(19)
public class EmojiMetadata {
diff --git a/emoji/core/src/main/java/androidx/emoji/text/EmojiProcessor.java b/emoji/core/src/main/java/androidx/emoji/text/EmojiProcessor.java
index 51dcc116..536eb9b 100644
--- a/emoji/core/src/main/java/androidx/emoji/text/EmojiProcessor.java
+++ b/emoji/core/src/main/java/androidx/emoji/text/EmojiProcessor.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.text;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Build;
import android.text.Editable;
@@ -51,7 +51,7 @@
* @hide
*/
@AnyThread
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
final class EmojiProcessor {
@@ -787,7 +787,7 @@
* @hide
*/
@AnyThread
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class GlyphChecker {
/**
* Default text size for {@link #mTextPaint}.
diff --git a/emoji/core/src/main/java/androidx/emoji/text/EmojiSpan.java b/emoji/core/src/main/java/androidx/emoji/text/EmojiSpan.java
index 9ca9ee6..95480fd 100644
--- a/emoji/core/src/main/java/androidx/emoji/text/EmojiSpan.java
+++ b/emoji/core/src/main/java/androidx/emoji/text/EmojiSpan.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.text;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Paint;
import android.text.style.ReplacementSpan;
@@ -67,7 +67,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
EmojiSpan(@NonNull final EmojiMetadata metadata) {
Preconditions.checkNotNull(metadata, "metadata cannot be null");
mMetadata = metadata;
@@ -96,7 +96,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
final EmojiMetadata getMetadata() {
return mMetadata;
}
@@ -106,7 +106,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
final int getWidth() {
return mWidth;
}
@@ -116,7 +116,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
final int getHeight() {
return mHeight;
}
@@ -124,7 +124,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
final float getRatio() {
return mRatio;
}
@@ -134,7 +134,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@VisibleForTesting
public final int getId() {
return getMetadata().getId();
diff --git a/emoji/core/src/main/java/androidx/emoji/text/FontRequestEmojiCompatConfig.java b/emoji/core/src/main/java/androidx/emoji/text/FontRequestEmojiCompatConfig.java
index b985dab..99ac85f 100644
--- a/emoji/core/src/main/java/androidx/emoji/text/FontRequestEmojiCompatConfig.java
+++ b/emoji/core/src/main/java/androidx/emoji/text/FontRequestEmojiCompatConfig.java
@@ -123,7 +123,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public FontRequestEmojiCompatConfig(@NonNull Context context, @NonNull FontRequest request,
@NonNull FontProviderHelper fontProviderHelper) {
super(new FontRequestMetadataLoader(context, request, fontProviderHelper));
@@ -329,7 +329,7 @@
* Delegate class for mocking FontsContractCompat.fetchFonts.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static class FontProviderHelper {
/** Calls FontsContractCompat.fetchFonts. */
public FontFamilyResult fetchFonts(@NonNull Context context,
diff --git a/emoji/core/src/main/java/androidx/emoji/text/MetadataListReader.java b/emoji/core/src/main/java/androidx/emoji/text/MetadataListReader.java
index fc09518..705650c3 100644
--- a/emoji/core/src/main/java/androidx/emoji/text/MetadataListReader.java
+++ b/emoji/core/src/main/java/androidx/emoji/text/MetadataListReader.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.text;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.res.AssetManager;
@@ -35,7 +35,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@AnyThread
@RequiresApi(19)
class MetadataListReader {
diff --git a/emoji/core/src/main/java/androidx/emoji/text/MetadataRepo.java b/emoji/core/src/main/java/androidx/emoji/text/MetadataRepo.java
index 0c5bb01..5f8b1be 100644
--- a/emoji/core/src/main/java/androidx/emoji/text/MetadataRepo.java
+++ b/emoji/core/src/main/java/androidx/emoji/text/MetadataRepo.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.text;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.res.AssetManager;
import android.graphics.Typeface;
@@ -70,7 +70,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
MetadataRepo() {
mTypeface = null;
mMetadataList = null;
@@ -148,7 +148,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Typeface getTypeface() {
return mTypeface;
}
@@ -156,7 +156,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
int getMetadataVersion() {
return mMetadataList.version();
}
@@ -164,7 +164,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Node getRootNode() {
return mRootNode;
}
@@ -172,7 +172,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public char[] getEmojiCharArray() {
return mEmojiCharArray;
}
@@ -180,7 +180,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public MetadataList getMetadataList() {
return mMetadataList;
}
@@ -190,7 +190,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@VisibleForTesting
void put(@NonNull final EmojiMetadata data) {
Preconditions.checkNotNull(data, "emoji metadata cannot be null");
@@ -206,7 +206,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
static class Node {
private final SparseArray<Node> mChildren;
private EmojiMetadata mData;
diff --git a/emoji/core/src/main/java/androidx/emoji/text/TypefaceEmojiSpan.java b/emoji/core/src/main/java/androidx/emoji/text/TypefaceEmojiSpan.java
index cb0a3e0..601d20d 100644
--- a/emoji/core/src/main/java/androidx/emoji/text/TypefaceEmojiSpan.java
+++ b/emoji/core/src/main/java/androidx/emoji/text/TypefaceEmojiSpan.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.text;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Canvas;
import android.graphics.Paint;
@@ -31,7 +31,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
public final class TypefaceEmojiSpan extends EmojiSpan {
diff --git a/emoji/core/src/main/java/androidx/emoji/widget/EditTextAttributeHelper.java b/emoji/core/src/main/java/androidx/emoji/widget/EditTextAttributeHelper.java
index db5e0df..8f588ce 100644
--- a/emoji/core/src/main/java/androidx/emoji/widget/EditTextAttributeHelper.java
+++ b/emoji/core/src/main/java/androidx/emoji/widget/EditTextAttributeHelper.java
@@ -16,7 +16,7 @@
package androidx.emoji.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.TypedArray;
@@ -32,7 +32,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class EditTextAttributeHelper {
static final int MAX_EMOJI_COUNT = Integer.MAX_VALUE;
private int mMaxEmojiCount;
diff --git a/emoji/core/src/main/java/androidx/emoji/widget/EmojiEditTextHelper.java b/emoji/core/src/main/java/androidx/emoji/widget/EmojiEditTextHelper.java
index fbc30f5..d140623 100644
--- a/emoji/core/src/main/java/androidx/emoji/widget/EmojiEditTextHelper.java
+++ b/emoji/core/src/main/java/androidx/emoji/widget/EmojiEditTextHelper.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Build;
import android.text.method.KeyListener;
@@ -158,7 +158,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void setEmojiReplaceStrategy(@EmojiCompat.ReplaceStrategy int replaceStrategy) {
mEmojiReplaceStrategy = replaceStrategy;
mHelper.setEmojiReplaceStrategy(replaceStrategy);
@@ -173,7 +173,7 @@
* {@link EmojiCompat#REPLACE_STRATEGY_ALL}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
int getEmojiReplaceStrategy() {
return mEmojiReplaceStrategy;
}
diff --git a/emoji/core/src/main/java/androidx/emoji/widget/EmojiExtractEditText.java b/emoji/core/src/main/java/androidx/emoji/widget/EmojiExtractEditText.java
index 39f7125..1279d71 100644
--- a/emoji/core/src/main/java/androidx/emoji/widget/EmojiExtractEditText.java
+++ b/emoji/core/src/main/java/androidx/emoji/widget/EmojiExtractEditText.java
@@ -16,7 +16,7 @@
package androidx.emoji.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.inputmethodservice.ExtractEditText;
@@ -43,7 +43,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class EmojiExtractEditText extends ExtractEditText {
private EmojiEditTextHelper mEmojiEditTextHelper;
diff --git a/emoji/core/src/main/java/androidx/emoji/widget/EmojiInputConnection.java b/emoji/core/src/main/java/androidx/emoji/widget/EmojiInputConnection.java
index 6c95d11..e51d248 100644
--- a/emoji/core/src/main/java/androidx/emoji/widget/EmojiInputConnection.java
+++ b/emoji/core/src/main/java/androidx/emoji/widget/EmojiInputConnection.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.text.Editable;
import android.view.inputmethod.EditorInfo;
@@ -37,7 +37,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
final class EmojiInputConnection extends InputConnectionWrapper {
private final TextView mTextView;
diff --git a/emoji/core/src/main/java/androidx/emoji/widget/EmojiInputFilter.java b/emoji/core/src/main/java/androidx/emoji/widget/EmojiInputFilter.java
index b3af99b..b44e859 100644
--- a/emoji/core/src/main/java/androidx/emoji/widget/EmojiInputFilter.java
+++ b/emoji/core/src/main/java/androidx/emoji/widget/EmojiInputFilter.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.text.Selection;
import android.text.Spannable;
@@ -40,7 +40,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
final class EmojiInputFilter implements android.text.InputFilter {
private final TextView mTextView;
diff --git a/emoji/core/src/main/java/androidx/emoji/widget/EmojiKeyListener.java b/emoji/core/src/main/java/androidx/emoji/widget/EmojiKeyListener.java
index 0efb06c..d1de3fb 100644
--- a/emoji/core/src/main/java/androidx/emoji/widget/EmojiKeyListener.java
+++ b/emoji/core/src/main/java/androidx/emoji/widget/EmojiKeyListener.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.text.Editable;
import android.view.KeyEvent;
@@ -30,7 +30,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
final class EmojiKeyListener implements android.text.method.KeyListener {
private final android.text.method.KeyListener mKeyListener;
diff --git a/emoji/core/src/main/java/androidx/emoji/widget/EmojiTextWatcher.java b/emoji/core/src/main/java/androidx/emoji/widget/EmojiTextWatcher.java
index f35ea4d..2197aff 100644
--- a/emoji/core/src/main/java/androidx/emoji/widget/EmojiTextWatcher.java
+++ b/emoji/core/src/main/java/androidx/emoji/widget/EmojiTextWatcher.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.text.Editable;
import android.text.Selection;
@@ -35,7 +35,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
final class EmojiTextWatcher implements android.text.TextWatcher {
private final EditText mEditText;
diff --git a/emoji/core/src/main/java/androidx/emoji/widget/EmojiTransformationMethod.java b/emoji/core/src/main/java/androidx/emoji/widget/EmojiTransformationMethod.java
index b875d61..81fe615 100644
--- a/emoji/core/src/main/java/androidx/emoji/widget/EmojiTransformationMethod.java
+++ b/emoji/core/src/main/java/androidx/emoji/widget/EmojiTransformationMethod.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Rect;
import android.text.method.TransformationMethod;
@@ -32,7 +32,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
class EmojiTransformationMethod implements TransformationMethod {
private final TransformationMethod mTransformationMethod;
diff --git a/emoji/core/src/main/java/androidx/emoji/widget/ExtractButtonCompat.java b/emoji/core/src/main/java/androidx/emoji/widget/ExtractButtonCompat.java
index bfb96f1..813585c 100644
--- a/emoji/core/src/main/java/androidx/emoji/widget/ExtractButtonCompat.java
+++ b/emoji/core/src/main/java/androidx/emoji/widget/ExtractButtonCompat.java
@@ -16,7 +16,7 @@
package androidx.emoji.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.os.Build;
@@ -33,7 +33,7 @@
* inflating {@link EmojiExtractEditText} for keyboard use.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ExtractButtonCompat extends Button {
public ExtractButtonCompat(Context context) {
super(context, null);
diff --git a/emoji/core/src/main/java/androidx/emoji/widget/SpannableBuilder.java b/emoji/core/src/main/java/androidx/emoji/widget/SpannableBuilder.java
index c182b0f..5813758 100644
--- a/emoji/core/src/main/java/androidx/emoji/widget/SpannableBuilder.java
+++ b/emoji/core/src/main/java/androidx/emoji/widget/SpannableBuilder.java
@@ -15,7 +15,7 @@
*/
package androidx.emoji.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.text.Editable;
import android.text.SpanWatcher;
@@ -48,7 +48,7 @@
* @hide
* @see EmojiEditableFactory
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class SpannableBuilder extends SpannableStringBuilder {
/**
* DynamicLayout$ChangeWatcher class.
@@ -63,7 +63,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
SpannableBuilder(@NonNull Class<?> watcherClass) {
Preconditions.checkNotNull(watcherClass, "watcherClass cannot be null");
mWatcherClass = watcherClass;
@@ -72,7 +72,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
SpannableBuilder(@NonNull Class<?> watcherClass, @NonNull CharSequence text) {
super(text);
Preconditions.checkNotNull(watcherClass, "watcherClass cannot be null");
@@ -82,7 +82,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
SpannableBuilder(@NonNull Class<?> watcherClass, @NonNull CharSequence text, int start,
int end) {
super(text, start, end);
@@ -93,7 +93,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
static SpannableBuilder create(@NonNull Class<?> clazz, @NonNull CharSequence text) {
return new SpannableBuilder(clazz, text);
}
@@ -255,7 +255,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void beginBatchEdit() {
blockWatchers();
}
@@ -263,7 +263,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void endBatchEdit() {
unblockwatchers();
fireWatchers();
diff --git a/enterprise/feedback/api/1.0.0-alpha01.txt b/enterprise/feedback/api/1.0.0-alpha01.txt
index 037c6e4..f1dbc74 100644
--- a/enterprise/feedback/api/1.0.0-alpha01.txt
+++ b/enterprise/feedback/api/1.0.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.enterprise.feedback {
public abstract class KeyedAppState {
@@ -24,7 +24,6 @@
public class KeyedAppStatesReporter {
method public static androidx.enterprise.feedback.KeyedAppStatesReporter getInstance(android.content.Context);
- method public static void initialize(android.content.Context, java.util.concurrent.Executor);
method public void set(java.util.Collection<androidx.enterprise.feedback.KeyedAppState>);
method public void setImmediate(java.util.Collection<androidx.enterprise.feedback.KeyedAppState>);
field public static final String APP_STATES_ACTION = "androidx.enterprise.feedback.action.APP_STATES";
diff --git a/enterprise/feedback/api/current.txt b/enterprise/feedback/api/current.txt
index 037c6e4..f1dbc74 100644
--- a/enterprise/feedback/api/current.txt
+++ b/enterprise/feedback/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.enterprise.feedback {
public abstract class KeyedAppState {
@@ -24,7 +24,6 @@
public class KeyedAppStatesReporter {
method public static androidx.enterprise.feedback.KeyedAppStatesReporter getInstance(android.content.Context);
- method public static void initialize(android.content.Context, java.util.concurrent.Executor);
method public void set(java.util.Collection<androidx.enterprise.feedback.KeyedAppState>);
method public void setImmediate(java.util.Collection<androidx.enterprise.feedback.KeyedAppState>);
field public static final String APP_STATES_ACTION = "androidx.enterprise.feedback.action.APP_STATES";
diff --git a/enterprise/feedback/api/restricted_1.0.0-alpha01.txt b/enterprise/feedback/api/restricted_1.0.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/enterprise/feedback/api/restricted_1.0.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/enterprise/feedback/api/restricted_current.txt b/enterprise/feedback/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/enterprise/feedback/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/enterprise/feedback/build.gradle b/enterprise/feedback/build.gradle
index 01318c7..07f7eb1 100644
--- a/enterprise/feedback/build.gradle
+++ b/enterprise/feedback/build.gradle
@@ -24,7 +24,7 @@
}
supportLibrary {
name = "Enterprise Feedback"
- publish = true
+ publish = false
mavenVersion = LibraryVersions.ENTERPRISE
mavenGroup = LibraryGroups.ENTERPRISE
inceptionYear = "2019"
diff --git a/enterprise/feedback/src/main/java/androidx/enterprise/feedback/BufferedServiceConnection.java b/enterprise/feedback/src/main/java/androidx/enterprise/feedback/BufferedServiceConnection.java
index fb3a361..a6e8af6 100644
--- a/enterprise/feedback/src/main/java/androidx/enterprise/feedback/BufferedServiceConnection.java
+++ b/enterprise/feedback/src/main/java/androidx/enterprise/feedback/BufferedServiceConnection.java
@@ -33,7 +33,6 @@
import java.util.ArrayDeque;
import java.util.Queue;
-import java.util.concurrent.Executor;
/**
* A wrapper around {@link ServiceConnection} and {@link Messenger} which will buffer messages sent
@@ -41,8 +40,6 @@
*
* <p>Each instance is single-use. After being unbound either manually (using {@link #unbind()} or
* due to an error it will become "dead" (see {@link #isDead()} and cannot be used further.
- *
- * <p>Instances are not thread safe, so avoid using on multiple different threads.
*/
class BufferedServiceConnection {
@@ -64,27 +61,14 @@
private boolean mHasBound = false;
@SuppressWarnings("WeakerAccess") /* synthetic access */
final Queue<Message> mBuffer = new ArrayDeque<>();
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- final Executor mExecutor;
- /**
- * Create a {@link BufferedServiceConnection}.
- *
- * <p>The {@link Executor} must execute serially on the same thread as all calls to
- * this instance.
- */
- BufferedServiceConnection(
- Executor executor, Context context, Intent bindIntent, int flags) {
- if (executor == null) {
- throw new NullPointerException("executor must not be null");
- }
+ BufferedServiceConnection(Context context, Intent bindIntent, int flags) {
if (context == null) {
- throw new NullPointerException("context must not be null");
+ throw new NullPointerException("Context must not be null");
}
if (bindIntent == null) {
throw new NullPointerException("bindIntent must not be null");
}
- this.mExecutor = executor;
this.mContext = context;
this.mBindIntent = bindIntent;
this.mFlags = flags;
@@ -108,45 +92,29 @@
}
void unbind() {
- if (!mHasBound) {
- throw new IllegalStateException("bindService must be called before unbind");
- }
- mIsDead = true;
mContext.unbindService(mConnection);
+ mIsDead = true;
}
private final ServiceConnection mConnection =
new ServiceConnection() {
@Override
public void onBindingDied(ComponentName name) {
- mExecutor.execute(new Runnable() {
- @Override
- public void run() {
- mIsDead = true;
- }
- });
+ mIsDead = true;
}
@Override
- public void onServiceConnected(final ComponentName componentName,
- final IBinder service) {
- mExecutor.execute(new Runnable() {
- @Override
- public void run() {
- mHasBeenDisconnected = false;
- if (canPackageReceiveAppStates(
- mContext, componentName.getPackageName())) {
- mMessenger = new Messenger(service);
- sendBufferedMessages();
- } else {
- mIsDead = true;
- }
- }
- });
+ public void onServiceConnected(ComponentName componentName, IBinder service) {
+ mHasBeenDisconnected = false;
+ if (canPackageReceiveAppStates(mContext, componentName.getPackageName())) {
+ mMessenger = new Messenger(service);
+ sendBufferedMessages();
+ } else {
+ mIsDead = true;
+ }
}
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- void sendBufferedMessages() {
+ private void sendBufferedMessages() {
while (!mBuffer.isEmpty()) {
trySendMessage(mBuffer.poll());
}
@@ -154,13 +122,8 @@
@Override
public void onServiceDisconnected(ComponentName componentName) {
- mExecutor.execute(new Runnable() {
- @Override
- public void run() {
- mHasBeenDisconnected = true;
- mMessenger = null;
- }
- });
+ mHasBeenDisconnected = true;
+ mMessenger = null;
}
};
diff --git a/enterprise/feedback/src/main/java/androidx/enterprise/feedback/KeyedAppStatesReporter.java b/enterprise/feedback/src/main/java/androidx/enterprise/feedback/KeyedAppStatesReporter.java
index 2a40b1c..6e0bc15 100644
--- a/enterprise/feedback/src/main/java/androidx/enterprise/feedback/KeyedAppStatesReporter.java
+++ b/enterprise/feedback/src/main/java/androidx/enterprise/feedback/KeyedAppStatesReporter.java
@@ -27,23 +27,20 @@
import android.os.Build;
import android.os.Bundle;
import android.os.Message;
+import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
/**
* A reporter of keyed app states to enable communication between an app and an EMM (enterprise
@@ -105,44 +102,6 @@
private final Map<String, BufferedServiceConnection> mServiceConnections = new HashMap<>();
- private static final int EXECUTOR_IDLE_ALIVE_TIME_SECS = 20;
- private final Executor mExecutor;
-
- /**
- * Creates an {@link ExecutorService} which has no persistent background thread, and ensures
- * tasks will run in submit order.
- */
- private static ExecutorService createExecutorService() {
- return new ThreadPoolExecutor(
- /* corePoolSize= */ 0,
- /* maximumPoolSize= */ 1,
- EXECUTOR_IDLE_ALIVE_TIME_SECS,
- TimeUnit.SECONDS,
- new LinkedBlockingQueue<Runnable>() /* Not used */);
- }
-
- /**
- * Sets executor used to construct the singleton.
- *
- * <p>If required, this method must be called before calling {@link #getInstance(Context)}.
- *
- * <p>If this method is not called, the reporter will run on a newly-created thread.
- * This newly-created thread will be cleaned up and recreated as necessary when idle.
- */
- public static void initialize(@NonNull Context context, @NonNull Executor executor) {
- if (context == null || executor == null) {
- throw new NullPointerException();
- }
- synchronized (KeyedAppStatesReporter.class) {
- if (sSingleton != null) {
- throw new IllegalStateException(
- "initialize can only be called once and must be called before "
- + "calling getInstance.");
- }
- initializeSingleton(context, executor);
- }
- }
-
/**
* Returns an instance of the reporter.
*
@@ -156,18 +115,14 @@
if (sSingleton == null) {
synchronized (KeyedAppStatesReporter.class) {
if (sSingleton == null) {
- initializeSingleton(context, createExecutorService());
+ sSingleton = new KeyedAppStatesReporter(context);
+ sSingleton.bind();
}
}
}
return sSingleton;
}
- private static void initializeSingleton(@NonNull Context context, @NonNull Executor executor) {
- sSingleton = new KeyedAppStatesReporter(context, executor);
- sSingleton.bind();
- }
-
@VisibleForTesting
static void resetSingleton() {
synchronized (KeyedAppStatesReporter.class) {
@@ -175,9 +130,8 @@
}
}
- private KeyedAppStatesReporter(Context context, Executor executor) {
+ private KeyedAppStatesReporter(Context context) {
this.mContext = context.getApplicationContext();
- this.mExecutor = executor;
}
/**
@@ -207,24 +161,20 @@
set(states, false);
}
- private void set(final Collection<KeyedAppState> states, final boolean immediate) {
- mExecutor.execute(new Runnable() {
- @Override
- public void run() {
- if (states.isEmpty()) {
- return;
- }
+ private void set(Collection<KeyedAppState> states, boolean immediate) {
+ if (states.isEmpty()) {
+ Log.i(LOG_TAG, "states provided was empty");
+ return;
+ }
- unbindOldBindings();
- bind();
+ unbindOldBindings();
+ bind();
- send(buildStatesBundle(states), immediate);
- }
- });
+ send(buildStatesBundle(states), immediate);
}
/**
- * Performs the same function as {@link #set(Collection)}, except it also
+ * Performs the same function as {@link #set(Collection<KeyedAppState>)}, except it also
* requests
* that the states are immediately uploaded to be accessible via server APIs.
*
@@ -235,8 +185,7 @@
set(states, true);
}
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- void bind() {
+ private void bind() {
Collection<String> acceptablePackageNames = getDeviceOwnerAndProfileOwnerPackageNames();
acceptablePackageNames.add(PHONESKY_PACKAGE_NAME);
bind(acceptablePackageNames);
@@ -263,8 +212,7 @@
bindIntent.setComponent(new ComponentName(serviceInfo.packageName, serviceInfo.name));
BufferedServiceConnection bufferedServiceConnection =
- new BufferedServiceConnection(
- mExecutor, mContext, bindIntent, Context.BIND_AUTO_CREATE);
+ new BufferedServiceConnection(mContext, bindIntent, Context.BIND_AUTO_CREATE);
bufferedServiceConnection.bindService();
mServiceConnections.put(serviceInfo.packageName, bufferedServiceConnection);
@@ -277,7 +225,7 @@
Collection<ComponentName> activeAdmins = devicePolicyManager.getActiveAdmins();
if (activeAdmins == null) {
- return new ArrayList<>();
+ return Collections.emptyList();
}
Collection<String> deviceOwnerProfileOwnerPackageNames = new ArrayList<>();
@@ -292,8 +240,7 @@
return deviceOwnerProfileOwnerPackageNames;
}
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- void unbindOldBindings() {
+ private void unbindOldBindings() {
Iterator<Entry<String, BufferedServiceConnection>> iterator =
mServiceConnections.entrySet().iterator();
@@ -347,8 +294,7 @@
return validServiceInfo;
}
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- static Bundle buildStatesBundle(Collection<KeyedAppState> keyedAppStates) {
+ private static Bundle buildStatesBundle(Collection<KeyedAppState> keyedAppStates) {
Bundle bundle = new Bundle();
bundle.putParcelableArrayList(APP_STATES, buildStateBundles(keyedAppStates));
return bundle;
@@ -363,8 +309,7 @@
return bundles;
}
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- void send(Bundle appStatesBundle, boolean immediate) {
+ private void send(Bundle appStatesBundle, boolean immediate) {
for (BufferedServiceConnection serviceConnection : mServiceConnections.values()) {
// Messages cannot be reused so we create a copy for each service connection.
serviceConnection.send(createStateMessage(appStatesBundle, immediate));
diff --git a/enterprise/feedback/src/test/java/androidx/enterprise/feedback/BufferedServiceConnectionTest.java b/enterprise/feedback/src/test/java/androidx/enterprise/feedback/BufferedServiceConnectionTest.java
index 4d8eff8..48b6b9c 100644
--- a/enterprise/feedback/src/test/java/androidx/enterprise/feedback/BufferedServiceConnectionTest.java
+++ b/enterprise/feedback/src/test/java/androidx/enterprise/feedback/BufferedServiceConnectionTest.java
@@ -47,9 +47,6 @@
import org.robolectric.shadow.api.Shadow;
import org.robolectric.shadows.ShadowContextWrapper;
-import java.util.List;
-import java.util.concurrent.Executor;
-
/** Tests {@link BufferedServiceConnection}. */
@RunWith(RobolectricTestRunner.class)
@DoNotInstrument
@@ -64,11 +61,9 @@
private final Intent mBindIntent = new Intent();
private final int mFlags = 0;
- private final Executor mExecutor = new TestExecutor();
-
private final TestHandler mTestHandler = new TestHandler();
private final BufferedServiceConnection mBufferedServiceConnection =
- new BufferedServiceConnection(mExecutor, mContext, mBindIntent, mFlags);
+ new BufferedServiceConnection(mContext, mBindIntent, mFlags);
private final ComponentName mTestComponentName = new ComponentName("test_package", "");
private final ComponentName mNotPhoneskyComponentName = mTestComponentName;
@@ -83,18 +78,9 @@
@Test
@SmallTest
- public void construct_nullExecutor_throwsNullPointerException() {
- try {
- new BufferedServiceConnection(null, mContext, mBindIntent, mFlags);
- fail();
- } catch (NullPointerException expected) { }
- }
-
- @Test
- @SmallTest
public void construct_nullContext_throwsNullPointerException() {
try {
- new BufferedServiceConnection(mExecutor, null, mBindIntent, mFlags);
+ new BufferedServiceConnection(null, mBindIntent, mFlags);
fail();
} catch (NullPointerException expected) { }
}
@@ -103,7 +89,7 @@
@SmallTest
public void construct_nullBindIntent_throwsNullPointerException() {
try {
- new BufferedServiceConnection(mExecutor, mContext, null, mFlags);
+ new BufferedServiceConnection(mContext, null, mFlags);
fail();
} catch (NullPointerException expected) { }
}
@@ -121,14 +107,6 @@
@Test
@SmallTest
- public void bind_bindingExists() {
- mBufferedServiceConnection.bindService();
-
- assertThat(getBoundServiceConnections()).isNotEmpty();
- }
-
- @Test
- @SmallTest
public void bind_alreadyBound_throwsIllegalStateException() {
mBufferedServiceConnection.bindService();
@@ -140,25 +118,6 @@
@Test
@SmallTest
- public void unbind_bindingDoesNotExist() {
- mBufferedServiceConnection.bindService();
-
- mBufferedServiceConnection.unbind();
-
- assertThat(getBoundServiceConnections()).isEmpty();
- }
-
- @Test
- @SmallTest
- public void unbind_hasntBound_throwsIllegalStateException() {
- try {
- mBufferedServiceConnection.unbind();
- fail();
- } catch (IllegalStateException expected) { }
- }
-
- @Test
- @SmallTest
public void sendMessage_bound_sends() {
mBufferedServiceConnection.bindService();
@@ -369,10 +328,6 @@
}
private ServiceConnection getServiceConnection() {
- return getBoundServiceConnections().get(0);
- }
-
- private List<ServiceConnection> getBoundServiceConnections() {
- return shadowOf((Application) mContext).getBoundServiceConnections();
+ return shadowOf((Application) mContext).getBoundServiceConnections().get(0);
}
}
diff --git a/enterprise/feedback/src/test/java/androidx/enterprise/feedback/KeyedAppStatesReporterTest.java b/enterprise/feedback/src/test/java/androidx/enterprise/feedback/KeyedAppStatesReporterTest.java
index 56a8441..28dfd13 100644
--- a/enterprise/feedback/src/test/java/androidx/enterprise/feedback/KeyedAppStatesReporterTest.java
+++ b/enterprise/feedback/src/test/java/androidx/enterprise/feedback/KeyedAppStatesReporterTest.java
@@ -63,7 +63,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.concurrent.Executor;
/** Tests {@link KeyedAppStatesReporter}. */
@RunWith(RobolectricTestRunner.class)
@@ -73,8 +72,6 @@
private final ComponentName mTestComponentName = new ComponentName("test_package", "");
- private final Executor mExecutor = new TestExecutor();
-
private final ContextWrapper mContext = ApplicationProvider.getApplicationContext();
private final DevicePolicyManager mDevicePolicyManager =
(DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
@@ -95,48 +92,10 @@
@Test
@SmallTest
public void getInstance_nullContext_throwsNullPointerException() {
- KeyedAppStatesReporter.resetSingleton();
try {
KeyedAppStatesReporter.getInstance(null);
fail();
- } catch (NullPointerException expected) {
- }
- }
-
- @Test
- @SmallTest
- public void initialize_usesExecutor() {
- KeyedAppStatesReporter.resetSingleton();
- TestExecutor testExecutor = new TestExecutor();
- KeyedAppStatesReporter.initialize(mContext, testExecutor);
-
- KeyedAppStatesReporter.getInstance(mContext).set(singleton(mState));
-
- assertThat(testExecutor.lastExecuted()).isNotNull();
- }
-
- @Test
- @SmallTest
- public void initialize_calledMultipleTimes_throwsIllegalStateException() {
- KeyedAppStatesReporter.resetSingleton();
- KeyedAppStatesReporter.initialize(mContext, mExecutor);
-
- try {
- KeyedAppStatesReporter.initialize(mContext, mExecutor);
- } catch (IllegalStateException expected) {
- }
- }
-
- @Test
- @SmallTest
- public void initialize_calledAfterGetInstance_throwsIllegalStateException() {
- KeyedAppStatesReporter.resetSingleton();
- KeyedAppStatesReporter.getInstance(mContext);
-
- try {
- KeyedAppStatesReporter.initialize(mContext, mExecutor);
- } catch (IllegalStateException expected) {
- }
+ } catch (NullPointerException expected) { }
}
@Test
@@ -144,7 +103,7 @@
public void setIncludesAppStateBundle() {
setTestHandlerReceivesStates();
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
reporter.set(singletonList(mState));
Bundle appStatesBundle = buildStatesBundle(singleton(mState));
@@ -191,7 +150,7 @@
public void setEmpty_doesNotSend() {
setTestHandlerReceivesStates();
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
reporter.set(Collections.<KeyedAppState>emptyList());
assertThat(mTestHandler.latestMessage()).isNull();
@@ -202,7 +161,7 @@
public void setNotImmediate() {
setTestHandlerReceivesStates();
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
reporter.set(singletonList(mState));
assertThat(mTestHandler.latestMessage().what).isEqualTo(WHAT_STATE);
@@ -213,7 +172,7 @@
public void setImmediate() {
setTestHandlerReceivesStates();
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
reporter.setImmediate(singletonList(mState));
assertThat(mTestHandler.latestMessage().what).isEqualTo(WHAT_IMMEDIATE_STATE);
@@ -225,7 +184,7 @@
addComponentAsRespondingToAppStatesIntent(mTestComponentName);
setComponentBindingToHandler(mTestComponentName, mTestHandler);
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
reporter.set(singletonList(mState));
assertThat(mTestHandler.latestMessage()).isNull();
@@ -238,7 +197,7 @@
setComponentBindingToHandler(mTestComponentName, mTestHandler);
shadowOf(mDevicePolicyManager).setDeviceOwner(mTestComponentName);
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
reporter.set(singletonList(mState));
assertThat(mTestHandler.latestMessage()).isNotNull();
@@ -251,7 +210,7 @@
setComponentBindingToHandler(mTestComponentName, mTestHandler);
shadowOf(mDevicePolicyManager).setProfileOwner(mTestComponentName);
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
reporter.set(singletonList(mState));
assertThat(mTestHandler.latestMessage()).isNotNull();
@@ -264,7 +223,7 @@
addComponentAsRespondingToAppStatesIntent(phoneskyComponentName);
setComponentBindingToHandler(phoneskyComponentName, mTestHandler);
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
reporter.set(singletonList(mState));
assertThat(mTestHandler.latestMessage()).isNotNull();
@@ -284,7 +243,7 @@
setComponentBindingToHandler(phoneskyComponentName, phoneskyTestHandler);
// Act
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
reporter.set(singletonList(mState));
// Assert
@@ -299,7 +258,7 @@
addComponentAsRespondingToAppStatesIntent(mTestComponentName);
setComponentBindingToHandler(mTestComponentName, mTestHandler);
shadowOf(mDevicePolicyManager).setProfileOwner(mTestComponentName);
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
reporter.set(singletonList(mState));
mTestHandler.reset();
@@ -324,7 +283,7 @@
addComponentAsRespondingToAppStatesIntent(mTestComponentName);
setComponentBindingToHandler(mTestComponentName, mTestHandler);
shadowOf(mDevicePolicyManager).setDeviceOwner(mTestComponentName);
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
reporter.set(singletonList(mState));
mTestHandler.reset();
@@ -351,7 +310,7 @@
setComponentBindingToHandler(mTestComponentName, mTestHandler);
shadowOf(mDevicePolicyManager).setProfileOwner(mTestComponentName);
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
// Set the binding to a different handler - as if the app has restarted.
TestHandler newAppTestHandler = new TestHandler();
@@ -376,7 +335,7 @@
setComponentBindingToHandler(mTestComponentName, mTestHandler);
shadowOf(mDevicePolicyManager).setProfileOwner(mTestComponentName);
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
// Set the binding to a different handler - as if the app has restarted.
TestHandler newAppTestHandler = new TestHandler();
@@ -401,7 +360,7 @@
setComponentBindingToHandler(mTestComponentName, mTestHandler);
shadowOf(mDevicePolicyManager).setProfileOwner(mTestComponentName);
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
simulateDisconnectingServiceConnection();
@@ -421,7 +380,7 @@
setComponentBindingToHandler(mTestComponentName, mTestHandler);
shadowOf(mDevicePolicyManager).setProfileOwner(mTestComponentName);
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
simulateDisconnectingServiceConnection();
reporter.set(singletonList(mState));
@@ -441,7 +400,7 @@
setComponentBindingToHandler(mTestComponentName, mTestHandler);
shadowOf(mDevicePolicyManager).setProfileOwner(mTestComponentName);
- KeyedAppStatesReporter reporter = getReporter(mContext);
+ KeyedAppStatesReporter reporter = KeyedAppStatesReporter.getInstance(mContext);
// Change the component binding to ensure that it doesn't reconnect
setComponentBindingToHandler(mTestComponentName, new TestHandler());
@@ -498,9 +457,4 @@
private ServiceConnection getServiceConnection() {
return shadowOf((Application) mContext).getBoundServiceConnections().get(0);
}
-
- private KeyedAppStatesReporter getReporter(Context context) {
- KeyedAppStatesReporter.initialize(context, mExecutor);
- return KeyedAppStatesReporter.getInstance(context);
- }
}
diff --git a/enterprise/feedback/src/test/java/androidx/enterprise/feedback/TestExecutor.java b/enterprise/feedback/src/test/java/androidx/enterprise/feedback/TestExecutor.java
deleted file mode 100644
index 6623870..0000000
--- a/enterprise/feedback/src/test/java/androidx/enterprise/feedback/TestExecutor.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2019 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.enterprise.feedback;
-
-import org.robolectric.annotation.internal.DoNotInstrument;
-
-import java.util.concurrent.Executor;
-
-/**
- * {@link Executor} which executes all {@link Runnable} instances inline and records that they have
- * run.
- */
-@DoNotInstrument
-public class TestExecutor implements Executor {
-
- private Runnable mLastExecuted;
-
- @Override
- public void execute(Runnable command) {
- command.run();
- mLastExecuted = command;
- }
-
- public Runnable lastExecuted() {
- return mLastExecuted;
- }
-}
diff --git a/exifinterface/api/1.0.0.txt b/exifinterface/api/1.0.0.txt
index a509b24..7635b59 100644
--- a/exifinterface/api/1.0.0.txt
+++ b/exifinterface/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.exifinterface.media {
public class ExifInterface {
diff --git a/exifinterface/api/1.1.0-alpha01.txt b/exifinterface/api/1.1.0-alpha01.txt
deleted file mode 100644
index 75772d7..0000000
--- a/exifinterface/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,336 +0,0 @@
-// Signature format: 3.0
-package androidx.exifinterface.media {
-
- public class ExifInterface {
- ctor public ExifInterface(java.io.File) throws java.io.IOException;
- ctor public ExifInterface(String) throws java.io.IOException;
- ctor public ExifInterface(java.io.FileDescriptor) throws java.io.IOException;
- ctor public ExifInterface(java.io.InputStream) throws java.io.IOException;
- method public void flipHorizontally();
- method public void flipVertically();
- method public double getAltitude(double);
- method public String? getAttribute(String);
- method public double getAttributeDouble(String, double);
- method public int getAttributeInt(String, int);
- method @Deprecated public boolean getLatLong(float[]!);
- method public double[]? getLatLong();
- method public int getRotationDegrees();
- method public byte[]? getThumbnail();
- method public android.graphics.Bitmap? getThumbnailBitmap();
- method public byte[]? getThumbnailBytes();
- method public long[]? getThumbnailRange();
- method public boolean hasThumbnail();
- method public boolean isFlipped();
- method public boolean isThumbnailCompressed();
- method public void resetOrientation();
- method public void rotate(int);
- method public void saveAttributes() throws java.io.IOException;
- method public void setAltitude(double);
- method public void setAttribute(String, String?);
- method public void setGpsInfo(android.location.Location!);
- method public void setLatLong(double, double);
- field public static final short ALTITUDE_ABOVE_SEA_LEVEL = 0; // 0x0
- field public static final short ALTITUDE_BELOW_SEA_LEVEL = 1; // 0x1
- field public static final int[]! BITS_PER_SAMPLE_GREYSCALE_1;
- field public static final int[]! BITS_PER_SAMPLE_GREYSCALE_2;
- field public static final int[]! BITS_PER_SAMPLE_RGB;
- field public static final int COLOR_SPACE_S_RGB = 1; // 0x1
- field public static final int COLOR_SPACE_UNCALIBRATED = 65535; // 0xffff
- field public static final short CONTRAST_HARD = 2; // 0x2
- field public static final short CONTRAST_NORMAL = 0; // 0x0
- field public static final short CONTRAST_SOFT = 1; // 0x1
- field public static final int DATA_DEFLATE_ZIP = 8; // 0x8
- field public static final int DATA_HUFFMAN_COMPRESSED = 2; // 0x2
- field public static final int DATA_JPEG = 6; // 0x6
- field public static final int DATA_JPEG_COMPRESSED = 7; // 0x7
- field public static final int DATA_LOSSY_JPEG = 34892; // 0x884c
- field public static final int DATA_PACK_BITS_COMPRESSED = 32773; // 0x8005
- field public static final int DATA_UNCOMPRESSED = 1; // 0x1
- field public static final short EXPOSURE_MODE_AUTO = 0; // 0x0
- field public static final short EXPOSURE_MODE_AUTO_BRACKET = 2; // 0x2
- field public static final short EXPOSURE_MODE_MANUAL = 1; // 0x1
- field public static final short EXPOSURE_PROGRAM_ACTION = 6; // 0x6
- field public static final short EXPOSURE_PROGRAM_APERTURE_PRIORITY = 3; // 0x3
- field public static final short EXPOSURE_PROGRAM_CREATIVE = 5; // 0x5
- field public static final short EXPOSURE_PROGRAM_LANDSCAPE_MODE = 8; // 0x8
- field public static final short EXPOSURE_PROGRAM_MANUAL = 1; // 0x1
- field public static final short EXPOSURE_PROGRAM_NORMAL = 2; // 0x2
- field public static final short EXPOSURE_PROGRAM_NOT_DEFINED = 0; // 0x0
- field public static final short EXPOSURE_PROGRAM_PORTRAIT_MODE = 7; // 0x7
- field public static final short EXPOSURE_PROGRAM_SHUTTER_PRIORITY = 4; // 0x4
- field public static final short FILE_SOURCE_DSC = 3; // 0x3
- field public static final short FILE_SOURCE_OTHER = 0; // 0x0
- field public static final short FILE_SOURCE_REFLEX_SCANNER = 2; // 0x2
- field public static final short FILE_SOURCE_TRANSPARENT_SCANNER = 1; // 0x1
- field public static final short FLAG_FLASH_FIRED = 1; // 0x1
- field public static final short FLAG_FLASH_MODE_AUTO = 24; // 0x18
- field public static final short FLAG_FLASH_MODE_COMPULSORY_FIRING = 8; // 0x8
- field public static final short FLAG_FLASH_MODE_COMPULSORY_SUPPRESSION = 16; // 0x10
- field public static final short FLAG_FLASH_NO_FLASH_FUNCTION = 32; // 0x20
- field public static final short FLAG_FLASH_RED_EYE_SUPPORTED = 64; // 0x40
- field public static final short FLAG_FLASH_RETURN_LIGHT_DETECTED = 6; // 0x6
- field public static final short FLAG_FLASH_RETURN_LIGHT_NOT_DETECTED = 4; // 0x4
- field public static final short FORMAT_CHUNKY = 1; // 0x1
- field public static final short FORMAT_PLANAR = 2; // 0x2
- field public static final short GAIN_CONTROL_HIGH_GAIN_DOWN = 4; // 0x4
- field public static final short GAIN_CONTROL_HIGH_GAIN_UP = 2; // 0x2
- field public static final short GAIN_CONTROL_LOW_GAIN_DOWN = 3; // 0x3
- field public static final short GAIN_CONTROL_LOW_GAIN_UP = 1; // 0x1
- field public static final short GAIN_CONTROL_NONE = 0; // 0x0
- field public static final String GPS_DIRECTION_MAGNETIC = "M";
- field public static final String GPS_DIRECTION_TRUE = "T";
- field public static final String GPS_DISTANCE_KILOMETERS = "K";
- field public static final String GPS_DISTANCE_MILES = "M";
- field public static final String GPS_DISTANCE_NAUTICAL_MILES = "N";
- field public static final String GPS_MEASUREMENT_2D = "2";
- field public static final String GPS_MEASUREMENT_3D = "3";
- field public static final short GPS_MEASUREMENT_DIFFERENTIAL_CORRECTED = 1; // 0x1
- field public static final String GPS_MEASUREMENT_INTERRUPTED = "V";
- field public static final String GPS_MEASUREMENT_IN_PROGRESS = "A";
- field public static final short GPS_MEASUREMENT_NO_DIFFERENTIAL = 0; // 0x0
- field public static final String GPS_SPEED_KILOMETERS_PER_HOUR = "K";
- field public static final String GPS_SPEED_KNOTS = "N";
- field public static final String GPS_SPEED_MILES_PER_HOUR = "M";
- field public static final String LATITUDE_NORTH = "N";
- field public static final String LATITUDE_SOUTH = "S";
- field public static final short LIGHT_SOURCE_CLOUDY_WEATHER = 10; // 0xa
- field public static final short LIGHT_SOURCE_COOL_WHITE_FLUORESCENT = 14; // 0xe
- field public static final short LIGHT_SOURCE_D50 = 23; // 0x17
- field public static final short LIGHT_SOURCE_D55 = 20; // 0x14
- field public static final short LIGHT_SOURCE_D65 = 21; // 0x15
- field public static final short LIGHT_SOURCE_D75 = 22; // 0x16
- field public static final short LIGHT_SOURCE_DAYLIGHT = 1; // 0x1
- field public static final short LIGHT_SOURCE_DAYLIGHT_FLUORESCENT = 12; // 0xc
- field public static final short LIGHT_SOURCE_DAY_WHITE_FLUORESCENT = 13; // 0xd
- field public static final short LIGHT_SOURCE_FINE_WEATHER = 9; // 0x9
- field public static final short LIGHT_SOURCE_FLASH = 4; // 0x4
- field public static final short LIGHT_SOURCE_FLUORESCENT = 2; // 0x2
- field public static final short LIGHT_SOURCE_ISO_STUDIO_TUNGSTEN = 24; // 0x18
- field public static final short LIGHT_SOURCE_OTHER = 255; // 0xff
- field public static final short LIGHT_SOURCE_SHADE = 11; // 0xb
- field public static final short LIGHT_SOURCE_STANDARD_LIGHT_A = 17; // 0x11
- field public static final short LIGHT_SOURCE_STANDARD_LIGHT_B = 18; // 0x12
- field public static final short LIGHT_SOURCE_STANDARD_LIGHT_C = 19; // 0x13
- field public static final short LIGHT_SOURCE_TUNGSTEN = 3; // 0x3
- field public static final short LIGHT_SOURCE_UNKNOWN = 0; // 0x0
- field public static final short LIGHT_SOURCE_WARM_WHITE_FLUORESCENT = 16; // 0x10
- field public static final short LIGHT_SOURCE_WHITE_FLUORESCENT = 15; // 0xf
- field public static final String LONGITUDE_EAST = "E";
- field public static final String LONGITUDE_WEST = "W";
- field public static final short METERING_MODE_AVERAGE = 1; // 0x1
- field public static final short METERING_MODE_CENTER_WEIGHT_AVERAGE = 2; // 0x2
- field public static final short METERING_MODE_MULTI_SPOT = 4; // 0x4
- field public static final short METERING_MODE_OTHER = 255; // 0xff
- field public static final short METERING_MODE_PARTIAL = 6; // 0x6
- field public static final short METERING_MODE_PATTERN = 5; // 0x5
- field public static final short METERING_MODE_SPOT = 3; // 0x3
- field public static final short METERING_MODE_UNKNOWN = 0; // 0x0
- field public static final int ORIENTATION_FLIP_HORIZONTAL = 2; // 0x2
- field public static final int ORIENTATION_FLIP_VERTICAL = 4; // 0x4
- field public static final int ORIENTATION_NORMAL = 1; // 0x1
- field public static final int ORIENTATION_ROTATE_180 = 3; // 0x3
- field public static final int ORIENTATION_ROTATE_270 = 8; // 0x8
- field public static final int ORIENTATION_ROTATE_90 = 6; // 0x6
- field public static final int ORIENTATION_TRANSPOSE = 5; // 0x5
- field public static final int ORIENTATION_TRANSVERSE = 7; // 0x7
- field public static final int ORIENTATION_UNDEFINED = 0; // 0x0
- field public static final int ORIGINAL_RESOLUTION_IMAGE = 0; // 0x0
- field public static final int PHOTOMETRIC_INTERPRETATION_BLACK_IS_ZERO = 1; // 0x1
- field public static final int PHOTOMETRIC_INTERPRETATION_RGB = 2; // 0x2
- field public static final int PHOTOMETRIC_INTERPRETATION_WHITE_IS_ZERO = 0; // 0x0
- field public static final int PHOTOMETRIC_INTERPRETATION_YCBCR = 6; // 0x6
- field public static final int REDUCED_RESOLUTION_IMAGE = 1; // 0x1
- field public static final short RENDERED_PROCESS_CUSTOM = 1; // 0x1
- field public static final short RENDERED_PROCESS_NORMAL = 0; // 0x0
- field public static final short RESOLUTION_UNIT_CENTIMETERS = 3; // 0x3
- field public static final short RESOLUTION_UNIT_INCHES = 2; // 0x2
- field public static final short SATURATION_HIGH = 0; // 0x0
- field public static final short SATURATION_LOW = 0; // 0x0
- field public static final short SATURATION_NORMAL = 0; // 0x0
- field public static final short SCENE_CAPTURE_TYPE_LANDSCAPE = 1; // 0x1
- field public static final short SCENE_CAPTURE_TYPE_NIGHT = 3; // 0x3
- field public static final short SCENE_CAPTURE_TYPE_PORTRAIT = 2; // 0x2
- field public static final short SCENE_CAPTURE_TYPE_STANDARD = 0; // 0x0
- field public static final short SCENE_TYPE_DIRECTLY_PHOTOGRAPHED = 1; // 0x1
- field public static final short SENSITIVITY_TYPE_ISO_SPEED = 3; // 0x3
- field public static final short SENSITIVITY_TYPE_REI = 2; // 0x2
- field public static final short SENSITIVITY_TYPE_REI_AND_ISO = 6; // 0x6
- field public static final short SENSITIVITY_TYPE_SOS = 1; // 0x1
- field public static final short SENSITIVITY_TYPE_SOS_AND_ISO = 5; // 0x5
- field public static final short SENSITIVITY_TYPE_SOS_AND_REI = 4; // 0x4
- field public static final short SENSITIVITY_TYPE_SOS_AND_REI_AND_ISO = 7; // 0x7
- field public static final short SENSITIVITY_TYPE_UNKNOWN = 0; // 0x0
- field public static final short SENSOR_TYPE_COLOR_SEQUENTIAL = 5; // 0x5
- field public static final short SENSOR_TYPE_COLOR_SEQUENTIAL_LINEAR = 8; // 0x8
- field public static final short SENSOR_TYPE_NOT_DEFINED = 1; // 0x1
- field public static final short SENSOR_TYPE_ONE_CHIP = 2; // 0x2
- field public static final short SENSOR_TYPE_THREE_CHIP = 4; // 0x4
- field public static final short SENSOR_TYPE_TRILINEAR = 7; // 0x7
- field public static final short SENSOR_TYPE_TWO_CHIP = 3; // 0x3
- field public static final short SHARPNESS_HARD = 2; // 0x2
- field public static final short SHARPNESS_NORMAL = 0; // 0x0
- field public static final short SHARPNESS_SOFT = 1; // 0x1
- field public static final short SUBJECT_DISTANCE_RANGE_CLOSE_VIEW = 2; // 0x2
- field public static final short SUBJECT_DISTANCE_RANGE_DISTANT_VIEW = 3; // 0x3
- field public static final short SUBJECT_DISTANCE_RANGE_MACRO = 1; // 0x1
- field public static final short SUBJECT_DISTANCE_RANGE_UNKNOWN = 0; // 0x0
- field public static final String TAG_APERTURE_VALUE = "ApertureValue";
- field public static final String TAG_ARTIST = "Artist";
- field public static final String TAG_BITS_PER_SAMPLE = "BitsPerSample";
- field public static final String TAG_BODY_SERIAL_NUMBER = "BodySerialNumber";
- field public static final String TAG_BRIGHTNESS_VALUE = "BrightnessValue";
- field @Deprecated public static final String TAG_CAMARA_OWNER_NAME = "CameraOwnerName";
- field public static final String TAG_CAMERA_OWNER_NAME = "CameraOwnerName";
- field public static final String TAG_CFA_PATTERN = "CFAPattern";
- field public static final String TAG_COLOR_SPACE = "ColorSpace";
- field public static final String TAG_COMPONENTS_CONFIGURATION = "ComponentsConfiguration";
- field public static final String TAG_COMPRESSED_BITS_PER_PIXEL = "CompressedBitsPerPixel";
- field public static final String TAG_COMPRESSION = "Compression";
- field public static final String TAG_CONTRAST = "Contrast";
- field public static final String TAG_COPYRIGHT = "Copyright";
- field public static final String TAG_CUSTOM_RENDERED = "CustomRendered";
- field public static final String TAG_DATETIME = "DateTime";
- field public static final String TAG_DATETIME_DIGITIZED = "DateTimeDigitized";
- field public static final String TAG_DATETIME_ORIGINAL = "DateTimeOriginal";
- field public static final String TAG_DEFAULT_CROP_SIZE = "DefaultCropSize";
- field public static final String TAG_DEVICE_SETTING_DESCRIPTION = "DeviceSettingDescription";
- field public static final String TAG_DIGITAL_ZOOM_RATIO = "DigitalZoomRatio";
- field public static final String TAG_DNG_VERSION = "DNGVersion";
- field public static final String TAG_EXIF_VERSION = "ExifVersion";
- field public static final String TAG_EXPOSURE_BIAS_VALUE = "ExposureBiasValue";
- field public static final String TAG_EXPOSURE_INDEX = "ExposureIndex";
- field public static final String TAG_EXPOSURE_MODE = "ExposureMode";
- field public static final String TAG_EXPOSURE_PROGRAM = "ExposureProgram";
- field public static final String TAG_EXPOSURE_TIME = "ExposureTime";
- field public static final String TAG_FILE_SOURCE = "FileSource";
- field public static final String TAG_FLASH = "Flash";
- field public static final String TAG_FLASHPIX_VERSION = "FlashpixVersion";
- field public static final String TAG_FLASH_ENERGY = "FlashEnergy";
- field public static final String TAG_FOCAL_LENGTH = "FocalLength";
- field public static final String TAG_FOCAL_LENGTH_IN_35MM_FILM = "FocalLengthIn35mmFilm";
- field public static final String TAG_FOCAL_PLANE_RESOLUTION_UNIT = "FocalPlaneResolutionUnit";
- field public static final String TAG_FOCAL_PLANE_X_RESOLUTION = "FocalPlaneXResolution";
- field public static final String TAG_FOCAL_PLANE_Y_RESOLUTION = "FocalPlaneYResolution";
- field public static final String TAG_F_NUMBER = "FNumber";
- field public static final String TAG_GAIN_CONTROL = "GainControl";
- field public static final String TAG_GAMMA = "Gamma";
- field public static final String TAG_GPS_ALTITUDE = "GPSAltitude";
- field public static final String TAG_GPS_ALTITUDE_REF = "GPSAltitudeRef";
- field public static final String TAG_GPS_AREA_INFORMATION = "GPSAreaInformation";
- field public static final String TAG_GPS_DATESTAMP = "GPSDateStamp";
- field public static final String TAG_GPS_DEST_BEARING = "GPSDestBearing";
- field public static final String TAG_GPS_DEST_BEARING_REF = "GPSDestBearingRef";
- field public static final String TAG_GPS_DEST_DISTANCE = "GPSDestDistance";
- field public static final String TAG_GPS_DEST_DISTANCE_REF = "GPSDestDistanceRef";
- field public static final String TAG_GPS_DEST_LATITUDE = "GPSDestLatitude";
- field public static final String TAG_GPS_DEST_LATITUDE_REF = "GPSDestLatitudeRef";
- field public static final String TAG_GPS_DEST_LONGITUDE = "GPSDestLongitude";
- field public static final String TAG_GPS_DEST_LONGITUDE_REF = "GPSDestLongitudeRef";
- field public static final String TAG_GPS_DIFFERENTIAL = "GPSDifferential";
- field public static final String TAG_GPS_DOP = "GPSDOP";
- field public static final String TAG_GPS_H_POSITIONING_ERROR = "GPSHPositioningError";
- field public static final String TAG_GPS_IMG_DIRECTION = "GPSImgDirection";
- field public static final String TAG_GPS_IMG_DIRECTION_REF = "GPSImgDirectionRef";
- field public static final String TAG_GPS_LATITUDE = "GPSLatitude";
- field public static final String TAG_GPS_LATITUDE_REF = "GPSLatitudeRef";
- field public static final String TAG_GPS_LONGITUDE = "GPSLongitude";
- field public static final String TAG_GPS_LONGITUDE_REF = "GPSLongitudeRef";
- field public static final String TAG_GPS_MAP_DATUM = "GPSMapDatum";
- field public static final String TAG_GPS_MEASURE_MODE = "GPSMeasureMode";
- field public static final String TAG_GPS_PROCESSING_METHOD = "GPSProcessingMethod";
- field public static final String TAG_GPS_SATELLITES = "GPSSatellites";
- field public static final String TAG_GPS_SPEED = "GPSSpeed";
- field public static final String TAG_GPS_SPEED_REF = "GPSSpeedRef";
- field public static final String TAG_GPS_STATUS = "GPSStatus";
- field public static final String TAG_GPS_TIMESTAMP = "GPSTimeStamp";
- field public static final String TAG_GPS_TRACK = "GPSTrack";
- field public static final String TAG_GPS_TRACK_REF = "GPSTrackRef";
- field public static final String TAG_GPS_VERSION_ID = "GPSVersionID";
- field public static final String TAG_IMAGE_DESCRIPTION = "ImageDescription";
- field public static final String TAG_IMAGE_LENGTH = "ImageLength";
- field public static final String TAG_IMAGE_UNIQUE_ID = "ImageUniqueID";
- field public static final String TAG_IMAGE_WIDTH = "ImageWidth";
- field public static final String TAG_INTEROPERABILITY_INDEX = "InteroperabilityIndex";
- field public static final String TAG_ISO_SPEED = "ISOSpeed";
- field public static final String TAG_ISO_SPEED_LATITUDE_YYY = "ISOSpeedLatitudeyyy";
- field public static final String TAG_ISO_SPEED_LATITUDE_ZZZ = "ISOSpeedLatitudezzz";
- field @Deprecated public static final String TAG_ISO_SPEED_RATINGS = "ISOSpeedRatings";
- field public static final String TAG_JPEG_INTERCHANGE_FORMAT = "JPEGInterchangeFormat";
- field public static final String TAG_JPEG_INTERCHANGE_FORMAT_LENGTH = "JPEGInterchangeFormatLength";
- field public static final String TAG_LENS_MAKE = "LensMake";
- field public static final String TAG_LENS_MODEL = "LensModel";
- field public static final String TAG_LENS_SERIAL_NUMBER = "LensSerialNumber";
- field public static final String TAG_LENS_SPECIFICATION = "LensSpecification";
- field public static final String TAG_LIGHT_SOURCE = "LightSource";
- field public static final String TAG_MAKE = "Make";
- field public static final String TAG_MAKER_NOTE = "MakerNote";
- field public static final String TAG_MAX_APERTURE_VALUE = "MaxApertureValue";
- field public static final String TAG_METERING_MODE = "MeteringMode";
- field public static final String TAG_MODEL = "Model";
- field public static final String TAG_NEW_SUBFILE_TYPE = "NewSubfileType";
- field public static final String TAG_OECF = "OECF";
- field public static final String TAG_ORF_ASPECT_FRAME = "AspectFrame";
- field public static final String TAG_ORF_PREVIEW_IMAGE_LENGTH = "PreviewImageLength";
- field public static final String TAG_ORF_PREVIEW_IMAGE_START = "PreviewImageStart";
- field public static final String TAG_ORF_THUMBNAIL_IMAGE = "ThumbnailImage";
- field public static final String TAG_ORIENTATION = "Orientation";
- field public static final String TAG_PHOTOGRAPHIC_SENSITIVITY = "PhotographicSensitivity";
- field public static final String TAG_PHOTOMETRIC_INTERPRETATION = "PhotometricInterpretation";
- field public static final String TAG_PIXEL_X_DIMENSION = "PixelXDimension";
- field public static final String TAG_PIXEL_Y_DIMENSION = "PixelYDimension";
- field public static final String TAG_PLANAR_CONFIGURATION = "PlanarConfiguration";
- field public static final String TAG_PRIMARY_CHROMATICITIES = "PrimaryChromaticities";
- field public static final String TAG_RECOMMENDED_EXPOSURE_INDEX = "RecommendedExposureIndex";
- field public static final String TAG_REFERENCE_BLACK_WHITE = "ReferenceBlackWhite";
- field public static final String TAG_RELATED_SOUND_FILE = "RelatedSoundFile";
- field public static final String TAG_RESOLUTION_UNIT = "ResolutionUnit";
- field public static final String TAG_ROWS_PER_STRIP = "RowsPerStrip";
- field public static final String TAG_RW2_ISO = "ISO";
- field public static final String TAG_RW2_JPG_FROM_RAW = "JpgFromRaw";
- field public static final String TAG_RW2_SENSOR_BOTTOM_BORDER = "SensorBottomBorder";
- field public static final String TAG_RW2_SENSOR_LEFT_BORDER = "SensorLeftBorder";
- field public static final String TAG_RW2_SENSOR_RIGHT_BORDER = "SensorRightBorder";
- field public static final String TAG_RW2_SENSOR_TOP_BORDER = "SensorTopBorder";
- field public static final String TAG_SAMPLES_PER_PIXEL = "SamplesPerPixel";
- field public static final String TAG_SATURATION = "Saturation";
- field public static final String TAG_SCENE_CAPTURE_TYPE = "SceneCaptureType";
- field public static final String TAG_SCENE_TYPE = "SceneType";
- field public static final String TAG_SENSING_METHOD = "SensingMethod";
- field public static final String TAG_SENSITIVITY_TYPE = "SensitivityType";
- field public static final String TAG_SHARPNESS = "Sharpness";
- field public static final String TAG_SHUTTER_SPEED_VALUE = "ShutterSpeedValue";
- field public static final String TAG_SOFTWARE = "Software";
- field public static final String TAG_SPATIAL_FREQUENCY_RESPONSE = "SpatialFrequencyResponse";
- field public static final String TAG_SPECTRAL_SENSITIVITY = "SpectralSensitivity";
- field public static final String TAG_STANDARD_OUTPUT_SENSITIVITY = "StandardOutputSensitivity";
- field public static final String TAG_STRIP_BYTE_COUNTS = "StripByteCounts";
- field public static final String TAG_STRIP_OFFSETS = "StripOffsets";
- field public static final String TAG_SUBFILE_TYPE = "SubfileType";
- field public static final String TAG_SUBJECT_AREA = "SubjectArea";
- field public static final String TAG_SUBJECT_DISTANCE = "SubjectDistance";
- field public static final String TAG_SUBJECT_DISTANCE_RANGE = "SubjectDistanceRange";
- field public static final String TAG_SUBJECT_LOCATION = "SubjectLocation";
- field public static final String TAG_SUBSEC_TIME = "SubSecTime";
- field public static final String TAG_SUBSEC_TIME_DIGITIZED = "SubSecTimeDigitized";
- field public static final String TAG_SUBSEC_TIME_ORIGINAL = "SubSecTimeOriginal";
- field public static final String TAG_THUMBNAIL_IMAGE_LENGTH = "ThumbnailImageLength";
- field public static final String TAG_THUMBNAIL_IMAGE_WIDTH = "ThumbnailImageWidth";
- field public static final String TAG_TRANSFER_FUNCTION = "TransferFunction";
- field public static final String TAG_USER_COMMENT = "UserComment";
- field public static final String TAG_WHITE_BALANCE = "WhiteBalance";
- field public static final String TAG_WHITE_POINT = "WhitePoint";
- field public static final String TAG_X_RESOLUTION = "XResolution";
- field public static final String TAG_Y_CB_CR_COEFFICIENTS = "YCbCrCoefficients";
- field public static final String TAG_Y_CB_CR_POSITIONING = "YCbCrPositioning";
- field public static final String TAG_Y_CB_CR_SUB_SAMPLING = "YCbCrSubSampling";
- field public static final String TAG_Y_RESOLUTION = "YResolution";
- field @Deprecated public static final int WHITEBALANCE_AUTO = 0; // 0x0
- field @Deprecated public static final int WHITEBALANCE_MANUAL = 1; // 0x1
- field public static final short WHITE_BALANCE_AUTO = 0; // 0x0
- field public static final short WHITE_BALANCE_MANUAL = 1; // 0x1
- field public static final short Y_CB_CR_POSITIONING_CENTERED = 1; // 0x1
- field public static final short Y_CB_CR_POSITIONING_CO_SITED = 2; // 0x2
- }
-
-}
-
diff --git a/exifinterface/api/current.txt b/exifinterface/api/current.txt
index 75772d7..7635b59 100644
--- a/exifinterface/api/current.txt
+++ b/exifinterface/api/current.txt
@@ -1,10 +1,8 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.exifinterface.media {
public class ExifInterface {
- ctor public ExifInterface(java.io.File) throws java.io.IOException;
ctor public ExifInterface(String) throws java.io.IOException;
- ctor public ExifInterface(java.io.FileDescriptor) throws java.io.IOException;
ctor public ExifInterface(java.io.InputStream) throws java.io.IOException;
method public void flipHorizontally();
method public void flipVertically();
diff --git a/exifinterface/api/res-1.1.0-alpha01.txt b/exifinterface/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/exifinterface/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/exifinterface/api/restricted_1.0.0.txt b/exifinterface/api/restricted_1.0.0.txt
deleted file mode 100644
index 572f8aa..0000000
--- a/exifinterface/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.exifinterface.media {
-
- public class ExifInterface {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public long getDateTime();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public long getGpsDateTime();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void setDateTime(long);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface ExifInterface.IfdType {
- }
-
-}
-
diff --git a/exifinterface/api/restricted_1.1.0-alpha01.txt b/exifinterface/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index 1cdbaf4..0000000
--- a/exifinterface/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.exifinterface.media {
-
- public class ExifInterface {
- }
-
-
-}
-
diff --git a/exifinterface/api/restricted_current.txt b/exifinterface/api/restricted_current.txt
deleted file mode 100644
index 1cdbaf4..0000000
--- a/exifinterface/api/restricted_current.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.exifinterface.media {
-
- public class ExifInterface {
- }
-
-
-}
-
diff --git a/exifinterface/src/androidTest/java/androidx/exifinterface/media/ExifInterfaceTest.java b/exifinterface/src/androidTest/java/androidx/exifinterface/media/ExifInterfaceTest.java
index 906eebd..b2a01ef 100644
--- a/exifinterface/src/androidTest/java/androidx/exifinterface/media/ExifInterfaceTest.java
+++ b/exifinterface/src/androidTest/java/androidx/exifinterface/media/ExifInterfaceTest.java
@@ -26,10 +26,7 @@
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.location.Location;
-import android.os.Build;
import android.os.Environment;
-import android.system.Os;
-import android.system.OsConstants;
import android.util.Log;
import android.util.Pair;
@@ -47,7 +44,6 @@
import java.io.ByteArrayInputStream;
import java.io.Closeable;
import java.io.File;
-import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -75,7 +71,6 @@
private static final String[] IMAGE_FILENAMES = new String[] {
EXIF_BYTE_ORDER_II_JPEG, EXIF_BYTE_ORDER_MM_JPEG, LG_G4_ISO_800_DNG};
- private static final int USER_READ_WRITE = 0600;
private static final String TEST_TEMP_FILE_NAME = "testImage";
private static final double DELTA = 1e-8;
// We translate double to rational in a 1/10000 precision.
@@ -780,14 +775,8 @@
File imageFile = new File(Environment.getExternalStorageDirectory(), fileName);
String verboseTag = imageFile.getName();
- // Creates via file.
- ExifInterface exifInterface = new ExifInterface(imageFile);
- assertNotNull(exifInterface);
- compareWithExpectedValue(exifInterface, expectedValue, verboseTag);
-
-
// Creates via path.
- exifInterface = new ExifInterface(imageFile.getAbsolutePath());
+ ExifInterface exifInterface = new ExifInterface(imageFile.getAbsolutePath());
assertNotNull(exifInterface);
compareWithExpectedValue(exifInterface, expectedValue, verboseTag);
@@ -800,21 +789,6 @@
} finally {
closeQuietly(in);
}
-
- // Creates via FileDescriptor.
- if (Build.VERSION.SDK_INT >= 21) {
- FileDescriptor fd = null;
- try {
- fd = Os.open(imageFile.getAbsolutePath(), OsConstants.O_RDONLY,
- OsConstants.S_IRWXU);
- exifInterface = new ExifInterface(fd);
- compareWithExpectedValue(exifInterface, expectedValue, verboseTag);
- } catch (Exception e) {
- throw new IOException("Failed to open file descriptor", e);
- } finally {
- closeQuietly(fd);
- }
- }
}
private void testSaveAttributes_withFileName(String fileName, ExpectedValue expectedValue)
@@ -900,17 +874,6 @@
}
}
- private void closeQuietly(FileDescriptor fd) {
- if (fd != null) {
- try {
- Os.close(fd);
- } catch (RuntimeException rethrown) {
- throw rethrown;
- } catch (Exception ignored) {
- }
- }
- }
-
private int copy(InputStream in, OutputStream out) throws IOException {
int total = 0;
byte[] buffer = new byte[8192];
diff --git a/exifinterface/src/main/java/androidx/exifinterface/media/ExifInterface.java b/exifinterface/src/main/java/androidx/exifinterface/media/ExifInterface.java
index c8bdf798..4061f8d 100644
--- a/exifinterface/src/main/java/androidx/exifinterface/media/ExifInterface.java
+++ b/exifinterface/src/main/java/androidx/exifinterface/media/ExifInterface.java
@@ -20,11 +20,6 @@
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.location.Location;
-import android.media.MediaDataSource;
-import android.media.MediaMetadataRetriever;
-import android.os.Build;
-import android.system.Os;
-import android.system.OsConstants;
import android.util.Log;
import android.util.Pair;
@@ -40,7 +35,6 @@
import java.io.DataInputStream;
import java.io.EOFException;
import java.io.File;
-import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
@@ -70,7 +64,7 @@
/**
* This is a class for reading and writing Exif tags in a JPEG file or a RAW image file.
* <p>
- * Supported formats are: JPEG, DNG, CR2, NEF, NRW, ARW, RW2, ORF, PEF, SRW, RAF and HEIF.
+ * Supported formats are: JPEG, DNG, CR2, NEF, NRW, ARW, RW2, ORF, PEF, SRW and RAF.
* <p>
* Attribute mutation is supported for JPEG image files.
*/
@@ -2844,10 +2838,6 @@
*/
public static final int REDUCED_RESOLUTION_IMAGE = 1;
- // TODO: Replace the following constants once Q is released. (b/124409340)
- private static final int METADATA_KEY_EXIF_OFFSET = 33;
- private static final int METADATA_KEY_EXIF_LENGTH = 34;
-
// Maximum size for checking file type signature (see image_type_recognition_lite.cc)
private static final int SIGNATURE_CHECK_SIZE = 5000;
@@ -2857,10 +2847,6 @@
private static final int RAF_INFO_SIZE = 160;
private static final int RAF_JPEG_LENGTH_VALUE_SIZE = 4;
- private static final byte[] HEIF_TYPE_FTYP = new byte[] {'f', 't', 'y', 'p'};
- private static final byte[] HEIF_BRAND_MIF1 = new byte[] {'m', 'i', 'f', '1'};
- private static final byte[] HEIF_BRAND_HEIC = new byte[] {'h', 'e', 'i', 'c'};
-
// See http://fileformats.archiveteam.org/wiki/Olympus_ORF
private static final short ORF_SIGNATURE_1 = 0x4f52;
private static final short ORF_SIGNATURE_2 = 0x5352;
@@ -3688,7 +3674,6 @@
private static final int IMAGE_TYPE_RAF = 9;
private static final int IMAGE_TYPE_RW2 = 10;
private static final int IMAGE_TYPE_SRW = 11;
- private static final int IMAGE_TYPE_HEIF = 12;
static {
sFormatter = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss");
@@ -3713,9 +3698,8 @@
sExifPointerTagMap.put(EXIF_POINTER_TAGS[5].number, IFD_TYPE_ORF_IMAGE_PROCESSING); // 8256
}
- private String mFilename;
- private FileDescriptor mSeekableFileDescriptor;
- private AssetManager.AssetInputStream mAssetInputStream;
+ private final String mFilename;
+ private final AssetManager.AssetInputStream mAssetInputStream;
private int mMimeType;
@SuppressWarnings("unchecked")
private final HashMap<String, ExifAttribute>[] mAttributes = new HashMap[EXIF_TAGS.length];
@@ -3743,47 +3727,15 @@
/**
* Reads Exif tags from the specified image file.
*/
- public ExifInterface(@NonNull File file) throws IOException {
- if (file == null) {
- throw new NullPointerException("file cannot be null");
- }
- initForFilename(file.getAbsolutePath());
- }
-
- /**
- * Reads Exif tags from the specified image file.
- */
public ExifInterface(@NonNull String filename) throws IOException {
- initForFilename(filename);
- }
-
- /**
- * Reads Exif tags from the specified image file descriptor. Attribute mutation is supported
- * for writable and seekable file descriptors only. This constructor will not rewind the offset
- * of the given file descriptor. Developers should close the file descriptor after use.
- */
- public ExifInterface(@NonNull FileDescriptor fileDescriptor) throws IOException {
- if (fileDescriptor == null) {
- throw new NullPointerException("fileDescriptor cannot be null");
- }
- mAssetInputStream = null;
- mFilename = null;
- if (Build.VERSION.SDK_INT >= 21 && isSeekableFD(fileDescriptor)) {
- mSeekableFileDescriptor = fileDescriptor;
- // Keep the original file descriptor in order to save attributes when it's seekable.
- // Otherwise, just close the given file descriptor after reading it because the save
- // feature won't be working.
- try {
- fileDescriptor = Os.dup(fileDescriptor);
- } catch (Exception e) {
- throw new IOException("Failed to duplicate file descriptor", e);
- }
- } else {
- mSeekableFileDescriptor = null;
+ if (filename == null) {
+ throw new IllegalArgumentException("filename cannot be null");
}
FileInputStream in = null;
+ mAssetInputStream = null;
+ mFilename = filename;
try {
- in = new FileInputStream(fileDescriptor);
+ in = new FileInputStream(filename);
loadAttributes(in);
} finally {
closeQuietly(in);
@@ -3798,19 +3750,13 @@
*/
public ExifInterface(@NonNull InputStream inputStream) throws IOException {
if (inputStream == null) {
- throw new NullPointerException("inputStream cannot be null");
+ throw new IllegalArgumentException("inputStream cannot be null");
}
mFilename = null;
if (inputStream instanceof AssetManager.AssetInputStream) {
mAssetInputStream = (AssetManager.AssetInputStream) inputStream;
- mSeekableFileDescriptor = null;
- } else if (inputStream instanceof FileInputStream
- && (isSeekableFD(((FileInputStream) inputStream).getFD()))) {
- mAssetInputStream = null;
- mSeekableFileDescriptor = ((FileInputStream) inputStream).getFD();
} else {
mAssetInputStream = null;
- mSeekableFileDescriptor = null;
}
loadAttributes(inputStream);
}
@@ -4291,10 +4237,6 @@
getRafAttributes(inputStream);
break;
}
- case IMAGE_TYPE_HEIF: {
- getHeifAttributes(inputStream);
- break;
- }
case IMAGE_TYPE_ORF: {
getOrfAttributes(inputStream);
break;
@@ -4339,18 +4281,6 @@
}
}
- private static boolean isSeekableFD(FileDescriptor fd) throws IOException {
- if (Build.VERSION.SDK_INT >= 21) {
- try {
- Os.lseek(fd, 0, OsConstants.SEEK_CUR);
- return true;
- } catch (Exception e) {
- return false;
- }
- }
- return false;
- }
-
// Prints out attributes for debugging.
private void printAttributes() {
for (int i = 0; i < mAttributes.length; ++i) {
@@ -4376,7 +4306,7 @@
if (!mIsSupportedFile || mMimeType != IMAGE_TYPE_JPEG) {
throw new IOException("ExifInterface only supports saving attributes on JPEG formats.");
}
- if (mSeekableFileDescriptor == null && mFilename == null) {
+ if (mFilename == null) {
throw new IOException(
"ExifInterface does not support saving attributes for the current input.");
}
@@ -4384,45 +4314,19 @@
// Keep the thumbnail in memory
mThumbnailBytes = getThumbnail();
- FileInputStream in = null;
- FileOutputStream out = null;
- File tempFile = null;
- try {
- // Move the original file to temporary file.
- if (mFilename != null) {
- tempFile = new File(mFilename + ".tmp");
- File originalFile = new File(mFilename);
- if (!originalFile.renameTo(tempFile)) {
- throw new IOException("Couldn't rename to " + tempFile.getAbsolutePath());
- }
- } else if (Build.VERSION.SDK_INT >= 21 && mSeekableFileDescriptor != null) {
- tempFile = File.createTempFile("temp", "jpg");
- Os.lseek(mSeekableFileDescriptor, 0, OsConstants.SEEK_SET);
- in = new FileInputStream(mSeekableFileDescriptor);
- out = new FileOutputStream(tempFile);
- copy(in, out);
- }
- } catch (Exception e) {
- throw new IOException("Failed to copy file");
- } finally {
- closeQuietly(in);
- closeQuietly(out);
+ File tempFile = new File(mFilename + ".tmp");
+ File originalFile = new File(mFilename);
+ if (!originalFile.renameTo(tempFile)) {
+ throw new IOException("Could not rename to " + tempFile.getAbsolutePath());
}
- in = null;
- out = null;
+ FileInputStream in = null;
+ FileOutputStream out = null;
try {
// Save the new file.
in = new FileInputStream(tempFile);
- if (mFilename != null) {
- out = new FileOutputStream(mFilename);
- } else if (Build.VERSION.SDK_INT >= 21 && mSeekableFileDescriptor != null) {
- Os.lseek(mSeekableFileDescriptor, 0, OsConstants.SEEK_SET);
- out = new FileOutputStream(mSeekableFileDescriptor);
- }
+ out = new FileOutputStream(mFilename);
saveJpegAttributes(in, out);
- } catch (Exception e) {
- throw new IOException("Failed to copy file");
} finally {
closeQuietly(in);
closeQuietly(out);
@@ -4444,7 +4348,7 @@
* Returns the JPEG compressed thumbnail inside the image file, or {@code null} if there is no
* JPEG compressed thumbnail.
* The returned data can be decoded using
- * {@link BitmapFactory#decodeByteArray(byte[],int,int)}
+ * {@link android.graphics.BitmapFactory#decodeByteArray(byte[],int,int)}
*/
@Nullable
public byte[] getThumbnail() {
@@ -4480,10 +4384,6 @@
}
} else if (mFilename != null) {
in = new FileInputStream(mFilename);
- } else if (Build.VERSION.SDK_INT >= 21 && mSeekableFileDescriptor != null) {
- FileDescriptor fileDescriptor = Os.dup(mSeekableFileDescriptor);
- Os.lseek(fileDescriptor, 0, OsConstants.SEEK_SET);
- in = new FileInputStream(fileDescriptor);
}
if (in == null) {
// Should not be reached this.
@@ -4498,7 +4398,7 @@
}
mThumbnailBytes = buffer;
return buffer;
- } catch (Exception e) {
+ } catch (IOException e) {
// Couldn't get a thumbnail image.
Log.d(TAG, "Encountered exception while getting thumbnail", e);
} finally {
@@ -4765,26 +4665,6 @@
}
}
- private void initForFilename(String filename) throws IOException {
- if (filename == null) {
- throw new NullPointerException("filename cannot be null");
- }
- FileInputStream in = null;
- mAssetInputStream = null;
- mFilename = filename;
- try {
- in = new FileInputStream(filename);
- if (isSeekableFD(in.getFD())) {
- mSeekableFileDescriptor = in.getFD();
- } else {
- mSeekableFileDescriptor = null;
- }
- loadAttributes(in);
- } finally {
- closeQuietly(in);
- }
- }
-
private static double convertRationalLatLonToDouble(String rationalString, String ref) {
try {
String [] parts = rationalString.split(",", -1);
@@ -4834,8 +4714,6 @@
return IMAGE_TYPE_JPEG;
} else if (isRafFormat(signatureCheckBytes)) {
return IMAGE_TYPE_RAF;
- } else if (isHeifFormat(signatureCheckBytes)) {
- return IMAGE_TYPE_HEIF;
} else if (isOrfFormat(signatureCheckBytes)) {
return IMAGE_TYPE_ORF;
} else if (isRw2Format(signatureCheckBytes)) {
@@ -4874,78 +4752,6 @@
return true;
}
- private boolean isHeifFormat(byte[] signatureCheckBytes) throws IOException {
- ByteOrderedDataInputStream signatureInputStream = null;
- try {
- signatureInputStream = new ByteOrderedDataInputStream(signatureCheckBytes);
- signatureInputStream.setByteOrder(ByteOrder.BIG_ENDIAN);
-
- long chunkSize = signatureInputStream.readInt();
- byte[] chunkType = new byte[4];
- signatureInputStream.read(chunkType);
-
- if (!Arrays.equals(chunkType, HEIF_TYPE_FTYP)) {
- return false;
- }
-
- long chunkDataOffset = 8;
- if (chunkSize == 1) {
- // This indicates that the next 8 bytes represent the chunk size,
- // and chunk data comes after that.
- chunkSize = signatureInputStream.readLong();
- if (chunkSize < 16) {
- // The smallest valid chunk is 16 bytes long in this case.
- return false;
- }
- chunkDataOffset += 8;
- }
-
- // only sniff up to signatureCheckBytes.length
- if (chunkSize > signatureCheckBytes.length) {
- chunkSize = signatureCheckBytes.length;
- }
-
- long chunkDataSize = chunkSize - chunkDataOffset;
-
- // It should at least have major brand (4-byte) and minor version (4-byte).
- // The rest of the chunk (if any) is a list of (4-byte) compatible brands.
- if (chunkDataSize < 8) {
- return false;
- }
-
- byte[] brand = new byte[4];
- boolean isMif1 = false;
- boolean isHeic = false;
- for (long i = 0; i < chunkDataSize / 4; ++i) {
- if (signatureInputStream.read(brand) != brand.length) {
- return false;
- }
- if (i == 1) {
- // Skip this index, it refers to the minorVersion, not a brand.
- continue;
- }
- if (Arrays.equals(brand, HEIF_BRAND_MIF1)) {
- isMif1 = true;
- } else if (Arrays.equals(brand, HEIF_BRAND_HEIC)) {
- isHeic = true;
- }
- if (isMif1 && isHeic) {
- return true;
- }
- }
- } catch (Exception e) {
- if (DEBUG) {
- Log.d(TAG, "Exception parsing HEIF file type box.", e);
- }
- } finally {
- if (signatureInputStream != null) {
- signatureInputStream.close();
- signatureInputStream = null;
- }
- }
- return false;
- }
-
/**
* ORF has a similar structure to TIFF but it contains a different signature at the TIFF Header.
* This method looks at the 2 bytes following the Byte Order bytes to determine if this file is
@@ -5234,166 +5040,6 @@
}
}
- private void getHeifAttributes(final ByteOrderedDataInputStream in) throws IOException {
- MediaMetadataRetriever retriever = new MediaMetadataRetriever();
- try {
- if (Build.VERSION.SDK_INT >= 23) {
- retriever.setDataSource(new MediaDataSource() {
- long mPosition;
-
- @Override
- public void close() throws IOException {}
-
- @Override
- public int readAt(long position, byte[] buffer, int offset, int size)
- throws IOException {
- if (size == 0) {
- return 0;
- }
- if (position < 0) {
- return -1;
- }
- try {
- if (mPosition != position) {
- // We don't allow seek to positions after the available bytes,
- // the input stream won't be able to seek back then.
- // However, if we hit an exception before (mPosition set to -1),
- // let it try the seek in hope it might recover.
- if (mPosition >= 0 && position >= mPosition + in.available()) {
- return -1;
- }
- in.seek(position);
- mPosition = position;
- }
-
- // If the read will cause us to go over the available bytes,
- // reduce the size so that we stay in the available range.
- // Otherwise the input stream may not be able to seek back.
- if (size > in.available()) {
- size = in.available();
- }
-
- int bytesRead = in.read(buffer, offset, size);
- if (bytesRead >= 0) {
- mPosition += bytesRead;
- return bytesRead;
- }
- } catch (IOException e) {
- // do nothing
- }
- mPosition = -1; // need to seek on next read
- return -1;
- }
-
- @Override
- public long getSize() throws IOException {
- return -1;
- }
- });
- } else {
- if (mSeekableFileDescriptor != null) {
- retriever.setDataSource(mSeekableFileDescriptor);
- } else if (mFilename != null) {
- retriever.setDataSource(mFilename);
- } else {
- return;
- }
- }
-
- String exifOffsetStr = retriever.extractMetadata(
- METADATA_KEY_EXIF_OFFSET);
- String exifLengthStr = retriever.extractMetadata(
- METADATA_KEY_EXIF_LENGTH);
- String hasImage = retriever.extractMetadata(
- MediaMetadataRetriever.METADATA_KEY_HAS_IMAGE);
- String hasVideo = retriever.extractMetadata(
- MediaMetadataRetriever.METADATA_KEY_HAS_VIDEO);
-
- String width = null;
- String height = null;
- String rotation = null;
- final String metadataValueYes = "yes";
- // If the file has both image and video, prefer image info over video info.
- // App querying ExifInterface is most likely using the bitmap path which
- // picks the image first.
- if (metadataValueYes.equals(hasImage)) {
- width = retriever.extractMetadata(
- MediaMetadataRetriever.METADATA_KEY_IMAGE_WIDTH);
- height = retriever.extractMetadata(
- MediaMetadataRetriever.METADATA_KEY_IMAGE_HEIGHT);
- rotation = retriever.extractMetadata(
- MediaMetadataRetriever.METADATA_KEY_IMAGE_ROTATION);
- } else if (metadataValueYes.equals(hasVideo)) {
- width = retriever.extractMetadata(
- MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH);
- height = retriever.extractMetadata(
- MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT);
- rotation = retriever.extractMetadata(
- MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION);
- }
-
- if (width != null) {
- mAttributes[IFD_TYPE_PRIMARY].put(TAG_IMAGE_WIDTH,
- ExifAttribute.createUShort(Integer.parseInt(width), mExifByteOrder));
- }
-
- if (height != null) {
- mAttributes[IFD_TYPE_PRIMARY].put(TAG_IMAGE_LENGTH,
- ExifAttribute.createUShort(Integer.parseInt(height), mExifByteOrder));
- }
-
- if (rotation != null) {
- int orientation = ExifInterface.ORIENTATION_NORMAL;
-
- // all rotation angles in CW
- switch (Integer.parseInt(rotation)) {
- case 90:
- orientation = ExifInterface.ORIENTATION_ROTATE_90;
- break;
- case 180:
- orientation = ExifInterface.ORIENTATION_ROTATE_180;
- break;
- case 270:
- orientation = ExifInterface.ORIENTATION_ROTATE_270;
- break;
- }
-
- mAttributes[IFD_TYPE_PRIMARY].put(TAG_ORIENTATION,
- ExifAttribute.createUShort(orientation, mExifByteOrder));
- }
-
- if (exifOffsetStr != null && exifLengthStr != null) {
- int offset = Integer.parseInt(exifOffsetStr);
- int length = Integer.parseInt(exifLengthStr);
- if (length <= 6) {
- throw new IOException("Invalid exif length");
- }
- in.seek(offset);
- byte[] identifier = new byte[6];
- if (in.read(identifier) != 6) {
- throw new IOException("Can't read identifier");
- }
- offset += 6;
- length -= 6;
- if (!Arrays.equals(identifier, IDENTIFIER_EXIF_APP1)) {
- throw new IOException("Invalid identifier");
- }
-
- byte[] bytes = new byte[length];
- if (in.read(bytes) != length) {
- throw new IOException("Can't read exif");
- }
- readExifSegment(bytes, IFD_TYPE_PRIMARY);
- }
-
- if (DEBUG) {
- Log.d(TAG, "Heif meta: " + width + "x" + height + ", rotation " + rotation);
- }
- } finally {
- retriever.release();
- }
- }
-
/**
* ORF files contains a primary image data and a MakerNote data that contains preview/thumbnail
* images. Both data takes the form of IFDs and can therefore be read with the
@@ -5998,8 +5644,7 @@
mHasThumbnail = true;
mThumbnailOffset = thumbnailOffset;
mThumbnailLength = thumbnailLength;
- if (mFilename == null && mAssetInputStream == null
- && mSeekableFileDescriptor == null) {
+ if (mFilename == null && mAssetInputStream == null) {
// Save the thumbnail in memory if the input doesn't support reading again.
byte[] thumbnailBytes = new byte[thumbnailLength];
in.seek(thumbnailOffset);
diff --git a/fragment/api/1.0.0.txt b/fragment/api/1.0.0.txt
index 4d6955e..f517de1 100644
--- a/fragment/api/1.0.0.txt
+++ b/fragment/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app {
public class DialogFragment extends androidx.fragment.app.Fragment implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
diff --git a/fragment/api/1.1.0-alpha01.txt b/fragment/api/1.1.0-alpha01.txt
index eff92037..8e43ddd 100644
--- a/fragment/api/1.1.0-alpha01.txt
+++ b/fragment/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app {
public class DialogFragment extends androidx.fragment.app.Fragment implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
diff --git a/fragment/api/1.1.0-alpha02.txt b/fragment/api/1.1.0-alpha02.txt
index eff92037..8e43ddd 100644
--- a/fragment/api/1.1.0-alpha02.txt
+++ b/fragment/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app {
public class DialogFragment extends androidx.fragment.app.Fragment implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
diff --git a/fragment/api/1.1.0-alpha03.txt b/fragment/api/1.1.0-alpha03.txt
index 8b5c94f..df95ae4 100644
--- a/fragment/api/1.1.0-alpha03.txt
+++ b/fragment/api/1.1.0-alpha03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app {
public class DialogFragment extends androidx.fragment.app.Fragment implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
diff --git a/fragment/api/1.1.0-alpha04.txt b/fragment/api/1.1.0-alpha04.txt
index 0883047..340f3a3 100644
--- a/fragment/api/1.1.0-alpha04.txt
+++ b/fragment/api/1.1.0-alpha04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app {
public class DialogFragment extends androidx.fragment.app.Fragment implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
@@ -264,7 +264,7 @@
method public abstract androidx.fragment.app.FragmentManager.BackStackEntry getBackStackEntryAt(int);
method public abstract int getBackStackEntryCount();
method public abstract androidx.fragment.app.Fragment? getFragment(android.os.Bundle, String);
- method public androidx.fragment.app.FragmentFactory getFragmentFactory();
+ method public abstract androidx.fragment.app.FragmentFactory getFragmentFactory();
method public abstract java.util.List<androidx.fragment.app.Fragment> getFragments();
method public abstract androidx.fragment.app.Fragment? getPrimaryNavigationFragment();
method public abstract boolean isDestroyed();
@@ -279,7 +279,7 @@
method public abstract void registerFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks, boolean);
method public abstract void removeOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public abstract androidx.fragment.app.Fragment.SavedState? saveFragmentInstanceState(androidx.fragment.app.Fragment);
- method public void setFragmentFactory(androidx.fragment.app.FragmentFactory);
+ method public abstract void setFragmentFactory(androidx.fragment.app.FragmentFactory);
method public abstract void unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks);
field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
}
diff --git a/fragment/api/1.1.0-alpha05.txt b/fragment/api/1.1.0-alpha05.txt
deleted file mode 100644
index e586a2f..0000000
--- a/fragment/api/1.1.0-alpha05.txt
+++ /dev/null
@@ -1,402 +0,0 @@
-// Signature format: 3.0
-package androidx.fragment.app {
-
- public class DialogFragment extends androidx.fragment.app.Fragment implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
- ctor public DialogFragment();
- method public void dismiss();
- method public void dismissAllowingStateLoss();
- method public android.app.Dialog? getDialog();
- method public boolean getShowsDialog();
- method @StyleRes public int getTheme();
- method public boolean isCancelable();
- method public void onCancel(android.content.DialogInterface);
- method public android.app.Dialog onCreateDialog(android.os.Bundle?);
- method public void onDismiss(android.content.DialogInterface);
- method public final android.app.Dialog requireDialog();
- method public void setCancelable(boolean);
- method public void setShowsDialog(boolean);
- method public void setStyle(int, @StyleRes int);
- method public void show(androidx.fragment.app.FragmentManager, String?);
- method public int show(androidx.fragment.app.FragmentTransaction, String?);
- method public void showNow(androidx.fragment.app.FragmentManager, String?);
- field public static final int STYLE_NORMAL = 0; // 0x0
- field public static final int STYLE_NO_FRAME = 2; // 0x2
- field public static final int STYLE_NO_INPUT = 3; // 0x3
- field public static final int STYLE_NO_TITLE = 1; // 0x1
- }
-
- public class Fragment implements android.content.ComponentCallbacks androidx.lifecycle.LifecycleOwner androidx.savedstate.SavedStateRegistryOwner android.view.View.OnCreateContextMenuListener androidx.lifecycle.ViewModelStoreOwner {
- ctor public Fragment();
- method public void dump(String, java.io.FileDescriptor?, java.io.PrintWriter, String[]?);
- method public final boolean equals(Object?);
- method public final androidx.fragment.app.FragmentActivity? getActivity();
- method public boolean getAllowEnterTransitionOverlap();
- method public boolean getAllowReturnTransitionOverlap();
- method public final android.os.Bundle? getArguments();
- method public final androidx.fragment.app.FragmentManager getChildFragmentManager();
- method public android.content.Context? getContext();
- method public Object? getEnterTransition();
- method public Object? getExitTransition();
- method public final androidx.fragment.app.FragmentManager? getFragmentManager();
- method public final Object? getHost();
- method public final int getId();
- method public final android.view.LayoutInflater getLayoutInflater();
- method public androidx.lifecycle.Lifecycle getLifecycle();
- method @Deprecated public androidx.loader.app.LoaderManager getLoaderManager();
- method public final androidx.fragment.app.Fragment? getParentFragment();
- method public Object? getReenterTransition();
- method public final android.content.res.Resources getResources();
- method public final boolean getRetainInstance();
- method public Object? getReturnTransition();
- method public final androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
- method public Object? getSharedElementEnterTransition();
- method public Object? getSharedElementReturnTransition();
- method public final String getString(@StringRes int);
- method public final String getString(@StringRes int, java.lang.Object...?);
- method public final String? getTag();
- method public final androidx.fragment.app.Fragment? getTargetFragment();
- method public final int getTargetRequestCode();
- method public final CharSequence getText(@StringRes int);
- method public boolean getUserVisibleHint();
- method public android.view.View? getView();
- method @MainThread public androidx.lifecycle.LifecycleOwner getViewLifecycleOwner();
- method public androidx.lifecycle.LiveData<androidx.lifecycle.LifecycleOwner> getViewLifecycleOwnerLiveData();
- method public androidx.lifecycle.ViewModelStore getViewModelStore();
- method public final int hashCode();
- method @Deprecated public static androidx.fragment.app.Fragment instantiate(android.content.Context, String);
- method @Deprecated public static androidx.fragment.app.Fragment instantiate(android.content.Context, String, android.os.Bundle?);
- method public final boolean isAdded();
- method public final boolean isDetached();
- method public final boolean isHidden();
- method public final boolean isInLayout();
- method public final boolean isRemoving();
- method public final boolean isResumed();
- method public final boolean isStateSaved();
- method public final boolean isVisible();
- method @CallSuper public void onActivityCreated(android.os.Bundle?);
- method public void onActivityResult(int, int, android.content.Intent?);
- method @CallSuper public void onAttach(android.content.Context);
- method @Deprecated @CallSuper public void onAttach(android.app.Activity);
- method public void onAttachFragment(androidx.fragment.app.Fragment);
- method @CallSuper public void onConfigurationChanged(android.content.res.Configuration);
- method public boolean onContextItemSelected(android.view.MenuItem);
- method @CallSuper public void onCreate(android.os.Bundle?);
- method public android.view.animation.Animation? onCreateAnimation(int, boolean, int);
- method public android.animation.Animator? onCreateAnimator(int, boolean, int);
- method public void onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo?);
- method public void onCreateOptionsMenu(android.view.Menu, android.view.MenuInflater);
- method public android.view.View? onCreateView(android.view.LayoutInflater, android.view.ViewGroup?, android.os.Bundle?);
- method @CallSuper public void onDestroy();
- method public void onDestroyOptionsMenu();
- method @CallSuper public void onDestroyView();
- method @CallSuper public void onDetach();
- method public android.view.LayoutInflater onGetLayoutInflater(android.os.Bundle?);
- method public void onHiddenChanged(boolean);
- method @CallSuper public void onInflate(android.content.Context, android.util.AttributeSet, android.os.Bundle?);
- method @Deprecated @CallSuper public void onInflate(android.app.Activity, android.util.AttributeSet, android.os.Bundle?);
- method @CallSuper public void onLowMemory();
- method public void onMultiWindowModeChanged(boolean);
- method public boolean onOptionsItemSelected(android.view.MenuItem);
- method public void onOptionsMenuClosed(android.view.Menu);
- method @CallSuper public void onPause();
- method public void onPictureInPictureModeChanged(boolean);
- method public void onPrepareOptionsMenu(android.view.Menu);
- method public void onRequestPermissionsResult(int, String[], int[]);
- method @CallSuper public void onResume();
- method public void onSaveInstanceState(android.os.Bundle);
- method @CallSuper public void onStart();
- method @CallSuper public void onStop();
- method public void onViewCreated(android.view.View, android.os.Bundle?);
- method @CallSuper public void onViewStateRestored(android.os.Bundle?);
- method public void postponeEnterTransition();
- method public void registerForContextMenu(android.view.View);
- method public final void requestPermissions(String[], int);
- method public final androidx.fragment.app.FragmentActivity requireActivity();
- method public final android.os.Bundle requireArguments();
- method public final android.content.Context requireContext();
- method public final androidx.fragment.app.FragmentManager requireFragmentManager();
- method public final Object requireHost();
- method public final androidx.fragment.app.Fragment requireParentFragment();
- method public final android.view.View requireView();
- method public void setAllowEnterTransitionOverlap(boolean);
- method public void setAllowReturnTransitionOverlap(boolean);
- method public void setArguments(android.os.Bundle?);
- method public void setEnterSharedElementCallback(androidx.core.app.SharedElementCallback?);
- method public void setEnterTransition(Object?);
- method public void setExitSharedElementCallback(androidx.core.app.SharedElementCallback?);
- method public void setExitTransition(Object?);
- method public void setHasOptionsMenu(boolean);
- method public void setInitialSavedState(androidx.fragment.app.Fragment.SavedState?);
- method public void setMenuVisibility(boolean);
- method public void setReenterTransition(Object?);
- method public void setRetainInstance(boolean);
- method public void setReturnTransition(Object?);
- method public void setSharedElementEnterTransition(Object?);
- method public void setSharedElementReturnTransition(Object?);
- method public void setTargetFragment(androidx.fragment.app.Fragment?, int);
- method public void setUserVisibleHint(boolean);
- method public boolean shouldShowRequestPermissionRationale(String);
- method public void startActivity(android.content.Intent!);
- method public void startActivity(android.content.Intent!, android.os.Bundle?);
- method public void startActivityForResult(android.content.Intent!, int);
- method public void startActivityForResult(android.content.Intent!, int, android.os.Bundle?);
- method public void startIntentSenderForResult(android.content.IntentSender!, int, android.content.Intent?, int, int, int, android.os.Bundle?) throws android.content.IntentSender.SendIntentException;
- method public void startPostponedEnterTransition();
- method public void unregisterForContextMenu(android.view.View);
- }
-
- public static class Fragment.InstantiationException extends java.lang.RuntimeException {
- ctor public Fragment.InstantiationException(String, Exception?);
- }
-
- public static class Fragment.SavedState implements android.os.Parcelable {
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<androidx.fragment.app.Fragment.SavedState> CREATOR;
- }
-
- public class FragmentActivity extends androidx.activity.ComponentActivity implements androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback androidx.core.app.ActivityCompat.RequestPermissionsRequestCodeValidator {
- ctor public FragmentActivity();
- method public androidx.fragment.app.FragmentManager getSupportFragmentManager();
- method @Deprecated public androidx.loader.app.LoaderManager getSupportLoaderManager();
- method public android.content.Context getThemedContext();
- method public void onAttachFragment(androidx.fragment.app.Fragment);
- method @CallSuper public void onMultiWindowModeChanged(boolean);
- method @CallSuper public void onPictureInPictureModeChanged(boolean);
- method protected void onResumeFragments();
- method public void setEnterSharedElementCallback(androidx.core.app.SharedElementCallback?);
- method public void setExitSharedElementCallback(androidx.core.app.SharedElementCallback?);
- method public void startActivityFromFragment(androidx.fragment.app.Fragment, android.content.Intent!, int);
- method public void startActivityFromFragment(androidx.fragment.app.Fragment, android.content.Intent!, int, android.os.Bundle?);
- method public void startIntentSenderFromFragment(androidx.fragment.app.Fragment, android.content.IntentSender!, int, android.content.Intent?, int, int, int, android.os.Bundle?) throws android.content.IntentSender.SendIntentException;
- method public void supportFinishAfterTransition();
- method @Deprecated public void supportInvalidateOptionsMenu();
- method public void supportPostponeEnterTransition();
- method public void supportStartPostponedEnterTransition();
- method public final void validateRequestPermissionsRequestCode(int);
- }
-
- public abstract class FragmentContainer {
- ctor public FragmentContainer();
- method @Deprecated public androidx.fragment.app.Fragment instantiate(android.content.Context, String, android.os.Bundle?);
- method public abstract android.view.View? onFindViewById(@IdRes int);
- method public abstract boolean onHasView();
- }
-
- public class FragmentController {
- method public void attachHost(androidx.fragment.app.Fragment?);
- method public static androidx.fragment.app.FragmentController createController(androidx.fragment.app.FragmentHostCallback<?>);
- method public void dispatchActivityCreated();
- method public void dispatchConfigurationChanged(android.content.res.Configuration);
- method public boolean dispatchContextItemSelected(android.view.MenuItem);
- method public void dispatchCreate();
- method public boolean dispatchCreateOptionsMenu(android.view.Menu, android.view.MenuInflater);
- method public void dispatchDestroy();
- method public void dispatchDestroyView();
- method public void dispatchLowMemory();
- method public void dispatchMultiWindowModeChanged(boolean);
- method public boolean dispatchOptionsItemSelected(android.view.MenuItem);
- method public void dispatchOptionsMenuClosed(android.view.Menu);
- method public void dispatchPause();
- method public void dispatchPictureInPictureModeChanged(boolean);
- method public boolean dispatchPrepareOptionsMenu(android.view.Menu);
- method @Deprecated public void dispatchReallyStop();
- method public void dispatchResume();
- method public void dispatchStart();
- method public void dispatchStop();
- method @Deprecated public void doLoaderDestroy();
- method @Deprecated public void doLoaderRetain();
- method @Deprecated public void doLoaderStart();
- method @Deprecated public void doLoaderStop(boolean);
- method @Deprecated public void dumpLoaders(String, java.io.FileDescriptor?, java.io.PrintWriter, String[]?);
- method public boolean execPendingActions();
- method public androidx.fragment.app.Fragment? findFragmentByWho(String);
- method public java.util.List<androidx.fragment.app.Fragment> getActiveFragments(java.util.List<androidx.fragment.app.Fragment>!);
- method public int getActiveFragmentsCount();
- method public androidx.fragment.app.FragmentManager getSupportFragmentManager();
- method @Deprecated public androidx.loader.app.LoaderManager! getSupportLoaderManager();
- method public void noteStateNotSaved();
- method public android.view.View? onCreateView(android.view.View?, String, android.content.Context, android.util.AttributeSet);
- method @Deprecated public void reportLoaderStart();
- method @Deprecated public void restoreAllState(android.os.Parcelable?, java.util.List<androidx.fragment.app.Fragment>?);
- method @Deprecated public void restoreAllState(android.os.Parcelable?, androidx.fragment.app.FragmentManagerNonConfig?);
- method @Deprecated public void restoreLoaderNonConfig(androidx.collection.SimpleArrayMap<java.lang.String,androidx.loader.app.LoaderManager>!);
- method public void restoreSaveState(android.os.Parcelable?);
- method @Deprecated public androidx.collection.SimpleArrayMap<java.lang.String,androidx.loader.app.LoaderManager>? retainLoaderNonConfig();
- method @Deprecated public androidx.fragment.app.FragmentManagerNonConfig? retainNestedNonConfig();
- method @Deprecated public java.util.List<androidx.fragment.app.Fragment>? retainNonConfig();
- method public android.os.Parcelable? saveAllState();
- }
-
- public class FragmentFactory {
- ctor public FragmentFactory();
- method public androidx.fragment.app.Fragment instantiate(ClassLoader, String, android.os.Bundle?);
- method public static Class<? extends androidx.fragment.app.Fragment> loadFragmentClass(ClassLoader, String);
- }
-
- public abstract class FragmentHostCallback<E> extends androidx.fragment.app.FragmentContainer {
- ctor public FragmentHostCallback(android.content.Context, android.os.Handler, int);
- method public void onDump(String, java.io.FileDescriptor?, java.io.PrintWriter, String[]?);
- method public android.view.View? onFindViewById(int);
- method public abstract E? onGetHost();
- method public android.view.LayoutInflater onGetLayoutInflater();
- method public int onGetWindowAnimations();
- method public boolean onHasView();
- method public boolean onHasWindowAnimations();
- method public void onRequestPermissionsFromFragment(androidx.fragment.app.Fragment, String[], int);
- method public boolean onShouldSaveFragmentState(androidx.fragment.app.Fragment);
- method public boolean onShouldShowRequestPermissionRationale(String);
- method public void onStartActivityFromFragment(androidx.fragment.app.Fragment, android.content.Intent!, int);
- method public void onStartActivityFromFragment(androidx.fragment.app.Fragment, android.content.Intent!, int, android.os.Bundle?);
- method public void onStartIntentSenderFromFragment(androidx.fragment.app.Fragment, android.content.IntentSender!, int, android.content.Intent?, int, int, int, android.os.Bundle?) throws android.content.IntentSender.SendIntentException;
- method public void onSupportInvalidateOptionsMenu();
- }
-
- public abstract class FragmentManager {
- ctor public FragmentManager();
- method public abstract void addOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
- method public abstract androidx.fragment.app.FragmentTransaction beginTransaction();
- method public abstract void dump(String, java.io.FileDescriptor?, java.io.PrintWriter, String[]?);
- method public static void enableDebugLogging(boolean);
- method public abstract boolean executePendingTransactions();
- method public abstract androidx.fragment.app.Fragment? findFragmentById(@IdRes int);
- method public abstract androidx.fragment.app.Fragment? findFragmentByTag(String?);
- method public abstract androidx.fragment.app.FragmentManager.BackStackEntry getBackStackEntryAt(int);
- method public abstract int getBackStackEntryCount();
- method public abstract androidx.fragment.app.Fragment? getFragment(android.os.Bundle, String);
- method public androidx.fragment.app.FragmentFactory getFragmentFactory();
- method public abstract java.util.List<androidx.fragment.app.Fragment> getFragments();
- method public abstract androidx.fragment.app.Fragment? getPrimaryNavigationFragment();
- method public abstract boolean isDestroyed();
- method public abstract boolean isStateSaved();
- method public abstract void popBackStack();
- method public abstract void popBackStack(String?, int);
- method public abstract void popBackStack(int, int);
- method public abstract boolean popBackStackImmediate();
- method public abstract boolean popBackStackImmediate(String?, int);
- method public abstract boolean popBackStackImmediate(int, int);
- method public abstract void putFragment(android.os.Bundle, String, androidx.fragment.app.Fragment);
- method public abstract void registerFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks, boolean);
- method public abstract void removeOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
- method public abstract androidx.fragment.app.Fragment.SavedState? saveFragmentInstanceState(androidx.fragment.app.Fragment);
- method public void setFragmentFactory(androidx.fragment.app.FragmentFactory);
- method public abstract void unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks);
- field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
- }
-
- public static interface FragmentManager.BackStackEntry {
- method public CharSequence? getBreadCrumbShortTitle();
- method @StringRes public int getBreadCrumbShortTitleRes();
- method public CharSequence? getBreadCrumbTitle();
- method @StringRes public int getBreadCrumbTitleRes();
- method public int getId();
- method public String? getName();
- }
-
- public abstract static class FragmentManager.FragmentLifecycleCallbacks {
- ctor public FragmentManager.FragmentLifecycleCallbacks();
- method public void onFragmentActivityCreated(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment, android.os.Bundle?);
- method public void onFragmentAttached(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment, android.content.Context);
- method public void onFragmentCreated(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment, android.os.Bundle?);
- method public void onFragmentDestroyed(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment);
- method public void onFragmentDetached(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment);
- method public void onFragmentPaused(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment);
- method public void onFragmentPreAttached(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment, android.content.Context);
- method public void onFragmentPreCreated(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment, android.os.Bundle?);
- method public void onFragmentResumed(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment);
- method public void onFragmentSaveInstanceState(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment, android.os.Bundle);
- method public void onFragmentStarted(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment);
- method public void onFragmentStopped(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment);
- method public void onFragmentViewCreated(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment, android.view.View, android.os.Bundle?);
- method public void onFragmentViewDestroyed(androidx.fragment.app.FragmentManager, androidx.fragment.app.Fragment);
- }
-
- public static interface FragmentManager.OnBackStackChangedListener {
- method public void onBackStackChanged();
- }
-
- @Deprecated public class FragmentManagerNonConfig {
- }
-
- public abstract class FragmentPagerAdapter extends androidx.viewpager.widget.PagerAdapter {
- ctor public FragmentPagerAdapter(androidx.fragment.app.FragmentManager);
- method public abstract androidx.fragment.app.Fragment getItem(int);
- method public long getItemId(int);
- method public boolean isViewFromObject(android.view.View, Object);
- }
-
- public abstract class FragmentStatePagerAdapter extends androidx.viewpager.widget.PagerAdapter {
- ctor public FragmentStatePagerAdapter(androidx.fragment.app.FragmentManager);
- method public abstract androidx.fragment.app.Fragment getItem(int);
- method public boolean isViewFromObject(android.view.View, Object);
- }
-
- public class FragmentTabHost extends android.widget.TabHost implements android.widget.TabHost.OnTabChangeListener {
- ctor public FragmentTabHost(android.content.Context);
- ctor public FragmentTabHost(android.content.Context, android.util.AttributeSet?);
- method public void addTab(android.widget.TabHost.TabSpec, Class<?>, android.os.Bundle?);
- method public void onTabChanged(String?);
- method @Deprecated public void setup();
- method public void setup(android.content.Context, androidx.fragment.app.FragmentManager);
- method public void setup(android.content.Context, androidx.fragment.app.FragmentManager, int);
- }
-
- public abstract class FragmentTransaction {
- ctor public FragmentTransaction();
- method public abstract androidx.fragment.app.FragmentTransaction add(androidx.fragment.app.Fragment, String?);
- method public abstract androidx.fragment.app.FragmentTransaction add(@IdRes int, androidx.fragment.app.Fragment);
- method public abstract androidx.fragment.app.FragmentTransaction add(@IdRes int, androidx.fragment.app.Fragment, String?);
- method public abstract androidx.fragment.app.FragmentTransaction addSharedElement(android.view.View, String);
- method public abstract androidx.fragment.app.FragmentTransaction addToBackStack(String?);
- method public abstract androidx.fragment.app.FragmentTransaction attach(androidx.fragment.app.Fragment);
- method public abstract int commit();
- method public abstract int commitAllowingStateLoss();
- method public abstract void commitNow();
- method public abstract void commitNowAllowingStateLoss();
- method public abstract androidx.fragment.app.FragmentTransaction detach(androidx.fragment.app.Fragment);
- method public abstract androidx.fragment.app.FragmentTransaction disallowAddToBackStack();
- method public abstract androidx.fragment.app.FragmentTransaction hide(androidx.fragment.app.Fragment);
- method public abstract boolean isAddToBackStackAllowed();
- method public abstract boolean isEmpty();
- method public abstract androidx.fragment.app.FragmentTransaction remove(androidx.fragment.app.Fragment);
- method public abstract androidx.fragment.app.FragmentTransaction replace(@IdRes int, androidx.fragment.app.Fragment);
- method public abstract androidx.fragment.app.FragmentTransaction replace(@IdRes int, androidx.fragment.app.Fragment, String?);
- method public abstract androidx.fragment.app.FragmentTransaction runOnCommit(Runnable);
- method @Deprecated public abstract androidx.fragment.app.FragmentTransaction setAllowOptimization(boolean);
- method public abstract androidx.fragment.app.FragmentTransaction setBreadCrumbShortTitle(@StringRes int);
- method public abstract androidx.fragment.app.FragmentTransaction setBreadCrumbShortTitle(CharSequence?);
- method public abstract androidx.fragment.app.FragmentTransaction setBreadCrumbTitle(@StringRes int);
- method public abstract androidx.fragment.app.FragmentTransaction setBreadCrumbTitle(CharSequence?);
- method public abstract androidx.fragment.app.FragmentTransaction setCustomAnimations(@AnimatorRes @AnimRes int, @AnimatorRes @AnimRes int);
- method public abstract androidx.fragment.app.FragmentTransaction setCustomAnimations(@AnimatorRes @AnimRes int, @AnimatorRes @AnimRes int, @AnimatorRes @AnimRes int, @AnimatorRes @AnimRes int);
- method public abstract androidx.fragment.app.FragmentTransaction setPrimaryNavigationFragment(androidx.fragment.app.Fragment?);
- method public abstract androidx.fragment.app.FragmentTransaction setReorderingAllowed(boolean);
- method public abstract androidx.fragment.app.FragmentTransaction setTransition(int);
- method public abstract androidx.fragment.app.FragmentTransaction setTransitionStyle(@StyleRes int);
- method public abstract androidx.fragment.app.FragmentTransaction show(androidx.fragment.app.Fragment);
- field public static final int TRANSIT_ENTER_MASK = 4096; // 0x1000
- field public static final int TRANSIT_EXIT_MASK = 8192; // 0x2000
- field public static final int TRANSIT_FRAGMENT_CLOSE = 8194; // 0x2002
- field public static final int TRANSIT_FRAGMENT_FADE = 4099; // 0x1003
- field public static final int TRANSIT_FRAGMENT_OPEN = 4097; // 0x1001
- field public static final int TRANSIT_NONE = 0; // 0x0
- field public static final int TRANSIT_UNSET = -1; // 0xffffffff
- }
-
- public class ListFragment extends androidx.fragment.app.Fragment {
- ctor public ListFragment();
- method public android.widget.ListAdapter? getListAdapter();
- method public android.widget.ListView getListView();
- method public long getSelectedItemId();
- method public int getSelectedItemPosition();
- method public void onListItemClick(android.widget.ListView, android.view.View, int, long);
- method public final android.widget.ListAdapter requireListAdapter();
- method public void setEmptyText(CharSequence?);
- method public void setListAdapter(android.widget.ListAdapter?);
- method public void setListShown(boolean);
- method public void setListShownNoAnimation(boolean);
- method public void setSelection(int);
- }
-
-}
-
diff --git a/fragment/api/current.txt b/fragment/api/current.txt
index e586a2f..340f3a3 100644
--- a/fragment/api/current.txt
+++ b/fragment/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app {
public class DialogFragment extends androidx.fragment.app.Fragment implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
@@ -25,7 +25,7 @@
field public static final int STYLE_NO_TITLE = 1; // 0x1
}
- public class Fragment implements android.content.ComponentCallbacks androidx.lifecycle.LifecycleOwner androidx.savedstate.SavedStateRegistryOwner android.view.View.OnCreateContextMenuListener androidx.lifecycle.ViewModelStoreOwner {
+ public class Fragment implements androidx.savedstate.bundle.BundleSavedStateRegistryOwner android.content.ComponentCallbacks androidx.lifecycle.LifecycleOwner android.view.View.OnCreateContextMenuListener androidx.lifecycle.ViewModelStoreOwner {
ctor public Fragment();
method public void dump(String, java.io.FileDescriptor?, java.io.PrintWriter, String[]?);
method public final boolean equals(Object?);
@@ -33,6 +33,7 @@
method public boolean getAllowEnterTransitionOverlap();
method public boolean getAllowReturnTransitionOverlap();
method public final android.os.Bundle? getArguments();
+ method public final androidx.savedstate.SavedStateRegistry<android.os.Bundle> getBundleSavedStateRegistry();
method public final androidx.fragment.app.FragmentManager getChildFragmentManager();
method public android.content.Context? getContext();
method public Object? getEnterTransition();
@@ -48,7 +49,6 @@
method public final android.content.res.Resources getResources();
method public final boolean getRetainInstance();
method public Object? getReturnTransition();
- method public final androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
method public Object? getSharedElementEnterTransition();
method public Object? getSharedElementReturnTransition();
method public final String getString(@StringRes int);
@@ -264,7 +264,7 @@
method public abstract androidx.fragment.app.FragmentManager.BackStackEntry getBackStackEntryAt(int);
method public abstract int getBackStackEntryCount();
method public abstract androidx.fragment.app.Fragment? getFragment(android.os.Bundle, String);
- method public androidx.fragment.app.FragmentFactory getFragmentFactory();
+ method public abstract androidx.fragment.app.FragmentFactory getFragmentFactory();
method public abstract java.util.List<androidx.fragment.app.Fragment> getFragments();
method public abstract androidx.fragment.app.Fragment? getPrimaryNavigationFragment();
method public abstract boolean isDestroyed();
@@ -279,7 +279,7 @@
method public abstract void registerFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks, boolean);
method public abstract void removeOnBackStackChangedListener(androidx.fragment.app.FragmentManager.OnBackStackChangedListener);
method public abstract androidx.fragment.app.Fragment.SavedState? saveFragmentInstanceState(androidx.fragment.app.Fragment);
- method public void setFragmentFactory(androidx.fragment.app.FragmentFactory);
+ method public abstract void setFragmentFactory(androidx.fragment.app.FragmentFactory);
method public abstract void unregisterFragmentLifecycleCallbacks(androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks);
field public static final int POP_BACK_STACK_INCLUSIVE = 1; // 0x1
}
diff --git a/fragment/api/res-1.1.0-alpha05.txt b/fragment/api/res-1.1.0-alpha05.txt
deleted file mode 100644
index e69de29..0000000
--- a/fragment/api/res-1.1.0-alpha05.txt
+++ /dev/null
diff --git a/fragment/api/restricted_1.0.0.txt b/fragment/api/restricted_1.0.0.txt
deleted file mode 100644
index b03ad6d..0000000
--- a/fragment/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-// Signature format: 3.0
-package androidx.fragment.app {
-
- public class DialogFragment extends androidx.fragment.app.Fragment {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setupDialog(android.app.Dialog!, int);
- }
-
- public class Fragment {
- method @Deprecated @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.view.LayoutInflater getLayoutInflater(android.os.Bundle?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final boolean hasOptionsMenu();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final boolean isMenuVisible();
- }
-
- public class FragmentActivity {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected boolean onPrepareOptionsPanel(android.view.View!, android.view.Menu!);
- }
-
- public abstract class FragmentManager {
- method @Deprecated @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.fragment.app.FragmentTransaction! openTransaction();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class FragmentTransitionImpl {
- ctor public FragmentTransitionImpl();
- method public abstract void addTarget(Object!, android.view.View!);
- method public abstract void addTargets(Object!, java.util.ArrayList<android.view.View>!);
- method public abstract void beginDelayedTransition(android.view.ViewGroup!, Object!);
- method protected static void bfsAddViewChildren(java.util.List<android.view.View>!, android.view.View!);
- method public abstract boolean canHandle(Object!);
- method public abstract Object! cloneTransition(Object!);
- method protected void getBoundsOnScreen(android.view.View!, android.graphics.Rect!);
- method protected static boolean isNullOrEmpty(java.util.List!);
- method public abstract Object! mergeTransitionsInSequence(Object!, Object!, Object!);
- method public abstract Object! mergeTransitionsTogether(Object!, Object!, Object!);
- method public abstract void removeTarget(Object!, android.view.View!);
- method public abstract void replaceTargets(Object!, java.util.ArrayList<android.view.View>!, java.util.ArrayList<android.view.View>!);
- method public abstract void scheduleHideFragmentView(Object!, android.view.View!, java.util.ArrayList<android.view.View>!);
- method public abstract void scheduleRemoveTargets(Object!, Object!, java.util.ArrayList<android.view.View>!, Object!, java.util.ArrayList<android.view.View>!, Object!, java.util.ArrayList<android.view.View>!);
- method public abstract void setEpicenter(Object!, android.view.View!);
- method public abstract void setEpicenter(Object!, android.graphics.Rect!);
- method public abstract void setSharedElementTargets(Object!, android.view.View!, java.util.ArrayList<android.view.View>!);
- method public abstract void swapSharedElementTargets(Object!, java.util.ArrayList<android.view.View>!, java.util.ArrayList<android.view.View>!);
- method public abstract Object! wrapTransitionInSet(Object!);
- }
-
-}
-
diff --git a/fragment/api/restricted_1.1.0-alpha05.txt b/fragment/api/restricted_1.1.0-alpha05.txt
deleted file mode 100644
index 59d618c..0000000
--- a/fragment/api/restricted_1.1.0-alpha05.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-// Signature format: 3.0
-package androidx.fragment.app {
-
- public class DialogFragment extends androidx.fragment.app.Fragment implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setupDialog(android.app.Dialog, int);
- }
-
- public class Fragment implements android.content.ComponentCallbacks androidx.lifecycle.LifecycleOwner androidx.savedstate.SavedStateRegistryOwner android.view.View.OnCreateContextMenuListener androidx.lifecycle.ViewModelStoreOwner {
- method @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.view.LayoutInflater getLayoutInflater(android.os.Bundle?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final boolean hasOptionsMenu();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final boolean isMenuVisible();
- }
-
- public class FragmentActivity extends androidx.activity.ComponentActivity implements androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback androidx.core.app.ActivityCompat.RequestPermissionsRequestCodeValidator {
- method @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected boolean onPrepareOptionsPanel(android.view.View?, android.view.Menu);
- method public final void validateRequestPermissionsRequestCode(int);
- }
-
- public abstract class FragmentManager {
- method @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.fragment.app.FragmentTransaction openTransaction();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class FragmentTransitionImpl {
- ctor public FragmentTransitionImpl();
- method public abstract void addTarget(Object!, android.view.View!);
- method public abstract void addTargets(Object!, java.util.ArrayList<android.view.View>!);
- method public abstract void beginDelayedTransition(android.view.ViewGroup!, Object!);
- method protected static void bfsAddViewChildren(java.util.List<android.view.View>!, android.view.View!);
- method public abstract boolean canHandle(Object!);
- method public abstract Object! cloneTransition(Object!);
- method protected void getBoundsOnScreen(android.view.View!, android.graphics.Rect!);
- method protected static boolean isNullOrEmpty(java.util.List!);
- method public abstract Object! mergeTransitionsInSequence(Object!, Object!, Object!);
- method public abstract Object! mergeTransitionsTogether(Object!, Object!, Object!);
- method public abstract void removeTarget(Object!, android.view.View!);
- method public abstract void replaceTargets(Object!, java.util.ArrayList<android.view.View>!, java.util.ArrayList<android.view.View>!);
- method public abstract void scheduleHideFragmentView(Object!, android.view.View!, java.util.ArrayList<android.view.View>!);
- method public abstract void scheduleRemoveTargets(Object!, Object!, java.util.ArrayList<android.view.View>!, Object!, java.util.ArrayList<android.view.View>!, Object!, java.util.ArrayList<android.view.View>!);
- method public abstract void setEpicenter(Object!, android.view.View!);
- method public abstract void setEpicenter(Object!, android.graphics.Rect!);
- method public abstract void setSharedElementTargets(Object!, android.view.View!, java.util.ArrayList<android.view.View>!);
- method public abstract void swapSharedElementTargets(Object!, java.util.ArrayList<android.view.View>!, java.util.ArrayList<android.view.View>!);
- method public abstract Object! wrapTransitionInSet(Object!);
- }
-
-}
-
diff --git a/fragment/api/restricted_current.txt b/fragment/api/restricted_current.txt
deleted file mode 100644
index 59d618c..0000000
--- a/fragment/api/restricted_current.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-// Signature format: 3.0
-package androidx.fragment.app {
-
- public class DialogFragment extends androidx.fragment.app.Fragment implements android.content.DialogInterface.OnCancelListener android.content.DialogInterface.OnDismissListener {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setupDialog(android.app.Dialog, int);
- }
-
- public class Fragment implements android.content.ComponentCallbacks androidx.lifecycle.LifecycleOwner androidx.savedstate.SavedStateRegistryOwner android.view.View.OnCreateContextMenuListener androidx.lifecycle.ViewModelStoreOwner {
- method @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.view.LayoutInflater getLayoutInflater(android.os.Bundle?);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final boolean hasOptionsMenu();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final boolean isMenuVisible();
- }
-
- public class FragmentActivity extends androidx.activity.ComponentActivity implements androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback androidx.core.app.ActivityCompat.RequestPermissionsRequestCodeValidator {
- method @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected boolean onPrepareOptionsPanel(android.view.View?, android.view.Menu);
- method public final void validateRequestPermissionsRequestCode(int);
- }
-
- public abstract class FragmentManager {
- method @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.fragment.app.FragmentTransaction openTransaction();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class FragmentTransitionImpl {
- ctor public FragmentTransitionImpl();
- method public abstract void addTarget(Object!, android.view.View!);
- method public abstract void addTargets(Object!, java.util.ArrayList<android.view.View>!);
- method public abstract void beginDelayedTransition(android.view.ViewGroup!, Object!);
- method protected static void bfsAddViewChildren(java.util.List<android.view.View>!, android.view.View!);
- method public abstract boolean canHandle(Object!);
- method public abstract Object! cloneTransition(Object!);
- method protected void getBoundsOnScreen(android.view.View!, android.graphics.Rect!);
- method protected static boolean isNullOrEmpty(java.util.List!);
- method public abstract Object! mergeTransitionsInSequence(Object!, Object!, Object!);
- method public abstract Object! mergeTransitionsTogether(Object!, Object!, Object!);
- method public abstract void removeTarget(Object!, android.view.View!);
- method public abstract void replaceTargets(Object!, java.util.ArrayList<android.view.View>!, java.util.ArrayList<android.view.View>!);
- method public abstract void scheduleHideFragmentView(Object!, android.view.View!, java.util.ArrayList<android.view.View>!);
- method public abstract void scheduleRemoveTargets(Object!, Object!, java.util.ArrayList<android.view.View>!, Object!, java.util.ArrayList<android.view.View>!, Object!, java.util.ArrayList<android.view.View>!);
- method public abstract void setEpicenter(Object!, android.view.View!);
- method public abstract void setEpicenter(Object!, android.graphics.Rect!);
- method public abstract void setSharedElementTargets(Object!, android.view.View!, java.util.ArrayList<android.view.View>!);
- method public abstract void swapSharedElementTargets(Object!, java.util.ArrayList<android.view.View>!, java.util.ArrayList<android.view.View>!);
- method public abstract Object! wrapTransitionInSet(Object!);
- }
-
-}
-
diff --git a/fragment/build.gradle b/fragment/build.gradle
index 2b6c14a..a04a4e7 100644
--- a/fragment/build.gradle
+++ b/fragment/build.gradle
@@ -18,9 +18,8 @@
api(project(":core")) {
exclude group: 'androidx.annotation'
}
- api(project(":collection"))
api("androidx.viewpager:viewpager:1.0.0")
- api(project(":annotation"))
+ api("androidx.annotation:annotation:1.0.0")
api("androidx.loader:loader:1.0.0")
api(project(":activity"))
api(ARCH_LIFECYCLE_VIEWMODEL, libs.exclude_annotations_transitive)
diff --git a/fragment/ktx/api/1.0.0.txt b/fragment/ktx/api/1.0.0.txt
index df8b4f5..cbe2677 100644
--- a/fragment/ktx/api/1.0.0.txt
+++ b/fragment/ktx/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app {
public final class FragmentManagerKt {
diff --git a/fragment/ktx/api/1.1.0-alpha01.txt b/fragment/ktx/api/1.1.0-alpha01.txt
index f3c14d2..a94ec17 100644
--- a/fragment/ktx/api/1.1.0-alpha01.txt
+++ b/fragment/ktx/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app {
public final class FragmentManagerKt {
diff --git a/fragment/ktx/api/1.1.0-alpha02.txt b/fragment/ktx/api/1.1.0-alpha02.txt
index f3c14d2..a94ec17 100644
--- a/fragment/ktx/api/1.1.0-alpha02.txt
+++ b/fragment/ktx/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app {
public final class FragmentManagerKt {
diff --git a/fragment/ktx/api/1.1.0-alpha03.txt b/fragment/ktx/api/1.1.0-alpha03.txt
index 57f43ef7..a4193b9 100644
--- a/fragment/ktx/api/1.1.0-alpha03.txt
+++ b/fragment/ktx/api/1.1.0-alpha03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app {
public final class FragmentManagerKt {
diff --git a/fragment/ktx/api/1.1.0-alpha04.txt b/fragment/ktx/api/1.1.0-alpha04.txt
index 54ffec7..a4193b9 100644
--- a/fragment/ktx/api/1.1.0-alpha04.txt
+++ b/fragment/ktx/api/1.1.0-alpha04.txt
@@ -1,18 +1,16 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app {
public final class FragmentManagerKt {
ctor public FragmentManagerKt();
- method public static inline void commit(androidx.fragment.app.FragmentManager, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
- method public static inline void commitNow(androidx.fragment.app.FragmentManager, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
- method @Deprecated public static inline void transaction(androidx.fragment.app.FragmentManager, boolean now = false, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
+ method public static void commit(androidx.fragment.app.FragmentManager, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
+ method public static void commitNow(androidx.fragment.app.FragmentManager, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
+ method @Deprecated public static void transaction(androidx.fragment.app.FragmentManager, boolean now = false, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
}
public final class FragmentViewModelLazyKt {
ctor public FragmentViewModelLazyKt();
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM>! activityViewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>! factoryProducer = null);
method @MainThread public static <VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM> createViewModelLazy(androidx.fragment.app.Fragment, kotlin.reflect.KClass<VM> viewModelClass, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner> ownerProducer, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM>! viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner>! ownerProducer = { this }, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>! factoryProducer = null);
}
}
diff --git a/fragment/ktx/api/1.1.0-alpha05.txt b/fragment/ktx/api/1.1.0-alpha05.txt
deleted file mode 100644
index 54ffec7..0000000
--- a/fragment/ktx/api/1.1.0-alpha05.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-// Signature format: 3.0
-package androidx.fragment.app {
-
- public final class FragmentManagerKt {
- ctor public FragmentManagerKt();
- method public static inline void commit(androidx.fragment.app.FragmentManager, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
- method public static inline void commitNow(androidx.fragment.app.FragmentManager, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
- method @Deprecated public static inline void transaction(androidx.fragment.app.FragmentManager, boolean now = false, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
- }
-
- public final class FragmentViewModelLazyKt {
- ctor public FragmentViewModelLazyKt();
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM>! activityViewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>! factoryProducer = null);
- method @MainThread public static <VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM> createViewModelLazy(androidx.fragment.app.Fragment, kotlin.reflect.KClass<VM> viewModelClass, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner> ownerProducer, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM>! viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner>! ownerProducer = { this }, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>! factoryProducer = null);
- }
-
-}
-
diff --git a/fragment/ktx/api/current.txt b/fragment/ktx/api/current.txt
index 54ffec7..a4193b9 100644
--- a/fragment/ktx/api/current.txt
+++ b/fragment/ktx/api/current.txt
@@ -1,18 +1,16 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app {
public final class FragmentManagerKt {
ctor public FragmentManagerKt();
- method public static inline void commit(androidx.fragment.app.FragmentManager, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
- method public static inline void commitNow(androidx.fragment.app.FragmentManager, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
- method @Deprecated public static inline void transaction(androidx.fragment.app.FragmentManager, boolean now = false, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
+ method public static void commit(androidx.fragment.app.FragmentManager, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
+ method public static void commitNow(androidx.fragment.app.FragmentManager, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
+ method @Deprecated public static void transaction(androidx.fragment.app.FragmentManager, boolean now = false, boolean allowStateLoss = false, kotlin.jvm.functions.Function1<? super androidx.fragment.app.FragmentTransaction,kotlin.Unit> body);
}
public final class FragmentViewModelLazyKt {
ctor public FragmentViewModelLazyKt();
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM>! activityViewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>! factoryProducer = null);
method @MainThread public static <VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM> createViewModelLazy(androidx.fragment.app.Fragment, kotlin.reflect.KClass<VM> viewModelClass, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner> ownerProducer, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>? factoryProducer = null);
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> kotlin.Lazy<VM>! viewModels(androidx.fragment.app.Fragment, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner>! ownerProducer = { this }, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory>! factoryProducer = null);
}
}
diff --git a/fragment/ktx/api/res-1.1.0-alpha05.txt b/fragment/ktx/api/res-1.1.0-alpha05.txt
deleted file mode 100644
index e69de29..0000000
--- a/fragment/ktx/api/res-1.1.0-alpha05.txt
+++ /dev/null
diff --git a/fragment/ktx/api/restricted_1.0.0.txt b/fragment/ktx/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/fragment/ktx/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/fragment/ktx/api/restricted_1.1.0-alpha05.txt b/fragment/ktx/api/restricted_1.1.0-alpha05.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/fragment/ktx/api/restricted_1.1.0-alpha05.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/fragment/ktx/api/restricted_current.txt b/fragment/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/fragment/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/fragment/ktx/src/androidTest/java/androidx/fragment/app/FragmentManagerTest.kt b/fragment/ktx/src/androidTest/java/androidx/fragment/app/FragmentManagerTest.kt
index fe0de65..b015bb1 100644
--- a/fragment/ktx/src/androidTest/java/androidx/fragment/app/FragmentManagerTest.kt
+++ b/fragment/ktx/src/androidTest/java/androidx/fragment/app/FragmentManagerTest.kt
@@ -1,13 +1,13 @@
package androidx.fragment.app
import androidx.test.annotation.UiThreadTest
-import androidx.test.filters.SmallTest
+import androidx.test.filters.MediumTest
import androidx.test.rule.ActivityTestRule
import com.google.common.truth.Truth.assertThat
import org.junit.Rule
import org.junit.Test
-@SmallTest
+@MediumTest
@Suppress("DEPRECATION")
class FragmentManagerTest {
@get:Rule val activityRule = ActivityTestRule<TestActivity>(TestActivity::class.java)
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/BackStackStateTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/BackStackStateTest.kt
index c4ef2a8..ba3226f 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/BackStackStateTest.kt
+++ b/fragment/src/androidTest/java/androidx/fragment/app/BackStackStateTest.kt
@@ -17,22 +17,17 @@
package androidx.fragment.app
import android.os.Parcel
-import androidx.fragment.app.FragmentTestUtil.shutdownFragmentController
-import androidx.fragment.app.FragmentTestUtil.startupFragmentController
import androidx.fragment.app.test.EmptyFragmentTestActivity
-import androidx.lifecycle.ViewModelStore
-import androidx.test.annotation.UiThreadTest
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import androidx.test.rule.ActivityTestRule
import com.google.common.truth.Truth.assertThat
-import junit.framework.Assert.fail
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
-@LargeTest
+@SmallTest
class BackStackStateTest {
@get:Rule
@@ -61,168 +56,4 @@
assertThat(restoredBackStackState.mReorderingAllowed)
.isEqualTo(backStackState.mReorderingAllowed)
}
-
- @Test
- @UiThreadTest
- fun testHideOnFragmentWithAManager() {
- val viewModelStore1 = ViewModelStore()
- val fc1 = startupFragmentController(activityRule.activity, null, viewModelStore1)
- val fm1 = fc1.supportFragmentManager
-
- val viewModelStore2 = ViewModelStore()
- val fc2 = startupFragmentController(activityRule.activity, null, viewModelStore2)
- val fm2 = fc2.supportFragmentManager
-
- val fragment1 = Fragment()
-
- fm1.beginTransaction().attach(fragment1).commitNow()
- try {
- fm2.beginTransaction().hide(fragment1).commitNow()
- fail("Fragment associated with another" +
- " FragmentManager should throw IllegalStateException")
- } catch (e: IllegalStateException) {
- assertThat(e)
- .hasMessageThat().contains(
- "Cannot hide Fragment attached to " +
- "a different FragmentManager. Fragment " + fragment1.toString() +
- " is already attached to a FragmentManager."
- )
- }
-
- // Bring the state back down to destroyed before we finish the test
- shutdownFragmentController(fc1, viewModelStore1)
- shutdownFragmentController(fc2, viewModelStore2)
- }
-
- @Test
- @UiThreadTest
- fun testShowOnFragmentWithAManager() {
- val viewModelStore1 = ViewModelStore()
- val fc1 = startupFragmentController(activityRule.activity, null, viewModelStore1)
- val fm1 = fc1.supportFragmentManager
-
- val viewModelStore2 = ViewModelStore()
- val fc2 = startupFragmentController(activityRule.activity, null, viewModelStore2)
- val fm2 = fc2.supportFragmentManager
-
- val fragment1 = Fragment()
-
- fm1.beginTransaction().attach(fragment1).commitNow()
- try {
- fm2.beginTransaction().show(fragment1).commitNow()
- fail("Fragment associated with another" +
- " FragmentManager should throw IllegalStateException")
- } catch (e: IllegalStateException) {
- assertThat(e)
- .hasMessageThat().contains(
- "Cannot show Fragment attached to " +
- "a different FragmentManager. Fragment " + fragment1.toString() +
- " is already attached to a FragmentManager."
- )
- }
-
- // Bring the state back down to destroyed before we finish the test
- shutdownFragmentController(fc1, viewModelStore1)
- shutdownFragmentController(fc2, viewModelStore2)
- }
-
- @Test
- @UiThreadTest
- fun testSetPrimaryNavigationFragmentOnFragmentWithAManager() {
- val viewModelStore1 = ViewModelStore()
- val fc1 = startupFragmentController(activityRule.activity, null, viewModelStore1)
- val fm1 = fc1.supportFragmentManager
-
- val viewModelStore2 = ViewModelStore()
- val fc2 = startupFragmentController(activityRule.activity, null, viewModelStore2)
- val fm2 = fc2.supportFragmentManager
-
- val fragment1 = Fragment()
-
- fm1.beginTransaction().attach(fragment1).commitNow()
- try {
- fm2.beginTransaction().setPrimaryNavigationFragment(fragment1).commitNow()
- fail("Fragment associated with another" +
- " FragmentManager should throw IllegalStateException")
- } catch (e: IllegalStateException) {
- assertThat(e)
- .hasMessageThat().contains(
- "Cannot setPrimaryNavigation for Fragment attached to " +
- "a different FragmentManager. Fragment " + fragment1.toString() +
- " is already attached to a FragmentManager."
- )
- }
-
- // Bring the state back down to destroyed before we finish the test
- shutdownFragmentController(fc1, viewModelStore1)
- shutdownFragmentController(fc2, viewModelStore2)
- }
-
- @Test
- @UiThreadTest
- fun testDetachFragmentWithManager() {
- val viewModelStore1 = ViewModelStore()
- val fc1 = startupFragmentController(activityRule.activity, null, viewModelStore1)
- val fm1 = fc1.supportFragmentManager
-
- val viewModelStore2 = ViewModelStore()
- val fc2 = startupFragmentController(activityRule.activity, null, viewModelStore2)
- val fm2 = fc2.supportFragmentManager
-
- // Add the initial state
- val fragment1 = StrictFragment()
-
- fm1.beginTransaction().attach(fragment1).commitNow()
-
- try {
- fm2.beginTransaction().detach(fragment1).commitNow()
- fail("Fragment associated with another" +
- " FragmentManager should throw IllegalStateException")
- } catch (e: IllegalStateException) {
- assertThat(e)
- .hasMessageThat().contains(
- "Cannot detach Fragment attached to " +
- "a different FragmentManager. Fragment " + fragment1.toString() +
- " is already attached to a FragmentManager."
- )
- }
-
- // Bring the state back down to destroyed before we finish the test
- shutdownFragmentController(fc1, viewModelStore1)
- shutdownFragmentController(fc2, viewModelStore2)
- }
-
- @Test
- @UiThreadTest
- fun testRemoveFragmentWithManager() {
- val viewModelStore1 = ViewModelStore()
- val fc1 = startupFragmentController(activityRule.activity, null, viewModelStore1)
- val fm1 = fc1.supportFragmentManager
-
- val viewModelStore2 = ViewModelStore()
- val fc2 = startupFragmentController(activityRule.activity, null, viewModelStore2)
- val fm2 = fc2.supportFragmentManager
-
- // Add the initial state
- val fragment1 = StrictFragment()
-
- fm1.beginTransaction().attach(fragment1).commitNow()
-
- try {
- fm2.beginTransaction().remove(fragment1).commitNow()
- fail("Fragment associated with another" +
- " FragmentManager should throw IllegalStateException")
- } catch (e: IllegalStateException) {
- assertThat(e)
- .hasMessageThat().contains(
- "Cannot remove Fragment attached to " +
- "a different FragmentManager. Fragment " + fragment1.toString() +
- " is already attached to a FragmentManager."
- )
- }
-
- // Bring the state back down to destroyed before we finish the test
- shutdownFragmentController(fc1, viewModelStore1)
- shutdownFragmentController(fc2, viewModelStore2)
- }
}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/ChildFragmentStateTest.java b/fragment/src/androidTest/java/androidx/fragment/app/ChildFragmentStateTest.java
new file mode 100644
index 0000000..d5ace4d
--- /dev/null
+++ b/fragment/src/androidTest/java/androidx/fragment/app/ChildFragmentStateTest.java
@@ -0,0 +1,49 @@
+/*
+ * 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.fragment.app;
+
+import static org.junit.Assert.assertTrue;
+
+import androidx.fragment.app.test.FragmentTestActivity;
+import androidx.fragment.app.test.FragmentTestActivity.ParentFragment;
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.rule.ActivityTestRule;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class ChildFragmentStateTest {
+ @Rule
+ public ActivityTestRule<FragmentTestActivity> mActivityRule =
+ new ActivityTestRule<FragmentTestActivity>(FragmentTestActivity.class);
+
+ @Test
+ @UiThreadTest
+ public void testChildFragmentOrdering() throws Throwable {
+ FragmentTestActivity.ParentFragment parent = new ParentFragment();
+ FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+ fm.beginTransaction().add(parent, "parent").commit();
+ fm.executePendingTransactions();
+ assertTrue(parent.wasAttachedInTime);
+ }
+}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/ChildFragmentStateTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/ChildFragmentStateTest.kt
deleted file mode 100644
index de0e5f2..0000000
--- a/fragment/src/androidTest/java/androidx/fragment/app/ChildFragmentStateTest.kt
+++ /dev/null
@@ -1,46 +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.fragment.app
-
-import androidx.fragment.app.test.FragmentTestActivity
-import androidx.fragment.app.test.FragmentTestActivity.ParentFragment
-import androidx.test.annotation.UiThreadTest
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
-import androidx.test.rule.ActivityTestRule
-import com.google.common.truth.Truth.assertThat
-
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@RunWith(AndroidJUnit4::class)
-@LargeTest
-class ChildFragmentStateTest {
- @get:Rule
- var activityRule = ActivityTestRule(FragmentTestActivity::class.java)
-
- @Test
- @UiThreadTest
- fun testChildFragmentOrdering() {
- val parent = ParentFragment()
- val fm = activityRule.activity.supportFragmentManager
- fm.beginTransaction().add(parent, "parent").commit()
- fm.executePendingTransactions()
- assertThat(parent.wasAttachedInTime).isTrue()
- }
-}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentDismissTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentDismissTest.kt
deleted file mode 100644
index f17f8ec..0000000
--- a/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentDismissTest.kt
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright 2019 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.fragment.app
-
-import android.app.AlertDialog
-import android.app.Dialog
-import android.content.DialogInterface
-import android.os.Bundle
-import android.os.Looper
-import androidx.fragment.app.test.EmptyFragmentTestActivity
-import androidx.lifecycle.GenericLifecycleObserver
-import androidx.lifecycle.Lifecycle
-import androidx.test.filters.LargeTest
-import androidx.test.rule.ActivityTestRule
-import com.google.common.truth.Truth.assertWithMessage
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.Parameterized
-import java.util.concurrent.CountDownLatch
-import java.util.concurrent.TimeUnit
-
-/**
- * Class representing the different ways of dismissing a [DialogFragment]
- */
-sealed class Operation {
- abstract fun run(dialogFragment: DialogFragment)
-
- override fun toString(): String = this.javaClass.simpleName
-}
-
-object ActivityFinish : Operation() {
- override fun run(dialogFragment: DialogFragment) {
- dialogFragment.requireActivity().finish()
- }
-}
-
-object FragmentDismiss : Operation() {
- override fun run(dialogFragment: DialogFragment) {
- dialogFragment.dismiss()
- }
-}
-
-object DialogDismiss : Operation() {
- override fun run(dialogFragment: DialogFragment) {
- dialogFragment.requireDialog().dismiss()
- }
-}
-
-object DialogCancel : Operation() {
- override fun run(dialogFragment: DialogFragment) {
- dialogFragment.requireDialog().cancel()
- }
-}
-
-@LargeTest
-@RunWith(Parameterized::class)
-class DialogFragmentDismissTest(
- private val operation: Operation,
- private val mainThread: Boolean
-) {
- companion object {
- @JvmStatic
- @Parameterized.Parameters(name = "operation={0}, mainThread={1}")
- fun data() = mutableListOf<Array<Any>>().apply {
- arrayOf(
- ActivityFinish,
- FragmentDismiss,
- DialogDismiss,
- DialogCancel
- ).forEach { operation ->
- // Run the operation on the main thread
- add(arrayOf(operation, true))
- // Run the operation off the main thread
- add(arrayOf(operation, false))
- }
- }
- }
-
- @get:Rule
- val activityTestRule = ActivityTestRule(EmptyFragmentTestActivity::class.java)
-
- @Test
- fun testDialogFragmentDismiss() {
- val fragment = TestDialogFragment()
- activityTestRule.runOnUiThread {
- fragment.showNow(activityTestRule.activity.supportFragmentManager, null)
- }
-
- assertWithMessage("Dialog was not being shown")
- .that(fragment.dialog?.isShowing)
- .isTrue()
-
- var dialogIsNonNull = false
- var isShowing = false
- var onDismissCalledCount = 0
- val countDownLatch = CountDownLatch(3)
- activityTestRule.runOnUiThread {
- fragment.lifecycle.addObserver(GenericLifecycleObserver { _, event ->
- if (event == Lifecycle.Event.ON_STOP) {
- val dialog = fragment.dialog
- dialogIsNonNull = dialog != null
- isShowing = dialog != null && dialog.isShowing
- countDownLatch.countDown()
- } else if (event == Lifecycle.Event.ON_DESTROY) {
- onDismissCalledCount = fragment.onDismissCalledCount
- countDownLatch.countDown()
- }
- })
- }
- var dismissOnMainThread = false
- var dismissCalled = false
- fragment.dismissCallback = {
- dismissCalled = true
- dismissOnMainThread = Looper.myLooper() == Looper.getMainLooper()
- countDownLatch.countDown()
- }
-
- if (mainThread) {
- activityTestRule.runOnUiThread {
- operation.run(fragment)
- }
- } else {
- operation.run(fragment)
- }
-
- countDownLatch.await(1, TimeUnit.SECONDS)
-
- assertWithMessage("Dialog should be dismissed")
- .that(dismissCalled)
- .isTrue()
- assertWithMessage("Dismiss should always be called on the main thread")
- .that(dismissOnMainThread)
- .isTrue()
- assertWithMessage("onDismiss() should be called before onDestroy()")
- .that(onDismissCalledCount)
- .isEqualTo(1)
- assertWithMessage("Dialog should not be null in onStop()")
- .that(dialogIsNonNull)
- .isTrue()
-
- if (operation is ActivityFinish) {
- assertWithMessage("Dialog should still be showing in onStop() during " +
- "the normal lifecycle")
- .that(isShowing)
- .isTrue()
- } else {
- assertWithMessage("Dialog should not be showing in onStop() when manually dismissed")
- .that(isShowing)
- .isFalse()
-
- assertWithMessage("Dialog should be null after dismiss()")
- .that(fragment.dialog)
- .isNull()
- }
- }
-
- class TestDialogFragment : DialogFragment() {
-
- var onDismissCalledCount = 0
- var dismissCallback: () -> Unit = {}
-
- override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
- return AlertDialog.Builder(context)
- .setTitle("Test")
- .setMessage("Message")
- .setPositiveButton("Button", null)
- .create()
- }
-
- override fun onDismiss(dialog: DialogInterface) {
- super.onDismiss(dialog)
- onDismissCalledCount++
- dismissCallback.invoke()
- }
- }
-}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentTest.java b/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentTest.java
new file mode 100644
index 0000000..916fce5
--- /dev/null
+++ b/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentTest.java
@@ -0,0 +1,248 @@
+/*
+ * 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.fragment.app;
+
+import static com.google.common.truth.Truth.assertWithMessage;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.os.Bundle;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.test.EmptyFragmentTestActivity;
+import androidx.lifecycle.Lifecycle;
+import androidx.lifecycle.LifecycleObserver;
+import androidx.lifecycle.OnLifecycleEvent;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.MediumTest;
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.rule.ActivityTestRule;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+@MediumTest
+@RunWith(AndroidJUnit4.class)
+public class DialogFragmentTest {
+ @Rule
+ public final ActivityTestRule<EmptyFragmentTestActivity> mActivityTestRule =
+ new ActivityTestRule<>(EmptyFragmentTestActivity.class);
+
+ @Test
+ public void testDialogFragmentShows() {
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ TestDialogFragment fragment = new TestDialogFragment();
+ fragment.show(mActivityTestRule.getActivity().getSupportFragmentManager(), null);
+
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertNotNull("Dialog was null", fragment.getDialog());
+ assertTrue("Dialog was not being shown", fragment.getDialog().isShowing());
+ }
+
+ @Test
+ public void testDialogFragmentShowsNow() throws Throwable {
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ final TestDialogFragment fragment = new TestDialogFragment();
+ mActivityTestRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ fragment.showNow(mActivityTestRule.getActivity().getSupportFragmentManager(),
+ null);
+ }
+ });
+
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertNotNull("Dialog was null", fragment.getDialog());
+ assertTrue("Dialog was not being shown", fragment.getDialog().isShowing());
+
+ final boolean[] dialogIsNonNull = new boolean[1];
+ final boolean[] isShowing = new boolean[1];
+ final boolean[] onDismissCalled = new boolean[1];
+ final CountDownLatch countDownLatch = new CountDownLatch(2);
+ mActivityTestRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ fragment.getLifecycle().addObserver(new LifecycleObserver() {
+ @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
+ public void onStop() {
+ Dialog dialog = fragment.getDialog();
+ dialogIsNonNull[0] = dialog != null;
+ isShowing[0] = dialog != null && dialog.isShowing();
+ countDownLatch.countDown();
+ }
+
+ @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
+ public void onDestroy() {
+ onDismissCalled[0] = fragment.onDismissCalled;
+ countDownLatch.countDown();
+ }
+ });
+ }
+ });
+
+ mActivityTestRule.finishActivity();
+
+ countDownLatch.await(1, TimeUnit.SECONDS);
+ assertWithMessage("onDismiss() should be called before onDestroy()")
+ .that(onDismissCalled[0])
+ .isTrue();
+ assertTrue("Dialog should not be null in onStop()", dialogIsNonNull[0]);
+ assertTrue("Dialog should still be showing in onStop() "
+ + "during the normal lifecycle", isShowing[0]);
+ }
+
+ @Test
+ public void testDialogFragmentDismiss() throws Throwable {
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ final TestDialogFragment fragment = new TestDialogFragment();
+ fragment.show(mActivityTestRule.getActivity().getSupportFragmentManager(), null);
+
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ assertNotNull("Dialog was null", fragment.getDialog());
+ assertTrue("Dialog was not being shown", fragment.getDialog().isShowing());
+
+ final boolean[] dialogIsNonNull = new boolean[1];
+ final boolean[] isShowing = new boolean[1];
+ final CountDownLatch countDownLatch = new CountDownLatch(1);
+ mActivityTestRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ fragment.getLifecycle().addObserver(new LifecycleObserver() {
+ @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
+ public void onStop() {
+ Dialog dialog = fragment.getDialog();
+ dialogIsNonNull[0] = dialog != null;
+ isShowing[0] = dialog != null && dialog.isShowing();
+ countDownLatch.countDown();
+ }
+ });
+ }
+ });
+
+ final CountDownLatch dismissLatch = new CountDownLatch(1);
+ fragment.setDestroyViewCallback(new TestDialogFragment.OnDestroyViewCallback() {
+ @Override
+ public void onDestroyView(TestDialogFragment fragment) {
+ dismissLatch.countDown();
+ }
+ });
+
+ fragment.dismiss();
+
+ countDownLatch.await(1, TimeUnit.SECONDS);
+
+ assertTrue("Dialog should not be null in onStop()", dialogIsNonNull[0]);
+ assertFalse("Dialog should not be showing in onStop() "
+ + "when manually dismissed", isShowing[0]);
+
+ // Wait for the DialogFragment's onDestroyView to be called which is where the Dialog
+ // gets null'ed out
+ dismissLatch.await();
+
+ assertNull("Dialog should be null after dismiss()", fragment.getDialog());
+ }
+
+ @Test
+ public void testDialogFragmentDismissBeforeOnDestroy() throws Throwable {
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ final TestDialogFragment fragment = new TestDialogFragment();
+ fragment.show(mActivityTestRule.getActivity().getSupportFragmentManager(), null);
+
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+
+ final boolean[] onDismissCalled = new boolean[1];
+ final CountDownLatch countDownLatch = new CountDownLatch(1);
+ mActivityTestRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ fragment.getLifecycle().addObserver(new LifecycleObserver() {
+ @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
+ public void onDestroy() {
+ onDismissCalled[0] = fragment.onDismissCalled;
+ countDownLatch.countDown();
+ }
+ });
+ }
+ });
+
+ fragment.dismiss();
+
+ countDownLatch.await(1, TimeUnit.SECONDS);
+
+ assertWithMessage("onDismiss() should be called before onDestroy()")
+ .that(onDismissCalled[0])
+ .isTrue();
+ }
+
+ public static class TestDialogFragment extends DialogFragment {
+
+ public interface OnDestroyViewCallback {
+ void onDestroyView(TestDialogFragment fragment);
+ }
+
+ public boolean onDismissCalled = false;
+
+ private @Nullable OnDestroyViewCallback mDestroyViewCallback = null;
+
+ public void setDestroyViewCallback(OnDestroyViewCallback callback) {
+ mDestroyViewCallback = callback;
+ }
+
+ @NonNull
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ return new AlertDialog.Builder(getContext())
+ .setTitle("Test")
+ .setMessage("Message")
+ .setPositiveButton("Button", null)
+ .create();
+ }
+
+ @Override
+ public void onDismiss(@NonNull DialogInterface dialog) {
+ super.onDismiss(dialog);
+ onDismissCalled = true;
+ }
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ if (mDestroyViewCallback != null) {
+ mDestroyViewCallback.onDestroyView(this);
+ }
+ }
+ }
+}
+
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentTest.kt
deleted file mode 100644
index ac239f5..0000000
--- a/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentTest.kt
+++ /dev/null
@@ -1,72 +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.fragment.app
-
-import android.app.AlertDialog
-import android.app.Dialog
-import android.os.Bundle
-import androidx.fragment.app.test.EmptyFragmentTestActivity
-import androidx.test.annotation.UiThreadTest
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
-import androidx.test.rule.ActivityTestRule
-import com.google.common.truth.Truth.assertWithMessage
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@LargeTest
-@RunWith(AndroidJUnit4::class)
-class DialogFragmentTest {
- @get:Rule
- val activityTestRule = ActivityTestRule(EmptyFragmentTestActivity::class.java)
-
- @Test
- fun testDialogFragmentShows() {
- val fragment = TestDialogFragment()
- fragment.show(activityTestRule.activity.supportFragmentManager, null)
- activityTestRule.runOnUiThread {
- activityTestRule.activity.supportFragmentManager.executePendingTransactions()
- }
-
- assertWithMessage("Dialog was not being shown")
- .that(fragment.dialog?.isShowing)
- .isTrue()
- }
-
- @UiThreadTest
- @Test
- fun testDialogFragmentShowsNow() {
- val fragment = TestDialogFragment()
- fragment.showNow(activityTestRule.activity.supportFragmentManager, null)
-
- assertWithMessage("Dialog was not being shown")
- .that(fragment.dialog?.isShowing)
- .isTrue()
- }
-
- class TestDialogFragment : DialogFragment() {
-
- override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
- return AlertDialog.Builder(context)
- .setTitle("Test")
- .setMessage("Message")
- .setPositiveButton("Button", null)
- .create()
- }
- }
-}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.java b/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.java
new file mode 100644
index 0000000..e623238
--- /dev/null
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.java
@@ -0,0 +1,670 @@
+/*
+ * 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.fragment.app;
+
+import static androidx.fragment.app.CtsMockitoUtils.within;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+
+import android.app.Instrumentation;
+import android.graphics.Canvas;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.util.Pair;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.view.animation.TranslateAnimation;
+
+import androidx.annotation.AnimRes;
+import androidx.core.view.ViewCompat;
+import androidx.fragment.app.test.FragmentTestActivity;
+import androidx.fragment.test.R;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.MediumTest;
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.rule.ActivityTestRule;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+@MediumTest
+@RunWith(AndroidJUnit4.class)
+public class FragmentAnimationTest {
+ // These are pretend resource IDs for animators. We don't need real ones since we
+ // load them by overriding onCreateAnimator
+ @AnimRes
+ private static final int ENTER = 1;
+ @AnimRes
+ private static final int EXIT = 2;
+ @AnimRes
+ private static final int POP_ENTER = 3;
+ @AnimRes
+ private static final int POP_EXIT = 4;
+
+ @Rule
+ public ActivityTestRule<FragmentTestActivity> mActivityRule =
+ new ActivityTestRule<>(FragmentTestActivity.class);
+
+ private Instrumentation mInstrumentation;
+
+ @Before
+ public void setupContainer() {
+ mInstrumentation = InstrumentationRegistry.getInstrumentation();
+ FragmentTestUtil.setContentView(mActivityRule, R.layout.simple_container);
+ }
+
+ // Ensure that adding and popping a Fragment uses the enter and popExit animators
+ @Test
+ public void addAnimators() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .add(R.id.fragmentContainer, fragment)
+ .addToBackStack(null)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertEnterPopExit(fragment);
+ }
+
+ // Ensure that removing and popping a Fragment uses the exit and popEnter animators
+ @Test
+ public void removeAnimators() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction().add(R.id.fragmentContainer, fragment, "1").commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .remove(fragment)
+ .addToBackStack(null)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertExitPopEnter(fragment);
+ }
+
+ // Ensure that showing and popping a Fragment uses the enter and popExit animators
+ @Test
+ public void showAnimators() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction().add(R.id.fragmentContainer, fragment).hide(fragment).commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .show(fragment)
+ .addToBackStack(null)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertEnterPopExit(fragment);
+ }
+
+ // Ensure that hiding and popping a Fragment uses the exit and popEnter animators
+ @Test
+ public void hideAnimators() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction().add(R.id.fragmentContainer, fragment, "1").commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .hide(fragment)
+ .addToBackStack(null)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertExitPopEnter(fragment);
+ }
+
+ // Ensure that attaching and popping a Fragment uses the enter and popExit animators
+ @Test
+ public void attachAnimators() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction().add(R.id.fragmentContainer, fragment).detach(fragment).commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .attach(fragment)
+ .addToBackStack(null)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertEnterPopExit(fragment);
+ }
+
+ // Ensure that detaching and popping a Fragment uses the exit and popEnter animators
+ @Test
+ public void detachAnimators() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction().add(R.id.fragmentContainer, fragment, "1").commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .detach(fragment)
+ .addToBackStack(null)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertExitPopEnter(fragment);
+ }
+
+ // Replace should exit the existing fragments and enter the added fragment, then
+ // popping should popExit the removed fragment and popEnter the added fragments
+ @Test
+ public void replaceAnimators() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment1 = new AnimatorFragment();
+ final AnimatorFragment fragment2 = new AnimatorFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment1, "1")
+ .add(R.id.fragmentContainer, fragment2, "2")
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ final AnimatorFragment fragment3 = new AnimatorFragment();
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .replace(R.id.fragmentContainer, fragment3)
+ .addToBackStack(null)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertFragmentAnimation(fragment1, 1, false, EXIT);
+ assertFragmentAnimation(fragment2, 1, false, EXIT);
+ assertFragmentAnimation(fragment3, 1, true, ENTER);
+
+ fm.popBackStack();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertFragmentAnimation(fragment3, 2, false, POP_EXIT);
+ final AnimatorFragment replacement1 = (AnimatorFragment) fm.findFragmentByTag("1");
+ final AnimatorFragment replacement2 = (AnimatorFragment) fm.findFragmentByTag("1");
+ int expectedAnimations = replacement1 == fragment1 ? 2 : 1;
+ assertFragmentAnimation(replacement1, expectedAnimations, true, POP_ENTER);
+ assertFragmentAnimation(replacement2, expectedAnimations, true, POP_ENTER);
+ }
+
+ // Ensure that adding and popping a Fragment uses the enter and popExit animators,
+ // but the animators are delayed when an entering Fragment is postponed.
+ @Test
+ public void postponedAddAnimators() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fragment.postponeEnterTransition();
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .add(R.id.fragmentContainer, fragment)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertPostponed(fragment, 0);
+ fragment.startPostponedEnterTransition();
+
+ FragmentTestUtil.waitForExecution(mActivityRule);
+ assertEnterPopExit(fragment);
+ }
+
+ // Ensure that removing and popping a Fragment uses the exit and popEnter animators,
+ // but the animators are delayed when an entering Fragment is postponed.
+ @Test
+ public void postponedRemoveAnimators() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction().add(R.id.fragmentContainer, fragment, "1").commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .remove(fragment)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertExitPostponedPopEnter(fragment);
+ }
+
+ // Ensure that adding and popping a Fragment is postponed in both directions
+ // when the fragments have been marked for postponing.
+ @Test
+ public void postponedAddRemove() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ final AnimatorFragment fragment1 = new AnimatorFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment1)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ final AnimatorFragment fragment2 = new AnimatorFragment();
+ fragment2.postponeEnterTransition();
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .replace(R.id.fragmentContainer, fragment2)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertPostponed(fragment2, 0);
+ assertNotNull(fragment1.getView());
+ assertEquals(View.VISIBLE, fragment1.getView().getVisibility());
+ assertEquals(1f, fragment1.getView().getAlpha(), 0f);
+ assertTrue(ViewCompat.isAttachedToWindow(fragment1.getView()));
+
+ fragment2.startPostponedEnterTransition();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertExitPostponedPopEnter(fragment1);
+ }
+
+ // Popping a postponed transaction should result in no animators
+ @Test
+ public void popPostponed() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ final AnimatorFragment fragment1 = new AnimatorFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment1)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+ assertEquals(0, fragment1.numAnimators);
+
+ final AnimatorFragment fragment2 = new AnimatorFragment();
+ fragment2.postponeEnterTransition();
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .replace(R.id.fragmentContainer, fragment2)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertPostponed(fragment2, 0);
+
+ // Now pop the postponed transaction
+ FragmentTestUtil.popBackStackImmediate(mActivityRule);
+
+ assertNotNull(fragment1.getView());
+ assertEquals(View.VISIBLE, fragment1.getView().getVisibility());
+ assertEquals(1f, fragment1.getView().getAlpha(), 0f);
+ assertTrue(ViewCompat.isAttachedToWindow(fragment1.getView()));
+ assertTrue(fragment1.isAdded());
+
+ assertNull(fragment2.getView());
+ assertFalse(fragment2.isAdded());
+
+ assertEquals(0, fragment1.numAnimators);
+ assertEquals(0, fragment2.numAnimators);
+ assertNull(fragment1.animation);
+ assertNull(fragment2.animation);
+ }
+
+ // Make sure that if the state was saved while a Fragment was animating that its
+ // state is proper after restoring.
+ @Test
+ public void saveWhileAnimatingAway() throws Throwable {
+ waitForAnimationReady();
+ final FragmentController fc1 = FragmentTestUtil.createController(mActivityRule);
+ FragmentTestUtil.resume(mActivityRule, fc1, null);
+
+ final FragmentManager fm1 = fc1.getSupportFragmentManager();
+
+ StrictViewFragment fragment1 = new StrictViewFragment();
+ fragment1.setLayoutId(R.layout.scene1);
+ fm1.beginTransaction()
+ .add(R.id.fragmentContainer, fragment1, "1")
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ StrictViewFragment fragment2 = new StrictViewFragment();
+
+ fm1.beginTransaction()
+ .setCustomAnimations(0, 0, 0, R.anim.long_fade_out)
+ .replace(R.id.fragmentContainer, fragment2, "2")
+ .addToBackStack(null)
+ .commit();
+ mInstrumentation.runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ fm1.executePendingTransactions();
+ }
+ });
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm1.popBackStack();
+
+ mInstrumentation.runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ fm1.executePendingTransactions();
+ }
+ });
+ FragmentTestUtil.waitForExecution(mActivityRule);
+ // Now fragment2 should be animating away
+ assertFalse(fragment2.isAdded());
+ assertEquals(fragment2, fm1.findFragmentByTag("2")); // still exists because it is animating
+
+ Pair<Parcelable, FragmentManagerNonConfig> state =
+ FragmentTestUtil.destroy(mActivityRule, fc1);
+
+ final FragmentController fc2 = FragmentTestUtil.createController(mActivityRule);
+ FragmentTestUtil.resume(mActivityRule, fc2, state);
+
+ final FragmentManager fm2 = fc2.getSupportFragmentManager();
+ Fragment fragment2restored = fm2.findFragmentByTag("2");
+ assertNull(fragment2restored);
+
+ Fragment fragment1restored = fm2.findFragmentByTag("1");
+ assertNotNull(fragment1restored);
+ assertNotNull(fragment1restored.getView());
+ }
+
+ // When an animation is running on a Fragment's View, the view shouldn't be
+ // prevented from being removed. There's no way to directly test this, so we have to
+ // test to see if the animation is still running.
+ @Test
+ public void clearAnimations() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ final StrictViewFragment fragment1 = new StrictViewFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment1)
+ .setReorderingAllowed(true)
+ .addToBackStack(null)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ final View fragmentView = fragment1.requireView();
+
+ final TranslateAnimation xAnimation = new TranslateAnimation(0, 1000, 0, 0);
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ fragmentView.startAnimation(xAnimation);
+ }
+ });
+
+ FragmentTestUtil.waitForExecution(mActivityRule);
+ FragmentTestUtil.popBackStackImmediate(mActivityRule);
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ assertNull(fragmentView.getAnimation());
+ }
+ });
+ }
+
+ // When a view is animated out, is parent should be null after the animation completes
+ @Test
+ public void parentNullAfterAnimation() throws Throwable {
+ waitForAnimationReady();
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ final EndAnimationListenerFragment fragment1 = new EndAnimationListenerFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment1)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ final EndAnimationListenerFragment fragment2 = new EndAnimationListenerFragment();
+
+ fm.beginTransaction()
+ .setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out,
+ android.R.anim.fade_in, android.R.anim.fade_out)
+ .replace(R.id.fragmentContainer, fragment2)
+ .addToBackStack(null)
+ .commit();
+
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertTrue(fragment1.exitLatch.await(1, TimeUnit.SECONDS));
+ assertTrue(fragment2.enterLatch.await(1, TimeUnit.SECONDS));
+
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ assertNotNull(fragment1.view);
+ assertNotNull(fragment2.view);
+ assertNull(fragment1.view.getParent());
+ }
+ });
+
+ // Now pop the transaction
+ FragmentTestUtil.popBackStackImmediate(mActivityRule);
+
+ assertTrue(fragment2.exitLatch.await(1, TimeUnit.SECONDS));
+ assertTrue(fragment1.enterLatch.await(1, TimeUnit.SECONDS));
+
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ assertNull(fragment2.view.getParent());
+ }
+ });
+ }
+
+ private void assertEnterPopExit(AnimatorFragment fragment) throws Throwable {
+ assertFragmentAnimation(fragment, 1, true, ENTER);
+
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+ fm.popBackStack();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertFragmentAnimation(fragment, 2, false, POP_EXIT);
+ }
+
+ private void assertExitPopEnter(AnimatorFragment fragment) throws Throwable {
+ assertFragmentAnimation(fragment, 1, false, EXIT);
+
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+ fm.popBackStack();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ AnimatorFragment replacement = (AnimatorFragment) fm.findFragmentByTag("1");
+
+ boolean isSameFragment = replacement == fragment;
+ int expectedAnimators = isSameFragment ? 2 : 1;
+ assertFragmentAnimation(replacement, expectedAnimators, true, POP_ENTER);
+ }
+
+ private void assertExitPostponedPopEnter(AnimatorFragment fragment) throws Throwable {
+ assertFragmentAnimation(fragment, 1, false, EXIT);
+
+ fragment.postponeEnterTransition();
+ FragmentTestUtil.popBackStackImmediate(mActivityRule);
+
+ assertPostponed(fragment, 1);
+
+ fragment.startPostponedEnterTransition();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+ assertFragmentAnimation(fragment, 2, true, POP_ENTER);
+ }
+
+ private void assertFragmentAnimation(AnimatorFragment fragment, int numAnimators,
+ boolean isEnter, int animatorResourceId) throws InterruptedException {
+ assertEquals(numAnimators, fragment.numAnimators);
+ assertEquals(isEnter, fragment.enter);
+ assertEquals(animatorResourceId, fragment.resourceId);
+ assertNotNull(fragment.animation);
+ assertTrue(FragmentTestUtil.waitForAnimationEnd(1000, fragment.animation));
+ assertTrue(fragment.animation.hasStarted());
+ }
+
+ private void assertPostponed(AnimatorFragment fragment, int expectedAnimators)
+ throws InterruptedException {
+ assertTrue(fragment.mOnCreateViewCalled);
+ assertEquals(View.VISIBLE, fragment.requireView().getVisibility());
+ assertEquals(0f, fragment.requireView().getAlpha(), 0f);
+ assertEquals(expectedAnimators, fragment.numAnimators);
+ }
+
+ // On Lollipop and earlier, animations are not allowed during window transitions
+ private void waitForAnimationReady() throws Throwable {
+ final View[] view = new View[1];
+ final FragmentTestActivity activity = mActivityRule.getActivity();
+ // Add a view to the hierarchy
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ view[0] = spy(new View(activity));
+ ViewGroup content = activity.findViewById(R.id.fragmentContainer);
+ content.addView(view[0]);
+ }
+ });
+
+ // Wait for its draw method to be called so we know that drawing can happen after
+ // the first frame (API 21 didn't allow it during Window transitions)
+ verify(view[0], within(1000)).draw((Canvas) any());
+
+ // Remove the view that we just added
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ ViewGroup content = activity.findViewById(R.id.fragmentContainer);
+ content.removeView(view[0]);
+ }
+ });
+ }
+
+ public static class AnimatorFragment extends StrictViewFragment {
+ public int numAnimators;
+ public Animation animation;
+ public boolean enter;
+ public int resourceId;
+
+ @Override
+ public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) {
+ if (nextAnim == 0) {
+ return null;
+ }
+ this.numAnimators++;
+ this.animation = new TranslateAnimation(-10, 0, 0, 0);
+ this.animation.setDuration(1);
+ this.resourceId = nextAnim;
+ this.enter = enter;
+ return this.animation;
+ }
+ }
+
+ public static class EndAnimationListenerFragment extends StrictViewFragment {
+ public View view;
+ public final CountDownLatch enterLatch = new CountDownLatch(1);
+ public final CountDownLatch exitLatch = new CountDownLatch(1);
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ if (view != null) {
+ return view;
+ }
+ view = super.onCreateView(inflater, container, savedInstanceState);
+ return view;
+ }
+
+ @Override
+ public Animation onCreateAnimation(int transit, final boolean enter, int nextAnim) {
+ if (nextAnim == 0) {
+ return null;
+ }
+ Animation anim = AnimationUtils.loadAnimation(getActivity(), nextAnim);
+ if (anim != null) {
+ anim.setAnimationListener(new Animation.AnimationListener() {
+ @Override
+ public void onAnimationStart(Animation animation) {
+ }
+
+ @Override
+ public void onAnimationEnd(Animation animation) {
+ if (enter) {
+ enterLatch.countDown();
+ } else {
+ exitLatch.countDown();
+ }
+ }
+
+ @Override
+ public void onAnimationRepeat(Animation animation) {
+
+ }
+ });
+ }
+ return anim;
+ }
+ }
+}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.kt
deleted file mode 100644
index e4a3be9..0000000
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimationTest.kt
+++ /dev/null
@@ -1,737 +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.fragment.app
-
-import android.app.Instrumentation
-import android.graphics.Canvas
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.view.animation.Animation
-import android.view.animation.AnimationUtils
-import android.view.animation.TranslateAnimation
-import androidx.annotation.AnimRes
-import androidx.core.view.ViewCompat
-import androidx.fragment.app.CtsMockitoUtils.within
-import androidx.fragment.app.test.FragmentTestActivity
-import androidx.fragment.test.R
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
-import androidx.test.platform.app.InstrumentationRegistry
-import androidx.test.rule.ActivityTestRule
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.ArgumentMatchers
-import org.mockito.Mockito.spy
-import org.mockito.Mockito.verify
-import java.util.concurrent.CountDownLatch
-import java.util.concurrent.TimeUnit
-
-@LargeTest
-@RunWith(AndroidJUnit4::class)
-class FragmentAnimationTest {
-
- @get:Rule
- var activityRule = ActivityTestRule(FragmentTestActivity::class.java)
-
- private lateinit var instrumentation: Instrumentation
-
- @Before
- fun setupContainer() {
- instrumentation = InstrumentationRegistry.getInstrumentation()
- FragmentTestUtil.setContentView(activityRule, R.layout.simple_container)
- }
-
- // Ensure that adding and popping a Fragment uses the enter and popExit animators
- @Test
- fun addAnimators() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment = AnimatorFragment()
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .add(R.id.fragmentContainer, fragment)
- .addToBackStack(null)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertEnterPopExit(fragment)
- }
-
- // Ensure that removing and popping a Fragment uses the exit and popEnter animators
- @Test
- fun removeAnimators() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment = AnimatorFragment()
- fm.beginTransaction().add(R.id.fragmentContainer, fragment, "1").commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .remove(fragment)
- .addToBackStack(null)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertExitPopEnter(fragment)
- }
-
- // Ensure that showing and popping a Fragment uses the enter and popExit animators
- @Test
- fun showAnimators() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment = AnimatorFragment()
- fm.beginTransaction().add(R.id.fragmentContainer, fragment).hide(fragment).commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .show(fragment)
- .addToBackStack(null)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertEnterPopExit(fragment)
- }
-
- // Ensure that hiding and popping a Fragment uses the exit and popEnter animators
- @Test
- fun hideAnimators() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment = AnimatorFragment()
- fm.beginTransaction().add(R.id.fragmentContainer, fragment, "1").commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .hide(fragment)
- .addToBackStack(null)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertExitPopEnter(fragment)
- }
-
- // Ensure that attaching and popping a Fragment uses the enter and popExit animators
- @Test
- fun attachAnimators() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment = AnimatorFragment()
- fm.beginTransaction().add(R.id.fragmentContainer, fragment).detach(fragment).commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .attach(fragment)
- .addToBackStack(null)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertEnterPopExit(fragment)
- }
-
- // Ensure that detaching and popping a Fragment uses the exit and popEnter animators
- @Test
- fun detachAnimators() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment = AnimatorFragment()
- fm.beginTransaction().add(R.id.fragmentContainer, fragment, "1").commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .detach(fragment)
- .addToBackStack(null)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertExitPopEnter(fragment)
- }
-
- // Replace should exit the existing fragments and enter the added fragment, then
- // popping should popExit the removed fragment and popEnter the added fragments
- @Test
- fun replaceAnimators() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment1 = AnimatorFragment()
- val fragment2 = AnimatorFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment1, "1")
- .add(R.id.fragmentContainer, fragment2, "2")
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- val fragment3 = AnimatorFragment()
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .replace(R.id.fragmentContainer, fragment3)
- .addToBackStack(null)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertFragmentAnimation(fragment1, 1, false, EXIT)
- assertFragmentAnimation(fragment2, 1, false, EXIT)
- assertFragmentAnimation(fragment3, 1, true, ENTER)
-
- fm.popBackStack()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertFragmentAnimation(fragment3, 2, false, POP_EXIT)
- val replacement1 = fm.findFragmentByTag("1") as AnimatorFragment?
- val replacement2 = fm.findFragmentByTag("1") as AnimatorFragment?
- val expectedAnimations = if (replacement1 === fragment1) 2 else 1
- assertFragmentAnimation(replacement1!!, expectedAnimations, true, POP_ENTER)
- assertFragmentAnimation(replacement2!!, expectedAnimations, true, POP_ENTER)
- }
-
- // Ensure that adding and popping a Fragment uses the enter and popExit animators,
- // but the animators are delayed when an entering Fragment is postponed.
- @Test
- fun postponedAddAnimators() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment = AnimatorFragment()
- fragment.postponeEnterTransition()
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .add(R.id.fragmentContainer, fragment)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertPostponed(fragment, 0)
- fragment.startPostponedEnterTransition()
-
- FragmentTestUtil.waitForExecution(activityRule)
- assertEnterPopExit(fragment)
- }
-
- // Ensure that removing and popping a Fragment uses the exit and popEnter animators,
- // but the animators are delayed when an entering Fragment is postponed.
- @Test
- fun postponedRemoveAnimators() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment = AnimatorFragment()
- fm.beginTransaction().add(R.id.fragmentContainer, fragment, "1").commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .remove(fragment)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertExitPostponedPopEnter(fragment)
- }
-
- // Ensure that adding and popping a Fragment is postponed in both directions
- // when the fragments have been marked for postponing.
- @Test
- fun postponedAddRemove() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment1 = AnimatorFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment1)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- val fragment2 = AnimatorFragment()
- fragment2.postponeEnterTransition()
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .replace(R.id.fragmentContainer, fragment2)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
-
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertPostponed(fragment2, 0)
- assertThat(fragment1.view).isNotNull()
- assertThat(fragment1.requireView().visibility).isEqualTo(View.VISIBLE)
- assertThat(fragment1.requireView().alpha).isWithin(0f).of(1f)
- assertThat(ViewCompat.isAttachedToWindow(fragment1.requireView())).isTrue()
-
- fragment2.startPostponedEnterTransition()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertExitPostponedPopEnter(fragment1)
- }
-
- // Popping a postponed transaction should result in no animators
- @Test
- fun popPostponed() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment1 = AnimatorFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment1)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
- assertThat(fragment1.numAnimators).isEqualTo(0)
-
- val fragment2 = AnimatorFragment()
- fragment2.postponeEnterTransition()
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .replace(R.id.fragmentContainer, fragment2)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
-
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertPostponed(fragment2, 0)
-
- // Now pop the postponed transaction
- FragmentTestUtil.popBackStackImmediate(activityRule)
-
- assertThat(fragment1.view).isNotNull()
- assertThat(fragment1.requireView().visibility).isEqualTo(View.VISIBLE)
- assertThat(fragment1.requireView().alpha).isWithin(0f).of(1f)
- assertThat(ViewCompat.isAttachedToWindow(fragment1.requireView())).isTrue()
- assertThat(fragment1.isAdded).isTrue()
-
- assertThat(fragment2.view).isNull()
- assertThat(fragment2.isAdded).isFalse()
-
- assertThat(fragment1.numAnimators).isEqualTo(0)
- assertThat(fragment2.numAnimators).isEqualTo(0)
- assertThat(fragment1.animation).isNull()
- assertThat(fragment2.animation).isNull()
- }
-
- // Make sure that if the state was saved while a Fragment was animating that its
- // state is proper after restoring.
- @Test
- fun saveWhileAnimatingAway() {
- waitForAnimationReady()
- val fc1 = FragmentTestUtil.createController(activityRule)
- FragmentTestUtil.resume(activityRule, fc1, null)
-
- val fm1 = fc1.supportFragmentManager
-
- val fragment1 = StrictViewFragment()
- fragment1.setLayoutId(R.layout.scene1)
- fm1.beginTransaction()
- .add(R.id.fragmentContainer, fragment1, "1")
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- val fragment2 = StrictViewFragment()
-
- fm1.beginTransaction()
- .setCustomAnimations(0, 0, 0, R.anim.long_fade_out)
- .replace(R.id.fragmentContainer, fragment2, "2")
- .addToBackStack(null)
- .commit()
- instrumentation.runOnMainSync { fm1.executePendingTransactions() }
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm1.popBackStack()
-
- instrumentation.runOnMainSync { fm1.executePendingTransactions() }
- FragmentTestUtil.waitForExecution(activityRule)
- // Now fragment2 should be animating away
- assertThat(fragment2.isAdded).isFalse()
- // still exists because it is animating
- assertThat(fm1.findFragmentByTag("2")).isEqualTo(fragment2)
-
- val state = FragmentTestUtil.destroy(activityRule, fc1)
-
- val fc2 = FragmentTestUtil.createController(activityRule)
- FragmentTestUtil.resume(activityRule, fc2, state)
-
- val fm2 = fc2.supportFragmentManager
- val fragment2restored = fm2.findFragmentByTag("2")
- assertThat(fragment2restored).isNull()
-
- val fragment1restored = fm2.findFragmentByTag("1")
- assertThat(fragment1restored).isNotNull()
- assertThat(fragment1restored!!.view).isNotNull()
- }
-
- // When an animation is running on a Fragment's View, the view shouldn't be
- // prevented from being removed. There's no way to directly test this, so we have to
- // test to see if the animation is still running.
- @Test
- fun clearAnimations() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment1 = StrictViewFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment1)
- .setReorderingAllowed(true)
- .addToBackStack(null)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- val fragmentView = fragment1.requireView()
-
- val xAnimation = TranslateAnimation(0f, 1000f, 0f, 0f)
- activityRule.runOnUiThread { fragmentView.startAnimation(xAnimation) }
-
- FragmentTestUtil.waitForExecution(activityRule)
- FragmentTestUtil.popBackStackImmediate(activityRule)
- activityRule.runOnUiThread { assertThat(fragmentView.animation).isNull() }
- }
-
- // When a view is animated out, is parent should be null after the animation completes
- @Test
- fun parentNullAfterAnimation() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment1 = AnimationListenerFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment1)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- val fragment2 = AnimationListenerFragment()
-
- fm.beginTransaction()
- .setCustomAnimations(
- android.R.anim.fade_in, android.R.anim.fade_out,
- android.R.anim.fade_in, android.R.anim.fade_out
- )
- .replace(R.id.fragmentContainer, fragment2)
- .addToBackStack(null)
- .commit()
-
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertThat(fragment1.exitLatch.await(1, TimeUnit.SECONDS)).isTrue()
- assertThat(fragment2.enterLatch.await(1, TimeUnit.SECONDS)).isTrue()
-
- activityRule.runOnUiThread {
- assertThat(fragment1.createdView).isNotNull()
- assertThat(fragment2.createdView).isNotNull()
- assertThat(fragment1.createdView.parent).isNull()
- }
-
- // Now pop the transaction
- FragmentTestUtil.popBackStackImmediate(activityRule)
-
- assertThat(fragment2.exitLatch.await(1, TimeUnit.SECONDS)).isTrue()
- assertThat(fragment1.enterLatch.await(1, TimeUnit.SECONDS)).isTrue()
-
- activityRule.runOnUiThread { assertThat(fragment2.createdView.parent).isNull() }
- }
-
- @Test
- fun animationListenersAreCalled() {
- waitForAnimationReady()
- val fm = activityRule.activity.supportFragmentManager
-
- // Add first fragment
- val fragment1 = AnimationListenerFragment()
- fragment1.forceRunOnHwLayer = false
- fragment1.repeat = true
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment1)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- // Replace first fragment with second fragment with a fade in/out animation
- val fragment2 = AnimationListenerFragment()
- fragment2.forceRunOnHwLayer = true
- fragment2.repeat = false
- fm.beginTransaction()
- .setCustomAnimations(
- android.R.anim.fade_in, android.R.anim.fade_out,
- android.R.anim.fade_in, android.R.anim.fade_out
- )
- .replace(R.id.fragmentContainer, fragment2)
- .addToBackStack(null)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- // Wait for animation to finish
- assertThat(fragment1.exitLatch.await(2, TimeUnit.SECONDS)).isTrue()
- assertThat(fragment2.enterLatch.await(2, TimeUnit.SECONDS)).isTrue()
-
- // Check if all animation listener callbacks have been called
- activityRule.runOnUiThread {
- assertThat(fragment1.exitStartCount).isEqualTo(1)
- assertThat(fragment1.exitRepeatCount).isEqualTo(1)
- assertThat(fragment1.exitEndCount).isEqualTo(1)
- assertThat(fragment2.enterStartCount).isEqualTo(1)
- assertThat(fragment2.enterRepeatCount).isEqualTo(0)
- assertThat(fragment2.enterEndCount).isEqualTo(1)
-
- // fragment1 exited, so its enter animation should not have been called
- assertThat(fragment1.enterStartCount).isEqualTo(0)
- assertThat(fragment1.enterRepeatCount).isEqualTo(0)
- assertThat(fragment1.enterEndCount).isEqualTo(0)
- // fragment2 entered, so its exit animation should not have been called
- assertThat(fragment2.exitStartCount).isEqualTo(0)
- assertThat(fragment2.exitRepeatCount).isEqualTo(0)
- assertThat(fragment2.exitEndCount).isEqualTo(0)
- }
- fragment1.resetCounts()
- fragment2.resetCounts()
-
- // Now pop the transaction
- FragmentTestUtil.popBackStackImmediate(activityRule)
-
- assertThat(fragment2.exitLatch.await(2, TimeUnit.SECONDS)).isTrue()
- assertThat(fragment1.enterLatch.await(2, TimeUnit.SECONDS)).isTrue()
-
- activityRule.runOnUiThread {
- assertThat(fragment2.exitStartCount).isEqualTo(1)
- assertThat(fragment2.exitRepeatCount).isEqualTo(0)
- assertThat(fragment2.exitEndCount).isEqualTo(1)
- assertThat(fragment1.enterStartCount).isEqualTo(1)
- assertThat(fragment1.enterRepeatCount).isEqualTo(1)
- assertThat(fragment1.enterEndCount).isEqualTo(1)
-
- // fragment1 entered, so its exit animation should not have been called
- assertThat(fragment1.exitStartCount).isEqualTo(0)
- assertThat(fragment1.exitRepeatCount).isEqualTo(0)
- assertThat(fragment1.exitEndCount).isEqualTo(0)
- // fragment2 exited, so its enter animation should not have been called
- assertThat(fragment2.enterStartCount).isEqualTo(0)
- assertThat(fragment2.enterRepeatCount).isEqualTo(0)
- assertThat(fragment2.enterEndCount).isEqualTo(0)
- }
- }
-
- private fun assertEnterPopExit(fragment: AnimatorFragment) {
- assertFragmentAnimation(fragment, 1, true, ENTER)
-
- val fm = activityRule.activity.supportFragmentManager
- fm.popBackStack()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertFragmentAnimation(fragment, 2, false, POP_EXIT)
- }
-
- private fun assertExitPopEnter(fragment: AnimatorFragment) {
- assertFragmentAnimation(fragment, 1, false, EXIT)
-
- val fm = activityRule.activity.supportFragmentManager
- fm.popBackStack()
- FragmentTestUtil.waitForExecution(activityRule)
-
- val replacement = fm.findFragmentByTag("1") as AnimatorFragment?
-
- val isSameFragment = replacement === fragment
- val expectedAnimators = if (isSameFragment) 2 else 1
- assertFragmentAnimation(replacement!!, expectedAnimators, true, POP_ENTER)
- }
-
- private fun assertExitPostponedPopEnter(fragment: AnimatorFragment) {
- assertFragmentAnimation(fragment, 1, false, EXIT)
-
- fragment.postponeEnterTransition()
- FragmentTestUtil.popBackStackImmediate(activityRule)
-
- assertPostponed(fragment, 1)
-
- fragment.startPostponedEnterTransition()
- FragmentTestUtil.waitForExecution(activityRule)
- assertFragmentAnimation(fragment, 2, true, POP_ENTER)
- }
-
- @Throws(InterruptedException::class)
- private fun assertFragmentAnimation(
- fragment: AnimatorFragment,
- numAnimators: Int,
- isEnter: Boolean,
- animatorResourceId: Int
- ) {
- assertThat(fragment.numAnimators).isEqualTo(numAnimators)
- assertThat(fragment.enter).isEqualTo(isEnter)
- assertThat(fragment.resourceId).isEqualTo(animatorResourceId)
- assertThat(fragment.animation).isNotNull()
- assertThat(FragmentTestUtil.waitForAnimationEnd(1000, fragment.animation)).isTrue()
- assertThat(fragment.animation?.hasStarted()!!).isTrue()
- }
-
- @Throws(InterruptedException::class)
- private fun assertPostponed(fragment: AnimatorFragment, expectedAnimators: Int) {
- assertThat(fragment.mOnCreateViewCalled).isTrue()
- assertThat(fragment.requireView().visibility).isEqualTo(View.VISIBLE)
- assertThat(fragment.requireView().alpha).isWithin(0f).of(0f)
- assertThat(fragment.numAnimators).isEqualTo(expectedAnimators)
- }
-
- // On Lollipop and earlier, animations are not allowed during window transitions
- private fun waitForAnimationReady() {
- val view = arrayOfNulls<View>(1)
- val activity = activityRule.activity
- // Add a view to the hierarchy
- activityRule.runOnUiThread {
- view[0] = spy(View(activity))
- val content = activity.findViewById<ViewGroup>(R.id.fragmentContainer)
- content.addView(view[0])
- }
-
- // Wait for its draw method to be called so we know that drawing can happen after
- // the first frame (API 21 didn't allow it during Window transitions)
- verify(view[0], within(1000))?.draw(ArgumentMatchers.any() as Canvas?)
-
- // Remove the view that we just added
- activityRule.runOnUiThread {
- val content = activity.findViewById<ViewGroup>(R.id.fragmentContainer)
- content.removeView(view[0])
- }
- }
-
- class AnimatorFragment : StrictViewFragment() {
- var numAnimators: Int = 0
- var animation: Animation? = null
- var enter: Boolean = false
- var resourceId: Int = 0
-
- override fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation? {
- if (nextAnim == 0) {
- return null
- }
- numAnimators++
- animation = TranslateAnimation(-10f, 0f, 0f, 0f)
- (animation as TranslateAnimation).duration = 1
- resourceId = nextAnim
- this.enter = enter
- return animation
- }
- }
-
- class AnimationListenerFragment : StrictViewFragment() {
- lateinit var createdView: View
- var forceRunOnHwLayer: Boolean = false
- var repeat: Boolean = false
- var enterStartCount = 0
- var enterRepeatCount = 0
- var enterEndCount = 0
- var exitStartCount = 0
- var exitRepeatCount = 0
- var exitEndCount = 0
- val enterLatch = CountDownLatch(1)
- val exitLatch = CountDownLatch(1)
-
- fun resetCounts() {
- enterEndCount = 0
- enterRepeatCount = enterEndCount
- enterStartCount = enterRepeatCount
- exitEndCount = 0
- exitRepeatCount = exitEndCount
- exitStartCount = exitRepeatCount
- }
-
- override fun onCreateView(
- inflater: LayoutInflater,
- container: ViewGroup?,
- savedInstanceState: Bundle?
- ) = super.onCreateView(inflater, container, savedInstanceState)?.apply {
- if (forceRunOnHwLayer) {
- // Set any background color on the TextView, so view.hasOverlappingRendering() will
- // return true, which in turn makes FragmentManagerImpl.shouldRunOnHWLayer() return
- // true.
- setBackgroundColor(-0x1)
- }
- createdView = this
- }
-
- override fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation? {
- if (nextAnim == 0) {
- return null
- }
- val anim = AnimationUtils.loadAnimation(activity, nextAnim)
- if (anim != null) {
- if (repeat) {
- anim.repeatCount = 1
- }
- anim.setAnimationListener(object : Animation.AnimationListener {
- override fun onAnimationStart(animation: Animation) {
- if (enter) {
- enterStartCount++
- } else {
- exitStartCount++
- }
- }
-
- override fun onAnimationEnd(animation: Animation) {
- if (enter) {
- enterEndCount++
- enterLatch.countDown()
- } else {
- exitEndCount++
- // When exiting, the view is detached after onAnimationEnd,
- // so wait one frame to count down the latch
- createdView.post { exitLatch.countDown() }
- }
- }
-
- override fun onAnimationRepeat(animation: Animation) {
- if (enter) {
- enterRepeatCount++
- } else {
- exitRepeatCount++
- }
- }
- })
- }
- return anim
- }
- }
-
- companion object {
- // These are pretend resource IDs for animators. We don't need real ones since we
- // load them by overriding onCreateAnimator
- @AnimRes
- private val ENTER = 1
- @AnimRes
- private val EXIT = 2
- @AnimRes
- private val POP_ENTER = 3
- @AnimRes
- private val POP_EXIT = 4
- }
-}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimatorTest.java b/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimatorTest.java
new file mode 100644
index 0000000..d01ca55
--- /dev/null
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimatorTest.java
@@ -0,0 +1,588 @@
+/*
+ * 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.fragment.app;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ValueAnimator;
+import android.os.Build;
+import android.os.Parcelable;
+import android.util.Pair;
+import android.view.View;
+
+import androidx.annotation.AnimatorRes;
+import androidx.annotation.RequiresApi;
+import androidx.core.view.ViewCompat;
+import androidx.fragment.app.test.FragmentTestActivity;
+import androidx.fragment.test.R;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.MediumTest;
+import androidx.test.rule.ActivityTestRule;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+@MediumTest
+@RunWith(AndroidJUnit4.class)
+public class FragmentAnimatorTest {
+ // These are pretend resource IDs for animators. We don't need real ones since we
+ // load them by overriding onCreateAnimator
+ @AnimatorRes
+ private static final int ENTER = 1;
+ @AnimatorRes
+ private static final int EXIT = 2;
+ @AnimatorRes
+ private static final int POP_ENTER = 3;
+ @AnimatorRes
+ private static final int POP_EXIT = 4;
+
+ @Rule
+ public ActivityTestRule<FragmentTestActivity> mActivityRule =
+ new ActivityTestRule<FragmentTestActivity>(FragmentTestActivity.class);
+
+ @Before
+ public void setupContainer() {
+ FragmentTestUtil.setContentView(mActivityRule, R.layout.simple_container);
+ }
+
+ // Ensure that adding and popping a Fragment uses the enter and popExit animators
+ @Test
+ public void addAnimators() throws Throwable {
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .add(R.id.fragmentContainer, fragment)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertEnterPopExit(fragment);
+ }
+
+ // Ensure that removing and popping a Fragment uses the exit and popEnter animators
+ @Test
+ public void removeAnimators() throws Throwable {
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment, "1")
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .remove(fragment)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertExitPopEnter(fragment);
+ }
+
+ // Ensure that showing and popping a Fragment uses the enter and popExit animators
+ // This tests reordered transactions
+ @Test
+ public void showAnimatorsReordered() throws Throwable {
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction().add(R.id.fragmentContainer, fragment).hide(fragment).commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ assertEquals(View.GONE, fragment.requireView().getVisibility());
+
+ }
+ });
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .show(fragment)
+ .addToBackStack(null)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ assertEquals(View.VISIBLE, fragment.requireView().getVisibility());
+ }
+ });
+
+ assertEnterPopExit(fragment);
+
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ assertEquals(View.GONE, fragment.requireView().getVisibility());
+ }
+ });
+ }
+
+ // Ensure that showing and popping a Fragment uses the enter and popExit animators
+ // This tests ordered transactions
+ @Test
+ public void showAnimatorsOrdered() throws Throwable {
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment)
+ .hide(fragment)
+ .setReorderingAllowed(false)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ assertEquals(View.GONE, fragment.requireView().getVisibility());
+
+ }
+ });
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .show(fragment)
+ .setReorderingAllowed(false)
+ .addToBackStack(null)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ assertEquals(View.VISIBLE, fragment.requireView().getVisibility());
+ }
+ });
+
+ assertEnterPopExit(fragment);
+
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ assertEquals(View.GONE, fragment.requireView().getVisibility());
+ }
+ });
+ }
+
+ // Ensure that hiding and popping a Fragment uses the exit and popEnter animators
+ @Test
+ public void hideAnimators() throws Throwable {
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment, "1")
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .hide(fragment)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertExitPopEnter(fragment);
+ }
+
+ // Ensure that attaching and popping a Fragment uses the enter and popExit animators
+ @Test
+ public void attachAnimators() throws Throwable {
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment)
+ .detach(fragment)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .attach(fragment)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertEnterPopExit(fragment);
+ }
+
+ // Ensure that detaching and popping a Fragment uses the exit and popEnter animators
+ @Test
+ public void detachAnimators() throws Throwable {
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment, "1")
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .detach(fragment)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertExitPopEnter(fragment);
+ }
+
+ // Replace should exit the existing fragments and enter the added fragment, then
+ // popping should popExit the removed fragment and popEnter the added fragments
+ @Test
+ public void replaceAnimators() throws Throwable {
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ // One fragment with a view
+ final AnimatorFragment fragment1 = new AnimatorFragment();
+ final AnimatorFragment fragment2 = new AnimatorFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment1, "1")
+ .add(R.id.fragmentContainer, fragment2, "2")
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ final AnimatorFragment fragment3 = new AnimatorFragment();
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .replace(R.id.fragmentContainer, fragment3)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertFragmentAnimation(fragment1, 1, false, EXIT);
+ assertFragmentAnimation(fragment2, 1, false, EXIT);
+ assertFragmentAnimation(fragment3, 1, true, ENTER);
+
+ fm.popBackStack();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertFragmentAnimation(fragment3, 2, false, POP_EXIT);
+ final AnimatorFragment replacement1 = (AnimatorFragment) fm.findFragmentByTag("1");
+ final AnimatorFragment replacement2 = (AnimatorFragment) fm.findFragmentByTag("1");
+ int expectedAnimations = replacement1 == fragment1 ? 2 : 1;
+ assertFragmentAnimation(replacement1, expectedAnimations, true, POP_ENTER);
+ assertFragmentAnimation(replacement2, expectedAnimations, true, POP_ENTER);
+ }
+
+ // Ensure that adding and popping a Fragment uses the enter and popExit animators,
+ // but the animators are delayed when an entering Fragment is postponed.
+ @Test
+ public void postponedAddAnimators() throws Throwable {
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fragment.postponeEnterTransition();
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .add(R.id.fragmentContainer, fragment)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertPostponed(fragment, 0);
+ fragment.startPostponedEnterTransition();
+
+ FragmentTestUtil.waitForExecution(mActivityRule);
+ assertEnterPopExit(fragment);
+ }
+
+ // Ensure that removing and popping a Fragment uses the exit and popEnter animators,
+ // but the animators are delayed when an entering Fragment is postponed.
+ @RequiresApi(Build.VERSION_CODES.JELLY_BEAN)
+ @Test
+ public void postponedRemoveAnimators() throws Throwable {
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ final AnimatorFragment fragment = new AnimatorFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment, "1")
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .remove(fragment)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertExitPostponedPopEnter(fragment);
+ }
+
+ // Ensure that adding and popping a Fragment is postponed in both directions
+ // when the fragments have been marked for postponing.
+ @Test
+ public void postponedAddRemove() throws Throwable {
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ final AnimatorFragment fragment1 = new AnimatorFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment1)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ final AnimatorFragment fragment2 = new AnimatorFragment();
+ fragment2.postponeEnterTransition();
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .replace(R.id.fragmentContainer, fragment2)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertPostponed(fragment2, 0);
+ assertNotNull(fragment1.getView());
+ assertEquals(View.VISIBLE, fragment1.getView().getVisibility());
+ assertEquals(1f, fragment1.getView().getAlpha(), 0f);
+ assertTrue(ViewCompat.isAttachedToWindow(fragment1.getView()));
+
+ fragment2.startPostponedEnterTransition();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertExitPostponedPopEnter(fragment1);
+ }
+
+ // Popping a postponed transaction should result in no animators
+ @Test
+ public void popPostponed() throws Throwable {
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+
+ final AnimatorFragment fragment1 = new AnimatorFragment();
+ fm.beginTransaction()
+ .add(R.id.fragmentContainer, fragment1)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+ assertEquals(0, fragment1.numAnimators);
+
+ final AnimatorFragment fragment2 = new AnimatorFragment();
+ fragment2.postponeEnterTransition();
+
+ fm.beginTransaction()
+ .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
+ .replace(R.id.fragmentContainer, fragment2)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertPostponed(fragment2, 0);
+
+ // Now pop the postponed transaction
+ FragmentTestUtil.popBackStackImmediate(mActivityRule);
+
+ assertNotNull(fragment1.getView());
+ assertEquals(1f, fragment1.getView().getAlpha(), 0f);
+ assertTrue(ViewCompat.isAttachedToWindow(fragment1.getView()));
+ assertTrue(fragment1.isAdded());
+
+ assertNull(fragment2.getView());
+ assertFalse(fragment2.isAdded());
+
+ assertEquals(0, fragment1.numAnimators);
+ assertEquals(0, fragment2.numAnimators);
+ assertNull(fragment1.animator);
+ assertNull(fragment2.animator);
+ }
+
+ // Make sure that if the state was saved while a Fragment was animating that its
+ // state is proper after restoring.
+ @Test
+ public void saveWhileAnimatingAway() throws Throwable {
+ final FragmentController fc1 = FragmentTestUtil.createController(mActivityRule);
+ FragmentTestUtil.resume(mActivityRule, fc1, null);
+
+ final FragmentManager fm1 = fc1.getSupportFragmentManager();
+
+ StrictViewFragment fragment1 = new StrictViewFragment();
+ fragment1.setLayoutId(R.layout.scene1);
+ fm1.beginTransaction()
+ .add(R.id.fragmentContainer, fragment1, "1")
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ StrictViewFragment fragment2 = new StrictViewFragment();
+
+ fm1.beginTransaction()
+ .setCustomAnimations(0, 0, 0, R.animator.slow_fade_out)
+ .replace(R.id.fragmentContainer, fragment2, "2")
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .commit();
+ FragmentTestUtil.executePendingTransactions(mActivityRule, fm1);
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ fm1.popBackStack();
+
+ FragmentTestUtil.executePendingTransactions(mActivityRule, fm1);
+ FragmentTestUtil.waitForExecution(mActivityRule);
+ // Now fragment2 should be animating away
+ assertFalse(fragment2.isAdded());
+ assertEquals(fragment2, fm1.findFragmentByTag("2")); // still exists because it is animating
+
+ Pair<Parcelable, FragmentManagerNonConfig> state =
+ FragmentTestUtil.destroy(mActivityRule, fc1);
+
+ final FragmentController fc2 = FragmentTestUtil.createController(mActivityRule);
+ FragmentTestUtil.resume(mActivityRule, fc2, state);
+
+ final FragmentManager fm2 = fc2.getSupportFragmentManager();
+ Fragment fragment2restored = fm2.findFragmentByTag("2");
+ assertNull(fragment2restored);
+
+ Fragment fragment1restored = fm2.findFragmentByTag("1");
+ assertNotNull(fragment1restored);
+ assertNotNull(fragment1restored.getView());
+ }
+
+ private void assertEnterPopExit(AnimatorFragment fragment) throws Throwable {
+ assertFragmentAnimation(fragment, 1, true, ENTER);
+
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+ fm.popBackStack();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ assertFragmentAnimation(fragment, 2, false, POP_EXIT);
+ }
+
+ private void assertExitPopEnter(AnimatorFragment fragment) throws Throwable {
+ assertFragmentAnimation(fragment, 1, false, EXIT);
+
+ final FragmentManager fm = mActivityRule.getActivity().getSupportFragmentManager();
+ fm.popBackStack();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+
+ AnimatorFragment replacement = (AnimatorFragment) fm.findFragmentByTag("1");
+
+ boolean isSameFragment = replacement == fragment;
+ int expectedAnimators = isSameFragment ? 2 : 1;
+ assertFragmentAnimation(replacement, expectedAnimators, true, POP_ENTER);
+ }
+
+ private void assertExitPostponedPopEnter(AnimatorFragment fragment) throws Throwable {
+ assertFragmentAnimation(fragment, 1, false, EXIT);
+
+ fragment.postponeEnterTransition();
+ FragmentTestUtil.popBackStackImmediate(mActivityRule);
+
+ assertPostponed(fragment, 1);
+
+ fragment.startPostponedEnterTransition();
+ FragmentTestUtil.waitForExecution(mActivityRule);
+ assertFragmentAnimation(fragment, 2, true, POP_ENTER);
+ }
+
+ private void assertFragmentAnimation(AnimatorFragment fragment, int numAnimators,
+ boolean isEnter, int animatorResourceId) throws InterruptedException {
+ assertEquals(numAnimators, fragment.numAnimators);
+ assertEquals(isEnter, fragment.enter);
+ assertEquals(animatorResourceId, fragment.resourceId);
+ assertNotNull(fragment.animator);
+ assertTrue(fragment.wasStarted);
+ assertTrue(fragment.endLatch.await(200, TimeUnit.MILLISECONDS));
+ }
+
+ private void assertPostponed(AnimatorFragment fragment, int expectedAnimators)
+ throws InterruptedException {
+ assertTrue(fragment.mOnCreateViewCalled);
+ assertEquals(View.VISIBLE, fragment.requireView().getVisibility());
+ assertEquals(0f, fragment.requireView().getAlpha(), 0f);
+ assertEquals(expectedAnimators, fragment.numAnimators);
+ }
+
+ public static class AnimatorFragment extends StrictViewFragment {
+ public int numAnimators;
+ public Animator animator;
+ public boolean enter;
+ public int resourceId;
+ public boolean wasStarted;
+ public CountDownLatch endLatch;
+
+ @Override
+ public Animator onCreateAnimator(int transit, boolean enter, int nextAnim) {
+ if (nextAnim == 0) {
+ return null;
+ }
+ this.numAnimators++;
+ this.wasStarted = false;
+ this.animator = ValueAnimator.ofFloat(0, 1).setDuration(1);
+ this.endLatch = new CountDownLatch(1);
+ this.animator.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ wasStarted = true;
+ }
+
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ endLatch.countDown();
+ }
+ });
+ this.resourceId = nextAnim;
+ this.enter = enter;
+ return this.animator;
+ }
+ }
+}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimatorTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimatorTest.kt
deleted file mode 100644
index b96e10b..0000000
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentAnimatorTest.kt
+++ /dev/null
@@ -1,566 +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.fragment.app
-
-import android.animation.Animator
-import android.animation.AnimatorListenerAdapter
-import android.animation.ValueAnimator
-import android.os.Build
-import android.view.View
-import androidx.annotation.AnimatorRes
-import androidx.annotation.RequiresApi
-import androidx.core.view.ViewCompat
-import androidx.fragment.app.test.FragmentTestActivity
-import androidx.fragment.test.R
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import androidx.test.rule.ActivityTestRule
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import java.util.concurrent.CountDownLatch
-import java.util.concurrent.TimeUnit
-
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class FragmentAnimatorTest {
-
- @get:Rule
- var activityRule = ActivityTestRule(FragmentTestActivity::class.java)
-
- @Before
- fun setupContainer() {
- FragmentTestUtil.setContentView(activityRule, R.layout.simple_container)
- }
-
- // Ensure that adding and popping a Fragment uses the enter and popExit animators
- @Test
- fun addAnimators() {
- val fm = activityRule.activity.supportFragmentManager
-
- // One fragment with a view
- val fragment = AnimatorFragment()
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .add(R.id.fragmentContainer, fragment)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertEnterPopExit(fragment)
- }
-
- // Ensure that removing and popping a Fragment uses the exit and popEnter animators
- @Test
- fun removeAnimators() {
- val fm = activityRule.activity.supportFragmentManager
-
- // One fragment with a view
- val fragment = AnimatorFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment, "1")
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .remove(fragment)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertExitPopEnter(fragment)
- }
-
- // Ensure that showing and popping a Fragment uses the enter and popExit animators
- // This tests reordered transactions
- @Test
- fun showAnimatorsReordered() {
- val fm = activityRule.activity.supportFragmentManager
-
- // One fragment with a view
- val fragment = AnimatorFragment()
- fm.beginTransaction().add(R.id.fragmentContainer, fragment).hide(fragment).commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- activityRule.runOnUiThread {
- assertThat(fragment.requireView().visibility).isEqualTo(View.GONE)
- }
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .show(fragment)
- .addToBackStack(null)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- activityRule.runOnUiThread {
- assertThat(fragment.requireView().visibility).isEqualTo(View.VISIBLE)
- }
-
- assertEnterPopExit(fragment)
-
- activityRule.runOnUiThread {
- assertThat(fragment.requireView().visibility).isEqualTo(View.GONE)
- }
- }
-
- // Ensure that showing and popping a Fragment uses the enter and popExit animators
- // This tests ordered transactions
- @Test
- fun showAnimatorsOrdered() {
- val fm = activityRule.activity.supportFragmentManager
-
- // One fragment with a view
- val fragment = AnimatorFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment)
- .hide(fragment)
- .setReorderingAllowed(false)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- activityRule.runOnUiThread {
- assertThat(fragment.requireView().visibility).isEqualTo(View.GONE)
- }
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .show(fragment)
- .setReorderingAllowed(false)
- .addToBackStack(null)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- activityRule.runOnUiThread {
- assertThat(fragment.requireView().visibility).isEqualTo(View.VISIBLE)
- }
-
- assertEnterPopExit(fragment)
-
- activityRule.runOnUiThread {
- assertThat(fragment.requireView().visibility).isEqualTo(View.GONE)
- }
- }
-
- // Ensure that hiding and popping a Fragment uses the exit and popEnter animators
- @Test
- fun hideAnimators() {
- val fm = activityRule.activity.supportFragmentManager
-
- // One fragment with a view
- val fragment = AnimatorFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment, "1")
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .hide(fragment)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertExitPopEnter(fragment)
- }
-
- // Ensure that attaching and popping a Fragment uses the enter and popExit animators
- @Test
- fun attachAnimators() {
- val fm = activityRule.activity.supportFragmentManager
-
- // One fragment with a view
- val fragment = AnimatorFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment)
- .detach(fragment)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .attach(fragment)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertEnterPopExit(fragment)
- }
-
- // Ensure that detaching and popping a Fragment uses the exit and popEnter animators
- @Test
- fun detachAnimators() {
- val fm = activityRule.activity.supportFragmentManager
-
- // One fragment with a view
- val fragment = AnimatorFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment, "1")
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .detach(fragment)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertExitPopEnter(fragment)
- }
-
- // Replace should exit the existing fragments and enter the added fragment, then
- // popping should popExit the removed fragment and popEnter the added fragments
- @Test
- fun replaceAnimators() {
- val fm = activityRule.activity.supportFragmentManager
-
- // One fragment with a view
- val fragment1 = AnimatorFragment()
- val fragment2 = AnimatorFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment1, "1")
- .add(R.id.fragmentContainer, fragment2, "2")
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- val fragment3 = AnimatorFragment()
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .replace(R.id.fragmentContainer, fragment3)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertFragmentAnimation(fragment1, 1, false, EXIT)
- assertFragmentAnimation(fragment2, 1, false, EXIT)
- assertFragmentAnimation(fragment3, 1, true, ENTER)
-
- fm.popBackStack()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertFragmentAnimation(fragment3, 2, false, POP_EXIT)
- val replacement1 = fm.findFragmentByTag("1") as AnimatorFragment
- val replacement2 = fm.findFragmentByTag("1") as AnimatorFragment
- val expectedAnimations = if (replacement1 === fragment1) 2 else 1
- assertFragmentAnimation(replacement1, expectedAnimations, true, POP_ENTER)
- assertFragmentAnimation(replacement2, expectedAnimations, true, POP_ENTER)
- }
-
- // Ensure that adding and popping a Fragment uses the enter and popExit animators,
- // but the animators are delayed when an entering Fragment is postponed.
- @Test
- fun postponedAddAnimators() {
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment = AnimatorFragment()
- fragment.postponeEnterTransition()
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .add(R.id.fragmentContainer, fragment)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertPostponed(fragment, 0)
- fragment.startPostponedEnterTransition()
-
- FragmentTestUtil.waitForExecution(activityRule)
- assertEnterPopExit(fragment)
- }
-
- // Ensure that removing and popping a Fragment uses the exit and popEnter animators,
- // but the animators are delayed when an entering Fragment is postponed.
- @RequiresApi(Build.VERSION_CODES.JELLY_BEAN)
- @Test
- fun postponedRemoveAnimators() {
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment = AnimatorFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment, "1")
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .remove(fragment)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertExitPostponedPopEnter(fragment)
- }
-
- // Ensure that adding and popping a Fragment is postponed in both directions
- // when the fragments have been marked for postponing.
- @Test
- fun postponedAddRemove() {
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment1 = AnimatorFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment1)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- val fragment2 = AnimatorFragment()
- fragment2.postponeEnterTransition()
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .replace(R.id.fragmentContainer, fragment2)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
-
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertPostponed(fragment2, 0)
- assertThat(fragment1.requireView()).isNotNull()
- assertThat(fragment1.requireView().visibility).isEqualTo(View.VISIBLE)
- assertThat(fragment1.requireView().alpha).isWithin(0f).of(1f)
- assertThat(ViewCompat.isAttachedToWindow(fragment1.requireView())).isTrue()
-
- fragment2.startPostponedEnterTransition()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertExitPostponedPopEnter(fragment1)
- }
-
- // Popping a postponed transaction should result in no animators
- @Test
- fun popPostponed() {
- val fm = activityRule.activity.supportFragmentManager
-
- val fragment1 = AnimatorFragment()
- fm.beginTransaction()
- .add(R.id.fragmentContainer, fragment1)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
- assertThat(fragment1.numAnimators).isEqualTo(0)
-
- val fragment2 = AnimatorFragment()
- fragment2.postponeEnterTransition()
-
- fm.beginTransaction()
- .setCustomAnimations(ENTER, EXIT, POP_ENTER, POP_EXIT)
- .replace(R.id.fragmentContainer, fragment2)
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
-
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertPostponed(fragment2, 0)
-
- // Now pop the postponed transaction
- FragmentTestUtil.popBackStackImmediate(activityRule)
-
- assertThat(fragment1.view).isNotNull()
- assertThat(fragment1.requireView().alpha).isWithin(0f).of(1f)
- assertThat(ViewCompat.isAttachedToWindow(fragment1.requireView())).isTrue()
- assertThat(fragment1.isAdded).isTrue()
-
- assertThat(fragment2.view).isNull()
- assertThat(fragment2.isAdded).isFalse()
-
- assertThat(fragment1.numAnimators).isEqualTo(0)
- assertThat(fragment2.numAnimators).isEqualTo(0)
-
- assertThat(fragment1.initialized).isFalse()
- assertThat(fragment2.initialized).isFalse()
- }
-
- // Make sure that if the state was saved while a Fragment was animating that its
- // state is proper after restoring.
- @Test
- fun saveWhileAnimatingAway() {
- val fc1 = FragmentTestUtil.createController(activityRule)
- FragmentTestUtil.resume(activityRule, fc1, null)
-
- val fm1 = fc1.supportFragmentManager
-
- val fragment1 = StrictViewFragment()
- fragment1.setLayoutId(R.layout.scene1)
- fm1.beginTransaction()
- .add(R.id.fragmentContainer, fragment1, "1")
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.waitForExecution(activityRule)
-
- val fragment2 = StrictViewFragment()
-
- fm1.beginTransaction()
- .setCustomAnimations(0, 0, 0, R.animator.slow_fade_out)
- .replace(R.id.fragmentContainer, fragment2, "2")
- .addToBackStack(null)
- .setReorderingAllowed(true)
- .commit()
- FragmentTestUtil.executePendingTransactions(activityRule, fm1)
- FragmentTestUtil.waitForExecution(activityRule)
-
- fm1.popBackStack()
-
- FragmentTestUtil.executePendingTransactions(activityRule, fm1)
- FragmentTestUtil.waitForExecution(activityRule)
- // Now fragment2 should be animating away
- assertThat(fragment2.isAdded).isFalse()
- assertThat(fm1.findFragmentByTag("2"))
- .isEqualTo(fragment2) // still exists because it is animating
-
- val state = FragmentTestUtil.destroy(activityRule, fc1)
-
- val fc2 = FragmentTestUtil.createController(activityRule)
- FragmentTestUtil.resume(activityRule, fc2, state)
-
- val fm2 = fc2.supportFragmentManager
- val fragment2restored = fm2.findFragmentByTag("2")
- assertThat(fragment2restored).isNull()
-
- val fragment1restored = fm2.findFragmentByTag("1")!!
- assertThat(fragment1restored).isNotNull()
- assertThat(fragment1restored.view).isNotNull()
- }
-
- private fun assertEnterPopExit(fragment: AnimatorFragment) {
- assertFragmentAnimation(fragment, 1, true, ENTER)
-
- val fm = activityRule.activity.supportFragmentManager
- fm.popBackStack()
- FragmentTestUtil.waitForExecution(activityRule)
-
- assertFragmentAnimation(fragment, 2, false, POP_EXIT)
- }
-
- private fun assertExitPopEnter(fragment: AnimatorFragment) {
- assertFragmentAnimation(fragment, 1, false, EXIT)
-
- val fm = activityRule.activity.supportFragmentManager
- fm.popBackStack()
- FragmentTestUtil.waitForExecution(activityRule)
-
- val replacement = fm.findFragmentByTag("1") as AnimatorFragment
-
- val isSameFragment = replacement === fragment
- val expectedAnimators = if (isSameFragment) 2 else 1
- assertFragmentAnimation(replacement, expectedAnimators, true, POP_ENTER)
- }
-
- private fun assertExitPostponedPopEnter(fragment: AnimatorFragment) {
- assertFragmentAnimation(fragment, 1, false, EXIT)
-
- fragment.postponeEnterTransition()
- FragmentTestUtil.popBackStackImmediate(activityRule)
-
- assertPostponed(fragment, 1)
-
- fragment.startPostponedEnterTransition()
- FragmentTestUtil.waitForExecution(activityRule)
- assertFragmentAnimation(fragment, 2, true, POP_ENTER)
- }
-
- private fun assertFragmentAnimation(
- fragment: AnimatorFragment,
- numAnimators: Int,
- isEnter: Boolean,
- animatorResourceId: Int
- ) {
- assertThat(fragment.numAnimators).isEqualTo(numAnimators)
- assertThat(fragment.baseEnter).isEqualTo(isEnter)
- assertThat(fragment.resourceId).isEqualTo(animatorResourceId)
- assertThat(fragment.baseAnimator).isNotNull()
- assertThat(fragment.wasStarted).isTrue()
- assertThat(fragment.endLatch.await(200, TimeUnit.MILLISECONDS)).isTrue()
- }
-
- private fun assertPostponed(fragment: AnimatorFragment, expectedAnimators: Int) {
- assertThat(fragment.mOnCreateViewCalled).isTrue()
- assertThat(fragment.requireView().visibility).isEqualTo(View.VISIBLE)
- assertThat(fragment.requireView().alpha).isWithin(0f).of(0f)
- assertThat(fragment.numAnimators).isEqualTo(expectedAnimators)
- }
-
- class AnimatorFragment : StrictViewFragment() {
- var numAnimators: Int = 0
- lateinit var baseAnimator: Animator
- var baseEnter: Boolean = false
- var resourceId: Int = 0
- var wasStarted: Boolean = false
- lateinit var endLatch: CountDownLatch
- var initialized: Boolean = false
-
- override fun onCreateAnimator(
- transit: Int,
- enter: Boolean,
- nextAnim: Int
- ) = ValueAnimator.ofFloat(0f, 1f).setDuration(1)?.apply {
- if (nextAnim == 0) {
- return null
- }
- addListener(object : AnimatorListenerAdapter() {
- override fun onAnimationStart(animation: Animator) {
- wasStarted = true
- }
-
- override fun onAnimationEnd(animation: Animator) {
- endLatch.countDown()
- }
- })
- numAnimators++
- wasStarted = false
- endLatch = CountDownLatch(1)
- resourceId = nextAnim
- baseEnter = enter
- baseAnimator = this
- initialized = true
- }
- }
-
- companion object {
- // These are pretend resource IDs for animators. We don't need real ones since we
- // load them by overriding onCreateAnimator
- @AnimatorRes
- private val ENTER = 1
- @AnimatorRes
- private val EXIT = 2
- @AnimatorRes
- private val POP_ENTER = 3
- @AnimatorRes
- private val POP_EXIT = 4
- }
-}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentArchLifecycleTest.java b/fragment/src/androidTest/java/androidx/fragment/app/FragmentArchLifecycleTest.java
new file mode 100644
index 0000000..b4f813f
--- /dev/null
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentArchLifecycleTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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.fragment.app;
+
+import static org.junit.Assert.assertEquals;
+
+import android.os.Bundle;
+
+import androidx.fragment.app.test.EmptyFragmentTestActivity;
+import androidx.lifecycle.Lifecycle;
+import androidx.lifecycle.LifecycleObserver;
+import androidx.lifecycle.OnLifecycleEvent;
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.rule.ActivityTestRule;
+
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class FragmentArchLifecycleTest {
+
+ @Rule
+ public ActivityTestRule<EmptyFragmentTestActivity> mActivityRule =
+ new ActivityTestRule<>(EmptyFragmentTestActivity.class);
+
+ @Test
+ @UiThreadTest
+ public void testFragmentAdditionDuringOnStop() {
+ final EmptyFragmentTestActivity activity = mActivityRule.getActivity();
+ final FragmentManager fm = activity.getSupportFragmentManager();
+
+ final Fragment first = new Fragment();
+ final Fragment second = new Fragment();
+ fm.beginTransaction().add(first, "first").commitNow();
+ first.getLifecycle().addObserver(new LifecycleObserver() {
+ @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
+ public void onStop() {
+ fm.beginTransaction().add(second, "second").commitNow();
+ first.getLifecycle().removeObserver(this);
+ }
+ });
+ activity.onSaveInstanceState(new Bundle());
+ assertEquals(Lifecycle.State.CREATED, first.getLifecycle().getCurrentState());
+ assertEquals(Lifecycle.State.CREATED, second.getLifecycle().getCurrentState());
+ Assert.assertEquals(Lifecycle.State.CREATED, activity.getLifecycle().getCurrentState());
+ }
+}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentArchLifecycleTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/FragmentArchLifecycleTest.kt
deleted file mode 100644
index d2c11d2..0000000
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentArchLifecycleTest.kt
+++ /dev/null
@@ -1,61 +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.fragment.app
-
-import android.os.Bundle
-import androidx.fragment.app.test.EmptyFragmentTestActivity
-import androidx.lifecycle.Lifecycle
-import androidx.lifecycle.LifecycleObserver
-import androidx.lifecycle.OnLifecycleEvent
-import androidx.test.annotation.UiThreadTest
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
-import androidx.test.rule.ActivityTestRule
-import com.google.common.truth.Truth.assertThat
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@RunWith(AndroidJUnit4::class)
-@LargeTest
-class FragmentArchLifecycleTest {
-
- @get:Rule
- val activityRule = ActivityTestRule(EmptyFragmentTestActivity::class.java)
-
- @Test
- @UiThreadTest
- fun testFragmentAdditionDuringOnStop() {
- val activity = activityRule.activity
- val fm = activity.supportFragmentManager
-
- val first = Fragment()
- val second = Fragment()
- fm.beginTransaction().add(first, "first").commitNow()
- first.lifecycle.addObserver(object : LifecycleObserver {
- @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
- fun onStop() {
- fm.beginTransaction().add(second, "second").commitNow()
- first.lifecycle.removeObserver(this)
- }
- })
- activity.onSaveInstanceState(Bundle())
- assertThat(first.lifecycle.currentState).isEqualTo(Lifecycle.State.CREATED)
- assertThat(second.lifecycle.currentState).isEqualTo(Lifecycle.State.CREATED)
- assertThat(activity.lifecycle.currentState).isEqualTo(Lifecycle.State.CREATED)
- }
-}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentFactoryTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/FragmentFactoryTest.kt
index f885d53..3f2e474 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentFactoryTest.kt
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentFactoryTest.kt
@@ -22,7 +22,7 @@
import androidx.fragment.test.R
import androidx.test.annotation.UiThreadTest
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import androidx.test.rule.ActivityTestRule
import org.junit.Assert.assertEquals
import org.junit.Before
@@ -31,7 +31,7 @@
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
-@LargeTest
+@SmallTest
class FragmentFactoryTest {
@get:Rule
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentLifecycleTest.java b/fragment/src/androidTest/java/androidx/fragment/app/FragmentLifecycleTest.java
index a52ef71..fb260b2 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentLifecycleTest.java
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentLifecycleTest.java
@@ -17,11 +17,6 @@
package androidx.fragment.app;
-import static androidx.fragment.app.FragmentTestUtil.HostCallbacks;
-import static androidx.fragment.app.FragmentTestUtil.restartFragmentController;
-import static androidx.fragment.app.FragmentTestUtil.shutdownFragmentController;
-import static androidx.fragment.app.FragmentTestUtil.startupFragmentController;
-
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
@@ -49,17 +44,20 @@
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
+import android.view.Window;
import android.widget.TextView;
import androidx.annotation.ContentView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.core.app.ActivityCompat;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.test.EmptyFragmentTestActivity;
import androidx.fragment.app.test.FragmentTestActivity;
import androidx.fragment.test.R;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.ViewModelStore;
+import androidx.lifecycle.ViewModelStoreOwner;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
@@ -72,6 +70,8 @@
import org.junit.Test;
import org.junit.runner.RunWith;
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
import java.util.concurrent.TimeUnit;
@RunWith(AndroidJUnit4.class)
@@ -343,8 +343,7 @@
public void testSavedInstanceStateAfterRestore() {
final ViewModelStore viewModelStore = new ViewModelStore();
- final FragmentController fc1 =
- startupFragmentController(mActivityRule.getActivity(), null, viewModelStore);
+ final FragmentController fc1 = startupFragmentController(null, viewModelStore);
final FragmentManager fm1 = fc1.getSupportFragmentManager();
// Add the initial state
@@ -370,8 +369,7 @@
fc1.dispatchDestroy();
// Create the new controller and restore state
- final FragmentController fc2 =
- startupFragmentController(mActivityRule.getActivity(), savedState, viewModelStore);
+ final FragmentController fc2 = startupFragmentController(savedState, viewModelStore);
final FragmentManager fm2 = fc2.getSupportFragmentManager();
final StrictFragment restoredParentFragment = (StrictFragment) fm2
@@ -696,8 +694,7 @@
@UiThreadTest
public void saveAnimationState() throws Throwable {
ViewModelStore viewModelStore = new ViewModelStore();
- FragmentController fc = startupFragmentController(mActivityRule.getActivity(), null,
- viewModelStore);
+ FragmentController fc = startupFragmentController(null, viewModelStore);
FragmentManager fm = fc.getSupportFragmentManager();
fm.beginTransaction()
@@ -710,7 +707,7 @@
assertAnimationsMatch(fm, 0, R.anim.fade_out, R.anim.fade_in, R.anim.fade_out);
// Causes save and restore of fragments and back stack
- fc = restartFragmentController(mActivityRule.getActivity(), fc, viewModelStore);
+ fc = restartFragmentController(fc, viewModelStore);
fm = fc.getSupportFragmentManager();
assertAnimationsMatch(fm, 0, R.anim.fade_out, R.anim.fade_in, R.anim.fade_out);
@@ -725,7 +722,7 @@
assertAnimationsMatch(fm, R.anim.fade_in, R.anim.fade_out, 0, 0);
// Causes save and restore of fragments and back stack
- fc = restartFragmentController(mActivityRule.getActivity(), fc, viewModelStore);
+ fc = restartFragmentController(fc, viewModelStore);
fm = fc.getSupportFragmentManager();
assertAnimationsMatch(fm, R.anim.fade_in, R.anim.fade_out, 0, 0);
@@ -844,8 +841,7 @@
@UiThreadTest
public void fragmentDestroyedOnFinish() throws Throwable {
ViewModelStore viewModelStore = new ViewModelStore();
- FragmentController fc = startupFragmentController(mActivityRule.getActivity(), null,
- viewModelStore);
+ FragmentController fc = startupFragmentController(null, viewModelStore);
FragmentManager fm = fc.getSupportFragmentManager();
StrictViewFragment fragmentA = StrictViewFragment.create(R.layout.fragment_a);
@@ -886,7 +882,7 @@
public void run() {
final ViewModelStore viewModelStore = new ViewModelStore();
final FragmentController fc1 = startupFragmentController(
- mActivityRule.getActivity(), null, viewModelStore);
+ null, viewModelStore);
final FragmentManager fm1 = fc1.getSupportFragmentManager();
@@ -928,8 +924,7 @@
// is being restored as the fragment controller state is being brought up.
try {
- startupFragmentController(mActivityRule.getActivity(), savedState,
- viewModelStore);
+ startupFragmentController(savedState, viewModelStore);
fail("Expected IllegalStateException when moving from "
+ StrictFragment.stateToString(fromState) + " to "
@@ -949,15 +944,14 @@
@UiThreadTest
public void noPrematureStateChange() throws Throwable {
ViewModelStore viewModelStore = new ViewModelStore();
- FragmentController fc = startupFragmentController(mActivityRule.getActivity(), null,
- viewModelStore);
+ FragmentController fc = startupFragmentController(null, viewModelStore);
FragmentManager fm = fc.getSupportFragmentManager();
fm.beginTransaction()
.add(new StrictFragment(), "1")
.commitNow();
- fc = restartFragmentController(mActivityRule.getActivity(), fc, viewModelStore);
+ fc = restartFragmentController(fc, viewModelStore);
fm = fc.getSupportFragmentManager();
@@ -977,8 +971,7 @@
@UiThreadTest
public void testIsStateSaved() throws Throwable {
ViewModelStore viewModelStore = new ViewModelStore();
- FragmentController fc = startupFragmentController(mActivityRule.getActivity(), null,
- viewModelStore);
+ FragmentController fc = startupFragmentController(null, viewModelStore);
FragmentManager fm = fc.getSupportFragmentManager();
Fragment f = new StrictFragment();
@@ -1007,8 +1000,7 @@
@UiThreadTest
public void testSetArgumentsLifecycle() throws Throwable {
ViewModelStore viewModelStore = new ViewModelStore();
- FragmentController fc = startupFragmentController(mActivityRule.getActivity(), null,
- viewModelStore);
+ FragmentController fc = startupFragmentController(null, viewModelStore);
FragmentManager fm = fc.getSupportFragmentManager();
Fragment f = new StrictFragment();
@@ -1085,8 +1077,7 @@
fc1.execPendingActions();
// Simulate an activity restart
- final FragmentController fc2 =
- restartFragmentController(mActivityRule.getActivity(), fc1, viewModelStore);
+ final FragmentController fc2 = restartFragmentController(fc1, viewModelStore);
// Bring the state back down to destroyed before we finish the test
shutdownFragmentController(fc2, viewModelStore);
@@ -1125,8 +1116,7 @@
fc1.execPendingActions();
// Simulate an activity restart
- final FragmentController fc2 =
- restartFragmentController(mActivityRule.getActivity(), fc1, viewModelStore);
+ final FragmentController fc2 = restartFragmentController(fc1, viewModelStore);
// Bring the state back down to destroyed before we finish the test
shutdownFragmentController(fc2, viewModelStore);
@@ -1136,8 +1126,7 @@
@UiThreadTest
public void targetFragmentClearedWhenSetToNull() {
ViewModelStore viewModelStore = new ViewModelStore();
- final FragmentController fc =
- startupFragmentController(mActivityRule.getActivity(), null, viewModelStore);
+ final FragmentController fc = startupFragmentController(null, viewModelStore);
final FragmentManager fm = fc.getSupportFragmentManager();
@@ -1180,8 +1169,7 @@
@UiThreadTest
public void targetFragmentOnlyTargetAdded() {
ViewModelStore viewModelStore = new ViewModelStore();
- final FragmentController fc =
- startupFragmentController(mActivityRule.getActivity(), null, viewModelStore);
+ final FragmentController fc = startupFragmentController(null, viewModelStore);
final FragmentManager fm = fc.getSupportFragmentManager();
@@ -1221,8 +1209,7 @@
@UiThreadTest
public void targetFragmentNonRetainedNonRetained() {
ViewModelStore viewModelStore = new ViewModelStore();
- final FragmentController fc =
- startupFragmentController(mActivityRule.getActivity(), null, viewModelStore);
+ final FragmentController fc = startupFragmentController(null, viewModelStore);
final FragmentManager fm = fc.getSupportFragmentManager();
@@ -1263,8 +1250,7 @@
@UiThreadTest
public void targetFragmentRetainedNonRetained() {
ViewModelStore viewModelStore = new ViewModelStore();
- final FragmentController fc =
- startupFragmentController(mActivityRule.getActivity(), null, viewModelStore);
+ final FragmentController fc = startupFragmentController(null, viewModelStore);
final FragmentManager fm = fc.getSupportFragmentManager();
@@ -1306,8 +1292,7 @@
@UiThreadTest
public void targetFragmentNonRetainedRetained() {
ViewModelStore viewModelStore = new ViewModelStore();
- final FragmentController fc =
- startupFragmentController(mActivityRule.getActivity(), null, viewModelStore);
+ final FragmentController fc = startupFragmentController(null, viewModelStore);
final FragmentManager fm = fc.getSupportFragmentManager();
@@ -1345,8 +1330,7 @@
@UiThreadTest
public void targetFragmentRetainedRetained() {
ViewModelStore viewModelStore = new ViewModelStore();
- final FragmentController fc =
- startupFragmentController(mActivityRule.getActivity(), null, viewModelStore);
+ final FragmentController fc = startupFragmentController(null, viewModelStore);
final FragmentManager fm = fc.getSupportFragmentManager();
@@ -1776,6 +1760,38 @@
Assert.assertEquals(popExit, record.mPopExitAnim);
}
+ private FragmentController restartFragmentController(FragmentController fc,
+ ViewModelStore viewModelStore) {
+ Parcelable savedState = shutdownFragmentController(fc, viewModelStore);
+ return startupFragmentController(savedState, viewModelStore);
+ }
+
+ private FragmentController startupFragmentController(Parcelable savedState,
+ ViewModelStore viewModelStore) {
+ final FragmentController fc = FragmentController.createController(
+ new HostCallbacks(mActivityRule.getActivity(), viewModelStore));
+ fc.attachHost(null);
+ fc.restoreSaveState(savedState);
+ fc.dispatchCreate();
+ fc.dispatchActivityCreated();
+ fc.noteStateNotSaved();
+ fc.execPendingActions();
+ fc.dispatchStart();
+ fc.dispatchResume();
+ fc.execPendingActions();
+ return fc;
+ }
+
+ private Parcelable shutdownFragmentController(FragmentController fc,
+ ViewModelStore viewModelStore) {
+ fc.dispatchPause();
+ final Parcelable savedState = fc.saveAllState();
+ fc.dispatchStop();
+ viewModelStore.clear();
+ fc.dispatchDestroy();
+ return savedState;
+ }
+
private void executePendingTransactions(final FragmentManager fm) throws Throwable {
mActivityRule.runOnUiThread(new Runnable() {
@Override
@@ -1886,6 +1902,100 @@
}
}
+ static class HostCallbacks extends FragmentHostCallback<FragmentActivity>
+ implements ViewModelStoreOwner {
+ private final FragmentActivity mActivity;
+ private final ViewModelStore mViewModelStore;
+
+ HostCallbacks(FragmentActivity activity, ViewModelStore viewModelStore) {
+ super(activity);
+ mActivity = activity;
+ mViewModelStore = viewModelStore;
+ }
+
+ @NonNull
+ @Override
+ public ViewModelStore getViewModelStore() {
+ return mViewModelStore;
+ }
+
+ @Override
+ public void onDump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
+ }
+
+ @Override
+ public boolean onShouldSaveFragmentState(Fragment fragment) {
+ return !mActivity.isFinishing();
+ }
+
+ @Override
+ @NonNull
+ public LayoutInflater onGetLayoutInflater() {
+ return mActivity.getLayoutInflater().cloneInContext(mActivity);
+ }
+
+ @Override
+ public FragmentActivity onGetHost() {
+ return mActivity;
+ }
+
+ @Override
+ public void onSupportInvalidateOptionsMenu() {
+ mActivity.supportInvalidateOptionsMenu();
+ }
+
+ @Override
+ public void onStartActivityFromFragment(Fragment fragment, Intent intent, int requestCode) {
+ mActivity.startActivityFromFragment(fragment, intent, requestCode);
+ }
+
+ @Override
+ public void onStartActivityFromFragment(
+ Fragment fragment, Intent intent, int requestCode, @Nullable Bundle options) {
+ mActivity.startActivityFromFragment(fragment, intent, requestCode, options);
+ }
+
+ @Override
+ public void onRequestPermissionsFromFragment(@NonNull Fragment fragment,
+ @NonNull String[] permissions, int requestCode) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean onShouldShowRequestPermissionRationale(@NonNull String permission) {
+ return ActivityCompat.shouldShowRequestPermissionRationale(
+ mActivity, permission);
+ }
+
+ @Override
+ public boolean onHasWindowAnimations() {
+ return mActivity.getWindow() != null;
+ }
+
+ @Override
+ public int onGetWindowAnimations() {
+ final Window w = mActivity.getWindow();
+ return (w == null) ? 0 : w.getAttributes().windowAnimations;
+ }
+
+ @Override
+ public void onAttachFragment(Fragment fragment) {
+ mActivity.onAttachFragment(fragment);
+ }
+
+ @Nullable
+ @Override
+ public View onFindViewById(int id) {
+ return mActivity.findViewById(id);
+ }
+
+ @Override
+ public boolean onHasView() {
+ final Window w = mActivity.getWindow();
+ return (w != null && w.peekDecorView() != null);
+ }
+ }
+
public static class SimpleFragment extends Fragment {
private int mLayoutId;
private static final String LAYOUT_ID = "layoutId";
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentManagerViewModelTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/FragmentManagerViewModelTest.kt
index 1ebbc02..c4fecf0 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentManagerViewModelTest.kt
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentManagerViewModelTest.kt
@@ -18,7 +18,7 @@
import androidx.lifecycle.ViewModelStore
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import org.junit.Before
import org.junit.Test
@@ -26,7 +26,7 @@
import org.mockito.Mockito.mock
@RunWith(AndroidJUnit4::class)
-@LargeTest
+@SmallTest
class FragmentManagerViewModelTest {
private lateinit var viewModel: FragmentManagerViewModel
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentReceiveResultTest.java b/fragment/src/androidTest/java/androidx/fragment/app/FragmentReceiveResultTest.java
new file mode 100644
index 0000000..0d32067
--- /dev/null
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentReceiveResultTest.java
@@ -0,0 +1,203 @@
+/*
+ * 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.fragment.app;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.same;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+
+import android.app.Activity;
+import android.app.PendingIntent;
+import android.content.Intent;
+import android.content.IntentSender;
+
+import androidx.core.app.ActivityCompat;
+import androidx.fragment.app.test.FragmentResultActivity;
+import androidx.fragment.app.test.FragmentTestActivity;
+import androidx.fragment.test.R;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.rule.ActivityTestRule;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Tests for Fragment startActivityForResult and startIntentSenderForResult.
+ */
+@RunWith(AndroidJUnit4.class)
+public class FragmentReceiveResultTest {
+ @Rule
+ public ActivityTestRule<FragmentTestActivity> mActivityRule =
+ new ActivityTestRule<FragmentTestActivity>(FragmentTestActivity.class);
+
+ private FragmentTestActivity mActivity;
+ private TestFragment mFragment;
+
+
+ @Before
+ public void setup() throws Throwable {
+ mActivity = mActivityRule.getActivity();
+ mFragment = attachTestFragment();
+ }
+
+ @Test
+ @SmallTest
+ public void testStartActivityForResultOk() throws Throwable {
+ startActivityForResult(10, Activity.RESULT_OK, "content 10");
+
+ assertTrue("Fragment should receive result", mFragment.mHasResult);
+ assertEquals(10, mFragment.mRequestCode);
+ assertEquals(Activity.RESULT_OK, mFragment.mResultCode);
+ assertEquals("content 10", mFragment.mResultContent);
+ }
+
+ @Test
+ @SmallTest
+ public void testStartActivityForResultCanceled() throws Throwable {
+ startActivityForResult(20, Activity.RESULT_CANCELED, "content 20");
+
+ assertTrue("Fragment should receive result", mFragment.mHasResult);
+ assertEquals(20, mFragment.mRequestCode);
+ assertEquals(Activity.RESULT_CANCELED, mFragment.mResultCode);
+ assertEquals("content 20", mFragment.mResultContent);
+ }
+
+ @Test
+ @SmallTest
+ public void testStartIntentSenderForResultOk() throws Throwable {
+ startIntentSenderForResult(30, Activity.RESULT_OK, "content 30");
+
+ assertTrue("Fragment should receive result", mFragment.mHasResult);
+ assertEquals(30, mFragment.mRequestCode);
+ assertEquals(Activity.RESULT_OK, mFragment.mResultCode);
+ assertEquals("content 30", mFragment.mResultContent);
+ }
+
+ @Test
+ @SmallTest
+ public void testStartIntentSenderForResultCanceled() throws Throwable {
+ startIntentSenderForResult(40, Activity.RESULT_CANCELED, "content 40");
+
+ assertTrue("Fragment should receive result", mFragment.mHasResult);
+ assertEquals(40, mFragment.mRequestCode);
+ assertEquals(Activity.RESULT_CANCELED, mFragment.mResultCode);
+ assertEquals("content 40", mFragment.mResultContent);
+ }
+
+ @Test
+ @SmallTest
+ public void testActivityResult_withDelegate() {
+ ActivityCompat.PermissionCompatDelegate
+ delegate = mock(ActivityCompat.PermissionCompatDelegate.class);
+
+ Intent data = new Intent();
+ ActivityCompat.setPermissionCompatDelegate(delegate);
+
+ mActivityRule.getActivity().onActivityResult(42, 43, data);
+
+ verify(delegate).onActivityResult(same(mActivityRule.getActivity()), eq(42), eq(43),
+ same(data));
+
+ ActivityCompat.setPermissionCompatDelegate(null);
+ mActivityRule.getActivity().onActivityResult(42, 43, data);
+ verifyNoMoreInteractions(delegate);
+ }
+
+ private TestFragment attachTestFragment() throws Throwable {
+ final TestFragment fragment = new TestFragment();
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ mActivity.getSupportFragmentManager().beginTransaction()
+ .add(R.id.content, fragment)
+ .addToBackStack(null)
+ .commitAllowingStateLoss();
+ mActivity.getFragmentManager().executePendingTransactions();
+ }
+ });
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+ return fragment;
+ }
+
+ private void startActivityForResult(final int requestCode, final int resultCode,
+ final String content) throws Throwable {
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ Intent intent = new Intent(mActivity, FragmentResultActivity.class);
+ intent.putExtra(FragmentResultActivity.EXTRA_RESULT_CODE, resultCode);
+ intent.putExtra(FragmentResultActivity.EXTRA_RESULT_CONTENT, content);
+
+ mFragment.startActivityForResult(intent, requestCode);
+ }
+ });
+ assertTrue(mFragment.mResultReceiveLatch.await(1, TimeUnit.SECONDS));
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+ }
+
+ private void startIntentSenderForResult(final int requestCode, final int resultCode,
+ final String content) throws Throwable {
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ Intent intent = new Intent(mActivity, FragmentResultActivity.class);
+ intent.putExtra(FragmentResultActivity.EXTRA_RESULT_CODE, resultCode);
+ intent.putExtra(FragmentResultActivity.EXTRA_RESULT_CONTENT, content);
+
+ PendingIntent pendingIntent = PendingIntent.getActivity(mActivity,
+ requestCode, intent, 0);
+
+ try {
+ mFragment.startIntentSenderForResult(pendingIntent.getIntentSender(),
+ requestCode, null, 0, 0, 0, null);
+ } catch (IntentSender.SendIntentException e) {
+ fail("IntentSender failed");
+ }
+ }
+ });
+ assertTrue(mFragment.mResultReceiveLatch.await(1, TimeUnit.SECONDS));
+ InstrumentationRegistry.getInstrumentation().waitForIdleSync();
+ }
+
+ public static class TestFragment extends Fragment {
+ boolean mHasResult = false;
+ int mRequestCode = -1;
+ int mResultCode = 100;
+ String mResultContent;
+ final CountDownLatch mResultReceiveLatch = new CountDownLatch(1);
+
+ @Override
+ public void onActivityResult(int requestCode, int resultCode, Intent data) {
+ mHasResult = true;
+ mRequestCode = requestCode;
+ mResultCode = resultCode;
+ mResultContent = data.getStringExtra(FragmentResultActivity.EXTRA_RESULT_CONTENT);
+ mResultReceiveLatch.countDown();
+ }
+ }
+}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentReceiveResultTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/FragmentReceiveResultTest.kt
deleted file mode 100644
index ef03c93..0000000
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentReceiveResultTest.kt
+++ /dev/null
@@ -1,191 +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.fragment.app
-
-import android.app.Activity
-import android.app.PendingIntent
-import android.content.Intent
-import android.content.IntentSender
-import androidx.core.app.ActivityCompat
-import androidx.fragment.app.test.FragmentResultActivity
-import androidx.fragment.app.test.FragmentTestActivity
-import androidx.fragment.test.R
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.MediumTest
-import androidx.test.platform.app.InstrumentationRegistry
-import androidx.test.rule.ActivityTestRule
-import com.google.common.truth.Truth.assertThat
-import com.google.common.truth.Truth.assertWithMessage
-import org.junit.Assert.fail
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.ArgumentMatchers.eq
-import org.mockito.ArgumentMatchers.same
-import org.mockito.Mockito.mock
-import org.mockito.Mockito.verify
-import org.mockito.Mockito.verifyNoMoreInteractions
-import java.util.concurrent.CountDownLatch
-import java.util.concurrent.TimeUnit
-
-/**
- * Tests for Fragment startActivityForResult and startIntentSenderForResult.
- */
-@RunWith(AndroidJUnit4::class)
-@MediumTest
-class FragmentReceiveResultTest {
- @get:Rule
- val activityRule = ActivityTestRule(FragmentTestActivity::class.java)
-
- private lateinit var activity: FragmentTestActivity
- private lateinit var fragment: TestFragment
-
- @Before
- fun setup() {
- activity = activityRule.activity
- fragment = attachTestFragment()
- }
-
- @Test
- fun testStartActivityForResultOk() {
- startActivityForResult(10, Activity.RESULT_OK, "content 10")
-
- assertWithMessage("Fragment should receive result").that(fragment.hasResult).isTrue()
- assertThat(fragment.requestCode).isEqualTo(10)
- assertThat(fragment.resultCode).isEqualTo(Activity.RESULT_OK)
- assertThat(fragment.resultContent).isEqualTo("content 10")
- }
-
- @Test
- fun testStartActivityForResultCanceled() {
- startActivityForResult(20, Activity.RESULT_CANCELED, "content 20")
-
- assertWithMessage("Fragment should receive result").that(fragment.hasResult).isTrue()
- assertThat(fragment.requestCode).isEqualTo(20)
- assertThat(fragment.resultCode).isEqualTo(Activity.RESULT_CANCELED)
- assertThat(fragment.resultContent).isEqualTo("content 20")
- }
-
- @Test
- fun testStartIntentSenderForResultOk() {
- startIntentSenderForResult(30, Activity.RESULT_OK, "content 30")
-
- assertWithMessage("Fragment should receive result").that(fragment.hasResult).isTrue()
- assertThat(fragment.requestCode).isEqualTo(30)
- assertThat(fragment.resultCode).isEqualTo(Activity.RESULT_OK)
- assertThat(fragment.resultContent).isEqualTo("content 30")
- }
-
- @Test
- fun testStartIntentSenderForResultCanceled() {
- startIntentSenderForResult(40, Activity.RESULT_CANCELED, "content 40")
-
- assertWithMessage("Fragment should receive result").that(fragment.hasResult).isTrue()
- assertThat(fragment.requestCode).isEqualTo(40)
- assertThat(fragment.resultCode).isEqualTo(Activity.RESULT_CANCELED)
- assertThat(fragment.resultContent).isEqualTo("content 40")
- }
-
- @Test
- fun testActivityResult_withDelegate() {
- val delegate = mock(ActivityCompat.PermissionCompatDelegate::class.java)
-
- val data = Intent()
- ActivityCompat.setPermissionCompatDelegate(delegate)
-
- activityRule.activity.onActivityResult(42, 43, data)
-
- verify(delegate).onActivityResult(
- same(activityRule.activity), eq(42), eq(43),
- same(data)
- )
-
- ActivityCompat.setPermissionCompatDelegate(null)
- activityRule.activity.onActivityResult(42, 43, data)
- verifyNoMoreInteractions(delegate)
- }
-
- private fun attachTestFragment(): TestFragment {
- val fragment = TestFragment()
- activityRule.runOnUiThread {
- activity.supportFragmentManager.beginTransaction()
- .add(R.id.content, fragment)
- .addToBackStack(null)
- .commitAllowingStateLoss()
- activity.supportFragmentManager.executePendingTransactions()
- }
- InstrumentationRegistry.getInstrumentation().waitForIdleSync()
- return fragment
- }
-
- private fun startActivityForResult(
- requestCode: Int,
- resultCode: Int,
- content: String
- ) {
- activityRule.runOnUiThread {
- val intent = Intent(activity, FragmentResultActivity::class.java)
- intent.putExtra(FragmentResultActivity.EXTRA_RESULT_CODE, resultCode)
- intent.putExtra(FragmentResultActivity.EXTRA_RESULT_CONTENT, content)
-
- fragment.startActivityForResult(intent, requestCode)
- }
- assertThat(fragment.resultReceiveLatch.await(1, TimeUnit.SECONDS)).isTrue()
- InstrumentationRegistry.getInstrumentation().waitForIdleSync()
- }
-
- private fun startIntentSenderForResult(
- requestCode: Int,
- resultCode: Int,
- content: String
- ) {
- activityRule.runOnUiThread {
- val intent = Intent(activity, FragmentResultActivity::class.java)
- intent.putExtra(FragmentResultActivity.EXTRA_RESULT_CODE, resultCode)
- intent.putExtra(FragmentResultActivity.EXTRA_RESULT_CONTENT, content)
-
- val pendingIntent = PendingIntent.getActivity(activity, requestCode, intent, 0)
-
- try {
- fragment.startIntentSenderForResult(
- pendingIntent.intentSender,
- requestCode, null, 0, 0, 0, null
- )
- } catch (e: IntentSender.SendIntentException) {
- fail("IntentSender failed")
- }
- }
- assertThat(fragment.resultReceiveLatch.await(1, TimeUnit.SECONDS)).isTrue()
- InstrumentationRegistry.getInstrumentation().waitForIdleSync()
- }
-
- class TestFragment : Fragment() {
- internal var hasResult = false
- internal var requestCode = -1
- internal var resultCode = 100
- internal lateinit var resultContent: String
- internal val resultReceiveLatch = CountDownLatch(1)
-
- override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
- hasResult = true
- this.requestCode = requestCode
- this.resultCode = resultCode
- resultContent = data!!.getStringExtra(FragmentResultActivity.EXTRA_RESULT_CONTENT)
- resultReceiveLatch.countDown()
- }
- }
-}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentReorderingTest.java b/fragment/src/androidTest/java/androidx/fragment/app/FragmentReorderingTest.java
index 1c47bc8..a2597f9 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentReorderingTest.java
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentReorderingTest.java
@@ -28,7 +28,7 @@
import androidx.fragment.test.R;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -37,7 +37,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class FragmentReorderingTest {
@Rule
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentReplaceTest.java b/fragment/src/androidTest/java/androidx/fragment/app/FragmentReplaceTest.java
new file mode 100644
index 0000000..217f236
--- /dev/null
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentReplaceTest.java
@@ -0,0 +1,120 @@
+/*
+ * 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.fragment.app;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import android.app.Activity;
+import android.app.Fragment;
+import android.app.Instrumentation;
+import android.view.KeyEvent;
+
+import androidx.fragment.app.test.FragmentTestActivity;
+import androidx.fragment.app.test.FragmentTestActivity.TestFragment;
+import androidx.fragment.test.R;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.MediumTest;
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.rule.ActivityTestRule;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Test to prevent regressions in SupportFragmentManager fragment replace method. See b/24693644
+ */
+@RunWith(AndroidJUnit4.class)
+@MediumTest
+public class FragmentReplaceTest {
+ @Rule
+ public ActivityTestRule<FragmentTestActivity> mActivityRule =
+ new ActivityTestRule<FragmentTestActivity>(FragmentTestActivity.class);
+
+ private Instrumentation mInstrumentation;
+
+ @Before
+ public void setUp() {
+ mInstrumentation = InstrumentationRegistry.getInstrumentation();
+ }
+
+ @Test
+ public void testReplaceFragment() throws Throwable {
+ final FragmentActivity activity = mActivityRule.getActivity();
+ final FragmentManager fm = activity.getSupportFragmentManager();
+
+ fm.beginTransaction()
+ .add(R.id.content, TestFragment.create(R.layout.fragment_a))
+ .addToBackStack(null)
+ .commit();
+ executePendingTransactions(fm);
+ assertNotNull(activity.findViewById(R.id.textA));
+ assertNull(activity.findViewById(R.id.textB));
+ assertNull(activity.findViewById(R.id.textC));
+
+
+ fm.beginTransaction()
+ .add(R.id.content, TestFragment.create(R.layout.fragment_b))
+ .addToBackStack(null)
+ .commit();
+ executePendingTransactions(fm);
+ assertNotNull(activity.findViewById(R.id.textA));
+ assertNotNull(activity.findViewById(R.id.textB));
+ assertNull(activity.findViewById(R.id.textC));
+
+ activity.getSupportFragmentManager().beginTransaction()
+ .replace(R.id.content, TestFragment.create(R.layout.fragment_c))
+ .addToBackStack(null)
+ .commit();
+ executePendingTransactions(fm);
+ assertNull(activity.findViewById(R.id.textA));
+ assertNull(activity.findViewById(R.id.textB));
+ assertNotNull(activity.findViewById(R.id.textC));
+ }
+
+ private void executePendingTransactions(final FragmentManager fm) throws Throwable {
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ fm.executePendingTransactions();
+ }
+ });
+ }
+
+ @Test
+ public void testBackPressWithFrameworkFragment() throws Throwable {
+ final Activity activity = mActivityRule.getActivity();
+
+ activity.getFragmentManager().beginTransaction()
+ .add(R.id.content, new Fragment())
+ .addToBackStack(null)
+ .commit();
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ activity.getFragmentManager().executePendingTransactions();
+ }
+ });
+ assertEquals(1, activity.getFragmentManager().getBackStackEntryCount());
+
+ mInstrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
+
+ assertEquals(0, activity.getFragmentManager().getBackStackEntryCount());
+ }
+}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentReplaceTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/FragmentReplaceTest.kt
deleted file mode 100644
index 1430927..0000000
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentReplaceTest.kt
+++ /dev/null
@@ -1,103 +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.fragment.app
-
-import android.app.Instrumentation
-import android.view.KeyEvent
-import android.view.View
-import androidx.fragment.app.test.FragmentTestActivity
-import androidx.fragment.app.test.FragmentTestActivity.TestFragment
-import androidx.fragment.test.R
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.MediumTest
-import androidx.test.platform.app.InstrumentationRegistry
-import androidx.test.rule.ActivityTestRule
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Test to prevent regressions in SupportFragmentManager fragment replace method. See b/24693644
- */
-@RunWith(AndroidJUnit4::class)
-@MediumTest
-class FragmentReplaceTest {
- @get:Rule
- val activityRule = ActivityTestRule(FragmentTestActivity::class.java)
-
- private lateinit var instrumentation: Instrumentation
-
- @Before
- fun setUp() {
- instrumentation = InstrumentationRegistry.getInstrumentation()
- }
-
- @Test
- fun testReplaceFragment() {
- val activity = activityRule.activity
- val fm = activity.supportFragmentManager
-
- fm.beginTransaction()
- .add(R.id.content, TestFragment.create(R.layout.fragment_a))
- .addToBackStack(null)
- .commit()
- executePendingTransactions(fm)
- assertThat(activity.findViewById<View>(R.id.textA)).isNotNull()
- assertThat(activity.findViewById<View>(R.id.textB)).isNull()
- assertThat(activity.findViewById<View>(R.id.textC)).isNull()
-
- fm.beginTransaction()
- .add(R.id.content, TestFragment.create(R.layout.fragment_b))
- .addToBackStack(null)
- .commit()
- executePendingTransactions(fm)
- assertThat(activity.findViewById<View>(R.id.textA)).isNotNull()
- assertThat(activity.findViewById<View>(R.id.textB)).isNotNull()
- assertThat(activity.findViewById<View>(R.id.textC)).isNull()
-
- activity.supportFragmentManager.beginTransaction()
- .replace(R.id.content, TestFragment.create(R.layout.fragment_c))
- .addToBackStack(null)
- .commit()
- executePendingTransactions(fm)
- assertThat(activity.findViewById<View>(R.id.textA)).isNull()
- assertThat(activity.findViewById<View>(R.id.textB)).isNull()
- assertThat(activity.findViewById<View>(R.id.textC)).isNotNull()
- }
-
- private fun executePendingTransactions(fm: FragmentManager) {
- activityRule.runOnUiThread { fm.executePendingTransactions() }
- }
-
- @Test
- fun testBackPressWithFrameworkFragment() {
- val activity = activityRule.activity
- val fm = activity.supportFragmentManager
-
- fm.beginTransaction()
- .add(R.id.content, Fragment())
- .addToBackStack(null)
- .commit()
- activityRule.runOnUiThread { fm.executePendingTransactions() }
- assertThat(fm.backStackEntryCount).isEqualTo(1)
-
- instrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK)
-
- assertThat(fm.backStackEntryCount).isEqualTo(0)
- }
-}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentSavedStateRegistryTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/FragmentSavedStateRegistryTest.kt
index cc85e34..0a2021f 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentSavedStateRegistryTest.kt
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentSavedStateRegistryTest.kt
@@ -23,7 +23,7 @@
import androidx.lifecycle.OnLifecycleEvent
import androidx.savedstate.SavedStateRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import androidx.test.rule.ActivityTestRule
import androidx.testutils.FragmentActivityUtils.recreateActivity
import androidx.testutils.RecreatedActivity
@@ -33,7 +33,7 @@
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
-@LargeTest
+@SmallTest
class FragmentSavedStateRegistryTest {
@get:Rule
@@ -45,7 +45,7 @@
fragmentManager.beginTransaction().add(testFragment, FRAGMENT_TAG).commitNow()
assertThat(fragmentManager.findFragmentByTag(FRAGMENT_TAG)).isNotNull()
assertThat(testFragment.lifecycle.currentState.isAtLeast(CREATED)).isTrue()
- val registry = testFragment.savedStateRegistry
+ val registry = testFragment.bundleSavedStateRegistry
val savedState = registry.consumeRestoredStateForKey(CALLBACK_KEY)
assertThat(savedState).isNull()
registry.registerSavedStateProvider(CALLBACK_KEY, DefaultProvider())
@@ -58,7 +58,7 @@
val recreated = recreateActivity(activityRule, activityRule.activity)
activityRule.runOnUiThread {
assertThat(recreated.fragment().lifecycle.currentState.isAtLeast(CREATED)).isTrue()
- checkDefaultSavedState(recreated.fragment().savedStateRegistry)
+ checkDefaultSavedState(recreated.fragment().bundleSavedStateRegistry)
}
}
@@ -70,7 +70,7 @@
recreated.fragment().lifecycle.addObserver(object : LifecycleObserver {
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
fun onResume() {
- checkDefaultSavedState(recreated.fragment().savedStateRegistry)
+ checkDefaultSavedState(recreated.fragment().bundleSavedStateRegistry)
}
})
}
@@ -83,7 +83,7 @@
}
}
-private fun checkDefaultSavedState(store: SavedStateRegistry) {
+private fun checkDefaultSavedState(store: SavedStateRegistry<Bundle>) {
val savedState = store.consumeRestoredStateForKey(CALLBACK_KEY)
assertThat(savedState).isNotNull()
assertThat(savedState!!.getString(KEY)).isEqualTo(VALUE)
@@ -98,12 +98,12 @@
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (savedInstanceState != null) {
- checkDefaultSavedState(savedStateRegistry)
+ checkDefaultSavedState(bundleSavedStateRegistry)
}
}
}
-private class DefaultProvider : SavedStateRegistry.SavedStateProvider {
+private class DefaultProvider : SavedStateRegistry.SavedStateProvider<Bundle> {
override fun saveState() = Bundle().apply { putString(KEY, VALUE) }
}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentTestUtil.java b/fragment/src/androidTest/java/androidx/fragment/app/FragmentTestUtil.java
index 5dad36f..f220673 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentTestUtil.java
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentTestUtil.java
@@ -19,36 +19,23 @@
import android.app.Activity;
import android.app.Instrumentation;
-import android.content.Intent;
import android.os.Build;
-import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.os.SystemClock;
import android.util.Pair;
-import android.view.LayoutInflater;
-import android.view.View;
import android.view.ViewGroup;
-import android.view.Window;
import android.view.animation.Animation;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.core.app.ActivityCompat;
import androidx.fragment.app.test.FragmentTestActivity;
-import androidx.lifecycle.ViewModelStore;
-import androidx.lifecycle.ViewModelStoreOwner;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
-import java.io.FileDescriptor;
-import java.io.PrintWriter;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
public class FragmentTestUtil {
-
private static final Runnable DO_NOTHING = new Runnable() {
@Override
public void run() {
@@ -168,8 +155,7 @@
@Override
public void run() {
Handler handler = new Handler();
- androidx.fragment.app.HostCallbacks hostCallbacks =
- new androidx.fragment.app.HostCallbacks(activity, handler, 0);
+ HostCallbacks hostCallbacks = new HostCallbacks(activity, handler, 0);
controller[0] = FragmentController.createController(hostCallbacks);
}
});
@@ -255,130 +241,4 @@
}
}
}
-
- static class HostCallbacks extends FragmentHostCallback<FragmentActivity>
- implements ViewModelStoreOwner {
- private final FragmentActivity mActivity;
- private final ViewModelStore mViewModelStore;
-
- HostCallbacks(FragmentActivity activity, ViewModelStore viewModelStore) {
- super(activity);
- mActivity = activity;
- mViewModelStore = viewModelStore;
- }
-
- @NonNull
- @Override
- public ViewModelStore getViewModelStore() {
- return mViewModelStore;
- }
-
- @Override
- public void onDump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args) {
- }
-
- @Override
- public boolean onShouldSaveFragmentState(Fragment fragment) {
- return !mActivity.isFinishing();
- }
-
- @Override
- @NonNull
- public LayoutInflater onGetLayoutInflater() {
- return mActivity.getLayoutInflater().cloneInContext(mActivity);
- }
-
- @Override
- public FragmentActivity onGetHost() {
- return mActivity;
- }
-
- @Override
- public void onSupportInvalidateOptionsMenu() {
- mActivity.supportInvalidateOptionsMenu();
- }
-
- @Override
- public void onStartActivityFromFragment(Fragment fragment, Intent intent, int requestCode) {
- mActivity.startActivityFromFragment(fragment, intent, requestCode);
- }
-
- @Override
- public void onStartActivityFromFragment(
- Fragment fragment, Intent intent, int requestCode, @Nullable Bundle options) {
- mActivity.startActivityFromFragment(fragment, intent, requestCode, options);
- }
-
- @Override
- public void onRequestPermissionsFromFragment(@NonNull Fragment fragment,
- @NonNull String[] permissions, int requestCode) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean onShouldShowRequestPermissionRationale(@NonNull String permission) {
- return ActivityCompat.shouldShowRequestPermissionRationale(
- mActivity, permission);
- }
-
- @Override
- public boolean onHasWindowAnimations() {
- return mActivity.getWindow() != null;
- }
-
- @Override
- public int onGetWindowAnimations() {
- final Window w = mActivity.getWindow();
- return (w == null) ? 0 : w.getAttributes().windowAnimations;
- }
-
- @Override
- public void onAttachFragment(Fragment fragment) {
- mActivity.onAttachFragment(fragment);
- }
-
- @Nullable
- @Override
- public View onFindViewById(int id) {
- return mActivity.findViewById(id);
- }
-
- @Override
- public boolean onHasView() {
- final Window w = mActivity.getWindow();
- return (w != null && w.peekDecorView() != null);
- }
- }
-
- public static FragmentController startupFragmentController(FragmentActivity activity,
- Parcelable savedState, ViewModelStore viewModelStore) {
- final FragmentController fc = FragmentController.createController(
- new HostCallbacks(activity, viewModelStore));
- fc.attachHost(null);
- fc.restoreSaveState(savedState);
- fc.dispatchCreate();
- fc.dispatchActivityCreated();
- fc.noteStateNotSaved();
- fc.execPendingActions();
- fc.dispatchStart();
- fc.dispatchResume();
- fc.execPendingActions();
- return fc;
- }
-
- public static FragmentController restartFragmentController(FragmentActivity activity,
- FragmentController fc, ViewModelStore viewModelStore) {
- Parcelable savedState = shutdownFragmentController(fc, viewModelStore);
- return startupFragmentController(activity, savedState, viewModelStore);
- }
-
- public static Parcelable shutdownFragmentController(FragmentController fc,
- ViewModelStore viewModelStore) {
- fc.dispatchPause();
- final Parcelable savedState = fc.saveAllState();
- fc.dispatchStop();
- viewModelStore.clear();
- fc.dispatchDestroy();
- return savedState;
- }
}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.java b/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.java
index 40c6c96..a8e1878 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.java
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.java
@@ -40,7 +40,7 @@
import androidx.lifecycle.Observer;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Rule;
@@ -51,7 +51,7 @@
import java.util.concurrent.TimeUnit;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class FragmentViewLifecycleTest {
@Rule
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewTests.java b/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewTests.java
index 51a53c5..8932fda 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewTests.java
+++ b/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewTests.java
@@ -35,7 +35,7 @@
import androidx.fragment.app.test.FragmentTestActivity;
import androidx.fragment.test.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -44,7 +44,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class FragmentViewTests {
@Rule
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/HangingFragmentTest.java b/fragment/src/androidTest/java/androidx/fragment/app/HangingFragmentTest.java
new file mode 100644
index 0000000..431dafe
--- /dev/null
+++ b/fragment/src/androidTest/java/androidx/fragment/app/HangingFragmentTest.java
@@ -0,0 +1,44 @@
+/*
+ * 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.fragment.app;
+
+import androidx.fragment.app.test.HangingFragmentActivity;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+import androidx.test.rule.ActivityTestRule;
+import androidx.testutils.FragmentActivityUtils;
+
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class HangingFragmentTest {
+
+ @Rule
+ public ActivityTestRule<HangingFragmentActivity> mActivityRule =
+ new ActivityTestRule<>(HangingFragmentActivity.class);
+
+ @Test
+ public void testNoCrash() throws InterruptedException {
+ HangingFragmentActivity newActivity = FragmentActivityUtils.recreateActivity(
+ mActivityRule, mActivityRule.getActivity());
+ Assert.assertNotNull(newActivity);
+ }
+}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/HangingFragmentTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/HangingFragmentTest.kt
deleted file mode 100644
index fac2f35..0000000
--- a/fragment/src/androidTest/java/androidx/fragment/app/HangingFragmentTest.kt
+++ /dev/null
@@ -1,43 +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.fragment.app
-
-import androidx.fragment.app.test.HangingFragmentActivity
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.MediumTest
-import androidx.test.rule.ActivityTestRule
-import androidx.testutils.FragmentActivityUtils
-import com.google.common.truth.Truth.assertThat
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@RunWith(AndroidJUnit4::class)
-@MediumTest
-class HangingFragmentTest {
-
- @get:Rule
- val activityRule = ActivityTestRule(HangingFragmentActivity::class.java)
-
- @Test
- fun testNoCrash() {
- val newActivity = FragmentActivityUtils.recreateActivity(
- activityRule, activityRule.activity
- )
- assertThat(newActivity).isNotNull()
- }
-}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/NestedFragmentRestoreTest.java b/fragment/src/androidTest/java/androidx/fragment/app/NestedFragmentRestoreTest.java
index 05b3858..543345c 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/NestedFragmentRestoreTest.java
+++ b/fragment/src/androidTest/java/androidx/fragment/app/NestedFragmentRestoreTest.java
@@ -28,7 +28,7 @@
import androidx.fragment.app.test.FragmentTestActivity.ChildFragment.OnAttachListener;
import androidx.fragment.app.test.FragmentTestActivity.ParentFragment;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Rule;
@@ -49,7 +49,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void recreateActivity() throws Throwable {
final FragmentTestActivity activity = mActivityRule.getActivity();
mActivityRule.runOnUiThread(new Runnable() {
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/PrimaryNavFragmentTest.java b/fragment/src/androidTest/java/androidx/fragment/app/PrimaryNavFragmentTest.java
index 6b53622..a284225 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/PrimaryNavFragmentTest.java
+++ b/fragment/src/androidTest/java/androidx/fragment/app/PrimaryNavFragmentTest.java
@@ -24,7 +24,7 @@
import androidx.fragment.app.test.EmptyFragmentTestActivity;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Rule;
@@ -32,7 +32,7 @@
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-@SmallTest
+@MediumTest
public class PrimaryNavFragmentTest {
@Rule
public ActivityTestRule<EmptyFragmentTestActivity> mActivityRule =
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/SafeTransactionInOnResumeTest.kt b/fragment/src/androidTest/java/androidx/fragment/app/SafeTransactionInOnResumeTest.kt
index 6bd4684..80e926d 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/SafeTransactionInOnResumeTest.kt
+++ b/fragment/src/androidTest/java/androidx/fragment/app/SafeTransactionInOnResumeTest.kt
@@ -21,7 +21,6 @@
import android.os.Build
import android.os.Bundle
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
import androidx.test.filters.SdkSuppress
import androidx.test.rule.ActivityTestRule
import org.junit.Assert.assertTrue
@@ -32,7 +31,6 @@
import java.util.concurrent.TimeUnit
@RunWith(AndroidJUnit4::class)
-@LargeTest
class SafeTransactionInOnResumeTest {
@get:Rule
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/TransitionFragment.java b/fragment/src/androidTest/java/androidx/fragment/app/TransitionFragment.java
index ad8b45b1..33a2ad9 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/TransitionFragment.java
+++ b/fragment/src/androidTest/java/androidx/fragment/app/TransitionFragment.java
@@ -69,7 +69,7 @@
}
void waitForTransition() throws InterruptedException {
- verify(mListener, CtsMockitoUtils.within(1000)).onTransitionEnd((Transition) any());
+ verify(mListener, CtsMockitoUtils.within(300)).onTransitionEnd((Transition) any());
reset(mListener);
}
diff --git a/fragment/src/androidTest/java/androidx/fragment/app/ViewModelTestInTransaction.java b/fragment/src/androidTest/java/androidx/fragment/app/ViewModelTestInTransaction.java
index 378dd87..b131559 100644
--- a/fragment/src/androidTest/java/androidx/fragment/app/ViewModelTestInTransaction.java
+++ b/fragment/src/androidTest/java/androidx/fragment/app/ViewModelTestInTransaction.java
@@ -28,14 +28,14 @@
import androidx.lifecycle.ViewModelProvider;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class ViewModelTestInTransaction {
diff --git a/fragment/src/main/java/androidx/fragment/app/BackStackRecord.java b/fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
index cccbffb..f305570 100644
--- a/fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
+++ b/fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
@@ -16,6 +16,7 @@
package androidx.fragment.app;
+import android.annotation.SuppressLint;
import android.util.Log;
import android.view.View;
@@ -304,6 +305,7 @@
if (containerViewId == 0) {
throw new IllegalArgumentException("Must use non-zero containerViewId");
}
+
doAddOp(containerViewId, fragment, tag, OP_REPLACE);
return this;
}
@@ -311,11 +313,6 @@
@NonNull
@Override
public FragmentTransaction remove(@NonNull Fragment fragment) {
- if (fragment.mFragmentManager != null && fragment.mFragmentManager != mManager) {
- throw new IllegalStateException("Cannot remove Fragment attached to "
- + "a different FragmentManager. Fragment " + fragment.toString() + " is already"
- + " attached to a FragmentManager.");
- }
addOp(new Op(OP_REMOVE, fragment));
return this;
@@ -324,11 +321,6 @@
@NonNull
@Override
public FragmentTransaction hide(@NonNull Fragment fragment) {
- if (fragment.mFragmentManager != null && fragment.mFragmentManager != mManager) {
- throw new IllegalStateException("Cannot hide Fragment attached to "
- + "a different FragmentManager. Fragment " + fragment.toString() + " is already"
- + " attached to a FragmentManager.");
- }
addOp(new Op(OP_HIDE, fragment));
return this;
@@ -337,11 +329,6 @@
@NonNull
@Override
public FragmentTransaction show(@NonNull Fragment fragment) {
- if (fragment.mFragmentManager != null && fragment.mFragmentManager != mManager) {
- throw new IllegalStateException("Cannot show Fragment attached to "
- + "a different FragmentManager. Fragment " + fragment.toString() + " is already"
- + " attached to a FragmentManager.");
- }
addOp(new Op(OP_SHOW, fragment));
return this;
@@ -350,12 +337,8 @@
@NonNull
@Override
public FragmentTransaction detach(@NonNull Fragment fragment) {
- if (fragment.mFragmentManager != null && fragment.mFragmentManager != mManager) {
- throw new IllegalStateException("Cannot detach Fragment attached to "
- + "a different FragmentManager. Fragment " + fragment.toString() + " is already"
- + " attached to a FragmentManager.");
- }
addOp(new Op(OP_DETACH, fragment));
+
return this;
}
@@ -370,12 +353,6 @@
@NonNull
@Override
public FragmentTransaction setPrimaryNavigationFragment(@Nullable Fragment fragment) {
- if (fragment != null
- && fragment.mFragmentManager != null && fragment.mFragmentManager != mManager) {
- throw new IllegalStateException("Cannot setPrimaryNavigation for Fragment attached to "
- + "a different FragmentManager. Fragment " + fragment.toString() + " is already"
- + " attached to a FragmentManager.");
- }
addOp(new Op(OP_SET_PRIMARY_NAV, fragment));
return this;
@@ -573,6 +550,7 @@
return setReorderingAllowed(allowOptimization);
}
+ @SuppressLint("RestrictedApi")
int commitInternal(boolean allowStateLoss) {
if (mCommitted) throw new IllegalStateException("commit already called");
if (FragmentManagerImpl.DEBUG) {
diff --git a/fragment/src/main/java/androidx/fragment/app/DialogFragment.java b/fragment/src/main/java/androidx/fragment/app/DialogFragment.java
index 74f516b..d3a4a29 100644
--- a/fragment/src/main/java/androidx/fragment/app/DialogFragment.java
+++ b/fragment/src/main/java/androidx/fragment/app/DialogFragment.java
@@ -16,15 +16,13 @@
package androidx.fragment.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
-import android.os.Handler;
-import android.os.Looper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -51,7 +49,7 @@
implements DialogInterface.OnCancelListener, DialogInterface.OnDismissListener {
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({STYLE_NORMAL, STYLE_NO_TITLE, STYLE_NO_FRAME, STYLE_NO_INPUT})
@Retention(RetentionPolicy.SOURCE)
private @interface DialogStyle {}
@@ -89,15 +87,6 @@
private static final String SAVED_SHOWS_DIALOG = "android:showsDialog";
private static final String SAVED_BACK_STACK_ID = "android:backStackId";
- private Handler mHandler;
- private Runnable mDismissRunnable = new Runnable() {
- @Override
- public void run() {
- if (mDialog != null) {
- onDismiss(mDialog);
- }
- }
- };
int mStyle = STYLE_NORMAL;
int mTheme = 0;
boolean mCancelable = true;
@@ -199,7 +188,7 @@
* the fragment.
*/
public void dismiss() {
- dismissInternal(false, false);
+ dismissInternal(false);
}
/**
@@ -209,32 +198,17 @@
* documentation for further details.
*/
public void dismissAllowingStateLoss() {
- dismissInternal(true, false);
+ dismissInternal(true);
}
- void dismissInternal(boolean allowStateLoss, boolean fromOnDismiss) {
+ void dismissInternal(boolean allowStateLoss) {
if (mDismissed) {
return;
}
mDismissed = true;
mShownByMe = false;
if (mDialog != null) {
- // Instead of waiting for a posted onDismiss(), null out
- // the listener and call onDismiss() manually to ensure
- // that the callback happens before onDestroy()
- mDialog.setOnDismissListener(null);
mDialog.dismiss();
- if (!fromOnDismiss) {
- // onDismiss() is always called on the main thread, so
- // we mimic that behavior here. The difference here is that
- // we don't post the message to ensure that the onDismiss()
- // callback still happens before onDestroy()
- if (Looper.myLooper() == mHandler.getLooper()) {
- onDismiss(mDialog);
- } else {
- mHandler.post(mDismissRunnable);
- }
- }
}
mViewDestroyed = true;
if (mBackStackId >= 0) {
@@ -356,8 +330,6 @@
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- // This assumes that onCreate() is being called on the main thread
- mHandler = new Handler();
mShowsDialog = mContainerId == 0;
@@ -390,7 +362,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setupDialog(@NonNull Dialog dialog, int style) {
switch (style) {
case STYLE_NO_INPUT:
@@ -442,7 +414,7 @@
// dispatches this asynchronously so we can receive the call
// after the activity is paused. Worst case, when the user comes
// back to the activity they see the dialog again.
- dismissInternal(true, true);
+ dismissInternal(true);
}
}
@@ -537,11 +509,7 @@
// that the callback happens before onDestroy()
mDialog.setOnDismissListener(null);
mDialog.dismiss();
- if (!mDismissed) {
- // Don't send a second onDismiss() callback if we've already
- // dismissed the dialog manually in dismissInternal()
- onDismiss(mDialog);
- }
+ onDismiss(mDialog);
mDialog = null;
}
}
diff --git a/fragment/src/main/java/androidx/fragment/app/Fragment.java b/fragment/src/main/java/androidx/fragment/app/Fragment.java
index 22659ec..fa817a9 100644
--- a/fragment/src/main/java/androidx/fragment/app/Fragment.java
+++ b/fragment/src/main/java/androidx/fragment/app/Fragment.java
@@ -16,7 +16,7 @@
package androidx.fragment.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.annotation.SuppressLint;
@@ -66,13 +66,12 @@
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.loader.app.LoaderManager;
import androidx.savedstate.SavedStateRegistry;
-import androidx.savedstate.SavedStateRegistryController;
-import androidx.savedstate.SavedStateRegistryOwner;
+import androidx.savedstate.bundle.BundleSavedStateRegistry;
+import androidx.savedstate.bundle.BundleSavedStateRegistryOwner;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
import java.util.UUID;
/**
@@ -91,7 +90,7 @@
*
*/
public class Fragment implements ComponentCallbacks, OnCreateContextMenuListener, LifecycleOwner,
- ViewModelStoreOwner, SavedStateRegistryOwner {
+ ViewModelStoreOwner, BundleSavedStateRegistryOwner {
static final Object USE_DEFAULT_TRANSITION = new Object();
@@ -248,10 +247,7 @@
@Nullable FragmentViewLifecycleOwner mViewLifecycleOwner;
MutableLiveData<LifecycleOwner> mViewLifecycleOwnerLiveData = new MutableLiveData<>();
- SavedStateRegistryController mSavedStateRegistryController;
-
- // Cache the ContentView layoutIds for Fragments.
- private static final HashMap<Class, Integer> sAnnotationIds = new HashMap<>();
+ BundleSavedStateRegistry mSavedStateRegistry = new BundleSavedStateRegistry();
/**
* {@inheritDoc}
@@ -348,8 +344,8 @@
@NonNull
@Override
- public final SavedStateRegistry getSavedStateRegistry() {
- return mSavedStateRegistryController.getSavedStateRegistry();
+ public final SavedStateRegistry<Bundle> getBundleSavedStateRegistry() {
+ return mSavedStateRegistry;
}
/**
@@ -434,7 +430,6 @@
private void initLifecycle() {
mLifecycleRegistry = new LifecycleRegistry(this);
- mSavedStateRegistryController = SavedStateRegistryController.create(this);
if (Build.VERSION.SDK_INT >= 19) {
mLifecycleRegistry.addObserver(new GenericLifecycleObserver() {
@Override
@@ -545,6 +540,7 @@
}
@Override
+ @SuppressLint({"UnknownNullness", "RestrictedApi"})
public String toString() {
StringBuilder sb = new StringBuilder(128);
DebugUtils.buildShortClassTag(this, sb);
@@ -1006,13 +1002,13 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
final public boolean hasOptionsMenu() {
return mHasMenu;
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
final public boolean isMenuVisible() {
return mMenuVisible;
}
@@ -1400,7 +1396,7 @@
*/
@Deprecated
@NonNull
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public LayoutInflater getLayoutInflater(@Nullable Bundle savedFragmentState) {
if (mHost == null) {
throw new IllegalStateException("onGetLayoutInflater() cannot be executed until the "
@@ -1577,6 +1573,7 @@
@CallSuper
public void onCreate(@Nullable Bundle savedInstanceState) {
mCalled = true;
+ mSavedStateRegistry.performRestore(savedInstanceState);
restoreChildFragmentState(savedInstanceState);
if (mChildFragmentManager != null
&& !mChildFragmentManager.isStateAtLeast(Fragment.CREATED)) {
@@ -1637,19 +1634,13 @@
@Nullable
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
- Class<? extends Fragment> clazz = getClass();
- if (!sAnnotationIds.containsKey(clazz)) {
- ContentView annotation = clazz.getAnnotation(ContentView.class);
- if (annotation != null) {
- sAnnotationIds.put(clazz, annotation.value());
- } else {
- sAnnotationIds.put(clazz, null);
+ ContentView annotation = getClass().getAnnotation(ContentView.class);
+ if (annotation != null) {
+ int layoutId = annotation.value();
+ if (layoutId != 0) {
+ return inflater.inflate(layoutId, container, false);
}
}
- Integer layoutId = sAnnotationIds.get(clazz);
- if (layoutId != null && layoutId != 0) {
- return inflater.inflate(layoutId, container, false);
- }
return null;
}
@@ -1852,6 +1843,7 @@
*/
void initState() {
initLifecycle();
+ mSavedStateRegistry = new BundleSavedStateRegistry();
mWho = UUID.randomUUID().toString();
mAdded = false;
mRemoving = false;
@@ -2519,7 +2511,6 @@
}
mState = CREATED;
mCalled = false;
- mSavedStateRegistryController.performRestore(savedInstanceState);
onCreate(savedInstanceState);
mIsCreated = true;
if (!mCalled) {
@@ -2724,7 +2715,7 @@
void performSaveInstanceState(Bundle outState) {
onSaveInstanceState(outState);
- mSavedStateRegistryController.performSave(outState);
+ mSavedStateRegistry.performSave(outState);
if (mChildFragmentManager != null) {
Parcelable p = mChildFragmentManager.saveAllState();
if (p != null) {
diff --git a/fragment/src/main/java/androidx/fragment/app/FragmentActivity.java b/fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
index 376c8d4..bd07f53 100644
--- a/fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
+++ b/fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
@@ -16,7 +16,7 @@
package androidx.fragment.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.app.Activity;
@@ -151,6 +151,7 @@
}
return;
}
+ @SuppressLint("RestrictedApi")
ActivityCompat.PermissionCompatDelegate delegate =
ActivityCompat.getPermissionCompatDelegate();
if (delegate != null && delegate.onActivityResult(this, requestCode, resultCode, data)) {
@@ -417,7 +418,6 @@
* because the fragment manager thinks the state is still saved.
*/
@Override
- @CallSuper
protected void onNewIntent(@SuppressLint("UnknownNullness") Intent intent) {
super.onNewIntent(intent);
mFragments.noteStateNotSaved();
@@ -480,7 +480,7 @@
* @hide
* @deprecated Override {@link #onPreparePanel(int, View, Menu)}.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Deprecated
protected boolean onPrepareOptionsPanel(@Nullable View view, @NonNull Menu menu) {
return super.onPreparePanel(Window.FEATURE_OPTIONS_PANEL, view, menu);
diff --git a/fragment/src/main/java/androidx/fragment/app/FragmentController.java b/fragment/src/main/java/androidx/fragment/app/FragmentController.java
index 2086392..729909d 100644
--- a/fragment/src/main/java/androidx/fragment/app/FragmentController.java
+++ b/fragment/src/main/java/androidx/fragment/app/FragmentController.java
@@ -53,6 +53,7 @@
* Returns a {@link FragmentController}.
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public static FragmentController createController(@NonNull FragmentHostCallback<?> callbacks) {
return new FragmentController(checkNotNull(callbacks, "callbacks == null"));
}
diff --git a/fragment/src/main/java/androidx/fragment/app/FragmentHostCallback.java b/fragment/src/main/java/androidx/fragment/app/FragmentHostCallback.java
index f9d820f..dcc8619 100644
--- a/fragment/src/main/java/androidx/fragment/app/FragmentHostCallback.java
+++ b/fragment/src/main/java/androidx/fragment/app/FragmentHostCallback.java
@@ -58,6 +58,7 @@
this(activity, activity /*context*/, new Handler(), 0 /*windowAnimations*/);
}
+ @SuppressLint("RestrictedApi")
FragmentHostCallback(@Nullable Activity activity, @NonNull Context context,
@NonNull Handler handler, int windowAnimations) {
mActivity = activity;
diff --git a/fragment/src/main/java/androidx/fragment/app/FragmentManager.java b/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
index 446002c..725f9dc 100644
--- a/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
+++ b/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
@@ -16,7 +16,7 @@
package androidx.fragment.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.os.Bundle;
@@ -46,8 +46,6 @@
* {@link FragmentActivity#getSupportFragmentManager}.
*/
public abstract class FragmentManager {
- static final FragmentFactory DEFAULT_FACTORY = new FragmentFactory();
-
/**
* Representation of an entry on the fragment back stack, as created
* with {@link FragmentTransaction#addToBackStack(String)
@@ -114,8 +112,6 @@
public void onBackStackChanged();
}
- private FragmentFactory mFragmentFactory = null;
-
/**
* Start a series of edit operations on the Fragments associated with
* this FragmentManager.
@@ -136,7 +132,7 @@
* @hide -- remove once prebuilts are in.
* @deprecated
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Deprecated
@NonNull
public FragmentTransaction openTransaction() {
@@ -393,13 +389,13 @@
/**
* Set a {@link FragmentFactory} for this FragmentManager that will be used
- * to create new Fragment instances from this point onward.
+ * to create new Fragment instances from this point onward. Any child
+ * FragmentManager that does not have a custom FragmentFactory set will also use
+ * this same FragmentFactory.
*
* @param fragmentFactory the factory to use to create new Fragment instances
*/
- public void setFragmentFactory(@NonNull FragmentFactory fragmentFactory) {
- mFragmentFactory = fragmentFactory;
- }
+ public abstract void setFragmentFactory(@NonNull FragmentFactory fragmentFactory);
/**
* Gets the current {@link FragmentFactory} used to instantiate new Fragment instances.
@@ -407,12 +403,7 @@
* @return the current FragmentFactory
*/
@NonNull
- public FragmentFactory getFragmentFactory() {
- if (mFragmentFactory == null) {
- mFragmentFactory = DEFAULT_FACTORY;
- }
- return mFragmentFactory;
- }
+ public abstract FragmentFactory getFragmentFactory();
/**
* Print the FragmentManager's state into the given stream.
diff --git a/fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java b/fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
index b4b8ea1..c528716 100644
--- a/fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
+++ b/fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
@@ -22,6 +22,7 @@
import android.animation.AnimatorSet;
import android.animation.PropertyValuesHolder;
import android.animation.ValueAnimator;
+import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
@@ -62,6 +63,7 @@
import java.io.FileDescriptor;
import java.io.PrintWriter;
+import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -116,6 +118,9 @@
Fragment mParent;
@Nullable
Fragment mPrimaryNav;
+ FragmentFactory mFragmentFactory;
+
+ static Field sAnimationListenerField = null;
boolean mNeedMenuInvalidate;
boolean mStateSaved;
@@ -144,26 +149,27 @@
}
};
- private static boolean modifiesAlpha(@Nullable Animation anim) {
- if (anim == null) {
- return false;
- } else if (anim instanceof AlphaAnimation) {
+ static boolean modifiesAlpha(AnimationOrAnimator anim) {
+ if (anim.animation instanceof AlphaAnimation) {
return true;
- } else if (anim instanceof AnimationSet) {
- List<Animation> anims = ((AnimationSet) anim).getAnimations();
+ } else if (anim.animation instanceof AnimationSet) {
+ List<Animation> anims = ((AnimationSet) anim.animation).getAnimations();
for (int i = 0; i < anims.size(); i++) {
- if (modifiesAlpha(anims.get(i))) {
+ if (anims.get(i) instanceof AlphaAnimation) {
return true;
}
}
+ return false;
+ } else {
+ return modifiesAlpha(anim.animator);
}
- return false;
}
- private static boolean modifiesAlpha(@Nullable Animator anim) {
+ static boolean modifiesAlpha(Animator anim) {
if (anim == null) {
return false;
- } else if (anim instanceof ValueAnimator) {
+ }
+ if (anim instanceof ValueAnimator) {
ValueAnimator valueAnim = (ValueAnimator) anim;
PropertyValuesHolder[] values = valueAnim.getValues();
for (int i = 0; i < values.length; i++) {
@@ -182,23 +188,17 @@
return false;
}
- private static boolean shouldRunOnHwLayer(@Nullable View v, @Nullable Animation anim) {
- return shouldAnimateOnHwLayer(v) && modifiesAlpha(anim);
- }
-
- private static boolean shouldRunOnHwLayer(@Nullable View v, @Nullable Animator anim) {
- return shouldAnimateOnHwLayer(v) && modifiesAlpha(anim);
- }
-
- private static boolean shouldAnimateOnHwLayer(@Nullable View v) {
- if (v == null) {
+ static boolean shouldRunOnHWLayer(View v, AnimationOrAnimator anim) {
+ if (v == null || anim == null) {
return false;
}
return Build.VERSION.SDK_INT >= 19
&& v.getLayerType() == View.LAYER_TYPE_NONE
- && ViewCompat.hasOverlappingRendering(v);
+ && ViewCompat.hasOverlappingRendering(v)
+ && modifiesAlpha(anim);
}
+ @SuppressLint("RestrictedApi")
private void throwException(RuntimeException ex) {
Log.e(TAG, ex.getMessage());
Log.e(TAG, "Activity state:");
@@ -426,6 +426,7 @@
}
@Override
+ @SuppressLint("RestrictedApi")
public String toString() {
StringBuilder sb = new StringBuilder(128);
sb.append("FragmentManager{");
@@ -680,36 +681,48 @@
}
/**
- * Sets the to be animated view on hardware layer during the animation and returns an
- * AnimationSet consisting of only the given animation that replaces it. The replacement is done
- * because animations do not support more than one listeners.
+ * Sets the to be animated view on hardware layer during the animation. Note
+ * that calling this will replace any existing animation listener on the animation
+ * with a new one, as animations do not support more than one listeners. Therefore,
+ * animations that already have listeners should do the layer change operations
+ * in their existing listeners, rather than calling this function.
*/
- @NonNull
- private static Animation setHwLayerAnimationListenerIfAlpha(final View v,
- @NonNull Animation anim) {
- if (shouldRunOnHwLayer(v, anim)) {
- // In case there's already a listener set on the animation, we need wrap the animation
- // in an AnimationSet and set our listener on that set, so that they will both get
- // animation listener callbacks.
- v.setLayerType(View.LAYER_TYPE_HARDWARE, null);
- AnimationSet animationSet = new AnimationSet(false);
- animationSet.addAnimation(anim);
- animationSet.setAnimationListener(new AnimationOnHwLayerIfNeededListener(v));
- return animationSet;
+ private static void setHWLayerAnimListenerIfAlpha(final View v, AnimationOrAnimator anim) {
+ if (v == null || anim == null) {
+ return;
}
- return anim;
+ if (shouldRunOnHWLayer(v, anim)) {
+ if (anim.animator != null) {
+ anim.animator.addListener(new AnimatorOnHWLayerIfNeededListener(v));
+ } else {
+ Animation.AnimationListener originalListener = getAnimationListener(anim.animation);
+ // If there's already a listener set on the animation, we need wrap the new listener
+ // around the existing listener, so that they will both get animation listener
+ // callbacks.
+ v.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ anim.animation.setAnimationListener(new AnimateOnHWLayerIfNeededListener(v,
+ originalListener));
+ }
+ }
}
/**
- * Sets the to be animated view on hardware layer during the animation.
+ * Returns an existing AnimationListener on an Animation or {@code null} if none exists.
*/
- private static void setHwLayerAnimatorListenerIfAlpha(final View v, @NonNull Animator anim) {
- if (v == null) {
- return;
+ private static Animation.AnimationListener getAnimationListener(Animation animation) {
+ Animation.AnimationListener originalListener = null;
+ try {
+ if (sAnimationListenerField == null) {
+ sAnimationListenerField = Animation.class.getDeclaredField("mListener");
+ sAnimationListenerField.setAccessible(true);
+ }
+ originalListener = (Animation.AnimationListener) sAnimationListenerField.get(animation);
+ } catch (NoSuchFieldException e) {
+ Log.e(TAG, "No field with the name mListener is found in Animation class", e);
+ } catch (IllegalAccessException e) {
+ Log.e(TAG, "Cannot access Animation's mListener field", e);
}
- if (shouldRunOnHwLayer(v, anim)) {
- anim.addListener(new AnimatorOnHwLayerIfNeededListener(v));
- }
+ return originalListener;
}
boolean isStateAtLeast(int state) {
@@ -1070,15 +1083,14 @@
fragment.setStateAfterAnimating(newState);
if (anim.animation != null) {
Animation animation =
- new EndViewTransitionAnimation(anim.animation, container, viewToAnimate);
+ new EndViewTransitionAnimator(anim.animation, container, viewToAnimate);
fragment.setAnimatingAway(fragment.mView);
- animation.setAnimationListener(new Animation.AnimationListener() {
- @Override
- public void onAnimationStart(Animation animation) {
- }
-
+ Animation.AnimationListener listener = getAnimationListener(animation);
+ animation.setAnimationListener(new AnimationListenerWrapper(listener) {
@Override
public void onAnimationEnd(Animation animation) {
+ super.onAnimationEnd(animation);
+
// onAnimationEnd() comes during draw(), so there can still be some
// draw events happening after this call. We don't want to detach
// the view until after the onAnimationEnd()
@@ -1093,16 +1105,12 @@
}
});
}
-
- @Override
- public void onAnimationRepeat(Animation animation) {
- }
});
- animation = setHwLayerAnimationListenerIfAlpha(viewToAnimate, animation);
+ setHWLayerAnimListenerIfAlpha(viewToAnimate, anim);
fragment.mView.startAnimation(animation);
} else {
Animator animator = anim.animator;
- fragment.setAnimator(animator);
+ fragment.setAnimator(anim.animator);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator anim) {
@@ -1117,7 +1125,7 @@
}
});
animator.setTarget(fragment.mView);
- setHwLayerAnimatorListenerIfAlpha(fragment.mView, animator);
+ setHWLayerAnimListenerIfAlpha(fragment.mView, anim);
animator.start();
}
}
@@ -1181,14 +1189,13 @@
} else {
fragment.mView.setVisibility(View.VISIBLE);
}
- setHwLayerAnimatorListenerIfAlpha(fragment.mView, anim.animator);
+ setHWLayerAnimListenerIfAlpha(fragment.mView, anim);
anim.animator.start();
} else {
if (anim != null) {
- Animation animation = setHwLayerAnimationListenerIfAlpha(fragment.mView,
- anim.animation);
- fragment.mView.startAnimation(animation);
- animation.start();
+ setHWLayerAnimListenerIfAlpha(fragment.mView, anim);
+ fragment.mView.startAnimation(anim.animation);
+ anim.animation.start();
}
final int visibility = fragment.mHidden && !fragment.isHideReplaced()
? View.GONE
@@ -1250,14 +1257,14 @@
// run animations:
AnimationOrAnimator anim = loadAnimation(f, f.getNextTransition(), true,
f.getNextTransitionStyle());
- if (anim != null && anim.animation != null) {
- Animation animation = setHwLayerAnimationListenerIfAlpha(f.mView,
- anim.animation);
- f.mView.startAnimation(animation);
- } else if (anim != null) {
- anim.animator.setTarget(f.mView);
- setHwLayerAnimatorListenerIfAlpha(f.mView, anim.animator);
- anim.animator.start();
+ if (anim != null) {
+ setHWLayerAnimListenerIfAlpha(f.mView, anim);
+ if (anim.animation != null) {
+ f.mView.startAnimation(anim.animation);
+ } else {
+ anim.animator.setTarget(f.mView);
+ anim.animator.start();
+ }
}
}
}
@@ -2419,6 +2426,7 @@
restoreSaveState(state);
}
+ @SuppressLint("RestrictedApi")
void restoreSaveState(Parcelable state) {
// If there is no saved state at all, then there's nothing else to do
if (state == null) return;
@@ -2760,28 +2768,27 @@
}
@Override
+ public void setFragmentFactory(@NonNull FragmentFactory fragmentFactory) {
+ mFragmentFactory = fragmentFactory;
+ }
+
+ @Override
@NonNull
public FragmentFactory getFragmentFactory() {
- FragmentFactory factory = super.getFragmentFactory();
- if (factory == DEFAULT_FACTORY) {
+ if (mFragmentFactory == null) {
if (mParent != null) {
- // This can't call setFragmentFactory since we need to
- // compute this each time getFragmentFactory() is called
- // so that if the parent's FragmentFactory changes, we
- // pick the change up here.
return mParent.mFragmentManager.getFragmentFactory();
}
- setFragmentFactory(new FragmentFactory() {
+ mFragmentFactory = new FragmentFactory() {
@SuppressWarnings("deprecation")
@NonNull
- @Override
- public Fragment instantiate(@NonNull ClassLoader classLoader,
- @NonNull String className, @Nullable Bundle args) {
- return mHost.instantiate(mHost.getContext(), className, args);
+ public Fragment instantiate(@NonNull Context context, @NonNull String className,
+ @Nullable Bundle args) {
+ return mHost.instantiate(context, className, args);
}
- });
+ };
}
- return super.getFragmentFactory();
+ return mFragmentFactory;
}
@Override
@@ -3326,17 +3333,49 @@
}
/**
- * Reset the layer type to LAYER_TYPE_NONE at the end of an animation.
+ * Wrap an AnimationListener that can be null. This allows us to chain animation listeners.
*/
- private static class AnimationOnHwLayerIfNeededListener implements Animation.AnimationListener {
- View mView;
+ private static class AnimationListenerWrapper implements Animation.AnimationListener {
+ private final Animation.AnimationListener mWrapped;
- AnimationOnHwLayerIfNeededListener(final View v) {
- mView = v;
+ AnimationListenerWrapper(Animation.AnimationListener wrapped) {
+ mWrapped = wrapped;
}
+ @CallSuper
@Override
public void onAnimationStart(Animation animation) {
+ if (mWrapped != null) {
+ mWrapped.onAnimationStart(animation);
+ }
+ }
+
+ @CallSuper
+ @Override
+ public void onAnimationEnd(Animation animation) {
+ if (mWrapped != null) {
+ mWrapped.onAnimationEnd(animation);
+ }
+ }
+
+ @CallSuper
+ @Override
+ public void onAnimationRepeat(Animation animation) {
+ if (mWrapped != null) {
+ mWrapped.onAnimationRepeat(animation);
+ }
+ }
+ }
+
+ /**
+ * Reset the layer type to LAYER_TYPE_NONE at the end of an animation.
+ */
+ private static class AnimateOnHWLayerIfNeededListener extends AnimationListenerWrapper {
+ View mView;
+
+ AnimateOnHWLayerIfNeededListener(final View v, Animation.AnimationListener listener) {
+ super(listener);
+ mView = v;
}
@Override
@@ -3362,20 +3401,17 @@
} else {
mView.setLayerType(View.LAYER_TYPE_NONE, null);
}
- }
-
- @Override
- public void onAnimationRepeat(Animation animation) {
+ super.onAnimationEnd(animation);
}
}
/**
* Set the layer type to LAYER_TYPE_HARDWARE while an animator is running.
*/
- private static class AnimatorOnHwLayerIfNeededListener extends AnimatorListenerAdapter {
+ private static class AnimatorOnHWLayerIfNeededListener extends AnimatorListenerAdapter {
View mView;
- AnimatorOnHwLayerIfNeededListener(final View v) {
+ AnimatorOnHWLayerIfNeededListener(final View v) {
mView = v;
}
@@ -3397,14 +3433,14 @@
* with Views remaining in the hierarchy as disappearing children after the view has been
* removed in some edge cases.
*/
- private static class EndViewTransitionAnimation extends AnimationSet implements Runnable {
+ private static class EndViewTransitionAnimator extends AnimationSet implements Runnable {
private final ViewGroup mParent;
private final View mChild;
private boolean mEnded;
private boolean mTransitionEnded;
private boolean mAnimating = true;
- EndViewTransitionAnimation(@NonNull Animation animation,
+ EndViewTransitionAnimator(@NonNull Animation animation,
@NonNull ViewGroup parent, @NonNull View child) {
super(false);
mParent = parent;
diff --git a/fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java b/fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
index 17baa9e..5d4de22 100644
--- a/fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
+++ b/fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
@@ -16,7 +16,7 @@
package androidx.fragment.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
import android.view.View;
@@ -198,7 +198,7 @@
public static final int TRANSIT_EXIT_MASK = 0x2000;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({TRANSIT_NONE, TRANSIT_FRAGMENT_OPEN, TRANSIT_FRAGMENT_CLOSE, TRANSIT_FRAGMENT_FADE})
@Retention(RetentionPolicy.SOURCE)
private @interface Transit {}
diff --git a/fragment/src/main/java/androidx/fragment/app/FragmentTransitionImpl.java b/fragment/src/main/java/androidx/fragment/app/FragmentTransitionImpl.java
index ccd121e..7aeeab7 100644
--- a/fragment/src/main/java/androidx/fragment/app/FragmentTransitionImpl.java
+++ b/fragment/src/main/java/androidx/fragment/app/FragmentTransitionImpl.java
@@ -16,7 +16,7 @@
package androidx.fragment.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.graphics.Rect;
@@ -37,7 +37,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("UnknownNullness")
public abstract class FragmentTransitionImpl {
diff --git a/fragment/testing/api/1.1.0-alpha01.txt b/fragment/testing/api/1.1.0-alpha01.txt
index a383258..2ad9886 100644
--- a/fragment/testing/api/1.1.0-alpha01.txt
+++ b/fragment/testing/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app.testing {
public final class FragmentScenario<F extends androidx.fragment.app.Fragment> {
diff --git a/fragment/testing/api/1.1.0-alpha02.txt b/fragment/testing/api/1.1.0-alpha02.txt
index a383258..2ad9886 100644
--- a/fragment/testing/api/1.1.0-alpha02.txt
+++ b/fragment/testing/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app.testing {
public final class FragmentScenario<F extends androidx.fragment.app.Fragment> {
diff --git a/fragment/testing/api/1.1.0-alpha03.txt b/fragment/testing/api/1.1.0-alpha03.txt
index a3d0790..8c83aa3 100644
--- a/fragment/testing/api/1.1.0-alpha03.txt
+++ b/fragment/testing/api/1.1.0-alpha03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app.testing {
public final class FragmentScenario<F extends androidx.fragment.app.Fragment> {
diff --git a/fragment/testing/api/1.1.0-alpha04.txt b/fragment/testing/api/1.1.0-alpha04.txt
index 6374c9f..8c83aa3 100644
--- a/fragment/testing/api/1.1.0-alpha04.txt
+++ b/fragment/testing/api/1.1.0-alpha04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app.testing {
public final class FragmentScenario<F extends androidx.fragment.app.Fragment> {
@@ -21,10 +21,6 @@
public final class FragmentScenarioKt {
ctor public FragmentScenarioKt();
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle! fragmentArgs = null, int themeResId = R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory! factory = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle! fragmentArgs = null, int themeResId = R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function1<? super android.os.Bundle,? extends F>! instantiate);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle! fragmentArgs = null, int themeResId = R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory! factory = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle! fragmentArgs = null, int themeResId = R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function1<? super android.os.Bundle,? extends F>! instantiate);
}
}
diff --git a/fragment/testing/api/1.1.0-alpha05.txt b/fragment/testing/api/1.1.0-alpha05.txt
deleted file mode 100644
index 6374c9f..0000000
--- a/fragment/testing/api/1.1.0-alpha05.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-// Signature format: 3.0
-package androidx.fragment.app.testing {
-
- public final class FragmentScenario<F extends androidx.fragment.app.Fragment> {
- method public static <F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launch(Class<F>);
- method public static <F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launch(Class<F>, android.os.Bundle?);
- method public static <F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launch(Class<F>, android.os.Bundle?, androidx.fragment.app.FragmentFactory?);
- method public static <F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launch(Class<F>, android.os.Bundle?, int, androidx.fragment.app.FragmentFactory?);
- method public static <F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launchInContainer(Class<F>);
- method public static <F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launchInContainer(Class<F>, android.os.Bundle?);
- method public static <F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launchInContainer(Class<F>, android.os.Bundle?, androidx.fragment.app.FragmentFactory?);
- method public static <F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F> launchInContainer(Class<F>, android.os.Bundle?, int, androidx.fragment.app.FragmentFactory?);
- method public androidx.fragment.app.testing.FragmentScenario<F> moveToState(androidx.lifecycle.Lifecycle.State);
- method public androidx.fragment.app.testing.FragmentScenario<F> onFragment(androidx.fragment.app.testing.FragmentScenario.FragmentAction<F>);
- method public androidx.fragment.app.testing.FragmentScenario<F> recreate();
- }
-
- public static interface FragmentScenario.FragmentAction<F extends androidx.fragment.app.Fragment> {
- method public void perform(F);
- }
-
- public final class FragmentScenarioKt {
- ctor public FragmentScenarioKt();
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle! fragmentArgs = null, int themeResId = R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory! factory = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle! fragmentArgs = null, int themeResId = R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function1<? super android.os.Bundle,? extends F>! instantiate);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle! fragmentArgs = null, int themeResId = R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory! factory = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle! fragmentArgs = null, int themeResId = R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function1<? super android.os.Bundle,? extends F>! instantiate);
- }
-
-}
-
diff --git a/fragment/testing/api/current.txt b/fragment/testing/api/current.txt
index 6374c9f..8c83aa3 100644
--- a/fragment/testing/api/current.txt
+++ b/fragment/testing/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.fragment.app.testing {
public final class FragmentScenario<F extends androidx.fragment.app.Fragment> {
@@ -21,10 +21,6 @@
public final class FragmentScenarioKt {
ctor public FragmentScenarioKt();
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle! fragmentArgs = null, int themeResId = R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory! factory = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F>! launchFragment(android.os.Bundle! fragmentArgs = null, int themeResId = R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function1<? super android.os.Bundle,? extends F>! instantiate);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle! fragmentArgs = null, int themeResId = R.style.FragmentScenarioEmptyFragmentActivityTheme, androidx.fragment.app.FragmentFactory! factory = null);
- method public static inline <reified F extends androidx.fragment.app.Fragment> androidx.fragment.app.testing.FragmentScenario<F>! launchFragmentInContainer(android.os.Bundle! fragmentArgs = null, int themeResId = R.style.FragmentScenarioEmptyFragmentActivityTheme, kotlin.jvm.functions.Function1<? super android.os.Bundle,? extends F>! instantiate);
}
}
diff --git a/fragment/testing/api/res-1.1.0-alpha05.txt b/fragment/testing/api/res-1.1.0-alpha05.txt
deleted file mode 100644
index e69de29..0000000
--- a/fragment/testing/api/res-1.1.0-alpha05.txt
+++ /dev/null
diff --git a/fragment/testing/api/restricted_1.1.0-alpha05.txt b/fragment/testing/api/restricted_1.1.0-alpha05.txt
deleted file mode 100644
index 6415760..0000000
--- a/fragment/testing/api/restricted_1.1.0-alpha05.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-// Signature format: 3.0
-package androidx.fragment.app.testing {
-
-
-
-}
-
diff --git a/fragment/testing/api/restricted_current.txt b/fragment/testing/api/restricted_current.txt
deleted file mode 100644
index 6415760..0000000
--- a/fragment/testing/api/restricted_current.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-// Signature format: 3.0
-package androidx.fragment.app.testing {
-
-
-
-}
-
diff --git a/fragment/testing/build.gradle b/fragment/testing/build.gradle
index 5e46add..0f69443 100644
--- a/fragment/testing/build.gradle
+++ b/fragment/testing/build.gradle
@@ -39,7 +39,6 @@
api(TEST_CORE)
api(KOTLIN_STDLIB)
androidTestImplementation(KOTLIN_STDLIB)
- androidTestImplementation(ESPRESSO_CORE)
androidTestImplementation(TEST_EXT_JUNIT)
androidTestImplementation(TEST_CORE)
androidTestImplementation(TEST_RUNNER)
diff --git a/fragment/testing/src/androidTest/java/androidx/fragment/app/testing/FragmentScenarioTest.kt b/fragment/testing/src/androidTest/java/androidx/fragment/app/testing/FragmentScenarioTest.kt
index b04ca7f..40ae535 100644
--- a/fragment/testing/src/androidTest/java/androidx/fragment/app/testing/FragmentScenarioTest.kt
+++ b/fragment/testing/src/androidTest/java/androidx/fragment/app/testing/FragmentScenarioTest.kt
@@ -16,24 +16,11 @@
package androidx.fragment.app.testing
-import android.app.UiModeManager
-import android.content.res.Configuration
import android.os.Bundle
-import androidx.core.content.ContextCompat.getSystemService
import androidx.fragment.app.FragmentFactory
-import androidx.fragment.testing.test.R.id.view_tag_id
import androidx.fragment.testing.test.R.style.ThemedFragmentTheme
-import androidx.lifecycle.GenericLifecycleObserver
-import androidx.lifecycle.Lifecycle
import androidx.lifecycle.Lifecycle.State
-import androidx.test.core.app.ApplicationProvider.getApplicationContext
-import androidx.test.espresso.Espresso.onView
-import androidx.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu
-import androidx.test.espresso.assertion.ViewAssertions.matches
-import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
-import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
@@ -54,7 +41,6 @@
* Verifies FragmentScenario API works consistently across different Android framework versions.
*/
@RunWith(AndroidJUnit4::class)
-@LargeTest
class FragmentScenarioTest {
@Test
fun launchFragment() {
@@ -194,33 +180,6 @@
}
@Test
- fun launchInContainerWithEarlyLifecycleCallbacks() {
- var tagSetBeforeOnStart = false
- with(launchFragmentInContainer {
- StateRecordingFragment().also { fragment ->
- fragment.viewLifecycleOwnerLiveData.observeForever { viewLifecycleOwner ->
- if (viewLifecycleOwner != null) {
- fragment.requireView().setTag(view_tag_id, "fakeNavController")
- }
- }
- fragment.lifecycle.addObserver(GenericLifecycleObserver { _, event ->
- if (event == Lifecycle.Event.ON_START) {
- tagSetBeforeOnStart =
- fragment.requireView().getTag(view_tag_id) == "fakeNavController"
- }
- })
- }
- }) {
- assertThat(tagSetBeforeOnStart).isTrue()
- onFragment { fragment ->
- assertThat(fragment.state).isEqualTo(State.RESUMED)
- assertThat(fragment.numberOfRecreations).isEqualTo(0)
- assertThat(fragment.isViewAttachedToWindow).isTrue()
- }
- }
- }
-
- @Test
fun fromResumedToCreated() {
with(launchFragmentInContainer<StateRecordingFragment>()) {
moveToState(State.CREATED)
@@ -432,19 +391,4 @@
}
}
}
-
- @Test
- fun fragmentWithOptionsMenu() {
- val uiModeManager = getSystemService(getApplicationContext(), UiModeManager::class.java)!!
- if (uiModeManager.currentModeType == Configuration.UI_MODE_TYPE_TELEVISION) {
- // Android TV does not support action bar.
- return
- }
-
- with(launchFragment<OptionsMenuFragment>()) {
- openActionBarOverflowOrOptionsMenu(getApplicationContext())
- onFragment { fragment -> fragment.requireActivity().openOptionsMenu() }
- onView(withText("Item1")).check(matches(isDisplayed()))
- }
- }
}
diff --git a/fragment/testing/src/androidTest/java/androidx/fragment/app/testing/FragmentScenarioViewModelTest.kt b/fragment/testing/src/androidTest/java/androidx/fragment/app/testing/FragmentScenarioViewModelTest.kt
index 763f36e..02f1149 100644
--- a/fragment/testing/src/androidTest/java/androidx/fragment/app/testing/FragmentScenarioViewModelTest.kt
+++ b/fragment/testing/src/androidTest/java/androidx/fragment/app/testing/FragmentScenarioViewModelTest.kt
@@ -21,7 +21,6 @@
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.MediumTest
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
@@ -33,7 +32,6 @@
* [ViewModelProvider.Factory] instance, allowing us to test the Fragment in isolation
*/
@RunWith(AndroidJUnit4::class)
-@MediumTest
class FragmentScenarioViewModelTest {
@Test
diff --git a/fragment/testing/src/androidTest/java/androidx/fragment/app/testing/OptionsMenuFragment.kt b/fragment/testing/src/androidTest/java/androidx/fragment/app/testing/OptionsMenuFragment.kt
deleted file mode 100644
index 5203b94..0000000
--- a/fragment/testing/src/androidTest/java/androidx/fragment/app/testing/OptionsMenuFragment.kt
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2019 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.fragment.app.testing
-
-import android.os.Bundle
-import android.view.Menu
-import android.view.MenuInflater
-import androidx.fragment.app.Fragment
-import androidx.fragment.testing.test.R
-
-/**
- * A minimum example Fragment with options menu for testing.
- */
-class OptionsMenuFragment : Fragment() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setHasOptionsMenu(true)
- }
-
- override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
- super.onCreateOptionsMenu(menu, inflater)
- inflater.inflate(R.menu.example_menu, menu)
- }
-}
\ No newline at end of file
diff --git a/fragment/testing/src/androidTest/res/menu/example_menu.xml b/fragment/testing/src/androidTest/res/menu/example_menu.xml
deleted file mode 100644
index 5bb7543..0000000
--- a/fragment/testing/src/androidTest/res/menu/example_menu.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2019 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.
- -->
-
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:title="Item1"/>
- <item android:title="Item2"/>
-</menu>
\ No newline at end of file
diff --git a/fragment/testing/src/androidTest/res/values/ids.xml b/fragment/testing/src/androidTest/res/values/ids.xml
deleted file mode 100644
index 6f11f71..0000000
--- a/fragment/testing/src/androidTest/res/values/ids.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<resources>
- <item type="id" name="view_tag_id" />
-</resources>
\ No newline at end of file
diff --git a/fragment/testing/src/main/java/androidx/fragment/app/testing/FragmentScenario.java b/fragment/testing/src/main/java/androidx/fragment/app/testing/FragmentScenario.java
index 473fa4a..5d691bf 100644
--- a/fragment/testing/src/main/java/androidx/fragment/app/testing/FragmentScenario.java
+++ b/fragment/testing/src/main/java/androidx/fragment/app/testing/FragmentScenario.java
@@ -75,7 +75,6 @@
+ ".THEME_EXTRAS_BUNDLE_KEY";
@Override
- @SuppressLint("RestrictedApi")
protected void onCreate(@Nullable Bundle savedInstanceState) {
setTheme(getIntent().getIntExtra(THEME_EXTRAS_BUNDLE_KEY,
R.style.FragmentScenarioEmptyFragmentActivityTheme));
@@ -324,6 +323,7 @@
* This method cannot be called from the main thread.
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public FragmentScenario<F> moveToState(@NonNull State newState) {
if (newState == State.DESTROYED) {
mActivityScenario.onActivity(
@@ -403,6 +403,7 @@
* This method cannot be called from the main thread.
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public FragmentScenario<F> onFragment(@NonNull final FragmentAction<F> action) {
mActivityScenario.onActivity(
new ActivityScenario.ActivityAction<EmptyFragmentActivity>() {
diff --git a/fragment/testing/src/main/res/values/styles.xml b/fragment/testing/src/main/res/values/styles.xml
index 4794e11..6d548ac 100644
--- a/fragment/testing/src/main/res/values/styles.xml
+++ b/fragment/testing/src/main/res/values/styles.xml
@@ -15,7 +15,7 @@
~ limitations under the License.
-->
<resources xmlns:tools="http://schemas.android.com/tools">
- <style name="FragmentScenarioEmptyFragmentActivityTheme" parent="android:Theme.WithActionBar">
+ <style name="FragmentScenarioEmptyFragmentActivityTheme" parent="android:Theme">
<item name="android:windowIsFloating">false</item>
</style>
</resources>
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index c788833..029c802 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -4,4 +4,3 @@
org.gradle.parallel=true
org.gradle.caching=true
android.builder.sdkDownload=false
-android.enableR8=false
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 077f056..1fbd12d 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=../../../../tools/external/gradle/gradle-5.1.1-bin.zip
+distributionUrl=../../../../tools/external/gradle/gradle-5.0-bin.zip
diff --git a/graphics/drawable/animated/api/1.0.0.txt b/graphics/drawable/animated/api/1.0.0.txt
index 7542e29..a81c3a2 100644
--- a/graphics/drawable/animated/api/1.0.0.txt
+++ b/graphics/drawable/animated/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.vectordrawable.graphics.drawable {
public interface Animatable2Compat extends android.graphics.drawable.Animatable {
diff --git a/graphics/drawable/animated/api/1.1.0-alpha01.txt b/graphics/drawable/animated/api/1.1.0-alpha01.txt
index 7542e29..a81c3a2 100644
--- a/graphics/drawable/animated/api/1.1.0-alpha01.txt
+++ b/graphics/drawable/animated/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.vectordrawable.graphics.drawable {
public interface Animatable2Compat extends android.graphics.drawable.Animatable {
diff --git a/graphics/drawable/animated/api/1.1.0-alpha02.txt b/graphics/drawable/animated/api/1.1.0-alpha02.txt
deleted file mode 100644
index 7542e29..0000000
--- a/graphics/drawable/animated/api/1.1.0-alpha02.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-// Signature format: 3.0
-package androidx.vectordrawable.graphics.drawable {
-
- public interface Animatable2Compat extends android.graphics.drawable.Animatable {
- method public void clearAnimationCallbacks();
- method public void registerAnimationCallback(androidx.vectordrawable.graphics.drawable.Animatable2Compat.AnimationCallback);
- method public boolean unregisterAnimationCallback(androidx.vectordrawable.graphics.drawable.Animatable2Compat.AnimationCallback);
- }
-
- public abstract static class Animatable2Compat.AnimationCallback {
- ctor public Animatable2Compat.AnimationCallback();
- method public void onAnimationEnd(android.graphics.drawable.Drawable!);
- method public void onAnimationStart(android.graphics.drawable.Drawable!);
- }
-
- public class AnimatedVectorDrawableCompat extends android.graphics.drawable.Drawable implements androidx.vectordrawable.graphics.drawable.Animatable2Compat androidx.core.graphics.drawable.TintAwareDrawable {
- method public void clearAnimationCallbacks();
- method public static void clearAnimationCallbacks(android.graphics.drawable.Drawable!);
- method public static androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat? create(android.content.Context, @DrawableRes int);
- method public static androidx.vectordrawable.graphics.drawable.AnimatedVectorDrawableCompat! createFromXmlInner(android.content.Context!, android.content.res.Resources!, org.xmlpull.v1.XmlPullParser!, android.util.AttributeSet!, android.content.res.Resources.Theme!) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public void draw(android.graphics.Canvas!);
- method public int getOpacity();
- method public boolean isRunning();
- method public void registerAnimationCallback(androidx.vectordrawable.graphics.drawable.Animatable2Compat.AnimationCallback);
- method public static void registerAnimationCallback(android.graphics.drawable.Drawable!, androidx.vectordrawable.graphics.drawable.Animatable2Compat.AnimationCallback!);
- method public void setAlpha(int);
- method public void setColorFilter(android.graphics.ColorFilter!);
- method public void start();
- method public void stop();
- method public boolean unregisterAnimationCallback(androidx.vectordrawable.graphics.drawable.Animatable2Compat.AnimationCallback);
- method public static boolean unregisterAnimationCallback(android.graphics.drawable.Drawable!, androidx.vectordrawable.graphics.drawable.Animatable2Compat.AnimationCallback!);
- }
-
-}
-
diff --git a/graphics/drawable/animated/api/current.txt b/graphics/drawable/animated/api/current.txt
index 7542e29..a81c3a2 100644
--- a/graphics/drawable/animated/api/current.txt
+++ b/graphics/drawable/animated/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.vectordrawable.graphics.drawable {
public interface Animatable2Compat extends android.graphics.drawable.Animatable {
diff --git a/graphics/drawable/animated/api/res-1.1.0-alpha02.txt b/graphics/drawable/animated/api/res-1.1.0-alpha02.txt
deleted file mode 100644
index e69de29..0000000
--- a/graphics/drawable/animated/api/res-1.1.0-alpha02.txt
+++ /dev/null
diff --git a/graphics/drawable/animated/api/restricted_1.0.0.txt b/graphics/drawable/animated/api/restricted_1.0.0.txt
deleted file mode 100644
index 7303fb4..0000000
--- a/graphics/drawable/animated/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-// Signature format: 3.0
-package androidx.vectordrawable.graphics.drawable {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class AnimationUtilsCompat {
- method public static android.view.animation.Interpolator! loadInterpolator(android.content.Context!, int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class AnimatorInflaterCompat {
- method public static android.animation.Animator! loadAnimator(android.content.Context!, @AnimatorRes int);
- method public static android.animation.Animator! loadAnimator(android.content.Context!, android.content.res.Resources!, android.content.res.Resources.Theme!, @AnimatorRes int);
- method public static android.animation.Animator! loadAnimator(android.content.Context!, android.content.res.Resources!, android.content.res.Resources.Theme!, @AnimatorRes int, float);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ArgbEvaluator {
- ctor public ArgbEvaluator();
- method public Object! evaluate(float, Object!, Object!);
- method public static androidx.vectordrawable.graphics.drawable.ArgbEvaluator! getInstance();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class PathInterpolatorCompat {
- ctor public PathInterpolatorCompat(android.content.Context!, android.util.AttributeSet!, org.xmlpull.v1.XmlPullParser!);
- ctor public PathInterpolatorCompat(android.content.res.Resources!, android.content.res.Resources.Theme!, android.util.AttributeSet!, org.xmlpull.v1.XmlPullParser!);
- method public float getInterpolation(float);
- field public static final double EPSILON = 1.0E-5;
- field public static final int MAX_NUM_POINTS = 3000; // 0xbb8
- }
-
-}
-
diff --git a/graphics/drawable/animated/api/restricted_1.1.0-alpha02.txt b/graphics/drawable/animated/api/restricted_1.1.0-alpha02.txt
deleted file mode 100644
index ceab395..0000000
--- a/graphics/drawable/animated/api/restricted_1.1.0-alpha02.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-// Signature format: 3.0
-package androidx.vectordrawable.graphics.drawable {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class AnimationUtilsCompat {
- method public static android.view.animation.Interpolator! loadInterpolator(android.content.Context!, int) throws android.content.res.Resources.NotFoundException;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class AnimatorInflaterCompat {
- method public static android.animation.Animator! loadAnimator(android.content.Context!, @AnimatorRes int) throws android.content.res.Resources.NotFoundException;
- method public static android.animation.Animator! loadAnimator(android.content.Context!, android.content.res.Resources!, android.content.res.Resources.Theme!, @AnimatorRes int) throws android.content.res.Resources.NotFoundException;
- method public static android.animation.Animator! loadAnimator(android.content.Context!, android.content.res.Resources!, android.content.res.Resources.Theme!, @AnimatorRes int, float) throws android.content.res.Resources.NotFoundException;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ArgbEvaluator implements android.animation.TypeEvaluator {
- ctor public ArgbEvaluator();
- method public Object! evaluate(float, Object!, Object!);
- method public static androidx.vectordrawable.graphics.drawable.ArgbEvaluator! getInstance();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PathInterpolatorCompat implements android.view.animation.Interpolator {
- ctor public PathInterpolatorCompat(android.content.Context!, android.util.AttributeSet!, org.xmlpull.v1.XmlPullParser!);
- ctor public PathInterpolatorCompat(android.content.res.Resources!, android.content.res.Resources.Theme!, android.util.AttributeSet!, org.xmlpull.v1.XmlPullParser!);
- method public float getInterpolation(float);
- field public static final double EPSILON = 1.0E-5;
- field public static final int MAX_NUM_POINTS = 3000; // 0xbb8
- }
-
-}
-
diff --git a/graphics/drawable/animated/api/restricted_current.txt b/graphics/drawable/animated/api/restricted_current.txt
deleted file mode 100644
index ceab395..0000000
--- a/graphics/drawable/animated/api/restricted_current.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-// Signature format: 3.0
-package androidx.vectordrawable.graphics.drawable {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class AnimationUtilsCompat {
- method public static android.view.animation.Interpolator! loadInterpolator(android.content.Context!, int) throws android.content.res.Resources.NotFoundException;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class AnimatorInflaterCompat {
- method public static android.animation.Animator! loadAnimator(android.content.Context!, @AnimatorRes int) throws android.content.res.Resources.NotFoundException;
- method public static android.animation.Animator! loadAnimator(android.content.Context!, android.content.res.Resources!, android.content.res.Resources.Theme!, @AnimatorRes int) throws android.content.res.Resources.NotFoundException;
- method public static android.animation.Animator! loadAnimator(android.content.Context!, android.content.res.Resources!, android.content.res.Resources.Theme!, @AnimatorRes int, float) throws android.content.res.Resources.NotFoundException;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ArgbEvaluator implements android.animation.TypeEvaluator {
- ctor public ArgbEvaluator();
- method public Object! evaluate(float, Object!, Object!);
- method public static androidx.vectordrawable.graphics.drawable.ArgbEvaluator! getInstance();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PathInterpolatorCompat implements android.view.animation.Interpolator {
- ctor public PathInterpolatorCompat(android.content.Context!, android.util.AttributeSet!, org.xmlpull.v1.XmlPullParser!);
- ctor public PathInterpolatorCompat(android.content.res.Resources!, android.content.res.Resources.Theme!, android.util.AttributeSet!, org.xmlpull.v1.XmlPullParser!);
- method public float getInterpolation(float);
- field public static final double EPSILON = 1.0E-5;
- field public static final int MAX_NUM_POINTS = 3000; // 0xbb8
- }
-
-}
-
diff --git a/graphics/drawable/animated/build.gradle b/graphics/drawable/animated/build.gradle
index 4ce8b2a..e0dd10b 100644
--- a/graphics/drawable/animated/build.gradle
+++ b/graphics/drawable/animated/build.gradle
@@ -9,7 +9,6 @@
dependencies {
api(project(":vectordrawable"))
implementation(project(":interpolator"))
- implementation(project(":collection"))
androidTestImplementation(TEST_EXT_JUNIT)
androidTestImplementation(TEST_CORE)
diff --git a/graphics/drawable/animated/src/androidTest/java/androidx/vectordrawable/graphics/drawable/tests/AnimatedVectorDrawableParameterizedTest.java b/graphics/drawable/animated/src/androidTest/java/androidx/vectordrawable/graphics/drawable/tests/AnimatedVectorDrawableParameterizedTest.java
index 5139ae2..b16e820 100644
--- a/graphics/drawable/animated/src/androidTest/java/androidx/vectordrawable/graphics/drawable/tests/AnimatedVectorDrawableParameterizedTest.java
+++ b/graphics/drawable/animated/src/androidTest/java/androidx/vectordrawable/graphics/drawable/tests/AnimatedVectorDrawableParameterizedTest.java
@@ -26,7 +26,7 @@
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
import androidx.vectordrawable.graphics.drawable.Animatable2Compat.AnimationCallback;
@@ -42,7 +42,7 @@
import java.util.Arrays;
import java.util.Collection;
-@SmallTest
+@MediumTest
@RunWith(Parameterized.class)
public class AnimatedVectorDrawableParameterizedTest {
@Rule public final ActivityTestRule<DrawableStubActivity> mActivityTestRule =
diff --git a/graphics/drawable/animated/src/androidTest/java/androidx/vectordrawable/graphics/drawable/tests/AnimatedVectorDrawableTest.java b/graphics/drawable/animated/src/androidTest/java/androidx/vectordrawable/graphics/drawable/tests/AnimatedVectorDrawableTest.java
index 0a9b2f9..a7e7b8f 100644
--- a/graphics/drawable/animated/src/androidTest/java/androidx/vectordrawable/graphics/drawable/tests/AnimatedVectorDrawableTest.java
+++ b/graphics/drawable/animated/src/androidTest/java/androidx/vectordrawable/graphics/drawable/tests/AnimatedVectorDrawableTest.java
@@ -42,7 +42,7 @@
import androidx.core.view.ViewCompat;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
import androidx.vectordrawable.graphics.drawable.Animatable2Compat.AnimationCallback;
@@ -61,7 +61,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class AnimatedVectorDrawableTest {
@Rule public final ActivityTestRule<DrawableStubActivity> mActivityTestRule;
diff --git a/graphics/drawable/animated/src/androidTest/java/androidx/vectordrawable/graphics/drawable/tests/PathInterpolatorValueParameterizedTest.java b/graphics/drawable/animated/src/androidTest/java/androidx/vectordrawable/graphics/drawable/tests/PathInterpolatorValueParameterizedTest.java
index 126f19c..d3f08a7 100644
--- a/graphics/drawable/animated/src/androidTest/java/androidx/vectordrawable/graphics/drawable/tests/PathInterpolatorValueParameterizedTest.java
+++ b/graphics/drawable/animated/src/androidTest/java/androidx/vectordrawable/graphics/drawable/tests/PathInterpolatorValueParameterizedTest.java
@@ -21,7 +21,7 @@
import android.app.Activity;
import android.view.animation.Interpolator;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import androidx.vectordrawable.graphics.drawable.AnimationUtilsCompat;
import androidx.vectordrawable.test.R;
@@ -35,7 +35,7 @@
import java.util.Arrays;
import java.util.Collection;
-@SmallTest
+@MediumTest
@RunWith(Parameterized.class)
public class PathInterpolatorValueParameterizedTest {
private static final float EPSILON = 1e-3f;
diff --git a/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/AnimationUtilsCompat.java b/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/AnimationUtilsCompat.java
index d560b87..2110f3c 100644
--- a/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/AnimationUtilsCompat.java
+++ b/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/AnimationUtilsCompat.java
@@ -16,7 +16,7 @@
package androidx.vectordrawable.graphics.drawable;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Resources;
@@ -52,7 +52,7 @@
* Defines common utilities for working with animations.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class AnimationUtilsCompat {
/**
* Loads an {@link Interpolator} object from a resource
diff --git a/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/AnimatorInflaterCompat.java b/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/AnimatorInflaterCompat.java
index cc797b0..f60713e 100644
--- a/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/AnimatorInflaterCompat.java
+++ b/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/AnimatorInflaterCompat.java
@@ -16,7 +16,7 @@
package androidx.vectordrawable.graphics.drawable;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static java.lang.Math.min;
@@ -65,7 +65,7 @@
* <em>something</em> file.)
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class AnimatorInflaterCompat {
private static final String TAG = "AnimatorInflater";
/**
diff --git a/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/ArgbEvaluator.java b/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/ArgbEvaluator.java
index e0fdf6e..9225ef2 100644
--- a/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/ArgbEvaluator.java
+++ b/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/ArgbEvaluator.java
@@ -16,7 +16,7 @@
package androidx.vectordrawable.graphics.drawable;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
@@ -28,7 +28,7 @@
* values that represent ARGB colors.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ArgbEvaluator implements TypeEvaluator {
private static final ArgbEvaluator sInstance = new ArgbEvaluator();
diff --git a/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/PathInterpolatorCompat.java b/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/PathInterpolatorCompat.java
index a18f8d3..e611c8e 100644
--- a/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/PathInterpolatorCompat.java
+++ b/graphics/drawable/animated/src/main/java/androidx/vectordrawable/graphics/drawable/PathInterpolatorCompat.java
@@ -15,7 +15,7 @@
*/
package androidx.vectordrawable.graphics.drawable;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static java.lang.Math.abs;
import static java.lang.Math.min;
@@ -52,7 +52,7 @@
* </pre></blockquote></p>
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class PathInterpolatorCompat implements Interpolator {
// This governs how accurate the approximation of the Path is.
diff --git a/graphics/drawable/static/api/1.0.0.txt b/graphics/drawable/static/api/1.0.0.txt
index 3fda85b..53c58ae7 100644
--- a/graphics/drawable/static/api/1.0.0.txt
+++ b/graphics/drawable/static/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.vectordrawable.graphics.drawable {
public class VectorDrawableCompat extends android.graphics.drawable.Drawable implements androidx.core.graphics.drawable.TintAwareDrawable {
diff --git a/graphics/drawable/static/api/1.1.0-alpha01.txt b/graphics/drawable/static/api/1.1.0-alpha01.txt
index 3fda85b..53c58ae7 100644
--- a/graphics/drawable/static/api/1.1.0-alpha01.txt
+++ b/graphics/drawable/static/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.vectordrawable.graphics.drawable {
public class VectorDrawableCompat extends android.graphics.drawable.Drawable implements androidx.core.graphics.drawable.TintAwareDrawable {
diff --git a/graphics/drawable/static/api/1.1.0-alpha02.txt b/graphics/drawable/static/api/1.1.0-alpha02.txt
deleted file mode 100644
index 3fda85b..0000000
--- a/graphics/drawable/static/api/1.1.0-alpha02.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.vectordrawable.graphics.drawable {
-
- public class VectorDrawableCompat extends android.graphics.drawable.Drawable implements androidx.core.graphics.drawable.TintAwareDrawable {
- method public static androidx.vectordrawable.graphics.drawable.VectorDrawableCompat? create(android.content.res.Resources, @DrawableRes int, android.content.res.Resources.Theme?);
- method public static androidx.vectordrawable.graphics.drawable.VectorDrawableCompat! createFromXmlInner(android.content.res.Resources!, org.xmlpull.v1.XmlPullParser!, android.util.AttributeSet!, android.content.res.Resources.Theme!) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
- method public void draw(android.graphics.Canvas!);
- method public int getOpacity();
- method public void setAlpha(int);
- method public void setColorFilter(android.graphics.ColorFilter!);
- }
-
-}
-
diff --git a/graphics/drawable/static/api/current.txt b/graphics/drawable/static/api/current.txt
index 3fda85b..53c58ae7 100644
--- a/graphics/drawable/static/api/current.txt
+++ b/graphics/drawable/static/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.vectordrawable.graphics.drawable {
public class VectorDrawableCompat extends android.graphics.drawable.Drawable implements androidx.core.graphics.drawable.TintAwareDrawable {
diff --git a/graphics/drawable/static/api/res-1.1.0-alpha02.txt b/graphics/drawable/static/api/res-1.1.0-alpha02.txt
deleted file mode 100644
index e69de29..0000000
--- a/graphics/drawable/static/api/res-1.1.0-alpha02.txt
+++ /dev/null
diff --git a/graphics/drawable/static/api/restricted_1.0.0.txt b/graphics/drawable/static/api/restricted_1.0.0.txt
deleted file mode 100644
index 3606d51..0000000
--- a/graphics/drawable/static/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.vectordrawable.graphics.drawable {
-
- public class VectorDrawableCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public float getPixelSize();
- }
-
-}
-
diff --git a/graphics/drawable/static/api/restricted_1.1.0-alpha02.txt b/graphics/drawable/static/api/restricted_1.1.0-alpha02.txt
deleted file mode 100644
index dadafcd..0000000
--- a/graphics/drawable/static/api/restricted_1.1.0-alpha02.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.vectordrawable.graphics.drawable {
-
- public class VectorDrawableCompat extends android.graphics.drawable.Drawable implements androidx.core.graphics.drawable.TintAwareDrawable {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public float getPixelSize();
- }
-
-}
-
diff --git a/graphics/drawable/static/api/restricted_current.txt b/graphics/drawable/static/api/restricted_current.txt
deleted file mode 100644
index dadafcd..0000000
--- a/graphics/drawable/static/api/restricted_current.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.vectordrawable.graphics.drawable {
-
- public class VectorDrawableCompat extends android.graphics.drawable.Drawable implements androidx.core.graphics.drawable.TintAwareDrawable {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public float getPixelSize();
- }
-
-}
-
diff --git a/graphics/drawable/static/build.gradle b/graphics/drawable/static/build.gradle
index ea9130d..2dc3d55 100644
--- a/graphics/drawable/static/build.gradle
+++ b/graphics/drawable/static/build.gradle
@@ -7,9 +7,8 @@
}
dependencies {
- api(project(":annotation"))
+ api("androidx.annotation:annotation:1.0.0")
api(project(":core"))
- implementation(project(":collection"))
androidTestImplementation(TEST_EXT_JUNIT)
androidTestImplementation(TEST_CORE)
diff --git a/graphics/drawable/static/src/main/java/androidx/vectordrawable/graphics/drawable/VectorDrawableCompat.java b/graphics/drawable/static/src/main/java/androidx/vectordrawable/graphics/drawable/VectorDrawableCompat.java
index 68bac39..bd9e707 100644
--- a/graphics/drawable/static/src/main/java/androidx/vectordrawable/graphics/drawable/VectorDrawableCompat.java
+++ b/graphics/drawable/static/src/main/java/androidx/vectordrawable/graphics/drawable/VectorDrawableCompat.java
@@ -22,7 +22,7 @@
import static android.graphics.Paint.Style.FILL;
import static android.graphics.Paint.Style.STROKE;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.res.ColorStateList;
@@ -613,7 +613,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public float getPixelSize() {
if (mVectorState == null || mVectorState.mVPathRenderer == null
|| mVectorState.mVPathRenderer.mBaseWidth == 0
diff --git a/gridlayout/api/1.0.0.txt b/gridlayout/api/1.0.0.txt
index 1c7a068..9c7a8da 100644
--- a/gridlayout/api/1.0.0.txt
+++ b/gridlayout/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.gridlayout.widget {
public class GridLayout extends android.view.ViewGroup {
diff --git a/gridlayout/api/1.1.0-alpha01.txt b/gridlayout/api/1.1.0-alpha01.txt
index 1c7a068..9c7a8da 100644
--- a/gridlayout/api/1.1.0-alpha01.txt
+++ b/gridlayout/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.gridlayout.widget {
public class GridLayout extends android.view.ViewGroup {
diff --git a/gridlayout/api/current.txt b/gridlayout/api/current.txt
index 1c7a068..9c7a8da 100644
--- a/gridlayout/api/current.txt
+++ b/gridlayout/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.gridlayout.widget {
public class GridLayout extends android.view.ViewGroup {
diff --git a/gridlayout/api/restricted_1.0.0.txt b/gridlayout/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/gridlayout/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/gridlayout/api/restricted_1.1.0-alpha01.txt b/gridlayout/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/gridlayout/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/gridlayout/api/restricted_current.txt b/gridlayout/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/gridlayout/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/gridlayout/src/androidTest/java/androidx/gridlayout/widget/GridLayoutTest.java b/gridlayout/src/androidTest/java/androidx/gridlayout/widget/GridLayoutTest.java
index 2c06b25..888e61a 100644
--- a/gridlayout/src/androidTest/java/androidx/gridlayout/widget/GridLayoutTest.java
+++ b/gridlayout/src/androidTest/java/androidx/gridlayout/widget/GridLayoutTest.java
@@ -30,7 +30,7 @@
import androidx.gridlayout.test.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -39,7 +39,7 @@
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class GridLayoutTest {
@Rule public final ActivityTestRule<GridLayoutTestActivity> mActivityTestRule;
diff --git a/heifwriter/api/1.0.0.txt b/heifwriter/api/1.0.0.txt
index 607f763..5403f3e 100644
--- a/heifwriter/api/1.0.0.txt
+++ b/heifwriter/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.heifwriter {
public final class HeifWriter implements java.lang.AutoCloseable {
diff --git a/heifwriter/api/1.1.0-alpha01.txt b/heifwriter/api/1.1.0-alpha01.txt
deleted file mode 100644
index 607f763..0000000
--- a/heifwriter/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-// Signature format: 3.0
-package androidx.heifwriter {
-
- public final class HeifWriter implements java.lang.AutoCloseable {
- method public void addBitmap(android.graphics.Bitmap);
- method public void addExifData(int, byte[], int, int);
- method public void addYuvBuffer(int, byte[]);
- method public void close();
- method public android.view.Surface getInputSurface();
- method public void setInputEndOfStreamTimestamp(long);
- method public void start();
- method public void stop(long) throws java.lang.Exception;
- field public static final int INPUT_MODE_BITMAP = 2; // 0x2
- field public static final int INPUT_MODE_BUFFER = 0; // 0x0
- field public static final int INPUT_MODE_SURFACE = 1; // 0x1
- }
-
- public static final class HeifWriter.Builder {
- ctor public HeifWriter.Builder(String, int, int, int);
- ctor public HeifWriter.Builder(java.io.FileDescriptor, int, int, int);
- method public androidx.heifwriter.HeifWriter! build() throws java.io.IOException;
- method public androidx.heifwriter.HeifWriter.Builder! setGridEnabled(boolean);
- method public androidx.heifwriter.HeifWriter.Builder! setHandler(android.os.Handler?);
- method public androidx.heifwriter.HeifWriter.Builder! setMaxImages(int);
- method public androidx.heifwriter.HeifWriter.Builder! setPrimaryIndex(int);
- method public androidx.heifwriter.HeifWriter.Builder! setQuality(int);
- method public androidx.heifwriter.HeifWriter.Builder! setRotation(int);
- }
-
-}
-
diff --git a/heifwriter/api/current.txt b/heifwriter/api/current.txt
index 607f763..5403f3e 100644
--- a/heifwriter/api/current.txt
+++ b/heifwriter/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.heifwriter {
public final class HeifWriter implements java.lang.AutoCloseable {
diff --git a/heifwriter/api/res-1.1.0-alpha01.txt b/heifwriter/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/heifwriter/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/heifwriter/api/restricted_1.0.0.txt b/heifwriter/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/heifwriter/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/heifwriter/api/restricted_1.1.0-alpha01.txt b/heifwriter/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/heifwriter/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/heifwriter/api/restricted_current.txt b/heifwriter/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/heifwriter/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/interpolator/api/1.0.0.txt b/interpolator/api/1.0.0.txt
index 5ce1a38..83c2124f 100644
--- a/interpolator/api/1.0.0.txt
+++ b/interpolator/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.interpolator.view.animation {
public class FastOutLinearInInterpolator implements android.view.animation.Interpolator {
diff --git a/interpolator/api/1.1.0-alpha01.txt b/interpolator/api/1.1.0-alpha01.txt
deleted file mode 100644
index 5ce1a38..0000000
--- a/interpolator/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-// Signature format: 3.0
-package androidx.interpolator.view.animation {
-
- public class FastOutLinearInInterpolator implements android.view.animation.Interpolator {
- ctor public FastOutLinearInInterpolator();
- method public float getInterpolation(float);
- }
-
- public class FastOutSlowInInterpolator implements android.view.animation.Interpolator {
- ctor public FastOutSlowInInterpolator();
- method public float getInterpolation(float);
- }
-
- public class LinearOutSlowInInterpolator implements android.view.animation.Interpolator {
- ctor public LinearOutSlowInInterpolator();
- method public float getInterpolation(float);
- }
-
-}
-
diff --git a/interpolator/api/current.txt b/interpolator/api/current.txt
index 5ce1a38..83c2124f 100644
--- a/interpolator/api/current.txt
+++ b/interpolator/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.interpolator.view.animation {
public class FastOutLinearInInterpolator implements android.view.animation.Interpolator {
diff --git a/interpolator/api/res-1.1.0-alpha01.txt b/interpolator/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/interpolator/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/interpolator/api/restricted_1.0.0.txt b/interpolator/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/interpolator/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/interpolator/api/restricted_1.1.0-alpha01.txt b/interpolator/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/interpolator/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/interpolator/api/restricted_current.txt b/interpolator/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/interpolator/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/jetifier/jetifier/core/src/main/kotlin/com/android/tools/build/jetifier/core/type/TypesMap.kt b/jetifier/jetifier/core/src/main/kotlin/com/android/tools/build/jetifier/core/type/TypesMap.kt
index 20f6ccb..eba019a 100644
--- a/jetifier/jetifier/core/src/main/kotlin/com/android/tools/build/jetifier/core/type/TypesMap.kt
+++ b/jetifier/jetifier/core/src/main/kotlin/com/android/tools/build/jetifier/core/type/TypesMap.kt
@@ -151,9 +151,5 @@
.toMap())
}
}
-
- fun getClassMappings(): Map<JavaType, JavaType> {
- // Create new map to avoid mutation.
- return HashMap<JavaType, JavaType>(types)
- }
}
+
diff --git a/jetifier/jetifier/core/src/main/resources/default.config b/jetifier/jetifier/core/src/main/resources/default.config
index c39f546..2870274 100644
--- a/jetifier/jetifier/core/src/main/resources/default.config
+++ b/jetifier/jetifier/core/src/main/resources/default.config
@@ -43,11 +43,6 @@
"from": "android/support/test/((.*)/)?internal/(.*)",
"to": "ignore"
},
- # b/123651524
- {
- "from": "android/support/v4/os/ResultReceiver(.*)",
- "to": "ignore"
- },
# Don't transform parcelizer generated classes
# This maintains compatibility across dejetified and androidx libraries
{
@@ -960,6 +955,24 @@
"to": "ignore"
},
+ #Activity
+ {
+ "from": "androidx/activity/(.*)",
+ "to": "ignore"
+ },
+
+ #SavedState
+ {
+ "from": "androidx/savedstate/(.*)",
+ "to": "ignore"
+ },
+
+ #RemoteCallback
+ {
+ "from": "androidx/remotecallback/(.*)",
+ "to": "ignore"
+ },
+
# Fallback for new media stuff
{
"from": "androidx/media/(.*)",
@@ -1217,6 +1230,22 @@
"to" = "androidx/versionedparcelable"
},
{
+ "from" = "androidx/remotecallback",
+ "to" = "androidx/remotecallback"
+ },
+ {
+ "from" = "androidx/activity",
+ "to" = "androidx/activity"
+ },
+ {
+ "from" = "androidx/savedstate/bundle",
+ "to" = "androidx/savedstate/bundle"
+ },
+ {
+ "from" = "androidx/savedstate/common",
+ "to" = "androidx/savedstate/common"
+ },
+ {
"from" = "androidx/slice/view",
"to" = "androidx/slice/view"
},
@@ -1307,6 +1336,18 @@
"to": { "groupId": "androidx.vectordrawable", "artifactId": "vectordrawable-animated", "version": "{newSlVersion}" }
},
{
+ "from": { "groupId": "androidx.activity", "artifactId": "activity", "version": "{newSlVersion}" },
+ "to": { "groupId": "androidx.activity", "artifactId": "activity", "version": "{newSlVersion}" }
+ },
+ {
+ "from": { "groupId": "androidx.savedstate", "artifactId": "savedstate-common", "version": "{newSlVersion}" },
+ "to": { "groupId": "androidx.savedstate", "artifactId": "savedstate-common", "version": "{newSlVersion}" }
+ },
+ {
+ "from": { "groupId": "androidx.savedstate", "artifactId": "savedstate-bundle", "version": "{newSlVersion}" },
+ "to": { "groupId": "androidx.savedstate", "artifactId": "savedstate-bundle", "version": "{newSlVersion}" }
+ },
+ {
"from": { "groupId": "com.android.support", "artifactId": "appcompat-v7", "version": "{oldSlVersion}" },
"to": { "groupId": "androidx.appcompat", "artifactId": "appcompat", "version": "{newSlVersion}" }
},
@@ -1526,6 +1567,10 @@
"from": { "groupId": "com.android.support", "artifactId": "versionedparcelable", "version": "{oldSlVersion}" },
"to": { "groupId": "androidx.versionedparcelable", "artifactId": "versionedparcelable", "version": "{newSlVersion}" }
},
+ {
+ "from": { "groupId": "androidx.remotecallback", "artifactId": "remotecallback", "version": "{newSlVersion}" },
+ "to": { "groupId": "androidx.remotecallback", "artifactId": "remotecallback", "version": "{newSlVersion}" }
+ },
#{
# "from": { "groupId": "android.arch.background.workmanager", "artifactId": "workmanager", "version": "{newArchVersion}" },
# "to": { "groupId": "androidx.work", "artifactId": "runtime", "version": "{newArchVersion}" }
@@ -1644,11 +1689,11 @@
},
{
"from": { "groupId": "com.android.support.constraint", "artifactId": "constraint-layout", "version": "1.1.0" },
- "to": { "groupId": "androidx.constraintlayout", "artifactId": "constraintlayout", "version": "1.1.3" }
+ "to": { "groupId": "androidx.constraintlayout", "artifactId": "constraintlayout", "version": "1.1.2" }
},
{
"from": { "groupId": "com.android.support.constraint", "artifactId": "constraint-layout-solver", "version": "1.1.0" },
- "to": { "groupId": "androidx.constraintlayout", "artifactId": "constraintlayout-solver", "version": "1.1.3" }
+ "to": { "groupId": "androidx.constraintlayout", "artifactId": "constraintlayout-solver", "version": "1.1.2" }
},
{
"from": { "groupId": "com.android.support.test", "artifactId": "orchestrator", "version": "1.0.2" },
@@ -1714,11 +1759,6 @@
"from": { "groupId": "com.android.support.test.uiautomator", "artifactId": "uiautomator", "version": "2.1.3" },
"to": { "groupId": "androidx.test.uiautomator", "artifactId": "uiautomator", "version": "{newUiAutomatorVersion}" }
},
- # b/123060356
- {
- "from": { "groupId": "com.android.support.test.uiautomator", "artifactId": "uiautomator-v18", "version": "2.1.3" },
- "to": { "groupId": "androidx.test.uiautomator", "artifactId": "uiautomator", "version": "{newUiAutomatorVersion}" }
- },
#{
# "from": { "groupId": "com.android.support.test", "artifactId": "testing-support-lib", "version": "0.1" },
# "to": { "groupId": "androidx.test", "artifactId": "test", "version": "{newSlVersion}" }
@@ -1765,7 +1805,7 @@
"oldSlVersion": "28.0.0",
"oldMaterialVersion": "28.0.0",
"oldRoomVersion": "1.1.0",
- "oldCarVersion": "28.0.0-alpha5",
+ "oldCarVersion": "28.0.0-alpha6",
"oldMediarouterVersion": "28.0.0-alpha5",
"oldMedia2Version": "28.0.0-alpha03",
"oldExoplayerVersion": "28.0.0-alpha01",
@@ -1774,13 +1814,13 @@
"newMaterialVersion": "1.0.0",
"newArchCoreVersion": "2.0.0",
"newLifecycleVersion": "2.0.0",
- "newPagingVersion": "2.0.0",
- "newRoomVersion": "2.0.0",
+ "newPagingVersion": "2.0.0-rc01",
+ "newRoomVersion": "2.0.0-rc01",
"newEspressoVersion": "3.1.0-alpha3",
"newTestsVersion": "1.1.0-alpha3",
"newJankTestHelperVersion": "1.0.1-alpha3",
"newUiAutomatorVersion": "2.2.0-alpha3",
- "newCarVersion": "1.0.0-alpha5",
+ "newCarVersion": "1.0.0-alpha6",
"newMediarouterVersion": "1.0.0-alpha5",
"newMedia2Version": "1.0.0-alpha03",
"newExoplayerVersion": "1.0.0-alpha01",
diff --git a/jetifier/jetifier/core/src/main/resources/default.generated.config b/jetifier/jetifier/core/src/main/resources/default.generated.config
index 7c257f0..e1119de 100644
--- a/jetifier/jetifier/core/src/main/resources/default.generated.config
+++ b/jetifier/jetifier/core/src/main/resources/default.generated.config
@@ -45,10 +45,6 @@
"to": "ignore"
},
{
- "from": "android/support/v4/os/ResultReceiver(.*)",
- "to": "ignore"
- },
- {
"from": "(.*)Parcelizer",
"to": "{0}Parcelizer"
},
@@ -915,6 +911,18 @@
"to": "ignore"
},
{
+ "from": "androidx/activity/(.*)",
+ "to": "ignore"
+ },
+ {
+ "from": "androidx/savedstate/(.*)",
+ "to": "ignore"
+ },
+ {
+ "from": "androidx/remotecallback/(.*)",
+ "to": "ignore"
+ },
+ {
"from": "androidx/media/(.*)",
"to": "android/support/v4/media/{0}"
},
@@ -1169,6 +1177,22 @@
"to": "androidx/versionedparcelable"
},
{
+ "from": "androidx/remotecallback",
+ "to": "androidx/remotecallback"
+ },
+ {
+ "from": "androidx/activity",
+ "to": "androidx/activity"
+ },
+ {
+ "from": "androidx/savedstate/bundle",
+ "to": "androidx/savedstate/bundle"
+ },
+ {
+ "from": "androidx/savedstate/common",
+ "to": "androidx/savedstate/common"
+ },
+ {
"from": "androidx/slice/view",
"to": "androidx/slice/view"
},
@@ -1268,6 +1292,42 @@
},
{
"from": {
+ "groupId": "androidx.activity",
+ "artifactId": "activity",
+ "version": "{newSlVersion}"
+ },
+ "to": {
+ "groupId": "androidx.activity",
+ "artifactId": "activity",
+ "version": "{newSlVersion}"
+ }
+ },
+ {
+ "from": {
+ "groupId": "androidx.savedstate",
+ "artifactId": "savedstate-common",
+ "version": "{newSlVersion}"
+ },
+ "to": {
+ "groupId": "androidx.savedstate",
+ "artifactId": "savedstate-common",
+ "version": "{newSlVersion}"
+ }
+ },
+ {
+ "from": {
+ "groupId": "androidx.savedstate",
+ "artifactId": "savedstate-bundle",
+ "version": "{newSlVersion}"
+ },
+ "to": {
+ "groupId": "androidx.savedstate",
+ "artifactId": "savedstate-bundle",
+ "version": "{newSlVersion}"
+ }
+ },
+ {
+ "from": {
"groupId": "com.android.support",
"artifactId": "appcompat-v7",
"version": "{oldSlVersion}"
@@ -1928,6 +1988,18 @@
},
{
"from": {
+ "groupId": "androidx.remotecallback",
+ "artifactId": "remotecallback",
+ "version": "{newSlVersion}"
+ },
+ "to": {
+ "groupId": "androidx.remotecallback",
+ "artifactId": "remotecallback",
+ "version": "{newSlVersion}"
+ }
+ },
+ {
+ "from": {
"groupId": "android.arch.core",
"artifactId": "common",
"version": "1.1.1"
@@ -2235,7 +2307,7 @@
"to": {
"groupId": "androidx.constraintlayout",
"artifactId": "constraintlayout",
- "version": "1.1.3"
+ "version": "1.1.2"
}
},
{
@@ -2247,7 +2319,7 @@
"to": {
"groupId": "androidx.constraintlayout",
"artifactId": "constraintlayout-solver",
- "version": "1.1.3"
+ "version": "1.1.2"
}
},
{
@@ -2444,18 +2516,6 @@
},
{
"from": {
- "groupId": "com.android.support.test.uiautomator",
- "artifactId": "uiautomator-v18",
- "version": "2.1.3"
- },
- "to": {
- "groupId": "androidx.test.uiautomator",
- "artifactId": "uiautomator",
- "version": "{newUiAutomatorVersion}"
- }
- },
- {
- "from": {
"groupId": "com.android.support",
"artifactId": "car",
"version": "{oldCarVersion}"
@@ -2556,7 +2616,7 @@
"oldSlVersion": "28.0.0",
"oldMaterialVersion": "28.0.0",
"oldRoomVersion": "1.1.0",
- "oldCarVersion": "28.0.0-alpha5",
+ "oldCarVersion": "28.0.0-alpha6",
"oldMediarouterVersion": "28.0.0-alpha5",
"oldMedia2Version": "28.0.0-alpha03",
"oldExoplayerVersion": "28.0.0-alpha01",
@@ -2565,13 +2625,13 @@
"newMaterialVersion": "1.0.0",
"newArchCoreVersion": "2.0.0",
"newLifecycleVersion": "2.0.0",
- "newPagingVersion": "2.0.0",
- "newRoomVersion": "2.0.0",
+ "newPagingVersion": "2.0.0-rc01",
+ "newRoomVersion": "2.0.0-rc01",
"newEspressoVersion": "3.1.0-alpha3",
"newTestsVersion": "1.1.0-alpha3",
"newJankTestHelperVersion": "1.0.1-alpha3",
"newUiAutomatorVersion": "2.2.0-alpha3",
- "newCarVersion": "1.0.0-alpha5",
+ "newCarVersion": "1.0.0-alpha6",
"newMediarouterVersion": "1.0.0-alpha5",
"newMedia2Version": "1.0.0-alpha03",
"newExoplayerVersion": "1.0.0-alpha01",
@@ -4098,6 +4158,7 @@
"android/support/v4/os/ParcelCompat": "androidx/core/os/ParcelCompat",
"android/support/v4/os/ParcelableCompat": "androidx/core/os/ParcelableCompat",
"android/support/v4/os/ParcelableCompatCreatorCallbacks": "androidx/core/os/ParcelableCompatCreatorCallbacks",
+ "android/support/v4/os/ResultReceiver": "androidx/core/os/ResultReceiver",
"android/support/v4/os/TraceCompat": "androidx/core/os/TraceCompat",
"android/support/v4/os/UserManagerCompat": "androidx/core/os/UserManagerCompat",
"android/support/v4/print/PrintHelper": "androidx/print/PrintHelper",
diff --git a/jetifier/jetifier/migration.config b/jetifier/jetifier/migration.config
index 78126a0..cfa1270 100644
--- a/jetifier/jetifier/migration.config
+++ b/jetifier/jetifier/migration.config
@@ -56,10 +56,18 @@
"to": "androidx/cardview/R{0}"
},
{
+ "from": "android/support/percent/R(.*)",
+ "to": "androidx/percentlayout/R{0}"
+ },
+ {
"from": "android/support/coordinatorlayout/R(.*)",
"to": "androidx/coordinatorlayout/R{0}"
},
{
+ "from": "android/support/text/emoji/R(.*)",
+ "to": "androidx/emoji/R{0}"
+ },
+ {
"from": "android/support/v7/recyclerview/R(.*)",
"to": "androidx/recyclerview/R{0}"
},
@@ -88,6 +96,30 @@
"to": "androidx/legacy/content/WakefulBroadcastReceiver{0}"
},
{
+ "from": "android/support/v13/view/ViewCompat(.*)",
+ "to": "androidx/legacy/view/ViewCompat{0}"
+ },
+ {
+ "from": "android/support/v13/app/ActivityCompat(.*)",
+ "to": "androidx/legacy/app/ActivityCompat{0}"
+ },
+ {
+ "from": "android/support/v13/app/FragmentCompat(.*)",
+ "to": "androidx/legacy/app/FragmentCompat{0}"
+ },
+ {
+ "from": "android/support/v13/app/FragmentPagerAdapter(.*)",
+ "to": "androidx/legacy/app/FragmentPagerAdapter{0}"
+ },
+ {
+ "from": "android/support/v13/app/FragmentStatePagerAdapter(.*)",
+ "to": "androidx/legacy/app/FragmentStatePagerAdapter{0}"
+ },
+ {
+ "from": "android/support/v13/app/FragmentTabHost(.*)",
+ "to": "androidx/legacy/app/FragmentTabHost{0}"
+ },
+ {
"from": "android/support/v7/widget/AdapterHelper(.*)",
"to": "androidx/recyclerview/widget/AdapterHelper{0}"
},
@@ -196,6 +228,10 @@
"to": "androidx/recyclerview/widget/{0}"
},
{
+ "from": "android/support/wear/(.*)",
+ "to": "androidx/wear/{0}"
+ },
+ {
"from": "android/support/v7/preference/(.*)",
"to": "androidx/preference/{0}"
},
@@ -284,6 +320,10 @@
"to": "androidx/leanback/{0}"
},
{
+ "from": "android/support/percent/(.*)",
+ "to": "androidx/percentlayout/widget/{0}"
+ },
+ {
"from": "android/support/annotation/(.*)",
"to": "androidx/annotation/{0}"
},
@@ -292,6 +332,18 @@
"to": "androidx/transition/{0}"
},
{
+ "from": "android/support/text/emoji/bundled/BundledEmojiCompatConfig(.*)",
+ "to": "androidx/emoji/bundled/BundledEmojiCompatConfig{0}"
+ },
+ {
+ "from": "android/support/text/emoji/widget/(.*)",
+ "to": "androidx/emoji/widget/{0}"
+ },
+ {
+ "from": "android/support/text/emoji/(.*)",
+ "to": "androidx/emoji/text/{0}"
+ },
+ {
"from": "android/support/v4/view/animation/PathInterpolatorApi14(.*)",
"to": "androidx/core/view/animation/PathInterpolatorApi14{0}"
},
@@ -460,10 +512,26 @@
"to": "androidx/drawerlayout/widget/DrawerLayout{0}"
},
{
+ "from": "android/support/v4/widget/SlidingPaneLayout(.*)",
+ "to": "androidx/slidingpanelayout/widget/SlidingPaneLayout{0}"
+ },
+ {
"from": "android/support/v4/view/AsyncLayoutInflater(.*)",
"to": "androidx/asynclayoutinflater/view/AsyncLayoutInflater{0}"
},
{
+ "from": "android/support/v4/widget/SwipeRefreshLayout(.*)",
+ "to": "androidx/swiperefreshlayout/widget/SwipeRefreshLayout{0}"
+ },
+ {
+ "from": "android/support/v4/widget/CircularProgressDrawable(.*)",
+ "to": "androidx/swiperefreshlayout/widget/CircularProgressDrawable{0}"
+ },
+ {
+ "from": "android/support/v4/widget/CircleImageView(.*)",
+ "to": "androidx/swiperefreshlayout/widget/CircleImageView{0}"
+ },
+ {
"from": "android/support/v4/util/ArrayMap(.*)",
"to": "androidx/collection/ArrayMap{0}"
},
@@ -512,6 +580,10 @@
"to": "androidx/core/{0}"
},
{
+ "from": "android/support/v13/(.*)",
+ "to": "androidx/core/{0}"
+ },
+ {
"from": "android/arch/core/(.*)",
"to": "androidx/arch/core/{0}"
},
@@ -706,82 +778,14 @@
],
"slRules": [
{
- "from": "androidx/viewpager2/(.*)",
- "to": "ignore"
- },
- {
"from": "androidx/sharetarget/(.*)",
"to": "ignore"
},
{
- "from": "androidx/percentlayout/R(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/percentlayout/widget/(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/wear/(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/swiperefreshlayout/widget/CircleImageView(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/swiperefreshlayout/widget/CircularProgressDrawable(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/swiperefreshlayout/widget/SwipeRefreshLayout(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/emoji/R(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/emoji/bundled/BundledEmojiCompatConfig(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/emoji/widget/(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/emoji/text/(.*)",
- "to": "ignore"
- },
- {
"from": "androidx/biometric/(.*)",
"to": "ignore"
},
{
- "from": "androidx/legacy/view/ViewCompat(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/legacy/app/ActivityCompat(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/legacy/app/FragmentCompat(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/legacy/app/FragmentPagerAdapter(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/legacy/app/FragmentStatePagerAdapter(.*)",
- "to": "ignore"
- },
- {
- "from": "androidx/legacy/app/FragmentTabHost(.*)",
- "to": "ignore"
- },
- {
"from": "androidx/versionedparcelable/(.*)",
"to": "ignore"
},
@@ -790,10 +794,6 @@
"to": "ignore"
},
{
- "from": "androidx/core/view/inputmethod/(.*)",
- "to": "ignore"
- },
- {
"from": "androidx/exifinterface/(.*)",
"to": "ignore"
},
@@ -838,10 +838,6 @@
"to": "ignore"
},
{
- "from": "androidx/slidingpanelayout/widget/SlidingPaneLayout(.*)",
- "to": "ignore"
- },
- {
"from": "androidx/slice/(.*)",
"to": "ignore"
},
@@ -912,10 +908,6 @@
],
"packageMap": [
{
- "from": "androidx/viewpager2",
- "to": "androidx/viewpager2"
- },
- {
"from": "androidx/sharetarget",
"to": "androidx/sharetarget"
},
@@ -964,11 +956,11 @@
"to": "androidx/coordinatorlayout"
},
{
- "from": "androidx/swiperefreshlayout",
+ "from": "android/support/swiperefreshlayout",
"to": "androidx/swiperefreshlayout"
},
{
- "from": "androidx/slidingpanelayout",
+ "from": "android/support/slidingpanelayout",
"to": "androidx/slidingpanelayout"
},
{
@@ -1008,10 +1000,6 @@
"to": "androidx/appcompat"
},
{
- "from": "android/support/v7/appcompat/resources",
- "to": "androidx/appcompat/resources"
- },
- {
"from": "android/support/v7/recyclerview",
"to": "androidx/recyclerview"
},
@@ -1020,7 +1008,7 @@
"to": "androidx/viewpager"
},
{
- "from": "androidx/percentlayout",
+ "from": "android/support/percent",
"to": "androidx/percentlayout"
},
{
@@ -1028,7 +1016,7 @@
"to": "androidx/gridlayout"
},
{
- "from": "androidx/legacy/v13",
+ "from": "android/support/v13",
"to": "androidx/legacy/v13"
},
{
@@ -1100,7 +1088,7 @@
"to": "androidx/drawerlayout"
},
{
- "from": "androidx/wear",
+ "from": "android/support/wear",
"to": "androidx/wear"
},
{
@@ -1108,15 +1096,15 @@
"to": "com/google/android/material"
},
{
- "from": "androidx/emoji/appcompat",
+ "from": "android/support/text/emoji/appcompat",
"to": "androidx/emoji/appcompat"
},
{
- "from": "androidx/emoji/bundled",
+ "from": "android/support/text/emoji/bundled",
"to": "androidx/emoji/bundled"
},
{
- "from": "androidx/emoji",
+ "from": "android/support/text/emoji",
"to": "androidx/emoji"
},
{
@@ -1128,6 +1116,10 @@
"to": "androidx/localbroadcastmanager"
},
{
+ "from": "androidx/text/emoji/bundled",
+ "to": "androidx/text/emoji/bundled"
+ },
+ {
"from": "androidx/webkit",
"to": "androidx/webkit"
},
@@ -1136,8 +1128,12 @@
"to": "androidx/remotecallback"
},
{
- "from": "androidx/savedstate",
- "to": "androidx/savedstate"
+ "from": "androidx/savedstate/bundle",
+ "to": "androidx/savedstate/bundle"
+ },
+ {
+ "from": "androidx/savedstate/common",
+ "to": "androidx/savedstate/common"
},
{
"from": "androidx/slice/view",
@@ -1225,18 +1221,6 @@
}
],
"pomRules": [
- {
- "from": {
- "groupId": "androidx.viewpager2",
- "artifactId": "viewpager2",
- "version": "{newSlVersion}"
- },
- "to": {
- "groupId": "androidx.viewpager2",
- "artifactId": "viewpager2",
- "version": "{newSlVersion}"
- }
- },
{
"from": {
"groupId": "com.android.support",
@@ -1264,12 +1248,24 @@
{
"from": {
"groupId": "androidx.savedstate",
- "artifactId": "savedstate",
+ "artifactId": "savedstate-common",
"version": "{newSlVersion}"
},
"to": {
"groupId": "androidx.savedstate",
- "artifactId": "savedstate",
+ "artifactId": "savedstate-common",
+ "version": "{newSlVersion}"
+ }
+ },
+ {
+ "from": {
+ "groupId": "androidx.savedstate",
+ "artifactId": "savedstate-bundle",
+ "version": "{newSlVersion}"
+ },
+ "to": {
+ "groupId": "androidx.savedstate",
+ "artifactId": "savedstate-bundle",
"version": "{newSlVersion}"
}
},
@@ -1288,18 +1284,6 @@
{
"from": {
"groupId": "com.android.support",
- "artifactId": "appcompat-resources",
- "version": "{oldSlVersion}"
- },
- "to": {
- "groupId": "androidx.appcompat",
- "artifactId": "appcompat-resources",
- "version": "{newSlVersion}"
- }
- },
- {
- "from": {
- "groupId": "com.android.support",
"artifactId": "cardview-v7",
"version": "{oldSlVersion}"
},
@@ -1419,9 +1403,9 @@
},
{
"from": {
- "groupId": "androidx.percentlayout",
- "artifactId": "percentlayout",
- "version": "{newSlVersion}"
+ "groupId": "com.android.support",
+ "artifactId": "percent",
+ "version": "{oldSlVersion}"
},
"to": {
"groupId": "androidx.percentlayout",
@@ -1563,9 +1547,9 @@
},
{
"from": {
- "groupId": "androidx.emoji",
- "artifactId": "emoji",
- "version": "{newSlVersion}"
+ "groupId": "com.android.support",
+ "artifactId": "support-emoji",
+ "version": "{oldSlVersion}"
},
"to": {
"groupId": "androidx.emoji",
@@ -1575,9 +1559,9 @@
},
{
"from": {
- "groupId": "androidx.emoji",
- "artifactId": "emoji-appcompat",
- "version": "{newSlVersion}"
+ "groupId": "com.android.support",
+ "artifactId": "support-emoji-appcompat",
+ "version": "{oldSlVersion}"
},
"to": {
"groupId": "androidx.emoji",
@@ -1587,9 +1571,9 @@
},
{
"from": {
- "groupId": "androidx.emoji",
- "artifactId": "emoji-bundled",
- "version": "{newSlVersion}"
+ "groupId": "com.android.support",
+ "artifactId": "support-emoji-bundled",
+ "version": "{oldSlVersion}"
},
"to": {
"groupId": "androidx.emoji",
@@ -1635,9 +1619,9 @@
},
{
"from": {
- "groupId": "androidx.legacy",
- "artifactId": "legacy-support-v13",
- "version": "{newSlVersion}"
+ "groupId": "com.android.support",
+ "artifactId": "support-v13",
+ "version": "{oldSlVersion}"
},
"to": {
"groupId": "androidx.legacy",
@@ -1695,9 +1679,9 @@
},
{
"from": {
- "groupId": "androidx.wear",
+ "groupId": "com.android.support",
"artifactId": "wear",
- "version": "{newSlVersion}"
+ "version": "{oldSlVersion}"
},
"to": {
"groupId": "androidx.wear",
@@ -1839,9 +1823,9 @@
},
{
"from": {
- "groupId": "androidx.slidingpanelayout",
+ "groupId": "com.android.support",
"artifactId": "slidingpanelayout",
- "version": "{newSlVersion}"
+ "version": "{oldSlVersion}"
},
"to": {
"groupId": "androidx.slidingpanelayout",
@@ -1851,9 +1835,9 @@
},
{
"from": {
- "groupId": "androidx.swiperefreshlayout",
+ "groupId": "com.android.support",
"artifactId": "swiperefreshlayout",
- "version": "{newSlVersion}"
+ "version": "{oldSlVersion}"
},
"to": {
"groupId": "androidx.swiperefreshlayout",
@@ -2266,7 +2250,7 @@
"to": {
"groupId": "androidx.constraintlayout",
"artifactId": "constraintlayout",
- "version": "1.1.3"
+ "version": "1.1.2"
}
},
{
@@ -2278,7 +2262,7 @@
"to": {
"groupId": "androidx.constraintlayout",
"artifactId": "constraintlayout-solver",
- "version": "1.1.3"
+ "version": "1.1.2"
}
},
{
@@ -3259,6 +3243,10 @@
"android/support/multidex/MultiDexApplication": "androidx/multidex/MultiDexApplication",
"android/support/multidex/MultiDexExtractor": "androidx/multidex/MultiDexExtractor",
"android/support/multidex/ZipUtil": "androidx/multidex/ZipUtil",
+ "android/support/percent/PercentFrameLayout": "androidx/percentlayout/widget/PercentFrameLayout",
+ "android/support/percent/PercentLayoutHelper": "androidx/percentlayout/widget/PercentLayoutHelper",
+ "android/support/percent/PercentRelativeLayout": "androidx/percentlayout/widget/PercentRelativeLayout",
+ "android/support/percent/R": "androidx/percentlayout/R",
"android/support/test/InstrumentationRegistry": "androidx/test/InstrumentationRegistry",
"android/support/test/annotation/Beta": "androidx/test/annotation/Beta",
"android/support/test/annotation/UiThreadTest": "androidx/test/annotation/UiThreadTest",
@@ -3609,6 +3597,35 @@
"android/support/test/uiautomator/UiWatcher": "androidx/test/uiautomator/UiWatcher",
"android/support/test/uiautomator/Until": "androidx/test/uiautomator/Until",
"android/support/test/uiautomator/WaitMixin": "androidx/test/uiautomator/WaitMixin",
+ "android/support/text/emoji/EmojiCompat": "androidx/emoji/text/EmojiCompat",
+ "android/support/text/emoji/EmojiMetadata": "androidx/emoji/text/EmojiMetadata",
+ "android/support/text/emoji/EmojiProcessor": "androidx/emoji/text/EmojiProcessor",
+ "android/support/text/emoji/EmojiSpan": "androidx/emoji/text/EmojiSpan",
+ "android/support/text/emoji/FontRequestEmojiCompatConfig": "androidx/emoji/text/FontRequestEmojiCompatConfig",
+ "android/support/text/emoji/MetadataListReader": "androidx/emoji/text/MetadataListReader",
+ "android/support/text/emoji/MetadataRepo": "androidx/emoji/text/MetadataRepo",
+ "android/support/text/emoji/R": "androidx/emoji/R",
+ "android/support/text/emoji/TypefaceEmojiSpan": "androidx/emoji/text/TypefaceEmojiSpan",
+ "android/support/text/emoji/bundled/BundledEmojiCompatConfig": "androidx/emoji/bundled/BundledEmojiCompatConfig",
+ "android/support/text/emoji/widget/EditTextAttributeHelper": "androidx/emoji/widget/EditTextAttributeHelper",
+ "android/support/text/emoji/widget/EmojiAppCompatButton": "androidx/emoji/widget/EmojiAppCompatButton",
+ "android/support/text/emoji/widget/EmojiAppCompatEditText": "androidx/emoji/widget/EmojiAppCompatEditText",
+ "android/support/text/emoji/widget/EmojiAppCompatTextView": "androidx/emoji/widget/EmojiAppCompatTextView",
+ "android/support/text/emoji/widget/EmojiButton": "androidx/emoji/widget/EmojiButton",
+ "android/support/text/emoji/widget/EmojiEditText": "androidx/emoji/widget/EmojiEditText",
+ "android/support/text/emoji/widget/EmojiEditTextHelper": "androidx/emoji/widget/EmojiEditTextHelper",
+ "android/support/text/emoji/widget/EmojiEditableFactory": "androidx/emoji/widget/EmojiEditableFactory",
+ "android/support/text/emoji/widget/EmojiExtractEditText": "androidx/emoji/widget/EmojiExtractEditText",
+ "android/support/text/emoji/widget/EmojiExtractTextLayout": "androidx/emoji/widget/EmojiExtractTextLayout",
+ "android/support/text/emoji/widget/EmojiInputConnection": "androidx/emoji/widget/EmojiInputConnection",
+ "android/support/text/emoji/widget/EmojiInputFilter": "androidx/emoji/widget/EmojiInputFilter",
+ "android/support/text/emoji/widget/EmojiKeyListener": "androidx/emoji/widget/EmojiKeyListener",
+ "android/support/text/emoji/widget/EmojiTextView": "androidx/emoji/widget/EmojiTextView",
+ "android/support/text/emoji/widget/EmojiTextViewHelper": "androidx/emoji/widget/EmojiTextViewHelper",
+ "android/support/text/emoji/widget/EmojiTextWatcher": "androidx/emoji/widget/EmojiTextWatcher",
+ "android/support/text/emoji/widget/EmojiTransformationMethod": "androidx/emoji/widget/EmojiTransformationMethod",
+ "android/support/text/emoji/widget/ExtractButtonCompat": "androidx/emoji/widget/ExtractButtonCompat",
+ "android/support/text/emoji/widget/SpannableBuilder": "androidx/emoji/widget/SpannableBuilder",
"android/support/transition/AnimatorUtils": "androidx/transition/AnimatorUtils",
"android/support/transition/ArcMotion": "androidx/transition/ArcMotion",
"android/support/transition/AutoTransition": "androidx/transition/AutoTransition",
@@ -3668,6 +3685,17 @@
"android/support/transition/WindowIdApi14": "androidx/transition/WindowIdApi14",
"android/support/transition/WindowIdApi18": "androidx/transition/WindowIdApi18",
"android/support/transition/WindowIdImpl": "androidx/transition/WindowIdImpl",
+ "android/support/v13/app/ActivityCompat": "androidx/legacy/app/ActivityCompat",
+ "android/support/v13/app/FragmentCompat": "androidx/legacy/app/FragmentCompat",
+ "android/support/v13/app/FragmentPagerAdapter": "androidx/legacy/app/FragmentPagerAdapter",
+ "android/support/v13/app/FragmentStatePagerAdapter": "androidx/legacy/app/FragmentStatePagerAdapter",
+ "android/support/v13/app/FragmentTabHost": "androidx/legacy/app/FragmentTabHost",
+ "android/support/v13/view/DragAndDropPermissionsCompat": "androidx/core/view/DragAndDropPermissionsCompat",
+ "android/support/v13/view/DragStartHelper": "androidx/core/view/DragStartHelper",
+ "android/support/v13/view/ViewCompat": "androidx/legacy/view/ViewCompat",
+ "android/support/v13/view/inputmethod/EditorInfoCompat": "androidx/core/view/inputmethod/EditorInfoCompat",
+ "android/support/v13/view/inputmethod/InputConnectionCompat": "androidx/core/view/inputmethod/InputConnectionCompat",
+ "android/support/v13/view/inputmethod/InputContentInfoCompat": "androidx/core/view/inputmethod/InputContentInfoCompat",
"android/support/v14/preference/EditTextPreferenceDialogFragment": "androidx/preference/EditTextPreferenceDialogFragment",
"android/support/v14/preference/ListPreferenceDialogFragment": "androidx/preference/ListPreferenceDialogFragment",
"android/support/v14/preference/MultiSelectListPreference": "androidx/preference/MultiSelectListPreference",
@@ -4166,6 +4194,8 @@
"android/support/v4/view/animation/PathInterpolatorCompat": "androidx/core/view/animation/PathInterpolatorCompat",
"android/support/v4/widget/AutoScrollHelper": "androidx/core/widget/AutoScrollHelper",
"android/support/v4/widget/AutoSizeableTextView": "androidx/core/widget/AutoSizeableTextView",
+ "android/support/v4/widget/CircleImageView": "androidx/swiperefreshlayout/widget/CircleImageView",
+ "android/support/v4/widget/CircularProgressDrawable": "androidx/swiperefreshlayout/widget/CircularProgressDrawable",
"android/support/v4/widget/CompoundButtonCompat": "androidx/core/widget/CompoundButtonCompat",
"android/support/v4/widget/ContentLoadingProgressBar": "androidx/core/widget/ContentLoadingProgressBar",
"android/support/v4/widget/CursorAdapter": "androidx/cursoradapter/widget/CursorAdapter",
@@ -4185,7 +4215,9 @@
"android/support/v4/widget/ResourceCursorAdapter": "androidx/cursoradapter/widget/ResourceCursorAdapter",
"android/support/v4/widget/ScrollerCompat": "androidx/core/widget/ScrollerCompat",
"android/support/v4/widget/SimpleCursorAdapter": "androidx/cursoradapter/widget/SimpleCursorAdapter",
+ "android/support/v4/widget/SlidingPaneLayout": "androidx/slidingpanelayout/widget/SlidingPaneLayout",
"android/support/v4/widget/Space": "androidx/legacy/widget/Space",
+ "android/support/v4/widget/SwipeRefreshLayout": "androidx/swiperefreshlayout/widget/SwipeRefreshLayout",
"android/support/v4/widget/TextViewCompat": "androidx/core/widget/TextViewCompat",
"android/support/v4/widget/TintableCompoundButton": "androidx/core/widget/TintableCompoundButton",
"android/support/v4/widget/TintableImageSourceView": "androidx/core/widget/TintableImageSourceView",
@@ -4442,7 +4474,49 @@
"android/support/v7/widget/helper/ItemTouchHelper": "androidx/recyclerview/widget/ItemTouchHelper",
"android/support/v7/widget/helper/ItemTouchUIUtil": "androidx/recyclerview/widget/ItemTouchUIUtil",
"android/support/v7/widget/helper/ItemTouchUIUtilImpl": "androidx/recyclerview/widget/ItemTouchUIUtilImpl",
- "android/support/v7/widget/util/SortedListAdapterCallback": "androidx/recyclerview/widget/SortedListAdapterCallback"
+ "android/support/v7/widget/util/SortedListAdapterCallback": "androidx/recyclerview/widget/SortedListAdapterCallback",
+ "android/support/wear/R": "androidx/wear/R",
+ "android/support/wear/activity/ConfirmationActivity": "androidx/wear/activity/ConfirmationActivity",
+ "android/support/wear/ambient/AmbientDelegate": "androidx/wear/ambient/AmbientDelegate",
+ "android/support/wear/ambient/AmbientMode": "androidx/wear/ambient/AmbientMode",
+ "android/support/wear/ambient/AmbientModeSupport": "androidx/wear/ambient/AmbientModeSupport",
+ "android/support/wear/ambient/SharedLibraryVersion": "androidx/wear/ambient/SharedLibraryVersion",
+ "android/support/wear/ambient/WearableControllerProvider": "androidx/wear/ambient/WearableControllerProvider",
+ "android/support/wear/internal/widget/ResourcesUtil": "androidx/wear/internal/widget/ResourcesUtil",
+ "android/support/wear/internal/widget/drawer/MultiPagePresenter": "androidx/wear/internal/widget/drawer/MultiPagePresenter",
+ "android/support/wear/internal/widget/drawer/MultiPageUi": "androidx/wear/internal/widget/drawer/MultiPageUi",
+ "android/support/wear/internal/widget/drawer/SinglePagePresenter": "androidx/wear/internal/widget/drawer/SinglePagePresenter",
+ "android/support/wear/internal/widget/drawer/SinglePageUi": "androidx/wear/internal/widget/drawer/SinglePageUi",
+ "android/support/wear/internal/widget/drawer/WearableNavigationDrawerPresenter": "androidx/wear/internal/widget/drawer/WearableNavigationDrawerPresenter",
+ "android/support/wear/utils/MetadataConstants": "androidx/wear/utils/MetadataConstants",
+ "android/support/wear/widget/BezierSCurveInterpolator": "androidx/wear/widget/BezierSCurveInterpolator",
+ "android/support/wear/widget/BoxInsetLayout": "androidx/wear/widget/BoxInsetLayout",
+ "android/support/wear/widget/CircledImageView": "androidx/wear/widget/CircledImageView",
+ "android/support/wear/widget/CircularProgressLayout": "androidx/wear/widget/CircularProgressLayout",
+ "android/support/wear/widget/CircularProgressLayoutController": "androidx/wear/widget/CircularProgressLayoutController",
+ "android/support/wear/widget/ConfirmationOverlay": "androidx/wear/widget/ConfirmationOverlay",
+ "android/support/wear/widget/CurvingLayoutCallback": "androidx/wear/widget/CurvingLayoutCallback",
+ "android/support/wear/widget/ProgressDrawable": "androidx/wear/widget/ProgressDrawable",
+ "android/support/wear/widget/ResourcesUtil": "androidx/wear/widget/ResourcesUtil",
+ "android/support/wear/widget/RoundedDrawable": "androidx/wear/widget/RoundedDrawable",
+ "android/support/wear/widget/ScrollManager": "androidx/wear/widget/ScrollManager",
+ "android/support/wear/widget/SimpleAnimatorListener": "androidx/wear/widget/SimpleAnimatorListener",
+ "android/support/wear/widget/SwipeDismissFrameLayout": "androidx/wear/widget/SwipeDismissFrameLayout",
+ "android/support/wear/widget/SwipeDismissLayout": "androidx/wear/widget/SwipeDismissLayout",
+ "android/support/wear/widget/WearableLinearLayoutManager": "androidx/wear/widget/WearableLinearLayoutManager",
+ "android/support/wear/widget/WearableRecyclerView": "androidx/wear/widget/WearableRecyclerView",
+ "android/support/wear/widget/drawer/AbsListViewFlingWatcher": "androidx/wear/widget/drawer/AbsListViewFlingWatcher",
+ "android/support/wear/widget/drawer/FlingWatcherFactory": "androidx/wear/widget/drawer/FlingWatcherFactory",
+ "android/support/wear/widget/drawer/NestedScrollViewFlingWatcher": "androidx/wear/widget/drawer/NestedScrollViewFlingWatcher",
+ "android/support/wear/widget/drawer/PageIndicatorView": "androidx/wear/widget/drawer/PageIndicatorView",
+ "android/support/wear/widget/drawer/RecyclerViewFlingWatcher": "androidx/wear/widget/drawer/RecyclerViewFlingWatcher",
+ "android/support/wear/widget/drawer/ScrollViewFlingWatcher": "androidx/wear/widget/drawer/ScrollViewFlingWatcher",
+ "android/support/wear/widget/drawer/WearableActionDrawerMenu": "androidx/wear/widget/drawer/WearableActionDrawerMenu",
+ "android/support/wear/widget/drawer/WearableActionDrawerView": "androidx/wear/widget/drawer/WearableActionDrawerView",
+ "android/support/wear/widget/drawer/WearableDrawerController": "androidx/wear/widget/drawer/WearableDrawerController",
+ "android/support/wear/widget/drawer/WearableDrawerLayout": "androidx/wear/widget/drawer/WearableDrawerLayout",
+ "android/support/wear/widget/drawer/WearableDrawerView": "androidx/wear/widget/drawer/WearableDrawerView",
+ "android/support/wear/widget/drawer/WearableNavigationDrawerView": "androidx/wear/widget/drawer/WearableNavigationDrawerView"
}
},
"proGuardMap": {
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/Processor.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/Processor.kt
index fb9b62a..4603bf8 100644
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/Processor.kt
+++ b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/Processor.kt
@@ -23,8 +23,6 @@
import com.android.tools.build.jetifier.processor.archive.Archive
import com.android.tools.build.jetifier.processor.archive.ArchiveFile
import com.android.tools.build.jetifier.processor.archive.ArchiveItemVisitor
-import com.android.tools.build.jetifier.processor.archive.FileSearchResult
-import com.android.tools.build.jetifier.processor.com.android.tools.build.jetifier.processor.transform.java.JavaTransformer
import com.android.tools.build.jetifier.processor.transform.TransformationContext
import com.android.tools.build.jetifier.processor.transform.Transformer
import com.android.tools.build.jetifier.processor.transform.bytecode.ByteCodeTransformer
@@ -35,7 +33,6 @@
import com.android.tools.build.jetifier.processor.transform.resource.XmlResourcesTransformer
import java.io.File
import java.io.FileNotFoundException
-import java.lang.StringBuilder
/**
* The main entry point to the library. Extracts any given archive recursively and runs all
@@ -44,8 +41,7 @@
*/
class Processor private constructor(
private val context: TransformationContext,
- private val transformers: List<Transformer>,
- private val stripSignatureFiles: Boolean = false
+ private val transformers: List<Transformer>
) : ArchiveItemVisitor {
companion object {
@@ -58,8 +54,7 @@
// Register your transformers here
ByteCodeTransformer(context),
XmlResourcesTransformer(context),
- ProGuardTransformer(context),
- JavaTransformer(context)
+ ProGuardTransformer(context)
)
/**
@@ -82,17 +77,14 @@
* @param useFallbackIfTypeIsMissing Use fallback for types resolving instead of crashing
* @param allowAmbiguousPackages Whether Jetifier should not crash when it attempts to
* rewrite ambiguous package reference such as android.support.v4.
- * @param stripSignatures Don't throw an error when jetifying a signed library and strip
- * the signature files instead.
* @param dataBindingVersion The versions to be used for data binding otherwise undefined.
*/
- fun createProcessor3(
+ fun createProcessor2(
config: Config,
reversedMode: Boolean = false,
rewritingSupportLib: Boolean = false,
useFallbackIfTypeIsMissing: Boolean = true,
allowAmbiguousPackages: Boolean = false,
- stripSignatures: Boolean = false,
dataBindingVersion: String? = null
): Processor {
var newConfig = config
@@ -112,11 +104,7 @@
reversedRestrictToPackagePrefixes = config.restrictToPackagePrefixes,
rulesMap = config.rulesMap.reverse().appendRules(config.slRules),
slRules = config.slRules,
- pomRewriteRules = config.pomRewriteRules
- // Remove uiautomator-v18 from the reversed version
- .filterNot { it.from.artifactId == "uiautomator-v18" }
- .map { it.getReversed() }
- .toSet(),
+ pomRewriteRules = config.pomRewriteRules.map { it.getReversed() }.toSet(),
typesMap = config.typesMap.reverseMapOrDie(),
proGuardMap = config.proGuardMap.reverseMap(),
versionsMap = config.versionsMap,
@@ -137,40 +125,7 @@
createTransformers(context)
}
- return Processor(context, transformers, stripSignatures)
- }
-
- /**
- * Creates a new instance of the [Processor].
- *
- * @param config Transformation configuration
- * @param reversedMode Whether the processor should run in reversed mode
- * @param rewritingSupportLib Whether we are rewriting the support library itself
- * @param useFallbackIfTypeIsMissing Use fallback for types resolving instead of crashing
- * @param allowAmbiguousPackages Whether Jetifier should not crash when it attempts to
- * rewrite ambiguous package reference such as android.support.v4.
- * @param dataBindingVersion The versions to be used for data binding otherwise undefined.
- */
- @Deprecated(
- message = "Legacy method that is missing 'throwErrorIsSignatureDetected' attribute",
- replaceWith = ReplaceWith(expression = "Processor.createProcessor3"))
- fun createProcessor2(
- config: Config,
- reversedMode: Boolean = false,
- rewritingSupportLib: Boolean = false,
- useFallbackIfTypeIsMissing: Boolean = true,
- allowAmbiguousPackages: Boolean = false,
- dataBindingVersion: String? = null
- ): Processor {
- return createProcessor3(
- config = config,
- reversedMode = reversedMode,
- rewritingSupportLib = rewritingSupportLib,
- useFallbackIfTypeIsMissing = useFallbackIfTypeIsMissing,
- allowAmbiguousPackages = allowAmbiguousPackages,
- stripSignatures = false,
- dataBindingVersion = dataBindingVersion
- )
+ return Processor(context, transformers)
}
/**
@@ -183,10 +138,9 @@
* @param versionSetName Versions map for dependencies rewriting
* @param dataBindingVersion The versions to be used for data binding otherwise undefined.
*/
- @Deprecated(
- message = "Legacy method that is missing 'allowAmbiguousPackages' attribute and " +
- "'versionSetName' attribute is not used anymore.",
- replaceWith = ReplaceWith(expression = "Processor.createProcessor3"))
+ @Deprecated(message = "Legacy method that is missing 'allowAmbiguousPackages' attribute " +
+ "and 'versionSetName' attribute is not used anymore.",
+ replaceWith = ReplaceWith(expression = "Processor.createProcessor2"))
fun createProcessor(
config: Config,
reversedMode: Boolean = false,
@@ -225,13 +179,12 @@
/**
* Transforms the input libraries given in [inputLibraries] using all the registered
* [Transformer]s and returns a list of replacement libraries (the newly created libraries are
- * get stored into [outputPath]). Also supports transforming single source files (java and xml.)
+ * get stored into [outputPath]).
*
* Currently we have the following transformers:
* - [ByteCodeTransformer] for java native code
- * - [XmlResourcesTransformer] for java native code and xml resource files
+ * - [XmlResourcesTransformer] for java native code
* - [ProGuardTransformer] for PorGuard files
- * - [JavaTransformer] for java source code
*
* @param input Files to process together with a path where they should be saved to.
* @param copyUnmodifiedLibsAlso Whether archives that were not modified should be also copied
@@ -239,25 +192,7 @@
* @return list of files (existing and generated) that should replace the given [input] files.
*/
fun transform(input: Set<FileMapping>, copyUnmodifiedLibsAlso: Boolean = true): Set<File> {
- val nonSingleFiles = HashSet<FileMapping>(input)
- for (fileMapping in nonSingleFiles) {
- // Treat all files as single files and check if they are transformable.
- val file = ArchiveFile(fileMapping.from.toPath(), fileMapping.from.readBytes())
- file.setIsSingleFile(true)
- val transformer = transformers.firstOrNull { it.canTransform(file) }
- if (transformer != null) {
- // Single file is transformable, set relativePath to the output path.
- file.updateRelativePath(fileMapping.to.toPath())
- transformer.runTransform(file)
- nonSingleFiles.remove(fileMapping)
- }
- }
- if (nonSingleFiles.isEmpty()) {
- // all files were single files, we're done.
- return emptySet()
- }
-
- val inputLibraries = nonSingleFiles.map { it.from }.toSet()
+ val inputLibraries = input.map { it.from }.toSet()
if (inputLibraries.size != input.size) {
throw IllegalArgumentException("Input files are duplicated!")
}
@@ -290,10 +225,7 @@
// 4) Transform the previously discovered POM files
transformPomFiles(pomFiles)
- // 5) Find signature files and report them if needed
- runSignatureDetectionFor(libraries)
-
- // 6) Repackage the libraries back to archive files
+ // 5) Repackage the libraries back to archive files
val generatedLibraries = libraries
.filter { copyUnmodifiedLibsAlso || it.wasChanged }
.map {
@@ -305,7 +237,7 @@
return generatedLibraries
}
- // 7) Create a set of files that should be removed (because they've been changed).
+ // 6) Create a set of files that should be removed (because they've been changed).
val filesToRemove = libraries
.filter { it.wasChanged }
.map { it.relativePath.toFile() }
@@ -314,40 +246,6 @@
return inputLibraries.minus(filesToRemove).plus(generatedLibraries)
}
- private fun runSignatureDetectionFor(libraries: List<Archive>) {
- var wereSignaturesDetected = false
- val sb = StringBuilder()
-
- libraries
- .filter { it.wasChanged }
- .forEach { library ->
- val foundSignatures = FileSearchResult()
- library.findAllFiles({ isSignatureFile(it) }, foundSignatures)
- if (foundSignatures.all.isNotEmpty()) {
- wereSignaturesDetected = true
- sb.appendln()
- sb.appendln("Found following signature files for '${library.relativePath}':")
- foundSignatures.all
- .sortedBy { it.relativePath.toString() }
- .forEach { file ->
- sb.appendln("- ${file.relativePath}")
- file.markedForRemoval = true
- }
- }
- }
-
- if (wereSignaturesDetected && !stripSignatureFiles) {
- throw SignatureFilesFoundJetifierException(
- "Jetifier found signature in at least one of the archives that need to be " +
- "modified. However doing so would break the signatures. Please ask the library " +
- "owner to provide jetpack compatible signed library. If you don't need " +
- "the signatures you can re-run jetifier with 'stripSignatures' option on. " +
- "Jetifier will then remove all affected signature files. Below is list of all " +
- "the signature that were discovered: $sb}"
- )
- }
- }
-
/**
* Maps the given dependency (in form of groupId:artifactId:version) to a new set of
* dependencies. Used for mapping of old support library artifacts to jetpack ones.
@@ -450,7 +348,7 @@
archive.files.forEach { it.accept(this) }
// This is an ugly workaround to merge annotations files due to having old and new
- // namespaces at the same time
+ // namespaces at the same time
if (context.isInReversedMode) {
AnnotationFilesMerger.tryMergeFilesInArchive(archive)
}
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/SignatureDetection.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/SignatureDetection.kt
deleted file mode 100644
index 9721c11..0000000
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/SignatureDetection.kt
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2019 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 com.android.tools.build.jetifier.processor
-
-import com.android.tools.build.jetifier.processor.archive.ArchiveFile
-import java.nio.charset.StandardCharsets
-import java.util.regex.Pattern
-
-private val signatureFilePattern = Pattern.compile(
- "^(/|\\\\)*meta-inf(/|\\\\)[^/\\\\]*\\.(SF|DSA|RSA|(SIG(-[^.]*)?))$",
- Pattern.CASE_INSENSITIVE
-)
-
-private val manifestPattern = Pattern.compile(
- "^(/|\\\\)*meta-inf(/|\\\\)manifest\\.mf$",
- Pattern.CASE_INSENSITIVE
-)
-
-private val manifestSignatureDataPattern = Pattern.compile(
- "(SHA1|SHA-1|SHA256|SHA-256)-Digest",
- Pattern.CASE_INSENSITIVE
-)
-
-fun isSignatureFile(file: ArchiveFile): Boolean {
- if (signatureFilePattern.matcher(file.relativePath.toString()).matches()) {
- return true
- }
-
- if (!manifestPattern.matcher(file.relativePath.toString()).matches()) {
- return false
- }
-
- val content = StringBuilder(file.data.toString(StandardCharsets.UTF_8)).toString()
- return manifestSignatureDataPattern.matcher(content).find()
-}
-
-class SignatureFilesFoundJetifierException(message: String) : Exception(message)
\ No newline at end of file
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/Archive.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/Archive.kt
index 3fd5390..e95f3e3 100644
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/Archive.kt
+++ b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/Archive.kt
@@ -54,8 +54,6 @@
override val fileName: String = relativePath.fileName.toString()
- override var markedForRemoval: Boolean = false
-
private var targetPath: Path = relativePath
override val wasChanged: Boolean
@@ -68,10 +66,6 @@
targetPath = path
}
- override fun findAllFiles(selector: (ArchiveFile) -> Boolean, result: FileSearchResult) {
- files.forEach { it.findAllFiles(selector, result) }
- }
-
override fun accept(visitor: ArchiveItemVisitor) {
visitor.visit(this)
}
@@ -121,10 +115,6 @@
val out = ZipOutputStream(outputStream)
for (file in files) {
- if (file.markedForRemoval) {
- continue
- }
-
Log.v(TAG, "Writing file: %s", file.relativePath)
// Make sure we always use '/' as separator in ZipOutputStream otherwise we might end
// up with a corrupted zip file on a non-Unix OS (b/109738608).
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/ArchiveFile.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/ArchiveFile.kt
index 4a41bb8..06e332c 100644
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/ArchiveFile.kt
+++ b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/ArchiveFile.kt
@@ -34,21 +34,9 @@
override var wasChanged: Boolean = false
private set
- override var markedForRemoval: Boolean = false
-
var data: ByteArray = data
private set
- // If this is true, treat the file as a single file not part of an archive.
- var isSingleFile: Boolean = false
- private set
-
- override fun findAllFiles(selector: (ArchiveFile) -> Boolean, result: FileSearchResult) {
- if (selector(this)) {
- result.addFile(this)
- }
- }
-
override fun accept(visitor: ArchiveItemVisitor) {
visitor.visit(this)
}
@@ -88,8 +76,4 @@
fun setNewDataSilently(newData: ByteArray) {
data = newData
}
-
- fun setIsSingleFile(isSingleFile: Boolean) {
- this.isSingleFile = isSingleFile
- }
}
\ No newline at end of file
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/ArchiveItem.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/ArchiveItem.kt
index f2f3ec6..9e188ca 100644
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/ArchiveItem.kt
+++ b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/archive/ArchiveItem.kt
@@ -46,16 +46,6 @@
val wasChanged: Boolean
/**
- * Whether to exclude this item from the generated output.
- */
- var markedForRemoval: Boolean
-
- /**
- * Finds all the files satisfying the given [selector] and adds them to [result].
- */
- fun findAllFiles(selector: (ArchiveFile) -> Boolean, result: FileSearchResult)
-
- /**
* Accepts visitor.
*/
fun accept(visitor: ArchiveItemVisitor)
@@ -65,28 +55,12 @@
*/
fun writeSelfTo(outputStream: OutputStream)
- fun isPomFile() = fileName.equals("pom.xml", ignoreCase = true) ||
- fileName.endsWith(".pom", ignoreCase = true)
+ fun isPomFile() = fileName.equals("pom.xml", ignoreCase = true)
+ || fileName.endsWith(".pom", ignoreCase = true)
fun isClassFile() = fileName.endsWith(".class", ignoreCase = true)
fun isXmlFile() = fileName.endsWith(".xml", ignoreCase = true)
- fun isProGuardFile() = fileName.equals("proguard.txt", ignoreCase = true)
-
- fun isJavaFile() = fileName.endsWith(".java")
-}
-
-/**
- * Aggregated result of all the files that were found.
- *
- * @see ArchiveItem.findAllFiles
- */
-class FileSearchResult {
-
- val all = mutableSetOf<ArchiveFile>()
-
- fun addFile(file: ArchiveFile) {
- all.add(file)
- }
+ fun isProGuardFile () = fileName.equals("proguard.txt", ignoreCase = true)
}
\ No newline at end of file
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/SourceJetifier.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/SourceJetifier.kt
deleted file mode 100644
index f783b09..0000000
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/SourceJetifier.kt
+++ /dev/null
@@ -1,53 +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 com.android.tools.build.jetifier.processor.transform
-
-import com.android.tools.build.jetifier.core.config.Config
-import java.io.File
-
-class SourceJetifier {
-
- companion object {
- fun jetifySourceFile(config: Config, source: String, outputFile: File) {
- val mappings = HashMap<String, String>()
- for (mapping in config.typesMap.getClassMappings()) {
- mappings.put(mapping.key.toDotNotation(), mapping.value.toDotNotation())
- }
- var sourceCode = source
- for (pair in mappings) {
- val fromType = pair.key
- val toType = pair.value
- var startIndex = sourceCode.indexOf(string = fromType,
- startIndex = 0)
- while (startIndex != -1) {
- // Replace only if the match is not followed by an alphanumeric character.
- // This serves to avoid matches where we match to a subset of the type instead
- // of the actual intended type (e.g com.foo.Class should not
- // match for the start of com.foo.Class2)
- if (startIndex + fromType.length == sourceCode.length ||
- !sourceCode[startIndex + fromType.length].isLetterOrDigit()) {
- sourceCode = sourceCode.replaceRange(startIndex,
- startIndex + fromType.length, toType)
- }
- startIndex += toType.length
- startIndex = sourceCode.indexOf(string = fromType, startIndex = startIndex)
- }
- }
- outputFile.writeText(sourceCode)
- }
- }
-}
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/Transformer.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/Transformer.kt
index c0b47a9..3e9c460 100644
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/Transformer.kt
+++ b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/Transformer.kt
@@ -32,13 +32,4 @@
* Runs transformation of the given file.
*/
fun runTransform(file: ArchiveFile)
-
- /**
- * Transforms the the given source file.
- */
- fun Transformer.transformSource(file: ArchiveFile, context: TransformationContext) {
- SourceJetifier.jetifySourceFile(context.config,
- String(file.data),
- file.relativePath.toFile())
- }
}
\ No newline at end of file
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/bytecode/ByteCodeTransformer.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/bytecode/ByteCodeTransformer.kt
index 58301ec..14460b8 100644
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/bytecode/ByteCodeTransformer.kt
+++ b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/bytecode/ByteCodeTransformer.kt
@@ -29,8 +29,7 @@
private val context: TransformationContext
) : Transformer {
- // Does not yet support single bytecode file transformation, file has to be within archive.
- override fun canTransform(file: ArchiveFile) = file.isClassFile() && !file.isSingleFile
+ override fun canTransform(file: ArchiveFile) = file.isClassFile()
override fun runTransform(file: ArchiveFile) {
val reader = ClassReader(file.data)
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.kt
index 24544fd..6898866 100644
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.kt
+++ b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.kt
@@ -88,8 +88,8 @@
// Verify that we did not make an ambiguous mapping, see b/116745353
if (!context.allowAmbiguousPackages && AMBIGUOUS_STRINGS.contains(type)) {
- throw AmbiguousStringJetifierException("The given artifact contains a string literal " +
- "with a package reference '$value' that cannot be safely rewritten. Libraries " +
+ throw IllegalArgumentException("The given artifact contains a string literal with" +
+ " a package reference '$value' that cannot be safely rewritten. Libraries " +
"using reflection such as annotation processors need to be updated manually " +
"to add support for androidx.")
}
@@ -148,8 +148,3 @@
return path
}
}
-
-/**
- * Thrown when jetifier finds a string reference to a package that has ambiguous mapping.
- */
-class AmbiguousStringJetifierException(message: String) : Exception(message)
\ No newline at end of file
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/java/JavaTransformer.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/java/JavaTransformer.kt
deleted file mode 100644
index 27085c8..0000000
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/java/JavaTransformer.kt
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.android.tools.build.jetifier.processor.com.android.tools.build.jetifier.processor.transform.java
-
-import com.android.tools.build.jetifier.processor.archive.ArchiveFile
-import com.android.tools.build.jetifier.processor.transform.TransformationContext
-import com.android.tools.build.jetifier.processor.transform.Transformer
-
-class JavaTransformer internal constructor(private val context: TransformationContext)
- : Transformer {
-
- // Transforms only single java source files for now and not ones contained in archives.
- override fun canTransform(file: ArchiveFile) = file.isJavaFile() && file.isSingleFile
-
- override fun runTransform(file: ArchiveFile) {
- transformSource(file, context)
- }
-}
\ No newline at end of file
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/metainf/MetaInfTransformer.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/metainf/MetaInfTransformer.kt
index 7ddefbd..5e3c621 100644
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/metainf/MetaInfTransformer.kt
+++ b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/metainf/MetaInfTransformer.kt
@@ -45,12 +45,10 @@
)
}
- // Does not support single proguard file transformation, file has to be within archive.
override fun canTransform(file: ArchiveFile): Boolean {
return context.rewritingSupportLib &&
file.relativePath.toString().contains(META_INF_DIR, ignoreCase = true) &&
- file.fileName.endsWith(VERSION_FILE_SUFFIX, ignoreCase = true) &&
- !file.isSingleFile
+ file.fileName.endsWith(VERSION_FILE_SUFFIX, ignoreCase = true)
}
override fun runTransform(file: ArchiveFile) {
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/ProGuardTransformer.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/ProGuardTransformer.kt
index e5b9866..129df0b 100644
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/ProGuardTransformer.kt
+++ b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/proguard/ProGuardTransformer.kt
@@ -37,8 +37,7 @@
))
override fun canTransform(file: ArchiveFile): Boolean {
- // Does not support single proguard file transformation, file has to be within archive.
- return file.isProGuardFile() && !file.isSingleFile
+ return file.isProGuardFile()
}
override fun runTransform(file: ArchiveFile) {
@@ -52,3 +51,4 @@
file.setNewData(result.toByteArray())
}
}
+
diff --git a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/resource/XmlResourcesTransformer.kt b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/resource/XmlResourcesTransformer.kt
index 4d8dd2c..4bdf93a 100644
--- a/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/resource/XmlResourcesTransformer.kt
+++ b/jetifier/jetifier/processor/src/main/kotlin/com/android/tools/build/jetifier/processor/transform/resource/XmlResourcesTransformer.kt
@@ -72,10 +72,6 @@
override fun canTransform(file: ArchiveFile) = file.isXmlFile() && !file.isPomFile()
override fun runTransform(file: ArchiveFile) {
- if (file.isSingleFile) {
- transformSource(file, context)
- return
- }
if (file.fileName == "maven-metadata.xml") {
// Dejetification is picking this file and we don't want to deal with it.
return
diff --git a/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/signatures/SignatureIntegrationTest.kt b/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/signatures/SignatureIntegrationTest.kt
deleted file mode 100644
index 588a3fd..0000000
--- a/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/signatures/SignatureIntegrationTest.kt
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright 2019 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 com.android.tools.build.jetifier.processor.signatures
-
-import com.android.tools.build.jetifier.core.config.Config
-import com.android.tools.build.jetifier.core.config.ConfigParser
-import com.android.tools.build.jetifier.processor.FileMapping
-import com.android.tools.build.jetifier.processor.Processor
-import com.android.tools.build.jetifier.processor.SignatureFilesFoundJetifierException
-import com.android.tools.build.jetifier.processor.archive.Archive
-import com.google.common.truth.Truth
-import org.junit.Test
-import java.io.File
-
-class SignatureIntegrationTest {
-
- private val signedLib = File(
- javaClass.getResource("/signatureDetectionTest/signedLibrary.jar").file)
-
- @Test
- fun archiveWithSignature_notJetified_shouldBeOk() {
- val processor = Processor.createProcessor3(
- // Since we give empty config, no jetification can happen. Thus jetifier thinks that
- // the library is not affected by it.
- Config.fromOptional()
- )
-
- val toFile = File.createTempFile("signatureTestResult.jar", "test")
-
- processor.transform(input = setOf(FileMapping(from = signedLib, to = toFile)))
-
- // Make sure that signatures were not stripped out
- val archive = Archive.Builder.extract(toFile)
- val mf = archive.files.firstOrNull {
- it.relativePath.toString() == "META-INF/MANIFEST.MF" }
- val rsa = archive.files.firstOrNull {
- it.relativePath.toString() == "META-INF/PFOPENSO.RSA" }
- val sf = archive.files.firstOrNull {
- it.relativePath.toString() == "META-INF/PFOPENSO.SF" }
- Truth.assertThat(mf).isNotNull()
- Truth.assertThat(rsa).isNotNull()
- Truth.assertThat(sf).isNotNull()
- }
-
- @Test
- fun archiveWithSignature_notJetified_stripRequired_shouldNotStrip() {
- val processor = Processor.createProcessor3(
- Config.fromOptional(),
- stripSignatures = true)
-
- val toFile = File.createTempFile("signatureTestResult.jar", "test")
-
- processor.transform(input = setOf(FileMapping(from = signedLib, to = toFile)))
-
- val archive = Archive.Builder.extract(toFile)
- val mf = archive.files.firstOrNull {
- it.relativePath.toString() == "META-INF/MANIFEST.MF" }
- val rsa = archive.files.firstOrNull {
- it.relativePath.toString() == "META-INF/PFOPENSO.RSA" }
- val sf = archive.files.firstOrNull {
- it.relativePath.toString() == "META-INF/PFOPENSO.SF" }
- Truth.assertThat(mf).isNotNull()
- Truth.assertThat(rsa).isNotNull()
- Truth.assertThat(sf).isNotNull()
- }
-
- @Test(expected = SignatureFilesFoundJetifierException::class)
- fun archiveWithSignature_andJetified_shouldThrowError() {
- val processor = Processor.createProcessor3(
- ConfigParser.loadDefaultConfig()!!
- )
-
- val toFile = File.createTempFile("signatureTestResult.jar", "test")
-
- processor.transform(input = setOf(FileMapping(from = signedLib, to = toFile)))
- }
-
- @Test
- fun archiveWithSignature_andJetified__stripRequired_shouldStrip() {
- val processor = Processor.createProcessor3(
- ConfigParser.loadDefaultConfig()!!,
- stripSignatures = true
- )
-
- val toFile = File.createTempFile("signatureTestResult.jar", "test")
-
- processor.transform(input = setOf(FileMapping(from = signedLib, to = toFile)))
-
- val archive = Archive.Builder.extract(toFile)
- val mf = archive.files.firstOrNull {
- it.relativePath.toString() == "META-INF/MANIFEST.MF" }
- val rsa = archive.files.firstOrNull {
- it.relativePath.toString() == "META-INF/PFOPENSO.RSA" }
- val sf = archive.files.firstOrNull {
- it.relativePath.toString() == "META-INF/PFOPENSO.SF" }
- Truth.assertThat(mf).isNull()
- Truth.assertThat(rsa).isNull()
- Truth.assertThat(sf).isNull()
- }
-}
\ No newline at end of file
diff --git a/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/signatures/SignaturePathCheckTest.kt b/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/signatures/SignaturePathCheckTest.kt
deleted file mode 100644
index 323b80b7..0000000
--- a/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/signatures/SignaturePathCheckTest.kt
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright 2019 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 com.android.tools.build.jetifier.processor.signatures
-
-import com.android.tools.build.jetifier.processor.archive.ArchiveFile
-import com.android.tools.build.jetifier.processor.isSignatureFile
-import com.google.common.truth.Truth
-import org.junit.Test
-import java.nio.file.Paths
-
-class SignaturePathCheckTest {
-
- @Test
- fun signatureFilePath_SF() {
- Truth.assertThat(checkSignatureFor("meta-inf/hello.sf")).isTrue()
- Truth.assertThat(checkSignatureFor("/meta-inf/hello.sf")).isTrue()
- Truth.assertThat(checkSignatureFor("/META-INF/HELLO.SF")).isTrue()
- }
-
- @Test
- fun signatureFilePath_DSA() {
- Truth.assertThat(checkSignatureFor("/meta-inf/hello.dsa")).isTrue()
- Truth.assertThat(checkSignatureFor("/META-INF/HELLO.DSA")).isTrue()
- }
-
- @Test
- fun signatureFilePath_RSA() {
- Truth.assertThat(checkSignatureFor("/meta-inf/hello.rsa")).isTrue()
- Truth.assertThat(checkSignatureFor("/META-INF/HELLO.RSA")).isTrue()
- }
-
- @Test
- fun signatureFilePath_SIG() {
- Truth.assertThat(checkSignatureFor("/meta-inf/hello.sig")).isTrue()
- Truth.assertThat(checkSignatureFor("/META-INF/HELLO.SIG")).isTrue()
- }
-
- @Test
- fun signatureFilePath_SIG123() {
- Truth.assertThat(checkSignatureFor("/meta-inf/hello.sig-123")).isTrue()
- Truth.assertThat(checkSignatureFor("/META-INF/HELLO.SIG-123")).isTrue()
- }
-
- @Test
- fun signatureFilePath_sf_notUnix() {
- Truth.assertThat(checkSignatureFor("\\meta-inf\\hello.sf")).isTrue()
- }
-
- @Test
- fun signatureFilePath_DSA_notUnix() {
- Truth.assertThat(checkSignatureFor("\\meta-inf\\hello.DSA")).isTrue()
- }
-
- @Test
- fun signatureFilePath_RSA_notUnix() {
- Truth.assertThat(checkSignatureFor("\\meta-inf\\hello.RSA")).isTrue()
- }
-
- @Test
- fun signatureFilePath_SIG_notUnix() {
- Truth.assertThat(checkSignatureFor("\\meta-inf\\hello.SIG-123")).isTrue()
- }
-
- @Test
- fun signatureFilePath_SF_notInMetaInf() {
- Truth.assertThat(checkSignatureFor("/not-meta-inf/hello.SF")).isFalse()
- Truth.assertThat(checkSignatureFor("/meta-inf/old/hello.SF")).isFalse()
- Truth.assertThat(checkSignatureFor("/old/meta-inf/hello.SF")).isFalse()
- Truth.assertThat(checkSignatureFor("old/meta-inf/hello.SF")).isFalse()
- }
-
- @Test
- fun signatureFilePath_DSA_notInMetaInf() {
- Truth.assertThat(checkSignatureFor("/not-meta-inf/hello.DSA")).isFalse()
- Truth.assertThat(checkSignatureFor("/meta-inf/old/hello.DSA")).isFalse()
- }
-
- @Test
- fun signatureFilePath_RSA_notInMetaInf() {
- Truth.assertThat(checkSignatureFor("/not-meta-inf/hello.RSA")).isFalse()
- Truth.assertThat(checkSignatureFor("/meta-inf/old/hello.RSA")).isFalse()
- }
-
- @Test
- fun signatureFilePath_SIG_notInMetaInf() {
- Truth.assertThat(checkSignatureFor("/not-meta-inf/hello.SIG-1")).isFalse()
- Truth.assertThat(checkSignatureFor("/meta-inf/old/hello.SIG-1")).isFalse()
- }
-
- @Test
- fun signatureFilePath_SF_onlySubstring() {
- Truth.assertThat(checkSignatureFor("/meta-inf/hello.SF.nope")).isFalse()
- }
-
- @Test
- fun signatureFilePath_DSA_onlySubstring() {
- Truth.assertThat(checkSignatureFor("/meta-inf/hello.DSA.nope")).isFalse()
- }
-
- @Test
- fun signatureFilePath_RSA_onlySubstring() {
- Truth.assertThat(checkSignatureFor("/meta-inf/hello.RSA.nope")).isFalse()
- }
-
- @Test
- fun signatureFilePath_SIG_onlySubstring() {
- Truth.assertThat(checkSignatureFor("/meta-inf/hello.SIG.nope")).isFalse()
- }
-
- @Test
- fun signatureFilePath_manifestFile_empty() {
- Truth.assertThat(checkSignatureFor("/meta-inf/manifest.mf")).isFalse()
- }
-
- @Test
- fun signatureFilePath_manifestFile_notRelated() {
- Truth.assertThat(
- checkSignatureFor(
- "/meta-inf/manifest.mf",
- "Hello world!".toByteArray())
- ).isFalse()
- }
-
- @Test
- fun signatureFilePath_manifestFile_containingSignature() {
- Truth.assertThat(
- checkSignatureFor(
- "/meta-inf/manifest.mf",
- "SHA1-Digest: (base64 representation of SHA1 digest)".toByteArray())
- ).isTrue()
- }
-
- @Test
- fun signatureFilePath_manifestFile_containingSignature2() {
- Truth.assertThat(
- checkSignatureFor(
- "/meta-inf/manifest.mf",
- "SHA-256-Digest: (base64 representation of SHA-256 digest)".toByteArray())
- ).isTrue()
- }
-
- @Test
- fun signatureFilePath_manifestFile_notInPath_containingSignature() {
- Truth.assertThat(
- checkSignatureFor(
- "/not-meta-inf/manifest.mf",
- "SHA1-Digest: (base64 representation of SHA1 digest)".toByteArray())
- ).isFalse()
- }
-
- private fun checkSignatureFor(path: String, content: ByteArray = byteArrayOf()): Boolean {
- return isSignatureFile(
- ArchiveFile(
- relativePath = Paths.get(path),
- data = content
- )
- )
- }
-}
\ No newline at end of file
diff --git a/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/transform/SingleFileJetificationTest.kt b/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/transform/SingleFileJetificationTest.kt
deleted file mode 100644
index 29d6481..0000000
--- a/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/transform/SingleFileJetificationTest.kt
+++ /dev/null
@@ -1,176 +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 com.android.tools.build.jetifier.processor.transform
-
-import com.android.tools.build.jetifier.core.config.Config
-import com.android.tools.build.jetifier.core.type.JavaType
-import com.android.tools.build.jetifier.core.type.TypesMap
-import com.android.tools.build.jetifier.processor.FileMapping
-import com.android.tools.build.jetifier.processor.Processor
-import com.google.common.truth.Truth
-import java.io.File
-import org.junit.Test
-
-/**
- * Tests that the source jetifier changes source code in the expected manner
- */
-class SingleFileJetificationTest {
-
- @Test
- fun xmlSourceJetifiedProperly() {
- testSingleFileJetification(
- givenFileContent = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<android.support.v7.preference.Preference/>",
- expectedOutputFileContent = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<androidx.preference.Preference/>",
- fileExtension = ".xml",
- typesMap = mapOf(
- "android/support/v7/preference/Preference" to "androidx/preference/Preference"
- )
- )
- }
-
- @Test
- fun javaSourceJetifiedProperly() {
- testSingleFileJetification(
- givenFileContent = "import android.support.v7.preference.Preference;\n" +
- "import android.support.v7.widget.CardViewBaseImpl\n" +
- "import android.support.v7.widget.CardViewApi21Impl\n" +
- "android.support.v7.widget.CardViewDelegate\n" +
- "code\n" +
- "inlineUsage(android.support.v7.widget.ThemedSpinnerAdapter variable);",
- expectedOutputFileContent = "import androidx.preference.Preference;\n" +
- "import androidx.cardview.widget.CardViewBaseImpl\n" +
- "import androidx.cardview.widget.CardViewApi21Impl\n" +
- "androidx.cardview.widget.CardViewDelegate\n" +
- "code\n" +
- "inlineUsage(androidx.appcompat.widget.ThemedSpinnerAdapter variable);",
- fileExtension = ".java",
- typesMap = mapOf(
- "android/support/v7/preference/Preference" to
- "androidx/preference/Preference",
- "android/support/v7/widget/CardViewApi21Impl" to
- "androidx/cardview/widget/CardViewApi21Impl",
- "android/support/v7/widget/CardViewBaseImpl" to
- "androidx/cardview/widget/CardViewBaseImpl",
- "android/support/v7/widget/CardViewDelegate" to
- "androidx/cardview/widget/CardViewDelegate",
- "android/support/v7/widget/ThemedSpinnerAdapter" to
- "androidx/appcompat/widget/ThemedSpinnerAdapter"
- )
- )
- }
-
- @Test
- fun javaSourceDejetifiedProperly() {
- testSingleFileJetification(
- givenFileContent = "import androidx.preference.Preference;\n" +
- "import androidx.cardview.widget.CardViewBaseImpl\n" +
- "import androidx.cardview.widget.CardViewApi21Impl\n" +
- "androidx.cardview.widget.CardViewDelegate\n" +
- "code\n" +
- "inlineUsage(androidx.appcompat.widget.ThemedSpinnerAdapter variable);",
- expectedOutputFileContent = "import android.support.v7.preference.Preference;\n" +
- "import android.support.v7.widget.CardViewBaseImpl\n" +
- "import android.support.v7.widget.CardViewApi21Impl\n" +
- "android.support.v7.widget.CardViewDelegate\n" +
- "code\n" +
- "inlineUsage(android.support.v7.widget.ThemedSpinnerAdapter variable);",
- fileExtension = ".java",
- typesMap = mapOf(
- "android/support/v7/preference/Preference" to
- "androidx/preference/Preference",
- "android/support/v7/widget/CardViewApi21Impl" to
- "androidx/cardview/widget/CardViewApi21Impl",
- "android/support/v7/widget/CardViewBaseImpl" to
- "androidx/cardview/widget/CardViewBaseImpl",
- "android/support/v7/widget/CardViewDelegate" to
- "androidx/cardview/widget/CardViewDelegate",
- "android/support/v7/widget/ThemedSpinnerAdapter" to
- "androidx/appcompat/widget/ThemedSpinnerAdapter"
- ),
- isReversed = true
- )
- }
-
- @Test
- fun doesNotJetifySubstring() {
- val sameInputOutput = "import android.support.v7.preference.PreferenceExtension;\n" +
- "code\n" +
- "inlineUsage(android.support.v7.widget.ThemedSpinnerAdapter2 variable);"
- testSingleFileJetification(
- givenFileContent = sameInputOutput,
- expectedOutputFileContent = sameInputOutput,
- fileExtension = ".java",
- typesMap = mapOf(
- "android/support/v7/preference/Preference" to
- "androidx/preference/Preference",
- "android/support/v7/widget/ThemedSpinnerAdapter" to
- "androidx/appcompat/widget/ThemedSpinnerAdapter"
- )
- )
- }
-
- @Test
- fun doesNotSourceJetifyNonJavaOrXMLFiles() {
- testSingleFileJetification(
- givenFileContent =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<android.support.v7.preference.Preference/>",
- expectedOutputFileContent = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<androidx.preference.Preference/>",
- fileExtension = ".aar",
- typesMap = mapOf(
- "android/support/v7/preference/Preference" to "androidx/preference/Preference"
- ),
- expectSpecifiedOutput = false
- )
- }
-
- /**
- * Runs the whole transformation process over the given single file and verifies that
- * currently transformable files transform properly while unsupported single file
- * transformations throw the appropriate error.
- */
- private fun testSingleFileJetification(
- givenFileContent: String,
- expectedOutputFileContent: String,
- fileExtension: String,
- typesMap: Map<String, String> = emptyMap(),
- isReversed: Boolean = false,
- expectSpecifiedOutput: Boolean = true
- ) {
- val typeMap = TypesMap(typesMap.map { JavaType(it.key) to JavaType(it.value) }.toMap())
- val config = Config.fromOptional(
- typesMap = typeMap
- )
- val processor = Processor.createProcessor3(
- config = config,
- reversedMode = isReversed,
- rewritingSupportLib = false)
-
- val inputFile = File("/tmp/singleFileTestInput" + fileExtension)
- inputFile.writeText(givenFileContent)
- val outputFile = File("/tmp/singleFileTestOutput" + fileExtension)
- processor.transform(setOf(FileMapping(inputFile, outputFile)))
- if (expectSpecifiedOutput) {
- Truth.assertThat(outputFile.readText()).isEqualTo(expectedOutputFileContent)
- } else {
- Truth.assertThat(outputFile.readText()).isNotEqualTo(expectedOutputFileContent)
- }
- }
-}
\ No newline at end of file
diff --git a/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImplTest.kt b/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImplTest.kt
index 8ee7e2b..5560c0a 100644
--- a/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImplTest.kt
+++ b/jetifier/jetifier/processor/src/test/kotlin/com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImplTest.kt
@@ -41,7 +41,7 @@
Truth.assertThat(remapper.rewriteString(given)).isEqualTo(expected)
}
- @Test(expected = AmbiguousStringJetifierException::class)
+ @Test(expected = IllegalArgumentException::class)
fun remapString_ambiguousPackageGiven_throwsException() {
val remapper = prepareRemapper(
TypesMap.EMPTY,
diff --git a/jetifier/jetifier/processor/src/test/resources/signatureDetectionTest/signedLibrary.jar b/jetifier/jetifier/processor/src/test/resources/signatureDetectionTest/signedLibrary.jar
deleted file mode 100644
index 7ba5d80..0000000
--- a/jetifier/jetifier/processor/src/test/resources/signatureDetectionTest/signedLibrary.jar
+++ /dev/null
Binary files differ
diff --git a/jetifier/jetifier/source-transformer/rewriteAll.sh b/jetifier/jetifier/source-transformer/rewriteAll.sh
new file mode 100755
index 0000000..c402d5e
--- /dev/null
+++ b/jetifier/jetifier/source-transformer/rewriteAll.sh
@@ -0,0 +1,7 @@
+set -e
+work_path="$PWD"
+
+script_path="$(cd $(dirname $0) && pwd)"
+
+"$script_path/rewriteMake.py"
+"$script_path/rewritePackageNames.py"
diff --git a/jetifier/jetifier/source-transformer/rewriteMake.py b/jetifier/jetifier/source-transformer/rewriteMake.py
new file mode 100755
index 0000000..a8ee1d7
--- /dev/null
+++ b/jetifier/jetifier/source-transformer/rewriteMake.py
@@ -0,0 +1,115 @@
+#!/usr/bin/python
+
+import csv, subprocess
+
+class StringBuilder(object):
+ def __init__(self, item=None):
+ self.items = []
+ if item is not None:
+ self.add(item)
+
+ def add(self, item):
+ self.items.append(str(item))
+ return self
+
+ def __str__(self):
+ return "".join(self.items)
+
+target_map = """android-slices-builders,androidx.slice_slice-builders
+android-slices-core,androidx.slice_slice-core
+android-slices-view,androidx.slice_slice-view
+android-support-animatedvectordrawable,androidx.vectordrawable_vectordrawable-animated
+android-support-annotations,androidx.annotation_annotation
+android-support-asynclayoutinflater,androidx.asynclayoutinflater_asynclayoutinflater
+android-support-car,androidx.car_car
+android-support-collections,androidx.collection_collection
+android-support-compat,androidx.core_core
+android-support-constraint-layout,androidx-constraintlayout_constraintlayout
+android-support-constraint-layout-solver,androidx-constraintlayout_constraintlayout-solver
+android-support-contentpaging,androidx.contentpager_contentpager
+android-support-coordinatorlayout,androidx.coordinatorlayout_coordinatorlayout
+android-support-core-ui,androidx.legacy_legacy-support-core-ui
+android-support-core-utils,androidx.legacy_legacy-support-core-utils
+android-support-cursoradapter,androidx.cursoradapter_cursoradapter
+android-support-customtabs,androidx.browser_browser
+android-support-customview,androidx.customview_customview
+android-support-documentfile,androidx.documentfile_documentfile
+android-support-drawerlayout,androidx.drawerlayout_drawerlayout
+android-support-dynamic-animation,androidx.dynamicanimation_dynamicanimation
+android-support-emoji,androidx.emoji_emoji
+android-support-emoji-appcompat,androidx.emoji_emoji-appcompat
+android-support-emoji-bundled,androidx.emoji_emoji-bundled
+android-support-exifinterface,androidx.exifinterface_exifinterface
+android-support-fragment,androidx.fragment_fragment
+android-support-heifwriter,androidx.heifwriter_heifwriter
+android-support-interpolator,androidx.interpolator_interpolator
+android-support-loader,androidx.loader_loader
+android-support-localbroadcastmanager,androidx.localbroadcastmanager_localbroadcastmanager
+android-support-media-compat,androidx.media_media
+android-support-percent,androidx.percentlayout_percentlayout
+android-support-print,androidx.print_print
+android-support-recommendation,androidx.recommendation_recommendation
+android-support-recyclerview-selection,androidx.recyclerview_recyclerview-selection
+android-support-slidingpanelayout,androidx.slidingpanelayout_slidingpanelayout
+android-support-swiperefreshlayout,androidx.swiperefreshlayout_swiperefreshlayout
+android-support-textclassifier,androidx.textclassifier_textclassifier
+android-support-transition,androidx.transition_transition
+android-support-tv-provider,androidx.tvprovider_tvprovider
+android-support-v13,androidx.legacy_legacy-support-v13
+android-support-v14-preference,androidx.legacy_legacy-preference-v14
+android-support-v17-leanback,androidx.leanback_leanback
+android-support-v17-preference-leanback,androidx.leanback_leanback-preference
+android-support-v4,androidx.legacy_legacy-support-v4
+android-support-v7-appcompat,androidx.appcompat_appcompat
+android-support-v7-cardview,androidx.cardview_cardview
+android-support-v7-gridlayout,androidx.gridlayout_gridlayout
+android-support-v7-mediarouter,androidx.mediarouter_mediarouter
+android-support-v7-palette,androidx.palette_palette
+android-support-v7-preference,androidx.preference_preference
+android-support-v7-recyclerview,androidx.recyclerview_recyclerview
+android-support-vectordrawable,androidx.vectordrawable_vectordrawable
+android-support-viewpager,androidx.viewpager_viewpager
+android-support-wear,androidx.wear_wear
+android-support-webkit,androidx.webkit_webkit
+android-arch-core-common,androidx.arch.core_core-common
+android-arch-core-runtime,androidx.arch.core_core-runtime
+android-arch-lifecycle-common,androidx.lifecycle_lifecycle-common
+android-arch-lifecycle-common-java8,androidx.lifecycle_lifecycle-common-java8
+android-arch-lifecycle-extensions,androidx.lifecycle_lifecycle-extensions
+android-arch-lifecycle-livedata,androidx.lifecycle_lifecycle-livedata
+android-arch-lifecycle-livedata-core,androidx.lifecycle_lifecycle-livedata-core
+android-arch-lifecycle-runtime,androidx.lifecycle_lifecycle-runtime
+android-arch-lifecycle-viewmodel,androidx.lifecycle_lifecycle-viewmodel
+android-arch-paging-common,androidx.paging_paging-common
+android-arch-paging-runtime,androidx.paging_paging-runtime
+android-arch-persistence-db,androidx.sqlite_sqlite
+android-arch-persistence-db-framework,androidx.sqlite_sqlite-framework
+android-arch-room-common,androidx.room_room-common
+android-arch-room-migration,androidx.room_room-migration
+android-arch-room-runtime,androidx.room_room-runtime
+android-arch-room-testing,androidx.room_room-testing
+android-support-design,com.google.android.material_material
+$(ANDROID_SUPPORT_DESIGN_TARGETS),com.google.android.material_material"""
+
+reader = csv.reader(target_map.split('\n'), delimiter=',')
+
+rewriterTextBuilder = StringBuilder()
+for row in reader:
+ rewriterTextBuilder.add("s|").add(row[0]).add("|").add(row[1]).add("|g\n")
+scriptPath = "/tmp/jetifier-make-sed-script.txt"
+print("Writing " + scriptPath)
+with open(scriptPath, 'w') as scriptFile:
+ scriptFile.write(str(rewriterTextBuilder))
+
+rewriteCommand = "time find . -name out -prune -o -name .git -prune -o -name .repo -prune -o -iregex '.*\.mk\|.*\.bp' -print | xargs -n 1 --no-run-if-empty -P 64 sed -i -f /tmp/jetifier-make-sed-script.txt"
+
+print("""
+Will run command:
+
+""" + rewriteCommand + """
+
+""")
+response = raw_input("Ok? [y/n]")
+if response == "y":
+ subprocess.check_output(rewriteCommand, shell=True)
+
diff --git a/jetifier/jetifier/source-transformer/rewritePackageNames.py b/jetifier/jetifier/source-transformer/rewritePackageNames.py
new file mode 100755
index 0000000..99326f9
--- /dev/null
+++ b/jetifier/jetifier/source-transformer/rewritePackageNames.py
@@ -0,0 +1,143 @@
+#!/usr/bin/python
+
+# This script does package renamings on source code (and .xml files and build files, etc), as part of migrating code to Jetpack.
+# For example, this script may replace the text
+# import android.support.annotation.RequiresApi;
+# with
+# import androidx.annotation.RequiresApi;
+
+# See also b/74074903
+import json
+import os.path
+import subprocess
+
+HARDCODED_RULES_REVERSE = [
+ "s|androidx.core.os.ResultReceiver|android.support.v4.os.ResultsReceiver|g\n",
+ "s|androidx.core.media.MediaBrowserCompat|android.support.v4.media.MediaBrowserCompat|g\n",
+ "s|androidx.core.media.MediaDescriptionCompat|android.support.v4.media.MediaDescriptionCompat|g\n",
+ "s|androidx.core.media.MediaMetadataCompat|android.support.v4.media.MediaMetadataCompat|g\n",
+ "s|androidx.core.media.RatingCompat|android.support.v4.media.RatingCompat|g\n",
+ "s|androidx.core.media.session.MediaControllerCompat|android.support.v4.media.session.MediaControllerCompat|g\n",
+ "s|androidx.core.media.session.MediaSessionCompat|android.support.v4.media.session.MediaSessionCompat|g\n",
+ "s|androidx.core.media.session.ParcelableVolumeInfo|android.support.v4.media.session.ParcelableVolumeInfo|g\n",
+ "s|androidx.core.media.session.PlaybackStateCompat|android.support.v4.media.session.PlaybackStateCompat|g\n",
+]
+
+class StringBuilder(object):
+ def __init__(self, item=None):
+ self.items = []
+ if item is not None:
+ self.add(item)
+
+ def add(self, item):
+ self.items.append(str(item))
+ return self
+
+ def __str__(self):
+ return "".join(self.items)
+
+class ExecutionConfig(object):
+ """Stores configuration about this execution of the package renaming.
+ For example, file paths of the source code.
+ This config could potentially be affected by command-line arguments.
+ """
+ def __init__(self, jetifierConfig, sourceRoots, excludeDirs):
+ self.jetifierConfig = jetifierConfig
+ self.sourceRoots = sourceRoots
+ self.excludeDirs = excludeDirs
+
+
+class SourceRewriteRule(object):
+ def __init__(self, fromName, toName):
+ self.fromName = fromName
+ self.toName = toName
+
+ def serialize(self):
+ return self.fromName + ":" + self.toName
+
+class JetifierConfig(object):
+ """Stores configuration about the renaming itself, such as package rename rules.
+ This config isn't supposed to be affected by command-line arguments.
+ """
+ @staticmethod
+ def parse(filePath):
+ with open(filePath) as f:
+ lines = f.readlines()
+ nonCommentLines = [line for line in lines if not line.strip().startswith("#")]
+ parsed = json.loads("".join(nonCommentLines))
+ return JetifierConfig(parsed)
+
+ def __init__(self, parsedJson):
+ self.json = parsedJson
+
+ def getTypesMap(self):
+ rules = []
+ for rule in self.json["rules"]:
+ fromName = rule["from"].replace("/", ".").replace("(.*)", "")
+ toName = rule["to"].replace("/", ".").replace("{0}", "")
+ if not toName.startswith("ignore"):
+ rules.append(SourceRewriteRule(fromName, toName))
+
+ return rules
+
+
+def createRewriteCommand(executionConfig):
+ # create command to find source files
+ finderTextBuilder = StringBuilder("find")
+ for sourceRoot in executionConfig.sourceRoots:
+ finderTextBuilder.add(" ").add(sourceRoot)
+ for exclusion in executionConfig.excludeDirs:
+ finderTextBuilder.add(" -name ").add(exclusion).add(" -prune -o")
+ finderTextBuilder.add(" -iregex '.*\.java\|.*\.xml\|.*\.cfg\|.*\.flags' -print")
+
+ # create command to rewrite one source
+ print("Building sed instructions")
+ rewriterTextBuilder = StringBuilder()
+ rewriteRules = executionConfig.jetifierConfig.getTypesMap()
+ for rule in rewriteRules:
+ rewriterTextBuilder.add("s|").add(rule.fromName.replace(".", "\.")).add("|").add(rule.toName).add("|g\n")
+ for rule in HARDCODED_RULES_REVERSE:
+ rewriterTextBuilder.add(rule)
+ scriptPath = "/tmp/jetifier-sed-script.txt"
+ print("Writing " + scriptPath)
+ with open(scriptPath, 'w') as scriptFile:
+ scriptFile.write(str(rewriterTextBuilder))
+
+ # create the command to do the rewrites
+ fullCommand = "time " + str(finderTextBuilder) + " | xargs -n 1 --no-run-if-empty -P 64 sed -i -f " + scriptPath
+
+ return fullCommand
+
+def processConfig(executionConfig):
+ print("Building rewrite command")
+ rewriteCommand = createRewriteCommand(executionConfig)
+ commandLength = len(rewriteCommand)
+ print("""
+Will run command:
+
+""" + rewriteCommand + """
+
+""")
+ response = raw_input("Ok? [y/n]")
+ if response == "y":
+ subprocess.check_output(rewriteCommand, shell=True)
+
+
+def main():
+ pathOfThisFile = os.path.realpath(__file__)
+ jetifierPath = os.path.abspath(os.path.join(pathOfThisFile, "..", ".."))
+
+ jetifierConfigPath = os.path.join(jetifierPath, "core/src/main/resources", "default.generated.config")
+ print("Parsing " + jetifierConfigPath)
+ jetifierConfig = JetifierConfig.parse(jetifierConfigPath)
+
+ sourceRoot = os.getcwd()
+ excludeDirs = ["out", ".git", ".repo"]
+
+ executionConfig = ExecutionConfig(jetifierConfig, [sourceRoot], excludeDirs)
+
+ processConfig(executionConfig)
+
+main()
+
+
diff --git a/jetifier/jetifier/source-transformer/source_transformer.py b/jetifier/jetifier/source-transformer/source_transformer.py
deleted file mode 100755
index 448e092..0000000
--- a/jetifier/jetifier/source-transformer/source_transformer.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/python
-
-# This script does package renamings on source code (and .xml files and build files, etc), as part of migrating code to Jetpack.
-# For example, this script may replace the text
-# import android.support.annotation.RequiresApi;
-# with
-# import androidx.annotation.RequiresApi;
-
-# See also b/74074903
-import argparse
-import json
-import os.path
-import subprocess
-
-class StringBuilder(object):
- def __init__(self, item=None):
- self.items = []
- if item is not None:
- self.add(item)
-
- def add(self, item):
- self.items.append(str(item))
- return self
-
- def __str__(self):
- return "".join(self.items)
-
-class SourceRewriteRule(object):
- def __init__(self, fromName, toName):
- self.fromName = fromName
- self.toName = toName
-
- def serialize(self):
- return self.fromName + ":" + self.toName
-
-class JetifierConfig(object):
- """
- Stores configuration about the renaming itself, such as package rename rules.
- """
- @staticmethod
- def parse(filePath):
- with open(filePath) as f:
- lines = f.readlines()
- nonCommentLines = [line for line in lines if not line.strip().startswith("#")]
- parsed = json.loads("".join(nonCommentLines))
- return JetifierConfig(parsed)
-
- def __init__(self, parsedJson):
- self.json = parsedJson
-
- def getTypesMap(self, reverse):
- rules = []
- for rule in self.json["rules"]:
- fromName = rule["from"].replace("/", ".").replace("(.*)", "")
- toName = rule["to"].replace("/", ".").replace("{0}", "")
- if not toName.startswith("ignore"):
- if reverse:
- # Dejetify instead, so toName becomes fromName and vice versa.
- rules.append(SourceRewriteRule(toName, fromName))
- else:
- rules.append(SourceRewriteRule(fromName, toName))
-
- return rules
-
-
-def createSourceJetificationSedCommand(args, jetifierConfig):
- rewriterTextBuilder = StringBuilder()
- rewriteRules = jetifierConfig.getTypesMap(args.reverse)
- # Append substitution rules, this will most probably never exceed the shell
- # characters per line limit which should be 131072.
- # In the weird case where the user somehow modified their ARG_MAX,
- # they'll know what to do when they see a /bin/sed: Argument list too long
- # error.
- for rule in rewriteRules:
- rewriterTextBuilder.add("-e \'s|").add(rule.fromName.replace(".", "\.")).add("|").add(rule.toName).add("|g\' ")
-
- # sed command containing substitutions and applied to the output file.
- sedCommand = "sed %s %s > %s" % (rewriterTextBuilder, args.infile, args.outfile)
- return sedCommand
-
-def jetifySource(args):
- # If config file is not specified, look for the config file in the
- # same folder.
- jetifierConfigPath = args.config
- if not jetifierConfigPath:
- jetifierConfigPath = os.path.join(os.path.realpath(__file__), "default.config")
- jetifierConfig = JetifierConfig.parse(jetifierConfigPath)
- command = createSourceJetificationSedCommand(args, jetifierConfig)
- subprocess.check_output(command, shell=True)
-
-
-def main():
- # Set up input arguments
- parser = argparse.ArgumentParser()
- parser.add_argument("-c", "--config", help="path to optional custom config file.")
- parser.add_argument("-r", "--reverse", help="operate in reverse mode (\"de-jetification\")",
- action="store_true")
- parser.add_argument("-i", "--infile",
- required=True, help="path to input source (java or xml)")
- parser.add_argument("-o", "--outfile",
- required=True, help="path to the output file, overriden if exists.")
- args = parser.parse_args()
- jetifySource(args)
-
-if __name__ == "__main__":
- main()
diff --git a/jetifier/jetifier/standalone/src/main/kotlin/com/android/tools/build/jetifier/standalone/Main.kt b/jetifier/jetifier/standalone/src/main/kotlin/com/android/tools/build/jetifier/standalone/Main.kt
index e9d5fdb..3254802 100644
--- a/jetifier/jetifier/standalone/src/main/kotlin/com/android/tools/build/jetifier/standalone/Main.kt
+++ b/jetifier/jetifier/standalone/src/main/kotlin/com/android/tools/build/jetifier/standalone/Main.kt
@@ -39,7 +39,7 @@
val OPTION_INPUT = createOption(
argName = "i",
argNameLong = "input",
- desc = "Input library path (jar, aar, zip), or source file (java, xml)",
+ desc = "Input library path (jar, aar, zip)",
isRequired = true
)
val OPTION_OUTPUT = createOption(
@@ -83,14 +83,6 @@
hasArgs = false,
isRequired = false
)
- val OPTION_STRIP_SIGNATURES = createOption(
- argName = "stripSignatures",
- argNameLong = "stripSignatures",
- desc = "Don't throw an error when jetifying a signed library and instead strip " +
- "the signature files.",
- hasArgs = false,
- isRequired = false
- )
private fun createOption(
argName: String,
@@ -119,12 +111,17 @@
Log.setLevel(cmd.getOptionValue(OPTION_LOG_LEVEL.opt))
- val input = File(cmd.getOptionValue(OPTION_INPUT.opt))
+ val inputLibrary = File(cmd.getOptionValue(OPTION_INPUT.opt))
val output = cmd.getOptionValue(OPTION_OUTPUT.opt)
val rebuildTopOfTree = cmd.hasOption(OPTION_REBUILD_TOP_OF_TREE.opt)
- val isReversed = cmd.hasOption(OPTION_REVERSED.opt)
- val isStrict = cmd.hasOption(OPTION_STRICT.opt)
- val shouldStripSignatures = cmd.hasOption(OPTION_STRIP_SIGNATURES.opt)
+
+ val fileMappings = mutableSetOf<FileMapping>()
+ if (rebuildTopOfTree) {
+ val tempFile = createTempFile(suffix = "zip")
+ fileMappings.add(FileMapping(inputLibrary, tempFile))
+ } else {
+ fileMappings.add(FileMapping(inputLibrary, File(output)))
+ }
val config = if (cmd.hasOption(OPTION_CONFIG.opt)) {
val configPath = Paths.get(cmd.getOptionValue(OPTION_CONFIG.opt))
@@ -139,19 +136,13 @@
return
}
- val fileMappings = mutableSetOf<FileMapping>()
- if (rebuildTopOfTree) {
- val tempFile = createTempFile(suffix = "zip")
- fileMappings.add(FileMapping(input, tempFile))
- } else {
- fileMappings.add(FileMapping(input, File(output)))
- }
+ val isReversed = cmd.hasOption(OPTION_REVERSED.opt)
+ val isStrict = cmd.hasOption(OPTION_STRICT.opt)
- val processor = Processor.createProcessor3(
+ val processor = Processor.createProcessor2(
config = config,
reversedMode = isReversed,
rewritingSupportLib = rebuildTopOfTree,
- stripSignatures = shouldStripSignatures,
useFallbackIfTypeIsMissing = !isStrict)
processor.transform(fileMappings)
diff --git a/leanback-preference/api/1.0.0.txt b/leanback-preference/api/1.0.0.txt
index 6a51929..75f7d49 100644
--- a/leanback-preference/api/1.0.0.txt
+++ b/leanback-preference/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.leanback.preference {
@Deprecated public abstract class BaseLeanbackPreferenceFragment extends androidx.preference.PreferenceFragment {
diff --git a/leanback-preference/api/1.1.0-alpha01.txt b/leanback-preference/api/1.1.0-alpha01.txt
index 79e53fb..75f7d49 100644
--- a/leanback-preference/api/1.1.0-alpha01.txt
+++ b/leanback-preference/api/1.1.0-alpha01.txt
@@ -1,8 +1,9 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.leanback.preference {
@Deprecated public abstract class BaseLeanbackPreferenceFragment extends androidx.preference.PreferenceFragment {
ctor @Deprecated public BaseLeanbackPreferenceFragment();
+ method @Deprecated public androidx.recyclerview.widget.RecyclerView! onCreateRecyclerView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
}
public abstract class BaseLeanbackPreferenceFragmentCompat extends androidx.preference.PreferenceFragmentCompat {
@@ -21,6 +22,8 @@
method @Deprecated public static androidx.leanback.preference.LeanbackListPreferenceDialogFragment! newInstanceMulti(String!);
method @Deprecated public static androidx.leanback.preference.LeanbackListPreferenceDialogFragment! newInstanceSingle(String!);
method @Deprecated public androidx.recyclerview.widget.RecyclerView.Adapter! onCreateAdapter();
+ method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
}
@Deprecated public class LeanbackListPreferenceDialogFragment.AdapterMulti extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder> implements androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder.OnItemClickListener {
@@ -67,6 +70,7 @@
@Deprecated public class LeanbackPreferenceDialogFragment extends android.app.Fragment {
ctor @Deprecated public LeanbackPreferenceDialogFragment();
method @Deprecated public androidx.preference.DialogPreference! getPreference();
+ method @Deprecated public void onCreate(android.os.Bundle!);
field @Deprecated public static final String ARG_KEY = "key";
}
@@ -78,6 +82,8 @@
@Deprecated public abstract class LeanbackPreferenceFragment extends androidx.leanback.preference.BaseLeanbackPreferenceFragment {
ctor @Deprecated public LeanbackPreferenceFragment();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onViewCreated(android.view.View!, android.os.Bundle!);
method @Deprecated public void setTitle(CharSequence!);
}
@@ -88,8 +94,12 @@
@Deprecated public abstract class LeanbackSettingsFragment extends android.app.Fragment implements androidx.preference.PreferenceFragment.OnPreferenceDisplayDialogCallback androidx.preference.PreferenceFragment.OnPreferenceStartFragmentCallback androidx.preference.PreferenceFragment.OnPreferenceStartScreenCallback {
ctor @Deprecated public LeanbackSettingsFragment();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onPause();
method @Deprecated public boolean onPreferenceDisplayDialog(androidx.preference.PreferenceFragment, androidx.preference.Preference!);
method @Deprecated public abstract void onPreferenceStartInitialScreen();
+ method @Deprecated public void onResume();
+ method @Deprecated public void onViewCreated(android.view.View!, android.os.Bundle!);
method @Deprecated public void startImmersiveFragment(android.app.Fragment);
method @Deprecated public void startPreferenceFragment(android.app.Fragment);
}
diff --git a/leanback-preference/api/1.1.0-alpha02.txt b/leanback-preference/api/1.1.0-alpha02.txt
deleted file mode 100644
index 5d40456..0000000
--- a/leanback-preference/api/1.1.0-alpha02.txt
+++ /dev/null
@@ -1,107 +0,0 @@
-// Signature format: 3.0
-package androidx.leanback.preference {
-
- @Deprecated public abstract class BaseLeanbackPreferenceFragment extends androidx.preference.PreferenceFragment {
- ctor @Deprecated public BaseLeanbackPreferenceFragment();
- method @Deprecated public androidx.recyclerview.widget.RecyclerView! onCreateRecyclerView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- }
-
- public abstract class BaseLeanbackPreferenceFragmentCompat extends androidx.preference.PreferenceFragmentCompat {
- ctor public BaseLeanbackPreferenceFragmentCompat();
- }
-
- public class LeanbackEditTextPreferenceDialogFragmentCompat extends androidx.leanback.preference.LeanbackPreferenceDialogFragmentCompat {
- ctor public LeanbackEditTextPreferenceDialogFragmentCompat();
- method public static androidx.leanback.preference.LeanbackEditTextPreferenceDialogFragmentCompat! newInstance(String!);
- field public static final String EXTRA_IME_OPTIONS = "ime_option";
- field public static final String EXTRA_INPUT_TYPE = "input_type";
- }
-
- @Deprecated public class LeanbackListPreferenceDialogFragment extends androidx.leanback.preference.LeanbackPreferenceDialogFragment {
- ctor @Deprecated public LeanbackListPreferenceDialogFragment();
- method @Deprecated public static androidx.leanback.preference.LeanbackListPreferenceDialogFragment! newInstanceMulti(String!);
- method @Deprecated public static androidx.leanback.preference.LeanbackListPreferenceDialogFragment! newInstanceSingle(String!);
- method @Deprecated public androidx.recyclerview.widget.RecyclerView.Adapter! onCreateAdapter();
- }
-
- @Deprecated public class LeanbackListPreferenceDialogFragment.AdapterMulti extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder> implements androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder.OnItemClickListener {
- ctor @Deprecated public LeanbackListPreferenceDialogFragment.AdapterMulti(CharSequence[]!, CharSequence[]!, java.util.Set<java.lang.String>!);
- method @Deprecated public int getItemCount();
- method @Deprecated public void onBindViewHolder(androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder!, int);
- method @Deprecated public androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
- method @Deprecated public void onItemClick(androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder!);
- }
-
- @Deprecated public class LeanbackListPreferenceDialogFragment.AdapterSingle extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder> implements androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder.OnItemClickListener {
- ctor @Deprecated public LeanbackListPreferenceDialogFragment.AdapterSingle(CharSequence[]!, CharSequence[]!, CharSequence!);
- method @Deprecated public int getItemCount();
- method @Deprecated public void onBindViewHolder(androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder!, int);
- method @Deprecated public androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
- method @Deprecated public void onItemClick(androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder!);
- }
-
- @Deprecated public static class LeanbackListPreferenceDialogFragment.ViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements android.view.View.OnClickListener {
- ctor @Deprecated public LeanbackListPreferenceDialogFragment.ViewHolder(android.view.View, androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder.OnItemClickListener);
- method @Deprecated public android.view.ViewGroup! getContainer();
- method @Deprecated public android.widget.TextView! getTitleView();
- method @Deprecated public android.widget.Checkable! getWidgetView();
- method @Deprecated public void onClick(android.view.View!);
- }
-
- @Deprecated public static interface LeanbackListPreferenceDialogFragment.ViewHolder.OnItemClickListener {
- method @Deprecated public void onItemClick(androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder!);
- }
-
- public class LeanbackListPreferenceDialogFragmentCompat extends androidx.leanback.preference.LeanbackPreferenceDialogFragmentCompat {
- ctor public LeanbackListPreferenceDialogFragmentCompat();
- method public static androidx.leanback.preference.LeanbackListPreferenceDialogFragmentCompat! newInstanceMulti(String!);
- method public static androidx.leanback.preference.LeanbackListPreferenceDialogFragmentCompat! newInstanceSingle(String!);
- }
-
- public static final class LeanbackListPreferenceDialogFragmentCompat.ViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements android.view.View.OnClickListener {
- method public android.view.ViewGroup! getContainer();
- method public android.widget.TextView! getTitleView();
- method public android.widget.Checkable! getWidgetView();
- method public void onClick(android.view.View!);
- }
-
- @Deprecated public class LeanbackPreferenceDialogFragment extends android.app.Fragment {
- ctor @Deprecated public LeanbackPreferenceDialogFragment();
- method @Deprecated public androidx.preference.DialogPreference! getPreference();
- field @Deprecated public static final String ARG_KEY = "key";
- }
-
- public class LeanbackPreferenceDialogFragmentCompat extends androidx.fragment.app.Fragment {
- ctor public LeanbackPreferenceDialogFragmentCompat();
- method public androidx.preference.DialogPreference! getPreference();
- field public static final String ARG_KEY = "key";
- }
-
- @Deprecated public abstract class LeanbackPreferenceFragment extends androidx.leanback.preference.BaseLeanbackPreferenceFragment {
- ctor @Deprecated public LeanbackPreferenceFragment();
- method @Deprecated public void setTitle(CharSequence!);
- }
-
- public abstract class LeanbackPreferenceFragmentCompat extends androidx.leanback.preference.BaseLeanbackPreferenceFragmentCompat {
- ctor public LeanbackPreferenceFragmentCompat();
- method public void setTitle(CharSequence!);
- }
-
- @Deprecated public abstract class LeanbackSettingsFragment extends android.app.Fragment implements androidx.preference.PreferenceFragment.OnPreferenceDisplayDialogCallback androidx.preference.PreferenceFragment.OnPreferenceStartFragmentCallback androidx.preference.PreferenceFragment.OnPreferenceStartScreenCallback {
- ctor @Deprecated public LeanbackSettingsFragment();
- method @Deprecated public boolean onPreferenceDisplayDialog(androidx.preference.PreferenceFragment, androidx.preference.Preference!);
- method @Deprecated public abstract void onPreferenceStartInitialScreen();
- method @Deprecated public void startImmersiveFragment(android.app.Fragment);
- method @Deprecated public void startPreferenceFragment(android.app.Fragment);
- }
-
- public abstract class LeanbackSettingsFragmentCompat extends androidx.fragment.app.Fragment implements androidx.preference.PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback androidx.preference.PreferenceFragmentCompat.OnPreferenceStartFragmentCallback androidx.preference.PreferenceFragmentCompat.OnPreferenceStartScreenCallback {
- ctor public LeanbackSettingsFragmentCompat();
- method public boolean onPreferenceDisplayDialog(androidx.preference.PreferenceFragmentCompat, androidx.preference.Preference!);
- method public abstract void onPreferenceStartInitialScreen();
- method public void startImmersiveFragment(androidx.fragment.app.Fragment);
- method public void startPreferenceFragment(androidx.fragment.app.Fragment);
- }
-
-}
-
diff --git a/leanback-preference/api/current.txt b/leanback-preference/api/current.txt
index 5d40456..75f7d49 100644
--- a/leanback-preference/api/current.txt
+++ b/leanback-preference/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.leanback.preference {
@Deprecated public abstract class BaseLeanbackPreferenceFragment extends androidx.preference.PreferenceFragment {
@@ -22,6 +22,8 @@
method @Deprecated public static androidx.leanback.preference.LeanbackListPreferenceDialogFragment! newInstanceMulti(String!);
method @Deprecated public static androidx.leanback.preference.LeanbackListPreferenceDialogFragment! newInstanceSingle(String!);
method @Deprecated public androidx.recyclerview.widget.RecyclerView.Adapter! onCreateAdapter();
+ method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
}
@Deprecated public class LeanbackListPreferenceDialogFragment.AdapterMulti extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder> implements androidx.leanback.preference.LeanbackListPreferenceDialogFragment.ViewHolder.OnItemClickListener {
@@ -68,6 +70,7 @@
@Deprecated public class LeanbackPreferenceDialogFragment extends android.app.Fragment {
ctor @Deprecated public LeanbackPreferenceDialogFragment();
method @Deprecated public androidx.preference.DialogPreference! getPreference();
+ method @Deprecated public void onCreate(android.os.Bundle!);
field @Deprecated public static final String ARG_KEY = "key";
}
@@ -79,6 +82,8 @@
@Deprecated public abstract class LeanbackPreferenceFragment extends androidx.leanback.preference.BaseLeanbackPreferenceFragment {
ctor @Deprecated public LeanbackPreferenceFragment();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onViewCreated(android.view.View!, android.os.Bundle!);
method @Deprecated public void setTitle(CharSequence!);
}
@@ -89,8 +94,12 @@
@Deprecated public abstract class LeanbackSettingsFragment extends android.app.Fragment implements androidx.preference.PreferenceFragment.OnPreferenceDisplayDialogCallback androidx.preference.PreferenceFragment.OnPreferenceStartFragmentCallback androidx.preference.PreferenceFragment.OnPreferenceStartScreenCallback {
ctor @Deprecated public LeanbackSettingsFragment();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onPause();
method @Deprecated public boolean onPreferenceDisplayDialog(androidx.preference.PreferenceFragment, androidx.preference.Preference!);
method @Deprecated public abstract void onPreferenceStartInitialScreen();
+ method @Deprecated public void onResume();
+ method @Deprecated public void onViewCreated(android.view.View!, android.os.Bundle!);
method @Deprecated public void startImmersiveFragment(android.app.Fragment);
method @Deprecated public void startPreferenceFragment(android.app.Fragment);
}
diff --git a/leanback-preference/api/res-1.1.0-alpha02.txt b/leanback-preference/api/res-1.1.0-alpha02.txt
deleted file mode 100644
index e69de29..0000000
--- a/leanback-preference/api/res-1.1.0-alpha02.txt
+++ /dev/null
diff --git a/leanback-preference/api/restricted_1.0.0.txt b/leanback-preference/api/restricted_1.0.0.txt
deleted file mode 100644
index 5059e95..0000000
--- a/leanback-preference/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-// Signature format: 3.0
-package androidx.leanback.preference {
-
- public abstract class BaseLeanbackPreferenceFragment {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.app.Fragment! getCallbackFragment();
- }
-
- @RequiresApi(21) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class LeanbackPreferenceFragmentTransitionHelperApi21 {
- method public static void addTransitions(android.app.Fragment!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class LeanbackSettingsFragment.DummyFragment {
- ctor public LeanbackSettingsFragment.DummyFragment();
- method public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class LeanbackSettingsRootView {
- ctor public LeanbackSettingsRootView(android.content.Context!);
- ctor public LeanbackSettingsRootView(android.content.Context!, android.util.AttributeSet!);
- ctor public LeanbackSettingsRootView(android.content.Context!, android.util.AttributeSet!, int);
- method public boolean dispatchKeyEvent(android.view.KeyEvent);
- method public void setOnBackKeyListener(android.view.View.OnKeyListener!);
- }
-
-}
-
-package androidx.leanback.preference.internal {
-
- @RequiresApi(21) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class OutlineOnlyWithChildrenFrameLayout {
- ctor public OutlineOnlyWithChildrenFrameLayout(android.content.Context!);
- ctor public OutlineOnlyWithChildrenFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public OutlineOnlyWithChildrenFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- ctor public OutlineOnlyWithChildrenFrameLayout(android.content.Context!, android.util.AttributeSet!, int, int);
- method protected void onLayout(boolean, int, int, int, int);
- method public void setOutlineProvider(android.view.ViewOutlineProvider!);
- }
-
-}
-
diff --git a/leanback-preference/api/restricted_1.1.0-alpha02.txt b/leanback-preference/api/restricted_1.1.0-alpha02.txt
deleted file mode 100644
index c559029..0000000
--- a/leanback-preference/api/restricted_1.1.0-alpha02.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-// Signature format: 3.0
-package androidx.leanback.preference {
-
- @RequiresApi(21) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class LeanbackPreferenceFragmentTransitionHelperApi21 {
- method public static void addTransitions(android.app.Fragment!);
- }
-
- @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class LeanbackSettingsFragment.DummyFragment extends android.app.Fragment {
- ctor @Deprecated public LeanbackSettingsFragment.DummyFragment();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class LeanbackSettingsRootView extends android.widget.FrameLayout {
- ctor public LeanbackSettingsRootView(android.content.Context!);
- ctor public LeanbackSettingsRootView(android.content.Context!, android.util.AttributeSet!);
- ctor public LeanbackSettingsRootView(android.content.Context!, android.util.AttributeSet!, int);
- method public void setOnBackKeyListener(android.view.View.OnKeyListener!);
- }
-
-}
-
-package androidx.leanback.preference.internal {
-
- @RequiresApi(21) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class OutlineOnlyWithChildrenFrameLayout extends android.widget.FrameLayout {
- ctor public OutlineOnlyWithChildrenFrameLayout(android.content.Context!);
- ctor public OutlineOnlyWithChildrenFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public OutlineOnlyWithChildrenFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- ctor public OutlineOnlyWithChildrenFrameLayout(android.content.Context!, android.util.AttributeSet!, int, int);
- }
-
-}
-
diff --git a/leanback-preference/api/restricted_current.txt b/leanback-preference/api/restricted_current.txt
deleted file mode 100644
index c559029..0000000
--- a/leanback-preference/api/restricted_current.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-// Signature format: 3.0
-package androidx.leanback.preference {
-
- @RequiresApi(21) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class LeanbackPreferenceFragmentTransitionHelperApi21 {
- method public static void addTransitions(android.app.Fragment!);
- }
-
- @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class LeanbackSettingsFragment.DummyFragment extends android.app.Fragment {
- ctor @Deprecated public LeanbackSettingsFragment.DummyFragment();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class LeanbackSettingsRootView extends android.widget.FrameLayout {
- ctor public LeanbackSettingsRootView(android.content.Context!);
- ctor public LeanbackSettingsRootView(android.content.Context!, android.util.AttributeSet!);
- ctor public LeanbackSettingsRootView(android.content.Context!, android.util.AttributeSet!, int);
- method public void setOnBackKeyListener(android.view.View.OnKeyListener!);
- }
-
-}
-
-package androidx.leanback.preference.internal {
-
- @RequiresApi(21) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class OutlineOnlyWithChildrenFrameLayout extends android.widget.FrameLayout {
- ctor public OutlineOnlyWithChildrenFrameLayout(android.content.Context!);
- ctor public OutlineOnlyWithChildrenFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public OutlineOnlyWithChildrenFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- ctor public OutlineOnlyWithChildrenFrameLayout(android.content.Context!, android.util.AttributeSet!, int, int);
- }
-
-}
-
diff --git a/leanback-preference/api21/androidx/leanback/preference/LeanbackPreferenceFragmentTransitionHelperApi21.java b/leanback-preference/api21/androidx/leanback/preference/LeanbackPreferenceFragmentTransitionHelperApi21.java
index 0838b1a..7167c18 100644
--- a/leanback-preference/api21/androidx/leanback/preference/LeanbackPreferenceFragmentTransitionHelperApi21.java
+++ b/leanback-preference/api21/androidx/leanback/preference/LeanbackPreferenceFragmentTransitionHelperApi21.java
@@ -16,7 +16,7 @@
package androidx.leanback.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Fragment;
import android.transition.Transition;
@@ -29,8 +29,9 @@
/**
* @hide
*/
+@SuppressWarnings("RestrictedApi")
@RequiresApi(21)
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class LeanbackPreferenceFragmentTransitionHelperApi21 {
public static void addTransitions(Fragment f) {
diff --git a/leanback-preference/api21/androidx/leanback/preference/internal/OutlineOnlyWithChildrenFrameLayout.java b/leanback-preference/api21/androidx/leanback/preference/internal/OutlineOnlyWithChildrenFrameLayout.java
index 3f9a766..8d7e477 100644
--- a/leanback-preference/api21/androidx/leanback/preference/internal/OutlineOnlyWithChildrenFrameLayout.java
+++ b/leanback-preference/api21/androidx/leanback/preference/internal/OutlineOnlyWithChildrenFrameLayout.java
@@ -16,7 +16,7 @@
package androidx.leanback.preference.internal;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Outline;
@@ -35,7 +35,7 @@
* @hide
*/
@RequiresApi(21)
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class OutlineOnlyWithChildrenFrameLayout extends FrameLayout {
private ViewOutlineProvider mMagicalOutlineProvider;
diff --git a/leanback-preference/build.gradle b/leanback-preference/build.gradle
index e14e08c..d0fc83a 100644
--- a/leanback-preference/build.gradle
+++ b/leanback-preference/build.gradle
@@ -6,12 +6,11 @@
}
dependencies {
- api(project(":annotation"))
implementation("androidx.collection:collection:1.0.0")
api("androidx.appcompat:appcompat:1.0.0")
api("androidx.recyclerview:recyclerview:1.0.0")
- api(project(":preference"))
- api(project(":leanback"))
+ api("androidx.preference:preference:1.0.0")
+ api("androidx.leanback:leanback:1.0.0")
}
android {
diff --git a/leanback-preference/src/main/java/androidx/leanback/preference/BaseLeanbackPreferenceFragment.java b/leanback-preference/src/main/java/androidx/leanback/preference/BaseLeanbackPreferenceFragment.java
index 56c9965..fd3abd6 100644
--- a/leanback-preference/src/main/java/androidx/leanback/preference/BaseLeanbackPreferenceFragment.java
+++ b/leanback-preference/src/main/java/androidx/leanback/preference/BaseLeanbackPreferenceFragment.java
@@ -16,7 +16,7 @@
package androidx.leanback.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Fragment;
import android.os.Bundle;
@@ -37,6 +37,7 @@
@Deprecated
public abstract class BaseLeanbackPreferenceFragment extends PreferenceFragment {
+ @SuppressWarnings("RestrictedApi")
@Override
public RecyclerView onCreateRecyclerView(LayoutInflater inflater, ViewGroup parent,
Bundle savedInstanceState) {
@@ -52,7 +53,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public Fragment getCallbackFragment() {
return getParentFragment();
diff --git a/leanback-preference/src/main/java/androidx/leanback/preference/BaseLeanbackPreferenceFragmentCompat.java b/leanback-preference/src/main/java/androidx/leanback/preference/BaseLeanbackPreferenceFragmentCompat.java
index c853b55..c1ef639 100644
--- a/leanback-preference/src/main/java/androidx/leanback/preference/BaseLeanbackPreferenceFragmentCompat.java
+++ b/leanback-preference/src/main/java/androidx/leanback/preference/BaseLeanbackPreferenceFragmentCompat.java
@@ -16,7 +16,7 @@
package androidx.leanback.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
import android.view.LayoutInflater;
@@ -35,6 +35,7 @@
*/
public abstract class BaseLeanbackPreferenceFragmentCompat extends PreferenceFragmentCompat {
+ @SuppressWarnings("RestrictedApi")
@Override
public RecyclerView onCreateRecyclerView(LayoutInflater inflater, ViewGroup parent,
Bundle savedInstanceState) {
@@ -50,7 +51,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public Fragment getCallbackFragment() {
return getParentFragment();
diff --git a/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackListPreferenceDialogFragment.java b/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackListPreferenceDialogFragment.java
index dab0ca3..e626a54 100644
--- a/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackListPreferenceDialogFragment.java
+++ b/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackListPreferenceDialogFragment.java
@@ -147,6 +147,7 @@
}
}
+ @SuppressWarnings("RestrictedApi")
@Override
public @Nullable View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
diff --git a/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackListPreferenceDialogFragmentCompat.java b/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackListPreferenceDialogFragmentCompat.java
index 9f4ed67..aef2bf0 100644
--- a/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackListPreferenceDialogFragmentCompat.java
+++ b/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackListPreferenceDialogFragmentCompat.java
@@ -156,6 +156,7 @@
}
}
+ @SuppressWarnings("RestrictedApi")
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
diff --git a/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackPreferenceFragmentCompat.java b/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackPreferenceFragmentCompat.java
index e2e4980..78c282b 100644
--- a/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackPreferenceFragmentCompat.java
+++ b/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackPreferenceFragmentCompat.java
@@ -32,12 +32,15 @@
* <p>The following sample code shows a simple leanback preference fragment that is
* populated from a resource. The resource it loads is:</p>
*
- * {@sample frameworks/support/samples/SupportPreferenceDemos/src/main/res/xml/preferences.xml preferences}
+ * {@sample frameworks/support/samples/SupportPreferenceDemos/src/main/res/xml/preferences.xml
+ * preferences}
*
* <p>The fragment needs only to implement {@link #onCreatePreferences(Bundle, String)} to populate
* the list of preference objects:</p>
*
- * {@sample frameworks/support/samples/SupportPreferenceDemos/src/main/java/com/example/androidx/preference/LeanbackPreferences.java leanback_preferences}
+ * {@sample frameworks/support/samples/SupportPreferenceDemos/src/main/java/com/example/android/supportpreference/FragmentSupportPreferencesLeanback.java
+ * support_fragment_leanback}
+ * support_fragment_leanback}
*/
public abstract class LeanbackPreferenceFragmentCompat extends
BaseLeanbackPreferenceFragmentCompat {
diff --git a/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackSettingsFragment.java b/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackSettingsFragment.java
index 54ae388..3fc03c6 100644
--- a/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackSettingsFragment.java
+++ b/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackSettingsFragment.java
@@ -16,7 +16,7 @@
package androidx.leanback.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Fragment;
import android.app.FragmentTransaction;
@@ -196,7 +196,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class DummyFragment extends Fragment {
@Override
diff --git a/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackSettingsFragmentCompat.java b/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackSettingsFragmentCompat.java
index 69e00b0..9f34a33 100644
--- a/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackSettingsFragmentCompat.java
+++ b/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackSettingsFragmentCompat.java
@@ -39,7 +39,8 @@
* <p>The following sample code shows a simple leanback preference fragment that is
* populated from a resource. The resource it loads is:</p>
*
- * {@sample frameworks/support/samples/SupportPreferenceDemos/src/main/res/xml/preferences.xml preferences}
+ * {@sample frameworks/support/samples/SupportPreferenceDemos/src/main/res/xml/preferences.xml
+ * preferences}
*
* <p>The sample implements
* {@link PreferenceFragmentCompat.OnPreferenceStartFragmentCallback#onPreferenceStartFragment(
@@ -48,7 +49,8 @@
* PreferenceFragmentCompat, PreferenceScreen)},
* and {@link #onPreferenceStartInitialScreen()}:</p>
*
- * {@sample frameworks/support/samples/SupportPreferenceDemos/src/main/java/com/example/androidx/preference/LeanbackPreferences.java leanback_preferences}
+ * {@sample frameworks/support/samples/SupportPreferenceDemos/src/main/java/com/example/android/supportpreference/FragmentSupportPreferencesLeanback.java
+ * support_fragment_leanback}
*/
public abstract class LeanbackSettingsFragmentCompat extends Fragment
implements PreferenceFragmentCompat.OnPreferenceStartFragmentCallback,
diff --git a/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackSettingsRootView.java b/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackSettingsRootView.java
index 4747412..db56481 100644
--- a/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackSettingsRootView.java
+++ b/leanback-preference/src/main/java/androidx/leanback/preference/LeanbackSettingsRootView.java
@@ -16,7 +16,7 @@
package androidx.leanback.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.util.AttributeSet;
@@ -29,7 +29,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class LeanbackSettingsRootView extends FrameLayout {
private OnKeyListener mOnBackKeyListener;
diff --git a/leanback/api/1.0.0.txt b/leanback/api/1.0.0.txt
index 267c8fe..2da313b 100644
--- a/leanback/api/1.0.0.txt
+++ b/leanback/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.leanback.app {
public final class BackgroundManager {
diff --git a/leanback/api/1.1.0-alpha01.txt b/leanback/api/1.1.0-alpha01.txt
index 9dab078..f26a898 100644
--- a/leanback/api/1.1.0-alpha01.txt
+++ b/leanback/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.leanback.app {
public final class BackgroundManager {
@@ -24,6 +24,7 @@
@Deprecated public class BaseFragment extends androidx.leanback.app.BrandedFragment {
method @Deprecated protected Object! createEntranceTransition();
method @Deprecated public final androidx.leanback.app.ProgressBarManager! getProgressBarManager();
+ method @Deprecated public void onCreate(android.os.Bundle!);
method @Deprecated protected void onEntranceTransitionEnd();
method @Deprecated protected void onEntranceTransitionPrepare();
method @Deprecated protected void onEntranceTransitionStart();
@@ -53,7 +54,13 @@
method @Deprecated public androidx.leanback.widget.TitleViewAdapter! getTitleViewAdapter();
method @Deprecated public void installTitleView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
method @Deprecated public final boolean isShowingTitle();
+ method @Deprecated public void onDestroyView();
method @Deprecated public android.view.View! onInflateTitleView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onPause();
+ method @Deprecated public void onResume();
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
+ method @Deprecated public void onStart();
+ method @Deprecated public void onViewCreated(android.view.View, android.os.Bundle?);
method @Deprecated public void setBadgeDrawable(android.graphics.drawable.Drawable!);
method @Deprecated public void setOnSearchClickedListener(android.view.View.OnClickListener!);
method @Deprecated public void setSearchAffordanceColor(int);
@@ -104,6 +111,9 @@
method @Deprecated public boolean isInHeadersTransition();
method @Deprecated public boolean isShowingHeaders();
method @Deprecated public androidx.leanback.app.HeadersFragment! onCreateHeadersFragment();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroy();
+ method @Deprecated public void onStop();
method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
method @Deprecated public void setBrandColor(@ColorInt int);
method @Deprecated public void setBrowseTransitionListener(androidx.leanback.app.BrowseFragment.BrowseTransitionListener!);
@@ -289,8 +299,10 @@
method @Deprecated public androidx.leanback.widget.DetailsParallax! getParallax();
method @Deprecated public androidx.leanback.app.RowsFragment! getRowsFragment();
method @Deprecated protected android.view.View! inflateTitle(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
method @Deprecated protected void onSetDetailsOverviewRowStatus(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter!, androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!, int, int, int);
method @Deprecated protected void onSetRowStatus(androidx.leanback.widget.RowPresenter!, androidx.leanback.widget.RowPresenter.ViewHolder!, int, int, int);
+ method @Deprecated public void onStop();
method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener!);
method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.BaseOnItemViewSelectedListener!);
@@ -369,6 +381,7 @@
method @Deprecated public android.graphics.drawable.Drawable! getImageDrawable();
method @Deprecated public CharSequence! getMessage();
method @Deprecated public boolean isBackgroundTranslucent();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
method @Deprecated public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
method @Deprecated public void setButtonClickListener(android.view.View.OnClickListener!);
method @Deprecated public void setButtonText(String!);
@@ -425,6 +438,7 @@
method @Deprecated public void notifyActionChanged(int);
method @Deprecated public void notifyButtonActionChanged(int);
method @Deprecated protected void onAddSharedElementTransition(android.app.FragmentTransaction!, androidx.leanback.app.GuidedStepFragment!);
+ method @Deprecated public void onCreate(android.os.Bundle!);
method @Deprecated public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction>, android.os.Bundle!);
method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! onCreateActionsStylist();
method @Deprecated public android.view.View! onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
@@ -432,6 +446,8 @@
method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! onCreateButtonActionsStylist();
method @Deprecated public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle!);
method @Deprecated public androidx.leanback.widget.GuidanceStylist! onCreateGuidanceStylist();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroyView();
method @Deprecated public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
method @Deprecated public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
method @Deprecated public void onGuidedActionEdited(androidx.leanback.widget.GuidedAction!);
@@ -439,6 +455,8 @@
method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
method @Deprecated protected void onProvideFragmentTransitions();
method @Deprecated public int onProvideTheme();
+ method @Deprecated public void onResume();
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
method @Deprecated public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
method @Deprecated public void openInEditMode(androidx.leanback.widget.GuidedAction!);
method @Deprecated public void popBackStackToGuidedStepFragment(Class!, int);
@@ -525,9 +543,13 @@
method @Deprecated public int getSelectedPosition();
method @Deprecated public final androidx.leanback.widget.VerticalGridView! getVerticalGridView();
method @Deprecated public boolean isScrolling();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroyView();
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
method @Deprecated public void onTransitionEnd();
method @Deprecated public boolean onTransitionPrepare();
method @Deprecated public void onTransitionStart();
+ method @Deprecated public void onViewCreated(android.view.View, android.os.Bundle?);
method @Deprecated public final void setAdapter(androidx.leanback.widget.ObjectAdapter!);
method @Deprecated public void setAlignment(int);
method @Deprecated public void setOnHeaderClickedListener(androidx.leanback.app.HeadersFragment.OnHeaderClickedListener!);
@@ -597,10 +619,13 @@
method @Deprecated protected abstract android.view.View? onCreateForegroundView(android.view.LayoutInflater!, android.view.ViewGroup!);
method @Deprecated protected android.animation.Animator? onCreateLogoAnimation();
method @Deprecated protected android.animation.Animator! onCreateTitleAnimator();
+ method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
method @Deprecated protected void onFinishFragment();
method @Deprecated protected void onLogoAnimationFinished();
method @Deprecated protected void onPageChanged(int, int);
method @Deprecated public int onProvideTheme();
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
+ method @Deprecated public void onViewCreated(android.view.View, android.os.Bundle?);
method @Deprecated public void setArrowBackgroundColor(@ColorInt int);
method @Deprecated public void setArrowColor(@ColorInt int);
method @Deprecated public void setDescriptionViewTextColor(@ColorInt int);
@@ -664,8 +689,17 @@
method @Deprecated public boolean isShowOrHideControlsOverlayOnUserInteraction();
method @Deprecated public void notifyPlaybackRowChanged();
method @Deprecated protected void onBufferingStateChanged(boolean);
+ method @Deprecated public void onCreate(android.os.Bundle!);
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroy();
+ method @Deprecated public void onDestroyView();
method @Deprecated protected void onError(int, CharSequence!);
+ method @Deprecated public void onPause();
+ method @Deprecated public void onResume();
+ method @Deprecated public void onStart();
+ method @Deprecated public void onStop();
method @Deprecated protected void onVideoSizeChanged(int, int);
+ method @Deprecated public void onViewCreated(android.view.View, android.os.Bundle?);
method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
method @Deprecated public void setBackgroundType(int);
method @Deprecated public void setControlsOverlayAutoHideEnabled(boolean);
@@ -691,7 +725,19 @@
@Deprecated public class PlaybackFragmentGlueHost extends androidx.leanback.media.PlaybackGlueHost implements androidx.leanback.widget.PlaybackSeekUi {
ctor @Deprecated public PlaybackFragmentGlueHost(androidx.leanback.app.PlaybackFragment!);
method @Deprecated public void fadeOut();
+ method @Deprecated public androidx.leanback.media.PlaybackGlueHost.PlayerCallback! getPlayerCallback();
+ method @Deprecated public void hideControlsOverlay(boolean);
+ method @Deprecated public boolean isControlsOverlayAutoHideEnabled();
+ method @Deprecated public boolean isControlsOverlayVisible();
+ method @Deprecated public void notifyPlaybackRowChanged();
+ method @Deprecated public void setControlsOverlayAutoHideEnabled(boolean);
+ method @Deprecated public void setHostCallback(androidx.leanback.media.PlaybackGlueHost.HostCallback!);
+ method @Deprecated public void setOnActionClickedListener(androidx.leanback.widget.OnActionClickedListener!);
+ method @Deprecated public void setOnKeyInterceptListener(android.view.View.OnKeyListener!);
+ method @Deprecated public void setPlaybackRow(androidx.leanback.widget.Row!);
+ method @Deprecated public void setPlaybackRowPresenter(androidx.leanback.widget.PlaybackRowPresenter!);
method @Deprecated public void setPlaybackSeekUiClient(androidx.leanback.widget.PlaybackSeekUi.Client!);
+ method @Deprecated public void showControlsOverlay(boolean);
}
public class PlaybackSupportFragment extends androidx.fragment.app.Fragment {
@@ -765,9 +811,14 @@
method @Deprecated public int getSelectedPosition();
method @Deprecated public final androidx.leanback.widget.VerticalGridView! getVerticalGridView();
method @Deprecated public boolean isScrolling();
+ method @Deprecated public void onCreate(android.os.Bundle!);
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroyView();
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
method @Deprecated public void onTransitionEnd();
method @Deprecated public boolean onTransitionPrepare();
method @Deprecated public void onTransitionStart();
+ method @Deprecated public void onViewCreated(android.view.View, android.os.Bundle?);
method @Deprecated public final void setAdapter(androidx.leanback.widget.ObjectAdapter!);
method @Deprecated public void setAlignment(int);
method @Deprecated public void setEntranceTransitionState(boolean);
@@ -838,6 +889,13 @@
method @Deprecated public androidx.leanback.app.RowsFragment! getRowsFragment();
method @Deprecated public String! getTitle();
method @Deprecated public static androidx.leanback.app.SearchFragment! newInstance(String!);
+ method @Deprecated public void onCreate(android.os.Bundle!);
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroy();
+ method @Deprecated public void onPause();
+ method @Deprecated public void onRequestPermissionsResult(int, String[]!, int[]!);
+ method @Deprecated public void onResume();
+ method @Deprecated public void onStart();
method @Deprecated public void setBadgeDrawable(android.graphics.drawable.Drawable!);
method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
@@ -891,6 +949,7 @@
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
method @Deprecated public void setGridPresenter(androidx.leanback.widget.VerticalGridPresenter!);
method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
@@ -1068,6 +1127,10 @@
method @Deprecated public long getSupportedActions();
method @Deprecated public boolean hasValidMedia();
method @Deprecated public boolean isMediaPlaying();
+ method @Deprecated public void next();
+ method @Deprecated public void pause();
+ method @Deprecated public void play(int);
+ method @Deprecated public void previous();
}
public class MediaPlayerAdapter extends androidx.leanback.media.PlayerAdapter {
@@ -1692,6 +1755,12 @@
method @Deprecated public androidx.leanback.widget.OnActionClickedListener! getOnActionClickedListener();
method @Deprecated public boolean isStyleLarge();
method @Deprecated public final boolean isUsingDefaultSelectEffect();
+ method @Deprecated protected void onBindRowViewHolder(androidx.leanback.widget.RowPresenter.ViewHolder!, Object!);
+ method @Deprecated protected void onRowViewAttachedToWindow(androidx.leanback.widget.RowPresenter.ViewHolder!);
+ method @Deprecated protected void onRowViewDetachedFromWindow(androidx.leanback.widget.RowPresenter.ViewHolder!);
+ method @Deprecated protected void onRowViewSelected(androidx.leanback.widget.RowPresenter.ViewHolder!, boolean);
+ method @Deprecated protected void onSelectLevelChanged(androidx.leanback.widget.RowPresenter.ViewHolder!);
+ method @Deprecated protected void onUnbindRowViewHolder(androidx.leanback.widget.RowPresenter.ViewHolder!);
method @Deprecated public void setBackgroundColor(@ColorInt int);
method @Deprecated public void setOnActionClickedListener(androidx.leanback.widget.OnActionClickedListener!);
method @Deprecated public final void setSharedElementEnterTransition(android.app.Activity!, String!, long);
diff --git a/leanback/api/1.1.0-alpha02.txt b/leanback/api/1.1.0-alpha02.txt
deleted file mode 100644
index 9dab078..0000000
--- a/leanback/api/1.1.0-alpha02.txt
+++ /dev/null
@@ -1,3191 +0,0 @@
-// Signature format: 3.0
-package androidx.leanback.app {
-
- public final class BackgroundManager {
- method public void attach(android.view.Window!);
- method public void attachToView(android.view.View!);
- method public void clearDrawable();
- method @ColorInt public int getColor();
- method @Deprecated public android.graphics.drawable.Drawable! getDefaultDimLayer();
- method @Deprecated public android.graphics.drawable.Drawable! getDimLayer();
- method public android.graphics.drawable.Drawable! getDrawable();
- method public static androidx.leanback.app.BackgroundManager! getInstance(android.app.Activity!);
- method public boolean isAttached();
- method public boolean isAutoReleaseOnStop();
- method public void release();
- method public void setAutoReleaseOnStop(boolean);
- method public void setBitmap(android.graphics.Bitmap!);
- method public void setColor(@ColorInt int);
- method @Deprecated public void setDimLayer(android.graphics.drawable.Drawable!);
- method public void setDrawable(android.graphics.drawable.Drawable!);
- method public void setThemeDrawableResourceId(int);
- }
-
- @Deprecated public class BaseFragment extends androidx.leanback.app.BrandedFragment {
- method @Deprecated protected Object! createEntranceTransition();
- method @Deprecated public final androidx.leanback.app.ProgressBarManager! getProgressBarManager();
- method @Deprecated protected void onEntranceTransitionEnd();
- method @Deprecated protected void onEntranceTransitionPrepare();
- method @Deprecated protected void onEntranceTransitionStart();
- method @Deprecated public void prepareEntranceTransition();
- method @Deprecated protected void runEntranceTransition(Object!);
- method @Deprecated public void startEntranceTransition();
- }
-
- public class BaseSupportFragment extends androidx.leanback.app.BrandedSupportFragment {
- method protected Object! createEntranceTransition();
- method public final androidx.leanback.app.ProgressBarManager! getProgressBarManager();
- method protected void onEntranceTransitionEnd();
- method protected void onEntranceTransitionPrepare();
- method protected void onEntranceTransitionStart();
- method public void prepareEntranceTransition();
- method protected void runEntranceTransition(Object!);
- method public void startEntranceTransition();
- }
-
- @Deprecated public class BrandedFragment extends android.app.Fragment {
- ctor @Deprecated public BrandedFragment();
- method @Deprecated public android.graphics.drawable.Drawable! getBadgeDrawable();
- method @Deprecated public int getSearchAffordanceColor();
- method @Deprecated public androidx.leanback.widget.SearchOrbView.Colors! getSearchAffordanceColors();
- method @Deprecated public CharSequence! getTitle();
- method @Deprecated public android.view.View! getTitleView();
- method @Deprecated public androidx.leanback.widget.TitleViewAdapter! getTitleViewAdapter();
- method @Deprecated public void installTitleView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method @Deprecated public final boolean isShowingTitle();
- method @Deprecated public android.view.View! onInflateTitleView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method @Deprecated public void setBadgeDrawable(android.graphics.drawable.Drawable!);
- method @Deprecated public void setOnSearchClickedListener(android.view.View.OnClickListener!);
- method @Deprecated public void setSearchAffordanceColor(int);
- method @Deprecated public void setSearchAffordanceColors(androidx.leanback.widget.SearchOrbView.Colors!);
- method @Deprecated public void setTitle(CharSequence!);
- method @Deprecated public void setTitleView(android.view.View!);
- method @Deprecated public void showTitle(boolean);
- method @Deprecated public void showTitle(int);
- }
-
- public class BrandedSupportFragment extends androidx.fragment.app.Fragment {
- ctor public BrandedSupportFragment();
- method public android.graphics.drawable.Drawable! getBadgeDrawable();
- method public int getSearchAffordanceColor();
- method public androidx.leanback.widget.SearchOrbView.Colors! getSearchAffordanceColors();
- method public CharSequence! getTitle();
- method public android.view.View! getTitleView();
- method public androidx.leanback.widget.TitleViewAdapter! getTitleViewAdapter();
- method public void installTitleView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method public final boolean isShowingTitle();
- method public android.view.View! onInflateTitleView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method public void setBadgeDrawable(android.graphics.drawable.Drawable!);
- method public void setOnSearchClickedListener(android.view.View.OnClickListener!);
- method public void setSearchAffordanceColor(int);
- method public void setSearchAffordanceColors(androidx.leanback.widget.SearchOrbView.Colors!);
- method public void setTitle(CharSequence!);
- method public void setTitleView(android.view.View!);
- method public void showTitle(boolean);
- method public void showTitle(int);
- }
-
- @Deprecated public class BrowseFragment extends androidx.leanback.app.BaseFragment {
- method @Deprecated public static android.os.Bundle! createArgs(android.os.Bundle!, String!, int);
- method @Deprecated public void enableMainFragmentScaling(boolean);
- method @Deprecated public void enableRowScaling(boolean);
- method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
- method @Deprecated @ColorInt public int getBrandColor();
- method @Deprecated public androidx.leanback.app.HeadersFragment! getHeadersFragment();
- method @Deprecated public int getHeadersState();
- method @Deprecated public android.app.Fragment! getMainFragment();
- method @Deprecated public final androidx.leanback.app.BrowseFragment.MainFragmentAdapterRegistry! getMainFragmentRegistry();
- method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
- method @Deprecated public androidx.leanback.widget.OnItemViewSelectedListener! getOnItemViewSelectedListener();
- method @Deprecated public androidx.leanback.app.RowsFragment! getRowsFragment();
- method @Deprecated public int getSelectedPosition();
- method @Deprecated public androidx.leanback.widget.RowPresenter.ViewHolder! getSelectedRowViewHolder();
- method @Deprecated public final boolean isHeadersTransitionOnBackEnabled();
- method @Deprecated public boolean isInHeadersTransition();
- method @Deprecated public boolean isShowingHeaders();
- method @Deprecated public androidx.leanback.app.HeadersFragment! onCreateHeadersFragment();
- method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method @Deprecated public void setBrandColor(@ColorInt int);
- method @Deprecated public void setBrowseTransitionListener(androidx.leanback.app.BrowseFragment.BrowseTransitionListener!);
- method @Deprecated public void setHeaderPresenterSelector(androidx.leanback.widget.PresenterSelector!);
- method @Deprecated public void setHeadersState(int);
- method @Deprecated public final void setHeadersTransitionOnBackEnabled(boolean);
- method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
- method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
- method @Deprecated public void setSelectedPosition(int);
- method @Deprecated public void setSelectedPosition(int, boolean);
- method @Deprecated public void setSelectedPosition(int, boolean, androidx.leanback.widget.Presenter.ViewHolderTask!);
- method @Deprecated public void startHeadersTransition(boolean);
- field @Deprecated public static final int HEADERS_DISABLED = 3; // 0x3
- field @Deprecated public static final int HEADERS_ENABLED = 1; // 0x1
- field @Deprecated public static final int HEADERS_HIDDEN = 2; // 0x2
- }
-
- @Deprecated public static class BrowseFragment.BrowseTransitionListener {
- ctor @Deprecated public BrowseFragment.BrowseTransitionListener();
- method @Deprecated public void onHeadersTransitionStart(boolean);
- method @Deprecated public void onHeadersTransitionStop(boolean);
- }
-
- @Deprecated public abstract static class BrowseFragment.FragmentFactory<T extends android.app.Fragment> {
- ctor @Deprecated public BrowseFragment.FragmentFactory();
- method @Deprecated public abstract T! createFragment(Object!);
- }
-
- @Deprecated public static interface BrowseFragment.FragmentHost {
- method @Deprecated public void notifyDataReady(androidx.leanback.app.BrowseFragment.MainFragmentAdapter!);
- method @Deprecated public void notifyViewCreated(androidx.leanback.app.BrowseFragment.MainFragmentAdapter!);
- method @Deprecated public void showTitleView(boolean);
- }
-
- @Deprecated public static class BrowseFragment.ListRowFragmentFactory extends androidx.leanback.app.BrowseFragment.FragmentFactory<androidx.leanback.app.RowsFragment> {
- ctor @Deprecated public BrowseFragment.ListRowFragmentFactory();
- method @Deprecated public androidx.leanback.app.RowsFragment! createFragment(Object!);
- }
-
- @Deprecated public static class BrowseFragment.MainFragmentAdapter<T extends android.app.Fragment> {
- ctor @Deprecated public BrowseFragment.MainFragmentAdapter(T!);
- method @Deprecated public final T! getFragment();
- method @Deprecated public final androidx.leanback.app.BrowseFragment.FragmentHost! getFragmentHost();
- method @Deprecated public boolean isScalingEnabled();
- method @Deprecated public boolean isScrolling();
- method @Deprecated public void onTransitionEnd();
- method @Deprecated public boolean onTransitionPrepare();
- method @Deprecated public void onTransitionStart();
- method @Deprecated public void setAlignment(int);
- method @Deprecated public void setEntranceTransitionState(boolean);
- method @Deprecated public void setExpand(boolean);
- method @Deprecated public void setScalingEnabled(boolean);
- }
-
- @Deprecated public static interface BrowseFragment.MainFragmentAdapterProvider {
- method @Deprecated public androidx.leanback.app.BrowseFragment.MainFragmentAdapter! getMainFragmentAdapter();
- }
-
- @Deprecated public static final class BrowseFragment.MainFragmentAdapterRegistry {
- ctor @Deprecated public BrowseFragment.MainFragmentAdapterRegistry();
- method @Deprecated public android.app.Fragment! createFragment(Object!);
- method @Deprecated public void registerFragment(Class!, androidx.leanback.app.BrowseFragment.FragmentFactory!);
- }
-
- @Deprecated public static class BrowseFragment.MainFragmentRowsAdapter<T extends android.app.Fragment> {
- ctor @Deprecated public BrowseFragment.MainFragmentRowsAdapter(T!);
- method @Deprecated public androidx.leanback.widget.RowPresenter.ViewHolder! findRowViewHolderByPosition(int);
- method @Deprecated public final T! getFragment();
- method @Deprecated public int getSelectedPosition();
- method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
- method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
- method @Deprecated public void setSelectedPosition(int, boolean, androidx.leanback.widget.Presenter.ViewHolderTask!);
- method @Deprecated public void setSelectedPosition(int, boolean);
- }
-
- @Deprecated public static interface BrowseFragment.MainFragmentRowsAdapterProvider {
- method @Deprecated public androidx.leanback.app.BrowseFragment.MainFragmentRowsAdapter! getMainFragmentRowsAdapter();
- }
-
- public class BrowseSupportFragment extends androidx.leanback.app.BaseSupportFragment {
- method public static android.os.Bundle! createArgs(android.os.Bundle!, String!, int);
- method public void enableMainFragmentScaling(boolean);
- method @Deprecated public void enableRowScaling(boolean);
- method public androidx.leanback.widget.ObjectAdapter! getAdapter();
- method @ColorInt public int getBrandColor();
- method public int getHeadersState();
- method public androidx.leanback.app.HeadersSupportFragment! getHeadersSupportFragment();
- method public androidx.fragment.app.Fragment! getMainFragment();
- method public final androidx.leanback.app.BrowseSupportFragment.MainFragmentAdapterRegistry! getMainFragmentRegistry();
- method public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
- method public androidx.leanback.widget.OnItemViewSelectedListener! getOnItemViewSelectedListener();
- method public androidx.leanback.app.RowsSupportFragment! getRowsSupportFragment();
- method public int getSelectedPosition();
- method public androidx.leanback.widget.RowPresenter.ViewHolder! getSelectedRowViewHolder();
- method public final boolean isHeadersTransitionOnBackEnabled();
- method public boolean isInHeadersTransition();
- method public boolean isShowingHeaders();
- method public androidx.leanback.app.HeadersSupportFragment! onCreateHeadersSupportFragment();
- method public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method public void setBrandColor(@ColorInt int);
- method public void setBrowseTransitionListener(androidx.leanback.app.BrowseSupportFragment.BrowseTransitionListener!);
- method public void setHeaderPresenterSelector(androidx.leanback.widget.PresenterSelector!);
- method public void setHeadersState(int);
- method public final void setHeadersTransitionOnBackEnabled(boolean);
- method public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
- method public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
- method public void setSelectedPosition(int);
- method public void setSelectedPosition(int, boolean);
- method public void setSelectedPosition(int, boolean, androidx.leanback.widget.Presenter.ViewHolderTask!);
- method public void startHeadersTransition(boolean);
- field public static final int HEADERS_DISABLED = 3; // 0x3
- field public static final int HEADERS_ENABLED = 1; // 0x1
- field public static final int HEADERS_HIDDEN = 2; // 0x2
- }
-
- public static class BrowseSupportFragment.BrowseTransitionListener {
- ctor public BrowseSupportFragment.BrowseTransitionListener();
- method public void onHeadersTransitionStart(boolean);
- method public void onHeadersTransitionStop(boolean);
- }
-
- public abstract static class BrowseSupportFragment.FragmentFactory<T extends androidx.fragment.app.Fragment> {
- ctor public BrowseSupportFragment.FragmentFactory();
- method public abstract T! createFragment(Object!);
- }
-
- public static interface BrowseSupportFragment.FragmentHost {
- method public void notifyDataReady(androidx.leanback.app.BrowseSupportFragment.MainFragmentAdapter!);
- method public void notifyViewCreated(androidx.leanback.app.BrowseSupportFragment.MainFragmentAdapter!);
- method public void showTitleView(boolean);
- }
-
- public static class BrowseSupportFragment.ListRowFragmentFactory extends androidx.leanback.app.BrowseSupportFragment.FragmentFactory<androidx.leanback.app.RowsSupportFragment> {
- ctor public BrowseSupportFragment.ListRowFragmentFactory();
- method public androidx.leanback.app.RowsSupportFragment! createFragment(Object!);
- }
-
- public static class BrowseSupportFragment.MainFragmentAdapter<T extends androidx.fragment.app.Fragment> {
- ctor public BrowseSupportFragment.MainFragmentAdapter(T!);
- method public final T! getFragment();
- method public final androidx.leanback.app.BrowseSupportFragment.FragmentHost! getFragmentHost();
- method public boolean isScalingEnabled();
- method public boolean isScrolling();
- method public void onTransitionEnd();
- method public boolean onTransitionPrepare();
- method public void onTransitionStart();
- method public void setAlignment(int);
- method public void setEntranceTransitionState(boolean);
- method public void setExpand(boolean);
- method public void setScalingEnabled(boolean);
- }
-
- public static interface BrowseSupportFragment.MainFragmentAdapterProvider {
- method public androidx.leanback.app.BrowseSupportFragment.MainFragmentAdapter! getMainFragmentAdapter();
- }
-
- public static final class BrowseSupportFragment.MainFragmentAdapterRegistry {
- ctor public BrowseSupportFragment.MainFragmentAdapterRegistry();
- method public androidx.fragment.app.Fragment! createFragment(Object!);
- method public void registerFragment(Class!, androidx.leanback.app.BrowseSupportFragment.FragmentFactory!);
- }
-
- public static class BrowseSupportFragment.MainFragmentRowsAdapter<T extends androidx.fragment.app.Fragment> {
- ctor public BrowseSupportFragment.MainFragmentRowsAdapter(T!);
- method public androidx.leanback.widget.RowPresenter.ViewHolder! findRowViewHolderByPosition(int);
- method public final T! getFragment();
- method public int getSelectedPosition();
- method public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
- method public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
- method public void setSelectedPosition(int, boolean, androidx.leanback.widget.Presenter.ViewHolderTask!);
- method public void setSelectedPosition(int, boolean);
- }
-
- public static interface BrowseSupportFragment.MainFragmentRowsAdapterProvider {
- method public androidx.leanback.app.BrowseSupportFragment.MainFragmentRowsAdapter! getMainFragmentRowsAdapter();
- }
-
- @Deprecated public class DetailsFragment extends androidx.leanback.app.BaseFragment {
- method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
- method @Deprecated public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
- method @Deprecated public androidx.leanback.widget.DetailsParallax! getParallax();
- method @Deprecated public androidx.leanback.app.RowsFragment! getRowsFragment();
- method @Deprecated protected android.view.View! inflateTitle(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method @Deprecated protected void onSetDetailsOverviewRowStatus(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter!, androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!, int, int, int);
- method @Deprecated protected void onSetRowStatus(androidx.leanback.widget.RowPresenter!, androidx.leanback.widget.RowPresenter.ViewHolder!, int, int, int);
- method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener!);
- method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.BaseOnItemViewSelectedListener!);
- method @Deprecated public void setSelectedPosition(int);
- method @Deprecated public void setSelectedPosition(int, boolean);
- method @Deprecated protected void setupDetailsOverviewRowPresenter(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter!);
- method @Deprecated protected void setupPresenter(androidx.leanback.widget.Presenter!);
- }
-
- @Deprecated public class DetailsFragmentBackgroundController {
- ctor @Deprecated public DetailsFragmentBackgroundController(androidx.leanback.app.DetailsFragment!);
- method @Deprecated public boolean canNavigateToVideoFragment();
- method @Deprecated public void enableParallax();
- method @Deprecated public void enableParallax(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, androidx.leanback.widget.ParallaxTarget.PropertyValuesHolderTarget?);
- method @Deprecated public final android.app.Fragment! findOrCreateVideoFragment();
- method @Deprecated public final android.graphics.drawable.Drawable! getBottomDrawable();
- method @Deprecated public final android.graphics.Bitmap! getCoverBitmap();
- method @Deprecated public final android.graphics.drawable.Drawable! getCoverDrawable();
- method @Deprecated public final int getParallaxDrawableMaxOffset();
- method @Deprecated public final androidx.leanback.media.PlaybackGlue! getPlaybackGlue();
- method @Deprecated @ColorInt public final int getSolidColor();
- method @Deprecated public androidx.leanback.media.PlaybackGlueHost! onCreateGlueHost();
- method @Deprecated public android.app.Fragment! onCreateVideoFragment();
- method @Deprecated public final void setCoverBitmap(android.graphics.Bitmap!);
- method @Deprecated public final void setParallaxDrawableMaxOffset(int);
- method @Deprecated public final void setSolidColor(@ColorInt int);
- method @Deprecated public void setupVideoPlayback(androidx.leanback.media.PlaybackGlue);
- method @Deprecated public final void switchToRows();
- method @Deprecated public final void switchToVideo();
- }
-
- public class DetailsSupportFragment extends androidx.leanback.app.BaseSupportFragment {
- method public androidx.leanback.widget.ObjectAdapter! getAdapter();
- method public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
- method public androidx.leanback.widget.DetailsParallax! getParallax();
- method public androidx.leanback.app.RowsSupportFragment! getRowsSupportFragment();
- method @Deprecated protected android.view.View! inflateTitle(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method protected void onSetDetailsOverviewRowStatus(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter!, androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!, int, int, int);
- method protected void onSetRowStatus(androidx.leanback.widget.RowPresenter!, androidx.leanback.widget.RowPresenter.ViewHolder!, int, int, int);
- method public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method public void setOnItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener!);
- method public void setOnItemViewSelectedListener(androidx.leanback.widget.BaseOnItemViewSelectedListener!);
- method public void setSelectedPosition(int);
- method public void setSelectedPosition(int, boolean);
- method protected void setupDetailsOverviewRowPresenter(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter!);
- method protected void setupPresenter(androidx.leanback.widget.Presenter!);
- }
-
- public class DetailsSupportFragmentBackgroundController {
- ctor public DetailsSupportFragmentBackgroundController(androidx.leanback.app.DetailsSupportFragment!);
- method public boolean canNavigateToVideoSupportFragment();
- method public void enableParallax();
- method public void enableParallax(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable, androidx.leanback.widget.ParallaxTarget.PropertyValuesHolderTarget?);
- method public final androidx.fragment.app.Fragment! findOrCreateVideoSupportFragment();
- method public final android.graphics.drawable.Drawable! getBottomDrawable();
- method public final android.graphics.Bitmap! getCoverBitmap();
- method public final android.graphics.drawable.Drawable! getCoverDrawable();
- method public final int getParallaxDrawableMaxOffset();
- method public final androidx.leanback.media.PlaybackGlue! getPlaybackGlue();
- method @ColorInt public final int getSolidColor();
- method public androidx.leanback.media.PlaybackGlueHost! onCreateGlueHost();
- method public androidx.fragment.app.Fragment! onCreateVideoSupportFragment();
- method public final void setCoverBitmap(android.graphics.Bitmap!);
- method public final void setParallaxDrawableMaxOffset(int);
- method public final void setSolidColor(@ColorInt int);
- method public void setupVideoPlayback(androidx.leanback.media.PlaybackGlue);
- method public final void switchToRows();
- method public final void switchToVideo();
- }
-
- @Deprecated public class ErrorFragment extends androidx.leanback.app.BrandedFragment {
- ctor @Deprecated public ErrorFragment();
- method @Deprecated public android.graphics.drawable.Drawable! getBackgroundDrawable();
- method @Deprecated public android.view.View.OnClickListener! getButtonClickListener();
- method @Deprecated public String! getButtonText();
- method @Deprecated public android.graphics.drawable.Drawable! getImageDrawable();
- method @Deprecated public CharSequence! getMessage();
- method @Deprecated public boolean isBackgroundTranslucent();
- method @Deprecated public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method @Deprecated public void setButtonClickListener(android.view.View.OnClickListener!);
- method @Deprecated public void setButtonText(String!);
- method @Deprecated public void setDefaultBackground(boolean);
- method @Deprecated public void setImageDrawable(android.graphics.drawable.Drawable!);
- method @Deprecated public void setMessage(CharSequence!);
- }
-
- public class ErrorSupportFragment extends androidx.leanback.app.BrandedSupportFragment {
- ctor public ErrorSupportFragment();
- method public android.graphics.drawable.Drawable! getBackgroundDrawable();
- method public android.view.View.OnClickListener! getButtonClickListener();
- method public String! getButtonText();
- method public android.graphics.drawable.Drawable! getImageDrawable();
- method public CharSequence! getMessage();
- method public boolean isBackgroundTranslucent();
- method public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
- method public void setButtonClickListener(android.view.View.OnClickListener!);
- method public void setButtonText(String!);
- method public void setDefaultBackground(boolean);
- method public void setImageDrawable(android.graphics.drawable.Drawable!);
- method public void setMessage(CharSequence!);
- }
-
- @Deprecated public class GuidedStepFragment extends android.app.Fragment {
- ctor @Deprecated public GuidedStepFragment();
- method @Deprecated public static int add(android.app.FragmentManager!, androidx.leanback.app.GuidedStepFragment!);
- method @Deprecated public static int add(android.app.FragmentManager!, androidx.leanback.app.GuidedStepFragment!, int);
- method @Deprecated public static int addAsRoot(android.app.Activity!, androidx.leanback.app.GuidedStepFragment!, int);
- method @Deprecated public void collapseAction(boolean);
- method @Deprecated public void collapseSubActions();
- method @Deprecated public void expandAction(androidx.leanback.widget.GuidedAction!, boolean);
- method @Deprecated public void expandSubActions(androidx.leanback.widget.GuidedAction!);
- method @Deprecated public androidx.leanback.widget.GuidedAction! findActionById(long);
- method @Deprecated public int findActionPositionById(long);
- method @Deprecated public androidx.leanback.widget.GuidedAction! findButtonActionById(long);
- method @Deprecated public int findButtonActionPositionById(long);
- method @Deprecated public void finishGuidedStepFragments();
- method @Deprecated public android.view.View! getActionItemView(int);
- method @Deprecated public java.util.List<androidx.leanback.widget.GuidedAction>! getActions();
- method @Deprecated public android.view.View! getButtonActionItemView(int);
- method @Deprecated public java.util.List<androidx.leanback.widget.GuidedAction>! getButtonActions();
- method @Deprecated public static androidx.leanback.app.GuidedStepFragment! getCurrentGuidedStepFragment(android.app.FragmentManager!);
- method @Deprecated public androidx.leanback.widget.GuidanceStylist! getGuidanceStylist();
- method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! getGuidedActionsStylist();
- method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! getGuidedButtonActionsStylist();
- method @Deprecated public int getSelectedActionPosition();
- method @Deprecated public int getSelectedButtonActionPosition();
- method @Deprecated public int getUiStyle();
- method @Deprecated public boolean isExpanded();
- method @Deprecated public boolean isFocusOutEndAllowed();
- method @Deprecated public boolean isFocusOutStartAllowed();
- method @Deprecated public boolean isSubActionsExpanded();
- method @Deprecated public void notifyActionChanged(int);
- method @Deprecated public void notifyButtonActionChanged(int);
- method @Deprecated protected void onAddSharedElementTransition(android.app.FragmentTransaction!, androidx.leanback.app.GuidedStepFragment!);
- method @Deprecated public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction>, android.os.Bundle!);
- method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! onCreateActionsStylist();
- method @Deprecated public android.view.View! onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method @Deprecated public void onCreateButtonActions(java.util.List<androidx.leanback.widget.GuidedAction>, android.os.Bundle!);
- method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! onCreateButtonActionsStylist();
- method @Deprecated public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle!);
- method @Deprecated public androidx.leanback.widget.GuidanceStylist! onCreateGuidanceStylist();
- method @Deprecated public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- method @Deprecated public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
- method @Deprecated public void onGuidedActionEdited(androidx.leanback.widget.GuidedAction!);
- method @Deprecated public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
- method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
- method @Deprecated protected void onProvideFragmentTransitions();
- method @Deprecated public int onProvideTheme();
- method @Deprecated public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- method @Deprecated public void openInEditMode(androidx.leanback.widget.GuidedAction!);
- method @Deprecated public void popBackStackToGuidedStepFragment(Class!, int);
- method @Deprecated public void setActions(java.util.List<androidx.leanback.widget.GuidedAction>!);
- method @Deprecated public void setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction>!);
- method @Deprecated public void setButtonActions(java.util.List<androidx.leanback.widget.GuidedAction>!);
- method @Deprecated public void setSelectedActionPosition(int);
- method @Deprecated public void setSelectedButtonActionPosition(int);
- method @Deprecated public void setUiStyle(int);
- field @Deprecated public static final String EXTRA_UI_STYLE = "uiStyle";
- field @Deprecated public static final int UI_STYLE_ACTIVITY_ROOT = 2; // 0x2
- field @Deprecated public static final int UI_STYLE_DEFAULT = 0; // 0x0
- field @Deprecated public static final int UI_STYLE_ENTRANCE = 1; // 0x1
- field @Deprecated public static final int UI_STYLE_REPLACE = 0; // 0x0
- }
-
- public class GuidedStepSupportFragment extends androidx.fragment.app.Fragment {
- ctor public GuidedStepSupportFragment();
- method public static int add(androidx.fragment.app.FragmentManager!, androidx.leanback.app.GuidedStepSupportFragment!);
- method public static int add(androidx.fragment.app.FragmentManager!, androidx.leanback.app.GuidedStepSupportFragment!, int);
- method public static int addAsRoot(androidx.fragment.app.FragmentActivity!, androidx.leanback.app.GuidedStepSupportFragment!, int);
- method public void collapseAction(boolean);
- method public void collapseSubActions();
- method public void expandAction(androidx.leanback.widget.GuidedAction!, boolean);
- method public void expandSubActions(androidx.leanback.widget.GuidedAction!);
- method public androidx.leanback.widget.GuidedAction! findActionById(long);
- method public int findActionPositionById(long);
- method public androidx.leanback.widget.GuidedAction! findButtonActionById(long);
- method public int findButtonActionPositionById(long);
- method public void finishGuidedStepSupportFragments();
- method public android.view.View! getActionItemView(int);
- method public java.util.List<androidx.leanback.widget.GuidedAction>! getActions();
- method public android.view.View! getButtonActionItemView(int);
- method public java.util.List<androidx.leanback.widget.GuidedAction>! getButtonActions();
- method public static androidx.leanback.app.GuidedStepSupportFragment! getCurrentGuidedStepSupportFragment(androidx.fragment.app.FragmentManager!);
- method public androidx.leanback.widget.GuidanceStylist! getGuidanceStylist();
- method public androidx.leanback.widget.GuidedActionsStylist! getGuidedActionsStylist();
- method public androidx.leanback.widget.GuidedActionsStylist! getGuidedButtonActionsStylist();
- method public int getSelectedActionPosition();
- method public int getSelectedButtonActionPosition();
- method public int getUiStyle();
- method public boolean isExpanded();
- method public boolean isFocusOutEndAllowed();
- method public boolean isFocusOutStartAllowed();
- method public boolean isSubActionsExpanded();
- method public void notifyActionChanged(int);
- method public void notifyButtonActionChanged(int);
- method protected void onAddSharedElementTransition(androidx.fragment.app.FragmentTransaction!, androidx.leanback.app.GuidedStepSupportFragment!);
- method public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction>, android.os.Bundle!);
- method public androidx.leanback.widget.GuidedActionsStylist! onCreateActionsStylist();
- method public android.view.View! onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method public void onCreateButtonActions(java.util.List<androidx.leanback.widget.GuidedAction>, android.os.Bundle!);
- method public androidx.leanback.widget.GuidedActionsStylist! onCreateButtonActionsStylist();
- method public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle!);
- method public androidx.leanback.widget.GuidanceStylist! onCreateGuidanceStylist();
- method public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- method public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
- method @Deprecated public void onGuidedActionEdited(androidx.leanback.widget.GuidedAction!);
- method public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
- method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
- method protected void onProvideFragmentTransitions();
- method public int onProvideTheme();
- method public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- method public void openInEditMode(androidx.leanback.widget.GuidedAction!);
- method public void popBackStackToGuidedStepSupportFragment(Class!, int);
- method public void setActions(java.util.List<androidx.leanback.widget.GuidedAction>!);
- method public void setActionsDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction>!);
- method public void setButtonActions(java.util.List<androidx.leanback.widget.GuidedAction>!);
- method public void setSelectedActionPosition(int);
- method public void setSelectedButtonActionPosition(int);
- method public void setUiStyle(int);
- field public static final String EXTRA_UI_STYLE = "uiStyle";
- field public static final int UI_STYLE_ACTIVITY_ROOT = 2; // 0x2
- field @Deprecated public static final int UI_STYLE_DEFAULT = 0; // 0x0
- field public static final int UI_STYLE_ENTRANCE = 1; // 0x1
- field public static final int UI_STYLE_REPLACE = 0; // 0x0
- }
-
- @Deprecated public class HeadersFragment extends android.app.Fragment {
- ctor @Deprecated public HeadersFragment();
- method @Deprecated public final androidx.leanback.widget.ObjectAdapter! getAdapter();
- method @Deprecated public final androidx.leanback.widget.ItemBridgeAdapter! getBridgeAdapter();
- method @Deprecated public final androidx.leanback.widget.PresenterSelector! getPresenterSelector();
- method @Deprecated public int getSelectedPosition();
- method @Deprecated public final androidx.leanback.widget.VerticalGridView! getVerticalGridView();
- method @Deprecated public boolean isScrolling();
- method @Deprecated public void onTransitionEnd();
- method @Deprecated public boolean onTransitionPrepare();
- method @Deprecated public void onTransitionStart();
- method @Deprecated public final void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method @Deprecated public void setAlignment(int);
- method @Deprecated public void setOnHeaderClickedListener(androidx.leanback.app.HeadersFragment.OnHeaderClickedListener!);
- method @Deprecated public void setOnHeaderViewSelectedListener(androidx.leanback.app.HeadersFragment.OnHeaderViewSelectedListener!);
- method @Deprecated public final void setPresenterSelector(androidx.leanback.widget.PresenterSelector!);
- method @Deprecated public void setSelectedPosition(int);
- method @Deprecated public void setSelectedPosition(int, boolean);
- }
-
- @Deprecated public static interface HeadersFragment.OnHeaderClickedListener {
- method @Deprecated public void onHeaderClicked(androidx.leanback.widget.RowHeaderPresenter.ViewHolder!, androidx.leanback.widget.Row!);
- }
-
- @Deprecated public static interface HeadersFragment.OnHeaderViewSelectedListener {
- method @Deprecated public void onHeaderSelected(androidx.leanback.widget.RowHeaderPresenter.ViewHolder!, androidx.leanback.widget.Row!);
- }
-
- public class HeadersSupportFragment extends androidx.fragment.app.Fragment {
- ctor public HeadersSupportFragment();
- method public final androidx.leanback.widget.ObjectAdapter! getAdapter();
- method public final androidx.leanback.widget.ItemBridgeAdapter! getBridgeAdapter();
- method public final androidx.leanback.widget.PresenterSelector! getPresenterSelector();
- method public int getSelectedPosition();
- method public final androidx.leanback.widget.VerticalGridView! getVerticalGridView();
- method public boolean isScrolling();
- method public void onTransitionEnd();
- method public boolean onTransitionPrepare();
- method public void onTransitionStart();
- method public final void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method public void setAlignment(int);
- method public void setOnHeaderClickedListener(androidx.leanback.app.HeadersSupportFragment.OnHeaderClickedListener!);
- method public void setOnHeaderViewSelectedListener(androidx.leanback.app.HeadersSupportFragment.OnHeaderViewSelectedListener!);
- method public final void setPresenterSelector(androidx.leanback.widget.PresenterSelector!);
- method public void setSelectedPosition(int);
- method public void setSelectedPosition(int, boolean);
- }
-
- public static interface HeadersSupportFragment.OnHeaderClickedListener {
- method public void onHeaderClicked(androidx.leanback.widget.RowHeaderPresenter.ViewHolder!, androidx.leanback.widget.Row!);
- }
-
- public static interface HeadersSupportFragment.OnHeaderViewSelectedListener {
- method public void onHeaderSelected(androidx.leanback.widget.RowHeaderPresenter.ViewHolder!, androidx.leanback.widget.Row!);
- }
-
- @Deprecated public abstract class OnboardingFragment extends android.app.Fragment {
- ctor @Deprecated public OnboardingFragment();
- method @Deprecated @ColorInt public final int getArrowBackgroundColor();
- method @Deprecated @ColorInt public final int getArrowColor();
- method @Deprecated protected final int getCurrentPageIndex();
- method @Deprecated @ColorInt public final int getDescriptionViewTextColor();
- method @Deprecated @ColorInt public final int getDotBackgroundColor();
- method @Deprecated public final int getIconResourceId();
- method @Deprecated public final int getLogoResourceId();
- method @Deprecated protected abstract int getPageCount();
- method @Deprecated protected abstract CharSequence! getPageDescription(int);
- method @Deprecated protected abstract CharSequence! getPageTitle(int);
- method @Deprecated public final CharSequence! getStartButtonText();
- method @Deprecated @ColorInt public final int getTitleViewTextColor();
- method @Deprecated protected final boolean isLogoAnimationFinished();
- method @Deprecated protected void moveToNextPage();
- method @Deprecated protected void moveToPreviousPage();
- method @Deprecated protected abstract android.view.View? onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!);
- method @Deprecated protected abstract android.view.View? onCreateContentView(android.view.LayoutInflater!, android.view.ViewGroup!);
- method @Deprecated protected android.animation.Animator! onCreateDescriptionAnimator();
- method @Deprecated protected android.animation.Animator? onCreateEnterAnimation();
- method @Deprecated protected abstract android.view.View? onCreateForegroundView(android.view.LayoutInflater!, android.view.ViewGroup!);
- method @Deprecated protected android.animation.Animator? onCreateLogoAnimation();
- method @Deprecated protected android.animation.Animator! onCreateTitleAnimator();
- method @Deprecated protected void onFinishFragment();
- method @Deprecated protected void onLogoAnimationFinished();
- method @Deprecated protected void onPageChanged(int, int);
- method @Deprecated public int onProvideTheme();
- method @Deprecated public void setArrowBackgroundColor(@ColorInt int);
- method @Deprecated public void setArrowColor(@ColorInt int);
- method @Deprecated public void setDescriptionViewTextColor(@ColorInt int);
- method @Deprecated public void setDotBackgroundColor(@ColorInt int);
- method @Deprecated public final void setIconResouceId(int);
- method @Deprecated public final void setLogoResourceId(int);
- method @Deprecated public void setStartButtonText(CharSequence!);
- method @Deprecated public void setTitleViewTextColor(@ColorInt int);
- method @Deprecated protected final void startEnterAnimation(boolean);
- }
-
- public abstract class OnboardingSupportFragment extends androidx.fragment.app.Fragment {
- ctor public OnboardingSupportFragment();
- method @ColorInt public final int getArrowBackgroundColor();
- method @ColorInt public final int getArrowColor();
- method protected final int getCurrentPageIndex();
- method @ColorInt public final int getDescriptionViewTextColor();
- method @ColorInt public final int getDotBackgroundColor();
- method public final int getIconResourceId();
- method public final int getLogoResourceId();
- method protected abstract int getPageCount();
- method protected abstract CharSequence! getPageDescription(int);
- method protected abstract CharSequence! getPageTitle(int);
- method public final CharSequence! getStartButtonText();
- method @ColorInt public final int getTitleViewTextColor();
- method protected final boolean isLogoAnimationFinished();
- method protected void moveToNextPage();
- method protected void moveToPreviousPage();
- method protected abstract android.view.View? onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!);
- method protected abstract android.view.View? onCreateContentView(android.view.LayoutInflater!, android.view.ViewGroup!);
- method protected android.animation.Animator! onCreateDescriptionAnimator();
- method protected android.animation.Animator? onCreateEnterAnimation();
- method protected abstract android.view.View? onCreateForegroundView(android.view.LayoutInflater!, android.view.ViewGroup!);
- method protected android.animation.Animator? onCreateLogoAnimation();
- method protected android.animation.Animator! onCreateTitleAnimator();
- method protected void onFinishFragment();
- method protected void onLogoAnimationFinished();
- method protected void onPageChanged(int, int);
- method public int onProvideTheme();
- method public void setArrowBackgroundColor(@ColorInt int);
- method public void setArrowColor(@ColorInt int);
- method public void setDescriptionViewTextColor(@ColorInt int);
- method public void setDotBackgroundColor(@ColorInt int);
- method public final void setIconResouceId(int);
- method public final void setLogoResourceId(int);
- method public void setStartButtonText(CharSequence!);
- method public void setTitleViewTextColor(@ColorInt int);
- method protected final void startEnterAnimation(boolean);
- }
-
- @Deprecated public class PlaybackFragment extends android.app.Fragment {
- ctor @Deprecated public PlaybackFragment();
- method @Deprecated public void fadeOut();
- method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
- method @Deprecated public int getBackgroundType();
- method @Deprecated public androidx.leanback.app.ProgressBarManager! getProgressBarManager();
- method @Deprecated public void hideControlsOverlay(boolean);
- method @Deprecated public boolean isControlsOverlayAutoHideEnabled();
- method @Deprecated public boolean isControlsOverlayVisible();
- method @Deprecated public boolean isFadingEnabled();
- method @Deprecated public boolean isShowOrHideControlsOverlayOnUserInteraction();
- method @Deprecated public void notifyPlaybackRowChanged();
- method @Deprecated protected void onBufferingStateChanged(boolean);
- method @Deprecated protected void onError(int, CharSequence!);
- method @Deprecated protected void onVideoSizeChanged(int, int);
- method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method @Deprecated public void setBackgroundType(int);
- method @Deprecated public void setControlsOverlayAutoHideEnabled(boolean);
- method @Deprecated public void setFadingEnabled(boolean);
- method @Deprecated public void setHostCallback(androidx.leanback.media.PlaybackGlueHost.HostCallback!);
- method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener!);
- method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.BaseOnItemViewSelectedListener!);
- method @Deprecated public final void setOnKeyInterceptListener(android.view.View.OnKeyListener!);
- method @Deprecated public void setOnPlaybackItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener!);
- method @Deprecated public void setPlaybackRow(androidx.leanback.widget.Row!);
- method @Deprecated public void setPlaybackRowPresenter(androidx.leanback.widget.PlaybackRowPresenter!);
- method @Deprecated public void setPlaybackSeekUiClient(androidx.leanback.widget.PlaybackSeekUi.Client!);
- method @Deprecated public void setSelectedPosition(int);
- method @Deprecated public void setSelectedPosition(int, boolean);
- method @Deprecated public void setShowOrHideControlsOverlayOnUserInteraction(boolean);
- method @Deprecated public void showControlsOverlay(boolean);
- method @Deprecated public void tickle();
- field @Deprecated public static final int BG_DARK = 1; // 0x1
- field @Deprecated public static final int BG_LIGHT = 2; // 0x2
- field @Deprecated public static final int BG_NONE = 0; // 0x0
- }
-
- @Deprecated public class PlaybackFragmentGlueHost extends androidx.leanback.media.PlaybackGlueHost implements androidx.leanback.widget.PlaybackSeekUi {
- ctor @Deprecated public PlaybackFragmentGlueHost(androidx.leanback.app.PlaybackFragment!);
- method @Deprecated public void fadeOut();
- method @Deprecated public void setPlaybackSeekUiClient(androidx.leanback.widget.PlaybackSeekUi.Client!);
- }
-
- public class PlaybackSupportFragment extends androidx.fragment.app.Fragment {
- ctor public PlaybackSupportFragment();
- method @Deprecated public void fadeOut();
- method public androidx.leanback.widget.ObjectAdapter! getAdapter();
- method public int getBackgroundType();
- method public androidx.leanback.app.ProgressBarManager! getProgressBarManager();
- method public void hideControlsOverlay(boolean);
- method public boolean isControlsOverlayAutoHideEnabled();
- method public boolean isControlsOverlayVisible();
- method @Deprecated public boolean isFadingEnabled();
- method public boolean isShowOrHideControlsOverlayOnUserInteraction();
- method public void notifyPlaybackRowChanged();
- method protected void onBufferingStateChanged(boolean);
- method protected void onError(int, CharSequence!);
- method protected void onVideoSizeChanged(int, int);
- method public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method public void setBackgroundType(int);
- method public void setControlsOverlayAutoHideEnabled(boolean);
- method @Deprecated public void setFadingEnabled(boolean);
- method public void setHostCallback(androidx.leanback.media.PlaybackGlueHost.HostCallback!);
- method public void setOnItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener!);
- method public void setOnItemViewSelectedListener(androidx.leanback.widget.BaseOnItemViewSelectedListener!);
- method public final void setOnKeyInterceptListener(android.view.View.OnKeyListener!);
- method public void setOnPlaybackItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener!);
- method public void setPlaybackRow(androidx.leanback.widget.Row!);
- method public void setPlaybackRowPresenter(androidx.leanback.widget.PlaybackRowPresenter!);
- method public void setPlaybackSeekUiClient(androidx.leanback.widget.PlaybackSeekUi.Client!);
- method public void setSelectedPosition(int);
- method public void setSelectedPosition(int, boolean);
- method public void setShowOrHideControlsOverlayOnUserInteraction(boolean);
- method public void showControlsOverlay(boolean);
- method public void tickle();
- field public static final int BG_DARK = 1; // 0x1
- field public static final int BG_LIGHT = 2; // 0x2
- field public static final int BG_NONE = 0; // 0x0
- }
-
- public class PlaybackSupportFragmentGlueHost extends androidx.leanback.media.PlaybackGlueHost implements androidx.leanback.widget.PlaybackSeekUi {
- ctor public PlaybackSupportFragmentGlueHost(androidx.leanback.app.PlaybackSupportFragment!);
- method public void fadeOut();
- method public void setPlaybackSeekUiClient(androidx.leanback.widget.PlaybackSeekUi.Client!);
- }
-
- public final class ProgressBarManager {
- ctor public ProgressBarManager();
- method public void disableProgressBar();
- method public void enableProgressBar();
- method public long getInitialDelay();
- method public void hide();
- method public void setInitialDelay(long);
- method public void setProgressBarView(android.view.View!);
- method public void setRootView(android.view.ViewGroup!);
- method public void show();
- }
-
- @Deprecated public class RowsFragment extends android.app.Fragment implements androidx.leanback.app.BrowseFragment.MainFragmentAdapterProvider androidx.leanback.app.BrowseFragment.MainFragmentRowsAdapterProvider {
- ctor @Deprecated public RowsFragment();
- method @Deprecated public void enableRowScaling(boolean);
- method @Deprecated protected androidx.leanback.widget.VerticalGridView! findGridViewFromRoot(android.view.View!);
- method @Deprecated public androidx.leanback.widget.RowPresenter.ViewHolder! findRowViewHolderByPosition(int);
- method @Deprecated public final androidx.leanback.widget.ObjectAdapter! getAdapter();
- method @Deprecated public final androidx.leanback.widget.ItemBridgeAdapter! getBridgeAdapter();
- method @Deprecated public androidx.leanback.app.BrowseFragment.MainFragmentAdapter! getMainFragmentAdapter();
- method @Deprecated public androidx.leanback.app.BrowseFragment.MainFragmentRowsAdapter! getMainFragmentRowsAdapter();
- method @Deprecated public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
- method @Deprecated public androidx.leanback.widget.BaseOnItemViewSelectedListener! getOnItemViewSelectedListener();
- method @Deprecated public final androidx.leanback.widget.PresenterSelector! getPresenterSelector();
- method @Deprecated public androidx.leanback.widget.RowPresenter.ViewHolder! getRowViewHolder(int);
- method @Deprecated public int getSelectedPosition();
- method @Deprecated public final androidx.leanback.widget.VerticalGridView! getVerticalGridView();
- method @Deprecated public boolean isScrolling();
- method @Deprecated public void onTransitionEnd();
- method @Deprecated public boolean onTransitionPrepare();
- method @Deprecated public void onTransitionStart();
- method @Deprecated public final void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method @Deprecated public void setAlignment(int);
- method @Deprecated public void setEntranceTransitionState(boolean);
- method @Deprecated public void setExpand(boolean);
- method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener!);
- method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.BaseOnItemViewSelectedListener!);
- method @Deprecated public final void setPresenterSelector(androidx.leanback.widget.PresenterSelector!);
- method @Deprecated public void setSelectedPosition(int, boolean, androidx.leanback.widget.Presenter.ViewHolderTask!);
- method @Deprecated public void setSelectedPosition(int);
- method @Deprecated public void setSelectedPosition(int, boolean);
- }
-
- @Deprecated public static class RowsFragment.MainFragmentAdapter extends androidx.leanback.app.BrowseFragment.MainFragmentAdapter<androidx.leanback.app.RowsFragment> {
- ctor @Deprecated public RowsFragment.MainFragmentAdapter(androidx.leanback.app.RowsFragment!);
- }
-
- @Deprecated public static class RowsFragment.MainFragmentRowsAdapter extends androidx.leanback.app.BrowseFragment.MainFragmentRowsAdapter<androidx.leanback.app.RowsFragment> {
- ctor @Deprecated public RowsFragment.MainFragmentRowsAdapter(androidx.leanback.app.RowsFragment!);
- }
-
- public class RowsSupportFragment extends androidx.fragment.app.Fragment implements androidx.leanback.app.BrowseSupportFragment.MainFragmentAdapterProvider androidx.leanback.app.BrowseSupportFragment.MainFragmentRowsAdapterProvider {
- ctor public RowsSupportFragment();
- method @Deprecated public void enableRowScaling(boolean);
- method protected androidx.leanback.widget.VerticalGridView! findGridViewFromRoot(android.view.View!);
- method public androidx.leanback.widget.RowPresenter.ViewHolder! findRowViewHolderByPosition(int);
- method public final androidx.leanback.widget.ObjectAdapter! getAdapter();
- method public final androidx.leanback.widget.ItemBridgeAdapter! getBridgeAdapter();
- method public androidx.leanback.app.BrowseSupportFragment.MainFragmentAdapter! getMainFragmentAdapter();
- method public androidx.leanback.app.BrowseSupportFragment.MainFragmentRowsAdapter! getMainFragmentRowsAdapter();
- method public androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
- method public androidx.leanback.widget.BaseOnItemViewSelectedListener! getOnItemViewSelectedListener();
- method public final androidx.leanback.widget.PresenterSelector! getPresenterSelector();
- method public androidx.leanback.widget.RowPresenter.ViewHolder! getRowViewHolder(int);
- method public int getSelectedPosition();
- method public final androidx.leanback.widget.VerticalGridView! getVerticalGridView();
- method public boolean isScrolling();
- method public void onTransitionEnd();
- method public boolean onTransitionPrepare();
- method public void onTransitionStart();
- method public final void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method public void setAlignment(int);
- method public void setEntranceTransitionState(boolean);
- method public void setExpand(boolean);
- method public void setOnItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener!);
- method public void setOnItemViewSelectedListener(androidx.leanback.widget.BaseOnItemViewSelectedListener!);
- method public final void setPresenterSelector(androidx.leanback.widget.PresenterSelector!);
- method public void setSelectedPosition(int, boolean, androidx.leanback.widget.Presenter.ViewHolderTask!);
- method public void setSelectedPosition(int);
- method public void setSelectedPosition(int, boolean);
- }
-
- public static class RowsSupportFragment.MainFragmentAdapter extends androidx.leanback.app.BrowseSupportFragment.MainFragmentAdapter<androidx.leanback.app.RowsSupportFragment> {
- ctor public RowsSupportFragment.MainFragmentAdapter(androidx.leanback.app.RowsSupportFragment!);
- }
-
- public static class RowsSupportFragment.MainFragmentRowsAdapter extends androidx.leanback.app.BrowseSupportFragment.MainFragmentRowsAdapter<androidx.leanback.app.RowsSupportFragment> {
- ctor public RowsSupportFragment.MainFragmentRowsAdapter(androidx.leanback.app.RowsSupportFragment!);
- }
-
- @Deprecated public class SearchFragment extends android.app.Fragment {
- ctor @Deprecated public SearchFragment();
- method @Deprecated public static android.os.Bundle! createArgs(android.os.Bundle!, String!);
- method @Deprecated public static android.os.Bundle! createArgs(android.os.Bundle!, String!, String!);
- method @Deprecated public void displayCompletions(java.util.List<java.lang.String>!);
- method @Deprecated public void displayCompletions(android.view.inputmethod.CompletionInfo[]!);
- method @Deprecated public android.graphics.drawable.Drawable! getBadgeDrawable();
- method @Deprecated public android.content.Intent! getRecognizerIntent();
- method @Deprecated public androidx.leanback.app.RowsFragment! getRowsFragment();
- method @Deprecated public String! getTitle();
- method @Deprecated public static androidx.leanback.app.SearchFragment! newInstance(String!);
- method @Deprecated public void setBadgeDrawable(android.graphics.drawable.Drawable!);
- method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
- method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
- method @Deprecated public void setSearchAffordanceColors(androidx.leanback.widget.SearchOrbView.Colors!);
- method @Deprecated public void setSearchAffordanceColorsInListening(androidx.leanback.widget.SearchOrbView.Colors!);
- method @Deprecated public void setSearchQuery(String!, boolean);
- method @Deprecated public void setSearchQuery(android.content.Intent!, boolean);
- method @Deprecated public void setSearchResultProvider(androidx.leanback.app.SearchFragment.SearchResultProvider!);
- method @Deprecated public void setSpeechRecognitionCallback(androidx.leanback.widget.SpeechRecognitionCallback!);
- method @Deprecated public void setTitle(String!);
- method @Deprecated public void startRecognition();
- }
-
- @Deprecated public static interface SearchFragment.SearchResultProvider {
- method @Deprecated public androidx.leanback.widget.ObjectAdapter! getResultsAdapter();
- method @Deprecated public boolean onQueryTextChange(String!);
- method @Deprecated public boolean onQueryTextSubmit(String!);
- }
-
- public class SearchSupportFragment extends androidx.fragment.app.Fragment {
- ctor public SearchSupportFragment();
- method public static android.os.Bundle! createArgs(android.os.Bundle!, String!);
- method public static android.os.Bundle! createArgs(android.os.Bundle!, String!, String!);
- method public void displayCompletions(java.util.List<java.lang.String>!);
- method public void displayCompletions(android.view.inputmethod.CompletionInfo[]!);
- method public android.graphics.drawable.Drawable! getBadgeDrawable();
- method public android.content.Intent! getRecognizerIntent();
- method public androidx.leanback.app.RowsSupportFragment! getRowsSupportFragment();
- method public String! getTitle();
- method public static androidx.leanback.app.SearchSupportFragment! newInstance(String!);
- method public void setBadgeDrawable(android.graphics.drawable.Drawable!);
- method public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
- method public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
- method public void setSearchAffordanceColors(androidx.leanback.widget.SearchOrbView.Colors!);
- method public void setSearchAffordanceColorsInListening(androidx.leanback.widget.SearchOrbView.Colors!);
- method public void setSearchQuery(String!, boolean);
- method public void setSearchQuery(android.content.Intent!, boolean);
- method public void setSearchResultProvider(androidx.leanback.app.SearchSupportFragment.SearchResultProvider!);
- method @Deprecated public void setSpeechRecognitionCallback(androidx.leanback.widget.SpeechRecognitionCallback!);
- method public void setTitle(String!);
- method public void startRecognition();
- }
-
- public static interface SearchSupportFragment.SearchResultProvider {
- method public androidx.leanback.widget.ObjectAdapter! getResultsAdapter();
- method public boolean onQueryTextChange(String!);
- method public boolean onQueryTextSubmit(String!);
- }
-
- @Deprecated public class VerticalGridFragment extends androidx.leanback.app.BaseFragment {
- method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
- method @Deprecated public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
- method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
- method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method @Deprecated public void setGridPresenter(androidx.leanback.widget.VerticalGridPresenter!);
- method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
- method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
- method @Deprecated public void setSelectedPosition(int);
- }
-
- public class VerticalGridSupportFragment extends androidx.leanback.app.BaseSupportFragment {
- method public androidx.leanback.widget.ObjectAdapter! getAdapter();
- method public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
- method public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
- method public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method public void setGridPresenter(androidx.leanback.widget.VerticalGridPresenter!);
- method public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
- method public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
- method public void setSelectedPosition(int);
- }
-
- @Deprecated public class VideoFragment extends androidx.leanback.app.PlaybackFragment {
- ctor @Deprecated public VideoFragment();
- method @Deprecated public android.view.SurfaceView! getSurfaceView();
- method @Deprecated public void setSurfaceHolderCallback(android.view.SurfaceHolder.Callback!);
- }
-
- @Deprecated public class VideoFragmentGlueHost extends androidx.leanback.app.PlaybackFragmentGlueHost implements androidx.leanback.media.SurfaceHolderGlueHost {
- ctor @Deprecated public VideoFragmentGlueHost(androidx.leanback.app.VideoFragment!);
- method @Deprecated public void setSurfaceHolderCallback(android.view.SurfaceHolder.Callback!);
- }
-
- public class VideoSupportFragment extends androidx.leanback.app.PlaybackSupportFragment {
- ctor public VideoSupportFragment();
- method public android.view.SurfaceView! getSurfaceView();
- method public void setSurfaceHolderCallback(android.view.SurfaceHolder.Callback!);
- }
-
- public class VideoSupportFragmentGlueHost extends androidx.leanback.app.PlaybackSupportFragmentGlueHost implements androidx.leanback.media.SurfaceHolderGlueHost {
- ctor public VideoSupportFragmentGlueHost(androidx.leanback.app.VideoSupportFragment!);
- method public void setSurfaceHolderCallback(android.view.SurfaceHolder.Callback!);
- }
-
-}
-
-package androidx.leanback.database {
-
- public abstract class CursorMapper {
- ctor public CursorMapper();
- method protected abstract Object! bind(android.database.Cursor!);
- method protected abstract void bindColumns(android.database.Cursor!);
- method public Object! convert(android.database.Cursor!);
- }
-
-}
-
-package androidx.leanback.graphics {
-
- public class BoundsRule {
- ctor public BoundsRule();
- ctor public BoundsRule(androidx.leanback.graphics.BoundsRule!);
- method public void calculateBounds(android.graphics.Rect!, android.graphics.Rect!);
- field public androidx.leanback.graphics.BoundsRule.ValueRule! bottom;
- field public androidx.leanback.graphics.BoundsRule.ValueRule! left;
- field public androidx.leanback.graphics.BoundsRule.ValueRule! right;
- field public androidx.leanback.graphics.BoundsRule.ValueRule! top;
- }
-
- public static final class BoundsRule.ValueRule {
- method public static androidx.leanback.graphics.BoundsRule.ValueRule! absoluteValue(int);
- method public int getAbsoluteValue();
- method public float getFraction();
- method public static androidx.leanback.graphics.BoundsRule.ValueRule! inheritFromParent(float);
- method public static androidx.leanback.graphics.BoundsRule.ValueRule! inheritFromParentWithOffset(float, int);
- method public void setAbsoluteValue(int);
- method public void setFraction(float);
- }
-
- public final class ColorFilterCache {
- method public static androidx.leanback.graphics.ColorFilterCache! getColorFilterCache(int);
- method public android.graphics.ColorFilter! getFilterForLevel(float);
- }
-
- public final class ColorFilterDimmer {
- method public void applyFilterToView(android.view.View!);
- method public static androidx.leanback.graphics.ColorFilterDimmer! create(androidx.leanback.graphics.ColorFilterCache!, float, float);
- method public static androidx.leanback.graphics.ColorFilterDimmer! createDefault(android.content.Context!);
- method public android.graphics.ColorFilter! getColorFilter();
- method public android.graphics.Paint! getPaint();
- method public void setActiveLevel(float);
- }
-
- public final class ColorOverlayDimmer {
- method public int applyToColor(int);
- method public static androidx.leanback.graphics.ColorOverlayDimmer! createColorOverlayDimmer(int, float, float);
- method public static androidx.leanback.graphics.ColorOverlayDimmer! createDefault(android.content.Context!);
- method public void drawColorOverlay(android.graphics.Canvas!, android.view.View!, boolean);
- method public int getAlpha();
- method public float getAlphaFloat();
- method public android.graphics.Paint! getPaint();
- method public boolean needsDraw();
- method public void setActiveLevel(float);
- }
-
- public class CompositeDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
- ctor public CompositeDrawable();
- method public void addChildDrawable(android.graphics.drawable.Drawable!);
- method public void draw(android.graphics.Canvas!);
- method public androidx.leanback.graphics.CompositeDrawable.ChildDrawable! getChildAt(int);
- method public int getChildCount();
- method public android.graphics.drawable.Drawable! getDrawable(int);
- method public int getOpacity();
- method public void invalidateDrawable(android.graphics.drawable.Drawable!);
- method public void removeChild(int);
- method public void removeDrawable(android.graphics.drawable.Drawable!);
- method public void scheduleDrawable(android.graphics.drawable.Drawable!, Runnable!, long);
- method public void setAlpha(int);
- method public void setChildDrawableAt(int, android.graphics.drawable.Drawable!);
- method public void setColorFilter(android.graphics.ColorFilter!);
- method public void unscheduleDrawable(android.graphics.drawable.Drawable!, Runnable!);
- }
-
- public static final class CompositeDrawable.ChildDrawable {
- ctor public CompositeDrawable.ChildDrawable(android.graphics.drawable.Drawable!, androidx.leanback.graphics.CompositeDrawable!);
- method public androidx.leanback.graphics.BoundsRule! getBoundsRule();
- method public android.graphics.drawable.Drawable! getDrawable();
- method public void recomputeBounds();
- field public static final android.util.Property<androidx.leanback.graphics.CompositeDrawable.ChildDrawable,java.lang.Integer>! BOTTOM_ABSOLUTE;
- field public static final android.util.Property<androidx.leanback.graphics.CompositeDrawable.ChildDrawable,java.lang.Float>! BOTTOM_FRACTION;
- field public static final android.util.Property<androidx.leanback.graphics.CompositeDrawable.ChildDrawable,java.lang.Integer>! LEFT_ABSOLUTE;
- field public static final android.util.Property<androidx.leanback.graphics.CompositeDrawable.ChildDrawable,java.lang.Float>! LEFT_FRACTION;
- field public static final android.util.Property<androidx.leanback.graphics.CompositeDrawable.ChildDrawable,java.lang.Integer>! RIGHT_ABSOLUTE;
- field public static final android.util.Property<androidx.leanback.graphics.CompositeDrawable.ChildDrawable,java.lang.Float>! RIGHT_FRACTION;
- field public static final android.util.Property<androidx.leanback.graphics.CompositeDrawable.ChildDrawable,java.lang.Integer>! TOP_ABSOLUTE;
- field public static final android.util.Property<androidx.leanback.graphics.CompositeDrawable.ChildDrawable,java.lang.Float>! TOP_FRACTION;
- }
-
- public class FitWidthBitmapDrawable extends android.graphics.drawable.Drawable {
- ctor public FitWidthBitmapDrawable();
- method public void draw(android.graphics.Canvas!);
- method public android.graphics.Bitmap! getBitmap();
- method public int getOpacity();
- method public android.graphics.Rect! getSource();
- method public int getVerticalOffset();
- method public void setAlpha(int);
- method public void setBitmap(android.graphics.Bitmap!);
- method public void setColorFilter(android.graphics.ColorFilter!);
- method public void setSource(android.graphics.Rect!);
- method public void setVerticalOffset(int);
- field public static final android.util.Property<androidx.leanback.graphics.FitWidthBitmapDrawable,java.lang.Integer>! PROPERTY_VERTICAL_OFFSET;
- }
-
-}
-
-package androidx.leanback.media {
-
- public class MediaControllerAdapter extends androidx.leanback.media.PlayerAdapter {
- ctor public MediaControllerAdapter(android.support.v4.media.session.MediaControllerCompat!);
- method public android.graphics.drawable.Drawable! getMediaArt(android.content.Context!);
- method public android.support.v4.media.session.MediaControllerCompat! getMediaController();
- method public CharSequence! getMediaSubtitle();
- method public CharSequence! getMediaTitle();
- method public void pause();
- method public void play();
- }
-
- @Deprecated public abstract class MediaControllerGlue extends androidx.leanback.media.PlaybackControlGlue {
- ctor @Deprecated public MediaControllerGlue(android.content.Context!, int[]!, int[]!);
- method @Deprecated public void attachToMediaController(android.support.v4.media.session.MediaControllerCompat!);
- method @Deprecated public void detach();
- method @Deprecated public int getCurrentPosition();
- method @Deprecated public int getCurrentSpeedId();
- method @Deprecated public android.graphics.drawable.Drawable! getMediaArt();
- method @Deprecated public final android.support.v4.media.session.MediaControllerCompat! getMediaController();
- method @Deprecated public int getMediaDuration();
- method @Deprecated public CharSequence! getMediaSubtitle();
- method @Deprecated public CharSequence! getMediaTitle();
- method @Deprecated public long getSupportedActions();
- method @Deprecated public boolean hasValidMedia();
- method @Deprecated public boolean isMediaPlaying();
- }
-
- public class MediaPlayerAdapter extends androidx.leanback.media.PlayerAdapter {
- ctor public MediaPlayerAdapter(android.content.Context!);
- method public final android.media.MediaPlayer! getMediaPlayer();
- method public int getProgressUpdatingInterval();
- method protected boolean onError(int, int);
- method protected boolean onInfo(int, int);
- method protected void onSeekComplete();
- method public void pause();
- method public void play();
- method public void release();
- method public void reset();
- method public boolean setDataSource(android.net.Uri!);
- }
-
- public class PlaybackBannerControlGlue<T extends androidx.leanback.media.PlayerAdapter> extends androidx.leanback.media.PlaybackBaseControlGlue<T> {
- ctor public PlaybackBannerControlGlue(android.content.Context!, int[]!, T!);
- ctor public PlaybackBannerControlGlue(android.content.Context!, int[]!, int[]!, T!);
- method public int[] getFastForwardSpeeds();
- method public int[] getRewindSpeeds();
- method public void onActionClicked(androidx.leanback.widget.Action!);
- method protected androidx.leanback.widget.PlaybackRowPresenter! onCreateRowPresenter();
- method public boolean onKey(android.view.View!, int, android.view.KeyEvent!);
- field public static final int ACTION_CUSTOM_LEFT_FIRST = 1; // 0x1
- field public static final int ACTION_CUSTOM_RIGHT_FIRST = 4096; // 0x1000
- field public static final int ACTION_FAST_FORWARD = 128; // 0x80
- field public static final int ACTION_PLAY_PAUSE = 64; // 0x40
- field public static final int ACTION_REWIND = 32; // 0x20
- field public static final int ACTION_SKIP_TO_NEXT = 256; // 0x100
- field public static final int ACTION_SKIP_TO_PREVIOUS = 16; // 0x10
- field public static final int PLAYBACK_SPEED_FAST_L0 = 10; // 0xa
- field public static final int PLAYBACK_SPEED_FAST_L1 = 11; // 0xb
- field public static final int PLAYBACK_SPEED_FAST_L2 = 12; // 0xc
- field public static final int PLAYBACK_SPEED_FAST_L3 = 13; // 0xd
- field public static final int PLAYBACK_SPEED_FAST_L4 = 14; // 0xe
- field public static final int PLAYBACK_SPEED_INVALID = -1; // 0xffffffff
- field public static final int PLAYBACK_SPEED_NORMAL = 1; // 0x1
- field public static final int PLAYBACK_SPEED_PAUSED = 0; // 0x0
- }
-
- public abstract class PlaybackBaseControlGlue<T extends androidx.leanback.media.PlayerAdapter> extends androidx.leanback.media.PlaybackGlue implements androidx.leanback.widget.OnActionClickedListener android.view.View.OnKeyListener {
- ctor public PlaybackBaseControlGlue(android.content.Context!, T!);
- method public android.graphics.drawable.Drawable! getArt();
- method public final long getBufferedPosition();
- method public androidx.leanback.widget.PlaybackControlsRow! getControlsRow();
- method public long getCurrentPosition();
- method public final long getDuration();
- method public androidx.leanback.widget.PlaybackRowPresenter! getPlaybackRowPresenter();
- method public final T! getPlayerAdapter();
- method public CharSequence! getSubtitle();
- method public long getSupportedActions();
- method public CharSequence! getTitle();
- method public boolean isControlsOverlayAutoHideEnabled();
- method public final boolean isPlaying();
- method public final boolean isPrepared();
- method protected static void notifyItemChanged(androidx.leanback.widget.ArrayObjectAdapter!, Object!);
- method protected void onCreatePrimaryActions(androidx.leanback.widget.ArrayObjectAdapter!);
- method protected abstract androidx.leanback.widget.PlaybackRowPresenter! onCreateRowPresenter();
- method protected void onCreateSecondaryActions(androidx.leanback.widget.ArrayObjectAdapter!);
- method protected void onMetadataChanged();
- method @CallSuper protected void onPlayCompleted();
- method @CallSuper protected void onPlayStateChanged();
- method @CallSuper protected void onPreparedStateChanged();
- method @CallSuper protected void onUpdateBufferedProgress();
- method @CallSuper protected void onUpdateDuration();
- method @CallSuper protected void onUpdateProgress();
- method public final void seekTo(long);
- method public void setArt(android.graphics.drawable.Drawable!);
- method public void setControlsOverlayAutoHideEnabled(boolean);
- method public void setControlsRow(androidx.leanback.widget.PlaybackControlsRow!);
- method public void setPlaybackRowPresenter(androidx.leanback.widget.PlaybackRowPresenter!);
- method public void setSubtitle(CharSequence!);
- method public void setTitle(CharSequence!);
- field public static final int ACTION_CUSTOM_LEFT_FIRST = 1; // 0x1
- field public static final int ACTION_CUSTOM_RIGHT_FIRST = 4096; // 0x1000
- field public static final int ACTION_FAST_FORWARD = 128; // 0x80
- field public static final int ACTION_PLAY_PAUSE = 64; // 0x40
- field public static final int ACTION_REPEAT = 512; // 0x200
- field public static final int ACTION_REWIND = 32; // 0x20
- field public static final int ACTION_SHUFFLE = 1024; // 0x400
- field public static final int ACTION_SKIP_TO_NEXT = 256; // 0x100
- field public static final int ACTION_SKIP_TO_PREVIOUS = 16; // 0x10
- }
-
- public abstract class PlaybackControlGlue extends androidx.leanback.media.PlaybackGlue implements androidx.leanback.widget.OnActionClickedListener android.view.View.OnKeyListener {
- ctor public PlaybackControlGlue(android.content.Context!, int[]!);
- ctor public PlaybackControlGlue(android.content.Context!, int[]!, int[]!);
- method public void enableProgressUpdating(boolean);
- method public androidx.leanback.widget.PlaybackControlsRow! getControlsRow();
- method @Deprecated public androidx.leanback.widget.PlaybackControlsRowPresenter! getControlsRowPresenter();
- method public abstract int getCurrentPosition();
- method public abstract int getCurrentSpeedId();
- method public int[]! getFastForwardSpeeds();
- method public abstract android.graphics.drawable.Drawable! getMediaArt();
- method public abstract int getMediaDuration();
- method public abstract CharSequence! getMediaSubtitle();
- method public abstract CharSequence! getMediaTitle();
- method public androidx.leanback.widget.PlaybackRowPresenter! getPlaybackRowPresenter();
- method public int[]! getRewindSpeeds();
- method public abstract long getSupportedActions();
- method public int getUpdatePeriod();
- method public abstract boolean hasValidMedia();
- method public boolean isFadingEnabled();
- method public abstract boolean isMediaPlaying();
- method public void onActionClicked(androidx.leanback.widget.Action!);
- method protected void onCreateControlsRowAndPresenter();
- method protected void onCreatePrimaryActions(androidx.leanback.widget.SparseArrayObjectAdapter!);
- method protected void onCreateSecondaryActions(androidx.leanback.widget.ArrayObjectAdapter!);
- method public boolean onKey(android.view.View!, int, android.view.KeyEvent!);
- method protected void onMetadataChanged();
- method protected void onStateChanged();
- method public void play(int);
- method public final void play();
- method public void setControlsRow(androidx.leanback.widget.PlaybackControlsRow!);
- method @Deprecated public void setControlsRowPresenter(androidx.leanback.widget.PlaybackControlsRowPresenter!);
- method public void setFadingEnabled(boolean);
- method public void setPlaybackRowPresenter(androidx.leanback.widget.PlaybackRowPresenter!);
- method public void updateProgress();
- field public static final int ACTION_CUSTOM_LEFT_FIRST = 1; // 0x1
- field public static final int ACTION_CUSTOM_RIGHT_FIRST = 4096; // 0x1000
- field public static final int ACTION_FAST_FORWARD = 128; // 0x80
- field public static final int ACTION_PLAY_PAUSE = 64; // 0x40
- field public static final int ACTION_REWIND = 32; // 0x20
- field public static final int ACTION_SKIP_TO_NEXT = 256; // 0x100
- field public static final int ACTION_SKIP_TO_PREVIOUS = 16; // 0x10
- field public static final int PLAYBACK_SPEED_FAST_L0 = 10; // 0xa
- field public static final int PLAYBACK_SPEED_FAST_L1 = 11; // 0xb
- field public static final int PLAYBACK_SPEED_FAST_L2 = 12; // 0xc
- field public static final int PLAYBACK_SPEED_FAST_L3 = 13; // 0xd
- field public static final int PLAYBACK_SPEED_FAST_L4 = 14; // 0xe
- field public static final int PLAYBACK_SPEED_INVALID = -1; // 0xffffffff
- field public static final int PLAYBACK_SPEED_NORMAL = 1; // 0x1
- field public static final int PLAYBACK_SPEED_PAUSED = 0; // 0x0
- }
-
- public abstract class PlaybackGlue {
- ctor public PlaybackGlue(android.content.Context!);
- method public void addPlayerCallback(androidx.leanback.media.PlaybackGlue.PlayerCallback!);
- method public android.content.Context! getContext();
- method public androidx.leanback.media.PlaybackGlueHost! getHost();
- method protected java.util.List<androidx.leanback.media.PlaybackGlue.PlayerCallback>! getPlayerCallbacks();
- method public boolean isPlaying();
- method public boolean isPrepared();
- method public void next();
- method @CallSuper protected void onAttachedToHost(androidx.leanback.media.PlaybackGlueHost!);
- method @CallSuper protected void onDetachedFromHost();
- method protected void onHostPause();
- method protected void onHostResume();
- method protected void onHostStart();
- method protected void onHostStop();
- method public void pause();
- method public void play();
- method public void playWhenPrepared();
- method public void previous();
- method public void removePlayerCallback(androidx.leanback.media.PlaybackGlue.PlayerCallback!);
- method public final void setHost(androidx.leanback.media.PlaybackGlueHost!);
- }
-
- public abstract static class PlaybackGlue.PlayerCallback {
- ctor public PlaybackGlue.PlayerCallback();
- method public void onPlayCompleted(androidx.leanback.media.PlaybackGlue!);
- method public void onPlayStateChanged(androidx.leanback.media.PlaybackGlue!);
- method public void onPreparedStateChanged(androidx.leanback.media.PlaybackGlue!);
- }
-
- public abstract class PlaybackGlueHost {
- ctor public PlaybackGlueHost();
- method @Deprecated public void fadeOut();
- method public androidx.leanback.media.PlaybackGlueHost.PlayerCallback! getPlayerCallback();
- method public void hideControlsOverlay(boolean);
- method public boolean isControlsOverlayAutoHideEnabled();
- method public boolean isControlsOverlayVisible();
- method public void notifyPlaybackRowChanged();
- method public void setControlsOverlayAutoHideEnabled(boolean);
- method @Deprecated public void setFadingEnabled(boolean);
- method public void setHostCallback(androidx.leanback.media.PlaybackGlueHost.HostCallback!);
- method public void setOnActionClickedListener(androidx.leanback.widget.OnActionClickedListener!);
- method public void setOnKeyInterceptListener(android.view.View.OnKeyListener!);
- method public void setPlaybackRow(androidx.leanback.widget.Row!);
- method public void setPlaybackRowPresenter(androidx.leanback.widget.PlaybackRowPresenter!);
- method public void showControlsOverlay(boolean);
- }
-
- public abstract static class PlaybackGlueHost.HostCallback {
- ctor public PlaybackGlueHost.HostCallback();
- method public void onHostDestroy();
- method public void onHostPause();
- method public void onHostResume();
- method public void onHostStart();
- method public void onHostStop();
- }
-
- public static class PlaybackGlueHost.PlayerCallback {
- ctor public PlaybackGlueHost.PlayerCallback();
- method public void onBufferingStateChanged(boolean);
- method public void onError(int, CharSequence!);
- method public void onVideoSizeChanged(int, int);
- }
-
- public class PlaybackTransportControlGlue<T extends androidx.leanback.media.PlayerAdapter> extends androidx.leanback.media.PlaybackBaseControlGlue<T> {
- ctor public PlaybackTransportControlGlue(android.content.Context!, T!);
- method public final androidx.leanback.widget.PlaybackSeekDataProvider! getSeekProvider();
- method public final boolean isSeekEnabled();
- method public void onActionClicked(androidx.leanback.widget.Action!);
- method protected androidx.leanback.widget.PlaybackRowPresenter! onCreateRowPresenter();
- method public boolean onKey(android.view.View!, int, android.view.KeyEvent!);
- method public final void setSeekEnabled(boolean);
- method public final void setSeekProvider(androidx.leanback.widget.PlaybackSeekDataProvider!);
- }
-
- public abstract class PlayerAdapter {
- ctor public PlayerAdapter();
- method public void fastForward();
- method public long getBufferedPosition();
- method public final androidx.leanback.media.PlayerAdapter.Callback! getCallback();
- method public long getCurrentPosition();
- method public long getDuration();
- method public long getSupportedActions();
- method public boolean isPlaying();
- method public boolean isPrepared();
- method public void next();
- method public void onAttachedToHost(androidx.leanback.media.PlaybackGlueHost!);
- method public void onDetachedFromHost();
- method public abstract void pause();
- method public abstract void play();
- method public void previous();
- method public void rewind();
- method public void seekTo(long);
- method public final void setCallback(androidx.leanback.media.PlayerAdapter.Callback!);
- method public void setProgressUpdatingEnabled(boolean);
- method public void setRepeatAction(int);
- method public void setShuffleAction(int);
- }
-
- public static class PlayerAdapter.Callback {
- ctor public PlayerAdapter.Callback();
- method public void onBufferedPositionChanged(androidx.leanback.media.PlayerAdapter!);
- method public void onBufferingStateChanged(androidx.leanback.media.PlayerAdapter!, boolean);
- method public void onCurrentPositionChanged(androidx.leanback.media.PlayerAdapter!);
- method public void onDurationChanged(androidx.leanback.media.PlayerAdapter!);
- method public void onError(androidx.leanback.media.PlayerAdapter!, int, String!);
- method public void onMetadataChanged(androidx.leanback.media.PlayerAdapter!);
- method public void onPlayCompleted(androidx.leanback.media.PlayerAdapter!);
- method public void onPlayStateChanged(androidx.leanback.media.PlayerAdapter!);
- method public void onPreparedStateChanged(androidx.leanback.media.PlayerAdapter!);
- method public void onVideoSizeChanged(androidx.leanback.media.PlayerAdapter!, int, int);
- }
-
- public interface SurfaceHolderGlueHost {
- method public void setSurfaceHolderCallback(android.view.SurfaceHolder.Callback!);
- }
-
-}
-
-package androidx.leanback.system {
-
- public class Settings {
- method public boolean getBoolean(String!);
- method public static androidx.leanback.system.Settings! getInstance(android.content.Context!);
- method public void setBoolean(String!, boolean);
- field public static final String OUTLINE_CLIPPING_DISABLED = "OUTLINE_CLIPPING_DISABLED";
- field public static final String PREFER_STATIC_SHADOWS = "PREFER_STATIC_SHADOWS";
- }
-
-}
-
-package androidx.leanback.widget {
-
- public abstract class AbstractDetailsDescriptionPresenter extends androidx.leanback.widget.Presenter {
- ctor public AbstractDetailsDescriptionPresenter();
- method protected abstract void onBindDescription(androidx.leanback.widget.AbstractDetailsDescriptionPresenter.ViewHolder!, Object!);
- method public final void onBindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!, Object!);
- method public final androidx.leanback.widget.AbstractDetailsDescriptionPresenter.ViewHolder! onCreateViewHolder(android.view.ViewGroup!);
- method public void onUnbindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!);
- }
-
- public static class AbstractDetailsDescriptionPresenter.ViewHolder extends androidx.leanback.widget.Presenter.ViewHolder {
- ctor public AbstractDetailsDescriptionPresenter.ViewHolder(android.view.View!);
- method public android.widget.TextView! getBody();
- method public android.widget.TextView! getSubtitle();
- method public android.widget.TextView! getTitle();
- }
-
- public abstract class AbstractMediaItemPresenter extends androidx.leanback.widget.RowPresenter {
- ctor public AbstractMediaItemPresenter();
- ctor public AbstractMediaItemPresenter(int);
- method protected androidx.leanback.widget.RowPresenter.ViewHolder! createRowViewHolder(android.view.ViewGroup!);
- method public androidx.leanback.widget.Presenter! getActionPresenter();
- method protected int getMediaPlayState(Object!);
- method public int getThemeId();
- method public boolean hasMediaRowSeparator();
- method protected abstract void onBindMediaDetails(androidx.leanback.widget.AbstractMediaItemPresenter.ViewHolder!, Object!);
- method public void onBindMediaPlayState(androidx.leanback.widget.AbstractMediaItemPresenter.ViewHolder!);
- method protected void onBindRowActions(androidx.leanback.widget.AbstractMediaItemPresenter.ViewHolder!);
- method protected void onUnbindMediaDetails(androidx.leanback.widget.AbstractMediaItemPresenter.ViewHolder!);
- method public void onUnbindMediaPlayState(androidx.leanback.widget.AbstractMediaItemPresenter.ViewHolder!);
- method public void setActionPresenter(androidx.leanback.widget.Presenter!);
- method public void setBackgroundColor(int);
- method public void setHasMediaRowSeparator(boolean);
- method public void setThemeId(int);
- field public static final int PLAY_STATE_INITIAL = 0; // 0x0
- field public static final int PLAY_STATE_PAUSED = 1; // 0x1
- field public static final int PLAY_STATE_PLAYING = 2; // 0x2
- }
-
- public static class AbstractMediaItemPresenter.ViewHolder extends androidx.leanback.widget.RowPresenter.ViewHolder {
- ctor public AbstractMediaItemPresenter.ViewHolder(android.view.View!);
- method public android.view.ViewGroup! getMediaItemActionsContainer();
- method public android.view.View! getMediaItemDetailsView();
- method public android.widget.TextView! getMediaItemDurationView();
- method public android.widget.TextView! getMediaItemNameView();
- method public android.widget.TextView! getMediaItemNumberView();
- method public android.widget.ViewFlipper! getMediaItemNumberViewFlipper();
- method public android.view.View! getMediaItemPausedView();
- method public android.view.View! getMediaItemPlayingView();
- method public androidx.leanback.widget.MultiActionsProvider.MultiAction[]! getMediaItemRowActions();
- method public android.view.View! getMediaItemRowSeparator();
- method public android.view.View! getSelectorView();
- method public void notifyActionChanged(androidx.leanback.widget.MultiActionsProvider.MultiAction!);
- method public void notifyDetailsChanged();
- method public void notifyPlayStateChanged();
- method public void onBindRowActions();
- method public void setSelectedMediaItemNumberView(int);
- }
-
- public abstract class AbstractMediaListHeaderPresenter extends androidx.leanback.widget.RowPresenter {
- ctor public AbstractMediaListHeaderPresenter(android.content.Context!, int);
- ctor public AbstractMediaListHeaderPresenter();
- method protected androidx.leanback.widget.RowPresenter.ViewHolder! createRowViewHolder(android.view.ViewGroup!);
- method protected abstract void onBindMediaListHeaderViewHolder(androidx.leanback.widget.AbstractMediaListHeaderPresenter.ViewHolder!, Object!);
- method public void setBackgroundColor(int);
- }
-
- public static class AbstractMediaListHeaderPresenter.ViewHolder extends androidx.leanback.widget.RowPresenter.ViewHolder {
- ctor public AbstractMediaListHeaderPresenter.ViewHolder(android.view.View!);
- method public android.widget.TextView! getHeaderView();
- }
-
- public class Action {
- ctor public Action(long);
- ctor public Action(long, CharSequence!);
- ctor public Action(long, CharSequence!, CharSequence!);
- ctor public Action(long, CharSequence!, CharSequence!, android.graphics.drawable.Drawable!);
- method public final void addKeyCode(int);
- method public final android.graphics.drawable.Drawable! getIcon();
- method public final long getId();
- method public final CharSequence! getLabel1();
- method public final CharSequence! getLabel2();
- method public final void removeKeyCode(int);
- method public final boolean respondsToKeyCode(int);
- method public final void setIcon(android.graphics.drawable.Drawable!);
- method public final void setId(long);
- method public final void setLabel1(CharSequence!);
- method public final void setLabel2(CharSequence!);
- field public static final long NO_ID = -1L; // 0xffffffffffffffffL
- }
-
- public class ArrayObjectAdapter extends androidx.leanback.widget.ObjectAdapter {
- ctor public ArrayObjectAdapter(androidx.leanback.widget.PresenterSelector!);
- ctor public ArrayObjectAdapter(androidx.leanback.widget.Presenter!);
- ctor public ArrayObjectAdapter();
- method public void add(Object!);
- method public void add(int, Object!);
- method public void addAll(int, java.util.Collection!);
- method public void clear();
- method public Object! get(int);
- method public int indexOf(Object!);
- method public void move(int, int);
- method public void notifyArrayItemRangeChanged(int, int);
- method public boolean remove(Object!);
- method public int removeItems(int, int);
- method public void replace(int, Object!);
- method public void setItems(java.util.List!, androidx.leanback.widget.DiffCallback!);
- method public int size();
- method public <E> java.util.List<E>! unmodifiableList();
- }
-
- public class BaseCardView extends android.widget.FrameLayout {
- ctor public BaseCardView(android.content.Context!);
- ctor public BaseCardView(android.content.Context!, android.util.AttributeSet!);
- ctor public BaseCardView(android.content.Context!, android.util.AttributeSet!, int);
- method protected androidx.leanback.widget.BaseCardView.LayoutParams! generateDefaultLayoutParams();
- method public androidx.leanback.widget.BaseCardView.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
- method protected androidx.leanback.widget.BaseCardView.LayoutParams! generateLayoutParams(android.view.ViewGroup.LayoutParams!);
- method public int getCardType();
- method @Deprecated public int getExtraVisibility();
- method public int getInfoVisibility();
- method public boolean isSelectedAnimationDelayed();
- method public void setCardType(int);
- method @Deprecated public void setExtraVisibility(int);
- method public void setInfoVisibility(int);
- method public void setSelectedAnimationDelayed(boolean);
- field public static final int CARD_REGION_VISIBLE_ACTIVATED = 1; // 0x1
- field public static final int CARD_REGION_VISIBLE_ALWAYS = 0; // 0x0
- field public static final int CARD_REGION_VISIBLE_SELECTED = 2; // 0x2
- field public static final int CARD_TYPE_INFO_OVER = 1; // 0x1
- field public static final int CARD_TYPE_INFO_UNDER = 2; // 0x2
- field public static final int CARD_TYPE_INFO_UNDER_WITH_EXTRA = 3; // 0x3
- field public static final int CARD_TYPE_MAIN_ONLY = 0; // 0x0
- }
-
- public static class BaseCardView.LayoutParams extends android.widget.FrameLayout.LayoutParams {
- ctor public BaseCardView.LayoutParams(android.content.Context!, android.util.AttributeSet!);
- ctor public BaseCardView.LayoutParams(int, int);
- ctor public BaseCardView.LayoutParams(android.view.ViewGroup.LayoutParams!);
- ctor public BaseCardView.LayoutParams(androidx.leanback.widget.BaseCardView.LayoutParams!);
- field public static final int VIEW_TYPE_EXTRA = 2; // 0x2
- field public static final int VIEW_TYPE_INFO = 1; // 0x1
- field public static final int VIEW_TYPE_MAIN = 0; // 0x0
- field @android.view.ViewDebug.ExportedProperty(category="layout", mapping={@android.view.ViewDebug.IntToString(from=androidx.leanback.widget.BaseCardView.LayoutParams.VIEW_TYPE_MAIN, to="MAIN"), @android.view.ViewDebug.IntToString(from=androidx.leanback.widget.BaseCardView.LayoutParams.VIEW_TYPE_INFO, to="INFO"), @android.view.ViewDebug.IntToString(from=androidx.leanback.widget.BaseCardView.LayoutParams.VIEW_TYPE_EXTRA, to="EXTRA")}) public int viewType;
- }
-
- public abstract class BaseGridView extends androidx.recyclerview.widget.RecyclerView {
- method public void addOnChildViewHolderSelectedListener(androidx.leanback.widget.OnChildViewHolderSelectedListener!);
- method public void animateIn();
- method public void animateOut();
- method public int getChildDrawingOrder(int, int);
- method @Deprecated public int getHorizontalMargin();
- method public int getHorizontalSpacing();
- method public int getInitialPrefetchItemCount();
- method public int getItemAlignmentOffset();
- method public float getItemAlignmentOffsetPercent();
- method public int getItemAlignmentViewId();
- method public androidx.leanback.widget.BaseGridView.OnUnhandledKeyListener! getOnUnhandledKeyListener();
- method public final int getSaveChildrenLimitNumber();
- method public final int getSaveChildrenPolicy();
- method public int getSelectedPosition();
- method @Deprecated public int getVerticalMargin();
- method public int getVerticalSpacing();
- method public void getViewSelectedOffsets(android.view.View!, int[]!);
- method public int getWindowAlignment();
- method public int getWindowAlignmentOffset();
- method public float getWindowAlignmentOffsetPercent();
- method public boolean hasPreviousViewInSameRow(int);
- method public boolean isChildLayoutAnimated();
- method public boolean isFocusDrawingOrderEnabled();
- method public final boolean isFocusSearchDisabled();
- method public boolean isItemAlignmentOffsetWithPadding();
- method public boolean isScrollEnabled();
- method public boolean isWindowAlignmentPreferKeyLineOverHighEdge();
- method public boolean isWindowAlignmentPreferKeyLineOverLowEdge();
- method public boolean onRequestFocusInDescendants(int, android.graphics.Rect!);
- method public void removeOnChildViewHolderSelectedListener(androidx.leanback.widget.OnChildViewHolderSelectedListener!);
- method public void setAnimateChildLayout(boolean);
- method public void setChildrenVisibility(int);
- method public void setFocusDrawingOrderEnabled(boolean);
- method public final void setFocusSearchDisabled(boolean);
- method public void setGravity(int);
- method public void setHasOverlappingRendering(boolean);
- method @Deprecated public void setHorizontalMargin(int);
- method public void setHorizontalSpacing(int);
- method public void setInitialPrefetchItemCount(int);
- method public void setItemAlignmentOffset(int);
- method public void setItemAlignmentOffsetPercent(float);
- method public void setItemAlignmentOffsetWithPadding(boolean);
- method public void setItemAlignmentViewId(int);
- method @Deprecated public void setItemMargin(int);
- method public void setItemSpacing(int);
- method public void setLayoutEnabled(boolean);
- method public void setOnChildLaidOutListener(androidx.leanback.widget.OnChildLaidOutListener!);
- method public void setOnChildSelectedListener(androidx.leanback.widget.OnChildSelectedListener!);
- method public void setOnChildViewHolderSelectedListener(androidx.leanback.widget.OnChildViewHolderSelectedListener!);
- method public void setOnKeyInterceptListener(androidx.leanback.widget.BaseGridView.OnKeyInterceptListener!);
- method public void setOnMotionInterceptListener(androidx.leanback.widget.BaseGridView.OnMotionInterceptListener!);
- method public void setOnTouchInterceptListener(androidx.leanback.widget.BaseGridView.OnTouchInterceptListener!);
- method public void setOnUnhandledKeyListener(androidx.leanback.widget.BaseGridView.OnUnhandledKeyListener!);
- method public void setPruneChild(boolean);
- method public final void setSaveChildrenLimitNumber(int);
- method public final void setSaveChildrenPolicy(int);
- method public void setScrollEnabled(boolean);
- method public void setSelectedPosition(int);
- method public void setSelectedPosition(int, int);
- method public void setSelectedPosition(int, androidx.leanback.widget.ViewHolderTask!);
- method public void setSelectedPositionSmooth(int);
- method public void setSelectedPositionSmooth(int, androidx.leanback.widget.ViewHolderTask!);
- method @Deprecated public void setVerticalMargin(int);
- method public void setVerticalSpacing(int);
- method public void setWindowAlignment(int);
- method public void setWindowAlignmentOffset(int);
- method public void setWindowAlignmentOffsetPercent(float);
- method public void setWindowAlignmentPreferKeyLineOverHighEdge(boolean);
- method public void setWindowAlignmentPreferKeyLineOverLowEdge(boolean);
- field public static final float ITEM_ALIGN_OFFSET_PERCENT_DISABLED = -1.0f;
- field public static final int SAVE_ALL_CHILD = 3; // 0x3
- field public static final int SAVE_LIMITED_CHILD = 2; // 0x2
- field public static final int SAVE_NO_CHILD = 0; // 0x0
- field public static final int SAVE_ON_SCREEN_CHILD = 1; // 0x1
- field public static final int WINDOW_ALIGN_BOTH_EDGE = 3; // 0x3
- field public static final int WINDOW_ALIGN_HIGH_EDGE = 2; // 0x2
- field public static final int WINDOW_ALIGN_LOW_EDGE = 1; // 0x1
- field public static final int WINDOW_ALIGN_NO_EDGE = 0; // 0x0
- field public static final float WINDOW_ALIGN_OFFSET_PERCENT_DISABLED = -1.0f;
- }
-
- public static interface BaseGridView.OnKeyInterceptListener {
- method public boolean onInterceptKeyEvent(android.view.KeyEvent!);
- }
-
- public static interface BaseGridView.OnMotionInterceptListener {
- method public boolean onInterceptMotionEvent(android.view.MotionEvent!);
- }
-
- public static interface BaseGridView.OnTouchInterceptListener {
- method public boolean onInterceptTouchEvent(android.view.MotionEvent!);
- }
-
- public static interface BaseGridView.OnUnhandledKeyListener {
- method public boolean onUnhandledKey(android.view.KeyEvent!);
- }
-
- public interface BaseOnItemViewClickedListener<T> {
- method public void onItemClicked(androidx.leanback.widget.Presenter.ViewHolder!, Object!, androidx.leanback.widget.RowPresenter.ViewHolder!, T!);
- }
-
- public interface BaseOnItemViewSelectedListener<T> {
- method public void onItemSelected(androidx.leanback.widget.Presenter.ViewHolder!, Object!, androidx.leanback.widget.RowPresenter.ViewHolder!, T!);
- }
-
- public class BrowseFrameLayout extends android.widget.FrameLayout {
- ctor public BrowseFrameLayout(android.content.Context!);
- ctor public BrowseFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public BrowseFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- method public androidx.leanback.widget.BrowseFrameLayout.OnChildFocusListener! getOnChildFocusListener();
- method public androidx.leanback.widget.BrowseFrameLayout.OnFocusSearchListener! getOnFocusSearchListener();
- method public void setOnChildFocusListener(androidx.leanback.widget.BrowseFrameLayout.OnChildFocusListener!);
- method public void setOnDispatchKeyListener(android.view.View.OnKeyListener!);
- method public void setOnFocusSearchListener(androidx.leanback.widget.BrowseFrameLayout.OnFocusSearchListener!);
- }
-
- public static interface BrowseFrameLayout.OnChildFocusListener {
- method public void onRequestChildFocus(android.view.View!, android.view.View!);
- method public boolean onRequestFocusInDescendants(int, android.graphics.Rect!);
- }
-
- public static interface BrowseFrameLayout.OnFocusSearchListener {
- method public android.view.View! onFocusSearch(android.view.View!, int);
- }
-
- public final class ClassPresenterSelector extends androidx.leanback.widget.PresenterSelector {
- ctor public ClassPresenterSelector();
- method public androidx.leanback.widget.ClassPresenterSelector! addClassPresenter(Class<?>!, androidx.leanback.widget.Presenter!);
- method public androidx.leanback.widget.ClassPresenterSelector! addClassPresenterSelector(Class<?>!, androidx.leanback.widget.PresenterSelector!);
- method public androidx.leanback.widget.Presenter! getPresenter(Object!);
- }
-
- public class ControlButtonPresenterSelector extends androidx.leanback.widget.PresenterSelector {
- ctor public ControlButtonPresenterSelector();
- method public androidx.leanback.widget.Presenter! getPresenter(Object!);
- method public androidx.leanback.widget.Presenter! getPrimaryPresenter();
- method public androidx.leanback.widget.Presenter! getSecondaryPresenter();
- }
-
- public class CursorObjectAdapter extends androidx.leanback.widget.ObjectAdapter {
- ctor public CursorObjectAdapter(androidx.leanback.widget.PresenterSelector!);
- ctor public CursorObjectAdapter(androidx.leanback.widget.Presenter!);
- ctor public CursorObjectAdapter();
- method public void changeCursor(android.database.Cursor!);
- method public void close();
- method public Object! get(int);
- method public final android.database.Cursor! getCursor();
- method public final androidx.leanback.database.CursorMapper! getMapper();
- method protected final void invalidateCache(int);
- method protected final void invalidateCache(int, int);
- method public boolean isClosed();
- method protected void onCursorChanged();
- method protected void onMapperChanged();
- method public final void setMapper(androidx.leanback.database.CursorMapper!);
- method public int size();
- method public android.database.Cursor! swapCursor(android.database.Cursor!);
- }
-
- public class DetailsOverviewLogoPresenter extends androidx.leanback.widget.Presenter {
- ctor public DetailsOverviewLogoPresenter();
- method public boolean isBoundToImage(androidx.leanback.widget.DetailsOverviewLogoPresenter.ViewHolder!, androidx.leanback.widget.DetailsOverviewRow!);
- method public void onBindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!, Object!);
- method public android.view.View! onCreateView(android.view.ViewGroup!);
- method public androidx.leanback.widget.Presenter.ViewHolder! onCreateViewHolder(android.view.ViewGroup!);
- method public void onUnbindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!);
- method public void setContext(androidx.leanback.widget.DetailsOverviewLogoPresenter.ViewHolder!, androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!, androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter!);
- }
-
- public static class DetailsOverviewLogoPresenter.ViewHolder extends androidx.leanback.widget.Presenter.ViewHolder {
- ctor public DetailsOverviewLogoPresenter.ViewHolder(android.view.View!);
- method public androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter! getParentPresenter();
- method public androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder! getParentViewHolder();
- method public boolean isSizeFromDrawableIntrinsic();
- method public void setSizeFromDrawableIntrinsic(boolean);
- field protected androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter! mParentPresenter;
- field protected androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder! mParentViewHolder;
- }
-
- public class DetailsOverviewRow extends androidx.leanback.widget.Row {
- ctor public DetailsOverviewRow(Object!);
- method @Deprecated public final void addAction(androidx.leanback.widget.Action!);
- method @Deprecated public final void addAction(int, androidx.leanback.widget.Action!);
- method public androidx.leanback.widget.Action! getActionForKeyCode(int);
- method @Deprecated public final java.util.List<androidx.leanback.widget.Action>! getActions();
- method public final androidx.leanback.widget.ObjectAdapter! getActionsAdapter();
- method public final android.graphics.drawable.Drawable! getImageDrawable();
- method public final Object! getItem();
- method public boolean isImageScaleUpAllowed();
- method @Deprecated public final boolean removeAction(androidx.leanback.widget.Action!);
- method public final void setActionsAdapter(androidx.leanback.widget.ObjectAdapter!);
- method public final void setImageBitmap(android.content.Context!, android.graphics.Bitmap!);
- method public final void setImageDrawable(android.graphics.drawable.Drawable!);
- method public void setImageScaleUpAllowed(boolean);
- method public final void setItem(Object!);
- }
-
- public static class DetailsOverviewRow.Listener {
- ctor public DetailsOverviewRow.Listener();
- method public void onActionsAdapterChanged(androidx.leanback.widget.DetailsOverviewRow!);
- method public void onImageDrawableChanged(androidx.leanback.widget.DetailsOverviewRow!);
- method public void onItemChanged(androidx.leanback.widget.DetailsOverviewRow!);
- }
-
- @Deprecated public class DetailsOverviewRowPresenter extends androidx.leanback.widget.RowPresenter {
- ctor @Deprecated public DetailsOverviewRowPresenter(androidx.leanback.widget.Presenter!);
- method @Deprecated protected androidx.leanback.widget.RowPresenter.ViewHolder! createRowViewHolder(android.view.ViewGroup!);
- method @Deprecated @ColorInt public int getBackgroundColor();
- method @Deprecated public androidx.leanback.widget.OnActionClickedListener! getOnActionClickedListener();
- method @Deprecated public boolean isStyleLarge();
- method @Deprecated public final boolean isUsingDefaultSelectEffect();
- method @Deprecated public void setBackgroundColor(@ColorInt int);
- method @Deprecated public void setOnActionClickedListener(androidx.leanback.widget.OnActionClickedListener!);
- method @Deprecated public final void setSharedElementEnterTransition(android.app.Activity!, String!, long);
- method @Deprecated public final void setSharedElementEnterTransition(android.app.Activity!, String!);
- method @Deprecated public void setStyleLarge(boolean);
- }
-
- @Deprecated public final class DetailsOverviewRowPresenter.ViewHolder extends androidx.leanback.widget.RowPresenter.ViewHolder {
- ctor @Deprecated public DetailsOverviewRowPresenter.ViewHolder(android.view.View!, androidx.leanback.widget.Presenter!);
- field @Deprecated public final androidx.leanback.widget.Presenter.ViewHolder! mDetailsDescriptionViewHolder;
- }
-
- public class DetailsParallax extends androidx.leanback.widget.RecyclerViewParallax {
- ctor public DetailsParallax();
- method public androidx.leanback.widget.Parallax.IntProperty! getOverviewRowBottom();
- method public androidx.leanback.widget.Parallax.IntProperty! getOverviewRowTop();
- }
-
- public abstract class DiffCallback<Value> {
- ctor public DiffCallback();
- method public abstract boolean areContentsTheSame(Value, Value);
- method public abstract boolean areItemsTheSame(Value, Value);
- method public Object! getChangePayload(Value, Value);
- }
-
- public class DividerPresenter extends androidx.leanback.widget.Presenter {
- ctor public DividerPresenter();
- method public void onBindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!, Object!);
- method public androidx.leanback.widget.Presenter.ViewHolder! onCreateViewHolder(android.view.ViewGroup!);
- method public void onUnbindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!);
- }
-
- public class DividerRow extends androidx.leanback.widget.Row {
- ctor public DividerRow();
- method public final boolean isRenderedAsRowView();
- }
-
- public interface FacetProvider {
- method public Object! getFacet(Class<?>!);
- }
-
- public interface FacetProviderAdapter {
- method public androidx.leanback.widget.FacetProvider! getFacetProvider(int);
- }
-
- public interface FocusHighlight {
- field public static final int ZOOM_FACTOR_LARGE = 3; // 0x3
- field public static final int ZOOM_FACTOR_MEDIUM = 2; // 0x2
- field public static final int ZOOM_FACTOR_NONE = 0; // 0x0
- field public static final int ZOOM_FACTOR_SMALL = 1; // 0x1
- field public static final int ZOOM_FACTOR_XSMALL = 4; // 0x4
- }
-
- public class FocusHighlightHelper {
- ctor @Deprecated public FocusHighlightHelper();
- method public static void setupBrowseItemFocusHighlight(androidx.leanback.widget.ItemBridgeAdapter!, int, boolean);
- method @Deprecated public static void setupHeaderItemFocusHighlight(androidx.leanback.widget.VerticalGridView!);
- method @Deprecated public static void setupHeaderItemFocusHighlight(androidx.leanback.widget.VerticalGridView!, boolean);
- method public static void setupHeaderItemFocusHighlight(androidx.leanback.widget.ItemBridgeAdapter!);
- method public static void setupHeaderItemFocusHighlight(androidx.leanback.widget.ItemBridgeAdapter!, boolean);
- }
-
- public interface FragmentAnimationProvider {
- method public void onImeAppearing(java.util.List<android.animation.Animator>);
- method public void onImeDisappearing(java.util.List<android.animation.Animator>);
- }
-
- public class FullWidthDetailsOverviewRowPresenter extends androidx.leanback.widget.RowPresenter {
- ctor public FullWidthDetailsOverviewRowPresenter(androidx.leanback.widget.Presenter!);
- ctor public FullWidthDetailsOverviewRowPresenter(androidx.leanback.widget.Presenter!, androidx.leanback.widget.DetailsOverviewLogoPresenter!);
- method protected androidx.leanback.widget.RowPresenter.ViewHolder! createRowViewHolder(android.view.ViewGroup!);
- method public final int getActionsBackgroundColor();
- method public final int getAlignmentMode();
- method public final int getBackgroundColor();
- method public final int getInitialState();
- method protected int getLayoutResourceId();
- method public androidx.leanback.widget.OnActionClickedListener! getOnActionClickedListener();
- method public final boolean isParticipatingEntranceTransition();
- method public final boolean isUsingDefaultSelectEffect();
- method public final void notifyOnBindLogo(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!);
- method protected void onLayoutLogo(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!, int, boolean);
- method protected void onLayoutOverviewFrame(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!, int, boolean);
- method protected void onStateChanged(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!, int);
- method public final void setActionsBackgroundColor(int);
- method public final void setAlignmentMode(int);
- method public final void setBackgroundColor(int);
- method public final void setInitialState(int);
- method public final void setListener(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.Listener!);
- method public void setOnActionClickedListener(androidx.leanback.widget.OnActionClickedListener!);
- method public final void setParticipatingEntranceTransition(boolean);
- method public final void setState(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!, int);
- field public static final int ALIGN_MODE_MIDDLE = 1; // 0x1
- field public static final int ALIGN_MODE_START = 0; // 0x0
- field public static final int STATE_FULL = 1; // 0x1
- field public static final int STATE_HALF = 0; // 0x0
- field public static final int STATE_SMALL = 2; // 0x2
- field protected int mInitialState;
- }
-
- public abstract static class FullWidthDetailsOverviewRowPresenter.Listener {
- ctor public FullWidthDetailsOverviewRowPresenter.Listener();
- method public void onBindLogo(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!);
- }
-
- public class FullWidthDetailsOverviewRowPresenter.ViewHolder extends androidx.leanback.widget.RowPresenter.ViewHolder {
- ctor public FullWidthDetailsOverviewRowPresenter.ViewHolder(android.view.View!, androidx.leanback.widget.Presenter!, androidx.leanback.widget.DetailsOverviewLogoPresenter!);
- method protected androidx.leanback.widget.DetailsOverviewRow.Listener! createRowListener();
- method public final android.view.ViewGroup! getActionsRow();
- method public final android.view.ViewGroup! getDetailsDescriptionFrame();
- method public final androidx.leanback.widget.Presenter.ViewHolder! getDetailsDescriptionViewHolder();
- method public final androidx.leanback.widget.DetailsOverviewLogoPresenter.ViewHolder! getLogoViewHolder();
- method public final android.view.ViewGroup! getOverviewView();
- method public final int getState();
- field protected final androidx.leanback.widget.DetailsOverviewRow.Listener! mRowListener;
- }
-
- public class FullWidthDetailsOverviewRowPresenter.ViewHolder.DetailsOverviewRowListener extends androidx.leanback.widget.DetailsOverviewRow.Listener {
- ctor public FullWidthDetailsOverviewRowPresenter.ViewHolder.DetailsOverviewRowListener();
- }
-
- public class FullWidthDetailsOverviewSharedElementHelper extends androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.Listener {
- ctor public FullWidthDetailsOverviewSharedElementHelper();
- method public boolean getAutoStartSharedElementTransition();
- method public void setAutoStartSharedElementTransition(boolean);
- method public void setSharedElementEnterTransition(android.app.Activity!, String!);
- method public void setSharedElementEnterTransition(android.app.Activity!, String!, long);
- method public void startPostponedEnterTransition();
- }
-
- public class GuidanceStylist implements androidx.leanback.widget.FragmentAnimationProvider {
- ctor public GuidanceStylist();
- method public android.widget.TextView! getBreadcrumbView();
- method public android.widget.TextView! getDescriptionView();
- method public android.widget.ImageView! getIconView();
- method public android.widget.TextView! getTitleView();
- method public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, androidx.leanback.widget.GuidanceStylist.Guidance!);
- method public void onDestroyView();
- method public void onImeAppearing(java.util.List<android.animation.Animator>);
- method public void onImeDisappearing(java.util.List<android.animation.Animator>);
- method public int onProvideLayoutId();
- }
-
- public static class GuidanceStylist.Guidance {
- ctor public GuidanceStylist.Guidance(String!, String!, String!, android.graphics.drawable.Drawable!);
- method public String! getBreadcrumb();
- method public String! getDescription();
- method public android.graphics.drawable.Drawable! getIconDrawable();
- method public String! getTitle();
- }
-
- public class GuidedAction extends androidx.leanback.widget.Action {
- ctor protected GuidedAction();
- method public String[]! getAutofillHints();
- method public int getCheckSetId();
- method public CharSequence! getDescription();
- method public int getDescriptionEditInputType();
- method public int getDescriptionInputType();
- method public CharSequence! getEditDescription();
- method public int getEditInputType();
- method public CharSequence! getEditTitle();
- method public int getInputType();
- method public android.content.Intent! getIntent();
- method public java.util.List<androidx.leanback.widget.GuidedAction>! getSubActions();
- method public CharSequence! getTitle();
- method public boolean hasEditableActivatorView();
- method public boolean hasMultilineDescription();
- method public boolean hasNext();
- method public boolean hasSubActions();
- method public boolean hasTextEditable();
- method public boolean infoOnly();
- method public final boolean isAutoSaveRestoreEnabled();
- method public boolean isChecked();
- method public boolean isDescriptionEditable();
- method public boolean isEditTitleUsed();
- method public boolean isEditable();
- method public boolean isEnabled();
- method public boolean isFocusable();
- method public void onRestoreInstanceState(android.os.Bundle!, String!);
- method public void onSaveInstanceState(android.os.Bundle!, String!);
- method public void setChecked(boolean);
- method public void setDescription(CharSequence!);
- method public void setEditDescription(CharSequence!);
- method public void setEditTitle(CharSequence!);
- method public void setEnabled(boolean);
- method public void setFocusable(boolean);
- method public void setIntent(android.content.Intent!);
- method public void setSubActions(java.util.List<androidx.leanback.widget.GuidedAction>!);
- method public void setTitle(CharSequence!);
- field public static final long ACTION_ID_CANCEL = -5L; // 0xfffffffffffffffbL
- field public static final long ACTION_ID_CONTINUE = -7L; // 0xfffffffffffffff9L
- field public static final long ACTION_ID_CURRENT = -3L; // 0xfffffffffffffffdL
- field public static final long ACTION_ID_FINISH = -6L; // 0xfffffffffffffffaL
- field public static final long ACTION_ID_NEXT = -2L; // 0xfffffffffffffffeL
- field public static final long ACTION_ID_NO = -9L; // 0xfffffffffffffff7L
- field public static final long ACTION_ID_OK = -4L; // 0xfffffffffffffffcL
- field public static final long ACTION_ID_YES = -8L; // 0xfffffffffffffff8L
- field public static final int CHECKBOX_CHECK_SET_ID = -1; // 0xffffffff
- field public static final int DEFAULT_CHECK_SET_ID = 1; // 0x1
- field public static final int NO_CHECK_SET = 0; // 0x0
- }
-
- public static class GuidedAction.Builder extends androidx.leanback.widget.GuidedAction.BuilderBase<androidx.leanback.widget.GuidedAction.Builder> {
- ctor @Deprecated public GuidedAction.Builder();
- ctor public GuidedAction.Builder(android.content.Context!);
- method public androidx.leanback.widget.GuidedAction! build();
- }
-
- public abstract static class GuidedAction.BuilderBase<B extends androidx.leanback.widget.GuidedAction.BuilderBase> {
- ctor public GuidedAction.BuilderBase(android.content.Context!);
- method protected final void applyValues(androidx.leanback.widget.GuidedAction!);
- method public B! autoSaveRestoreEnabled(boolean);
- method public B! autofillHints(java.lang.String...!);
- method public B! checkSetId(int);
- method public B! checked(boolean);
- method public B! clickAction(long);
- method public B! description(CharSequence!);
- method public B! description(@StringRes int);
- method public B! descriptionEditInputType(int);
- method public B! descriptionEditable(boolean);
- method public B! descriptionInputType(int);
- method public B! editDescription(CharSequence!);
- method public B! editDescription(@StringRes int);
- method public B! editInputType(int);
- method public B! editTitle(CharSequence!);
- method public B! editTitle(@StringRes int);
- method public B! editable(boolean);
- method public B! enabled(boolean);
- method public B! focusable(boolean);
- method public android.content.Context! getContext();
- method public B! hasEditableActivatorView(boolean);
- method public B! hasNext(boolean);
- method public B! icon(android.graphics.drawable.Drawable!);
- method public B! icon(@DrawableRes int);
- method @Deprecated public B! iconResourceId(@DrawableRes int, android.content.Context!);
- method public B! id(long);
- method public B! infoOnly(boolean);
- method public B! inputType(int);
- method public B! intent(android.content.Intent!);
- method public B! multilineDescription(boolean);
- method public B! subActions(java.util.List<androidx.leanback.widget.GuidedAction>!);
- method public B! title(CharSequence!);
- method public B! title(@StringRes int);
- }
-
- public interface GuidedActionAutofillSupport {
- method public void setOnAutofillListener(androidx.leanback.widget.GuidedActionAutofillSupport.OnAutofillListener!);
- }
-
- public static interface GuidedActionAutofillSupport.OnAutofillListener {
- method public void onAutofill(android.view.View!);
- }
-
- public class GuidedActionDiffCallback extends androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction> {
- ctor public GuidedActionDiffCallback();
- method public boolean areContentsTheSame(androidx.leanback.widget.GuidedAction, androidx.leanback.widget.GuidedAction);
- method public boolean areItemsTheSame(androidx.leanback.widget.GuidedAction, androidx.leanback.widget.GuidedAction);
- method public static androidx.leanback.widget.GuidedActionDiffCallback! getInstance();
- }
-
- public class GuidedActionEditText extends android.widget.EditText implements androidx.leanback.widget.GuidedActionAutofillSupport androidx.leanback.widget.ImeKeyMonitor {
- ctor public GuidedActionEditText(android.content.Context!);
- ctor public GuidedActionEditText(android.content.Context!, android.util.AttributeSet!);
- ctor public GuidedActionEditText(android.content.Context!, android.util.AttributeSet!, int);
- method public void setImeKeyListener(androidx.leanback.widget.ImeKeyMonitor.ImeKeyListener!);
- method public void setOnAutofillListener(androidx.leanback.widget.GuidedActionAutofillSupport.OnAutofillListener!);
- }
-
- public class GuidedActionsStylist implements androidx.leanback.widget.FragmentAnimationProvider {
- ctor public GuidedActionsStylist();
- method public void collapseAction(boolean);
- method public void expandAction(androidx.leanback.widget.GuidedAction!, boolean);
- method public androidx.leanback.widget.VerticalGridView! getActionsGridView();
- method public androidx.leanback.widget.GuidedAction! getExpandedAction();
- method public int getItemViewType(androidx.leanback.widget.GuidedAction!);
- method public androidx.leanback.widget.VerticalGridView! getSubActionsGridView();
- method public final boolean isBackKeyToCollapseActivatorView();
- method public final boolean isBackKeyToCollapseSubActions();
- method public boolean isButtonActions();
- method public boolean isExpandTransitionSupported();
- method public boolean isExpanded();
- method public boolean isInExpandTransition();
- method public boolean isSubActionsExpanded();
- method public void onAnimateItemChecked(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean);
- method public void onAnimateItemFocused(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean);
- method public void onAnimateItemPressed(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean);
- method public void onAnimateItemPressedCancelled(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void onBindActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onBindCheckMarkView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onBindChevronView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onBindViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!);
- method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder! onCreateViewHolder(android.view.ViewGroup!);
- method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
- method public void onDestroyView();
- method @Deprecated protected void onEditingModeChange(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!, boolean);
- method @CallSuper protected void onEditingModeChange(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, boolean, boolean);
- method public void onImeAppearing(java.util.List<android.animation.Animator>);
- method public void onImeDisappearing(java.util.List<android.animation.Animator>);
- method public int onProvideItemLayoutId();
- method public int onProvideItemLayoutId(int);
- method public int onProvideLayoutId();
- method public boolean onUpdateActivatorView(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method public void onUpdateExpandedViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void openInEditMode(androidx.leanback.widget.GuidedAction!);
- method public void setAsButtonActions();
- method public final void setBackKeyToCollapseActivatorView(boolean);
- method public final void setBackKeyToCollapseSubActions(boolean);
- method @Deprecated public void setEditingMode(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!, boolean);
- method @Deprecated public void setExpandedViewHolder(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method protected void setupImeOptions(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!, androidx.leanback.widget.GuidedAction!);
- method @Deprecated public void startExpandedTransition(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- field public static final int VIEW_TYPE_DATE_PICKER = 1; // 0x1
- field public static final int VIEW_TYPE_DEFAULT = 0; // 0x0
- }
-
- public static class GuidedActionsStylist.ViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements androidx.leanback.widget.FacetProvider {
- ctor public GuidedActionsStylist.ViewHolder(android.view.View!);
- ctor public GuidedActionsStylist.ViewHolder(android.view.View!, boolean);
- method public androidx.leanback.widget.GuidedAction! getAction();
- method public android.widget.ImageView! getCheckmarkView();
- method public android.widget.ImageView! getChevronView();
- method public android.view.View! getContentView();
- method public android.widget.TextView! getDescriptionView();
- method public android.widget.EditText! getEditableDescriptionView();
- method public android.widget.EditText! getEditableTitleView();
- method public android.view.View! getEditingView();
- method public Object! getFacet(Class<?>!);
- method public android.widget.ImageView! getIconView();
- method public android.widget.TextView! getTitleView();
- method public boolean isInEditing();
- method public boolean isInEditingActivatorView();
- method public boolean isInEditingDescription();
- method public boolean isInEditingText();
- method public boolean isInEditingTitle();
- method public boolean isSubAction();
- }
-
- public class GuidedDatePickerAction extends androidx.leanback.widget.GuidedAction {
- ctor public GuidedDatePickerAction();
- method public long getDate();
- method public String! getDatePickerFormat();
- method public long getMaxDate();
- method public long getMinDate();
- method public void setDate(long);
- }
-
- public static final class GuidedDatePickerAction.Builder extends androidx.leanback.widget.GuidedDatePickerAction.BuilderBase<androidx.leanback.widget.GuidedDatePickerAction.Builder> {
- ctor public GuidedDatePickerAction.Builder(android.content.Context!);
- method public androidx.leanback.widget.GuidedDatePickerAction! build();
- }
-
- public abstract static class GuidedDatePickerAction.BuilderBase<B extends androidx.leanback.widget.GuidedDatePickerAction.BuilderBase> extends androidx.leanback.widget.GuidedAction.BuilderBase<B> {
- ctor public GuidedDatePickerAction.BuilderBase(android.content.Context!);
- method protected final void applyDatePickerValues(androidx.leanback.widget.GuidedDatePickerAction!);
- method public B! date(long);
- method public B! datePickerFormat(String!);
- method public B! maxDate(long);
- method public B! minDate(long);
- }
-
- public class HeaderItem {
- ctor public HeaderItem(long, String!);
- ctor public HeaderItem(String!);
- method public CharSequence! getContentDescription();
- method public CharSequence! getDescription();
- method public final long getId();
- method public final String! getName();
- method public void setContentDescription(CharSequence!);
- method public void setDescription(CharSequence!);
- }
-
- public class HorizontalGridView extends androidx.leanback.widget.BaseGridView {
- ctor public HorizontalGridView(android.content.Context!);
- ctor public HorizontalGridView(android.content.Context!, android.util.AttributeSet!);
- ctor public HorizontalGridView(android.content.Context!, android.util.AttributeSet!, int);
- method public final boolean getFadingLeftEdge();
- method public final int getFadingLeftEdgeLength();
- method public final int getFadingLeftEdgeOffset();
- method public final boolean getFadingRightEdge();
- method public final int getFadingRightEdgeLength();
- method public final int getFadingRightEdgeOffset();
- method protected void initAttributes(android.content.Context!, android.util.AttributeSet!);
- method public final void setFadingLeftEdge(boolean);
- method public final void setFadingLeftEdgeLength(int);
- method public final void setFadingLeftEdgeOffset(int);
- method public final void setFadingRightEdge(boolean);
- method public final void setFadingRightEdgeLength(int);
- method public final void setFadingRightEdgeOffset(int);
- method public void setNumRows(int);
- method public void setRowHeight(int);
- }
-
- public final class HorizontalHoverCardSwitcher extends androidx.leanback.widget.PresenterSwitcher {
- ctor public HorizontalHoverCardSwitcher();
- method protected void insertView(android.view.View!);
- method public void select(androidx.leanback.widget.HorizontalGridView!, android.view.View!, Object!);
- }
-
- public class ImageCardView extends androidx.leanback.widget.BaseCardView {
- ctor @Deprecated public ImageCardView(android.content.Context!, int);
- ctor public ImageCardView(android.content.Context!, android.util.AttributeSet!, int);
- ctor public ImageCardView(android.content.Context!);
- ctor public ImageCardView(android.content.Context!, android.util.AttributeSet!);
- method public android.graphics.drawable.Drawable! getBadgeImage();
- method public CharSequence! getContentText();
- method public android.graphics.drawable.Drawable! getInfoAreaBackground();
- method public android.graphics.drawable.Drawable! getMainImage();
- method public final android.widget.ImageView! getMainImageView();
- method public CharSequence! getTitleText();
- method public void setBadgeImage(android.graphics.drawable.Drawable!);
- method public void setContentText(CharSequence!);
- method public void setInfoAreaBackground(android.graphics.drawable.Drawable!);
- method public void setInfoAreaBackgroundColor(@ColorInt int);
- method public void setMainImage(android.graphics.drawable.Drawable!);
- method public void setMainImage(android.graphics.drawable.Drawable!, boolean);
- method public void setMainImageAdjustViewBounds(boolean);
- method public void setMainImageDimensions(int, int);
- method public void setMainImageScaleType(android.widget.ImageView.ScaleType!);
- method public void setTitleText(CharSequence!);
- field public static final int CARD_TYPE_FLAG_CONTENT = 2; // 0x2
- field public static final int CARD_TYPE_FLAG_ICON_LEFT = 8; // 0x8
- field public static final int CARD_TYPE_FLAG_ICON_RIGHT = 4; // 0x4
- field public static final int CARD_TYPE_FLAG_IMAGE_ONLY = 0; // 0x0
- field public static final int CARD_TYPE_FLAG_TITLE = 1; // 0x1
- }
-
- public interface ImeKeyMonitor {
- method public void setImeKeyListener(androidx.leanback.widget.ImeKeyMonitor.ImeKeyListener!);
- }
-
- public static interface ImeKeyMonitor.ImeKeyListener {
- method public boolean onKeyPreIme(android.widget.EditText!, int, android.view.KeyEvent!);
- }
-
- public final class ItemAlignmentFacet {
- ctor public ItemAlignmentFacet();
- method public androidx.leanback.widget.ItemAlignmentFacet.ItemAlignmentDef[]! getAlignmentDefs();
- method public boolean isMultiAlignment();
- method public void setAlignmentDefs(androidx.leanback.widget.ItemAlignmentFacet.ItemAlignmentDef[]!);
- field public static final float ITEM_ALIGN_OFFSET_PERCENT_DISABLED = -1.0f;
- }
-
- public static class ItemAlignmentFacet.ItemAlignmentDef {
- ctor public ItemAlignmentFacet.ItemAlignmentDef();
- method public final int getItemAlignmentFocusViewId();
- method public final int getItemAlignmentOffset();
- method public final float getItemAlignmentOffsetPercent();
- method public final int getItemAlignmentViewId();
- method public boolean isAlignedToTextViewBaseLine();
- method public final boolean isItemAlignmentOffsetWithPadding();
- method public final void setAlignedToTextViewBaseline(boolean);
- method public final void setItemAlignmentFocusViewId(int);
- method public final void setItemAlignmentOffset(int);
- method public final void setItemAlignmentOffsetPercent(float);
- method public final void setItemAlignmentOffsetWithPadding(boolean);
- method public final void setItemAlignmentViewId(int);
- }
-
- public class ItemBridgeAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter implements androidx.leanback.widget.FacetProviderAdapter {
- ctor public ItemBridgeAdapter(androidx.leanback.widget.ObjectAdapter!, androidx.leanback.widget.PresenterSelector!);
- ctor public ItemBridgeAdapter(androidx.leanback.widget.ObjectAdapter!);
- ctor public ItemBridgeAdapter();
- method public void clear();
- method public androidx.leanback.widget.FacetProvider! getFacetProvider(int);
- method public int getItemCount();
- method public java.util.ArrayList<androidx.leanback.widget.Presenter>! getPresenterMapper();
- method public androidx.leanback.widget.ItemBridgeAdapter.Wrapper! getWrapper();
- method protected void onAddPresenter(androidx.leanback.widget.Presenter!, int);
- method protected void onAttachedToWindow(androidx.leanback.widget.ItemBridgeAdapter.ViewHolder!);
- method protected void onBind(androidx.leanback.widget.ItemBridgeAdapter.ViewHolder!);
- method public final void onBindViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder!, int);
- method public final void onBindViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder!, int, java.util.List!);
- method protected void onCreate(androidx.leanback.widget.ItemBridgeAdapter.ViewHolder!);
- method public final androidx.recyclerview.widget.RecyclerView.ViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
- method protected void onDetachedFromWindow(androidx.leanback.widget.ItemBridgeAdapter.ViewHolder!);
- method public final boolean onFailedToRecycleView(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method protected void onUnbind(androidx.leanback.widget.ItemBridgeAdapter.ViewHolder!);
- method public final void onViewAttachedToWindow(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public final void onViewDetachedFromWindow(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public final void onViewRecycled(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
- method public void setAdapterListener(androidx.leanback.widget.ItemBridgeAdapter.AdapterListener!);
- method public void setPresenter(androidx.leanback.widget.PresenterSelector!);
- method public void setPresenterMapper(java.util.ArrayList<androidx.leanback.widget.Presenter>!);
- method public void setWrapper(androidx.leanback.widget.ItemBridgeAdapter.Wrapper!);
- }
-
- public static class ItemBridgeAdapter.AdapterListener {
- ctor public ItemBridgeAdapter.AdapterListener();
- method public void onAddPresenter(androidx.leanback.widget.Presenter!, int);
- method public void onAttachedToWindow(androidx.leanback.widget.ItemBridgeAdapter.ViewHolder!);
- method public void onBind(androidx.leanback.widget.ItemBridgeAdapter.ViewHolder!);
- method public void onBind(androidx.leanback.widget.ItemBridgeAdapter.ViewHolder!, java.util.List!);
- method public void onCreate(androidx.leanback.widget.ItemBridgeAdapter.ViewHolder!);
- method public void onDetachedFromWindow(androidx.leanback.widget.ItemBridgeAdapter.ViewHolder!);
- method public void onUnbind(androidx.leanback.widget.ItemBridgeAdapter.ViewHolder!);
- }
-
- public class ItemBridgeAdapter.ViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder implements androidx.leanback.widget.FacetProvider {
- method public final Object! getExtraObject();
- method public Object! getFacet(Class<?>!);
- method public final Object! getItem();
- method public final androidx.leanback.widget.Presenter! getPresenter();
- method public final androidx.leanback.widget.Presenter.ViewHolder! getViewHolder();
- method public void setExtraObject(Object!);
- }
-
- public abstract static class ItemBridgeAdapter.Wrapper {
- ctor public ItemBridgeAdapter.Wrapper();
- method public abstract android.view.View! createWrapper(android.view.View!);
- method public abstract void wrap(android.view.View!, android.view.View!);
- }
-
- public class ItemBridgeAdapterShadowOverlayWrapper extends androidx.leanback.widget.ItemBridgeAdapter.Wrapper {
- ctor public ItemBridgeAdapterShadowOverlayWrapper(androidx.leanback.widget.ShadowOverlayHelper!);
- method public android.view.View! createWrapper(android.view.View!);
- method public void wrap(android.view.View!, android.view.View!);
- }
-
- public class ListRow extends androidx.leanback.widget.Row {
- ctor public ListRow(androidx.leanback.widget.HeaderItem!, androidx.leanback.widget.ObjectAdapter!);
- ctor public ListRow(long, androidx.leanback.widget.HeaderItem!, androidx.leanback.widget.ObjectAdapter!);
- ctor public ListRow(androidx.leanback.widget.ObjectAdapter!);
- method public final androidx.leanback.widget.ObjectAdapter! getAdapter();
- method public CharSequence! getContentDescription();
- method public void setContentDescription(CharSequence!);
- }
-
- public final class ListRowHoverCardView extends android.widget.LinearLayout {
- ctor public ListRowHoverCardView(android.content.Context!);
- ctor public ListRowHoverCardView(android.content.Context!, android.util.AttributeSet!);
- ctor public ListRowHoverCardView(android.content.Context!, android.util.AttributeSet!, int);
- method public CharSequence! getDescription();
- method public CharSequence! getTitle();
- method public void setDescription(CharSequence!);
- method public void setTitle(CharSequence!);
- }
-
- public class ListRowPresenter extends androidx.leanback.widget.RowPresenter {
- ctor public ListRowPresenter();
- ctor public ListRowPresenter(int);
- ctor public ListRowPresenter(int, boolean);
- method protected void applySelectLevelToChild(androidx.leanback.widget.ListRowPresenter.ViewHolder!, android.view.View!);
- method public final boolean areChildRoundedCornersEnabled();
- method protected androidx.leanback.widget.RowPresenter.ViewHolder! createRowViewHolder(android.view.ViewGroup!);
- method protected androidx.leanback.widget.ShadowOverlayHelper.Options! createShadowOverlayOptions();
- method public final void enableChildRoundedCorners(boolean);
- method public int getExpandedRowHeight();
- method public final int getFocusZoomFactor();
- method public final androidx.leanback.widget.PresenterSelector! getHoverCardPresenterSelector();
- method public int getRecycledPoolSize(androidx.leanback.widget.Presenter!);
- method public int getRowHeight();
- method public final boolean getShadowEnabled();
- method @Deprecated public final int getZoomFactor();
- method public final boolean isFocusDimmerUsed();
- method public final boolean isKeepChildForeground();
- method public boolean isUsingDefaultListSelectEffect();
- method public final boolean isUsingDefaultSelectEffect();
- method public boolean isUsingDefaultShadow();
- method public boolean isUsingOutlineClipping(android.content.Context!);
- method public boolean isUsingZOrder(android.content.Context!);
- method public void setExpandedRowHeight(int);
- method public final void setHoverCardPresenterSelector(androidx.leanback.widget.PresenterSelector!);
- method public final void setKeepChildForeground(boolean);
- method public void setNumRows(int);
- method public void setRecycledPoolSize(androidx.leanback.widget.Presenter!, int);
- method public void setRowHeight(int);
- method public final void setShadowEnabled(boolean);
- }
-
- public static class ListRowPresenter.SelectItemViewHolderTask extends androidx.leanback.widget.Presenter.ViewHolderTask {
- ctor public ListRowPresenter.SelectItemViewHolderTask(int);
- method public int getItemPosition();
- method public androidx.leanback.widget.Presenter.ViewHolderTask! getItemTask();
- method public boolean isSmoothScroll();
- method public void setItemPosition(int);
- method public void setItemTask(androidx.leanback.widget.Presenter.ViewHolderTask!);
- method public void setSmoothScroll(boolean);
- }
-
- public static class ListRowPresenter.ViewHolder extends androidx.leanback.widget.RowPresenter.ViewHolder {
- ctor public ListRowPresenter.ViewHolder(android.view.View!, androidx.leanback.widget.HorizontalGridView!, androidx.leanback.widget.ListRowPresenter!);
- method public final androidx.leanback.widget.ItemBridgeAdapter! getBridgeAdapter();
- method public final androidx.leanback.widget.HorizontalGridView! getGridView();
- method public androidx.leanback.widget.Presenter.ViewHolder! getItemViewHolder(int);
- method public final androidx.leanback.widget.ListRowPresenter! getListRowPresenter();
- method public int getSelectedPosition();
- }
-
- public final class ListRowView extends android.widget.LinearLayout {
- ctor public ListRowView(android.content.Context!);
- ctor public ListRowView(android.content.Context!, android.util.AttributeSet!);
- ctor public ListRowView(android.content.Context!, android.util.AttributeSet!, int);
- method public androidx.leanback.widget.HorizontalGridView! getGridView();
- }
-
- public interface MultiActionsProvider {
- method public androidx.leanback.widget.MultiActionsProvider.MultiAction[]! getActions();
- }
-
- public static class MultiActionsProvider.MultiAction {
- ctor public MultiActionsProvider.MultiAction(long);
- method public android.graphics.drawable.Drawable! getCurrentDrawable();
- method public android.graphics.drawable.Drawable[]! getDrawables();
- method public long getId();
- method public int getIndex();
- method public void incrementIndex();
- method public void setDrawables(android.graphics.drawable.Drawable[]!);
- method public void setIndex(int);
- }
-
- public abstract class ObjectAdapter {
- ctor public ObjectAdapter(androidx.leanback.widget.PresenterSelector!);
- ctor public ObjectAdapter(androidx.leanback.widget.Presenter!);
- ctor public ObjectAdapter();
- method public abstract Object! get(int);
- method public long getId(int);
- method public final androidx.leanback.widget.Presenter! getPresenter(Object!);
- method public final androidx.leanback.widget.PresenterSelector! getPresenterSelector();
- method public final boolean hasStableIds();
- method public boolean isImmediateNotifySupported();
- method protected final void notifyChanged();
- method protected final void notifyItemMoved(int, int);
- method public final void notifyItemRangeChanged(int, int);
- method public final void notifyItemRangeChanged(int, int, Object!);
- method protected final void notifyItemRangeInserted(int, int);
- method protected final void notifyItemRangeRemoved(int, int);
- method protected void onHasStableIdsChanged();
- method protected void onPresenterSelectorChanged();
- method public final void registerObserver(androidx.leanback.widget.ObjectAdapter.DataObserver!);
- method public final void setHasStableIds(boolean);
- method public final void setPresenterSelector(androidx.leanback.widget.PresenterSelector!);
- method public abstract int size();
- method public final void unregisterAllObservers();
- method public final void unregisterObserver(androidx.leanback.widget.ObjectAdapter.DataObserver!);
- field public static final int NO_ID = -1; // 0xffffffff
- }
-
- public abstract static class ObjectAdapter.DataObserver {
- ctor public ObjectAdapter.DataObserver();
- method public void onChanged();
- method public void onItemMoved(int, int);
- method public void onItemRangeChanged(int, int);
- method public void onItemRangeChanged(int, int, Object!);
- method public void onItemRangeInserted(int, int);
- method public void onItemRangeRemoved(int, int);
- }
-
- public interface OnActionClickedListener {
- method public void onActionClicked(androidx.leanback.widget.Action!);
- }
-
- public interface OnChildLaidOutListener {
- method public void onChildLaidOut(android.view.ViewGroup!, android.view.View!, int, long);
- }
-
- @Deprecated public interface OnChildSelectedListener {
- method @Deprecated public void onChildSelected(android.view.ViewGroup!, android.view.View!, int, long);
- }
-
- public abstract class OnChildViewHolderSelectedListener {
- ctor public OnChildViewHolderSelectedListener();
- method public void onChildViewHolderSelected(androidx.recyclerview.widget.RecyclerView!, androidx.recyclerview.widget.RecyclerView.ViewHolder!, int, int);
- method public void onChildViewHolderSelectedAndPositioned(androidx.recyclerview.widget.RecyclerView!, androidx.recyclerview.widget.RecyclerView.ViewHolder!, int, int);
- }
-
- public interface OnItemViewClickedListener extends androidx.leanback.widget.BaseOnItemViewClickedListener<androidx.leanback.widget.Row> {
- }
-
- public interface OnItemViewSelectedListener extends androidx.leanback.widget.BaseOnItemViewSelectedListener<androidx.leanback.widget.Row> {
- }
-
- public class PageRow extends androidx.leanback.widget.Row {
- ctor public PageRow(androidx.leanback.widget.HeaderItem!);
- method public final boolean isRenderedAsRowView();
- }
-
- public abstract class Parallax<PropertyT extends android.util.Property> {
- ctor public Parallax();
- method public androidx.leanback.widget.ParallaxEffect! addEffect(androidx.leanback.widget.Parallax.PropertyMarkerValue...!);
- method public final PropertyT! addProperty(String!);
- method public abstract PropertyT! createProperty(String!, int);
- method public java.util.List<androidx.leanback.widget.ParallaxEffect>! getEffects();
- method public abstract float getMaxValue();
- method public final java.util.List<PropertyT>! getProperties();
- method public void removeAllEffects();
- method public void removeEffect(androidx.leanback.widget.ParallaxEffect!);
- method @CallSuper public void updateValues();
- }
-
- public static class Parallax.FloatProperty extends android.util.Property<androidx.leanback.widget.Parallax,java.lang.Float> {
- ctor public Parallax.FloatProperty(String!, int);
- method public final androidx.leanback.widget.Parallax.PropertyMarkerValue! at(float, float);
- method public final androidx.leanback.widget.Parallax.PropertyMarkerValue! atAbsolute(float);
- method public final androidx.leanback.widget.Parallax.PropertyMarkerValue! atFraction(float);
- method public final androidx.leanback.widget.Parallax.PropertyMarkerValue! atMax();
- method public final androidx.leanback.widget.Parallax.PropertyMarkerValue! atMin();
- method public final Float! get(androidx.leanback.widget.Parallax!);
- method public final int getIndex();
- method public final float getValue(androidx.leanback.widget.Parallax!);
- method public final void set(androidx.leanback.widget.Parallax!, Float!);
- method public final void setValue(androidx.leanback.widget.Parallax!, float);
- field public static final float UNKNOWN_AFTER = 3.4028235E38f;
- field public static final float UNKNOWN_BEFORE = -3.4028235E38f;
- }
-
- public static class Parallax.IntProperty extends android.util.Property<androidx.leanback.widget.Parallax,java.lang.Integer> {
- ctor public Parallax.IntProperty(String!, int);
- method public final androidx.leanback.widget.Parallax.PropertyMarkerValue! at(int, float);
- method public final androidx.leanback.widget.Parallax.PropertyMarkerValue! atAbsolute(int);
- method public final androidx.leanback.widget.Parallax.PropertyMarkerValue! atFraction(float);
- method public final androidx.leanback.widget.Parallax.PropertyMarkerValue! atMax();
- method public final androidx.leanback.widget.Parallax.PropertyMarkerValue! atMin();
- method public final Integer! get(androidx.leanback.widget.Parallax!);
- method public final int getIndex();
- method public final int getValue(androidx.leanback.widget.Parallax!);
- method public final void set(androidx.leanback.widget.Parallax!, Integer!);
- method public final void setValue(androidx.leanback.widget.Parallax!, int);
- field public static final int UNKNOWN_AFTER = 2147483647; // 0x7fffffff
- field public static final int UNKNOWN_BEFORE = -2147483648; // 0x80000000
- }
-
- public static class Parallax.PropertyMarkerValue<PropertyT> {
- ctor public Parallax.PropertyMarkerValue(PropertyT!);
- method public PropertyT! getProperty();
- }
-
- public abstract class ParallaxEffect {
- method public final void addTarget(androidx.leanback.widget.ParallaxTarget!);
- method public final java.util.List<androidx.leanback.widget.Parallax.PropertyMarkerValue>! getPropertyRanges();
- method public final java.util.List<androidx.leanback.widget.ParallaxTarget>! getTargets();
- method public final void performMapping(androidx.leanback.widget.Parallax!);
- method public final void removeTarget(androidx.leanback.widget.ParallaxTarget!);
- method public final void setPropertyRanges(androidx.leanback.widget.Parallax.PropertyMarkerValue...!);
- method public final androidx.leanback.widget.ParallaxEffect! target(androidx.leanback.widget.ParallaxTarget!);
- method public final androidx.leanback.widget.ParallaxEffect! target(Object!, android.animation.PropertyValuesHolder!);
- method public final <T, V extends java.lang.Number> androidx.leanback.widget.ParallaxEffect! target(T!, android.util.Property<T,V>!);
- }
-
- public abstract class ParallaxTarget {
- ctor public ParallaxTarget();
- method public void directUpdate(Number!);
- method public boolean isDirectMapping();
- method public void update(float);
- }
-
- public static final class ParallaxTarget.DirectPropertyTarget<T extends java.lang.Object, V extends java.lang.Number> extends androidx.leanback.widget.ParallaxTarget {
- ctor public ParallaxTarget.DirectPropertyTarget(Object!, android.util.Property<T,V>!);
- }
-
- public static final class ParallaxTarget.PropertyValuesHolderTarget extends androidx.leanback.widget.ParallaxTarget {
- ctor public ParallaxTarget.PropertyValuesHolderTarget(Object!, android.animation.PropertyValuesHolder!);
- }
-
- public class PlaybackControlsRow extends androidx.leanback.widget.Row {
- ctor public PlaybackControlsRow(Object!);
- ctor public PlaybackControlsRow();
- method public androidx.leanback.widget.Action! getActionForKeyCode(int);
- method public androidx.leanback.widget.Action! getActionForKeyCode(androidx.leanback.widget.ObjectAdapter!, int);
- method public long getBufferedPosition();
- method @Deprecated public int getBufferedProgress();
- method @Deprecated public long getBufferedProgressLong();
- method public long getCurrentPosition();
- method @Deprecated public int getCurrentTime();
- method @Deprecated public long getCurrentTimeLong();
- method public long getDuration();
- method public final android.graphics.drawable.Drawable! getImageDrawable();
- method public final Object! getItem();
- method public final androidx.leanback.widget.ObjectAdapter! getPrimaryActionsAdapter();
- method public final androidx.leanback.widget.ObjectAdapter! getSecondaryActionsAdapter();
- method @Deprecated public int getTotalTime();
- method @Deprecated public long getTotalTimeLong();
- method public void setBufferedPosition(long);
- method @Deprecated public void setBufferedProgress(int);
- method @Deprecated public void setBufferedProgressLong(long);
- method public void setCurrentPosition(long);
- method @Deprecated public void setCurrentTime(int);
- method @Deprecated public void setCurrentTimeLong(long);
- method public void setDuration(long);
- method public final void setImageBitmap(android.content.Context!, android.graphics.Bitmap!);
- method public final void setImageDrawable(android.graphics.drawable.Drawable!);
- method public void setOnPlaybackProgressChangedListener(androidx.leanback.widget.PlaybackControlsRow.OnPlaybackProgressCallback!);
- method public final void setPrimaryActionsAdapter(androidx.leanback.widget.ObjectAdapter!);
- method public final void setSecondaryActionsAdapter(androidx.leanback.widget.ObjectAdapter!);
- method @Deprecated public void setTotalTime(int);
- method @Deprecated public void setTotalTimeLong(long);
- }
-
- public static class PlaybackControlsRow.ClosedCaptioningAction extends androidx.leanback.widget.PlaybackControlsRow.MultiAction {
- ctor public PlaybackControlsRow.ClosedCaptioningAction(android.content.Context!);
- ctor public PlaybackControlsRow.ClosedCaptioningAction(android.content.Context!, int);
- field public static final int INDEX_OFF = 0; // 0x0
- field public static final int INDEX_ON = 1; // 0x1
- field @Deprecated public static final int OFF = 0; // 0x0
- field @Deprecated public static final int ON = 1; // 0x1
- }
-
- public static class PlaybackControlsRow.FastForwardAction extends androidx.leanback.widget.PlaybackControlsRow.MultiAction {
- ctor public PlaybackControlsRow.FastForwardAction(android.content.Context!);
- ctor public PlaybackControlsRow.FastForwardAction(android.content.Context!, int);
- }
-
- public static class PlaybackControlsRow.HighQualityAction extends androidx.leanback.widget.PlaybackControlsRow.MultiAction {
- ctor public PlaybackControlsRow.HighQualityAction(android.content.Context!);
- ctor public PlaybackControlsRow.HighQualityAction(android.content.Context!, int);
- field public static final int INDEX_OFF = 0; // 0x0
- field public static final int INDEX_ON = 1; // 0x1
- field @Deprecated public static final int OFF = 0; // 0x0
- field @Deprecated public static final int ON = 1; // 0x1
- }
-
- public static class PlaybackControlsRow.MoreActions extends androidx.leanback.widget.Action {
- ctor public PlaybackControlsRow.MoreActions(android.content.Context!);
- }
-
- public abstract static class PlaybackControlsRow.MultiAction extends androidx.leanback.widget.Action {
- ctor public PlaybackControlsRow.MultiAction(int);
- method public int getActionCount();
- method public android.graphics.drawable.Drawable! getDrawable(int);
- method public int getIndex();
- method public String! getLabel(int);
- method public String! getSecondaryLabel(int);
- method public void nextIndex();
- method public void setDrawables(android.graphics.drawable.Drawable[]!);
- method public void setIndex(int);
- method public void setLabels(String[]!);
- method public void setSecondaryLabels(String[]!);
- }
-
- public static class PlaybackControlsRow.OnPlaybackProgressCallback {
- ctor public PlaybackControlsRow.OnPlaybackProgressCallback();
- method public void onBufferedPositionChanged(androidx.leanback.widget.PlaybackControlsRow!, long);
- method public void onCurrentPositionChanged(androidx.leanback.widget.PlaybackControlsRow!, long);
- method public void onDurationChanged(androidx.leanback.widget.PlaybackControlsRow!, long);
- }
-
- public static class PlaybackControlsRow.PictureInPictureAction extends androidx.leanback.widget.Action {
- ctor public PlaybackControlsRow.PictureInPictureAction(android.content.Context!);
- }
-
- public static class PlaybackControlsRow.PlayPauseAction extends androidx.leanback.widget.PlaybackControlsRow.MultiAction {
- ctor public PlaybackControlsRow.PlayPauseAction(android.content.Context!);
- field public static final int INDEX_PAUSE = 1; // 0x1
- field public static final int INDEX_PLAY = 0; // 0x0
- field @Deprecated public static final int PAUSE = 1; // 0x1
- field @Deprecated public static final int PLAY = 0; // 0x0
- }
-
- public static class PlaybackControlsRow.RepeatAction extends androidx.leanback.widget.PlaybackControlsRow.MultiAction {
- ctor public PlaybackControlsRow.RepeatAction(android.content.Context!);
- ctor public PlaybackControlsRow.RepeatAction(android.content.Context!, int);
- ctor public PlaybackControlsRow.RepeatAction(android.content.Context!, int, int);
- field @Deprecated public static final int ALL = 1; // 0x1
- field public static final int INDEX_ALL = 1; // 0x1
- field public static final int INDEX_NONE = 0; // 0x0
- field public static final int INDEX_ONE = 2; // 0x2
- field @Deprecated public static final int NONE = 0; // 0x0
- field @Deprecated public static final int ONE = 2; // 0x2
- }
-
- public static class PlaybackControlsRow.RewindAction extends androidx.leanback.widget.PlaybackControlsRow.MultiAction {
- ctor public PlaybackControlsRow.RewindAction(android.content.Context!);
- ctor public PlaybackControlsRow.RewindAction(android.content.Context!, int);
- }
-
- public static class PlaybackControlsRow.ShuffleAction extends androidx.leanback.widget.PlaybackControlsRow.MultiAction {
- ctor public PlaybackControlsRow.ShuffleAction(android.content.Context!);
- ctor public PlaybackControlsRow.ShuffleAction(android.content.Context!, int);
- field public static final int INDEX_OFF = 0; // 0x0
- field public static final int INDEX_ON = 1; // 0x1
- field @Deprecated public static final int OFF = 0; // 0x0
- field @Deprecated public static final int ON = 1; // 0x1
- }
-
- public static class PlaybackControlsRow.SkipNextAction extends androidx.leanback.widget.Action {
- ctor public PlaybackControlsRow.SkipNextAction(android.content.Context!);
- }
-
- public static class PlaybackControlsRow.SkipPreviousAction extends androidx.leanback.widget.Action {
- ctor public PlaybackControlsRow.SkipPreviousAction(android.content.Context!);
- }
-
- public abstract static class PlaybackControlsRow.ThumbsAction extends androidx.leanback.widget.PlaybackControlsRow.MultiAction {
- ctor public PlaybackControlsRow.ThumbsAction(int, android.content.Context!, int, int);
- field public static final int INDEX_OUTLINE = 1; // 0x1
- field public static final int INDEX_SOLID = 0; // 0x0
- field @Deprecated public static final int OUTLINE = 1; // 0x1
- field @Deprecated public static final int SOLID = 0; // 0x0
- }
-
- public static class PlaybackControlsRow.ThumbsDownAction extends androidx.leanback.widget.PlaybackControlsRow.ThumbsAction {
- ctor public PlaybackControlsRow.ThumbsDownAction(android.content.Context!);
- }
-
- public static class PlaybackControlsRow.ThumbsUpAction extends androidx.leanback.widget.PlaybackControlsRow.ThumbsAction {
- ctor public PlaybackControlsRow.ThumbsUpAction(android.content.Context!);
- }
-
- public class PlaybackControlsRowPresenter extends androidx.leanback.widget.PlaybackRowPresenter {
- ctor public PlaybackControlsRowPresenter(androidx.leanback.widget.Presenter!);
- ctor public PlaybackControlsRowPresenter();
- method public boolean areSecondaryActionsHidden();
- method protected androidx.leanback.widget.RowPresenter.ViewHolder! createRowViewHolder(android.view.ViewGroup!);
- method @ColorInt public int getBackgroundColor();
- method public androidx.leanback.widget.OnActionClickedListener! getOnActionClickedListener();
- method @ColorInt public int getProgressColor();
- method public void setBackgroundColor(@ColorInt int);
- method public void setOnActionClickedListener(androidx.leanback.widget.OnActionClickedListener!);
- method public void setProgressColor(@ColorInt int);
- method public void setSecondaryActionsHidden(boolean);
- method public void showBottomSpace(androidx.leanback.widget.PlaybackControlsRowPresenter.ViewHolder!, boolean);
- method public void showPrimaryActions(androidx.leanback.widget.PlaybackControlsRowPresenter.ViewHolder!);
- }
-
- public class PlaybackControlsRowPresenter.ViewHolder extends androidx.leanback.widget.PlaybackRowPresenter.ViewHolder {
- field public final androidx.leanback.widget.Presenter.ViewHolder! mDescriptionViewHolder;
- }
-
- public abstract class PlaybackRowPresenter extends androidx.leanback.widget.RowPresenter {
- ctor public PlaybackRowPresenter();
- method public void onReappear(androidx.leanback.widget.RowPresenter.ViewHolder!);
- }
-
- public static class PlaybackRowPresenter.ViewHolder extends androidx.leanback.widget.RowPresenter.ViewHolder {
- ctor public PlaybackRowPresenter.ViewHolder(android.view.View!);
- }
-
- public class PlaybackSeekDataProvider {
- ctor public PlaybackSeekDataProvider();
- method public long[]! getSeekPositions();
- method public void getThumbnail(int, androidx.leanback.widget.PlaybackSeekDataProvider.ResultCallback!);
- method public void reset();
- }
-
- public static class PlaybackSeekDataProvider.ResultCallback {
- ctor public PlaybackSeekDataProvider.ResultCallback();
- method public void onThumbnailLoaded(android.graphics.Bitmap!, int);
- }
-
- public interface PlaybackSeekUi {
- method public void setPlaybackSeekUiClient(androidx.leanback.widget.PlaybackSeekUi.Client!);
- }
-
- public static class PlaybackSeekUi.Client {
- ctor public PlaybackSeekUi.Client();
- method public androidx.leanback.widget.PlaybackSeekDataProvider! getPlaybackSeekDataProvider();
- method public boolean isSeekEnabled();
- method public void onSeekFinished(boolean);
- method public void onSeekPositionChanged(long);
- method public void onSeekStarted();
- }
-
- public class PlaybackTransportRowPresenter extends androidx.leanback.widget.PlaybackRowPresenter {
- ctor public PlaybackTransportRowPresenter();
- method protected androidx.leanback.widget.RowPresenter.ViewHolder! createRowViewHolder(android.view.ViewGroup!);
- method public float getDefaultSeekIncrement();
- method public androidx.leanback.widget.OnActionClickedListener! getOnActionClickedListener();
- method @ColorInt public int getProgressColor();
- method @ColorInt public int getSecondaryProgressColor();
- method protected void onProgressBarClicked(androidx.leanback.widget.PlaybackTransportRowPresenter.ViewHolder!);
- method public void setDefaultSeekIncrement(float);
- method public void setDescriptionPresenter(androidx.leanback.widget.Presenter!);
- method public void setOnActionClickedListener(androidx.leanback.widget.OnActionClickedListener!);
- method public void setProgressColor(@ColorInt int);
- method public void setSecondaryProgressColor(@ColorInt int);
- }
-
- public class PlaybackTransportRowPresenter.ViewHolder extends androidx.leanback.widget.PlaybackRowPresenter.ViewHolder implements androidx.leanback.widget.PlaybackSeekUi {
- ctor public PlaybackTransportRowPresenter.ViewHolder(android.view.View!, androidx.leanback.widget.Presenter!);
- method public final android.widget.TextView! getCurrentPositionView();
- method public final androidx.leanback.widget.Presenter.ViewHolder! getDescriptionViewHolder();
- method public final android.widget.TextView! getDurationView();
- method protected void onSetCurrentPositionLabel(long);
- method protected void onSetDurationLabel(long);
- method public void setPlaybackSeekUiClient(androidx.leanback.widget.PlaybackSeekUi.Client!);
- }
-
- public abstract class Presenter implements androidx.leanback.widget.FacetProvider {
- ctor public Presenter();
- method protected static void cancelAnimationsRecursive(android.view.View!);
- method public final Object! getFacet(Class<?>!);
- method public abstract void onBindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!, Object!);
- method public void onBindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!, Object!, java.util.List<java.lang.Object>!);
- method public abstract androidx.leanback.widget.Presenter.ViewHolder! onCreateViewHolder(android.view.ViewGroup!);
- method public abstract void onUnbindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!);
- method public void onViewAttachedToWindow(androidx.leanback.widget.Presenter.ViewHolder!);
- method public void onViewDetachedFromWindow(androidx.leanback.widget.Presenter.ViewHolder!);
- method public final void setFacet(Class<?>!, Object!);
- method public void setOnClickListener(androidx.leanback.widget.Presenter.ViewHolder!, android.view.View.OnClickListener!);
- }
-
- public static class Presenter.ViewHolder implements androidx.leanback.widget.FacetProvider {
- ctor public Presenter.ViewHolder(android.view.View!);
- method public final Object! getFacet(Class<?>!);
- method public final void setFacet(Class<?>!, Object!);
- field public final android.view.View! view;
- }
-
- public abstract static class Presenter.ViewHolderTask {
- ctor public Presenter.ViewHolderTask();
- method public void run(androidx.leanback.widget.Presenter.ViewHolder!);
- }
-
- public abstract class PresenterSelector {
- ctor public PresenterSelector();
- method public abstract androidx.leanback.widget.Presenter! getPresenter(Object!);
- method public androidx.leanback.widget.Presenter[]! getPresenters();
- }
-
- public abstract class PresenterSwitcher {
- ctor public PresenterSwitcher();
- method public void clear();
- method public final android.view.ViewGroup! getParentViewGroup();
- method public void init(android.view.ViewGroup!, androidx.leanback.widget.PresenterSelector!);
- method protected abstract void insertView(android.view.View!);
- method protected void onViewSelected(android.view.View!);
- method public void select(Object!);
- method protected void showView(android.view.View!, boolean);
- method public void unselect();
- }
-
- public class RecyclerViewParallax extends androidx.leanback.widget.Parallax<androidx.leanback.widget.RecyclerViewParallax.ChildPositionProperty> {
- ctor public RecyclerViewParallax();
- method public androidx.leanback.widget.RecyclerViewParallax.ChildPositionProperty! createProperty(String!, int);
- method public float getMaxValue();
- method public androidx.recyclerview.widget.RecyclerView! getRecyclerView();
- method public void setRecyclerView(androidx.recyclerview.widget.RecyclerView!);
- }
-
- public static final class RecyclerViewParallax.ChildPositionProperty extends androidx.leanback.widget.Parallax.IntProperty {
- method public androidx.leanback.widget.RecyclerViewParallax.ChildPositionProperty! adapterPosition(int);
- method public androidx.leanback.widget.RecyclerViewParallax.ChildPositionProperty! fraction(float);
- method public int getAdapterPosition();
- method public float getFraction();
- method public int getOffset();
- method public int getViewId();
- method public androidx.leanback.widget.RecyclerViewParallax.ChildPositionProperty! offset(int);
- method public androidx.leanback.widget.RecyclerViewParallax.ChildPositionProperty! viewId(int);
- }
-
- public class Row {
- ctor public Row(long, androidx.leanback.widget.HeaderItem!);
- ctor public Row(androidx.leanback.widget.HeaderItem!);
- ctor public Row();
- method public final androidx.leanback.widget.HeaderItem! getHeaderItem();
- method public final long getId();
- method public boolean isRenderedAsRowView();
- method public final void setHeaderItem(androidx.leanback.widget.HeaderItem!);
- method public final void setId(long);
- }
-
- public class RowHeaderPresenter extends androidx.leanback.widget.Presenter {
- ctor public RowHeaderPresenter();
- method protected static float getFontDescent(android.widget.TextView!, android.graphics.Paint!);
- method public int getSpaceUnderBaseline(androidx.leanback.widget.RowHeaderPresenter.ViewHolder!);
- method public boolean isNullItemVisibilityGone();
- method public void onBindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!, Object!);
- method public androidx.leanback.widget.Presenter.ViewHolder! onCreateViewHolder(android.view.ViewGroup!);
- method protected void onSelectLevelChanged(androidx.leanback.widget.RowHeaderPresenter.ViewHolder!);
- method public void onUnbindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!);
- method public void setNullItemVisibilityGone(boolean);
- method public final void setSelectLevel(androidx.leanback.widget.RowHeaderPresenter.ViewHolder!, float);
- }
-
- public static class RowHeaderPresenter.ViewHolder extends androidx.leanback.widget.Presenter.ViewHolder {
- ctor public RowHeaderPresenter.ViewHolder(android.view.View!);
- method public final float getSelectLevel();
- }
-
- public final class RowHeaderView extends android.widget.TextView {
- ctor public RowHeaderView(android.content.Context!);
- ctor public RowHeaderView(android.content.Context!, android.util.AttributeSet!);
- ctor public RowHeaderView(android.content.Context!, android.util.AttributeSet!, int);
- }
-
- public abstract class RowPresenter extends androidx.leanback.widget.Presenter {
- ctor public RowPresenter();
- method protected abstract androidx.leanback.widget.RowPresenter.ViewHolder! createRowViewHolder(android.view.ViewGroup!);
- method protected void dispatchItemSelectedListener(androidx.leanback.widget.RowPresenter.ViewHolder!, boolean);
- method public void freeze(androidx.leanback.widget.RowPresenter.ViewHolder!, boolean);
- method public final androidx.leanback.widget.RowHeaderPresenter! getHeaderPresenter();
- method public final androidx.leanback.widget.RowPresenter.ViewHolder! getRowViewHolder(androidx.leanback.widget.Presenter.ViewHolder!);
- method public final boolean getSelectEffectEnabled();
- method public final float getSelectLevel(androidx.leanback.widget.Presenter.ViewHolder!);
- method public final int getSyncActivatePolicy();
- method protected void initializeRowViewHolder(androidx.leanback.widget.RowPresenter.ViewHolder!);
- method protected boolean isClippingChildren();
- method public boolean isUsingDefaultSelectEffect();
- method protected void onBindRowViewHolder(androidx.leanback.widget.RowPresenter.ViewHolder!, Object!);
- method public final void onBindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!, Object!);
- method public final androidx.leanback.widget.Presenter.ViewHolder! onCreateViewHolder(android.view.ViewGroup!);
- method protected void onRowViewAttachedToWindow(androidx.leanback.widget.RowPresenter.ViewHolder!);
- method protected void onRowViewDetachedFromWindow(androidx.leanback.widget.RowPresenter.ViewHolder!);
- method protected void onRowViewExpanded(androidx.leanback.widget.RowPresenter.ViewHolder!, boolean);
- method protected void onRowViewSelected(androidx.leanback.widget.RowPresenter.ViewHolder!, boolean);
- method protected void onSelectLevelChanged(androidx.leanback.widget.RowPresenter.ViewHolder!);
- method protected void onUnbindRowViewHolder(androidx.leanback.widget.RowPresenter.ViewHolder!);
- method public final void onUnbindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!);
- method public final void onViewAttachedToWindow(androidx.leanback.widget.Presenter.ViewHolder!);
- method public final void onViewDetachedFromWindow(androidx.leanback.widget.Presenter.ViewHolder!);
- method public void setEntranceTransitionState(androidx.leanback.widget.RowPresenter.ViewHolder!, boolean);
- method public final void setHeaderPresenter(androidx.leanback.widget.RowHeaderPresenter!);
- method public final void setRowViewExpanded(androidx.leanback.widget.Presenter.ViewHolder!, boolean);
- method public final void setRowViewSelected(androidx.leanback.widget.Presenter.ViewHolder!, boolean);
- method public final void setSelectEffectEnabled(boolean);
- method public final void setSelectLevel(androidx.leanback.widget.Presenter.ViewHolder!, float);
- method public final void setSyncActivatePolicy(int);
- field public static final int SYNC_ACTIVATED_CUSTOM = 0; // 0x0
- field public static final int SYNC_ACTIVATED_TO_EXPANDED = 1; // 0x1
- field public static final int SYNC_ACTIVATED_TO_EXPANDED_AND_SELECTED = 3; // 0x3
- field public static final int SYNC_ACTIVATED_TO_SELECTED = 2; // 0x2
- }
-
- public static class RowPresenter.ViewHolder extends androidx.leanback.widget.Presenter.ViewHolder {
- ctor public RowPresenter.ViewHolder(android.view.View!);
- method public final androidx.leanback.widget.RowHeaderPresenter.ViewHolder! getHeaderViewHolder();
- method public final androidx.leanback.widget.BaseOnItemViewClickedListener! getOnItemViewClickedListener();
- method public final androidx.leanback.widget.BaseOnItemViewSelectedListener! getOnItemViewSelectedListener();
- method public android.view.View.OnKeyListener! getOnKeyListener();
- method public final androidx.leanback.widget.Row! getRow();
- method public final Object! getRowObject();
- method public final float getSelectLevel();
- method public Object! getSelectedItem();
- method public androidx.leanback.widget.Presenter.ViewHolder! getSelectedItemViewHolder();
- method public final boolean isExpanded();
- method public final boolean isSelected();
- method public final void setActivated(boolean);
- method public final void setOnItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener!);
- method public final void setOnItemViewSelectedListener(androidx.leanback.widget.BaseOnItemViewSelectedListener!);
- method public void setOnKeyListener(android.view.View.OnKeyListener!);
- method public final void syncActivatedStatus(android.view.View!);
- field protected final androidx.leanback.graphics.ColorOverlayDimmer! mColorDimmer;
- }
-
- public class SearchBar extends android.widget.RelativeLayout {
- ctor public SearchBar(android.content.Context!);
- ctor public SearchBar(android.content.Context!, android.util.AttributeSet!);
- ctor public SearchBar(android.content.Context!, android.util.AttributeSet!, int);
- method public void displayCompletions(java.util.List<java.lang.String>!);
- method public void displayCompletions(android.view.inputmethod.CompletionInfo[]!);
- method public android.graphics.drawable.Drawable! getBadgeDrawable();
- method public CharSequence! getHint();
- method public String! getTitle();
- method public boolean isRecognizing();
- method public void setBadgeDrawable(android.graphics.drawable.Drawable!);
- method public void setPermissionListener(androidx.leanback.widget.SearchBar.SearchBarPermissionListener!);
- method public void setSearchAffordanceColors(androidx.leanback.widget.SearchOrbView.Colors!);
- method public void setSearchAffordanceColorsInListening(androidx.leanback.widget.SearchOrbView.Colors!);
- method public void setSearchBarListener(androidx.leanback.widget.SearchBar.SearchBarListener!);
- method public void setSearchQuery(String!);
- method @Deprecated public void setSpeechRecognitionCallback(androidx.leanback.widget.SpeechRecognitionCallback!);
- method public void setSpeechRecognizer(android.speech.SpeechRecognizer!);
- method public void setTitle(String!);
- method public void startRecognition();
- method public void stopRecognition();
- }
-
- public static interface SearchBar.SearchBarListener {
- method public void onKeyboardDismiss(String!);
- method public void onSearchQueryChange(String!);
- method public void onSearchQuerySubmit(String!);
- }
-
- public static interface SearchBar.SearchBarPermissionListener {
- method public void requestAudioPermission();
- }
-
- public class SearchEditText extends android.widget.EditText {
- ctor public SearchEditText(android.content.Context!);
- ctor public SearchEditText(android.content.Context!, android.util.AttributeSet!);
- ctor public SearchEditText(android.content.Context!, android.util.AttributeSet!, int);
- method public static boolean isLayoutRtl(android.view.View!);
- method public void reset();
- method public void setFinalRecognizedText(CharSequence!);
- method public void setOnKeyboardDismissListener(androidx.leanback.widget.SearchEditText.OnKeyboardDismissListener!);
- method public void updateRecognizedText(String!, String!);
- method public void updateRecognizedText(String!, java.util.List<java.lang.Float>!);
- }
-
- public static interface SearchEditText.OnKeyboardDismissListener {
- method public void onKeyboardDismiss();
- }
-
- public class SearchOrbView extends android.widget.FrameLayout implements android.view.View.OnClickListener {
- ctor public SearchOrbView(android.content.Context!);
- ctor public SearchOrbView(android.content.Context!, android.util.AttributeSet!);
- ctor public SearchOrbView(android.content.Context!, android.util.AttributeSet!, int);
- method public void enableOrbColorAnimation(boolean);
- method @ColorInt public int getOrbColor();
- method public androidx.leanback.widget.SearchOrbView.Colors! getOrbColors();
- method public android.graphics.drawable.Drawable! getOrbIcon();
- method public void onClick(android.view.View!);
- method public void setOnOrbClickedListener(android.view.View.OnClickListener!);
- method public void setOrbColor(int);
- method @Deprecated public void setOrbColor(@ColorInt int, @ColorInt int);
- method public void setOrbColors(androidx.leanback.widget.SearchOrbView.Colors!);
- method public void setOrbIcon(android.graphics.drawable.Drawable!);
- }
-
- public static class SearchOrbView.Colors {
- ctor public SearchOrbView.Colors(@ColorInt int);
- ctor public SearchOrbView.Colors(@ColorInt int, @ColorInt int);
- ctor public SearchOrbView.Colors(@ColorInt int, @ColorInt int, @ColorInt int);
- method public static int getBrightColor(int);
- field @ColorInt public int brightColor;
- field @ColorInt public int color;
- field @ColorInt public int iconColor;
- }
-
- public class SectionRow extends androidx.leanback.widget.Row {
- ctor public SectionRow(androidx.leanback.widget.HeaderItem!);
- ctor public SectionRow(long, String!);
- ctor public SectionRow(String!);
- method public final boolean isRenderedAsRowView();
- }
-
- public class ShadowOverlayContainer extends android.widget.FrameLayout {
- ctor public ShadowOverlayContainer(android.content.Context!);
- ctor public ShadowOverlayContainer(android.content.Context!, android.util.AttributeSet!);
- ctor public ShadowOverlayContainer(android.content.Context!, android.util.AttributeSet!, int);
- method public int getShadowType();
- method public android.view.View! getWrappedView();
- method @Deprecated public void initialize(boolean, boolean);
- method @Deprecated public void initialize(boolean, boolean, boolean);
- method public static void prepareParentForShadow(android.view.ViewGroup!);
- method public void setOverlayColor(@ColorInt int);
- method public void setShadowFocusLevel(float);
- method public static boolean supportsDynamicShadow();
- method public static boolean supportsShadow();
- method public void useDynamicShadow();
- method public void useDynamicShadow(float, float);
- method public void useStaticShadow();
- method public void wrap(android.view.View!);
- field public static final int SHADOW_DYNAMIC = 3; // 0x3
- field public static final int SHADOW_NONE = 1; // 0x1
- field public static final int SHADOW_STATIC = 2; // 0x2
- }
-
- public final class ShadowOverlayHelper {
- method public androidx.leanback.widget.ShadowOverlayContainer! createShadowOverlayContainer(android.content.Context!);
- method public int getShadowType();
- method public boolean needsOverlay();
- method public boolean needsRoundedCorner();
- method public boolean needsWrapper();
- method public void onViewCreated(android.view.View!);
- method public void prepareParentForShadow(android.view.ViewGroup!);
- method public static void setNoneWrapperOverlayColor(android.view.View!, int);
- method public static void setNoneWrapperShadowFocusLevel(android.view.View!, float);
- method public void setOverlayColor(android.view.View!, int);
- method public void setShadowFocusLevel(android.view.View!, float);
- method public static boolean supportsDynamicShadow();
- method public static boolean supportsForeground();
- method public static boolean supportsRoundedCorner();
- method public static boolean supportsShadow();
- field public static final int SHADOW_DYNAMIC = 3; // 0x3
- field public static final int SHADOW_NONE = 1; // 0x1
- field public static final int SHADOW_STATIC = 2; // 0x2
- }
-
- public static final class ShadowOverlayHelper.Builder {
- ctor public ShadowOverlayHelper.Builder();
- method public androidx.leanback.widget.ShadowOverlayHelper! build(android.content.Context!);
- method public androidx.leanback.widget.ShadowOverlayHelper.Builder! keepForegroundDrawable(boolean);
- method public androidx.leanback.widget.ShadowOverlayHelper.Builder! needsOverlay(boolean);
- method public androidx.leanback.widget.ShadowOverlayHelper.Builder! needsRoundedCorner(boolean);
- method public androidx.leanback.widget.ShadowOverlayHelper.Builder! needsShadow(boolean);
- method public androidx.leanback.widget.ShadowOverlayHelper.Builder! options(androidx.leanback.widget.ShadowOverlayHelper.Options!);
- method public androidx.leanback.widget.ShadowOverlayHelper.Builder! preferZOrder(boolean);
- }
-
- public static final class ShadowOverlayHelper.Options {
- ctor public ShadowOverlayHelper.Options();
- method public androidx.leanback.widget.ShadowOverlayHelper.Options! dynamicShadowZ(float, float);
- method public float getDynamicShadowFocusedZ();
- method public float getDynamicShadowUnfocusedZ();
- method public int getRoundedCornerRadius();
- method public androidx.leanback.widget.ShadowOverlayHelper.Options! roundedCornerRadius(int);
- field public static final androidx.leanback.widget.ShadowOverlayHelper.Options! DEFAULT;
- }
-
- public final class SinglePresenterSelector extends androidx.leanback.widget.PresenterSelector {
- ctor public SinglePresenterSelector(androidx.leanback.widget.Presenter!);
- method public androidx.leanback.widget.Presenter! getPresenter(Object!);
- }
-
- public class SparseArrayObjectAdapter extends androidx.leanback.widget.ObjectAdapter {
- ctor public SparseArrayObjectAdapter(androidx.leanback.widget.PresenterSelector!);
- ctor public SparseArrayObjectAdapter(androidx.leanback.widget.Presenter!);
- ctor public SparseArrayObjectAdapter();
- method public void clear(int);
- method public void clear();
- method public Object! get(int);
- method public int indexOf(Object!);
- method public int indexOf(int);
- method public Object! lookup(int);
- method public void notifyArrayItemRangeChanged(int, int);
- method public void set(int, Object!);
- method public int size();
- }
-
- public class SpeechOrbView extends androidx.leanback.widget.SearchOrbView {
- ctor public SpeechOrbView(android.content.Context!);
- ctor public SpeechOrbView(android.content.Context!, android.util.AttributeSet!);
- ctor public SpeechOrbView(android.content.Context!, android.util.AttributeSet!, int);
- method public void setListeningOrbColors(androidx.leanback.widget.SearchOrbView.Colors!);
- method public void setNotListeningOrbColors(androidx.leanback.widget.SearchOrbView.Colors!);
- method public void setSoundLevel(int);
- method public void showListening();
- method public void showNotListening();
- }
-
- @Deprecated public interface SpeechRecognitionCallback {
- method @Deprecated public void recognizeSpeech();
- }
-
- public class TitleHelper {
- ctor public TitleHelper(android.view.ViewGroup!, android.view.View!);
- method public androidx.leanback.widget.BrowseFrameLayout.OnFocusSearchListener! getOnFocusSearchListener();
- method public android.view.ViewGroup! getSceneRoot();
- method public android.view.View! getTitleView();
- method public void showTitle(boolean);
- }
-
- public class TitleView extends android.widget.FrameLayout implements androidx.leanback.widget.TitleViewAdapter.Provider {
- ctor public TitleView(android.content.Context!);
- ctor public TitleView(android.content.Context!, android.util.AttributeSet!);
- ctor public TitleView(android.content.Context!, android.util.AttributeSet!, int);
- method public void enableAnimation(boolean);
- method public android.graphics.drawable.Drawable! getBadgeDrawable();
- method public androidx.leanback.widget.SearchOrbView.Colors! getSearchAffordanceColors();
- method public android.view.View! getSearchAffordanceView();
- method public CharSequence! getTitle();
- method public androidx.leanback.widget.TitleViewAdapter! getTitleViewAdapter();
- method public void setBadgeDrawable(android.graphics.drawable.Drawable!);
- method public void setOnSearchClickedListener(android.view.View.OnClickListener!);
- method public void setSearchAffordanceColors(androidx.leanback.widget.SearchOrbView.Colors!);
- method public void setTitle(CharSequence!);
- method public void updateComponentsVisibility(int);
- }
-
- public abstract class TitleViewAdapter {
- ctor public TitleViewAdapter();
- method public android.graphics.drawable.Drawable! getBadgeDrawable();
- method public androidx.leanback.widget.SearchOrbView.Colors! getSearchAffordanceColors();
- method public abstract android.view.View! getSearchAffordanceView();
- method public CharSequence! getTitle();
- method public void setAnimationEnabled(boolean);
- method public void setBadgeDrawable(android.graphics.drawable.Drawable!);
- method public void setOnSearchClickedListener(android.view.View.OnClickListener!);
- method public void setSearchAffordanceColors(androidx.leanback.widget.SearchOrbView.Colors!);
- method public void setTitle(CharSequence!);
- method public void updateComponentsVisibility(int);
- field public static final int BRANDING_VIEW_VISIBLE = 2; // 0x2
- field public static final int FULL_VIEW_VISIBLE = 6; // 0x6
- field public static final int SEARCH_VIEW_VISIBLE = 4; // 0x4
- }
-
- public static interface TitleViewAdapter.Provider {
- method public androidx.leanback.widget.TitleViewAdapter! getTitleViewAdapter();
- }
-
- public class VerticalGridPresenter extends androidx.leanback.widget.Presenter {
- ctor public VerticalGridPresenter();
- ctor public VerticalGridPresenter(int);
- ctor public VerticalGridPresenter(int, boolean);
- method public final boolean areChildRoundedCornersEnabled();
- method protected androidx.leanback.widget.VerticalGridPresenter.ViewHolder! createGridViewHolder(android.view.ViewGroup!);
- method protected androidx.leanback.widget.ShadowOverlayHelper.Options! createShadowOverlayOptions();
- method public final void enableChildRoundedCorners(boolean);
- method public final int getFocusZoomFactor();
- method public final boolean getKeepChildForeground();
- method public int getNumberOfColumns();
- method public final androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
- method public final androidx.leanback.widget.OnItemViewSelectedListener! getOnItemViewSelectedListener();
- method public final boolean getShadowEnabled();
- method protected void initializeGridViewHolder(androidx.leanback.widget.VerticalGridPresenter.ViewHolder!);
- method public final boolean isFocusDimmerUsed();
- method public boolean isUsingDefaultShadow();
- method public boolean isUsingZOrder(android.content.Context!);
- method public void onBindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!, Object!);
- method public final androidx.leanback.widget.VerticalGridPresenter.ViewHolder! onCreateViewHolder(android.view.ViewGroup!);
- method public void onUnbindViewHolder(androidx.leanback.widget.Presenter.ViewHolder!);
- method public void setEntranceTransitionState(androidx.leanback.widget.VerticalGridPresenter.ViewHolder!, boolean);
- method public final void setKeepChildForeground(boolean);
- method public void setNumberOfColumns(int);
- method public final void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
- method public final void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
- method public final void setShadowEnabled(boolean);
- }
-
- public static class VerticalGridPresenter.ViewHolder extends androidx.leanback.widget.Presenter.ViewHolder {
- ctor public VerticalGridPresenter.ViewHolder(androidx.leanback.widget.VerticalGridView!);
- method public androidx.leanback.widget.VerticalGridView! getGridView();
- }
-
- public class VerticalGridView extends androidx.leanback.widget.BaseGridView {
- ctor public VerticalGridView(android.content.Context!);
- ctor public VerticalGridView(android.content.Context!, android.util.AttributeSet!);
- ctor public VerticalGridView(android.content.Context!, android.util.AttributeSet!, int);
- method protected void initAttributes(android.content.Context!, android.util.AttributeSet!);
- method public void setColumnWidth(int);
- method public void setNumColumns(int);
- }
-
- public interface ViewHolderTask {
- method public void run(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- }
-
-}
-
-package androidx.leanback.widget.picker {
-
- public class DatePicker extends androidx.leanback.widget.picker.Picker {
- ctor public DatePicker(android.content.Context!, android.util.AttributeSet!);
- ctor public DatePicker(android.content.Context!, android.util.AttributeSet!, int);
- method public long getDate();
- method public String! getDatePickerFormat();
- method public long getMaxDate();
- method public long getMinDate();
- method public final void onColumnValueChanged(int, int);
- method public void setDate(long);
- method public void setDate(int, int, int, boolean);
- method public void setDatePickerFormat(String!);
- method public void setMaxDate(long);
- method public void setMinDate(long);
- }
-
- public class Picker extends android.widget.FrameLayout {
- ctor public Picker(android.content.Context!, android.util.AttributeSet!);
- ctor public Picker(android.content.Context!, android.util.AttributeSet!, int);
- method public void addOnValueChangedListener(androidx.leanback.widget.picker.Picker.PickerValueListener!);
- method public float getActivatedVisibleItemCount();
- method public androidx.leanback.widget.picker.PickerColumn! getColumnAt(int);
- method public int getColumnsCount();
- method protected int getPickerItemHeightPixels();
- method @LayoutRes public final int getPickerItemLayoutId();
- method @IdRes public final int getPickerItemTextViewId();
- method public int getSelectedColumn();
- method @Deprecated public final CharSequence! getSeparator();
- method public final java.util.List<java.lang.CharSequence>! getSeparators();
- method public float getVisibleItemCount();
- method public void onColumnValueChanged(int, int);
- method public void removeOnValueChangedListener(androidx.leanback.widget.picker.Picker.PickerValueListener!);
- method public void setActivatedVisibleItemCount(float);
- method public void setColumnAt(int, androidx.leanback.widget.picker.PickerColumn!);
- method public void setColumnValue(int, int, boolean);
- method public void setColumns(java.util.List<androidx.leanback.widget.picker.PickerColumn>!);
- method public final void setPickerItemLayoutId(@LayoutRes int);
- method public final void setPickerItemTextViewId(@IdRes int);
- method public void setSelectedColumn(int);
- method public final void setSeparator(CharSequence!);
- method public final void setSeparators(java.util.List<java.lang.CharSequence>!);
- method public void setVisibleItemCount(float);
- }
-
- public static interface Picker.PickerValueListener {
- method public void onValueChanged(androidx.leanback.widget.picker.Picker!, int);
- }
-
- public class PickerColumn {
- ctor public PickerColumn();
- method public int getCount();
- method public int getCurrentValue();
- method public CharSequence! getLabelFor(int);
- method public String! getLabelFormat();
- method public int getMaxValue();
- method public int getMinValue();
- method public CharSequence[]! getStaticLabels();
- method public void setCurrentValue(int);
- method public void setLabelFormat(String!);
- method public void setMaxValue(int);
- method public void setMinValue(int);
- method public void setStaticLabels(CharSequence[]!);
- }
-
- public class PinPicker extends androidx.leanback.widget.picker.Picker {
- ctor public PinPicker(android.content.Context!, android.util.AttributeSet!);
- ctor public PinPicker(android.content.Context!, android.util.AttributeSet!, int);
- method public String! getPin();
- method public void resetPin();
- method public void setNumberOfColumns(int);
- }
-
- public class TimePicker extends androidx.leanback.widget.picker.Picker {
- ctor public TimePicker(android.content.Context!, android.util.AttributeSet!);
- ctor public TimePicker(android.content.Context!, android.util.AttributeSet!, int);
- method public int getHour();
- method public int getMinute();
- method public boolean is24Hour();
- method public boolean isPm();
- method public void setHour(@IntRange(from=0, to=23) int);
- method public void setIs24Hour(boolean);
- method public void setMinute(@IntRange(from=0, to=59) int);
- }
-
-}
-
diff --git a/leanback/api/current.txt b/leanback/api/current.txt
index 9dab078..f26a898 100644
--- a/leanback/api/current.txt
+++ b/leanback/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.leanback.app {
public final class BackgroundManager {
@@ -24,6 +24,7 @@
@Deprecated public class BaseFragment extends androidx.leanback.app.BrandedFragment {
method @Deprecated protected Object! createEntranceTransition();
method @Deprecated public final androidx.leanback.app.ProgressBarManager! getProgressBarManager();
+ method @Deprecated public void onCreate(android.os.Bundle!);
method @Deprecated protected void onEntranceTransitionEnd();
method @Deprecated protected void onEntranceTransitionPrepare();
method @Deprecated protected void onEntranceTransitionStart();
@@ -53,7 +54,13 @@
method @Deprecated public androidx.leanback.widget.TitleViewAdapter! getTitleViewAdapter();
method @Deprecated public void installTitleView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
method @Deprecated public final boolean isShowingTitle();
+ method @Deprecated public void onDestroyView();
method @Deprecated public android.view.View! onInflateTitleView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onPause();
+ method @Deprecated public void onResume();
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
+ method @Deprecated public void onStart();
+ method @Deprecated public void onViewCreated(android.view.View, android.os.Bundle?);
method @Deprecated public void setBadgeDrawable(android.graphics.drawable.Drawable!);
method @Deprecated public void setOnSearchClickedListener(android.view.View.OnClickListener!);
method @Deprecated public void setSearchAffordanceColor(int);
@@ -104,6 +111,9 @@
method @Deprecated public boolean isInHeadersTransition();
method @Deprecated public boolean isShowingHeaders();
method @Deprecated public androidx.leanback.app.HeadersFragment! onCreateHeadersFragment();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroy();
+ method @Deprecated public void onStop();
method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
method @Deprecated public void setBrandColor(@ColorInt int);
method @Deprecated public void setBrowseTransitionListener(androidx.leanback.app.BrowseFragment.BrowseTransitionListener!);
@@ -289,8 +299,10 @@
method @Deprecated public androidx.leanback.widget.DetailsParallax! getParallax();
method @Deprecated public androidx.leanback.app.RowsFragment! getRowsFragment();
method @Deprecated protected android.view.View! inflateTitle(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
method @Deprecated protected void onSetDetailsOverviewRowStatus(androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter!, androidx.leanback.widget.FullWidthDetailsOverviewRowPresenter.ViewHolder!, int, int, int);
method @Deprecated protected void onSetRowStatus(androidx.leanback.widget.RowPresenter!, androidx.leanback.widget.RowPresenter.ViewHolder!, int, int, int);
+ method @Deprecated public void onStop();
method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.BaseOnItemViewClickedListener!);
method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.BaseOnItemViewSelectedListener!);
@@ -369,6 +381,7 @@
method @Deprecated public android.graphics.drawable.Drawable! getImageDrawable();
method @Deprecated public CharSequence! getMessage();
method @Deprecated public boolean isBackgroundTranslucent();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
method @Deprecated public void setBackgroundDrawable(android.graphics.drawable.Drawable!);
method @Deprecated public void setButtonClickListener(android.view.View.OnClickListener!);
method @Deprecated public void setButtonText(String!);
@@ -425,6 +438,7 @@
method @Deprecated public void notifyActionChanged(int);
method @Deprecated public void notifyButtonActionChanged(int);
method @Deprecated protected void onAddSharedElementTransition(android.app.FragmentTransaction!, androidx.leanback.app.GuidedStepFragment!);
+ method @Deprecated public void onCreate(android.os.Bundle!);
method @Deprecated public void onCreateActions(java.util.List<androidx.leanback.widget.GuidedAction>, android.os.Bundle!);
method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! onCreateActionsStylist();
method @Deprecated public android.view.View! onCreateBackgroundView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
@@ -432,6 +446,8 @@
method @Deprecated public androidx.leanback.widget.GuidedActionsStylist! onCreateButtonActionsStylist();
method @Deprecated public androidx.leanback.widget.GuidanceStylist.Guidance onCreateGuidance(android.os.Bundle!);
method @Deprecated public androidx.leanback.widget.GuidanceStylist! onCreateGuidanceStylist();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroyView();
method @Deprecated public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
method @Deprecated public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
method @Deprecated public void onGuidedActionEdited(androidx.leanback.widget.GuidedAction!);
@@ -439,6 +455,8 @@
method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
method @Deprecated protected void onProvideFragmentTransitions();
method @Deprecated public int onProvideTheme();
+ method @Deprecated public void onResume();
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
method @Deprecated public boolean onSubGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
method @Deprecated public void openInEditMode(androidx.leanback.widget.GuidedAction!);
method @Deprecated public void popBackStackToGuidedStepFragment(Class!, int);
@@ -525,9 +543,13 @@
method @Deprecated public int getSelectedPosition();
method @Deprecated public final androidx.leanback.widget.VerticalGridView! getVerticalGridView();
method @Deprecated public boolean isScrolling();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroyView();
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
method @Deprecated public void onTransitionEnd();
method @Deprecated public boolean onTransitionPrepare();
method @Deprecated public void onTransitionStart();
+ method @Deprecated public void onViewCreated(android.view.View, android.os.Bundle?);
method @Deprecated public final void setAdapter(androidx.leanback.widget.ObjectAdapter!);
method @Deprecated public void setAlignment(int);
method @Deprecated public void setOnHeaderClickedListener(androidx.leanback.app.HeadersFragment.OnHeaderClickedListener!);
@@ -597,10 +619,13 @@
method @Deprecated protected abstract android.view.View? onCreateForegroundView(android.view.LayoutInflater!, android.view.ViewGroup!);
method @Deprecated protected android.animation.Animator? onCreateLogoAnimation();
method @Deprecated protected android.animation.Animator! onCreateTitleAnimator();
+ method @Deprecated public android.view.View? onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
method @Deprecated protected void onFinishFragment();
method @Deprecated protected void onLogoAnimationFinished();
method @Deprecated protected void onPageChanged(int, int);
method @Deprecated public int onProvideTheme();
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
+ method @Deprecated public void onViewCreated(android.view.View, android.os.Bundle?);
method @Deprecated public void setArrowBackgroundColor(@ColorInt int);
method @Deprecated public void setArrowColor(@ColorInt int);
method @Deprecated public void setDescriptionViewTextColor(@ColorInt int);
@@ -664,8 +689,17 @@
method @Deprecated public boolean isShowOrHideControlsOverlayOnUserInteraction();
method @Deprecated public void notifyPlaybackRowChanged();
method @Deprecated protected void onBufferingStateChanged(boolean);
+ method @Deprecated public void onCreate(android.os.Bundle!);
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroy();
+ method @Deprecated public void onDestroyView();
method @Deprecated protected void onError(int, CharSequence!);
+ method @Deprecated public void onPause();
+ method @Deprecated public void onResume();
+ method @Deprecated public void onStart();
+ method @Deprecated public void onStop();
method @Deprecated protected void onVideoSizeChanged(int, int);
+ method @Deprecated public void onViewCreated(android.view.View, android.os.Bundle?);
method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
method @Deprecated public void setBackgroundType(int);
method @Deprecated public void setControlsOverlayAutoHideEnabled(boolean);
@@ -691,7 +725,19 @@
@Deprecated public class PlaybackFragmentGlueHost extends androidx.leanback.media.PlaybackGlueHost implements androidx.leanback.widget.PlaybackSeekUi {
ctor @Deprecated public PlaybackFragmentGlueHost(androidx.leanback.app.PlaybackFragment!);
method @Deprecated public void fadeOut();
+ method @Deprecated public androidx.leanback.media.PlaybackGlueHost.PlayerCallback! getPlayerCallback();
+ method @Deprecated public void hideControlsOverlay(boolean);
+ method @Deprecated public boolean isControlsOverlayAutoHideEnabled();
+ method @Deprecated public boolean isControlsOverlayVisible();
+ method @Deprecated public void notifyPlaybackRowChanged();
+ method @Deprecated public void setControlsOverlayAutoHideEnabled(boolean);
+ method @Deprecated public void setHostCallback(androidx.leanback.media.PlaybackGlueHost.HostCallback!);
+ method @Deprecated public void setOnActionClickedListener(androidx.leanback.widget.OnActionClickedListener!);
+ method @Deprecated public void setOnKeyInterceptListener(android.view.View.OnKeyListener!);
+ method @Deprecated public void setPlaybackRow(androidx.leanback.widget.Row!);
+ method @Deprecated public void setPlaybackRowPresenter(androidx.leanback.widget.PlaybackRowPresenter!);
method @Deprecated public void setPlaybackSeekUiClient(androidx.leanback.widget.PlaybackSeekUi.Client!);
+ method @Deprecated public void showControlsOverlay(boolean);
}
public class PlaybackSupportFragment extends androidx.fragment.app.Fragment {
@@ -765,9 +811,14 @@
method @Deprecated public int getSelectedPosition();
method @Deprecated public final androidx.leanback.widget.VerticalGridView! getVerticalGridView();
method @Deprecated public boolean isScrolling();
+ method @Deprecated public void onCreate(android.os.Bundle!);
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroyView();
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
method @Deprecated public void onTransitionEnd();
method @Deprecated public boolean onTransitionPrepare();
method @Deprecated public void onTransitionStart();
+ method @Deprecated public void onViewCreated(android.view.View, android.os.Bundle?);
method @Deprecated public final void setAdapter(androidx.leanback.widget.ObjectAdapter!);
method @Deprecated public void setAlignment(int);
method @Deprecated public void setEntranceTransitionState(boolean);
@@ -838,6 +889,13 @@
method @Deprecated public androidx.leanback.app.RowsFragment! getRowsFragment();
method @Deprecated public String! getTitle();
method @Deprecated public static androidx.leanback.app.SearchFragment! newInstance(String!);
+ method @Deprecated public void onCreate(android.os.Bundle!);
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroy();
+ method @Deprecated public void onPause();
+ method @Deprecated public void onRequestPermissionsResult(int, String[]!, int[]!);
+ method @Deprecated public void onResume();
+ method @Deprecated public void onStart();
method @Deprecated public void setBadgeDrawable(android.graphics.drawable.Drawable!);
method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
method @Deprecated public void setOnItemViewSelectedListener(androidx.leanback.widget.OnItemViewSelectedListener!);
@@ -891,6 +949,7 @@
method @Deprecated public androidx.leanback.widget.ObjectAdapter! getAdapter();
method @Deprecated public androidx.leanback.widget.VerticalGridPresenter! getGridPresenter();
method @Deprecated public androidx.leanback.widget.OnItemViewClickedListener! getOnItemViewClickedListener();
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
method @Deprecated public void setAdapter(androidx.leanback.widget.ObjectAdapter!);
method @Deprecated public void setGridPresenter(androidx.leanback.widget.VerticalGridPresenter!);
method @Deprecated public void setOnItemViewClickedListener(androidx.leanback.widget.OnItemViewClickedListener!);
@@ -1068,6 +1127,10 @@
method @Deprecated public long getSupportedActions();
method @Deprecated public boolean hasValidMedia();
method @Deprecated public boolean isMediaPlaying();
+ method @Deprecated public void next();
+ method @Deprecated public void pause();
+ method @Deprecated public void play(int);
+ method @Deprecated public void previous();
}
public class MediaPlayerAdapter extends androidx.leanback.media.PlayerAdapter {
@@ -1692,6 +1755,12 @@
method @Deprecated public androidx.leanback.widget.OnActionClickedListener! getOnActionClickedListener();
method @Deprecated public boolean isStyleLarge();
method @Deprecated public final boolean isUsingDefaultSelectEffect();
+ method @Deprecated protected void onBindRowViewHolder(androidx.leanback.widget.RowPresenter.ViewHolder!, Object!);
+ method @Deprecated protected void onRowViewAttachedToWindow(androidx.leanback.widget.RowPresenter.ViewHolder!);
+ method @Deprecated protected void onRowViewDetachedFromWindow(androidx.leanback.widget.RowPresenter.ViewHolder!);
+ method @Deprecated protected void onRowViewSelected(androidx.leanback.widget.RowPresenter.ViewHolder!, boolean);
+ method @Deprecated protected void onSelectLevelChanged(androidx.leanback.widget.RowPresenter.ViewHolder!);
+ method @Deprecated protected void onUnbindRowViewHolder(androidx.leanback.widget.RowPresenter.ViewHolder!);
method @Deprecated public void setBackgroundColor(@ColorInt int);
method @Deprecated public void setOnActionClickedListener(androidx.leanback.widget.OnActionClickedListener!);
method @Deprecated public final void setSharedElementEnterTransition(android.app.Activity!, String!, long);
diff --git a/leanback/api/res-1.1.0-alpha02.txt b/leanback/api/res-1.1.0-alpha02.txt
deleted file mode 100644
index e69de29..0000000
--- a/leanback/api/res-1.1.0-alpha02.txt
+++ /dev/null
diff --git a/leanback/api/restricted_1.0.0.txt b/leanback/api/restricted_1.0.0.txt
deleted file mode 100644
index 2ad77bd..0000000
--- a/leanback/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,544 +0,0 @@
-// Signature format: 3.0
-package androidx.leanback.animation {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class LogAccelerateInterpolator {
- ctor public LogAccelerateInterpolator(int, int);
- method public float getInterpolation(float);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class LogDecelerateInterpolator {
- ctor public LogDecelerateInterpolator(int, int);
- method public float getInterpolation(float);
- }
-
-}
-
-package androidx.leanback.app {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class BackgroundFragment {
- ctor public BackgroundFragment();
- method public void onDestroy();
- method public void onResume();
- method public void onStart();
- method public void onStop();
- }
-
- @Deprecated public class GuidedStepFragment implements androidx.leanback.widget.GuidedActionAdapter.FocusListener {
- method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setEntranceTransitionType(int);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final int SLIDE_FROM_BOTTOM = 1; // 0x1
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final int SLIDE_FROM_SIDE = 0; // 0x0
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class GuidedStepFragment.DummyFragment {
- ctor public GuidedStepFragment.DummyFragment();
- method public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- }
-
- public class GuidedStepSupportFragment implements androidx.leanback.widget.GuidedActionAdapter.FocusListener {
- method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setEntranceTransitionType(int);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final int SLIDE_FROM_BOTTOM = 1; // 0x1
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final int SLIDE_FROM_SIDE = 0; // 0x0
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class GuidedStepSupportFragment.DummyFragment {
- ctor public GuidedStepSupportFragment.DummyFragment();
- method public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class PermissionHelper {
- method public static void requestPermissions(android.app.Fragment!, String[]!, int);
- }
-
- @Deprecated public class PlaybackFragment {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.leanback.app.PlaybackFragment.OnFadeCompleteListener! getFadeCompleteListener();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void resetFocus();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void setFadeCompleteListener(androidx.leanback.app.PlaybackFragment.OnFadeCompleteListener!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static class PlaybackFragment.OnFadeCompleteListener {
- ctor public PlaybackFragment.OnFadeCompleteListener();
- method public void onFadeInComplete();
- method public void onFadeOutComplete();
- }
-
- public class PlaybackSupportFragment {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.leanback.app.PlaybackSupportFragment.OnFadeCompleteListener! getFadeCompleteListener();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void resetFocus();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void setFadeCompleteListener(androidx.leanback.app.PlaybackSupportFragment.OnFadeCompleteListener!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static class PlaybackSupportFragment.OnFadeCompleteListener {
- ctor public PlaybackSupportFragment.OnFadeCompleteListener();
- method public void onFadeInComplete();
- method public void onFadeOutComplete();
- }
-
-}
-
-package androidx.leanback.media {
-
- @Deprecated @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class MediaPlayerGlue extends androidx.leanback.media.PlaybackControlGlue implements androidx.leanback.widget.OnItemViewSelectedListener {
- ctor public MediaPlayerGlue(android.content.Context!);
- ctor public MediaPlayerGlue(android.content.Context!, int[]!, int[]!);
- method public int getCurrentPosition();
- method public int getCurrentSpeedId();
- method public android.graphics.drawable.Drawable! getMediaArt();
- method public int getMediaDuration();
- method public CharSequence! getMediaSubtitle();
- method public CharSequence! getMediaTitle();
- method public long getSupportedActions();
- method public boolean hasValidMedia();
- method public boolean isMediaPlaying();
- method public void onItemSelected(androidx.leanback.widget.Presenter.ViewHolder!, Object!, androidx.leanback.widget.RowPresenter.ViewHolder!, androidx.leanback.widget.Row!);
- method public void release();
- method public void reset();
- method protected void seekTo(int);
- method public void setArtist(String!);
- method public void setCover(android.graphics.drawable.Drawable!);
- method public void setDisplay(android.view.SurfaceHolder!);
- method public boolean setMediaSource(android.net.Uri!);
- method public boolean setMediaSource(String!);
- method public void setMode(int);
- method public void setTitle(String!);
- method public void setVideoUrl(String!);
- field public static final int FAST_FORWARD_REWIND_REPEAT_DELAY = 200; // 0xc8
- field public static final int FAST_FORWARD_REWIND_STEP = 10000; // 0x2710
- field public static final int NO_REPEAT = 0; // 0x0
- field public static final int REPEAT_ALL = 2; // 0x2
- field public static final int REPEAT_ONE = 1; // 0x1
- field protected final androidx.leanback.widget.PlaybackControlsRow.ThumbsDownAction! mThumbsDownAction;
- field protected final androidx.leanback.widget.PlaybackControlsRow.ThumbsUpAction! mThumbsUpAction;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface PlaybackBannerControlGlue.ACTION_ {
- }
-
- public abstract class PlaybackControlGlue extends androidx.leanback.media.PlaybackGlue implements androidx.leanback.widget.OnActionClickedListener {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) protected androidx.leanback.widget.SparseArrayObjectAdapter! createPrimaryActionsAdapter(androidx.leanback.widget.PresenterSelector!);
- }
-
-}
-
-package androidx.leanback.system {
-
- public class Settings {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean isOutlineClippingDisabled();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean preferStaticShadows();
- }
-
-}
-
-package androidx.leanback.transition {
-
- @RequiresApi(21) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class FadeAndShortSlide {
- ctor public FadeAndShortSlide();
- ctor public FadeAndShortSlide(int);
- ctor public FadeAndShortSlide(android.content.Context!, android.util.AttributeSet!);
- method public android.transition.Transition! addListener(android.transition.Transition.TransitionListener!);
- method public void captureEndValues(android.transition.TransitionValues!);
- method public void captureStartValues(android.transition.TransitionValues!);
- method public android.transition.Transition! clone();
- method public float getDistance();
- method public android.animation.Animator! onAppear(android.view.ViewGroup!, android.view.View!, android.transition.TransitionValues!, android.transition.TransitionValues!);
- method public android.animation.Animator! onDisappear(android.view.ViewGroup!, android.view.View!, android.transition.TransitionValues!, android.transition.TransitionValues!);
- method public android.transition.Transition! removeListener(android.transition.Transition.TransitionListener!);
- method public void setDistance(float);
- method public void setEpicenterCallback(android.transition.Transition.EpicenterCallback!);
- method public void setSlideEdge(int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class LeanbackTransitionHelper {
- method public static Object! loadTitleInTransition(android.content.Context!);
- method public static Object! loadTitleOutTransition(android.content.Context!);
- }
-
- @RequiresApi(21) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ParallaxTransition {
- ctor public ParallaxTransition();
- ctor public ParallaxTransition(android.content.Context!, android.util.AttributeSet!);
- method public android.animation.Animator! onAppear(android.view.ViewGroup!, android.view.View!, android.transition.TransitionValues!, android.transition.TransitionValues!);
- method public android.animation.Animator! onDisappear(android.view.ViewGroup!, android.view.View!, android.transition.TransitionValues!, android.transition.TransitionValues!);
- }
-
- @RequiresApi(21) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class SlideNoPropagation {
- ctor public SlideNoPropagation();
- ctor public SlideNoPropagation(int);
- ctor public SlideNoPropagation(android.content.Context!, android.util.AttributeSet!);
- method public void setSlideEdge(int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public abstract class TransitionEpicenterCallback {
- ctor public TransitionEpicenterCallback();
- method public abstract android.graphics.Rect! onGetEpicenter(Object!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class TransitionHelper {
- method public static void addSharedElement(android.app.FragmentTransaction!, android.view.View!, String!);
- method public static void addTarget(Object!, android.view.View!);
- method public static void addTransition(Object!, Object!);
- method public static void addTransitionListener(Object!, androidx.leanback.transition.TransitionListener!);
- method public static void beginDelayedTransition(android.view.ViewGroup!, Object!);
- method public static Object! createAutoTransition();
- method public static Object! createChangeBounds(boolean);
- method public static Object! createChangeTransform();
- method public static Object! createDefaultInterpolator(android.content.Context!);
- method public static Object! createFadeAndShortSlide(int);
- method public static Object! createFadeAndShortSlide(int, float);
- method public static Object! createFadeTransition(int);
- method public static Object! createScale();
- method public static Object! createScene(android.view.ViewGroup!, Runnable!);
- method public static Object! createSlide(int);
- method public static Object! createTransitionSet(boolean);
- method public static void exclude(Object!, int, boolean);
- method public static void exclude(Object!, android.view.View!, boolean);
- method public static void excludeChildren(Object!, int, boolean);
- method public static void excludeChildren(Object!, android.view.View!, boolean);
- method public static Object! getEnterTransition(android.view.Window!);
- method public static Object! getExitTransition(android.view.Window!);
- method public static Object! getReenterTransition(android.view.Window!);
- method public static Object! getReturnTransition(android.view.Window!);
- method public static Object! getSharedElementEnterTransition(android.view.Window!);
- method public static Object! getSharedElementExitTransition(android.view.Window!);
- method public static Object! getSharedElementReenterTransition(android.view.Window!);
- method public static Object! getSharedElementReturnTransition(android.view.Window!);
- method public static void include(Object!, int);
- method public static void include(Object!, android.view.View!);
- method public static Object! loadTransition(android.content.Context!, int);
- method public static void removeTransitionListener(Object!, androidx.leanback.transition.TransitionListener!);
- method public static void runTransition(Object!, Object!);
- method public static void setChangeBoundsDefaultStartDelay(Object!, int);
- method public static void setChangeBoundsStartDelay(Object!, android.view.View!, int);
- method public static void setChangeBoundsStartDelay(Object!, int, int);
- method public static void setChangeBoundsStartDelay(Object!, String!, int);
- method public static void setDuration(Object!, long);
- method public static void setEnterTransition(android.view.Window!, Object!);
- method public static void setEnterTransition(android.app.Fragment!, Object!);
- method public static void setEpicenterCallback(Object!, androidx.leanback.transition.TransitionEpicenterCallback!);
- method public static void setExitTransition(android.app.Fragment!, Object!);
- method public static void setInterpolator(Object!, Object!);
- method public static void setReturnTransition(android.view.Window!, Object!);
- method public static void setSharedElementEnterTransition(android.view.Window!, Object!);
- method public static void setSharedElementEnterTransition(android.app.Fragment!, Object!);
- method public static void setSharedElementReturnTransition(android.view.Window!, Object!);
- method public static void setStartDelay(Object!, long);
- method public static void setTransitionGroup(android.view.ViewGroup!, boolean);
- method public static boolean systemSupportsEntranceTransitions();
- field public static final int FADE_IN = 1; // 0x1
- field public static final int FADE_OUT = 2; // 0x2
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class TransitionListener {
- ctor public TransitionListener();
- method public void onTransitionCancel(Object!);
- method public void onTransitionEnd(Object!);
- method public void onTransitionPause(Object!);
- method public void onTransitionResume(Object!);
- method public void onTransitionStart(Object!);
- field protected Object! mImpl;
- }
-
-}
-
-package androidx.leanback.util {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final class MathUtil {
- method public static int safeLongToInt(long);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class StateMachine {
- ctor public StateMachine();
- method public void addState(androidx.leanback.util.StateMachine.State!);
- method public void addTransition(androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.Event!);
- method public void addTransition(androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.Condition!);
- method public void addTransition(androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.State!);
- method public void fireEvent(androidx.leanback.util.StateMachine.Event!);
- method public void reset();
- method public void start();
- field public static final int STATUS_INVOKED = 1; // 0x1
- field public static final int STATUS_ZERO = 0; // 0x0
- }
-
- public static class StateMachine.Condition {
- ctor public StateMachine.Condition(String!);
- method public boolean canProceed();
- }
-
- public static class StateMachine.Event {
- ctor public StateMachine.Event(String!);
- }
-
- public static class StateMachine.State {
- ctor public StateMachine.State(String!);
- ctor public StateMachine.State(String!, boolean, boolean);
- method public final int getStatus();
- method public void run();
- method public String toString();
- }
-
-}
-
-package androidx.leanback.widget {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class BackgroundHelper {
- method public static void setBackgroundPreservingAlpha(android.view.View!, android.graphics.drawable.Drawable!);
- }
-
- public abstract class BaseGridView {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getExtraLayoutSpace();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getFocusScrollStrategy();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int getSelectedSubPosition();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setExtraLayoutSpace(int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setFocusScrollStrategy(int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSelectedPositionSmoothWithSub(int, int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSelectedPositionWithSub(int, int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSelectedPositionWithSub(int, int, int);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final int FOCUS_SCROLL_ALIGNED = 0; // 0x0
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final int FOCUS_SCROLL_ITEM = 1; // 0x1
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final int FOCUS_SCROLL_PAGE = 2; // 0x2
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class BrowseRowsFrameLayout {
- ctor public BrowseRowsFrameLayout(android.content.Context!);
- ctor public BrowseRowsFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public BrowseRowsFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- method protected void measureChildWithMargins(android.view.View!, int, int, int, int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class DetailsParallaxDrawable extends androidx.leanback.graphics.CompositeDrawable {
- ctor public DetailsParallaxDrawable(android.content.Context!, androidx.leanback.widget.DetailsParallax!, android.graphics.drawable.Drawable!, androidx.leanback.widget.ParallaxTarget!);
- ctor public DetailsParallaxDrawable(android.content.Context!, androidx.leanback.widget.DetailsParallax!, android.graphics.drawable.Drawable!, android.graphics.drawable.Drawable!, androidx.leanback.widget.ParallaxTarget!);
- ctor public DetailsParallaxDrawable(android.content.Context!, androidx.leanback.widget.DetailsParallax!);
- method public android.graphics.drawable.Drawable! getBottomDrawable();
- method public android.graphics.drawable.Drawable! getCoverDrawable();
- method @ColorInt public int getSolidColor();
- method public void setSolidColor(@ColorInt int);
- }
-
- public class DividerPresenter extends androidx.leanback.widget.Presenter {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public DividerPresenter(int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class GuidedActionAdapter {
- ctor public GuidedActionAdapter(java.util.List<androidx.leanback.widget.GuidedAction>!, androidx.leanback.widget.GuidedActionAdapter.ClickListener!, androidx.leanback.widget.GuidedActionAdapter.FocusListener!, androidx.leanback.widget.GuidedActionsStylist!, boolean);
- method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder! findSubChildViewHolder(android.view.View!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public java.util.List<androidx.leanback.widget.GuidedAction>! getActions();
- method public int getCount();
- method public androidx.leanback.widget.GuidedActionsStylist! getGuidedActionsStylist();
- method public androidx.leanback.widget.GuidedAction! getItem(int);
- method public int getItemCount();
- method public int getItemViewType(int);
- method public void handleCheckedActions(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public int indexOf(androidx.leanback.widget.GuidedAction!);
- method public void onBindViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder!, int);
- method public androidx.recyclerview.widget.RecyclerView.ViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
- method public void performOnActionClick(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void setActions(java.util.List<androidx.leanback.widget.GuidedAction>!);
- method public void setClickListener(androidx.leanback.widget.GuidedActionAdapter.ClickListener!);
- method public void setDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction>!);
- method public void setFocusListener(androidx.leanback.widget.GuidedActionAdapter.FocusListener!);
- }
-
- public static interface GuidedActionAdapter.ClickListener {
- method public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- }
-
- public static interface GuidedActionAdapter.EditListener {
- method public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
- method public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
- method public void onImeClose();
- method public void onImeOpen();
- }
-
- public static interface GuidedActionAdapter.FocusListener {
- method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class GuidedActionAdapterGroup {
- ctor public GuidedActionAdapterGroup();
- method public void addAdpter(androidx.leanback.widget.GuidedActionAdapter!, androidx.leanback.widget.GuidedActionAdapter!);
- method public void closeIme(android.view.View!);
- method public void fillAndGoNext(androidx.leanback.widget.GuidedActionAdapter!, android.widget.TextView!);
- method public void fillAndStay(androidx.leanback.widget.GuidedActionAdapter!, android.widget.TextView!);
- method public androidx.leanback.widget.GuidedActionAdapter! getNextAdapter(androidx.leanback.widget.GuidedActionAdapter!);
- method public void openIme(androidx.leanback.widget.GuidedActionAdapter!, androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void setEditListener(androidx.leanback.widget.GuidedActionAdapter.EditListener!);
- }
-
- public class GuidedActionsStylist implements androidx.leanback.widget.FragmentAnimationProvider {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setEditListener(androidx.leanback.widget.GuidedActionAdapter.EditListener!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class InvisibleRowPresenter extends androidx.leanback.widget.RowPresenter {
- ctor public InvisibleRowPresenter();
- method protected androidx.leanback.widget.RowPresenter.ViewHolder! createRowViewHolder(android.view.ViewGroup!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class MediaNowPlayingView {
- ctor public MediaNowPlayingView(android.content.Context!, android.util.AttributeSet!);
- method protected void onAttachedToWindow();
- method protected void onDetachedFromWindow();
- method public void setVisibility(int);
- field protected final android.view.animation.LinearInterpolator! mLinearInterpolator;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class NonOverlappingLinearLayout {
- ctor public NonOverlappingLinearLayout(android.content.Context!);
- ctor public NonOverlappingLinearLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public NonOverlappingLinearLayout(android.content.Context!, android.util.AttributeSet!, int);
- method public void focusableViewAvailable(android.view.View!);
- method public boolean hasOverlappingRendering();
- method protected void onLayout(boolean, int, int, int, int);
- method public void setFocusableViewAvailableFixEnabled(boolean);
- }
-
- public abstract class ObjectAdapter {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final boolean hasObserver();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class PagingIndicator {
- ctor public PagingIndicator(android.content.Context!);
- ctor public PagingIndicator(android.content.Context!, android.util.AttributeSet!);
- ctor public PagingIndicator(android.content.Context!, android.util.AttributeSet!, int);
- method protected void onDraw(android.graphics.Canvas!);
- method protected void onMeasure(int, int);
- method public void onPageSelected(int, boolean);
- method public void onRtlPropertiesChanged(int);
- method protected void onSizeChanged(int, int, int, int);
- method public void setArrowBackgroundColor(@ColorInt int);
- method public void setArrowColor(@ColorInt int);
- method public void setDotBackgroundColor(@ColorInt int);
- method public void setPageCount(int);
- }
-
- public class PagingIndicator.Dot {
- ctor public PagingIndicator.Dot();
- method public void adjustAlpha();
- method public float getAlpha();
- method public float getDiameter();
- method public float getTranslationX();
- method public void setAlpha(float);
- method public void setDiameter(float);
- method public void setTranslationX(float);
- }
-
- public abstract class ParallaxEffect {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final java.util.List<java.lang.Float>! getWeights();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final void setWeights(float...!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final androidx.leanback.widget.ParallaxEffect! weights(float...!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class PlaybackTransportRowView {
- ctor public PlaybackTransportRowView(android.content.Context!, android.util.AttributeSet!);
- ctor public PlaybackTransportRowView(android.content.Context!, android.util.AttributeSet!, int);
- method public boolean dispatchKeyEvent(android.view.KeyEvent!);
- method public android.view.View! focusSearch(android.view.View!, int);
- method public boolean hasOverlappingRendering();
- method protected boolean onRequestFocusInDescendants(int, android.graphics.Rect!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static interface PlaybackTransportRowView.OnUnhandledKeyListener {
- method public boolean onUnhandledKey(android.view.KeyEvent!);
- }
-
- public class RowHeaderPresenter extends androidx.leanback.widget.Presenter {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public RowHeaderPresenter(int);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public RowHeaderPresenter(int, boolean);
- }
-
- public static class RowHeaderPresenter.ViewHolder extends androidx.leanback.widget.Presenter.ViewHolder {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public RowHeaderPresenter.ViewHolder(androidx.leanback.widget.RowHeaderView!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ScaleFrameLayout {
- ctor public ScaleFrameLayout(android.content.Context!);
- ctor public ScaleFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public ScaleFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- method public void addView(android.view.View!, int, android.view.ViewGroup.LayoutParams!);
- method protected boolean addViewInLayout(android.view.View!, int, android.view.ViewGroup.LayoutParams!, boolean);
- method protected void onLayout(boolean, int, int, int, int);
- method protected void onMeasure(int, int);
- method public void setChildScale(float);
- method public void setForeground(android.graphics.drawable.Drawable!);
- method public void setLayoutScaleX(float);
- method public void setLayoutScaleY(float);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class SeekBar {
- ctor public SeekBar(android.content.Context!, android.util.AttributeSet!);
- method public CharSequence! getAccessibilityClassName();
- method public int getMax();
- method public int getProgress();
- method public int getSecondProgress();
- method public int getSecondaryProgressColor();
- method protected void onDraw(android.graphics.Canvas!);
- method protected void onFocusChanged(boolean, int, android.graphics.Rect!);
- method protected void onSizeChanged(int, int, int, int);
- method public boolean performAccessibilityAction(int, android.os.Bundle!);
- method public void setAccessibilitySeekListener(androidx.leanback.widget.SeekBar.AccessibilitySeekListener!);
- method public void setActiveBarHeight(int);
- method public void setActiveRadius(int);
- method public void setBarHeight(int);
- method public void setMax(int);
- method public void setProgress(int);
- method public void setProgressColor(int);
- method public void setSecondaryProgress(int);
- method public void setSecondaryProgressColor(int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract static class SeekBar.AccessibilitySeekListener {
- ctor public SeekBar.AccessibilitySeekListener();
- method public abstract boolean onAccessibilitySeekBackward();
- method public abstract boolean onAccessibilitySeekForward();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ThumbsBar {
- ctor public ThumbsBar(android.content.Context!, android.util.AttributeSet!);
- ctor public ThumbsBar(android.content.Context!, android.util.AttributeSet!, int);
- method public void clearThumbBitmaps();
- method protected android.view.View! createThumbView(android.view.ViewGroup!);
- method public int getHeroIndex();
- method public android.graphics.Bitmap! getThumbBitmap(int);
- method protected void onLayout(boolean, int, int, int, int);
- method protected void onMeasure(int, int);
- method public void setHeroThumbSize(int, int);
- method public void setNumberOfThumbs(int);
- method public void setThumbBitmap(int, android.graphics.Bitmap!);
- method public void setThumbSize(int, int);
- method public void setThumbSpace(int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class Util {
- method public static boolean isDescendant(android.view.ViewGroup!, android.view.View!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class VideoSurfaceView {
- ctor public VideoSurfaceView(android.content.Context!);
- ctor public VideoSurfaceView(android.content.Context!, android.util.AttributeSet!);
- ctor public VideoSurfaceView(android.content.Context!, android.util.AttributeSet!, int);
- method public void setTransitionVisibility(int);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public @interface Visibility {
- }
-
-}
-
-package androidx.leanback.widget.picker {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class DatePicker extends androidx.leanback.widget.picker.Picker {
- ctor public DatePicker(android.content.Context!, android.util.AttributeSet!);
- ctor public DatePicker(android.content.Context!, android.util.AttributeSet!, int);
- method public long getDate();
- method public String! getDatePickerFormat();
- method public long getMaxDate();
- method public long getMinDate();
- method public final void onColumnValueChanged(int, int);
- method public void setDatePickerFormat(String!);
- method public void setMaxDate(long);
- method public void setMinDate(long);
- method public void updateDate(int, int, int, boolean);
- }
-
-}
-
diff --git a/leanback/api/restricted_1.1.0-alpha02.txt b/leanback/api/restricted_1.1.0-alpha02.txt
deleted file mode 100644
index d54d9cd..0000000
--- a/leanback/api/restricted_1.1.0-alpha02.txt
+++ /dev/null
@@ -1,438 +0,0 @@
-// Signature format: 3.0
-package androidx.leanback.animation {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class LogAccelerateInterpolator implements android.animation.TimeInterpolator {
- ctor public LogAccelerateInterpolator(int, int);
- method public float getInterpolation(float);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class LogDecelerateInterpolator implements android.animation.TimeInterpolator {
- ctor public LogDecelerateInterpolator(int, int);
- method public float getInterpolation(float);
- }
-
-}
-
-package androidx.leanback.app {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class BackgroundFragment extends android.app.Fragment {
- ctor public BackgroundFragment();
- }
-
- @Deprecated public class GuidedStepFragment extends android.app.Fragment implements androidx.leanback.widget.GuidedActionAdapter.FocusListener {
- method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
- method @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setEntranceTransitionType(int);
- field @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int SLIDE_FROM_BOTTOM = 1; // 0x1
- field @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int SLIDE_FROM_SIDE = 0; // 0x0
- }
-
- @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class GuidedStepFragment.DummyFragment extends android.app.Fragment {
- ctor @Deprecated public GuidedStepFragment.DummyFragment();
- }
-
- public class GuidedStepSupportFragment extends androidx.fragment.app.Fragment implements androidx.leanback.widget.GuidedActionAdapter.FocusListener {
- method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setEntranceTransitionType(int);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int SLIDE_FROM_BOTTOM = 1; // 0x1
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int SLIDE_FROM_SIDE = 0; // 0x0
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class GuidedStepSupportFragment.DummyFragment extends androidx.fragment.app.Fragment {
- ctor public GuidedStepSupportFragment.DummyFragment();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PermissionHelper {
- method public static void requestPermissions(android.app.Fragment!, String[]!, int);
- }
-
- @Deprecated public class PlaybackFragment extends android.app.Fragment {
- }
-
-
- public class PlaybackSupportFragment extends androidx.fragment.app.Fragment {
- }
-
-
-}
-
-package androidx.leanback.media {
-
- @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MediaPlayerGlue extends androidx.leanback.media.PlaybackControlGlue implements androidx.leanback.widget.OnItemViewSelectedListener {
- ctor @Deprecated public MediaPlayerGlue(android.content.Context!);
- ctor @Deprecated public MediaPlayerGlue(android.content.Context!, int[]!, int[]!);
- method @Deprecated public int getCurrentPosition();
- method @Deprecated public int getCurrentSpeedId();
- method @Deprecated public android.graphics.drawable.Drawable! getMediaArt();
- method @Deprecated public int getMediaDuration();
- method @Deprecated public CharSequence! getMediaSubtitle();
- method @Deprecated public CharSequence! getMediaTitle();
- method @Deprecated public long getSupportedActions();
- method @Deprecated public boolean hasValidMedia();
- method @Deprecated public boolean isMediaPlaying();
- method @Deprecated public void onItemSelected(androidx.leanback.widget.Presenter.ViewHolder!, Object!, androidx.leanback.widget.RowPresenter.ViewHolder!, androidx.leanback.widget.Row!);
- method @Deprecated public void release();
- method @Deprecated public void reset();
- method @Deprecated protected void seekTo(int);
- method @Deprecated public void setArtist(String!);
- method @Deprecated public void setCover(android.graphics.drawable.Drawable!);
- method @Deprecated public void setDisplay(android.view.SurfaceHolder!);
- method @Deprecated public boolean setMediaSource(android.net.Uri!);
- method @Deprecated public boolean setMediaSource(String!);
- method @Deprecated public void setMode(int);
- method @Deprecated public void setTitle(String!);
- method @Deprecated public void setVideoUrl(String!);
- field @Deprecated public static final int FAST_FORWARD_REWIND_REPEAT_DELAY = 200; // 0xc8
- field @Deprecated public static final int FAST_FORWARD_REWIND_STEP = 10000; // 0x2710
- field @Deprecated public static final int NO_REPEAT = 0; // 0x0
- field @Deprecated public static final int REPEAT_ALL = 2; // 0x2
- field @Deprecated public static final int REPEAT_ONE = 1; // 0x1
- field @Deprecated protected final androidx.leanback.widget.PlaybackControlsRow.ThumbsDownAction! mThumbsDownAction;
- field @Deprecated protected final androidx.leanback.widget.PlaybackControlsRow.ThumbsUpAction! mThumbsUpAction;
- }
-
- @IntDef(flag=true, value={androidx.leanback.media.PlaybackBannerControlGlue.ACTION_CUSTOM_LEFT_FIRST, androidx.leanback.media.PlaybackBannerControlGlue.ACTION_SKIP_TO_PREVIOUS, androidx.leanback.media.PlaybackBannerControlGlue.ACTION_REWIND, androidx.leanback.media.PlaybackBannerControlGlue.ACTION_PLAY_PAUSE, androidx.leanback.media.PlaybackBannerControlGlue.ACTION_FAST_FORWARD, androidx.leanback.media.PlaybackBannerControlGlue.ACTION_SKIP_TO_NEXT, androidx.leanback.media.PlaybackBannerControlGlue.ACTION_CUSTOM_RIGHT_FIRST}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PlaybackBannerControlGlue.ACTION_ {
- }
-
- public abstract class PlaybackControlGlue extends androidx.leanback.media.PlaybackGlue implements androidx.leanback.widget.OnActionClickedListener android.view.View.OnKeyListener {
- }
-
-}
-
-package androidx.leanback.system {
-
- public class Settings {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isOutlineClippingDisabled();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean preferStaticShadows();
- }
-
-}
-
-package androidx.leanback.transition {
-
- @RequiresApi(21) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class FadeAndShortSlide extends android.transition.Visibility {
- ctor public FadeAndShortSlide();
- ctor public FadeAndShortSlide(int);
- ctor public FadeAndShortSlide(android.content.Context!, android.util.AttributeSet!);
- method public float getDistance();
- method public void setDistance(float);
- method public void setSlideEdge(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class LeanbackTransitionHelper {
- method public static Object! loadTitleInTransition(android.content.Context!);
- method public static Object! loadTitleOutTransition(android.content.Context!);
- }
-
- @RequiresApi(21) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ParallaxTransition extends android.transition.Visibility {
- ctor public ParallaxTransition();
- ctor public ParallaxTransition(android.content.Context!, android.util.AttributeSet!);
- }
-
- @RequiresApi(21) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class SlideNoPropagation extends android.transition.Slide {
- ctor public SlideNoPropagation();
- ctor public SlideNoPropagation(int);
- ctor public SlideNoPropagation(android.content.Context!, android.util.AttributeSet!);
- }
-
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class TransitionHelper {
- method public static void addSharedElement(android.app.FragmentTransaction!, android.view.View!, String!);
- method public static void addTarget(Object!, android.view.View!);
- method public static void addTransition(Object!, Object!);
- method public static void addTransitionListener(Object!, androidx.leanback.transition.TransitionListener!);
- method public static void beginDelayedTransition(android.view.ViewGroup!, Object!);
- method public static Object! createAutoTransition();
- method public static Object! createChangeBounds(boolean);
- method public static Object! createChangeTransform();
- method public static Object! createDefaultInterpolator(android.content.Context!);
- method public static Object! createFadeAndShortSlide(int);
- method public static Object! createFadeAndShortSlide(int, float);
- method public static Object! createFadeTransition(int);
- method public static Object! createScale();
- method public static Object! createScene(android.view.ViewGroup!, Runnable!);
- method public static Object! createSlide(int);
- method public static Object! createTransitionSet(boolean);
- method public static void exclude(Object!, int, boolean);
- method public static void exclude(Object!, android.view.View!, boolean);
- method public static void excludeChildren(Object!, int, boolean);
- method public static void excludeChildren(Object!, android.view.View!, boolean);
- method public static Object! getEnterTransition(android.view.Window!);
- method public static Object! getExitTransition(android.view.Window!);
- method public static Object! getReenterTransition(android.view.Window!);
- method public static Object! getReturnTransition(android.view.Window!);
- method public static Object! getSharedElementEnterTransition(android.view.Window!);
- method public static Object! getSharedElementExitTransition(android.view.Window!);
- method public static Object! getSharedElementReenterTransition(android.view.Window!);
- method public static Object! getSharedElementReturnTransition(android.view.Window!);
- method public static void include(Object!, int);
- method public static void include(Object!, android.view.View!);
- method public static Object! loadTransition(android.content.Context!, int);
- method public static void removeTransitionListener(Object!, androidx.leanback.transition.TransitionListener!);
- method public static void runTransition(Object!, Object!);
- method public static void setChangeBoundsDefaultStartDelay(Object!, int);
- method public static void setChangeBoundsStartDelay(Object!, android.view.View!, int);
- method public static void setChangeBoundsStartDelay(Object!, int, int);
- method public static void setChangeBoundsStartDelay(Object!, String!, int);
- method public static void setDuration(Object!, long);
- method public static void setEnterTransition(android.view.Window!, Object!);
- method public static void setEnterTransition(android.app.Fragment!, Object!);
- method public static void setEpicenterCallback(Object!, androidx.leanback.transition.TransitionEpicenterCallback!);
- method public static void setExitTransition(android.app.Fragment!, Object!);
- method public static void setInterpolator(Object!, Object!);
- method public static void setReturnTransition(android.view.Window!, Object!);
- method public static void setSharedElementEnterTransition(android.view.Window!, Object!);
- method public static void setSharedElementEnterTransition(android.app.Fragment!, Object!);
- method public static void setSharedElementReturnTransition(android.view.Window!, Object!);
- method public static void setStartDelay(Object!, long);
- method public static void setTransitionGroup(android.view.ViewGroup!, boolean);
- method public static boolean systemSupportsEntranceTransitions();
- field public static final int FADE_IN = 1; // 0x1
- field public static final int FADE_OUT = 2; // 0x2
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TransitionListener {
- ctor public TransitionListener();
- method public void onTransitionCancel(Object!);
- method public void onTransitionEnd(Object!);
- method public void onTransitionPause(Object!);
- method public void onTransitionResume(Object!);
- method public void onTransitionStart(Object!);
- field protected Object! mImpl;
- }
-
-}
-
-package androidx.leanback.util {
-
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class StateMachine {
- ctor public StateMachine();
- method public void addState(androidx.leanback.util.StateMachine.State!);
- method public void addTransition(androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.Event!);
- method public void addTransition(androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.Condition!);
- method public void addTransition(androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.State!);
- method public void fireEvent(androidx.leanback.util.StateMachine.Event!);
- method public void reset();
- method public void start();
- field public static final int STATUS_INVOKED = 1; // 0x1
- field public static final int STATUS_ZERO = 0; // 0x0
- }
-
- public static class StateMachine.Condition {
- ctor public StateMachine.Condition(String!);
- method public boolean canProceed();
- }
-
- public static class StateMachine.Event {
- ctor public StateMachine.Event(String!);
- }
-
- public static class StateMachine.State {
- ctor public StateMachine.State(String!);
- ctor public StateMachine.State(String!, boolean, boolean);
- method public final int getStatus();
- method public void run();
- }
-
-}
-
-package androidx.leanback.widget {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class BackgroundHelper {
- method public static void setBackgroundPreservingAlpha(android.view.View!, android.graphics.drawable.Drawable!);
- }
-
- public abstract class BaseGridView extends androidx.recyclerview.widget.RecyclerView {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getExtraLayoutSpace();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getFocusScrollStrategy();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getSelectedSubPosition();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setExtraLayoutSpace(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setFocusScrollStrategy(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSelectedPositionSmoothWithSub(int, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSelectedPositionWithSub(int, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSelectedPositionWithSub(int, int, int);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int FOCUS_SCROLL_ALIGNED = 0; // 0x0
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int FOCUS_SCROLL_ITEM = 1; // 0x1
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int FOCUS_SCROLL_PAGE = 2; // 0x2
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class BrowseRowsFrameLayout extends android.widget.FrameLayout {
- ctor public BrowseRowsFrameLayout(android.content.Context!);
- ctor public BrowseRowsFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public BrowseRowsFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- }
-
-
- public class DividerPresenter extends androidx.leanback.widget.Presenter {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public DividerPresenter(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class GuidedActionAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter {
- ctor public GuidedActionAdapter(java.util.List<androidx.leanback.widget.GuidedAction>!, androidx.leanback.widget.GuidedActionAdapter.ClickListener!, androidx.leanback.widget.GuidedActionAdapter.FocusListener!, androidx.leanback.widget.GuidedActionsStylist!, boolean);
- method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder! findSubChildViewHolder(android.view.View!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public java.util.List<androidx.leanback.widget.GuidedAction>! getActions();
- method public int getCount();
- method public androidx.leanback.widget.GuidedActionsStylist! getGuidedActionsStylist();
- method public androidx.leanback.widget.GuidedAction! getItem(int);
- method public int getItemCount();
- method public void handleCheckedActions(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public int indexOf(androidx.leanback.widget.GuidedAction!);
- method public void onBindViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder!, int);
- method public androidx.recyclerview.widget.RecyclerView.ViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
- method public void performOnActionClick(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void setActions(java.util.List<androidx.leanback.widget.GuidedAction>!);
- method public void setClickListener(androidx.leanback.widget.GuidedActionAdapter.ClickListener!);
- method public void setDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction>!);
- method public void setFocusListener(androidx.leanback.widget.GuidedActionAdapter.FocusListener!);
- }
-
- public static interface GuidedActionAdapter.ClickListener {
- method public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- }
-
- public static interface GuidedActionAdapter.EditListener {
- method public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
- method public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
- method public void onImeClose();
- method public void onImeOpen();
- }
-
- public static interface GuidedActionAdapter.FocusListener {
- method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class GuidedActionAdapterGroup {
- ctor public GuidedActionAdapterGroup();
- method public void addAdpter(androidx.leanback.widget.GuidedActionAdapter!, androidx.leanback.widget.GuidedActionAdapter!);
- method public void closeIme(android.view.View!);
- method public void fillAndGoNext(androidx.leanback.widget.GuidedActionAdapter!, android.widget.TextView!);
- method public void fillAndStay(androidx.leanback.widget.GuidedActionAdapter!, android.widget.TextView!);
- method public androidx.leanback.widget.GuidedActionAdapter! getNextAdapter(androidx.leanback.widget.GuidedActionAdapter!);
- method public void openIme(androidx.leanback.widget.GuidedActionAdapter!, androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void setEditListener(androidx.leanback.widget.GuidedActionAdapter.EditListener!);
- }
-
- public class GuidedActionsStylist implements androidx.leanback.widget.FragmentAnimationProvider {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setEditListener(androidx.leanback.widget.GuidedActionAdapter.EditListener!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class InvisibleRowPresenter extends androidx.leanback.widget.RowPresenter {
- ctor public InvisibleRowPresenter();
- method protected androidx.leanback.widget.RowPresenter.ViewHolder! createRowViewHolder(android.view.ViewGroup!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MediaNowPlayingView extends android.widget.LinearLayout {
- ctor public MediaNowPlayingView(android.content.Context!, android.util.AttributeSet!);
- field protected final android.view.animation.LinearInterpolator! mLinearInterpolator;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class NonOverlappingLinearLayout extends android.widget.LinearLayout {
- ctor public NonOverlappingLinearLayout(android.content.Context!);
- ctor public NonOverlappingLinearLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public NonOverlappingLinearLayout(android.content.Context!, android.util.AttributeSet!, int);
- method public void setFocusableViewAvailableFixEnabled(boolean);
- }
-
- public abstract class ObjectAdapter {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final boolean hasObserver();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PagingIndicator extends android.view.View {
- ctor public PagingIndicator(android.content.Context!);
- ctor public PagingIndicator(android.content.Context!, android.util.AttributeSet!);
- ctor public PagingIndicator(android.content.Context!, android.util.AttributeSet!, int);
- method public void onPageSelected(int, boolean);
- method public void setArrowBackgroundColor(@ColorInt int);
- method public void setArrowColor(@ColorInt int);
- method public void setDotBackgroundColor(@ColorInt int);
- method public void setPageCount(int);
- }
-
- public class PagingIndicator.Dot {
- ctor public PagingIndicator.Dot();
- method public void adjustAlpha();
- method public float getAlpha();
- method public float getDiameter();
- method public float getTranslationX();
- method public void setAlpha(float);
- method public void setDiameter(float);
- method public void setTranslationX(float);
- }
-
- public abstract class ParallaxEffect {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PlaybackTransportRowView extends android.widget.LinearLayout {
- ctor public PlaybackTransportRowView(android.content.Context!, android.util.AttributeSet!);
- ctor public PlaybackTransportRowView(android.content.Context!, android.util.AttributeSet!, int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface PlaybackTransportRowView.OnUnhandledKeyListener {
- method public boolean onUnhandledKey(android.view.KeyEvent!);
- }
-
- public class RowHeaderPresenter extends androidx.leanback.widget.Presenter {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public RowHeaderPresenter(int);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public RowHeaderPresenter(int, boolean);
- }
-
- public static class RowHeaderPresenter.ViewHolder extends androidx.leanback.widget.Presenter.ViewHolder {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public RowHeaderPresenter.ViewHolder(androidx.leanback.widget.RowHeaderView!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ScaleFrameLayout extends android.widget.FrameLayout {
- ctor public ScaleFrameLayout(android.content.Context!);
- ctor public ScaleFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public ScaleFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- method public void setChildScale(float);
- method public void setLayoutScaleX(float);
- method public void setLayoutScaleY(float);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class SeekBar extends android.view.View {
- ctor public SeekBar(android.content.Context!, android.util.AttributeSet!);
- method public int getMax();
- method public int getProgress();
- method public int getSecondProgress();
- method public int getSecondaryProgressColor();
- method public void setAccessibilitySeekListener(androidx.leanback.widget.SeekBar.AccessibilitySeekListener!);
- method public void setActiveBarHeight(int);
- method public void setActiveRadius(int);
- method public void setBarHeight(int);
- method public void setMax(int);
- method public void setProgress(int);
- method public void setProgressColor(int);
- method public void setSecondaryProgress(int);
- method public void setSecondaryProgressColor(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract static class SeekBar.AccessibilitySeekListener {
- ctor public SeekBar.AccessibilitySeekListener();
- method public abstract boolean onAccessibilitySeekBackward();
- method public abstract boolean onAccessibilitySeekForward();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ThumbsBar extends android.widget.LinearLayout {
- ctor public ThumbsBar(android.content.Context!, android.util.AttributeSet!);
- ctor public ThumbsBar(android.content.Context!, android.util.AttributeSet!, int);
- method public void clearThumbBitmaps();
- method protected android.view.View! createThumbView(android.view.ViewGroup!);
- method public int getHeroIndex();
- method public android.graphics.Bitmap! getThumbBitmap(int);
- method public void setHeroThumbSize(int, int);
- method public void setNumberOfThumbs(int);
- method public void setThumbBitmap(int, android.graphics.Bitmap!);
- method public void setThumbSize(int, int);
- method public void setThumbSpace(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class Util {
- method public static boolean isDescendant(android.view.ViewGroup!, android.view.View!);
- }
-
-
- @IntDef({android.view.View.VISIBLE, android.view.View.INVISIBLE, android.view.View.GONE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public @interface Visibility {
- }
-
-}
-
diff --git a/leanback/api/restricted_current.txt b/leanback/api/restricted_current.txt
deleted file mode 100644
index d54d9cd..0000000
--- a/leanback/api/restricted_current.txt
+++ /dev/null
@@ -1,438 +0,0 @@
-// Signature format: 3.0
-package androidx.leanback.animation {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class LogAccelerateInterpolator implements android.animation.TimeInterpolator {
- ctor public LogAccelerateInterpolator(int, int);
- method public float getInterpolation(float);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class LogDecelerateInterpolator implements android.animation.TimeInterpolator {
- ctor public LogDecelerateInterpolator(int, int);
- method public float getInterpolation(float);
- }
-
-}
-
-package androidx.leanback.app {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class BackgroundFragment extends android.app.Fragment {
- ctor public BackgroundFragment();
- }
-
- @Deprecated public class GuidedStepFragment extends android.app.Fragment implements androidx.leanback.widget.GuidedActionAdapter.FocusListener {
- method @Deprecated public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
- method @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setEntranceTransitionType(int);
- field @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int SLIDE_FROM_BOTTOM = 1; // 0x1
- field @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int SLIDE_FROM_SIDE = 0; // 0x0
- }
-
- @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class GuidedStepFragment.DummyFragment extends android.app.Fragment {
- ctor @Deprecated public GuidedStepFragment.DummyFragment();
- }
-
- public class GuidedStepSupportFragment extends androidx.fragment.app.Fragment implements androidx.leanback.widget.GuidedActionAdapter.FocusListener {
- method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setEntranceTransitionType(int);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int SLIDE_FROM_BOTTOM = 1; // 0x1
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int SLIDE_FROM_SIDE = 0; // 0x0
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class GuidedStepSupportFragment.DummyFragment extends androidx.fragment.app.Fragment {
- ctor public GuidedStepSupportFragment.DummyFragment();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PermissionHelper {
- method public static void requestPermissions(android.app.Fragment!, String[]!, int);
- }
-
- @Deprecated public class PlaybackFragment extends android.app.Fragment {
- }
-
-
- public class PlaybackSupportFragment extends androidx.fragment.app.Fragment {
- }
-
-
-}
-
-package androidx.leanback.media {
-
- @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MediaPlayerGlue extends androidx.leanback.media.PlaybackControlGlue implements androidx.leanback.widget.OnItemViewSelectedListener {
- ctor @Deprecated public MediaPlayerGlue(android.content.Context!);
- ctor @Deprecated public MediaPlayerGlue(android.content.Context!, int[]!, int[]!);
- method @Deprecated public int getCurrentPosition();
- method @Deprecated public int getCurrentSpeedId();
- method @Deprecated public android.graphics.drawable.Drawable! getMediaArt();
- method @Deprecated public int getMediaDuration();
- method @Deprecated public CharSequence! getMediaSubtitle();
- method @Deprecated public CharSequence! getMediaTitle();
- method @Deprecated public long getSupportedActions();
- method @Deprecated public boolean hasValidMedia();
- method @Deprecated public boolean isMediaPlaying();
- method @Deprecated public void onItemSelected(androidx.leanback.widget.Presenter.ViewHolder!, Object!, androidx.leanback.widget.RowPresenter.ViewHolder!, androidx.leanback.widget.Row!);
- method @Deprecated public void release();
- method @Deprecated public void reset();
- method @Deprecated protected void seekTo(int);
- method @Deprecated public void setArtist(String!);
- method @Deprecated public void setCover(android.graphics.drawable.Drawable!);
- method @Deprecated public void setDisplay(android.view.SurfaceHolder!);
- method @Deprecated public boolean setMediaSource(android.net.Uri!);
- method @Deprecated public boolean setMediaSource(String!);
- method @Deprecated public void setMode(int);
- method @Deprecated public void setTitle(String!);
- method @Deprecated public void setVideoUrl(String!);
- field @Deprecated public static final int FAST_FORWARD_REWIND_REPEAT_DELAY = 200; // 0xc8
- field @Deprecated public static final int FAST_FORWARD_REWIND_STEP = 10000; // 0x2710
- field @Deprecated public static final int NO_REPEAT = 0; // 0x0
- field @Deprecated public static final int REPEAT_ALL = 2; // 0x2
- field @Deprecated public static final int REPEAT_ONE = 1; // 0x1
- field @Deprecated protected final androidx.leanback.widget.PlaybackControlsRow.ThumbsDownAction! mThumbsDownAction;
- field @Deprecated protected final androidx.leanback.widget.PlaybackControlsRow.ThumbsUpAction! mThumbsUpAction;
- }
-
- @IntDef(flag=true, value={androidx.leanback.media.PlaybackBannerControlGlue.ACTION_CUSTOM_LEFT_FIRST, androidx.leanback.media.PlaybackBannerControlGlue.ACTION_SKIP_TO_PREVIOUS, androidx.leanback.media.PlaybackBannerControlGlue.ACTION_REWIND, androidx.leanback.media.PlaybackBannerControlGlue.ACTION_PLAY_PAUSE, androidx.leanback.media.PlaybackBannerControlGlue.ACTION_FAST_FORWARD, androidx.leanback.media.PlaybackBannerControlGlue.ACTION_SKIP_TO_NEXT, androidx.leanback.media.PlaybackBannerControlGlue.ACTION_CUSTOM_RIGHT_FIRST}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PlaybackBannerControlGlue.ACTION_ {
- }
-
- public abstract class PlaybackControlGlue extends androidx.leanback.media.PlaybackGlue implements androidx.leanback.widget.OnActionClickedListener android.view.View.OnKeyListener {
- }
-
-}
-
-package androidx.leanback.system {
-
- public class Settings {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isOutlineClippingDisabled();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean preferStaticShadows();
- }
-
-}
-
-package androidx.leanback.transition {
-
- @RequiresApi(21) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class FadeAndShortSlide extends android.transition.Visibility {
- ctor public FadeAndShortSlide();
- ctor public FadeAndShortSlide(int);
- ctor public FadeAndShortSlide(android.content.Context!, android.util.AttributeSet!);
- method public float getDistance();
- method public void setDistance(float);
- method public void setSlideEdge(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class LeanbackTransitionHelper {
- method public static Object! loadTitleInTransition(android.content.Context!);
- method public static Object! loadTitleOutTransition(android.content.Context!);
- }
-
- @RequiresApi(21) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ParallaxTransition extends android.transition.Visibility {
- ctor public ParallaxTransition();
- ctor public ParallaxTransition(android.content.Context!, android.util.AttributeSet!);
- }
-
- @RequiresApi(21) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class SlideNoPropagation extends android.transition.Slide {
- ctor public SlideNoPropagation();
- ctor public SlideNoPropagation(int);
- ctor public SlideNoPropagation(android.content.Context!, android.util.AttributeSet!);
- }
-
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class TransitionHelper {
- method public static void addSharedElement(android.app.FragmentTransaction!, android.view.View!, String!);
- method public static void addTarget(Object!, android.view.View!);
- method public static void addTransition(Object!, Object!);
- method public static void addTransitionListener(Object!, androidx.leanback.transition.TransitionListener!);
- method public static void beginDelayedTransition(android.view.ViewGroup!, Object!);
- method public static Object! createAutoTransition();
- method public static Object! createChangeBounds(boolean);
- method public static Object! createChangeTransform();
- method public static Object! createDefaultInterpolator(android.content.Context!);
- method public static Object! createFadeAndShortSlide(int);
- method public static Object! createFadeAndShortSlide(int, float);
- method public static Object! createFadeTransition(int);
- method public static Object! createScale();
- method public static Object! createScene(android.view.ViewGroup!, Runnable!);
- method public static Object! createSlide(int);
- method public static Object! createTransitionSet(boolean);
- method public static void exclude(Object!, int, boolean);
- method public static void exclude(Object!, android.view.View!, boolean);
- method public static void excludeChildren(Object!, int, boolean);
- method public static void excludeChildren(Object!, android.view.View!, boolean);
- method public static Object! getEnterTransition(android.view.Window!);
- method public static Object! getExitTransition(android.view.Window!);
- method public static Object! getReenterTransition(android.view.Window!);
- method public static Object! getReturnTransition(android.view.Window!);
- method public static Object! getSharedElementEnterTransition(android.view.Window!);
- method public static Object! getSharedElementExitTransition(android.view.Window!);
- method public static Object! getSharedElementReenterTransition(android.view.Window!);
- method public static Object! getSharedElementReturnTransition(android.view.Window!);
- method public static void include(Object!, int);
- method public static void include(Object!, android.view.View!);
- method public static Object! loadTransition(android.content.Context!, int);
- method public static void removeTransitionListener(Object!, androidx.leanback.transition.TransitionListener!);
- method public static void runTransition(Object!, Object!);
- method public static void setChangeBoundsDefaultStartDelay(Object!, int);
- method public static void setChangeBoundsStartDelay(Object!, android.view.View!, int);
- method public static void setChangeBoundsStartDelay(Object!, int, int);
- method public static void setChangeBoundsStartDelay(Object!, String!, int);
- method public static void setDuration(Object!, long);
- method public static void setEnterTransition(android.view.Window!, Object!);
- method public static void setEnterTransition(android.app.Fragment!, Object!);
- method public static void setEpicenterCallback(Object!, androidx.leanback.transition.TransitionEpicenterCallback!);
- method public static void setExitTransition(android.app.Fragment!, Object!);
- method public static void setInterpolator(Object!, Object!);
- method public static void setReturnTransition(android.view.Window!, Object!);
- method public static void setSharedElementEnterTransition(android.view.Window!, Object!);
- method public static void setSharedElementEnterTransition(android.app.Fragment!, Object!);
- method public static void setSharedElementReturnTransition(android.view.Window!, Object!);
- method public static void setStartDelay(Object!, long);
- method public static void setTransitionGroup(android.view.ViewGroup!, boolean);
- method public static boolean systemSupportsEntranceTransitions();
- field public static final int FADE_IN = 1; // 0x1
- field public static final int FADE_OUT = 2; // 0x2
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TransitionListener {
- ctor public TransitionListener();
- method public void onTransitionCancel(Object!);
- method public void onTransitionEnd(Object!);
- method public void onTransitionPause(Object!);
- method public void onTransitionResume(Object!);
- method public void onTransitionStart(Object!);
- field protected Object! mImpl;
- }
-
-}
-
-package androidx.leanback.util {
-
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class StateMachine {
- ctor public StateMachine();
- method public void addState(androidx.leanback.util.StateMachine.State!);
- method public void addTransition(androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.Event!);
- method public void addTransition(androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.Condition!);
- method public void addTransition(androidx.leanback.util.StateMachine.State!, androidx.leanback.util.StateMachine.State!);
- method public void fireEvent(androidx.leanback.util.StateMachine.Event!);
- method public void reset();
- method public void start();
- field public static final int STATUS_INVOKED = 1; // 0x1
- field public static final int STATUS_ZERO = 0; // 0x0
- }
-
- public static class StateMachine.Condition {
- ctor public StateMachine.Condition(String!);
- method public boolean canProceed();
- }
-
- public static class StateMachine.Event {
- ctor public StateMachine.Event(String!);
- }
-
- public static class StateMachine.State {
- ctor public StateMachine.State(String!);
- ctor public StateMachine.State(String!, boolean, boolean);
- method public final int getStatus();
- method public void run();
- }
-
-}
-
-package androidx.leanback.widget {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class BackgroundHelper {
- method public static void setBackgroundPreservingAlpha(android.view.View!, android.graphics.drawable.Drawable!);
- }
-
- public abstract class BaseGridView extends androidx.recyclerview.widget.RecyclerView {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getExtraLayoutSpace();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getFocusScrollStrategy();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getSelectedSubPosition();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setExtraLayoutSpace(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setFocusScrollStrategy(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSelectedPositionSmoothWithSub(int, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSelectedPositionWithSub(int, int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setSelectedPositionWithSub(int, int, int);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int FOCUS_SCROLL_ALIGNED = 0; // 0x0
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int FOCUS_SCROLL_ITEM = 1; // 0x1
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int FOCUS_SCROLL_PAGE = 2; // 0x2
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class BrowseRowsFrameLayout extends android.widget.FrameLayout {
- ctor public BrowseRowsFrameLayout(android.content.Context!);
- ctor public BrowseRowsFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public BrowseRowsFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- }
-
-
- public class DividerPresenter extends androidx.leanback.widget.Presenter {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public DividerPresenter(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class GuidedActionAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter {
- ctor public GuidedActionAdapter(java.util.List<androidx.leanback.widget.GuidedAction>!, androidx.leanback.widget.GuidedActionAdapter.ClickListener!, androidx.leanback.widget.GuidedActionAdapter.FocusListener!, androidx.leanback.widget.GuidedActionsStylist!, boolean);
- method public androidx.leanback.widget.GuidedActionsStylist.ViewHolder! findSubChildViewHolder(android.view.View!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public java.util.List<androidx.leanback.widget.GuidedAction>! getActions();
- method public int getCount();
- method public androidx.leanback.widget.GuidedActionsStylist! getGuidedActionsStylist();
- method public androidx.leanback.widget.GuidedAction! getItem(int);
- method public int getItemCount();
- method public void handleCheckedActions(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public int indexOf(androidx.leanback.widget.GuidedAction!);
- method public void onBindViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder!, int);
- method public androidx.recyclerview.widget.RecyclerView.ViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
- method public void performOnActionClick(androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void setActions(java.util.List<androidx.leanback.widget.GuidedAction>!);
- method public void setClickListener(androidx.leanback.widget.GuidedActionAdapter.ClickListener!);
- method public void setDiffCallback(androidx.leanback.widget.DiffCallback<androidx.leanback.widget.GuidedAction>!);
- method public void setFocusListener(androidx.leanback.widget.GuidedActionAdapter.FocusListener!);
- }
-
- public static interface GuidedActionAdapter.ClickListener {
- method public void onGuidedActionClicked(androidx.leanback.widget.GuidedAction!);
- }
-
- public static interface GuidedActionAdapter.EditListener {
- method public void onGuidedActionEditCanceled(androidx.leanback.widget.GuidedAction!);
- method public long onGuidedActionEditedAndProceed(androidx.leanback.widget.GuidedAction!);
- method public void onImeClose();
- method public void onImeOpen();
- }
-
- public static interface GuidedActionAdapter.FocusListener {
- method public void onGuidedActionFocused(androidx.leanback.widget.GuidedAction!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class GuidedActionAdapterGroup {
- ctor public GuidedActionAdapterGroup();
- method public void addAdpter(androidx.leanback.widget.GuidedActionAdapter!, androidx.leanback.widget.GuidedActionAdapter!);
- method public void closeIme(android.view.View!);
- method public void fillAndGoNext(androidx.leanback.widget.GuidedActionAdapter!, android.widget.TextView!);
- method public void fillAndStay(androidx.leanback.widget.GuidedActionAdapter!, android.widget.TextView!);
- method public androidx.leanback.widget.GuidedActionAdapter! getNextAdapter(androidx.leanback.widget.GuidedActionAdapter!);
- method public void openIme(androidx.leanback.widget.GuidedActionAdapter!, androidx.leanback.widget.GuidedActionsStylist.ViewHolder!);
- method public void setEditListener(androidx.leanback.widget.GuidedActionAdapter.EditListener!);
- }
-
- public class GuidedActionsStylist implements androidx.leanback.widget.FragmentAnimationProvider {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setEditListener(androidx.leanback.widget.GuidedActionAdapter.EditListener!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class InvisibleRowPresenter extends androidx.leanback.widget.RowPresenter {
- ctor public InvisibleRowPresenter();
- method protected androidx.leanback.widget.RowPresenter.ViewHolder! createRowViewHolder(android.view.ViewGroup!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MediaNowPlayingView extends android.widget.LinearLayout {
- ctor public MediaNowPlayingView(android.content.Context!, android.util.AttributeSet!);
- field protected final android.view.animation.LinearInterpolator! mLinearInterpolator;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class NonOverlappingLinearLayout extends android.widget.LinearLayout {
- ctor public NonOverlappingLinearLayout(android.content.Context!);
- ctor public NonOverlappingLinearLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public NonOverlappingLinearLayout(android.content.Context!, android.util.AttributeSet!, int);
- method public void setFocusableViewAvailableFixEnabled(boolean);
- }
-
- public abstract class ObjectAdapter {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final boolean hasObserver();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PagingIndicator extends android.view.View {
- ctor public PagingIndicator(android.content.Context!);
- ctor public PagingIndicator(android.content.Context!, android.util.AttributeSet!);
- ctor public PagingIndicator(android.content.Context!, android.util.AttributeSet!, int);
- method public void onPageSelected(int, boolean);
- method public void setArrowBackgroundColor(@ColorInt int);
- method public void setArrowColor(@ColorInt int);
- method public void setDotBackgroundColor(@ColorInt int);
- method public void setPageCount(int);
- }
-
- public class PagingIndicator.Dot {
- ctor public PagingIndicator.Dot();
- method public void adjustAlpha();
- method public float getAlpha();
- method public float getDiameter();
- method public float getTranslationX();
- method public void setAlpha(float);
- method public void setDiameter(float);
- method public void setTranslationX(float);
- }
-
- public abstract class ParallaxEffect {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PlaybackTransportRowView extends android.widget.LinearLayout {
- ctor public PlaybackTransportRowView(android.content.Context!, android.util.AttributeSet!);
- ctor public PlaybackTransportRowView(android.content.Context!, android.util.AttributeSet!, int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface PlaybackTransportRowView.OnUnhandledKeyListener {
- method public boolean onUnhandledKey(android.view.KeyEvent!);
- }
-
- public class RowHeaderPresenter extends androidx.leanback.widget.Presenter {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public RowHeaderPresenter(int);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public RowHeaderPresenter(int, boolean);
- }
-
- public static class RowHeaderPresenter.ViewHolder extends androidx.leanback.widget.Presenter.ViewHolder {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public RowHeaderPresenter.ViewHolder(androidx.leanback.widget.RowHeaderView!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ScaleFrameLayout extends android.widget.FrameLayout {
- ctor public ScaleFrameLayout(android.content.Context!);
- ctor public ScaleFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public ScaleFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- method public void setChildScale(float);
- method public void setLayoutScaleX(float);
- method public void setLayoutScaleY(float);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class SeekBar extends android.view.View {
- ctor public SeekBar(android.content.Context!, android.util.AttributeSet!);
- method public int getMax();
- method public int getProgress();
- method public int getSecondProgress();
- method public int getSecondaryProgressColor();
- method public void setAccessibilitySeekListener(androidx.leanback.widget.SeekBar.AccessibilitySeekListener!);
- method public void setActiveBarHeight(int);
- method public void setActiveRadius(int);
- method public void setBarHeight(int);
- method public void setMax(int);
- method public void setProgress(int);
- method public void setProgressColor(int);
- method public void setSecondaryProgress(int);
- method public void setSecondaryProgressColor(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract static class SeekBar.AccessibilitySeekListener {
- ctor public SeekBar.AccessibilitySeekListener();
- method public abstract boolean onAccessibilitySeekBackward();
- method public abstract boolean onAccessibilitySeekForward();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ThumbsBar extends android.widget.LinearLayout {
- ctor public ThumbsBar(android.content.Context!, android.util.AttributeSet!);
- ctor public ThumbsBar(android.content.Context!, android.util.AttributeSet!, int);
- method public void clearThumbBitmaps();
- method protected android.view.View! createThumbView(android.view.ViewGroup!);
- method public int getHeroIndex();
- method public android.graphics.Bitmap! getThumbBitmap(int);
- method public void setHeroThumbSize(int, int);
- method public void setNumberOfThumbs(int);
- method public void setThumbBitmap(int, android.graphics.Bitmap!);
- method public void setThumbSize(int, int);
- method public void setThumbSpace(int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class Util {
- method public static boolean isDescendant(android.view.ViewGroup!, android.view.View!);
- }
-
-
- @IntDef({android.view.View.VISIBLE, android.view.View.INVISIBLE, android.view.View.GONE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public @interface Visibility {
- }
-
-}
-
diff --git a/leanback/api21/androidx/leanback/transition/FadeAndShortSlide.java b/leanback/api21/androidx/leanback/transition/FadeAndShortSlide.java
index 29a290b..f197c57 100644
--- a/leanback/api21/androidx/leanback/transition/FadeAndShortSlide.java
+++ b/leanback/api21/androidx/leanback/transition/FadeAndShortSlide.java
@@ -15,7 +15,7 @@
*/
package androidx.leanback.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.AnimatorSet;
@@ -42,7 +42,7 @@
* @hide
*/
@RequiresApi(21)
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class FadeAndShortSlide extends Visibility {
private static final TimeInterpolator sDecelerate = new DecelerateInterpolator();
diff --git a/leanback/api21/androidx/leanback/transition/SlideNoPropagation.java b/leanback/api21/androidx/leanback/transition/SlideNoPropagation.java
index a10a0cc..3ff7847 100644
--- a/leanback/api21/androidx/leanback/transition/SlideNoPropagation.java
+++ b/leanback/api21/androidx/leanback/transition/SlideNoPropagation.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.transition.Slide;
@@ -26,7 +26,7 @@
* @hide
*/
@RequiresApi(21)
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class SlideNoPropagation extends Slide {
public SlideNoPropagation() {
diff --git a/leanback/api21/androidx/leanback/transition/TranslationAnimationCreator.java b/leanback/api21/androidx/leanback/transition/TranslationAnimationCreator.java
index 4dd2597..455a60d 100644
--- a/leanback/api21/androidx/leanback/transition/TranslationAnimationCreator.java
+++ b/leanback/api21/androidx/leanback/transition/TranslationAnimationCreator.java
@@ -1,6 +1,6 @@
package androidx.leanback.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -23,7 +23,7 @@
* @hide
*/
@RequiresApi(21)
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
class TranslationAnimationCreator {
/**
diff --git a/leanback/build.gradle b/leanback/build.gradle
index e9cf2a8..1229c11 100644
--- a/leanback/build.gradle
+++ b/leanback/build.gradle
@@ -7,10 +7,8 @@
}
dependencies {
- api(project(":annotation"))
api("androidx.interpolator:interpolator:1.0.0")
- api(project(":core"))
- implementation("androidx.collection:collection:1.0.0")
+ api("androidx.core:core:1.0.0")
api("androidx.media:media:1.0.0")
api("androidx.fragment:fragment:1.0.0")
api("androidx.recyclerview:recyclerview:1.0.0")
diff --git a/leanback/common/androidx/leanback/transition/TransitionListener.java b/leanback/common/androidx/leanback/transition/TransitionListener.java
index 838fafc..da91d8b 100644
--- a/leanback/common/androidx/leanback/transition/TransitionListener.java
+++ b/leanback/common/androidx/leanback/transition/TransitionListener.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
@@ -21,7 +21,7 @@
* Listeners for transition start and stop.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class TransitionListener {
protected Object mImpl;
diff --git a/leanback/src/androidTest/java/androidx/leanback/app/HeadersFragmentTest.java b/leanback/src/androidTest/java/androidx/leanback/app/HeadersFragmentTest.java
index aa625df..74399dd 100644
--- a/leanback/src/androidTest/java/androidx/leanback/app/HeadersFragmentTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/app/HeadersFragmentTest.java
@@ -32,12 +32,12 @@
import androidx.leanback.widget.ListRowPresenter;
import androidx.leanback.widget.VerticalGridView;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class HeadersFragmentTest extends SingleFragmentTestBase {
diff --git a/leanback/src/androidTest/java/androidx/leanback/app/HeadersSupportFragmentTest.java b/leanback/src/androidTest/java/androidx/leanback/app/HeadersSupportFragmentTest.java
index 809edea1..976bacf 100644
--- a/leanback/src/androidTest/java/androidx/leanback/app/HeadersSupportFragmentTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/app/HeadersSupportFragmentTest.java
@@ -29,12 +29,12 @@
import androidx.leanback.widget.ListRowPresenter;
import androidx.leanback.widget.VerticalGridView;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class HeadersSupportFragmentTest extends SingleSupportFragmentTestBase {
diff --git a/leanback/src/androidTest/java/androidx/leanback/app/ListRowDataAdapterTest.java b/leanback/src/androidTest/java/androidx/leanback/app/ListRowDataAdapterTest.java
index b16643e..81afadf 100644
--- a/leanback/src/androidTest/java/androidx/leanback/app/ListRowDataAdapterTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/app/ListRowDataAdapterTest.java
@@ -28,7 +28,7 @@
import androidx.leanback.widget.PresenterSelector;
import androidx.leanback.widget.SectionRow;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SmallTest;
import org.junit.Before;
@@ -176,7 +176,7 @@
assertEquals(3, listRowDataAdapter.size());
}
- @SmallTest
+ @MediumTest
@Test
public void adapterSize_nonVisibleRowRemoved() {
int itemCount = 4;
diff --git a/leanback/src/androidTest/java/androidx/leanback/app/PlaybackFragmentTest.java b/leanback/src/androidTest/java/androidx/leanback/app/PlaybackFragmentTest.java
index 1bd73fb..8b8ce9a 100644
--- a/leanback/src/androidTest/java/androidx/leanback/app/PlaybackFragmentTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/app/PlaybackFragmentTest.java
@@ -48,7 +48,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.Suppress;
import org.junit.Test;
@@ -56,7 +56,7 @@
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class PlaybackFragmentTest extends SingleFragmentTestBase {
diff --git a/leanback/src/androidTest/java/androidx/leanback/app/PlaybackSupportFragmentTest.java b/leanback/src/androidTest/java/androidx/leanback/app/PlaybackSupportFragmentTest.java
index 7e4bba2..747d06e 100644
--- a/leanback/src/androidTest/java/androidx/leanback/app/PlaybackSupportFragmentTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/app/PlaybackSupportFragmentTest.java
@@ -51,6 +51,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.Suppress;
import org.junit.Test;
@@ -58,7 +59,7 @@
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class PlaybackSupportFragmentTest extends SingleSupportFragmentTestBase {
diff --git a/leanback/src/androidTest/java/androidx/leanback/app/VerticalGridFragmentTest.java b/leanback/src/androidTest/java/androidx/leanback/app/VerticalGridFragmentTest.java
index 16ad9ce..00058ab 100644
--- a/leanback/src/androidTest/java/androidx/leanback/app/VerticalGridFragmentTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/app/VerticalGridFragmentTest.java
@@ -25,13 +25,13 @@
import androidx.leanback.widget.ArrayObjectAdapter;
import androidx.leanback.widget.VerticalGridPresenter;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class VerticalGridFragmentTest extends SingleFragmentTestBase {
diff --git a/leanback/src/androidTest/java/androidx/leanback/app/VerticalGridSupportFragmentTest.java b/leanback/src/androidTest/java/androidx/leanback/app/VerticalGridSupportFragmentTest.java
index 4594ec8..f940396 100644
--- a/leanback/src/androidTest/java/androidx/leanback/app/VerticalGridSupportFragmentTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/app/VerticalGridSupportFragmentTest.java
@@ -22,13 +22,13 @@
import androidx.leanback.widget.ArrayObjectAdapter;
import androidx.leanback.widget.VerticalGridPresenter;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class VerticalGridSupportFragmentTest extends SingleSupportFragmentTestBase {
diff --git a/leanback/src/androidTest/java/androidx/leanback/graphics/FitWidthBitmapDrawableTest.java b/leanback/src/androidTest/java/androidx/leanback/graphics/FitWidthBitmapDrawableTest.java
index 177ca54..68f0a1c 100644
--- a/leanback/src/androidTest/java/androidx/leanback/graphics/FitWidthBitmapDrawableTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/graphics/FitWidthBitmapDrawableTest.java
@@ -27,7 +27,7 @@
import android.os.Build;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
import androidx.test.filters.SmallTest;
@@ -46,7 +46,7 @@
private final static int HEIGHT = 600;
private Bitmap bitmap = Bitmap.createBitmap(WIDTH, HEIGHT, Bitmap.Config.ARGB_8888);
- @LargeTest
+ @MediumTest
@Test
public void draw_withOffset() {
int offset = 600;
diff --git a/leanback/src/androidTest/java/androidx/leanback/media/PlaybackBannerControlGlueTest.java b/leanback/src/androidTest/java/androidx/leanback/media/PlaybackBannerControlGlueTest.java
index c778851..6ced4d8 100644
--- a/leanback/src/androidTest/java/androidx/leanback/media/PlaybackBannerControlGlueTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/media/PlaybackBannerControlGlueTest.java
@@ -34,13 +34,13 @@
import androidx.leanback.widget.PlaybackControlsRowPresenter;
import androidx.leanback.widget.PlaybackRowPresenter;
import androidx.leanback.widget.RowPresenter;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.mockito.Mockito;
-@LargeTest
+@SmallTest
public class PlaybackBannerControlGlueTest {
public static class PlayerAdapterSample extends PlayerAdapter {
diff --git a/leanback/src/androidTest/java/androidx/leanback/media/PlaybackGlueTest.java b/leanback/src/androidTest/java/androidx/leanback/media/PlaybackGlueTest.java
index 8cb2066..df5ff5d 100644
--- a/leanback/src/androidTest/java/androidx/leanback/media/PlaybackGlueTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/media/PlaybackGlueTest.java
@@ -28,7 +28,7 @@
import android.content.Context;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
@@ -36,7 +36,7 @@
import org.mockito.Mockito;
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
public class PlaybackGlueTest {
diff --git a/leanback/src/androidTest/java/androidx/leanback/media/PlaybackTransportControlGlueTest.java b/leanback/src/androidTest/java/androidx/leanback/media/PlaybackTransportControlGlueTest.java
index 547667b..986c2fc 100644
--- a/leanback/src/androidTest/java/androidx/leanback/media/PlaybackTransportControlGlueTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/media/PlaybackTransportControlGlueTest.java
@@ -36,13 +36,13 @@
import androidx.leanback.widget.PlaybackRowPresenter;
import androidx.leanback.widget.PlaybackTransportRowPresenter;
import androidx.leanback.widget.RowPresenter;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.mockito.Mockito;
-@MediumTest
+@SmallTest
public class PlaybackTransportControlGlueTest {
public static class PlayerAdapterSample extends PlayerAdapter {
diff --git a/leanback/src/androidTest/java/androidx/leanback/widget/GridWidgetPrefetchTest.java b/leanback/src/androidTest/java/androidx/leanback/widget/GridWidgetPrefetchTest.java
index 3747e0e..c42831d 100644
--- a/leanback/src/androidTest/java/androidx/leanback/widget/GridWidgetPrefetchTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/widget/GridWidgetPrefetchTest.java
@@ -16,14 +16,14 @@
import androidx.recyclerview.widget.RecyclerView;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.ArrayList;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class GridWidgetPrefetchTest {
diff --git a/leanback/src/androidTest/java/androidx/leanback/widget/ListRowPresenterTest.java b/leanback/src/androidTest/java/androidx/leanback/widget/ListRowPresenterTest.java
index 59dde3f..cb8a2fa1 100644
--- a/leanback/src/androidTest/java/androidx/leanback/widget/ListRowPresenterTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/widget/ListRowPresenterTest.java
@@ -32,14 +32,14 @@
import androidx.core.view.ViewCompat;
import androidx.leanback.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class ListRowPresenterTest {
static final float DELTA = 1f;
diff --git a/leanback/src/androidTest/java/androidx/leanback/widget/ParallaxFloatEffectTest.java b/leanback/src/androidTest/java/androidx/leanback/widget/ParallaxFloatEffectTest.java
index 37900fd..3114d8e 100644
--- a/leanback/src/androidTest/java/androidx/leanback/widget/ParallaxFloatEffectTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/widget/ParallaxFloatEffectTest.java
@@ -26,7 +26,7 @@
import android.util.Property;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -36,7 +36,7 @@
import org.mockito.MockitoAnnotations;
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
public class ParallaxFloatEffectTest {
Parallax<Parallax.FloatProperty> mSource;
diff --git a/leanback/src/androidTest/java/androidx/leanback/widget/PlaybackTransportRowPresenterTest.java b/leanback/src/androidTest/java/androidx/leanback/widget/PlaybackTransportRowPresenterTest.java
index 6f691c1..0a395f5 100644
--- a/leanback/src/androidTest/java/androidx/leanback/widget/PlaybackTransportRowPresenterTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/widget/PlaybackTransportRowPresenterTest.java
@@ -38,7 +38,7 @@
import androidx.leanback.media.PlaybackTransportControlGlue;
import androidx.leanback.media.PlayerAdapter;
import androidx.leanback.widget.PlaybackSeekDataProvider.ResultCallback;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Before;
@@ -47,7 +47,7 @@
import java.util.Arrays;
-@MediumTest
+@SmallTest
public class PlaybackTransportRowPresenterTest {
Context mContext;
diff --git a/leanback/src/androidTest/java/androidx/leanback/widget/PresenterTest.java b/leanback/src/androidTest/java/androidx/leanback/widget/PresenterTest.java
index 9c168fe..cf03798 100644
--- a/leanback/src/androidTest/java/androidx/leanback/widget/PresenterTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/widget/PresenterTest.java
@@ -31,13 +31,13 @@
import androidx.leanback.app.HeadersFragment;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class PresenterTest {
private Context mContext;
diff --git a/leanback/src/androidTest/java/androidx/leanback/widget/ShadowOverlayContainerTest.java b/leanback/src/androidTest/java/androidx/leanback/widget/ShadowOverlayContainerTest.java
index 78f6c27..280095f 100644
--- a/leanback/src/androidTest/java/androidx/leanback/widget/ShadowOverlayContainerTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/widget/ShadowOverlayContainerTest.java
@@ -26,13 +26,13 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class ShadowOverlayContainerTest {
private Context mContext;
diff --git a/leanback/src/androidTest/java/androidx/leanback/widget/ThumbsBarTest.java b/leanback/src/androidTest/java/androidx/leanback/widget/ThumbsBarTest.java
index 9a675a6..1bee7ac 100644
--- a/leanback/src/androidTest/java/androidx/leanback/widget/ThumbsBarTest.java
+++ b/leanback/src/androidTest/java/androidx/leanback/widget/ThumbsBarTest.java
@@ -26,13 +26,14 @@
import androidx.leanback.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class ThumbsBarTest {
diff --git a/leanback/src/main/java/androidx/leanback/animation/LogAccelerateInterpolator.java b/leanback/src/main/java/androidx/leanback/animation/LogAccelerateInterpolator.java
index 284815a..3816087 100644
--- a/leanback/src/main/java/androidx/leanback/animation/LogAccelerateInterpolator.java
+++ b/leanback/src/main/java/androidx/leanback/animation/LogAccelerateInterpolator.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.animation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.TimeInterpolator;
@@ -22,7 +22,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class LogAccelerateInterpolator implements TimeInterpolator {
int mBase;
diff --git a/leanback/src/main/java/androidx/leanback/animation/LogDecelerateInterpolator.java b/leanback/src/main/java/androidx/leanback/animation/LogDecelerateInterpolator.java
index d13ac78..383814a 100644
--- a/leanback/src/main/java/androidx/leanback/animation/LogDecelerateInterpolator.java
+++ b/leanback/src/main/java/androidx/leanback/animation/LogDecelerateInterpolator.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.animation;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.TimeInterpolator;
@@ -22,7 +22,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class LogDecelerateInterpolator implements TimeInterpolator {
int mBase;
diff --git a/leanback/src/main/java/androidx/leanback/app/BackgroundFragment.java b/leanback/src/main/java/androidx/leanback/app/BackgroundFragment.java
index d02edee..87d73ab 100644
--- a/leanback/src/main/java/androidx/leanback/app/BackgroundFragment.java
+++ b/leanback/src/main/java/androidx/leanback/app/BackgroundFragment.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Fragment;
@@ -23,7 +23,7 @@
* Fragment used by the background manager.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class BackgroundFragment extends Fragment {
private BackgroundManager mBackgroundManager;
diff --git a/leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java b/leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java
index 27b3d99..ec1a131 100644
--- a/leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java
+++ b/leanback/src/main/java/androidx/leanback/app/GuidedStepFragment.java
@@ -16,7 +16,7 @@
*/
package androidx.leanback.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.AnimatorSet;
@@ -231,14 +231,14 @@
* Animation to slide the contents from the side (left/right).
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int SLIDE_FROM_SIDE = 0;
/**
* Animation to slide the contents from the bottom.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int SLIDE_FROM_BOTTOM = 1;
private static final String TAG = "GuidedStepF";
@@ -247,7 +247,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class DummyFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
@@ -1348,7 +1348,7 @@
* For now clients(subclasses) can call this method inside the constructor.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setEntranceTransitionType(int transitionType) {
this.entranceTransitionType = transitionType;
}
diff --git a/leanback/src/main/java/androidx/leanback/app/GuidedStepSupportFragment.java b/leanback/src/main/java/androidx/leanback/app/GuidedStepSupportFragment.java
index c82116f..fe94957 100644
--- a/leanback/src/main/java/androidx/leanback/app/GuidedStepSupportFragment.java
+++ b/leanback/src/main/java/androidx/leanback/app/GuidedStepSupportFragment.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.AnimatorSet;
@@ -226,14 +226,14 @@
* Animation to slide the contents from the side (left/right).
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int SLIDE_FROM_SIDE = 0;
/**
* Animation to slide the contents from the bottom.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int SLIDE_FROM_BOTTOM = 1;
private static final String TAG = "GuidedStepF";
@@ -242,7 +242,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class DummyFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
@@ -1343,7 +1343,7 @@
* For now clients(subclasses) can call this method inside the constructor.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setEntranceTransitionType(int transitionType) {
this.entranceTransitionType = transitionType;
}
diff --git a/leanback/src/main/java/androidx/leanback/app/PermissionHelper.java b/leanback/src/main/java/androidx/leanback/app/PermissionHelper.java
index cd32e18..a7e56bb 100644
--- a/leanback/src/main/java/androidx/leanback/app/PermissionHelper.java
+++ b/leanback/src/main/java/androidx/leanback/app/PermissionHelper.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Build;
@@ -22,7 +22,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class PermissionHelper {
public static void requestPermissions(android.app.Fragment fragment, String[] permissions,
diff --git a/leanback/src/main/java/androidx/leanback/media/MediaPlayerGlue.java b/leanback/src/main/java/androidx/leanback/media/MediaPlayerGlue.java
index b8fd5e6..02d159b 100644
--- a/leanback/src/main/java/androidx/leanback/media/MediaPlayerGlue.java
+++ b/leanback/src/main/java/androidx/leanback/media/MediaPlayerGlue.java
@@ -55,7 +55,7 @@
* @deprecated Use {@link MediaPlayerAdapter} with {@link PlaybackTransportControlGlue} or
* {@link PlaybackBannerControlGlue}.
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Deprecated
public class MediaPlayerGlue extends PlaybackControlGlue implements
OnItemViewSelectedListener {
diff --git a/leanback/src/main/java/androidx/leanback/media/PlaybackBannerControlGlue.java b/leanback/src/main/java/androidx/leanback/media/PlaybackBannerControlGlue.java
index 84d4f61..aee3acd 100644
--- a/leanback/src/main/java/androidx/leanback/media/PlaybackBannerControlGlue.java
+++ b/leanback/src/main/java/androidx/leanback/media/PlaybackBannerControlGlue.java
@@ -16,7 +16,7 @@
package androidx.leanback.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.util.Log;
@@ -95,7 +95,7 @@
ACTION_SKIP_TO_NEXT,
ACTION_CUSTOM_RIGHT_FIRST
})
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
public @interface ACTION_ {}
@@ -151,7 +151,7 @@
PLAYBACK_SPEED_FAST_L3,
PLAYBACK_SPEED_FAST_L4
})
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
private @interface SPEED {}
diff --git a/leanback/src/main/java/androidx/leanback/system/Settings.java b/leanback/src/main/java/androidx/leanback/system/Settings.java
index 636b8d3..b24e4f0 100644
--- a/leanback/src/main/java/androidx/leanback/system/Settings.java
+++ b/leanback/src/main/java/androidx/leanback/system/Settings.java
@@ -16,7 +16,7 @@
package androidx.leanback.system;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.ActivityManager;
import android.content.Context;
@@ -76,7 +76,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean preferStaticShadows() {
return mPreferStaticShadows;
}
@@ -86,7 +86,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isOutlineClippingDisabled() {
return mOutlineClippingDisabled;
}
diff --git a/leanback/src/main/java/androidx/leanback/transition/LeanbackTransitionHelper.java b/leanback/src/main/java/androidx/leanback/transition/LeanbackTransitionHelper.java
index 836c02c..9693013 100644
--- a/leanback/src/main/java/androidx/leanback/transition/LeanbackTransitionHelper.java
+++ b/leanback/src/main/java/androidx/leanback/transition/LeanbackTransitionHelper.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.os.Build;
@@ -27,7 +27,7 @@
* Helper class to load Leanback specific transition.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class LeanbackTransitionHelper {
public static Object loadTitleInTransition(Context context) {
diff --git a/leanback/src/main/java/androidx/leanback/transition/ParallaxTransition.java b/leanback/src/main/java/androidx/leanback/transition/ParallaxTransition.java
index 6596cf1..35636c9 100644
--- a/leanback/src/main/java/androidx/leanback/transition/ParallaxTransition.java
+++ b/leanback/src/main/java/androidx/leanback/transition/ParallaxTransition.java
@@ -16,7 +16,7 @@
package androidx.leanback.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.ValueAnimator;
@@ -43,7 +43,7 @@
* @hide
*/
@RequiresApi(21)
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ParallaxTransition extends Visibility {
static Interpolator sInterpolator = new LinearInterpolator();
diff --git a/leanback/src/main/java/androidx/leanback/transition/TransitionHelper.java b/leanback/src/main/java/androidx/leanback/transition/TransitionHelper.java
index f0ead7d..4d8c877 100644
--- a/leanback/src/main/java/androidx/leanback/transition/TransitionHelper.java
+++ b/leanback/src/main/java/androidx/leanback/transition/TransitionHelper.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.TimeInterpolator;
import android.content.Context;
@@ -40,7 +40,7 @@
* Helper for view transitions.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class TransitionHelper {
public static final int FADE_IN = 0x1;
diff --git a/leanback/src/main/java/androidx/leanback/util/StateMachine.java b/leanback/src/main/java/androidx/leanback/util/StateMachine.java
index 893fa74..06a33cf 100644
--- a/leanback/src/main/java/androidx/leanback/util/StateMachine.java
+++ b/leanback/src/main/java/androidx/leanback/util/StateMachine.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.util;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.util.Log;
@@ -35,7 +35,7 @@
* is executed and {@link Transition#mCondition} passes.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class StateMachine {
static final boolean DEBUG = false;
diff --git a/leanback/src/main/java/androidx/leanback/widget/BackgroundHelper.java b/leanback/src/main/java/androidx/leanback/widget/BackgroundHelper.java
index 3a57eb9..f72ff44 100644
--- a/leanback/src/main/java/androidx/leanback/widget/BackgroundHelper.java
+++ b/leanback/src/main/java/androidx/leanback/widget/BackgroundHelper.java
@@ -15,7 +15,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.drawable.Drawable;
import android.os.Build;
@@ -27,7 +27,7 @@
* Helper for view backgrounds.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class BackgroundHelper {
public static void setBackgroundPreservingAlpha(View view, Drawable drawable) {
if (Build.VERSION.SDK_INT >= 19) {
diff --git a/leanback/src/main/java/androidx/leanback/widget/BaseGridView.java b/leanback/src/main/java/androidx/leanback/widget/BaseGridView.java
index f95c78f..15c843c 100644
--- a/leanback/src/main/java/androidx/leanback/widget/BaseGridView.java
+++ b/leanback/src/main/java/androidx/leanback/widget/BaseGridView.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.TypedArray;
@@ -45,14 +45,14 @@
* is back to the view.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public final static int FOCUS_SCROLL_ALIGNED = 0;
/**
* Scroll to make the focused item inside client area.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public final static int FOCUS_SCROLL_ITEM = 1;
/**
@@ -60,7 +60,7 @@
* The page size matches the client area size of RecyclerView.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public final static int FOCUS_SCROLL_PAGE = 2;
/**
@@ -272,7 +272,7 @@
* </ul>
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setFocusScrollStrategy(int scrollStrategy) {
if (scrollStrategy != FOCUS_SCROLL_ALIGNED && scrollStrategy != FOCUS_SCROLL_ITEM
&& scrollStrategy != FOCUS_SCROLL_PAGE) {
@@ -291,7 +291,7 @@
* </ul>
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public int getFocusScrollStrategy() {
return mLayoutManager.getFocusScrollStrategy();
}
@@ -685,7 +685,7 @@
* Changes the selected item and/or subposition immediately without animation.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setSelectedPositionWithSub(int position, int subposition) {
mLayoutManager.setSelectionWithSub(position, subposition, 0);
}
@@ -705,7 +705,7 @@
* another {@link #setSelectedPosition} or {@link #setSelectedPositionSmooth} call.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setSelectedPositionWithSub(int position, int subposition, int scrollExtra) {
mLayoutManager.setSelectionWithSub(position, subposition, scrollExtra);
}
@@ -724,7 +724,7 @@
* position.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setSelectedPositionSmoothWithSub(int position, int subposition) {
mLayoutManager.setSelectionSmoothWithSub(position, subposition);
}
@@ -796,7 +796,7 @@
* is defined.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public int getSelectedSubPosition() {
return mLayoutManager.getSubSelection();
}
@@ -1109,7 +1109,7 @@
* Must be bigger or equals to 0.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setExtraLayoutSpace(int extraLayoutSpace) {
mLayoutManager.setExtraLayoutSpace(extraLayoutSpace);
}
@@ -1119,7 +1119,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public int getExtraLayoutSpace() {
return mLayoutManager.getExtraLayoutSpace();
}
diff --git a/leanback/src/main/java/androidx/leanback/widget/BrowseRowsFrameLayout.java b/leanback/src/main/java/androidx/leanback/widget/BrowseRowsFrameLayout.java
index 4332d34..f8ea638 100644
--- a/leanback/src/main/java/androidx/leanback/widget/BrowseRowsFrameLayout.java
+++ b/leanback/src/main/java/androidx/leanback/widget/BrowseRowsFrameLayout.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.util.AttributeSet;
@@ -28,7 +28,7 @@
* using hardcoded DIPS.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class BrowseRowsFrameLayout extends FrameLayout {
public BrowseRowsFrameLayout(Context context) {
diff --git a/leanback/src/main/java/androidx/leanback/widget/DividerPresenter.java b/leanback/src/main/java/androidx/leanback/widget/DividerPresenter.java
index 4b6748f..c0f224f 100644
--- a/leanback/src/main/java/androidx/leanback/widget/DividerPresenter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/DividerPresenter.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.LayoutInflater;
import android.view.View;
@@ -36,7 +36,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public DividerPresenter(int layoutResourceId) {
mLayoutResourceId = layoutResourceId;
}
diff --git a/leanback/src/main/java/androidx/leanback/widget/FocusHighlightHandler.java b/leanback/src/main/java/androidx/leanback/widget/FocusHighlightHandler.java
index db92f83..314de8a 100644
--- a/leanback/src/main/java/androidx/leanback/widget/FocusHighlightHandler.java
+++ b/leanback/src/main/java/androidx/leanback/widget/FocusHighlightHandler.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.View;
@@ -30,7 +30,7 @@
* @param view The view whose focus is changing.
* @param hasFocus True if focus is gained; false otherwise.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void onItemFocused(View view, boolean hasFocus);
/**
diff --git a/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java b/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java
index 351d5c8..507ad34 100644
--- a/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapter.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.util.Log;
import android.view.KeyEvent;
@@ -41,7 +41,7 @@
* {@link GuidedActionAdapter.ClickListener} and {@link GuidedActionAdapter.FocusListener}.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class GuidedActionAdapter extends RecyclerView.Adapter {
static final String TAG = "GuidedActionAdapter";
static final boolean DEBUG = false;
@@ -279,7 +279,7 @@
* Used for serialization only.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public List<GuidedAction> getActions() {
return new ArrayList<GuidedAction>(mActions);
}
diff --git a/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapterGroup.java b/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapterGroup.java
index f4e16be..0e354de4 100644
--- a/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapterGroup.java
+++ b/leanback/src/main/java/androidx/leanback/widget/GuidedActionAdapterGroup.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.util.Log;
@@ -32,7 +32,7 @@
* editing finished, maintain the Ime open/close status.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class GuidedActionAdapterGroup {
private static final String TAG_EDIT = "EditableAction";
diff --git a/leanback/src/main/java/androidx/leanback/widget/GuidedActionEditText.java b/leanback/src/main/java/androidx/leanback/widget/GuidedActionEditText.java
index 018f7dc1..408380e2 100644
--- a/leanback/src/main/java/androidx/leanback/widget/GuidedActionEditText.java
+++ b/leanback/src/main/java/androidx/leanback/widget/GuidedActionEditText.java
@@ -146,6 +146,7 @@
* See
* {@link TextViewCompat#setCustomSelectionActionModeCallback(TextView, ActionMode.Callback)}
*/
+ @SuppressWarnings("RestrictedApi")
@Override
public void setCustomSelectionActionModeCallback(ActionMode.Callback actionModeCallback) {
super.setCustomSelectionActionModeCallback(TextViewCompat
diff --git a/leanback/src/main/java/androidx/leanback/widget/GuidedActionsStylist.java b/leanback/src/main/java/androidx/leanback/widget/GuidedActionsStylist.java
index 3770108..dcfdaab 100644
--- a/leanback/src/main/java/androidx/leanback/widget/GuidedActionsStylist.java
+++ b/leanback/src/main/java/androidx/leanback/widget/GuidedActionsStylist.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.leanback.widget.GuidedAction.EDITING_ACTIVATOR_VIEW;
import static androidx.leanback.widget.GuidedAction.EDITING_DESCRIPTION;
import static androidx.leanback.widget.GuidedAction.EDITING_NONE;
@@ -1030,7 +1030,7 @@
* Sets listener for reporting view being edited.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setEditListener(EditListener listener) {
mEditListener = listener;
}
diff --git a/leanback/src/main/java/androidx/leanback/widget/InvisibleRowPresenter.java b/leanback/src/main/java/androidx/leanback/widget/InvisibleRowPresenter.java
index d8c6961..25197f4 100644
--- a/leanback/src/main/java/androidx/leanback/widget/InvisibleRowPresenter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/InvisibleRowPresenter.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
@@ -23,7 +23,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class InvisibleRowPresenter extends RowPresenter {
public InvisibleRowPresenter() {
diff --git a/leanback/src/main/java/androidx/leanback/widget/MediaNowPlayingView.java b/leanback/src/main/java/androidx/leanback/widget/MediaNowPlayingView.java
index 3bcce0e..90849f2 100644
--- a/leanback/src/main/java/androidx/leanback/widget/MediaNowPlayingView.java
+++ b/leanback/src/main/java/androidx/leanback/widget/MediaNowPlayingView.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.ObjectAnimator;
@@ -33,7 +33,7 @@
* The view displaying 3 animated peak meters next to each other when a media item is playing.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class MediaNowPlayingView extends LinearLayout{
private final ImageView mImage1;
diff --git a/leanback/src/main/java/androidx/leanback/widget/NonOverlappingLinearLayout.java b/leanback/src/main/java/androidx/leanback/widget/NonOverlappingLinearLayout.java
index 6b02520..bf1385f 100644
--- a/leanback/src/main/java/androidx/leanback/widget/NonOverlappingLinearLayout.java
+++ b/leanback/src/main/java/androidx/leanback/widget/NonOverlappingLinearLayout.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.util.AttributeSet;
@@ -27,7 +27,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class NonOverlappingLinearLayout extends LinearLayout {
boolean mFocusableViewAvailableFixEnabled = false;
diff --git a/leanback/src/main/java/androidx/leanback/widget/ObjectAdapter.java b/leanback/src/main/java/androidx/leanback/widget/ObjectAdapter.java
index c938e1e..988b5fb0 100644
--- a/leanback/src/main/java/androidx/leanback/widget/ObjectAdapter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/ObjectAdapter.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.database.Observable;
@@ -217,7 +217,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public final boolean hasObserver() {
return mObservable.hasObserver();
}
diff --git a/leanback/src/main/java/androidx/leanback/widget/PagingIndicator.java b/leanback/src/main/java/androidx/leanback/widget/PagingIndicator.java
index dafc41b..53bda36 100644
--- a/leanback/src/main/java/androidx/leanback/widget/PagingIndicator.java
+++ b/leanback/src/main/java/androidx/leanback/widget/PagingIndicator.java
@@ -16,7 +16,7 @@
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.AnimatorSet;
@@ -48,7 +48,7 @@
* A page indicator with dots.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class PagingIndicator extends View {
private static final long DURATION_ALPHA = 167;
private static final long DURATION_DIAMETER = 417;
diff --git a/leanback/src/main/java/androidx/leanback/widget/PlaybackTransportRowView.java b/leanback/src/main/java/androidx/leanback/widget/PlaybackTransportRowView.java
index 3ccee0e..a99db75 100644
--- a/leanback/src/main/java/androidx/leanback/widget/PlaybackTransportRowView.java
+++ b/leanback/src/main/java/androidx/leanback/widget/PlaybackTransportRowView.java
@@ -16,7 +16,7 @@
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Rect;
@@ -34,13 +34,13 @@
* View for PlaybackTransportRowPresenter that has a custom focusSearch.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class PlaybackTransportRowView extends LinearLayout {
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public interface OnUnhandledKeyListener {
/**
* Returns true if the key event should be consumed.
diff --git a/leanback/src/main/java/androidx/leanback/widget/ResizingTextView.java b/leanback/src/main/java/androidx/leanback/widget/ResizingTextView.java
index e7c9bf5..a839ab9 100644
--- a/leanback/src/main/java/androidx/leanback/widget/ResizingTextView.java
+++ b/leanback/src/main/java/androidx/leanback/widget/ResizingTextView.java
@@ -278,6 +278,7 @@
* See
* {@link TextViewCompat#setCustomSelectionActionModeCallback(TextView, ActionMode.Callback)}
*/
+ @SuppressWarnings("RestrictedApi")
@Override
public void setCustomSelectionActionModeCallback(ActionMode.Callback actionModeCallback) {
super.setCustomSelectionActionModeCallback(TextViewCompat
diff --git a/leanback/src/main/java/androidx/leanback/widget/RowHeaderPresenter.java b/leanback/src/main/java/androidx/leanback/widget/RowHeaderPresenter.java
index 1c250de..5f93dca 100644
--- a/leanback/src/main/java/androidx/leanback/widget/RowHeaderPresenter.java
+++ b/leanback/src/main/java/androidx/leanback/widget/RowHeaderPresenter.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Paint;
import android.text.TextUtils;
@@ -49,7 +49,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public RowHeaderPresenter(int layoutResourceId) {
this(layoutResourceId, true);
}
@@ -57,7 +57,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public RowHeaderPresenter(int layoutResourceId, boolean animateSelect) {
mLayoutResourceId = layoutResourceId;
mAnimateSelect = animateSelect;
@@ -103,7 +103,7 @@
* @param view The single RowHeaderView.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ViewHolder(RowHeaderView view) {
super(view);
mTitleView = view;
diff --git a/leanback/src/main/java/androidx/leanback/widget/RowHeaderView.java b/leanback/src/main/java/androidx/leanback/widget/RowHeaderView.java
index 7ca6b2c..0d696de 100644
--- a/leanback/src/main/java/androidx/leanback/widget/RowHeaderView.java
+++ b/leanback/src/main/java/androidx/leanback/widget/RowHeaderView.java
@@ -42,6 +42,7 @@
* See
* {@link TextViewCompat#setCustomSelectionActionModeCallback(TextView, ActionMode.Callback)}
*/
+ @SuppressWarnings("RestrictedApi")
@Override
public void setCustomSelectionActionModeCallback(ActionMode.Callback actionModeCallback) {
super.setCustomSelectionActionModeCallback(TextViewCompat
diff --git a/leanback/src/main/java/androidx/leanback/widget/ScaleFrameLayout.java b/leanback/src/main/java/androidx/leanback/widget/ScaleFrameLayout.java
index 2f88f08..0c5b9f7 100644
--- a/leanback/src/main/java/androidx/leanback/widget/ScaleFrameLayout.java
+++ b/leanback/src/main/java/androidx/leanback/widget/ScaleFrameLayout.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.drawable.Drawable;
@@ -29,7 +29,7 @@
* Subclass of FrameLayout that support scale layout area size for children.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ScaleFrameLayout extends FrameLayout {
private static final int DEFAULT_CHILD_GRAVITY = Gravity.TOP | Gravity.START;
diff --git a/leanback/src/main/java/androidx/leanback/widget/SearchEditText.java b/leanback/src/main/java/androidx/leanback/widget/SearchEditText.java
index 06367fb..a9b29f1 100644
--- a/leanback/src/main/java/androidx/leanback/widget/SearchEditText.java
+++ b/leanback/src/main/java/androidx/leanback/widget/SearchEditText.java
@@ -18,6 +18,7 @@
import android.util.Log;
import android.view.KeyEvent;
+import androidx.core.widget.TextViewCompat;
import androidx.leanback.R;
/**
@@ -57,8 +58,8 @@
if (DEBUG) Log.v(TAG, "Keyboard being dismissed");
if (mKeyboardDismissListener != null) {
mKeyboardDismissListener.onKeyboardDismiss();
- return true;
}
+ return false;
}
return super.onKeyPreIme(keyCode, event);
}
diff --git a/leanback/src/main/java/androidx/leanback/widget/SeekBar.java b/leanback/src/main/java/androidx/leanback/widget/SeekBar.java
index 9b63e88..a484dd1 100644
--- a/leanback/src/main/java/androidx/leanback/widget/SeekBar.java
+++ b/leanback/src/main/java/androidx/leanback/widget/SeekBar.java
@@ -16,7 +16,7 @@
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Canvas;
@@ -37,13 +37,13 @@
* The widget does not deal with KeyEvent, it's client's responsibility to set a key listener.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class SeekBar extends View {
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public abstract static class AccessibilitySeekListener {
/**
* Called to perform AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD
diff --git a/leanback/src/main/java/androidx/leanback/widget/StreamingTextView.java b/leanback/src/main/java/androidx/leanback/widget/StreamingTextView.java
index b5805eb..0069675 100644
--- a/leanback/src/main/java/androidx/leanback/widget/StreamingTextView.java
+++ b/leanback/src/main/java/androidx/leanback/widget/StreamingTextView.java
@@ -72,10 +72,6 @@
}
};
- /** Class name may be obfuscated by Proguard. Hardcode the string for accessibility usage. */
- private static final String ACCESSIBILITY_CLASS_NAME =
- "androidx.leanback.widget.StreamingTextView";
-
final Random mRandom = new Random();
Bitmap mOneDot;
@@ -234,7 +230,7 @@
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
- info.setClassName(ACCESSIBILITY_CLASS_NAME);
+ info.setClassName(StreamingTextView.class.getCanonicalName());
}
private class DottySpan extends ReplacementSpan {
@@ -303,6 +299,7 @@
* See
* {@link TextViewCompat#setCustomSelectionActionModeCallback(TextView, ActionMode.Callback)}
*/
+ @SuppressWarnings("RestrictedApi")
@Override
public void setCustomSelectionActionModeCallback(ActionMode.Callback actionModeCallback) {
super.setCustomSelectionActionModeCallback(TextViewCompat
diff --git a/leanback/src/main/java/androidx/leanback/widget/ThumbsBar.java b/leanback/src/main/java/androidx/leanback/widget/ThumbsBar.java
index e455ad9..682dcc0 100644
--- a/leanback/src/main/java/androidx/leanback/widget/ThumbsBar.java
+++ b/leanback/src/main/java/androidx/leanback/widget/ThumbsBar.java
@@ -15,7 +15,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Bitmap;
@@ -32,7 +32,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ThumbsBar extends LinearLayout {
// initial value for Thumb's number before measuring the screen size
diff --git a/leanback/src/main/java/androidx/leanback/widget/Util.java b/leanback/src/main/java/androidx/leanback/widget/Util.java
index 663bef5..bda8ac6 100644
--- a/leanback/src/main/java/androidx/leanback/widget/Util.java
+++ b/leanback/src/main/java/androidx/leanback/widget/Util.java
@@ -13,7 +13,7 @@
*/
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.View;
import android.view.ViewGroup;
@@ -24,7 +24,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class Util {
/**
diff --git a/leanback/src/main/java/androidx/leanback/widget/Visibility.java b/leanback/src/main/java/androidx/leanback/widget/Visibility.java
index 04730fb..a23ecdb 100644
--- a/leanback/src/main/java/androidx/leanback/widget/Visibility.java
+++ b/leanback/src/main/java/androidx/leanback/widget/Visibility.java
@@ -16,7 +16,7 @@
package androidx.leanback.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.View;
@@ -27,7 +27,7 @@
import java.lang.annotation.RetentionPolicy;
/** @hide */
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@IntDef({View.VISIBLE, View.INVISIBLE, View.GONE})
@Retention(RetentionPolicy.SOURCE)
public @interface Visibility {}
diff --git a/leanback/src/main/res/values-as/strings.xml b/leanback/src/main/res/values-as/strings.xml
index 05b84d6..eb3b2b0 100644
--- a/leanback/src/main/res/values-as/strings.xml
+++ b/leanback/src/main/res/values-as/strings.xml
@@ -49,7 +49,7 @@
<string name="lb_playback_controls_closed_captioning_disable" msgid="5508271941331836786">"ছাব-টাইটেল অক্ষম কৰক"</string>
<string name="lb_playback_controls_picture_in_picture" msgid="8800305194045609275">"চিত্ৰৰ ভিতৰত চিত্ৰ ম\'ড আৰম্ভ কৰক"</string>
<string name="lb_playback_time_separator" msgid="6549544638083578695">"/"</string>
- <string name="lb_playback_controls_shown" msgid="7794717158616536936">"মিডিয়াৰ নিয়ন্ত্ৰণসমূহ দেখুওৱা হ’ল"</string>
+ <string name="lb_playback_controls_shown" msgid="7794717158616536936">"মিডিয়াৰ নিয়ন্ত্ৰণসমূহ দেখুওৱা হ\'ল"</string>
<string name="lb_playback_controls_hidden" msgid="619396299825306757">"মিডিয়াৰ নিয়ন্ত্ৰণসমূহ লুকুৱাই ৰখা হৈছে, দেখুওৱাবলৈ ডি-পেডত টিপক"</string>
<string name="lb_guidedaction_finish_title" msgid="7747913934287176843">"সমাপ্ত"</string>
<string name="lb_guidedaction_continue_title" msgid="1122271825827282965">"অব্যাহত ৰাখক"</string>
diff --git a/leanback/src/main/res/values-bs/strings.xml b/leanback/src/main/res/values-bs/strings.xml
index 6c429a0..dbdfdea 100644
--- a/leanback/src/main/res/values-bs/strings.xml
+++ b/leanback/src/main/res/values-bs/strings.xml
@@ -55,5 +55,5 @@
<string name="lb_guidedaction_continue_title" msgid="1122271825827282965">"Nastavi"</string>
<string name="lb_media_player_error" msgid="8748646000835486516">"Kôd greške MediaPlayera %1$d dodatno %2$d"</string>
<string name="lb_onboarding_get_started" msgid="7674487829030291492">"ZAPOČNITE"</string>
- <string name="lb_onboarding_accessibility_next" msgid="4213611627196077555">"Naprijed"</string>
+ <string name="lb_onboarding_accessibility_next" msgid="4213611627196077555">"Dalje"</string>
</resources>
diff --git a/leanback/src/main/res/values-ne/strings.xml b/leanback/src/main/res/values-ne/strings.xml
index 5cf37cd..416fc65 100644
--- a/leanback/src/main/res/values-ne/strings.xml
+++ b/leanback/src/main/res/values-ne/strings.xml
@@ -47,7 +47,7 @@
<string name="lb_playback_controls_high_quality_disable" msgid="3000046054608531995">"उच्च गुणस्तरलाई असक्षम पार्नुहोस्"</string>
<string name="lb_playback_controls_closed_captioning_enable" msgid="3934392140182327163">"उप शीर्षकहरू देखाउने सुविधालाई सक्षम पार्नुहोस्"</string>
<string name="lb_playback_controls_closed_captioning_disable" msgid="5508271941331836786">"उप शीर्षकहरू देखाउने सुविधालाई असक्षम पार्नुहोस्"</string>
- <string name="lb_playback_controls_picture_in_picture" msgid="8800305194045609275">"तस्बिरभित्र तस्बिर नामक मोडमा प्रविष्टि गर्नुहोस्"</string>
+ <string name="lb_playback_controls_picture_in_picture" msgid="8800305194045609275">"तस्बिरभित्र तस्बिर नामक मोडमा प्रविष्ट गर्नुहोस्"</string>
<string name="lb_playback_time_separator" msgid="6549544638083578695">"/"</string>
<string name="lb_playback_controls_shown" msgid="7794717158616536936">"मिडियाका नियन्त्रणहरू देखाइएका छन्"</string>
<string name="lb_playback_controls_hidden" msgid="619396299825306757">"मिडियाका नियन्त्रणहरूलाई लुकाइएको छ, देखाउनका लागि d-pad नामक बटन थिच्नुहोस्"</string>
diff --git a/leanback/src/main/res/values-ta/strings.xml b/leanback/src/main/res/values-ta/strings.xml
index d0b2641..10c84ca 100644
--- a/leanback/src/main/res/values-ta/strings.xml
+++ b/leanback/src/main/res/values-ta/strings.xml
@@ -41,8 +41,8 @@
<string name="lb_playback_controls_repeat_none" msgid="5812341701962930499">"எதையும் மீண்டும் இயக்காதே"</string>
<string name="lb_playback_controls_repeat_all" msgid="5164826436271322261">"அனைத்தையும் மீண்டும் இயக்கு"</string>
<string name="lb_playback_controls_repeat_one" msgid="7675097479246139440">"ஒன்றை மட்டும் மீண்டும் இயக்கு"</string>
- <string name="lb_playback_controls_shuffle_enable" msgid="7809089255981448519">"வரிசை மாற்றி இயக்கு"</string>
- <string name="lb_playback_controls_shuffle_disable" msgid="8182435535948303910">"வரிசை மாற்றி இயக்குவதை நிறுத்து"</string>
+ <string name="lb_playback_controls_shuffle_enable" msgid="7809089255981448519">"கலைத்து இயக்கு"</string>
+ <string name="lb_playback_controls_shuffle_disable" msgid="8182435535948303910">"கலைக்காமல் இயக்கு"</string>
<string name="lb_playback_controls_high_quality_enable" msgid="1862669142355962638">"உயர்தரத்தை இயக்கு"</string>
<string name="lb_playback_controls_high_quality_disable" msgid="3000046054608531995">"உயர்தரத்தை முடக்கு"</string>
<string name="lb_playback_controls_closed_captioning_enable" msgid="3934392140182327163">"விரிவான வசனங்களை இயக்கு"</string>
diff --git a/legacy/core-ui/api/1.0.0.txt b/legacy/core-ui/api/1.0.0.txt
index f2552774..4e71f40 100644
--- a/legacy/core-ui/api/1.0.0.txt
+++ b/legacy/core-ui/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.legacy.app {
@Deprecated public class ActionBarDrawerToggle implements androidx.drawerlayout.widget.DrawerLayout.DrawerListener {
@@ -35,6 +35,8 @@
ctor @Deprecated public Space(android.content.Context, android.util.AttributeSet?, int);
ctor @Deprecated public Space(android.content.Context, android.util.AttributeSet?);
ctor @Deprecated public Space(android.content.Context);
+ method @Deprecated public void draw(android.graphics.Canvas!);
+ method @Deprecated protected void onMeasure(int, int);
}
}
diff --git a/legacy/core-ui/api/1.1.0-alpha01.ignore b/legacy/core-ui/api/1.1.0-alpha01.ignore
deleted file mode 100644
index 2cbfc99..0000000
--- a/legacy/core-ui/api/1.1.0-alpha01.ignore
+++ /dev/null
@@ -1,5 +0,0 @@
-// Baseline format: 1.0
-DeprecationMismatch: androidx.legacy.app.ActionBarDrawerToggle:
- Class androidx.legacy.app.ActionBarDrawerToggle: @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-
-
diff --git a/legacy/core-ui/api/1.1.0-alpha01.txt b/legacy/core-ui/api/1.1.0-alpha01.txt
deleted file mode 100644
index f2552774..0000000
--- a/legacy/core-ui/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-// Signature format: 3.0
-package androidx.legacy.app {
-
- @Deprecated public class ActionBarDrawerToggle implements androidx.drawerlayout.widget.DrawerLayout.DrawerListener {
- ctor @Deprecated public ActionBarDrawerToggle(android.app.Activity!, androidx.drawerlayout.widget.DrawerLayout!, @DrawableRes int, @StringRes int, @StringRes int);
- ctor @Deprecated public ActionBarDrawerToggle(android.app.Activity!, androidx.drawerlayout.widget.DrawerLayout!, boolean, @DrawableRes int, @StringRes int, @StringRes int);
- method @Deprecated public boolean isDrawerIndicatorEnabled();
- method @Deprecated public void onConfigurationChanged(android.content.res.Configuration!);
- method @Deprecated public void onDrawerClosed(android.view.View!);
- method @Deprecated public void onDrawerOpened(android.view.View!);
- method @Deprecated public void onDrawerSlide(android.view.View!, float);
- method @Deprecated public void onDrawerStateChanged(int);
- method @Deprecated public boolean onOptionsItemSelected(android.view.MenuItem!);
- method @Deprecated public void setDrawerIndicatorEnabled(boolean);
- method @Deprecated public void setHomeAsUpIndicator(android.graphics.drawable.Drawable!);
- method @Deprecated public void setHomeAsUpIndicator(int);
- method @Deprecated public void syncState();
- }
-
- @Deprecated public static interface ActionBarDrawerToggle.Delegate {
- method @Deprecated public android.graphics.drawable.Drawable? getThemeUpIndicator();
- method @Deprecated public void setActionBarDescription(@StringRes int);
- method @Deprecated public void setActionBarUpIndicator(android.graphics.drawable.Drawable!, @StringRes int);
- }
-
- @Deprecated public static interface ActionBarDrawerToggle.DelegateProvider {
- method @Deprecated public androidx.legacy.app.ActionBarDrawerToggle.Delegate? getDrawerToggleDelegate();
- }
-
-}
-
-package androidx.legacy.widget {
-
- @Deprecated public class Space extends android.view.View {
- ctor @Deprecated public Space(android.content.Context, android.util.AttributeSet?, int);
- ctor @Deprecated public Space(android.content.Context, android.util.AttributeSet?);
- ctor @Deprecated public Space(android.content.Context);
- }
-
-}
-
diff --git a/legacy/core-ui/api/current.txt b/legacy/core-ui/api/current.txt
index f2552774..4e71f40 100644
--- a/legacy/core-ui/api/current.txt
+++ b/legacy/core-ui/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.legacy.app {
@Deprecated public class ActionBarDrawerToggle implements androidx.drawerlayout.widget.DrawerLayout.DrawerListener {
@@ -35,6 +35,8 @@
ctor @Deprecated public Space(android.content.Context, android.util.AttributeSet?, int);
ctor @Deprecated public Space(android.content.Context, android.util.AttributeSet?);
ctor @Deprecated public Space(android.content.Context);
+ method @Deprecated public void draw(android.graphics.Canvas!);
+ method @Deprecated protected void onMeasure(int, int);
}
}
diff --git a/legacy/core-ui/api/res-1.1.0-alpha01.txt b/legacy/core-ui/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/legacy/core-ui/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/legacy/core-ui/api/restricted_1.0.0.txt b/legacy/core-ui/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/legacy/core-ui/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/legacy/core-ui/api/restricted_1.1.0-alpha01.ignore b/legacy/core-ui/api/restricted_1.1.0-alpha01.ignore
deleted file mode 100644
index 2cbfc99..0000000
--- a/legacy/core-ui/api/restricted_1.1.0-alpha01.ignore
+++ /dev/null
@@ -1,5 +0,0 @@
-// Baseline format: 1.0
-DeprecationMismatch: androidx.legacy.app.ActionBarDrawerToggle:
- Class androidx.legacy.app.ActionBarDrawerToggle: @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-
-
diff --git a/legacy/core-ui/api/restricted_1.1.0-alpha01.txt b/legacy/core-ui/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/legacy/core-ui/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/legacy/core-ui/api/restricted_current.txt b/legacy/core-ui/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/legacy/core-ui/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/legacy/core-utils/api/1.0.0.txt b/legacy/core-utils/api/1.0.0.txt
index 5e8a796..f36337a 100644
--- a/legacy/core-utils/api/1.0.0.txt
+++ b/legacy/core-utils/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.legacy.content {
@Deprecated public abstract class WakefulBroadcastReceiver extends android.content.BroadcastReceiver {
diff --git a/legacy/core-utils/api/1.1.0-alpha01.txt b/legacy/core-utils/api/1.1.0-alpha01.txt
deleted file mode 100644
index 5e8a796..0000000
--- a/legacy/core-utils/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-// Signature format: 3.0
-package androidx.legacy.content {
-
- @Deprecated public abstract class WakefulBroadcastReceiver extends android.content.BroadcastReceiver {
- ctor @Deprecated public WakefulBroadcastReceiver();
- method @Deprecated public static boolean completeWakefulIntent(android.content.Intent!);
- method @Deprecated public static android.content.ComponentName! startWakefulService(android.content.Context!, android.content.Intent!);
- }
-
-}
-
diff --git a/legacy/core-utils/api/current.txt b/legacy/core-utils/api/current.txt
index 5e8a796..f36337a 100644
--- a/legacy/core-utils/api/current.txt
+++ b/legacy/core-utils/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.legacy.content {
@Deprecated public abstract class WakefulBroadcastReceiver extends android.content.BroadcastReceiver {
diff --git a/legacy/core-utils/api/res-1.1.0-alpha01.txt b/legacy/core-utils/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/legacy/core-utils/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/legacy/core-utils/api/restricted_1.0.0.txt b/legacy/core-utils/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/legacy/core-utils/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/legacy/core-utils/api/restricted_1.1.0-alpha01.txt b/legacy/core-utils/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/legacy/core-utils/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/legacy/core-utils/api/restricted_current.txt b/legacy/core-utils/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/legacy/core-utils/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/legacy/v13/api/1.0.0.txt b/legacy/v13/api/1.0.0.txt
index 87015e1..d4892b1 100644
--- a/legacy/v13/api/1.0.0.txt
+++ b/legacy/v13/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.legacy.app {
@Deprecated public class ActivityCompat extends androidx.core.app.ActivityCompat {
@@ -24,22 +24,42 @@
@Deprecated public abstract class FragmentPagerAdapter extends androidx.viewpager.widget.PagerAdapter {
ctor @Deprecated public FragmentPagerAdapter(android.app.FragmentManager!);
+ method @Deprecated public void destroyItem(android.view.ViewGroup!, int, Object!);
+ method @Deprecated public void finishUpdate(android.view.ViewGroup!);
method @Deprecated public abstract android.app.Fragment! getItem(int);
method @Deprecated public long getItemId(int);
+ method @Deprecated public Object! instantiateItem(android.view.ViewGroup!, int);
method @Deprecated public boolean isViewFromObject(android.view.View!, Object!);
+ method @Deprecated public void restoreState(android.os.Parcelable!, ClassLoader!);
+ method @Deprecated public android.os.Parcelable! saveState();
+ method @Deprecated public void setPrimaryItem(android.view.ViewGroup!, int, Object!);
+ method @Deprecated public void startUpdate(android.view.ViewGroup!);
}
@Deprecated public abstract class FragmentStatePagerAdapter extends androidx.viewpager.widget.PagerAdapter {
ctor @Deprecated public FragmentStatePagerAdapter(android.app.FragmentManager!);
+ method @Deprecated public void destroyItem(android.view.ViewGroup!, int, Object!);
+ method @Deprecated public void finishUpdate(android.view.ViewGroup!);
method @Deprecated public abstract android.app.Fragment! getItem(int);
+ method @Deprecated public Object! instantiateItem(android.view.ViewGroup!, int);
method @Deprecated public boolean isViewFromObject(android.view.View!, Object!);
+ method @Deprecated public void restoreState(android.os.Parcelable!, ClassLoader!);
+ method @Deprecated public android.os.Parcelable! saveState();
+ method @Deprecated public void setPrimaryItem(android.view.ViewGroup!, int, Object!);
+ method @Deprecated public void startUpdate(android.view.ViewGroup!);
}
@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 protected void onAttachedToWindow();
+ method @Deprecated protected void onDetachedFromWindow();
+ method @Deprecated protected void onRestoreInstanceState(android.os.Parcelable!);
+ method @Deprecated protected android.os.Parcelable! onSaveInstanceState();
method @Deprecated public void onTabChanged(String!);
+ method @Deprecated public void setOnTabChangedListener(android.widget.TabHost.OnTabChangeListener!);
+ method @Deprecated public void setup();
method @Deprecated public void setup(android.content.Context!, android.app.FragmentManager!);
method @Deprecated public void setup(android.content.Context!, android.app.FragmentManager!, int);
}
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
index 87015e1..d4892b1 100644
--- a/legacy/v13/api/current.txt
+++ b/legacy/v13/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.legacy.app {
@Deprecated public class ActivityCompat extends androidx.core.app.ActivityCompat {
@@ -24,22 +24,42 @@
@Deprecated public abstract class FragmentPagerAdapter extends androidx.viewpager.widget.PagerAdapter {
ctor @Deprecated public FragmentPagerAdapter(android.app.FragmentManager!);
+ method @Deprecated public void destroyItem(android.view.ViewGroup!, int, Object!);
+ method @Deprecated public void finishUpdate(android.view.ViewGroup!);
method @Deprecated public abstract android.app.Fragment! getItem(int);
method @Deprecated public long getItemId(int);
+ method @Deprecated public Object! instantiateItem(android.view.ViewGroup!, int);
method @Deprecated public boolean isViewFromObject(android.view.View!, Object!);
+ method @Deprecated public void restoreState(android.os.Parcelable!, ClassLoader!);
+ method @Deprecated public android.os.Parcelable! saveState();
+ method @Deprecated public void setPrimaryItem(android.view.ViewGroup!, int, Object!);
+ method @Deprecated public void startUpdate(android.view.ViewGroup!);
}
@Deprecated public abstract class FragmentStatePagerAdapter extends androidx.viewpager.widget.PagerAdapter {
ctor @Deprecated public FragmentStatePagerAdapter(android.app.FragmentManager!);
+ method @Deprecated public void destroyItem(android.view.ViewGroup!, int, Object!);
+ method @Deprecated public void finishUpdate(android.view.ViewGroup!);
method @Deprecated public abstract android.app.Fragment! getItem(int);
+ method @Deprecated public Object! instantiateItem(android.view.ViewGroup!, int);
method @Deprecated public boolean isViewFromObject(android.view.View!, Object!);
+ method @Deprecated public void restoreState(android.os.Parcelable!, ClassLoader!);
+ method @Deprecated public android.os.Parcelable! saveState();
+ method @Deprecated public void setPrimaryItem(android.view.ViewGroup!, int, Object!);
+ method @Deprecated public void startUpdate(android.view.ViewGroup!);
}
@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 protected void onAttachedToWindow();
+ method @Deprecated protected void onDetachedFromWindow();
+ method @Deprecated protected void onRestoreInstanceState(android.os.Parcelable!);
+ method @Deprecated protected android.os.Parcelable! onSaveInstanceState();
method @Deprecated public void onTabChanged(String!);
+ method @Deprecated public void setOnTabChangedListener(android.widget.TabHost.OnTabChangeListener!);
+ method @Deprecated public void setup();
method @Deprecated public void setup(android.content.Context!, android.app.FragmentManager!);
method @Deprecated public void setup(android.content.Context!, android.app.FragmentManager!, int);
}
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/src/main/java/androidx/legacy/app/FragmentCompat.java b/legacy/v13/src/main/java/androidx/legacy/app/FragmentCompat.java
index ac182f5..34685ab 100644
--- a/legacy/v13/src/main/java/androidx/legacy/app/FragmentCompat.java
+++ b/legacy/v13/src/main/java/androidx/legacy/app/FragmentCompat.java
@@ -192,7 +192,7 @@
* @deprecated Use {@link androidx.fragment.app.Fragment} instead of the framework
* {@link Fragment}.
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Deprecated
public static PermissionCompatDelegate getPermissionCompatDelegate() {
return sDelegate;
diff --git a/lifecycle/common-java8/api/2.0.0.txt b/lifecycle/common-java8/api/2.0.0.txt
index 498d3a9..2df8249 100644
--- a/lifecycle/common-java8/api/2.0.0.txt
+++ b/lifecycle/common-java8/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public interface DefaultLifecycleObserver extends androidx.lifecycle.LifecycleObserver androidx.lifecycle.LifecycleObserver {
diff --git a/lifecycle/common-java8/api/2.1.0-alpha01.txt b/lifecycle/common-java8/api/2.1.0-alpha01.txt
index 498d3a9..2df8249 100644
--- a/lifecycle/common-java8/api/2.1.0-alpha01.txt
+++ b/lifecycle/common-java8/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public interface DefaultLifecycleObserver extends androidx.lifecycle.LifecycleObserver androidx.lifecycle.LifecycleObserver {
diff --git a/lifecycle/common-java8/api/2.1.0-alpha02.txt b/lifecycle/common-java8/api/2.1.0-alpha02.txt
index 498d3a9..2df8249 100644
--- a/lifecycle/common-java8/api/2.1.0-alpha02.txt
+++ b/lifecycle/common-java8/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public interface DefaultLifecycleObserver extends androidx.lifecycle.LifecycleObserver androidx.lifecycle.LifecycleObserver {
diff --git a/lifecycle/common-java8/api/2.1.0-alpha03.txt b/lifecycle/common-java8/api/2.1.0-alpha03.txt
deleted file mode 100644
index 498d3a9..0000000
--- a/lifecycle/common-java8/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public interface DefaultLifecycleObserver extends androidx.lifecycle.LifecycleObserver androidx.lifecycle.LifecycleObserver {
- method public default void onCreate(androidx.lifecycle.LifecycleOwner);
- method public default void onDestroy(androidx.lifecycle.LifecycleOwner);
- method public default void onPause(androidx.lifecycle.LifecycleOwner);
- method public default void onResume(androidx.lifecycle.LifecycleOwner);
- method public default void onStart(androidx.lifecycle.LifecycleOwner);
- method public default void onStop(androidx.lifecycle.LifecycleOwner);
- }
-
-}
-
diff --git a/lifecycle/common-java8/api/current.txt b/lifecycle/common-java8/api/current.txt
index 498d3a9..2df8249 100644
--- a/lifecycle/common-java8/api/current.txt
+++ b/lifecycle/common-java8/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public interface DefaultLifecycleObserver extends androidx.lifecycle.LifecycleObserver androidx.lifecycle.LifecycleObserver {
diff --git a/lifecycle/common-java8/api/restricted_2.0.0.txt b/lifecycle/common-java8/api/restricted_2.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/common-java8/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/common-java8/api/restricted_2.1.0-alpha03.txt b/lifecycle/common-java8/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/common-java8/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/common-java8/api/restricted_current.txt b/lifecycle/common-java8/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/common-java8/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/common-java8/build.gradle b/lifecycle/common-java8/build.gradle
index cf02115..71277e5 100644
--- a/lifecycle/common-java8/build.gradle
+++ b/lifecycle/common-java8/build.gradle
@@ -28,7 +28,7 @@
dependencies {
compile(project(":lifecycle:lifecycle-common"))
- compile(project(":annotation"))
+ compile(SUPPORT_ANNOTATIONS)
testCompile(JUNIT)
testCompile(MOCKITO_CORE)
diff --git a/lifecycle/common/api/2.0.0.txt b/lifecycle/common/api/2.0.0.txt
index 43627f9..fb2c0d2 100644
--- a/lifecycle/common/api/2.0.0.txt
+++ b/lifecycle/common/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public abstract class Lifecycle {
diff --git a/lifecycle/common/api/2.1.0-alpha01.txt b/lifecycle/common/api/2.1.0-alpha01.txt
index 2503882..3003f83 100644
--- a/lifecycle/common/api/2.1.0-alpha01.txt
+++ b/lifecycle/common/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public abstract class Lifecycle {
diff --git a/lifecycle/common/api/2.1.0-alpha02.txt b/lifecycle/common/api/2.1.0-alpha02.txt
index f23b5eb..3003f83 100644
--- a/lifecycle/common/api/2.1.0-alpha02.txt
+++ b/lifecycle/common/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public abstract class Lifecycle {
@@ -8,7 +8,7 @@
method @MainThread public abstract void removeObserver(androidx.lifecycle.LifecycleObserver);
}
- public enum Lifecycle.Event {
+ public static enum Lifecycle.Event {
enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_ANY;
enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_CREATE;
enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_DESTROY;
@@ -18,7 +18,7 @@
enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_STOP;
}
- public enum Lifecycle.State {
+ public static enum Lifecycle.State {
method public boolean isAtLeast(androidx.lifecycle.Lifecycle.State);
enum_constant public static final androidx.lifecycle.Lifecycle.State CREATED;
enum_constant public static final androidx.lifecycle.Lifecycle.State DESTROYED;
diff --git a/lifecycle/common/api/2.1.0-alpha03.txt b/lifecycle/common/api/2.1.0-alpha03.txt
deleted file mode 100644
index f23b5eb..0000000
--- a/lifecycle/common/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public abstract class Lifecycle {
- ctor public Lifecycle();
- method @MainThread public abstract void addObserver(androidx.lifecycle.LifecycleObserver);
- method @MainThread public abstract androidx.lifecycle.Lifecycle.State getCurrentState();
- method @MainThread public abstract void removeObserver(androidx.lifecycle.LifecycleObserver);
- }
-
- public enum Lifecycle.Event {
- enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_ANY;
- enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_CREATE;
- enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_DESTROY;
- enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_PAUSE;
- enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_RESUME;
- enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_START;
- enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_STOP;
- }
-
- public enum Lifecycle.State {
- method public boolean isAtLeast(androidx.lifecycle.Lifecycle.State);
- enum_constant public static final androidx.lifecycle.Lifecycle.State CREATED;
- enum_constant public static final androidx.lifecycle.Lifecycle.State DESTROYED;
- enum_constant public static final androidx.lifecycle.Lifecycle.State INITIALIZED;
- enum_constant public static final androidx.lifecycle.Lifecycle.State RESUMED;
- enum_constant public static final androidx.lifecycle.Lifecycle.State STARTED;
- }
-
- public interface LifecycleEventObserver extends androidx.lifecycle.LifecycleObserver {
- method public void onStateChanged(androidx.lifecycle.LifecycleOwner, androidx.lifecycle.Lifecycle.Event);
- }
-
- public interface LifecycleObserver {
- }
-
- public interface LifecycleOwner {
- method public androidx.lifecycle.Lifecycle getLifecycle();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD) public @interface OnLifecycleEvent {
- method public abstract androidx.lifecycle.Lifecycle.Event value();
- }
-
-}
-
diff --git a/lifecycle/common/api/current.txt b/lifecycle/common/api/current.txt
index f23b5eb..3003f83 100644
--- a/lifecycle/common/api/current.txt
+++ b/lifecycle/common/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public abstract class Lifecycle {
@@ -8,7 +8,7 @@
method @MainThread public abstract void removeObserver(androidx.lifecycle.LifecycleObserver);
}
- public enum Lifecycle.Event {
+ public static enum Lifecycle.Event {
enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_ANY;
enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_CREATE;
enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_DESTROY;
@@ -18,7 +18,7 @@
enum_constant public static final androidx.lifecycle.Lifecycle.Event ON_STOP;
}
- public enum Lifecycle.State {
+ public static enum Lifecycle.State {
method public boolean isAtLeast(androidx.lifecycle.Lifecycle.State);
enum_constant public static final androidx.lifecycle.Lifecycle.State CREATED;
enum_constant public static final androidx.lifecycle.Lifecycle.State DESTROYED;
diff --git a/lifecycle/common/api/restricted_2.0.0.txt b/lifecycle/common/api/restricted_2.0.0.txt
deleted file mode 100644
index cf5ae20..0000000
--- a/lifecycle/common/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class CompositeGeneratedAdaptersObserver implements androidx.lifecycle.GenericLifecycleObserver {
- method public void onStateChanged(androidx.lifecycle.LifecycleOwner!, androidx.lifecycle.Lifecycle.Event!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface GeneratedAdapter {
- method public void callMethods(androidx.lifecycle.LifecycleOwner!, androidx.lifecycle.Lifecycle.Event!, boolean, androidx.lifecycle.MethodCallsLogger!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public interface GenericLifecycleObserver extends androidx.lifecycle.LifecycleObserver {
- method public void onStateChanged(androidx.lifecycle.LifecycleOwner!, androidx.lifecycle.Lifecycle.Event!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class Lifecycling {
- method public static String! getAdapterName(String!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class MethodCallsLogger {
- ctor public MethodCallsLogger();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean approveCall(String!, int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class SingleGeneratedAdapterObserver implements androidx.lifecycle.GenericLifecycleObserver {
- method public void onStateChanged(androidx.lifecycle.LifecycleOwner!, androidx.lifecycle.Lifecycle.Event!);
- }
-
-}
-
diff --git a/lifecycle/common/api/restricted_2.1.0-alpha03.ignore b/lifecycle/common/api/restricted_2.1.0-alpha03.ignore
deleted file mode 100644
index f0841f8..0000000
--- a/lifecycle/common/api/restricted_2.1.0-alpha03.ignore
+++ /dev/null
@@ -1,9 +0,0 @@
-// Baseline format: 1.0
-ChangedSuperclass: androidx.lifecycle.GenericLifecycleObserver:
- Class androidx.lifecycle.GenericLifecycleObserver superclass changed from androidx.lifecycle.LifecycleObserver to androidx.lifecycle.LifecycleEventObserver
-
-RemovedClass: androidx.lifecycle.CompositeGeneratedAdaptersObserver:
- Removed class androidx.lifecycle.CompositeGeneratedAdaptersObserver
-
-RemovedClass: androidx.lifecycle.SingleGeneratedAdapterObserver:
- Removed class androidx.lifecycle.SingleGeneratedAdapterObserver
\ No newline at end of file
diff --git a/lifecycle/common/api/restricted_2.1.0-alpha03.txt b/lifecycle/common/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index 7aa1c38..0000000
--- a/lifecycle/common/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface GeneratedAdapter {
- method public void callMethods(androidx.lifecycle.LifecycleOwner!, androidx.lifecycle.Lifecycle.Event!, boolean, androidx.lifecycle.MethodCallsLogger!);
- }
-
- @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface GenericLifecycleObserver extends androidx.lifecycle.LifecycleEventObserver {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class Lifecycling {
- method public static String! getAdapterName(String!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MethodCallsLogger {
- ctor public MethodCallsLogger();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean approveCall(String!, int);
- }
-
-}
-
diff --git a/lifecycle/common/api/restricted_current.txt b/lifecycle/common/api/restricted_current.txt
deleted file mode 100644
index 7aa1c38..0000000
--- a/lifecycle/common/api/restricted_current.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface GeneratedAdapter {
- method public void callMethods(androidx.lifecycle.LifecycleOwner!, androidx.lifecycle.Lifecycle.Event!, boolean, androidx.lifecycle.MethodCallsLogger!);
- }
-
- @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface GenericLifecycleObserver extends androidx.lifecycle.LifecycleEventObserver {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class Lifecycling {
- method public static String! getAdapterName(String!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MethodCallsLogger {
- ctor public MethodCallsLogger();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean approveCall(String!, int);
- }
-
-}
-
diff --git a/lifecycle/common/build.gradle b/lifecycle/common/build.gradle
index 75037fa..8d36e45 100644
--- a/lifecycle/common/build.gradle
+++ b/lifecycle/common/build.gradle
@@ -28,7 +28,7 @@
dependencies {
testCompile(JUNIT)
testCompile(MOCKITO_CORE)
- compile(project(":annotation"))
+ compile(SUPPORT_ANNOTATIONS)
}
supportLibrary {
diff --git a/lifecycle/common/eap/api/1.0.0-alpha01.txt b/lifecycle/common/eap/api/1.0.0-alpha01.txt
deleted file mode 100644
index ac09a5a..0000000
--- a/lifecycle/common/eap/api/1.0.0-alpha01.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public final class LifecycleKt {
- ctor public LifecycleKt();
- method public static kotlinx.coroutines.CoroutineScope getCoroutineScope(androidx.lifecycle.Lifecycle);
- }
-
- public final class LifecycleOwnerKt {
- ctor public LifecycleOwnerKt();
- method public static kotlinx.coroutines.CoroutineScope getLifecycleScope(androidx.lifecycle.LifecycleOwner);
- }
-
-}
-
diff --git a/lifecycle/common/eap/api/current.txt b/lifecycle/common/eap/api/current.txt
deleted file mode 100644
index ac09a5a..0000000
--- a/lifecycle/common/eap/api/current.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public final class LifecycleKt {
- ctor public LifecycleKt();
- method public static kotlinx.coroutines.CoroutineScope getCoroutineScope(androidx.lifecycle.Lifecycle);
- }
-
- public final class LifecycleOwnerKt {
- ctor public LifecycleOwnerKt();
- method public static kotlinx.coroutines.CoroutineScope getLifecycleScope(androidx.lifecycle.LifecycleOwner);
- }
-
-}
-
diff --git a/lifecycle/common/eap/api/restricted_1.0.0-alpha01.txt b/lifecycle/common/eap/api/restricted_1.0.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/common/eap/api/restricted_1.0.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/common/eap/api/restricted_current.txt b/lifecycle/common/eap/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/common/eap/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/common/eap/build.gradle b/lifecycle/common/eap/build.gradle
deleted file mode 100644
index a9d1653..0000000
--- a/lifecycle/common/eap/build.gradle
+++ /dev/null
@@ -1,41 +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.
- */
-
-import static androidx.build.dependencies.DependenciesKt.*
-import androidx.build.LibraryGroups
-import androidx.build.LibraryVersions
-
-plugins {
- id("SupportKotlinLibraryPlugin")
-}
-
-dependencies {
- api(project(":lifecycle:lifecycle-common"))
- api(KOTLIN_STDLIB)
- api(KOTLIN_COROUTINES_CORE)
- // tests are in lifecycle kotlin test app to be able to test with a proper lifecycle
- // implementation while keeping this project pure kotlin.
-}
-
-supportLibrary {
- name = "Lifecycle Kotlin Extensions"
- publish = false
- mavenVersion = LibraryVersions.LIFECYCLES_COROUTINES
- mavenGroup = LibraryGroups.LIFECYCLE
- inceptionYear = "2018"
- description = "Kotlin extensions for 'lifecycle' artifact"
- useMetalava = true
-}
diff --git a/lifecycle/common/eap/src/main/java/androidx/lifecycle/Lifecycle.kt b/lifecycle/common/eap/src/main/java/androidx/lifecycle/Lifecycle.kt
deleted file mode 100644
index 9b0bf10..0000000
--- a/lifecycle/common/eap/src/main/java/androidx/lifecycle/Lifecycle.kt
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2019 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.lifecycle
-
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.SupervisorJob
-import kotlinx.coroutines.cancel
-import kotlinx.coroutines.launch
-import kotlin.coroutines.CoroutineContext
-
-/**
- * [CoroutineScope] tied to this [Lifecycle].
- *
- * This scope will be canceled when the [Lifecycle] is destroyed.
- *
- * This scope is bound to [Dispatchers.Main]
- */
-val Lifecycle.coroutineScope: CoroutineScope
- get() {
- while (true) {
- val existing = mInternalScopeRef.get() as LifecycleCoroutineScope?
- if (existing != null) {
- return existing
- }
- val newScope = LifecycleCoroutineScope(
- this,
- SupervisorJob() + Dispatchers.Main
- )
- if (mInternalScopeRef.compareAndSet(null, newScope)) {
- newScope.register()
- return newScope
- }
- }
- }
-
-internal class LifecycleCoroutineScope(
- private val lifecycle: Lifecycle,
- override val coroutineContext: CoroutineContext
-) : CoroutineScope, LifecycleEventObserver {
- init {
- // in case we are initialized on a non-main thread, make a best effort check before
- // we return the scope. This is not sync but if developer is launching on a non-main
- // dispatcher, they cannot be 100% sure anyways.
- if (lifecycle.currentState == Lifecycle.State.DESTROYED) {
- coroutineContext.cancel()
- }
- }
-
- fun register() {
- // TODO use Main.Immediate once it is graduated out of experimental.
- launch(Dispatchers.Main) {
- if (lifecycle.currentState >= Lifecycle.State.INITIALIZED) {
- lifecycle.addObserver(this@LifecycleCoroutineScope)
- } else {
- coroutineContext.cancel()
- }
- }
- }
-
- override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event) {
- if (lifecycle.currentState <= Lifecycle.State.DESTROYED) {
- lifecycle.removeObserver(this)
- coroutineContext.cancel()
- }
- }
-}
\ No newline at end of file
diff --git a/lifecycle/common/eap/src/main/java/androidx/lifecycle/LifecycleOwner.kt b/lifecycle/common/eap/src/main/java/androidx/lifecycle/LifecycleOwner.kt
deleted file mode 100644
index 6789c98..0000000
--- a/lifecycle/common/eap/src/main/java/androidx/lifecycle/LifecycleOwner.kt
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2019 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.lifecycle
-
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.Dispatchers
-
-/**
- * [CoroutineScope] tied to this [LifecycleOwner]'s [Lifecycle].
- *
- * This scope will be cancelled when the [Lifecycle] is destroyed.
- *
- * This scope is bound to [Dispatchers.Main].
- */
-val LifecycleOwner.lifecycleScope: CoroutineScope
- get() = lifecycle.coroutineScope
diff --git a/lifecycle/common/src/main/java/androidx/lifecycle/CompositeGeneratedAdaptersObserver.java b/lifecycle/common/src/main/java/androidx/lifecycle/CompositeGeneratedAdaptersObserver.java
index 10d7adb..873445d 100644
--- a/lifecycle/common/src/main/java/androidx/lifecycle/CompositeGeneratedAdaptersObserver.java
+++ b/lifecycle/common/src/main/java/androidx/lifecycle/CompositeGeneratedAdaptersObserver.java
@@ -17,7 +17,13 @@
package androidx.lifecycle;
-class CompositeGeneratedAdaptersObserver implements LifecycleEventObserver {
+import androidx.annotation.RestrictTo;
+
+/**
+ * @hide
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+public class CompositeGeneratedAdaptersObserver implements LifecycleEventObserver {
private final GeneratedAdapter[] mGeneratedAdapters;
diff --git a/lifecycle/common/src/main/java/androidx/lifecycle/GeneratedAdapter.java b/lifecycle/common/src/main/java/androidx/lifecycle/GeneratedAdapter.java
index 7d5dede2..a70d67b 100644
--- a/lifecycle/common/src/main/java/androidx/lifecycle/GeneratedAdapter.java
+++ b/lifecycle/common/src/main/java/androidx/lifecycle/GeneratedAdapter.java
@@ -21,7 +21,7 @@
/**
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public interface GeneratedAdapter {
/**
diff --git a/lifecycle/common/src/main/java/androidx/lifecycle/GenericLifecycleObserver.java b/lifecycle/common/src/main/java/androidx/lifecycle/GenericLifecycleObserver.java
index 1c0c70a..bf2bceb 100644
--- a/lifecycle/common/src/main/java/androidx/lifecycle/GenericLifecycleObserver.java
+++ b/lifecycle/common/src/main/java/androidx/lifecycle/GenericLifecycleObserver.java
@@ -25,6 +25,6 @@
* @deprecated and it is scheduled to be removed in lifecycle 3.0
*/
@Deprecated
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public interface GenericLifecycleObserver extends LifecycleEventObserver {
}
diff --git a/lifecycle/common/src/main/java/androidx/lifecycle/Lifecycle.java b/lifecycle/common/src/main/java/androidx/lifecycle/Lifecycle.java
index 6fd66bd8..9b6a5dc 100644
--- a/lifecycle/common/src/main/java/androidx/lifecycle/Lifecycle.java
+++ b/lifecycle/common/src/main/java/androidx/lifecycle/Lifecycle.java
@@ -18,9 +18,6 @@
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
-import androidx.annotation.RestrictTo;
-
-import java.util.concurrent.atomic.AtomicReference;
/**
* Defines an object that has an Android Lifecycle. {@link androidx.fragment.app.Fragment Fragment}
@@ -76,16 +73,6 @@
* and events without tracking them manually.
*/
public abstract class Lifecycle {
-
- /**
- * Lifecycle coroutines extensions stashes the CoroutineScope into this field.
- *
- * @hide used by lifecycle-common-ktx
- */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
- @NonNull
- AtomicReference<Object> mInternalScopeRef = new AtomicReference<>();
-
/**
* Adds a LifecycleObserver that will be notified when the LifecycleOwner changes
* state.
diff --git a/lifecycle/common/src/main/java/androidx/lifecycle/Lifecycling.java b/lifecycle/common/src/main/java/androidx/lifecycle/Lifecycling.java
index 9450466..c0b4407 100644
--- a/lifecycle/common/src/main/java/androidx/lifecycle/Lifecycling.java
+++ b/lifecycle/common/src/main/java/androidx/lifecycle/Lifecycling.java
@@ -33,7 +33,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class Lifecycling {
private static final int REFLECTIVE_CALLBACK = 1;
diff --git a/lifecycle/common/src/main/java/androidx/lifecycle/MethodCallsLogger.java b/lifecycle/common/src/main/java/androidx/lifecycle/MethodCallsLogger.java
index f091d87..0401a22 100644
--- a/lifecycle/common/src/main/java/androidx/lifecycle/MethodCallsLogger.java
+++ b/lifecycle/common/src/main/java/androidx/lifecycle/MethodCallsLogger.java
@@ -24,14 +24,14 @@
/**
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class MethodCallsLogger {
private Map<String, Integer> mCalledMethods = new HashMap<>();
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public boolean approveCall(String name, int type) {
Integer nullableMask = mCalledMethods.get(name);
int mask = nullableMask != null ? nullableMask : 0;
diff --git a/lifecycle/common/src/main/java/androidx/lifecycle/SingleGeneratedAdapterObserver.java b/lifecycle/common/src/main/java/androidx/lifecycle/SingleGeneratedAdapterObserver.java
index 2f77c1d..f9cd5d1 100644
--- a/lifecycle/common/src/main/java/androidx/lifecycle/SingleGeneratedAdapterObserver.java
+++ b/lifecycle/common/src/main/java/androidx/lifecycle/SingleGeneratedAdapterObserver.java
@@ -16,7 +16,13 @@
package androidx.lifecycle;
-class SingleGeneratedAdapterObserver implements LifecycleEventObserver {
+import androidx.annotation.RestrictTo;
+
+/**
+ * @hide
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+public class SingleGeneratedAdapterObserver implements LifecycleEventObserver {
private final GeneratedAdapter mGeneratedAdapter;
diff --git a/lifecycle/extensions/api/2.0.0.txt b/lifecycle/extensions/api/2.0.0.txt
index c85f1ab..c3b2a11 100644
--- a/lifecycle/extensions/api/2.0.0.txt
+++ b/lifecycle/extensions/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class ViewModelProviders {
diff --git a/lifecycle/extensions/api/2.1.0-alpha01.txt b/lifecycle/extensions/api/2.1.0-alpha01.txt
index c85f1ab..c3b2a11 100644
--- a/lifecycle/extensions/api/2.1.0-alpha01.txt
+++ b/lifecycle/extensions/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class ViewModelProviders {
diff --git a/lifecycle/extensions/api/2.1.0-alpha02.txt b/lifecycle/extensions/api/2.1.0-alpha02.txt
index c85f1ab..c3b2a11 100644
--- a/lifecycle/extensions/api/2.1.0-alpha02.txt
+++ b/lifecycle/extensions/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class ViewModelProviders {
diff --git a/lifecycle/extensions/api/2.1.0-alpha03.txt b/lifecycle/extensions/api/2.1.0-alpha03.txt
deleted file mode 100644
index c85f1ab..0000000
--- a/lifecycle/extensions/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public class ViewModelProviders {
- ctor @Deprecated public ViewModelProviders();
- method @MainThread public static androidx.lifecycle.ViewModelProvider of(androidx.fragment.app.Fragment);
- method @MainThread public static androidx.lifecycle.ViewModelProvider of(androidx.fragment.app.FragmentActivity);
- method @MainThread public static androidx.lifecycle.ViewModelProvider of(androidx.fragment.app.Fragment, androidx.lifecycle.ViewModelProvider.Factory?);
- method @MainThread public static androidx.lifecycle.ViewModelProvider of(androidx.fragment.app.FragmentActivity, androidx.lifecycle.ViewModelProvider.Factory?);
- }
-
- @Deprecated public static class ViewModelProviders.DefaultFactory extends androidx.lifecycle.ViewModelProvider.AndroidViewModelFactory {
- ctor @Deprecated public ViewModelProviders.DefaultFactory(android.app.Application);
- }
-
- @Deprecated public class ViewModelStores {
- method @Deprecated @MainThread public static androidx.lifecycle.ViewModelStore of(androidx.fragment.app.FragmentActivity);
- method @Deprecated @MainThread public static androidx.lifecycle.ViewModelStore of(androidx.fragment.app.Fragment);
- }
-
-}
-
diff --git a/lifecycle/extensions/api/current.txt b/lifecycle/extensions/api/current.txt
index c85f1ab..c3b2a11 100644
--- a/lifecycle/extensions/api/current.txt
+++ b/lifecycle/extensions/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class ViewModelProviders {
diff --git a/lifecycle/extensions/api/res-2.1.0-alpha03.txt b/lifecycle/extensions/api/res-2.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/lifecycle/extensions/api/res-2.1.0-alpha03.txt
+++ /dev/null
diff --git a/lifecycle/extensions/api/restricted_2.0.0.txt b/lifecycle/extensions/api/restricted_2.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/extensions/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/extensions/api/restricted_2.1.0-alpha03.txt b/lifecycle/extensions/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/extensions/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/extensions/api/restricted_current.txt b/lifecycle/extensions/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/extensions/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/FragmentLifecycleInActivityTest.java b/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/FragmentLifecycleInActivityTest.java
index 55bc682..a44ec6f 100644
--- a/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/FragmentLifecycleInActivityTest.java
+++ b/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/FragmentLifecycleInActivityTest.java
@@ -33,7 +33,7 @@
import androidx.fragment.app.Fragment;
import androidx.lifecycle.activity.FragmentLifecycleActivity;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -46,7 +46,7 @@
import java.util.Arrays;
import java.util.concurrent.TimeUnit;
-@SmallTest
+@MediumTest
@RunWith(Parameterized.class)
public class FragmentLifecycleInActivityTest {
diff --git a/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/FragmentOperationsLifecycleTest.java b/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/FragmentOperationsLifecycleTest.java
index 55ae129..f95bdcb 100644
--- a/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/FragmentOperationsLifecycleTest.java
+++ b/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/FragmentOperationsLifecycleTest.java
@@ -34,7 +34,7 @@
import androidx.lifecycle.extensions.test.R;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Rule;
@@ -44,7 +44,7 @@
import java.util.ArrayList;
import java.util.List;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class FragmentOperationsLifecycleTest {
diff --git a/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/ViewModelTest.java b/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/ViewModelTest.java
index a263822..a286455 100644
--- a/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/ViewModelTest.java
+++ b/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/ViewModelTest.java
@@ -34,7 +34,7 @@
import androidx.test.annotation.UiThreadTest;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -45,7 +45,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class ViewModelTest {
private static final int TIMEOUT = 2; // secs
diff --git a/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/ViewModelTestInTransaction.java b/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/ViewModelTestInTransaction.java
index 56ccb55..b91f77f 100644
--- a/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/ViewModelTestInTransaction.java
+++ b/lifecycle/extensions/src/androidTest/java/androidx/lifecycle/ViewModelTestInTransaction.java
@@ -27,14 +27,14 @@
import androidx.lifecycle.viewmodeltest.TestViewModel;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class ViewModelTestInTransaction {
diff --git a/lifecycle/integration-tests/kotlintestapp/.gitignore b/lifecycle/integration-tests/kotlintestapp/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/lifecycle/integration-tests/kotlintestapp/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/lifecycle/integration-tests/kotlintestapp/build.gradle b/lifecycle/integration-tests/kotlintestapp/build.gradle
deleted file mode 100644
index 84c2c0e..0000000
--- a/lifecycle/integration-tests/kotlintestapp/build.gradle
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2019 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.
- */
-// TO debug processor, run:
-//./gradlew :r:in:k:clean :r:in:k:cC --no-daemon
-// -Dorg.gradle.debug=true
-// -Dkotlin.compiler.execution.strategy="in-process"
-import static androidx.build.dependencies.DependenciesKt.*
-
-plugins {
- id("AndroidXPlugin")
- id("com.android.application")
- id("org.jetbrains.kotlin.android")
-}
-
-dependencies {
- implementation(project(":lifecycle:lifecycle-common-eap"))
- implementation(project(":activity"))
-
- testImplementation(JUNIT)
- testImplementation(TEST_RUNNER)
- testImplementation(TRUTH)
- testImplementation(KOTLIN_COROUTINES)
- testImplementation(KOTLIN_COROUTINES_TEST)
-
- androidTestImplementation(KOTLIN_COROUTINES)
- androidTestImplementation(TEST_EXT_KTX)
- androidTestImplementation(TRUTH)
- androidTestImplementation(TEST_RUNNER)
- androidTestImplementation(ESPRESSO_CORE)
-}
-
-android {
- kotlinOptions {
- jvmTarget = '1.8' // necessary to use espresso kotlin extensions
- }
- sourceSets {
- test.java.srcDirs += 'src/test-common/java'
- androidTest.java.srcDirs += 'src/test-common/java'
- }
-}
-
-tasks['check'].dependsOn(tasks['connectedCheck'])
-
-uploadArchives.enabled = false
diff --git a/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleCoroutineScopeAndroidTest.kt b/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleCoroutineScopeAndroidTest.kt
deleted file mode 100644
index 0fc0157..0000000
--- a/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleCoroutineScopeAndroidTest.kt
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2019 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.lifecycle
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import org.junit.runner.RunWith
-
-/**
- * To ensure consistent behavior, we run these tests both on androidTest and test
- */
-@ExperimentalCoroutinesApi
-@RunWith(AndroidJUnit4::class)
-class LifecycleCoroutineScopeAndroidTest : LifecycleCoroutineScopeTestBase()
\ No newline at end of file
diff --git a/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleScopeIntegrationTest.kt b/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleScopeIntegrationTest.kt
deleted file mode 100644
index b130056..0000000
--- a/lifecycle/integration-tests/kotlintestapp/src/androidTest/java/androidx/lifecycle/LifecycleScopeIntegrationTest.kt
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright 2019 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.lifecycle
-
-import androidx.lifecycle.Lifecycle.State.CREATED
-import androidx.lifecycle.Lifecycle.State.DESTROYED
-import androidx.lifecycle.Lifecycle.State.RESUMED
-import androidx.lifecycle.Lifecycle.State.STARTED
-import androidx.lifecycle.kotlintestapp.TestActivity
-import androidx.test.ext.junit.rules.activityScenarioRule
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
-import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.Job
-import kotlinx.coroutines.async
-import kotlinx.coroutines.cancel
-import kotlinx.coroutines.delay
-import kotlinx.coroutines.runBlocking
-import kotlinx.coroutines.sync.Mutex
-import kotlinx.coroutines.withContext
-import org.junit.After
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@ExperimentalCoroutinesApi
-@LargeTest
-@RunWith(AndroidJUnit4::class)
-class LifecycleScopeIntegrationTest {
- private val testScope = CoroutineScope(Job() + Dispatchers.Default)
-
- @JvmField
- @Rule
- val rule = activityScenarioRule<TestActivity>()
-
- @After
- fun cancelScope() {
- testScope.cancel()
- }
-
- @Test
- fun alreadyResumed() = runBlocking {
- rule.scenario.moveToState(RESUMED)
- assertThat(owner().lifecycleScope.async {
- true
- }.await()).isTrue()
- }
-
- @Test
- fun createdState() = runBlocking {
- rule.scenario.moveToState(CREATED)
- assertThat(owner().lifecycleScope.async {
- true
- }.await()).isTrue()
- }
-
- @Test
- fun startOnMainThread() = runBlocking {
- rule.scenario.moveToState(RESUMED)
- val owner = owner()
- assertThat(
- testScope.async(Dispatchers.Main) {
- withContext(owner.lifecycleScope.coroutineContext) {
- true
- }
- }.await()
- ).isTrue()
- }
-
- @Test
- fun alreadyDestroyed() = runBlocking {
- val owner = owner() // grab it before destroying
- rule.scenario.moveToState(DESTROYED)
- val action = owner.lifecycleScope.async {
- true
- }
- action.join()
- assertThat(action.isCancelled).isTrue()
- }
-
- @Test
- fun destroyedWhileRunning() = runBlocking {
- val owner = owner() // grab it before destroying
- rule.scenario.moveToState(STARTED)
- val runningMutex = Mutex(true)
- val action = owner.lifecycleScope.async {
- runningMutex.unlock()
- delay(10_000)
- }
- runningMutex.lock()
- assertThat(action.isActive).isTrue()
- rule.scenario.moveToState(DESTROYED)
- action.join()
- assertThat(action.isCancelled).isTrue()
- }
-
- private fun owner(): LifecycleOwner {
- lateinit var owner: LifecycleOwner
- rule.scenario.onActivity {
- owner = it
- }
- return owner
- }
-}
\ No newline at end of file
diff --git a/lifecycle/integration-tests/kotlintestapp/src/main/AndroidManifest.xml b/lifecycle/integration-tests/kotlintestapp/src/main/AndroidManifest.xml
deleted file mode 100644
index d662e79..0000000
--- a/lifecycle/integration-tests/kotlintestapp/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- ~ Copyright (C) 2019 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 xmlns:android="http://schemas.android.com/apk/res/android"
- package="androidx.lifecycle.kotlintestapp">
- <application>
- <activity android:name="androidx.lifecycle.kotlintestapp.TestActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/lifecycle/integration-tests/kotlintestapp/src/main/java/androidx/lifecycle/kotlintestapp/TestActivity.kt b/lifecycle/integration-tests/kotlintestapp/src/main/java/androidx/lifecycle/kotlintestapp/TestActivity.kt
deleted file mode 100644
index f0a2e6c..0000000
--- a/lifecycle/integration-tests/kotlintestapp/src/main/java/androidx/lifecycle/kotlintestapp/TestActivity.kt
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2019 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.lifecycle.kotlintestapp
-
-class TestActivity : androidx.activity.ComponentActivity()
\ No newline at end of file
diff --git a/lifecycle/integration-tests/kotlintestapp/src/test-common/java/androidx.lifecycle/FakeLifecycleOwner.kt b/lifecycle/integration-tests/kotlintestapp/src/test-common/java/androidx.lifecycle/FakeLifecycleOwner.kt
deleted file mode 100644
index cd93f87..0000000
--- a/lifecycle/integration-tests/kotlintestapp/src/test-common/java/androidx.lifecycle/FakeLifecycleOwner.kt
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright 2019 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.lifecycle
-
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.delay
-import kotlinx.coroutines.withContext
-import kotlinx.coroutines.withTimeoutOrNull
-
-class FakeLifecycleOwner(initialState: Lifecycle.State? = null) : LifecycleOwner {
- private val registry: LifecycleRegistry = LifecycleRegistry(this)
-
- init {
- initialState?.let {
- setState(it)
- }
- }
-
- override fun getLifecycle(): Lifecycle = registry
-
- fun setState(state: Lifecycle.State) {
- registry.markState(state)
- }
-
- suspend fun awaitExactObserverCount(count: Int, timeout: Long = 1000L): Boolean =
- // just give job some time to start
- withTimeoutOrNull(timeout) {
- while (getObserverCount(count) != count) {
- delay(50)
- }
- true
- } ?: false
-
- private suspend fun getObserverCount(count: Int): Int {
- return withContext(Dispatchers.Main) {
- registry.observerCount
- }
- }
-}
\ No newline at end of file
diff --git a/lifecycle/integration-tests/kotlintestapp/src/test-common/java/androidx.lifecycle/LifecycleCoroutineScopeTestBase.kt b/lifecycle/integration-tests/kotlintestapp/src/test-common/java/androidx.lifecycle/LifecycleCoroutineScopeTestBase.kt
deleted file mode 100644
index 2c907ec..0000000
--- a/lifecycle/integration-tests/kotlintestapp/src/test-common/java/androidx.lifecycle/LifecycleCoroutineScopeTestBase.kt
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright 2019 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.lifecycle
-
-import androidx.test.filters.SmallTest
-import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.async
-import kotlinx.coroutines.delay
-import kotlinx.coroutines.launch
-import kotlinx.coroutines.runBlocking
-import kotlinx.coroutines.sync.Mutex
-import kotlinx.coroutines.withContext
-import org.junit.Test
-import java.util.concurrent.CancellationException
-
-@SmallTest
-@ExperimentalCoroutinesApi
-abstract class LifecycleCoroutineScopeTestBase {
- @Test
- fun initialization() {
- val owner = FakeLifecycleOwner(Lifecycle.State.INITIALIZED)
- val scope = owner.lifecycleScope
- assertThat(owner.lifecycle.mInternalScopeRef.get()).isSameAs(scope)
- val scope2 = owner.lifecycleScope
- assertThat(scope).isSameAs(scope2)
- runBlocking(Dispatchers.Main) {
- assertThat((owner.lifecycle as LifecycleRegistry).observerCount).isEqualTo(1)
- }
- }
-
- @Test
- fun simpleLaunch() {
- val owner = FakeLifecycleOwner(Lifecycle.State.INITIALIZED)
- assertThat(
- runBlocking {
- owner.lifecycleScope.async {
- // do nothing
- true
- }.await()
- }
- ).isTrue()
- }
-
- @Test
- fun launchAfterDestroy() {
- val owner = FakeLifecycleOwner(Lifecycle.State.DESTROYED)
- runBlocking {
- owner.lifecycleScope.launch {
- // do nothing
- throw AssertionError("should not run")
- }.join()
- }
- }
-
- @Test
- fun launchOnMain() {
- val owner = FakeLifecycleOwner(Lifecycle.State.STARTED)
- assertThat(
- runBlocking(Dispatchers.Main) {
- owner.lifecycleScope.async {
- true
- }.await()
- }
- ).isTrue()
- }
-
- @Test
- fun launchOnIO() {
- val owner = FakeLifecycleOwner(Lifecycle.State.STARTED)
- assertThat(
- runBlocking(Dispatchers.IO) {
- owner.lifecycleScope.async {
- true
- }.await()
- }
- ).isTrue()
- }
-
- @Test
- fun destroyWhileRunning() {
- val startMutex = Mutex(locked = true)
- val alwaysLocked = Mutex(locked = true)
- val owner = FakeLifecycleOwner(Lifecycle.State.STARTED)
- val actionWasActive = owner.lifecycleScope.async(Dispatchers.IO) {
- startMutex.unlock()
- alwaysLocked.lock() // wait 4ever
- }
- runBlocking(Dispatchers.Main) {
- startMutex.lock() // wait until it starts
- owner.setState(Lifecycle.State.DESTROYED)
- actionWasActive.join()
- assertThat(actionWasActive.isCancelled).isTrue()
- }
- }
-
- @Test
- fun throwException() {
- val owner = FakeLifecycleOwner(Lifecycle.State.STARTED)
- runBlocking {
- val action = owner.lifecycleScope.async {
- throw RuntimeException("foo")
- }
- action.join()
- assertThat(action.getCompletionExceptionOrNull()).hasMessageThat().isSameAs("foo")
- }
- }
-
- @Test
- fun throwException_onStart() {
- val owner = FakeLifecycleOwner(Lifecycle.State.CREATED)
- runBlocking {
- // TODO guarantee later execution
- val action = owner.lifecycleScope.async {
- throw RuntimeException("foo")
- }
- withContext(Dispatchers.Main) {
- owner.setState(Lifecycle.State.STARTED)
- }
- action.join()
- assertThat(action.getCompletionExceptionOrNull()).hasMessageThat().isSameAs("foo")
- }
- }
-
- @Test
- fun runAnotherAfterCancellation_cancelOutside() {
- val owner = FakeLifecycleOwner(Lifecycle.State.STARTED)
- runBlocking {
- val action = owner.lifecycleScope.async {
- delay(20000)
- }
- action.cancel()
- action.join()
- }
- assertThat(runBlocking {
- owner.lifecycleScope.async {
- true
- }.await()
- }).isTrue()
- }
-
- @Test
- fun runAnotherAfterCancellation_cancelInside() {
- val owner = FakeLifecycleOwner(Lifecycle.State.STARTED)
- runBlocking {
- val action = owner.lifecycleScope.async {
- throw CancellationException("")
- }
- action.join()
- }
- assertThat(runBlocking {
- owner.lifecycleScope.async {
- true
- }.await()
- }).isTrue()
- }
-
- @Test
- fun runAnotherAfterFailure() {
- val owner = FakeLifecycleOwner(Lifecycle.State.STARTED)
- runBlocking {
- val action = owner.lifecycleScope.async {
- throw IllegalArgumentException("why not ?")
- }
- val result = kotlin.runCatching {
- action.await()
- }
- assertThat(result.exceptionOrNull())
- .isInstanceOf(IllegalArgumentException::class.java)
- }
- assertThat(runBlocking {
- owner.lifecycleScope.async {
- true
- }.await()
- }).isTrue()
- }
-}
diff --git a/lifecycle/integration-tests/kotlintestapp/src/test/java/androidx/lifecycle/LifecycleCoroutineScopeTest.kt b/lifecycle/integration-tests/kotlintestapp/src/test/java/androidx/lifecycle/LifecycleCoroutineScopeTest.kt
deleted file mode 100644
index fbf948e..0000000
--- a/lifecycle/integration-tests/kotlintestapp/src/test/java/androidx/lifecycle/LifecycleCoroutineScopeTest.kt
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2019 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.lifecycle
-
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.asCoroutineDispatcher
-import kotlinx.coroutines.test.resetMain
-import kotlinx.coroutines.test.setMain
-import org.junit.After
-import org.junit.Before
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-import java.util.concurrent.Executors
-import java.util.concurrent.TimeUnit
-
-/**
- * To ensure consistent behavior, we run these tests both on androidTest and test
- */
-@ExperimentalCoroutinesApi
-@RunWith(JUnit4::class)
-class LifecycleCoroutineScopeTest : LifecycleCoroutineScopeTestBase() {
- private val mainExecutor = Executors.newSingleThreadExecutor()
-
- @Before
- fun setMainDispatcher() {
- Dispatchers.setMain(mainExecutor.asCoroutineDispatcher())
- }
-
- @After
- fun clearMainDispatcher() {
- mainExecutor.shutdownNow()
- mainExecutor.awaitTermination(10, TimeUnit.SECONDS)
- Dispatchers.resetMain()
- }
-}
diff --git a/lifecycle/integration-tests/testapp/src/androidTest/java/androidx/lifecycle/FragmentInBackStackLifecycleTest.java b/lifecycle/integration-tests/testapp/src/androidTest/java/androidx/lifecycle/FragmentInBackStackLifecycleTest.java
index 07823d4..f4b0549 100644
--- a/lifecycle/integration-tests/testapp/src/androidTest/java/androidx/lifecycle/FragmentInBackStackLifecycleTest.java
+++ b/lifecycle/integration-tests/testapp/src/androidTest/java/androidx/lifecycle/FragmentInBackStackLifecycleTest.java
@@ -38,7 +38,7 @@
import androidx.lifecycle.testapp.EmptyActivity;
import androidx.lifecycle.testapp.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Rule;
@@ -47,7 +47,7 @@
import java.util.ArrayList;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class FragmentInBackStackLifecycleTest {
@Rule
diff --git a/lifecycle/integration-tests/testapp/src/androidTest/java/androidx/lifecycle/LiveDataOnSaveInstanceStateTest.java b/lifecycle/integration-tests/testapp/src/androidTest/java/androidx/lifecycle/LiveDataOnSaveInstanceStateTest.java
index 8dbc35e..ee28d32 100644
--- a/lifecycle/integration-tests/testapp/src/androidTest/java/androidx/lifecycle/LiveDataOnSaveInstanceStateTest.java
+++ b/lifecycle/integration-tests/testapp/src/androidTest/java/androidx/lifecycle/LiveDataOnSaveInstanceStateTest.java
@@ -28,8 +28,8 @@
import androidx.lifecycle.testapp.CollectingSupportFragment;
import androidx.lifecycle.testapp.NavigationDialogActivity;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -39,7 +39,7 @@
import java.util.concurrent.atomic.AtomicInteger;
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class LiveDataOnSaveInstanceStateTest {
@Rule
diff --git a/lifecycle/integration-tests/testapp/src/androidTest/java/androidx/lifecycle/ProcessOwnerTest.java b/lifecycle/integration-tests/testapp/src/androidTest/java/androidx/lifecycle/ProcessOwnerTest.java
index 981f1d0..5a73b6d 100644
--- a/lifecycle/integration-tests/testapp/src/androidTest/java/androidx/lifecycle/ProcessOwnerTest.java
+++ b/lifecycle/integration-tests/testapp/src/androidTest/java/androidx/lifecycle/ProcessOwnerTest.java
@@ -38,7 +38,7 @@
import androidx.lifecycle.testapp.NonSupportActivity;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -53,7 +53,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class ProcessOwnerTest {
diff --git a/lifecycle/livedata-core/api/2.0.0.txt b/lifecycle/livedata-core/api/2.0.0.txt
index 1656aab..82a6312 100644
--- a/lifecycle/livedata-core/api/2.0.0.txt
+++ b/lifecycle/livedata-core/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public abstract class LiveData<T> {
diff --git a/lifecycle/livedata-core/api/2.1.0-alpha01.txt b/lifecycle/livedata-core/api/2.1.0-alpha01.txt
index f0db7db..b59c9e6 100644
--- a/lifecycle/livedata-core/api/2.1.0-alpha01.txt
+++ b/lifecycle/livedata-core/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public abstract class LiveData<T> {
diff --git a/lifecycle/livedata-core/api/2.1.0-alpha02.txt b/lifecycle/livedata-core/api/2.1.0-alpha02.txt
index f0db7db..b59c9e6 100644
--- a/lifecycle/livedata-core/api/2.1.0-alpha02.txt
+++ b/lifecycle/livedata-core/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public abstract class LiveData<T> {
diff --git a/lifecycle/livedata-core/api/2.1.0-alpha03.txt b/lifecycle/livedata-core/api/2.1.0-alpha03.txt
deleted file mode 100644
index f0db7db..0000000
--- a/lifecycle/livedata-core/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public abstract class LiveData<T> {
- ctor public LiveData(T!);
- ctor public LiveData();
- method public T? getValue();
- method public boolean hasActiveObservers();
- method public boolean hasObservers();
- method @MainThread public void observe(androidx.lifecycle.LifecycleOwner, androidx.lifecycle.Observer<? super T>);
- method @MainThread public void observeForever(androidx.lifecycle.Observer<? super T>);
- method protected void onActive();
- method protected void onInactive();
- method protected void postValue(T!);
- method @MainThread public void removeObserver(androidx.lifecycle.Observer<? super T>);
- method @MainThread public void removeObservers(androidx.lifecycle.LifecycleOwner);
- method @MainThread protected void setValue(T!);
- }
-
- public class MutableLiveData<T> extends androidx.lifecycle.LiveData<T> {
- ctor public MutableLiveData(T!);
- ctor public MutableLiveData();
- method public void postValue(T!);
- method public void setValue(T!);
- }
-
- public interface Observer<T> {
- method public void onChanged(T!);
- }
-
-}
-
diff --git a/lifecycle/livedata-core/api/current.txt b/lifecycle/livedata-core/api/current.txt
index f0db7db..b59c9e6 100644
--- a/lifecycle/livedata-core/api/current.txt
+++ b/lifecycle/livedata-core/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public abstract class LiveData<T> {
diff --git a/lifecycle/livedata-core/api/res-2.1.0-alpha03.txt b/lifecycle/livedata-core/api/res-2.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/lifecycle/livedata-core/api/res-2.1.0-alpha03.txt
+++ /dev/null
diff --git a/lifecycle/livedata-core/api/restricted_2.0.0.txt b/lifecycle/livedata-core/api/restricted_2.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/livedata-core/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/livedata-core/api/restricted_2.1.0-alpha03.txt b/lifecycle/livedata-core/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/livedata-core/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/livedata-core/api/restricted_current.txt b/lifecycle/livedata-core/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/livedata-core/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/livedata-core/ktx/api/2.1.0-alpha01.txt b/lifecycle/livedata-core/ktx/api/2.1.0-alpha01.txt
index f2a9ac9..50f7bde 100644
--- a/lifecycle/livedata-core/ktx/api/2.1.0-alpha01.txt
+++ b/lifecycle/livedata-core/ktx/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class LiveDataKt {
diff --git a/lifecycle/livedata-core/ktx/api/2.1.0-alpha02.txt b/lifecycle/livedata-core/ktx/api/2.1.0-alpha02.txt
index 861a341..50f7bde 100644
--- a/lifecycle/livedata-core/ktx/api/2.1.0-alpha02.txt
+++ b/lifecycle/livedata-core/ktx/api/2.1.0-alpha02.txt
@@ -1,9 +1,9 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class LiveDataKt {
ctor public LiveDataKt();
- method @MainThread public static inline <T> androidx.lifecycle.Observer<T> observe(androidx.lifecycle.LiveData<T>, androidx.lifecycle.LifecycleOwner owner, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> onChanged);
+ method @MainThread public static <T> androidx.lifecycle.Observer<T> observe(androidx.lifecycle.LiveData<T>, androidx.lifecycle.LifecycleOwner owner, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> onChanged);
}
}
diff --git a/lifecycle/livedata-core/ktx/api/2.1.0-alpha03.txt b/lifecycle/livedata-core/ktx/api/2.1.0-alpha03.txt
deleted file mode 100644
index 861a341..0000000
--- a/lifecycle/livedata-core/ktx/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public final class LiveDataKt {
- ctor public LiveDataKt();
- method @MainThread public static inline <T> androidx.lifecycle.Observer<T> observe(androidx.lifecycle.LiveData<T>, androidx.lifecycle.LifecycleOwner owner, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> onChanged);
- }
-
-}
-
diff --git a/lifecycle/livedata-core/ktx/api/current.txt b/lifecycle/livedata-core/ktx/api/current.txt
index 861a341..50f7bde 100644
--- a/lifecycle/livedata-core/ktx/api/current.txt
+++ b/lifecycle/livedata-core/ktx/api/current.txt
@@ -1,9 +1,9 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class LiveDataKt {
ctor public LiveDataKt();
- method @MainThread public static inline <T> androidx.lifecycle.Observer<T> observe(androidx.lifecycle.LiveData<T>, androidx.lifecycle.LifecycleOwner owner, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> onChanged);
+ method @MainThread public static <T> androidx.lifecycle.Observer<T> observe(androidx.lifecycle.LiveData<T>, androidx.lifecycle.LifecycleOwner owner, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> onChanged);
}
}
diff --git a/lifecycle/livedata-core/ktx/api/res-2.1.0-alpha03.txt b/lifecycle/livedata-core/ktx/api/res-2.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/lifecycle/livedata-core/ktx/api/res-2.1.0-alpha03.txt
+++ /dev/null
diff --git a/lifecycle/livedata-core/ktx/api/restricted_2.1.0-alpha03.txt b/lifecycle/livedata-core/ktx/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/livedata-core/ktx/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/livedata-core/ktx/api/restricted_current.txt b/lifecycle/livedata-core/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/livedata-core/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/livedata/api/2.1.0-alpha01.txt b/lifecycle/livedata/api/2.1.0-alpha01.txt
index 2f5616b..5c4ba0d 100644
--- a/lifecycle/livedata/api/2.1.0-alpha01.txt
+++ b/lifecycle/livedata/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class MediatorLiveData<T> extends androidx.lifecycle.MutableLiveData<T> {
diff --git a/lifecycle/livedata/api/2.1.0-alpha02.txt b/lifecycle/livedata/api/2.1.0-alpha02.txt
index 2f5616b..5c4ba0d 100644
--- a/lifecycle/livedata/api/2.1.0-alpha02.txt
+++ b/lifecycle/livedata/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class MediatorLiveData<T> extends androidx.lifecycle.MutableLiveData<T> {
diff --git a/lifecycle/livedata/api/2.1.0-alpha03.txt b/lifecycle/livedata/api/2.1.0-alpha03.txt
deleted file mode 100644
index 2f5616b..0000000
--- a/lifecycle/livedata/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public class MediatorLiveData<T> extends androidx.lifecycle.MutableLiveData<T> {
- ctor public MediatorLiveData();
- method @MainThread public <S> void addSource(androidx.lifecycle.LiveData<S>, androidx.lifecycle.Observer<? super S>);
- method @MainThread public <S> void removeSource(androidx.lifecycle.LiveData<S>);
- }
-
- public class Transformations {
- method @MainThread public static <X> androidx.lifecycle.LiveData<X> distinctUntilChanged(androidx.lifecycle.LiveData<X>);
- method @MainThread public static <X, Y> androidx.lifecycle.LiveData<Y> map(androidx.lifecycle.LiveData<X>, androidx.arch.core.util.Function<X,Y>);
- method @MainThread public static <X, Y> androidx.lifecycle.LiveData<Y> switchMap(androidx.lifecycle.LiveData<X>, androidx.arch.core.util.Function<X,androidx.lifecycle.LiveData<Y>>);
- }
-
-}
-
diff --git a/lifecycle/livedata/api/current.txt b/lifecycle/livedata/api/current.txt
index 2f5616b..5c4ba0d 100644
--- a/lifecycle/livedata/api/current.txt
+++ b/lifecycle/livedata/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class MediatorLiveData<T> extends androidx.lifecycle.MutableLiveData<T> {
diff --git a/lifecycle/livedata/api/res-2.1.0-alpha03.txt b/lifecycle/livedata/api/res-2.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/lifecycle/livedata/api/res-2.1.0-alpha03.txt
+++ /dev/null
diff --git a/lifecycle/livedata/api/restricted_2.0.0.txt b/lifecycle/livedata/api/restricted_2.0.0.txt
deleted file mode 100644
index 2d7ce3b..0000000
--- a/lifecycle/livedata/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class ComputableLiveData<T> {
- ctor public ComputableLiveData();
- ctor public ComputableLiveData(java.util.concurrent.Executor);
- method @WorkerThread protected abstract T! compute();
- method public androidx.lifecycle.LiveData<T> getLiveData();
- method public void invalidate();
- }
-
-}
-
diff --git a/lifecycle/livedata/api/restricted_2.1.0-alpha03.txt b/lifecycle/livedata/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index c4aa36c..0000000
--- a/lifecycle/livedata/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class ComputableLiveData<T> {
- ctor public ComputableLiveData();
- ctor public ComputableLiveData(java.util.concurrent.Executor);
- method @WorkerThread protected abstract T! compute();
- method public androidx.lifecycle.LiveData<T> getLiveData();
- method public void invalidate();
- }
-
-}
-
diff --git a/lifecycle/livedata/api/restricted_current.txt b/lifecycle/livedata/api/restricted_current.txt
deleted file mode 100644
index c4aa36c..0000000
--- a/lifecycle/livedata/api/restricted_current.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class ComputableLiveData<T> {
- ctor public ComputableLiveData();
- ctor public ComputableLiveData(java.util.concurrent.Executor);
- method @WorkerThread protected abstract T! compute();
- method public androidx.lifecycle.LiveData<T> getLiveData();
- method public void invalidate();
- }
-
-}
-
diff --git a/lifecycle/livedata/ktx/api/2.1.0-alpha01.txt b/lifecycle/livedata/ktx/api/2.1.0-alpha01.txt
index 21fe035..ef528c1 100644
--- a/lifecycle/livedata/ktx/api/2.1.0-alpha01.txt
+++ b/lifecycle/livedata/ktx/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class TransformationsKt {
diff --git a/lifecycle/livedata/ktx/api/2.1.0-alpha02.txt b/lifecycle/livedata/ktx/api/2.1.0-alpha02.txt
index a21c943..ef528c1 100644
--- a/lifecycle/livedata/ktx/api/2.1.0-alpha02.txt
+++ b/lifecycle/livedata/ktx/api/2.1.0-alpha02.txt
@@ -1,11 +1,11 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class TransformationsKt {
ctor public TransformationsKt();
- method public static inline <X> androidx.lifecycle.LiveData<X> distinctUntilChanged(androidx.lifecycle.LiveData<X>);
- method public static inline <X, Y> androidx.lifecycle.LiveData<Y> map(androidx.lifecycle.LiveData<X>, kotlin.jvm.functions.Function1<? super X,? extends Y> transform);
- method public static inline <X, Y> androidx.lifecycle.LiveData<Y> switchMap(androidx.lifecycle.LiveData<X>, kotlin.jvm.functions.Function1<? super X,? extends androidx.lifecycle.LiveData<Y>> transform);
+ method public static <X> androidx.lifecycle.LiveData<X> distinctUntilChanged(androidx.lifecycle.LiveData<X>);
+ method public static <X, Y> androidx.lifecycle.LiveData<Y> map(androidx.lifecycle.LiveData<X>, kotlin.jvm.functions.Function1<? super X,? extends Y> transform);
+ method public static <X, Y> androidx.lifecycle.LiveData<Y> switchMap(androidx.lifecycle.LiveData<X>, kotlin.jvm.functions.Function1<? super X,? extends androidx.lifecycle.LiveData<Y>> transform);
}
}
diff --git a/lifecycle/livedata/ktx/api/2.1.0-alpha03.txt b/lifecycle/livedata/ktx/api/2.1.0-alpha03.txt
deleted file mode 100644
index a21c943..0000000
--- a/lifecycle/livedata/ktx/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public final class TransformationsKt {
- ctor public TransformationsKt();
- method public static inline <X> androidx.lifecycle.LiveData<X> distinctUntilChanged(androidx.lifecycle.LiveData<X>);
- method public static inline <X, Y> androidx.lifecycle.LiveData<Y> map(androidx.lifecycle.LiveData<X>, kotlin.jvm.functions.Function1<? super X,? extends Y> transform);
- method public static inline <X, Y> androidx.lifecycle.LiveData<Y> switchMap(androidx.lifecycle.LiveData<X>, kotlin.jvm.functions.Function1<? super X,? extends androidx.lifecycle.LiveData<Y>> transform);
- }
-
-}
-
diff --git a/lifecycle/livedata/ktx/api/current.txt b/lifecycle/livedata/ktx/api/current.txt
index a21c943..ef528c1 100644
--- a/lifecycle/livedata/ktx/api/current.txt
+++ b/lifecycle/livedata/ktx/api/current.txt
@@ -1,11 +1,11 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class TransformationsKt {
ctor public TransformationsKt();
- method public static inline <X> androidx.lifecycle.LiveData<X> distinctUntilChanged(androidx.lifecycle.LiveData<X>);
- method public static inline <X, Y> androidx.lifecycle.LiveData<Y> map(androidx.lifecycle.LiveData<X>, kotlin.jvm.functions.Function1<? super X,? extends Y> transform);
- method public static inline <X, Y> androidx.lifecycle.LiveData<Y> switchMap(androidx.lifecycle.LiveData<X>, kotlin.jvm.functions.Function1<? super X,? extends androidx.lifecycle.LiveData<Y>> transform);
+ method public static <X> androidx.lifecycle.LiveData<X> distinctUntilChanged(androidx.lifecycle.LiveData<X>);
+ method public static <X, Y> androidx.lifecycle.LiveData<Y> map(androidx.lifecycle.LiveData<X>, kotlin.jvm.functions.Function1<? super X,? extends Y> transform);
+ method public static <X, Y> androidx.lifecycle.LiveData<Y> switchMap(androidx.lifecycle.LiveData<X>, kotlin.jvm.functions.Function1<? super X,? extends androidx.lifecycle.LiveData<Y>> transform);
}
}
diff --git a/lifecycle/livedata/ktx/api/res-2.1.0-alpha03.txt b/lifecycle/livedata/ktx/api/res-2.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/lifecycle/livedata/ktx/api/res-2.1.0-alpha03.txt
+++ /dev/null
diff --git a/lifecycle/livedata/ktx/api/restricted_2.1.0-alpha03.txt b/lifecycle/livedata/ktx/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/livedata/ktx/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/livedata/ktx/api/restricted_current.txt b/lifecycle/livedata/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/livedata/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/livedata/src/main/java/androidx/lifecycle/ComputableLiveData.java b/lifecycle/livedata/src/main/java/androidx/lifecycle/ComputableLiveData.java
index 837a35d..7ce7a0a 100644
--- a/lifecycle/livedata/src/main/java/androidx/lifecycle/ComputableLiveData.java
+++ b/lifecycle/livedata/src/main/java/androidx/lifecycle/ComputableLiveData.java
@@ -37,7 +37,7 @@
* @param <T> The type of the live data
* @hide internal
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public abstract class ComputableLiveData<T> {
@SuppressWarnings("WeakerAccess") /* synthetic access */
final Executor mExecutor;
diff --git a/lifecycle/process/api/2.0.0.txt b/lifecycle/process/api/2.0.0.txt
index beea619..ee2ae90 100644
--- a/lifecycle/process/api/2.0.0.txt
+++ b/lifecycle/process/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class ProcessLifecycleOwner implements androidx.lifecycle.LifecycleOwner {
diff --git a/lifecycle/process/api/2.1.0-alpha01.txt b/lifecycle/process/api/2.1.0-alpha01.txt
index beea619..ee2ae90 100644
--- a/lifecycle/process/api/2.1.0-alpha01.txt
+++ b/lifecycle/process/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class ProcessLifecycleOwner implements androidx.lifecycle.LifecycleOwner {
diff --git a/lifecycle/process/api/2.1.0-alpha02.txt b/lifecycle/process/api/2.1.0-alpha02.txt
index beea619..ee2ae90 100644
--- a/lifecycle/process/api/2.1.0-alpha02.txt
+++ b/lifecycle/process/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class ProcessLifecycleOwner implements androidx.lifecycle.LifecycleOwner {
diff --git a/lifecycle/process/api/2.1.0-alpha03.txt b/lifecycle/process/api/2.1.0-alpha03.txt
deleted file mode 100644
index beea619..0000000
--- a/lifecycle/process/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public class ProcessLifecycleOwner implements androidx.lifecycle.LifecycleOwner {
- method public static androidx.lifecycle.LifecycleOwner get();
- method public androidx.lifecycle.Lifecycle getLifecycle();
- }
-
-}
-
diff --git a/lifecycle/process/api/current.txt b/lifecycle/process/api/current.txt
index beea619..ee2ae90 100644
--- a/lifecycle/process/api/current.txt
+++ b/lifecycle/process/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class ProcessLifecycleOwner implements androidx.lifecycle.LifecycleOwner {
diff --git a/lifecycle/process/api/res-2.1.0-alpha03.txt b/lifecycle/process/api/res-2.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/lifecycle/process/api/res-2.1.0-alpha03.txt
+++ /dev/null
diff --git a/lifecycle/process/api/restricted_2.0.0.txt b/lifecycle/process/api/restricted_2.0.0.txt
deleted file mode 100644
index c2d3603..0000000
--- a/lifecycle/process/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ProcessLifecycleOwnerInitializer {
- ctor public ProcessLifecycleOwnerInitializer();
- method public int delete(android.net.Uri, String!, String[]!);
- method public String? getType(android.net.Uri);
- method public android.net.Uri? insert(android.net.Uri, android.content.ContentValues!);
- method public boolean onCreate();
- method public android.database.Cursor? query(android.net.Uri, String[]!, String!, String[]!, String!);
- method public int update(android.net.Uri, android.content.ContentValues!, String!, String[]!);
- }
-
-}
-
diff --git a/lifecycle/process/api/restricted_2.1.0-alpha03.txt b/lifecycle/process/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index eab2976..0000000
--- a/lifecycle/process/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ProcessLifecycleOwnerInitializer extends android.content.ContentProvider {
- ctor public ProcessLifecycleOwnerInitializer();
- method public int delete(android.net.Uri, String!, String[]!);
- method public String? getType(android.net.Uri);
- method public android.net.Uri? insert(android.net.Uri, android.content.ContentValues!);
- method public boolean onCreate();
- method public android.database.Cursor? query(android.net.Uri, String[]!, String!, String[]!, String!);
- method public int update(android.net.Uri, android.content.ContentValues!, String!, String[]!);
- }
-
-}
-
diff --git a/lifecycle/process/api/restricted_current.txt b/lifecycle/process/api/restricted_current.txt
deleted file mode 100644
index eab2976..0000000
--- a/lifecycle/process/api/restricted_current.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ProcessLifecycleOwnerInitializer extends android.content.ContentProvider {
- ctor public ProcessLifecycleOwnerInitializer();
- method public int delete(android.net.Uri, String!, String[]!);
- method public String? getType(android.net.Uri);
- method public android.net.Uri? insert(android.net.Uri, android.content.ContentValues!);
- method public boolean onCreate();
- method public android.database.Cursor? query(android.net.Uri, String[]!, String!, String[]!, String!);
- method public int update(android.net.Uri, android.content.ContentValues!, String!, String[]!);
- }
-
-}
-
diff --git a/lifecycle/process/src/main/java/androidx/lifecycle/ProcessLifecycleOwnerInitializer.java b/lifecycle/process/src/main/java/androidx/lifecycle/ProcessLifecycleOwnerInitializer.java
index 18133c8..ba3dfe9 100644
--- a/lifecycle/process/src/main/java/androidx/lifecycle/ProcessLifecycleOwnerInitializer.java
+++ b/lifecycle/process/src/main/java/androidx/lifecycle/ProcessLifecycleOwnerInitializer.java
@@ -30,7 +30,7 @@
* @hide
*/
@SuppressWarnings("UnknownNullness") // TODO https://issuetracker.google.com/issues/112197238
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class ProcessLifecycleOwnerInitializer extends ContentProvider {
@Override
public boolean onCreate() {
diff --git a/lifecycle/reactivestreams/api/2.0.0.txt b/lifecycle/reactivestreams/api/2.0.0.txt
index f3d107a..ac0dbcb 100644
--- a/lifecycle/reactivestreams/api/2.0.0.txt
+++ b/lifecycle/reactivestreams/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class LiveDataReactiveStreams {
diff --git a/lifecycle/reactivestreams/api/2.1.0-alpha01.txt b/lifecycle/reactivestreams/api/2.1.0-alpha01.txt
index f3d107a..ac0dbcb 100644
--- a/lifecycle/reactivestreams/api/2.1.0-alpha01.txt
+++ b/lifecycle/reactivestreams/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class LiveDataReactiveStreams {
diff --git a/lifecycle/reactivestreams/api/2.1.0-alpha02.txt b/lifecycle/reactivestreams/api/2.1.0-alpha02.txt
index f3d107a..ac0dbcb 100644
--- a/lifecycle/reactivestreams/api/2.1.0-alpha02.txt
+++ b/lifecycle/reactivestreams/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class LiveDataReactiveStreams {
diff --git a/lifecycle/reactivestreams/api/2.1.0-alpha03.txt b/lifecycle/reactivestreams/api/2.1.0-alpha03.txt
deleted file mode 100644
index f3d107a..0000000
--- a/lifecycle/reactivestreams/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public final class LiveDataReactiveStreams {
- method public static <T> androidx.lifecycle.LiveData<T> fromPublisher(org.reactivestreams.Publisher<T>);
- method public static <T> org.reactivestreams.Publisher<T> toPublisher(androidx.lifecycle.LifecycleOwner, androidx.lifecycle.LiveData<T>);
- }
-
-}
-
diff --git a/lifecycle/reactivestreams/api/current.txt b/lifecycle/reactivestreams/api/current.txt
index f3d107a..ac0dbcb 100644
--- a/lifecycle/reactivestreams/api/current.txt
+++ b/lifecycle/reactivestreams/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class LiveDataReactiveStreams {
diff --git a/lifecycle/reactivestreams/api/res-2.1.0-alpha03.txt b/lifecycle/reactivestreams/api/res-2.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/lifecycle/reactivestreams/api/res-2.1.0-alpha03.txt
+++ /dev/null
diff --git a/lifecycle/reactivestreams/api/restricted_2.0.0.txt b/lifecycle/reactivestreams/api/restricted_2.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/reactivestreams/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/reactivestreams/api/restricted_2.1.0-alpha03.txt b/lifecycle/reactivestreams/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/reactivestreams/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/reactivestreams/api/restricted_current.txt b/lifecycle/reactivestreams/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/reactivestreams/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/reactivestreams/build.gradle b/lifecycle/reactivestreams/build.gradle
index bed1534..0a412b5 100644
--- a/lifecycle/reactivestreams/build.gradle
+++ b/lifecycle/reactivestreams/build.gradle
@@ -34,7 +34,7 @@
api(project(":lifecycle:lifecycle-common"))
api(project(":lifecycle:lifecycle-livedata"))
api(project(":lifecycle:lifecycle-runtime"))
- api(project(":annotation"))
+ api(SUPPORT_ANNOTATIONS)
api(REACTIVE_STREAMS)
annotationProcessor(NULLAWAY)
diff --git a/lifecycle/reactivestreams/ktx/api/2.0.0.txt b/lifecycle/reactivestreams/ktx/api/2.0.0.txt
index eea5d85..c137b3362 100644
--- a/lifecycle/reactivestreams/ktx/api/2.0.0.txt
+++ b/lifecycle/reactivestreams/ktx/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class LiveDataReactiveSteamsKt {
diff --git a/lifecycle/reactivestreams/ktx/api/2.1.0-alpha01.txt b/lifecycle/reactivestreams/ktx/api/2.1.0-alpha01.txt
index eea5d85..c137b3362 100644
--- a/lifecycle/reactivestreams/ktx/api/2.1.0-alpha01.txt
+++ b/lifecycle/reactivestreams/ktx/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class LiveDataReactiveSteamsKt {
diff --git a/lifecycle/reactivestreams/ktx/api/2.1.0-alpha02.txt b/lifecycle/reactivestreams/ktx/api/2.1.0-alpha02.txt
index 659d07d..c137b3362 100644
--- a/lifecycle/reactivestreams/ktx/api/2.1.0-alpha02.txt
+++ b/lifecycle/reactivestreams/ktx/api/2.1.0-alpha02.txt
@@ -1,10 +1,10 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class LiveDataReactiveSteamsKt {
ctor public LiveDataReactiveSteamsKt();
- method public static inline <T> androidx.lifecycle.LiveData<T> toLiveData(org.reactivestreams.Publisher<T>);
- method public static inline <T> org.reactivestreams.Publisher<T> toPublisher(androidx.lifecycle.LiveData<T>, androidx.lifecycle.LifecycleOwner lifecycle);
+ method public static <T> androidx.lifecycle.LiveData<T> toLiveData(org.reactivestreams.Publisher<T>);
+ method public static <T> org.reactivestreams.Publisher<T> toPublisher(androidx.lifecycle.LiveData<T>, androidx.lifecycle.LifecycleOwner lifecycle);
}
}
diff --git a/lifecycle/reactivestreams/ktx/api/2.1.0-alpha03.txt b/lifecycle/reactivestreams/ktx/api/2.1.0-alpha03.txt
deleted file mode 100644
index 659d07d..0000000
--- a/lifecycle/reactivestreams/ktx/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public final class LiveDataReactiveSteamsKt {
- ctor public LiveDataReactiveSteamsKt();
- method public static inline <T> androidx.lifecycle.LiveData<T> toLiveData(org.reactivestreams.Publisher<T>);
- method public static inline <T> org.reactivestreams.Publisher<T> toPublisher(androidx.lifecycle.LiveData<T>, androidx.lifecycle.LifecycleOwner lifecycle);
- }
-
-}
-
diff --git a/lifecycle/reactivestreams/ktx/api/current.txt b/lifecycle/reactivestreams/ktx/api/current.txt
index 659d07d..c137b3362 100644
--- a/lifecycle/reactivestreams/ktx/api/current.txt
+++ b/lifecycle/reactivestreams/ktx/api/current.txt
@@ -1,10 +1,10 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class LiveDataReactiveSteamsKt {
ctor public LiveDataReactiveSteamsKt();
- method public static inline <T> androidx.lifecycle.LiveData<T> toLiveData(org.reactivestreams.Publisher<T>);
- method public static inline <T> org.reactivestreams.Publisher<T> toPublisher(androidx.lifecycle.LiveData<T>, androidx.lifecycle.LifecycleOwner lifecycle);
+ method public static <T> androidx.lifecycle.LiveData<T> toLiveData(org.reactivestreams.Publisher<T>);
+ method public static <T> org.reactivestreams.Publisher<T> toPublisher(androidx.lifecycle.LiveData<T>, androidx.lifecycle.LifecycleOwner lifecycle);
}
}
diff --git a/lifecycle/reactivestreams/ktx/api/res-2.1.0-alpha03.txt b/lifecycle/reactivestreams/ktx/api/res-2.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/lifecycle/reactivestreams/ktx/api/res-2.1.0-alpha03.txt
+++ /dev/null
diff --git a/lifecycle/reactivestreams/ktx/api/restricted_2.0.0.txt b/lifecycle/reactivestreams/ktx/api/restricted_2.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/reactivestreams/ktx/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/reactivestreams/ktx/api/restricted_2.1.0-alpha03.txt b/lifecycle/reactivestreams/ktx/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/reactivestreams/ktx/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/reactivestreams/ktx/api/restricted_current.txt b/lifecycle/reactivestreams/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/reactivestreams/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/runtime/api/2.0.0.txt b/lifecycle/runtime/api/2.0.0.txt
index 7bb9371..767450d 100644
--- a/lifecycle/runtime/api/2.0.0.txt
+++ b/lifecycle/runtime/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class LifecycleRegistry extends androidx.lifecycle.Lifecycle {
diff --git a/lifecycle/runtime/api/2.1.0-alpha01.txt b/lifecycle/runtime/api/2.1.0-alpha01.txt
index 7bb9371..767450d 100644
--- a/lifecycle/runtime/api/2.1.0-alpha01.txt
+++ b/lifecycle/runtime/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class LifecycleRegistry extends androidx.lifecycle.Lifecycle {
diff --git a/lifecycle/runtime/api/2.1.0-alpha02.txt b/lifecycle/runtime/api/2.1.0-alpha02.txt
index 0a652c0..8b9aee1 100644
--- a/lifecycle/runtime/api/2.1.0-alpha02.txt
+++ b/lifecycle/runtime/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class LifecycleRegistry extends androidx.lifecycle.Lifecycle {
diff --git a/lifecycle/runtime/api/2.1.0-alpha03.txt b/lifecycle/runtime/api/2.1.0-alpha03.txt
deleted file mode 100644
index 0a652c0..0000000
--- a/lifecycle/runtime/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public class LifecycleRegistry extends androidx.lifecycle.Lifecycle {
- ctor public LifecycleRegistry(androidx.lifecycle.LifecycleOwner);
- method public void addObserver(androidx.lifecycle.LifecycleObserver);
- method public androidx.lifecycle.Lifecycle.State getCurrentState();
- method public int getObserverCount();
- method public void handleLifecycleEvent(androidx.lifecycle.Lifecycle.Event);
- method @Deprecated @MainThread public void markState(androidx.lifecycle.Lifecycle.State);
- method public void removeObserver(androidx.lifecycle.LifecycleObserver);
- method @MainThread public void setCurrentState(androidx.lifecycle.Lifecycle.State);
- }
-
- @Deprecated public interface LifecycleRegistryOwner extends androidx.lifecycle.LifecycleOwner {
- method @Deprecated public androidx.lifecycle.LifecycleRegistry getLifecycle();
- }
-
-}
-
diff --git a/lifecycle/runtime/api/current.txt b/lifecycle/runtime/api/current.txt
index 0a652c0..8b9aee1 100644
--- a/lifecycle/runtime/api/current.txt
+++ b/lifecycle/runtime/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class LifecycleRegistry extends androidx.lifecycle.Lifecycle {
diff --git a/lifecycle/runtime/api/res-2.1.0-alpha03.txt b/lifecycle/runtime/api/res-2.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/lifecycle/runtime/api/res-2.1.0-alpha03.txt
+++ /dev/null
diff --git a/lifecycle/runtime/api/restricted_2.0.0.txt b/lifecycle/runtime/api/restricted_2.0.0.txt
deleted file mode 100644
index bfa81cf..0000000
--- a/lifecycle/runtime/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ReportFragment {
- ctor public ReportFragment();
- method public static void injectIfNeededIn(android.app.Activity!);
- method public void onActivityCreated(android.os.Bundle!);
- method public void onDestroy();
- method public void onPause();
- method public void onResume();
- method public void onStart();
- method public void onStop();
- }
-
-}
-
diff --git a/lifecycle/runtime/api/restricted_2.1.0-alpha03.txt b/lifecycle/runtime/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index c79f82d..0000000
--- a/lifecycle/runtime/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ReportFragment extends android.app.Fragment {
- ctor public ReportFragment();
- method public static void injectIfNeededIn(android.app.Activity!);
- }
-
-}
-
diff --git a/lifecycle/runtime/api/restricted_current.txt b/lifecycle/runtime/api/restricted_current.txt
deleted file mode 100644
index c79f82d..0000000
--- a/lifecycle/runtime/api/restricted_current.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ReportFragment extends android.app.Fragment {
- ctor public ReportFragment();
- method public static void injectIfNeededIn(android.app.Activity!);
- }
-
-}
-
diff --git a/lifecycle/runtime/build.gradle b/lifecycle/runtime/build.gradle
index ab40c7d..fc45423 100644
--- a/lifecycle/runtime/build.gradle
+++ b/lifecycle/runtime/build.gradle
@@ -21,7 +21,7 @@
api(project(":lifecycle:lifecycle-common"))
api(project(":arch:core-common"))
// necessary for IJ to resolve dependencies.
- api(project(":annotation"))
+ api(SUPPORT_ANNOTATIONS)
testImplementation(JUNIT)
testImplementation(MOCKITO_CORE)
diff --git a/lifecycle/runtime/src/main/java/androidx/lifecycle/ReportFragment.java b/lifecycle/runtime/src/main/java/androidx/lifecycle/ReportFragment.java
index e2a80a2..ca1f3a9 100644
--- a/lifecycle/runtime/src/main/java/androidx/lifecycle/ReportFragment.java
+++ b/lifecycle/runtime/src/main/java/androidx/lifecycle/ReportFragment.java
@@ -28,7 +28,7 @@
* @hide
*/
@SuppressWarnings("UnknownNullness") // TODO https://issuetracker.google.com/issues/112197238
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class ReportFragment extends Fragment {
private static final String REPORT_FRAGMENT_TAG = "androidx.lifecycle"
+ ".LifecycleDispatcher.report_fragment_tag";
diff --git a/lifecycle/service/api/2.0.0.txt b/lifecycle/service/api/2.0.0.txt
index a12d86e..b7273c0 100644
--- a/lifecycle/service/api/2.0.0.txt
+++ b/lifecycle/service/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class LifecycleService extends android.app.Service implements androidx.lifecycle.LifecycleOwner {
diff --git a/lifecycle/service/api/2.1.0-alpha01.txt b/lifecycle/service/api/2.1.0-alpha01.txt
index a12d86e..b7273c0 100644
--- a/lifecycle/service/api/2.1.0-alpha01.txt
+++ b/lifecycle/service/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class LifecycleService extends android.app.Service implements androidx.lifecycle.LifecycleOwner {
diff --git a/lifecycle/service/api/2.1.0-alpha02.txt b/lifecycle/service/api/2.1.0-alpha02.txt
index a12d86e..b7273c0 100644
--- a/lifecycle/service/api/2.1.0-alpha02.txt
+++ b/lifecycle/service/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class LifecycleService extends android.app.Service implements androidx.lifecycle.LifecycleOwner {
diff --git a/lifecycle/service/api/2.1.0-alpha03.txt b/lifecycle/service/api/2.1.0-alpha03.txt
deleted file mode 100644
index a12d86e..0000000
--- a/lifecycle/service/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public class LifecycleService extends android.app.Service implements androidx.lifecycle.LifecycleOwner {
- ctor public LifecycleService();
- method public androidx.lifecycle.Lifecycle getLifecycle();
- method @CallSuper public android.os.IBinder? onBind(android.content.Intent);
- method @CallSuper public void onStart(android.content.Intent, int);
- }
-
- public class ServiceLifecycleDispatcher {
- ctor public ServiceLifecycleDispatcher(androidx.lifecycle.LifecycleOwner);
- method public androidx.lifecycle.Lifecycle getLifecycle();
- method public void onServicePreSuperOnBind();
- method public void onServicePreSuperOnCreate();
- method public void onServicePreSuperOnDestroy();
- method public void onServicePreSuperOnStart();
- }
-
-}
-
diff --git a/lifecycle/service/api/current.txt b/lifecycle/service/api/current.txt
index a12d86e..b7273c0 100644
--- a/lifecycle/service/api/current.txt
+++ b/lifecycle/service/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class LifecycleService extends android.app.Service implements androidx.lifecycle.LifecycleOwner {
diff --git a/lifecycle/service/api/res-2.1.0-alpha03.txt b/lifecycle/service/api/res-2.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/lifecycle/service/api/res-2.1.0-alpha03.txt
+++ /dev/null
diff --git a/lifecycle/service/api/restricted_2.0.0.txt b/lifecycle/service/api/restricted_2.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/service/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/service/api/restricted_2.1.0-alpha03.txt b/lifecycle/service/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/service/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/service/api/restricted_current.txt b/lifecycle/service/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/service/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/viewmodel-savedstate/build.gradle b/lifecycle/viewmodel-savedstate/build.gradle
index 80941d5..b73b401 100644
--- a/lifecycle/viewmodel-savedstate/build.gradle
+++ b/lifecycle/viewmodel-savedstate/build.gradle
@@ -31,8 +31,8 @@
}
dependencies {
- api(project(":annotation"))
- api(project(":savedstate"))
+ api(SUPPORT_ANNOTATIONS)
+ api(project(":savedstate:savedstate-common"))
api(project(":lifecycle:lifecycle-livedata-core"))
api(project(":lifecycle:lifecycle-viewmodel"))
diff --git a/lifecycle/viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/SavedStateHandleTest.kt b/lifecycle/viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/SavedStateHandleTest.kt
index cbef37e..69cbfd6 100644
--- a/lifecycle/viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/SavedStateHandleTest.kt
+++ b/lifecycle/viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/SavedStateHandleTest.kt
@@ -19,13 +19,11 @@
import androidx.lifecycle.SavedStateHandle
import androidx.test.annotation.UiThreadTest
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
-@SmallTest
class SavedStateHandleTest {
@Test
diff --git a/lifecycle/viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/ViewModelsWithStateTests.java b/lifecycle/viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/ViewModelsWithStateTests.java
index 25073a5..1917cb3 100644
--- a/lifecycle/viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/ViewModelsWithStateTests.java
+++ b/lifecycle/viewmodel-savedstate/src/androidTest/java/androidx/lifecycle/viewmodel/savedstate/ViewModelsWithStateTests.java
@@ -31,7 +31,7 @@
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.viewmodel.savedstate.activity.FakingSavedStateActivity;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -44,7 +44,7 @@
import java.util.Collection;
@RunWith(Parameterized.class)
-@SmallTest
+@MediumTest
public class ViewModelsWithStateTests {
private static final String FRAGMENT_MODE = "fragment";
diff --git a/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/AbstractSavedStateVMFactory.java b/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/AbstractSavedStateVMFactory.java
index e5beb04..cd3a0dc 100644
--- a/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/AbstractSavedStateVMFactory.java
+++ b/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/AbstractSavedStateVMFactory.java
@@ -16,12 +16,12 @@
package androidx.lifecycle;
+import android.app.Application;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.savedstate.SavedStateRegistry;
-import androidx.savedstate.SavedStateRegistryOwner;
/**
* Skeleton of {@link androidx.lifecycle.ViewModelProvider.KeyedFactory}
@@ -29,28 +29,22 @@
* implement {@link #create(String, Class, SavedStateHandle)} to actually instantiate
* {@code ViewModels}.
*/
-public abstract class AbstractSavedStateVMFactory extends ViewModelProvider.KeyedFactory {
- static final String TAG_SAVED_STATE_HANDLE_CONTROLLER = "androidx.lifecycle.savedstate.vm.tag";
+public abstract class AbstractSavedStateVMFactory implements ViewModelProvider.KeyedFactory {
+ static final String TAG_SAVED_STATE_HANDLE = "androidx.lifecycle.savedstate.vm.tag";
- private final SavedStateRegistry mSavedStateRegistry;
- private final Lifecycle mLifecycle;
+ private final SavedStateRegistry<Bundle> mSavedStateRegistry;
private final Bundle mDefaultArgs;
/**
* Constructs this factory.
- *
- * @param owner {@link SavedStateRegistryOwner} that will provide restored state for created
- * {@link ViewModel ViewModels}
- * @param defaultArgs values from this {@code Bundle} will be used as defaults by
- * {@link SavedStateHandle} passed in {@link ViewModel ViewModels}
- * if there is no previously saved state
- * or previously saved state misses a value by such key
*/
- public AbstractSavedStateVMFactory(@NonNull SavedStateRegistryOwner owner,
+ public AbstractSavedStateVMFactory(
+ @NonNull Application application,
+ @NonNull SavedStateRegistry<Bundle> savedStateRegistry,
@Nullable Bundle defaultArgs) {
- mSavedStateRegistry = owner.getSavedStateRegistry();
- mLifecycle = owner.getLifecycle();
+ mSavedStateRegistry = savedStateRegistry;
mDefaultArgs = defaultArgs;
+ VMSavedStateInitializer.initializeIfNeeded(application);
}
@NonNull
@@ -58,27 +52,12 @@
public final <T extends ViewModel> T create(@NonNull String key, @NonNull Class<T> modelClass) {
Bundle restoredState = mSavedStateRegistry.consumeRestoredStateForKey(key);
SavedStateHandle handle = SavedStateHandle.createHandle(restoredState, mDefaultArgs);
- SavedStateHandleController controller = new SavedStateHandleController(key, handle);
- controller.attachToLifecycle(mSavedStateRegistry, mLifecycle);
+ mSavedStateRegistry.registerSavedStateProvider(key, handle.savedStateProvider());
T viewmodel = create(key, modelClass, handle);
- viewmodel.setTagIfAbsent(TAG_SAVED_STATE_HANDLE_CONTROLLER, controller);
- mSavedStateRegistry.runOnNextRecreation(OnRecreation.class);
+ viewmodel.setTagIfAbsent(TAG_SAVED_STATE_HANDLE, handle);
return viewmodel;
}
- @NonNull
- @Override
- public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
- // ViewModelProvider calls correct create that support same modelClass with different keys
- // If a developer manually calls this method, there is no "key" in picture, so factory
- // simply uses classname internally as as key.
- String canonicalName = modelClass.getCanonicalName();
- if (canonicalName == null) {
- throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
- }
- return create(canonicalName, modelClass);
- }
-
/**
* Creates a new instance of the given {@code Class}.
* <p>
@@ -86,69 +65,11 @@
* @param key a key associated with the requested ViewModel
* @param modelClass a {@code Class} whose instance is requested
* @param handle a handle to saved state associated with the requested ViewModel
- * @param <T> The type parameter for the ViewModel.
+ * @param <T> The type parameter for the ViewModel.
* @return a newly created ViewModels
*/
@NonNull
protected abstract <T extends ViewModel> T create(@NonNull String key,
@NonNull Class<T> modelClass, @NonNull SavedStateHandle handle);
-
- static final class OnRecreation implements SavedStateRegistry.AutoRecreated {
-
- @Override
- public void onRecreated(@NonNull SavedStateRegistryOwner owner) {
- if (!(owner instanceof ViewModelStoreOwner)) {
- throw new IllegalStateException(
- "Internal error: OnRecreation should be registered only on components"
- + "that implement ViewModelStoreOwner");
- }
- ViewModelStore viewModelStore = ((ViewModelStoreOwner) owner).getViewModelStore();
- SavedStateRegistry savedStateRegistry = owner.getSavedStateRegistry();
- for (String key : viewModelStore.keys()) {
- ViewModel viewModel = viewModelStore.get(key);
- SavedStateHandleController controller = viewModel.getTag(
- TAG_SAVED_STATE_HANDLE_CONTROLLER);
- if (controller != null && !controller.isAttached()) {
- controller.attachToLifecycle(owner.getSavedStateRegistry(),
- owner.getLifecycle());
- }
- }
- if (!viewModelStore.keys().isEmpty()) {
- savedStateRegistry.runOnNextRecreation(OnRecreation.class);
- }
- }
- }
-
- static final class SavedStateHandleController implements LifecycleEventObserver {
- private final String mKey;
- boolean mIsAttached = false;
- private final SavedStateHandle mHandle;
-
- SavedStateHandleController(String key, SavedStateHandle handle) {
- mKey = key;
- mHandle = handle;
- }
-
- boolean isAttached() {
- return mIsAttached;
- }
-
- void attachToLifecycle(SavedStateRegistry registry, Lifecycle lifecycle) {
- if (mIsAttached) {
- throw new IllegalStateException("Already attached to lifecycleOwner");
- }
- mIsAttached = true;
- lifecycle.addObserver(this);
- registry.registerSavedStateProvider(mKey, mHandle.savedStateProvider());
- }
-
- @Override
- public void onStateChanged(@NonNull LifecycleOwner source, @NonNull Lifecycle.Event event) {
- if (event == Lifecycle.Event.ON_DESTROY) {
- mIsAttached = false;
- source.getLifecycle().removeObserver(this);
- }
- }
- }
}
diff --git a/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandle.java b/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandle.java
index 782966a..564d19a2 100644
--- a/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandle.java
+++ b/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandle.java
@@ -20,6 +20,7 @@
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
+import android.util.Log;
import android.util.Size;
import android.util.SizeF;
import android.util.SparseArray;
@@ -46,28 +47,6 @@
private static final String VALUES = "values";
private static final String KEYS = "keys";
- private final SavedStateProvider mSavedStateProvider = new SavedStateProvider() {
- @SuppressWarnings("unchecked")
- @NonNull
- @Override
- public Bundle saveState() {
- Set<String> keySet = mRegular.keySet();
- ArrayList keys = new ArrayList(keySet.size());
- ArrayList value = new ArrayList(keys.size());
- for (String key : keySet) {
- keys.add(key);
- value.add(mRegular.get(key));
- }
-
- Bundle res = new Bundle();
- // "parcelable" arraylists - lol
- res.putParcelableArrayList("keys", keys);
- res.putParcelableArrayList("values", value);
- return res;
- }
- };
-
-
/**
* Creates a handle with the given initial arguments.
*/
@@ -102,7 +81,7 @@
ArrayList keys = restoredState.getParcelableArrayList(KEYS);
ArrayList values = restoredState.getParcelableArrayList(VALUES);
if (keys == null || values == null || keys.size() != values.size()) {
- throw new IllegalStateException("Invalid bundle passed as restored state");
+ Log.e("SavedStateAccessor", "Invalid bundle passed to the restoration phase");
}
for (int i = 0; i < keys.size(); i++) {
state.put((String) keys.get(i), values.get(i));
@@ -111,8 +90,27 @@
}
@NonNull
- SavedStateProvider savedStateProvider() {
- return mSavedStateProvider;
+ SavedStateProvider<Bundle> savedStateProvider() {
+ return new SavedStateProvider<Bundle>() {
+ @SuppressWarnings("unchecked")
+ @NonNull
+ @Override
+ public Bundle saveState() {
+ Set<String> keySet = mRegular.keySet();
+ ArrayList keys = new ArrayList(keySet.size());
+ ArrayList value = new ArrayList(keys.size());
+ for (String key : keySet) {
+ keys.add(key);
+ value.add(mRegular.get(key));
+ }
+
+ Bundle res = new Bundle();
+ // "parcelable" arraylists - lol
+ res.putParcelableArrayList("keys", keys);
+ res.putParcelableArrayList("values", value);
+ return res;
+ }
+ };
}
/**
diff --git a/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateVMFactory.java b/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateVMFactory.java
index 57cacb4..c642040 100644
--- a/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateVMFactory.java
+++ b/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateVMFactory.java
@@ -24,7 +24,7 @@
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
-import androidx.savedstate.SavedStateRegistryOwner;
+import androidx.savedstate.SavedStateRegistry;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
@@ -69,7 +69,8 @@
* miss a value by such key.
*/
public SavedStateVMFactory(@NonNull Fragment fragment, @Nullable Bundle defaultArgs) {
- this(checkApplication(checkActivity(fragment)), fragment, defaultArgs);
+ this(checkApplication(checkActivity(fragment)),
+ fragment.getBundleSavedStateRegistry(), defaultArgs);
}
/**
@@ -96,7 +97,7 @@
* misses a value by such key.
*/
public SavedStateVMFactory(@NonNull FragmentActivity activity, @Nullable Bundle defaultArgs) {
- this(checkApplication(activity), activity, defaultArgs);
+ this(checkApplication(activity), activity.getBundleSavedStateRegistry(), defaultArgs);
}
/**
@@ -106,16 +107,15 @@
* the given {@code activity}.
*
* @param application an application
- * @param owner {@link SavedStateRegistryOwner} that will provide restored state for created
- * {@link ViewModel ViewModels}
+ * @param savedStateRegistry registry to retrieve saved state from and later to contribute
* @param defaultArgs values from this {@code Bundle} will be used as defaults by
* {@link SavedStateHandle} if there is no previously saved state or previously saved state
* misses a value by such key.
*/
public SavedStateVMFactory(@NonNull Application application,
- @NonNull SavedStateRegistryOwner owner,
+ @NonNull SavedStateRegistry<Bundle> savedStateRegistry,
@Nullable Bundle defaultArgs) {
- super(owner, defaultArgs);
+ super(application, savedStateRegistry, defaultArgs);
mApplication = application;
mFactory = ViewModelProvider.AndroidViewModelFactory.getInstance(application);
}
diff --git a/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/VMSavedStateInitializer.java b/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/VMSavedStateInitializer.java
new file mode 100644
index 0000000..d2d61dd
--- /dev/null
+++ b/lifecycle/viewmodel-savedstate/src/main/java/androidx/lifecycle/VMSavedStateInitializer.java
@@ -0,0 +1,115 @@
+/*
+ * 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.lifecycle;
+
+import android.app.Activity;
+import android.app.Application;
+import android.content.Context;
+import android.os.Bundle;
+
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
+import androidx.fragment.app.FragmentManager;
+import androidx.savedstate.SavedStateRegistry;
+
+class VMSavedStateInitializer implements Application.ActivityLifecycleCallbacks {
+
+ private static boolean sInitialized = false;
+
+ static void initializeIfNeeded(Application application) {
+ if (!sInitialized) {
+ application.registerActivityLifecycleCallbacks(new VMSavedStateInitializer());
+ sInitialized = true;
+ }
+ }
+
+ @Override
+ public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
+ if (activity instanceof FragmentActivity) {
+ final FragmentActivity fragmentActivity = (FragmentActivity) activity;
+ fragmentActivity.getSupportFragmentManager()
+ .registerFragmentLifecycleCallbacks(new FragmentCallbacks(), true);
+ // but it is too early - viewmodels aren't ready yet.
+ fragmentActivity.getLifecycle().addObserver(new LifecycleEventObserver() {
+ @Override
+ public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
+ // next event is going to be created....
+ if (!fragmentActivity.getViewModelStore().keys().isEmpty()) {
+ attach(fragmentActivity.getBundleSavedStateRegistry(), fragmentActivity);
+ }
+ source.getLifecycle().removeObserver(this);
+ }
+ });
+
+ }
+ }
+
+ @Override
+ public void onActivityStarted(Activity activity) {
+
+ }
+
+ @Override
+ public void onActivityResumed(Activity activity) {
+
+ }
+
+ @Override
+ public void onActivityPaused(Activity activity) {
+
+ }
+
+ @Override
+ public void onActivityStopped(Activity activity) {
+
+ }
+
+ @Override
+ public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
+
+ }
+
+ @Override
+ public void onActivityDestroyed(Activity activity) {
+
+ }
+
+ @SuppressWarnings("WeakerAccess")
+ static void attach(SavedStateRegistry<Bundle> savedStateStore, ViewModelStoreOwner store) {
+ ViewModelStore viewModelStore = store.getViewModelStore();
+ for (String key : viewModelStore.keys()) {
+ ViewModel viewModel = viewModelStore.get(key);
+ SavedStateHandle handle = viewModel
+ .getTag(AbstractSavedStateVMFactory.TAG_SAVED_STATE_HANDLE);
+ if (handle != null) {
+ savedStateStore.unregisterSavedStateProvider(key);
+ savedStateStore.registerSavedStateProvider(key, handle.savedStateProvider());
+ }
+ }
+ }
+
+ static class FragmentCallbacks extends FragmentManager.FragmentLifecycleCallbacks {
+ @Override
+ public void onFragmentAttached(@NonNull FragmentManager fm,
+ @NonNull Fragment fragment, @NonNull Context context) {
+ if (!fragment.getViewModelStore().keys().isEmpty()) {
+ attach(fragment.getBundleSavedStateRegistry(), fragment);
+ }
+ }
+ }
+}
diff --git a/lifecycle/viewmodel/api/2.0.0.txt b/lifecycle/viewmodel/api/2.0.0.txt
index d30b55f..2bfd246 100644
--- a/lifecycle/viewmodel/api/2.0.0.txt
+++ b/lifecycle/viewmodel/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class AndroidViewModel extends androidx.lifecycle.ViewModel {
diff --git a/lifecycle/viewmodel/api/2.1.0-alpha01.txt b/lifecycle/viewmodel/api/2.1.0-alpha01.txt
index 0a6e010..1dea887 100644
--- a/lifecycle/viewmodel/api/2.1.0-alpha01.txt
+++ b/lifecycle/viewmodel/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class AndroidViewModel extends androidx.lifecycle.ViewModel {
diff --git a/lifecycle/viewmodel/api/2.1.0-alpha02.txt b/lifecycle/viewmodel/api/2.1.0-alpha02.txt
index 0a6e010..1dea887 100644
--- a/lifecycle/viewmodel/api/2.1.0-alpha02.txt
+++ b/lifecycle/viewmodel/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class AndroidViewModel extends androidx.lifecycle.ViewModel {
diff --git a/lifecycle/viewmodel/api/2.1.0-alpha03.txt b/lifecycle/viewmodel/api/2.1.0-alpha03.txt
deleted file mode 100644
index d30b55f..0000000
--- a/lifecycle/viewmodel/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public class AndroidViewModel extends androidx.lifecycle.ViewModel {
- ctor public AndroidViewModel(android.app.Application);
- method public <T extends android.app.Application> T getApplication();
- }
-
- public abstract class ViewModel {
- ctor public ViewModel();
- method protected void onCleared();
- }
-
- public class ViewModelProvider {
- ctor public ViewModelProvider(androidx.lifecycle.ViewModelStoreOwner, androidx.lifecycle.ViewModelProvider.Factory);
- ctor public ViewModelProvider(androidx.lifecycle.ViewModelStore, androidx.lifecycle.ViewModelProvider.Factory);
- method @MainThread public <T extends androidx.lifecycle.ViewModel> T get(Class<T>);
- method @MainThread public <T extends androidx.lifecycle.ViewModel> T get(String, Class<T>);
- }
-
- public static class ViewModelProvider.AndroidViewModelFactory extends androidx.lifecycle.ViewModelProvider.NewInstanceFactory {
- ctor public ViewModelProvider.AndroidViewModelFactory(android.app.Application);
- method public static androidx.lifecycle.ViewModelProvider.AndroidViewModelFactory getInstance(android.app.Application);
- }
-
- public static interface ViewModelProvider.Factory {
- method public <T extends androidx.lifecycle.ViewModel> T create(Class<T>);
- }
-
- public static class ViewModelProvider.NewInstanceFactory implements androidx.lifecycle.ViewModelProvider.Factory {
- ctor public ViewModelProvider.NewInstanceFactory();
- method public <T extends androidx.lifecycle.ViewModel> T create(Class<T>);
- }
-
- public class ViewModelStore {
- ctor public ViewModelStore();
- method public final void clear();
- }
-
- public interface ViewModelStoreOwner {
- method public androidx.lifecycle.ViewModelStore getViewModelStore();
- }
-
-}
-
diff --git a/lifecycle/viewmodel/api/current.txt b/lifecycle/viewmodel/api/current.txt
index d30b55f..1dea887 100644
--- a/lifecycle/viewmodel/api/current.txt
+++ b/lifecycle/viewmodel/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public class AndroidViewModel extends androidx.lifecycle.ViewModel {
@@ -14,6 +14,8 @@
public class ViewModelProvider {
ctor public ViewModelProvider(androidx.lifecycle.ViewModelStoreOwner, androidx.lifecycle.ViewModelProvider.Factory);
ctor public ViewModelProvider(androidx.lifecycle.ViewModelStore, androidx.lifecycle.ViewModelProvider.Factory);
+ ctor public ViewModelProvider(androidx.lifecycle.ViewModelStoreOwner, androidx.lifecycle.ViewModelProvider.KeyedFactory);
+ ctor public ViewModelProvider(androidx.lifecycle.ViewModelStore, androidx.lifecycle.ViewModelProvider.KeyedFactory);
method @MainThread public <T extends androidx.lifecycle.ViewModel> T get(Class<T>);
method @MainThread public <T extends androidx.lifecycle.ViewModel> T get(String, Class<T>);
}
@@ -27,6 +29,10 @@
method public <T extends androidx.lifecycle.ViewModel> T create(Class<T>);
}
+ public static interface ViewModelProvider.KeyedFactory {
+ method public <T extends androidx.lifecycle.ViewModel> T create(String, Class<T>);
+ }
+
public static class ViewModelProvider.NewInstanceFactory implements androidx.lifecycle.ViewModelProvider.Factory {
ctor public ViewModelProvider.NewInstanceFactory();
method public <T extends androidx.lifecycle.ViewModel> T create(Class<T>);
diff --git a/lifecycle/viewmodel/api/res-2.1.0-alpha03.txt b/lifecycle/viewmodel/api/res-2.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/lifecycle/viewmodel/api/res-2.1.0-alpha03.txt
+++ /dev/null
diff --git a/lifecycle/viewmodel/api/restricted_2.0.0.txt b/lifecycle/viewmodel/api/restricted_2.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/viewmodel/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/viewmodel/api/restricted_2.1.0-alpha03.txt b/lifecycle/viewmodel/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/viewmodel/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/viewmodel/api/restricted_current.txt b/lifecycle/viewmodel/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/viewmodel/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/viewmodel/build.gradle b/lifecycle/viewmodel/build.gradle
index bdb416e..7d940ce 100644
--- a/lifecycle/viewmodel/build.gradle
+++ b/lifecycle/viewmodel/build.gradle
@@ -34,7 +34,7 @@
}
dependencies {
- api(project(":annotation"))
+ api(SUPPORT_ANNOTATIONS)
testImplementation(JUNIT)
testImplementation(MOCKITO_CORE)
diff --git a/lifecycle/viewmodel/ktx/api/2.0.0.txt b/lifecycle/viewmodel/ktx/api/2.0.0.txt
index 923ee14..183eaa0 100644
--- a/lifecycle/viewmodel/ktx/api/2.0.0.txt
+++ b/lifecycle/viewmodel/ktx/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class ViewModelProviderKt {
diff --git a/lifecycle/viewmodel/ktx/api/2.1.0-alpha01.txt b/lifecycle/viewmodel/ktx/api/2.1.0-alpha01.txt
index b543d19..61e351d 100644
--- a/lifecycle/viewmodel/ktx/api/2.1.0-alpha01.txt
+++ b/lifecycle/viewmodel/ktx/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class ViewModelKt {
diff --git a/lifecycle/viewmodel/ktx/api/2.1.0-alpha02.txt b/lifecycle/viewmodel/ktx/api/2.1.0-alpha02.txt
index 2c78583..61e351d 100644
--- a/lifecycle/viewmodel/ktx/api/2.1.0-alpha02.txt
+++ b/lifecycle/viewmodel/ktx/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class ViewModelKt {
@@ -15,7 +15,6 @@
public final class ViewModelProviderKt {
ctor public ViewModelProviderKt();
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> VM! get(androidx.lifecycle.ViewModelProvider);
}
}
diff --git a/lifecycle/viewmodel/ktx/api/2.1.0-alpha03.txt b/lifecycle/viewmodel/ktx/api/2.1.0-alpha03.txt
deleted file mode 100644
index 2c78583..0000000
--- a/lifecycle/viewmodel/ktx/api/2.1.0-alpha03.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-// Signature format: 3.0
-package androidx.lifecycle {
-
- public final class ViewModelKt {
- ctor public ViewModelKt();
- method public static kotlinx.coroutines.CoroutineScope getViewModelScope(androidx.lifecycle.ViewModel);
- }
-
- public final class ViewModelLazy<VM extends androidx.lifecycle.ViewModel> implements kotlin.Lazy<VM> {
- ctor public ViewModelLazy(kotlin.reflect.KClass<VM> viewModelClass, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelStoreOwner> ownerProducer, kotlin.jvm.functions.Function0<? extends androidx.lifecycle.ViewModelProvider.Factory> factoryProducer);
- method public VM getValue();
- method public boolean isInitialized();
- property public VM value;
- }
-
- public final class ViewModelProviderKt {
- ctor public ViewModelProviderKt();
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> VM! get(androidx.lifecycle.ViewModelProvider);
- }
-
-}
-
diff --git a/lifecycle/viewmodel/ktx/api/current.txt b/lifecycle/viewmodel/ktx/api/current.txt
index 2c78583..61e351d 100644
--- a/lifecycle/viewmodel/ktx/api/current.txt
+++ b/lifecycle/viewmodel/ktx/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.lifecycle {
public final class ViewModelKt {
@@ -15,7 +15,6 @@
public final class ViewModelProviderKt {
ctor public ViewModelProviderKt();
- method @MainThread public static inline <reified VM extends androidx.lifecycle.ViewModel> VM! get(androidx.lifecycle.ViewModelProvider);
}
}
diff --git a/lifecycle/viewmodel/ktx/api/res-2.1.0-alpha03.txt b/lifecycle/viewmodel/ktx/api/res-2.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/lifecycle/viewmodel/ktx/api/res-2.1.0-alpha03.txt
+++ /dev/null
diff --git a/lifecycle/viewmodel/ktx/api/restricted_2.0.0.txt b/lifecycle/viewmodel/ktx/api/restricted_2.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/viewmodel/ktx/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/viewmodel/ktx/api/restricted_2.1.0-alpha03.txt b/lifecycle/viewmodel/ktx/api/restricted_2.1.0-alpha03.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/viewmodel/ktx/api/restricted_2.1.0-alpha03.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/viewmodel/ktx/api/restricted_current.txt b/lifecycle/viewmodel/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/lifecycle/viewmodel/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/lifecycle/viewmodel/src/main/java/androidx/lifecycle/ViewModelProvider.java b/lifecycle/viewmodel/src/main/java/androidx/lifecycle/ViewModelProvider.java
index fa2efb9..121e191d6 100644
--- a/lifecycle/viewmodel/src/main/java/androidx/lifecycle/ViewModelProvider.java
+++ b/lifecycle/viewmodel/src/main/java/androidx/lifecycle/ViewModelProvider.java
@@ -57,7 +57,7 @@
* This is more advanced version of {@link Factory} that receives a key specified for requested
* {@link ViewModel}.
*/
- abstract static class KeyedFactory implements Factory {
+ public interface KeyedFactory {
/**
* Creates a new instance of the given {@code Class}.
*
@@ -67,18 +67,10 @@
* @return a newly created ViewModel
*/
@NonNull
- public abstract <T extends ViewModel> T create(@NonNull String key,
- @NonNull Class<T> modelClass);
-
- @NonNull
- @Override
- public <T extends ViewModel> T create(@NonNull Class<T> modelClass) {
- throw new UnsupportedOperationException("create(String, Class<?>) must be called on "
- + "implementaions of KeyedFactory");
- }
+ <T extends ViewModel> T create(@NonNull String key, @NonNull Class<T> modelClass);
}
- private final Factory mFactory;
+ private final KeyedFactory mFactory;
private final ViewModelStore mViewModelStore;
/**
@@ -103,6 +95,31 @@
* new {@code ViewModels}
*/
public ViewModelProvider(@NonNull ViewModelStore store, @NonNull Factory factory) {
+ this(store, new FactoryWrapper(factory));
+ }
+
+ /**
+` * Creates {@code ViewModelProvider}, which will create {@code ViewModels} via the given
+ * {@code Factory} and retain them in a store of the given {@code ViewModelStoreOwner}.
+ *
+ * @param owner a {@code ViewModelStoreOwner} whose {@link ViewModelStore} will be used to
+ * retain {@code ViewModels}
+ * @param factory a {@code KeyedFactory} which will be used to instantiate
+ * new {@code ViewModels}
+ */
+ public ViewModelProvider(@NonNull ViewModelStoreOwner owner, @NonNull KeyedFactory factory) {
+ this(owner.getViewModelStore(), factory);
+ }
+
+ /**
+ * Creates {@code ViewModelProvider}, which will create {@code ViewModels} via the given
+ * {@code Factory} and retain them in the given {@code store}.
+ *
+ * @param store {@code ViewModelStore} where ViewModels will be stored.
+ * @param factory factory a {@code Factory} which will be used to instantiate
+ * new {@code ViewModels}
+ */
+ public ViewModelProvider(@NonNull ViewModelStore store, @NonNull KeyedFactory factory) {
mFactory = factory;
mViewModelStore = store;
}
@@ -158,11 +175,8 @@
// TODO: log a warning.
}
}
- if (mFactory instanceof KeyedFactory) {
- viewModel = ((KeyedFactory) (mFactory)).create(key, modelClass);
- } else {
- viewModel = (mFactory).create(modelClass);
- }
+
+ viewModel = mFactory.create(key, modelClass);
mViewModelStore.put(key, viewModel);
//noinspection unchecked
return (T) viewModel;
@@ -241,4 +255,17 @@
return super.create(modelClass);
}
}
+
+ private static class FactoryWrapper implements KeyedFactory {
+ private final Factory mFactory;
+
+ FactoryWrapper(Factory factory) {
+ mFactory = factory;
+ }
+
+ @Override
+ public <T extends ViewModel> T create(String key, Class<T> modelClass) {
+ return mFactory.create(modelClass);
+ }
+ }
}
diff --git a/loader/api/1.0.0.txt b/loader/api/1.0.0.txt
index 3d1e552..ba1f38c 100644
--- a/loader/api/1.0.0.txt
+++ b/loader/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.loader.app {
public abstract class LoaderManager {
diff --git a/loader/api/1.1.0-alpha01.txt b/loader/api/1.1.0-alpha01.txt
index 8b3df8a..1bc56b87 100644
--- a/loader/api/1.1.0-alpha01.txt
+++ b/loader/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.loader.app {
public abstract class LoaderManager {
diff --git a/loader/api/1.1.0-beta01.ignore b/loader/api/1.1.0-beta01.ignore
deleted file mode 100644
index 4376069..0000000
--- a/loader/api/1.1.0-beta01.ignore
+++ /dev/null
@@ -1,7 +0,0 @@
-// Baseline format: 1.0
-DeprecationMismatch: androidx.loader.content.AsyncTaskLoader#dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]):
- Method androidx.loader.content.AsyncTaskLoader.dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.loader.content.CursorLoader#dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]):
- Method androidx.loader.content.CursorLoader.dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-
-
diff --git a/loader/api/1.1.0-beta01.txt b/loader/api/1.1.0-beta01.txt
index 8b3df8a..1bc56b87 100644
--- a/loader/api/1.1.0-beta01.txt
+++ b/loader/api/1.1.0-beta01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.loader.app {
public abstract class LoaderManager {
diff --git a/loader/api/current.txt b/loader/api/current.txt
index 8b3df8a..1bc56b87 100644
--- a/loader/api/current.txt
+++ b/loader/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.loader.app {
public abstract class LoaderManager {
diff --git a/loader/api/restricted_1.0.0.txt b/loader/api/restricted_1.0.0.txt
deleted file mode 100644
index 42e0b7e..0000000
--- a/loader/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-// Signature format: 3.0
-package androidx.loader.content {
-
- public abstract class AsyncTaskLoader<D> extends androidx.loader.content.Loader<D> {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void waitForLoader();
- }
-
-}
-
diff --git a/loader/api/restricted_1.1.0-beta01.ignore b/loader/api/restricted_1.1.0-beta01.ignore
deleted file mode 100644
index 4376069..0000000
--- a/loader/api/restricted_1.1.0-beta01.ignore
+++ /dev/null
@@ -1,7 +0,0 @@
-// Baseline format: 1.0
-DeprecationMismatch: androidx.loader.content.AsyncTaskLoader#dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]):
- Method androidx.loader.content.AsyncTaskLoader.dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-DeprecationMismatch: androidx.loader.content.CursorLoader#dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]):
- Method androidx.loader.content.CursorLoader.dump(String, java.io.FileDescriptor, java.io.PrintWriter, String[]): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match
-
-
diff --git a/loader/api/restricted_1.1.0-beta01.txt b/loader/api/restricted_1.1.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/loader/api/restricted_1.1.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/loader/api/restricted_current.txt b/loader/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/loader/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/loader/build.gradle b/loader/build.gradle
index d599582..481dfb2 100644
--- a/loader/build.gradle
+++ b/loader/build.gradle
@@ -9,7 +9,6 @@
dependencies {
api("androidx.annotation:annotation:1.0.0")
api("androidx.core:core:1.0.0")
- implementation("androidx.collection:collection:1.0.0")
api(ARCH_LIFECYCLE_LIVEDATA_CORE, libs.exclude_annotations_transitive)
api(ARCH_LIFECYCLE_VIEWMODEL, libs.exclude_annotations_transitive)
diff --git a/loader/src/androidTest/java/androidx/loader/app/LoaderInfoTest.java b/loader/src/androidTest/java/androidx/loader/app/LoaderInfoTest.java
index d1afd22..f255040 100644
--- a/loader/src/androidTest/java/androidx/loader/app/LoaderInfoTest.java
+++ b/loader/src/androidTest/java/androidx/loader/app/LoaderInfoTest.java
@@ -31,7 +31,7 @@
import androidx.loader.content.Loader;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Before;
@@ -42,7 +42,7 @@
import java.util.concurrent.TimeUnit;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class LoaderInfoTest {
private LifecycleOwner mOwner;
diff --git a/loader/src/androidTest/java/androidx/loader/app/LoaderManagerTest.java b/loader/src/androidTest/java/androidx/loader/app/LoaderManagerTest.java
index 8e7d67f..c04e7a3 100644
--- a/loader/src/androidTest/java/androidx/loader/app/LoaderManagerTest.java
+++ b/loader/src/androidTest/java/androidx/loader/app/LoaderManagerTest.java
@@ -35,7 +35,7 @@
import androidx.loader.content.Loader;
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Before;
@@ -46,7 +46,7 @@
import java.util.concurrent.TimeUnit;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class LoaderManagerTest {
private LoaderManager mLoaderManager;
@@ -204,38 +204,6 @@
initialCallback.mLoader.isReset());
}
- /**
- * Ensures that calling restartLoader from onLoadFinished will not reset current loader.
- * This is especially important for CursorLoader which closes cursor when Loader is reset.
- * This means that rest of onLoadFinished could access closed cursor.
- */
- @Test
- public void testRestartLoaderWhileDeliveringData() throws Throwable {
- CountDownLatch initialCountDownLatch = new CountDownLatch(1);
- final DelayLoaderCallbacks initialCallback = new DelayLoaderCallbacks(mock(Context.class),
- initialCountDownLatch) {
- @Override
- public void onLoadFinished(@NonNull Loader<Boolean> loader, Boolean data) {
- super.onLoadFinished(loader, data);
- assertFalse("Assumption is that loader is not reset in onLoadFinished",
- loader.isReset());
- mLoaderManager.restartLoader(45, null,
- new DelayLoaderCallbacks(mock(Context.class), new CountDownLatch(1)));
- assertFalse("Loader should not be reset when restarted in onLoadFinished",
- loader.isReset());
- }
- };
- InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
- @Override
- public void run() {
- mLoaderManager.initLoader(45, null, initialCallback);
- }
- });
- // Wait for the Loader to return data
- initialCountDownLatch.await(1, TimeUnit.SECONDS);
- }
-
-
@Test
public void testRestartLoaderMultiple() throws Throwable {
CountDownLatch initialCountDownLatch = new CountDownLatch(1);
diff --git a/loader/src/androidTest/java/androidx/loader/app/LoaderViewModelTest.java b/loader/src/androidTest/java/androidx/loader/app/LoaderViewModelTest.java
index de1a842..ca0068a 100644
--- a/loader/src/androidTest/java/androidx/loader/app/LoaderViewModelTest.java
+++ b/loader/src/androidTest/java/androidx/loader/app/LoaderViewModelTest.java
@@ -25,14 +25,14 @@
import androidx.loader.app.test.DummyLoader;
import androidx.loader.content.Loader;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@RunWith(JUnit4.class)
-@MediumTest
+@SmallTest
public class LoaderViewModelTest {
@Test
diff --git a/loader/src/main/java/androidx/loader/app/LoaderManagerImpl.java b/loader/src/main/java/androidx/loader/app/LoaderManagerImpl.java
index 00dceb2..37586b2 100644
--- a/loader/src/main/java/androidx/loader/app/LoaderManagerImpl.java
+++ b/loader/src/main/java/androidx/loader/app/LoaderManagerImpl.java
@@ -250,8 +250,8 @@
Log.v(TAG, " onLoadFinished in " + mLoader + ": "
+ mLoader.dataToString(data));
}
- mDeliveredData = true;
mCallback.onLoadFinished(mLoader, data);
+ mDeliveredData = true;
}
boolean hasDeliveredData() {
diff --git a/localbroadcastmanager/api/1.0.0.txt b/localbroadcastmanager/api/1.0.0.txt
index e646c932..8513cd9 100644
--- a/localbroadcastmanager/api/1.0.0.txt
+++ b/localbroadcastmanager/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.localbroadcastmanager.content {
public final class LocalBroadcastManager {
diff --git a/localbroadcastmanager/api/1.1.0-alpha01.txt b/localbroadcastmanager/api/1.1.0-alpha01.txt
index 665dd3c..3e3571d 100644
--- a/localbroadcastmanager/api/1.1.0-alpha01.txt
+++ b/localbroadcastmanager/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.localbroadcastmanager.content {
@Deprecated public final class LocalBroadcastManager {
diff --git a/localbroadcastmanager/api/1.1.0-alpha02.txt b/localbroadcastmanager/api/1.1.0-alpha02.txt
deleted file mode 100644
index 665dd3c..0000000
--- a/localbroadcastmanager/api/1.1.0-alpha02.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-// Signature format: 3.0
-package androidx.localbroadcastmanager.content {
-
- @Deprecated public final class LocalBroadcastManager {
- method @Deprecated public static androidx.localbroadcastmanager.content.LocalBroadcastManager getInstance(android.content.Context);
- method @Deprecated public void registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter);
- method @Deprecated public boolean sendBroadcast(android.content.Intent);
- method @Deprecated public void sendBroadcastSync(android.content.Intent);
- method @Deprecated public void unregisterReceiver(android.content.BroadcastReceiver);
- }
-
-}
-
diff --git a/localbroadcastmanager/api/current.txt b/localbroadcastmanager/api/current.txt
index 665dd3c..3e3571d 100644
--- a/localbroadcastmanager/api/current.txt
+++ b/localbroadcastmanager/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.localbroadcastmanager.content {
@Deprecated public final class LocalBroadcastManager {
diff --git a/localbroadcastmanager/api/res-1.1.0-alpha02.txt b/localbroadcastmanager/api/res-1.1.0-alpha02.txt
deleted file mode 100644
index e69de29..0000000
--- a/localbroadcastmanager/api/res-1.1.0-alpha02.txt
+++ /dev/null
diff --git a/localbroadcastmanager/api/restricted_1.0.0.txt b/localbroadcastmanager/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/localbroadcastmanager/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/localbroadcastmanager/api/restricted_1.1.0-alpha02.txt b/localbroadcastmanager/api/restricted_1.1.0-alpha02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/localbroadcastmanager/api/restricted_1.1.0-alpha02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/localbroadcastmanager/api/restricted_current.txt b/localbroadcastmanager/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/localbroadcastmanager/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/media/api/1.0.0.txt b/media/api/1.0.0.txt
index 0b63682..3f2e9f9 100644
--- a/media/api/1.0.0.txt
+++ b/media/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package android.support.v4.media {
public final class MediaBrowserCompat {
diff --git a/media/api/1.1.0-alpha01.txt b/media/api/1.1.0-alpha01.txt
index c4e14c0..0d77d11 100644
--- a/media/api/1.1.0-alpha01.txt
+++ b/media/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package android.support.v4.media {
public final class MediaBrowserCompat {
diff --git a/media/api/1.1.0-alpha02.txt b/media/api/1.1.0-alpha02.txt
deleted file mode 100644
index c4e14c0..0000000
--- a/media/api/1.1.0-alpha02.txt
+++ /dev/null
@@ -1,702 +0,0 @@
-// Signature format: 3.0
-package android.support.v4.media {
-
- public final class MediaBrowserCompat {
- ctor public MediaBrowserCompat(android.content.Context!, android.content.ComponentName!, android.support.v4.media.MediaBrowserCompat.ConnectionCallback!, android.os.Bundle!);
- method public void connect();
- method public void disconnect();
- method public android.os.Bundle? getExtras();
- method public void getItem(String, android.support.v4.media.MediaBrowserCompat.ItemCallback);
- method public String getRoot();
- method public android.content.ComponentName getServiceComponent();
- method public android.support.v4.media.session.MediaSessionCompat.Token getSessionToken();
- method public boolean isConnected();
- method public void search(String, android.os.Bundle!, android.support.v4.media.MediaBrowserCompat.SearchCallback);
- method public void sendCustomAction(String, android.os.Bundle!, android.support.v4.media.MediaBrowserCompat.CustomActionCallback?);
- method public void subscribe(String, android.support.v4.media.MediaBrowserCompat.SubscriptionCallback);
- method public void subscribe(String, android.os.Bundle, android.support.v4.media.MediaBrowserCompat.SubscriptionCallback);
- method public void unsubscribe(String);
- method public void unsubscribe(String, android.support.v4.media.MediaBrowserCompat.SubscriptionCallback);
- field public static final String CUSTOM_ACTION_DOWNLOAD = "android.support.v4.media.action.DOWNLOAD";
- field public static final String CUSTOM_ACTION_REMOVE_DOWNLOADED_FILE = "android.support.v4.media.action.REMOVE_DOWNLOADED_FILE";
- field public static final String EXTRA_DOWNLOAD_PROGRESS = "android.media.browse.extra.DOWNLOAD_PROGRESS";
- field public static final String EXTRA_MEDIA_ID = "android.media.browse.extra.MEDIA_ID";
- field public static final String EXTRA_PAGE = "android.media.browse.extra.PAGE";
- field public static final String EXTRA_PAGE_SIZE = "android.media.browse.extra.PAGE_SIZE";
- }
-
- public static class MediaBrowserCompat.ConnectionCallback {
- ctor public MediaBrowserCompat.ConnectionCallback();
- method public void onConnected();
- method public void onConnectionFailed();
- method public void onConnectionSuspended();
- }
-
- public abstract static class MediaBrowserCompat.CustomActionCallback {
- ctor public MediaBrowserCompat.CustomActionCallback();
- method public void onError(String!, android.os.Bundle!, android.os.Bundle!);
- method public void onProgressUpdate(String!, android.os.Bundle!, android.os.Bundle!);
- method public void onResult(String!, android.os.Bundle!, android.os.Bundle!);
- }
-
- public abstract static class MediaBrowserCompat.ItemCallback {
- ctor public MediaBrowserCompat.ItemCallback();
- method public void onError(String);
- method public void onItemLoaded(android.support.v4.media.MediaBrowserCompat.MediaItem!);
- }
-
- public static class MediaBrowserCompat.MediaItem implements android.os.Parcelable {
- ctor public MediaBrowserCompat.MediaItem(android.support.v4.media.MediaDescriptionCompat, int);
- method public int describeContents();
- method public static android.support.v4.media.MediaBrowserCompat.MediaItem! fromMediaItem(Object!);
- method public static java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>! fromMediaItemList(java.util.List<?>!);
- method public android.support.v4.media.MediaDescriptionCompat getDescription();
- method public int getFlags();
- method public String? getMediaId();
- method public boolean isBrowsable();
- method public boolean isPlayable();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<android.support.v4.media.MediaBrowserCompat.MediaItem>! CREATOR;
- field public static final int FLAG_BROWSABLE = 1; // 0x1
- field public static final int FLAG_PLAYABLE = 2; // 0x2
- }
-
- public abstract static class MediaBrowserCompat.SearchCallback {
- ctor public MediaBrowserCompat.SearchCallback();
- method public void onError(String, android.os.Bundle!);
- method public void onSearchResult(String, android.os.Bundle!, java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>);
- }
-
- public abstract static class MediaBrowserCompat.SubscriptionCallback {
- ctor public MediaBrowserCompat.SubscriptionCallback();
- method public void onChildrenLoaded(String, java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>);
- method public void onChildrenLoaded(String, java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>, android.os.Bundle);
- method public void onError(String);
- method public void onError(String, android.os.Bundle);
- }
-
- public final class MediaDescriptionCompat implements android.os.Parcelable {
- method public int describeContents();
- method public static android.support.v4.media.MediaDescriptionCompat! fromMediaDescription(Object!);
- method public CharSequence? getDescription();
- method public android.os.Bundle? getExtras();
- method public android.graphics.Bitmap? getIconBitmap();
- method public android.net.Uri? getIconUri();
- method public Object! getMediaDescription();
- method public String? getMediaId();
- method public android.net.Uri? getMediaUri();
- method public CharSequence? getSubtitle();
- method public CharSequence? getTitle();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final long BT_FOLDER_TYPE_ALBUMS = 2L; // 0x2L
- field public static final long BT_FOLDER_TYPE_ARTISTS = 3L; // 0x3L
- field public static final long BT_FOLDER_TYPE_GENRES = 4L; // 0x4L
- field public static final long BT_FOLDER_TYPE_MIXED = 0L; // 0x0L
- field public static final long BT_FOLDER_TYPE_PLAYLISTS = 5L; // 0x5L
- field public static final long BT_FOLDER_TYPE_TITLES = 1L; // 0x1L
- field public static final long BT_FOLDER_TYPE_YEARS = 6L; // 0x6L
- field public static final android.os.Parcelable.Creator<android.support.v4.media.MediaDescriptionCompat>! CREATOR;
- field public static final String EXTRA_BT_FOLDER_TYPE = "android.media.extra.BT_FOLDER_TYPE";
- field public static final String EXTRA_DOWNLOAD_STATUS = "android.media.extra.DOWNLOAD_STATUS";
- field public static final long STATUS_DOWNLOADED = 2L; // 0x2L
- field public static final long STATUS_DOWNLOADING = 1L; // 0x1L
- field public static final long STATUS_NOT_DOWNLOADED = 0L; // 0x0L
- }
-
- public static final class MediaDescriptionCompat.Builder {
- ctor public MediaDescriptionCompat.Builder();
- method public android.support.v4.media.MediaDescriptionCompat! build();
- method public android.support.v4.media.MediaDescriptionCompat.Builder! setDescription(CharSequence?);
- method public android.support.v4.media.MediaDescriptionCompat.Builder! setExtras(android.os.Bundle?);
- method public android.support.v4.media.MediaDescriptionCompat.Builder! setIconBitmap(android.graphics.Bitmap?);
- method public android.support.v4.media.MediaDescriptionCompat.Builder! setIconUri(android.net.Uri?);
- method public android.support.v4.media.MediaDescriptionCompat.Builder! setMediaId(String?);
- method public android.support.v4.media.MediaDescriptionCompat.Builder! setMediaUri(android.net.Uri?);
- method public android.support.v4.media.MediaDescriptionCompat.Builder! setSubtitle(CharSequence?);
- method public android.support.v4.media.MediaDescriptionCompat.Builder! setTitle(CharSequence?);
- }
-
- public final class MediaMetadataCompat implements android.os.Parcelable {
- method public boolean containsKey(String!);
- method public int describeContents();
- method public static android.support.v4.media.MediaMetadataCompat! fromMediaMetadata(Object!);
- method public android.graphics.Bitmap! getBitmap(String!);
- method public android.os.Bundle! getBundle();
- method public android.support.v4.media.MediaDescriptionCompat! getDescription();
- method public long getLong(String!);
- method public Object! getMediaMetadata();
- method public android.support.v4.media.RatingCompat! getRating(String!);
- method public String! getString(String!);
- method public CharSequence! getText(String!);
- method public java.util.Set<java.lang.String>! keySet();
- method public int size();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<android.support.v4.media.MediaMetadataCompat>! CREATOR;
- field public static final String METADATA_KEY_ADVERTISEMENT = "android.media.metadata.ADVERTISEMENT";
- field public static final String METADATA_KEY_ALBUM = "android.media.metadata.ALBUM";
- field public static final String METADATA_KEY_ALBUM_ART = "android.media.metadata.ALBUM_ART";
- field public static final String METADATA_KEY_ALBUM_ARTIST = "android.media.metadata.ALBUM_ARTIST";
- field public static final String METADATA_KEY_ALBUM_ART_URI = "android.media.metadata.ALBUM_ART_URI";
- field public static final String METADATA_KEY_ART = "android.media.metadata.ART";
- field public static final String METADATA_KEY_ARTIST = "android.media.metadata.ARTIST";
- field public static final String METADATA_KEY_ART_URI = "android.media.metadata.ART_URI";
- field public static final String METADATA_KEY_AUTHOR = "android.media.metadata.AUTHOR";
- field public static final String METADATA_KEY_BT_FOLDER_TYPE = "android.media.metadata.BT_FOLDER_TYPE";
- field public static final String METADATA_KEY_COMPILATION = "android.media.metadata.COMPILATION";
- field public static final String METADATA_KEY_COMPOSER = "android.media.metadata.COMPOSER";
- field public static final String METADATA_KEY_DATE = "android.media.metadata.DATE";
- field public static final String METADATA_KEY_DISC_NUMBER = "android.media.metadata.DISC_NUMBER";
- field public static final String METADATA_KEY_DISPLAY_DESCRIPTION = "android.media.metadata.DISPLAY_DESCRIPTION";
- field public static final String METADATA_KEY_DISPLAY_ICON = "android.media.metadata.DISPLAY_ICON";
- field public static final String METADATA_KEY_DISPLAY_ICON_URI = "android.media.metadata.DISPLAY_ICON_URI";
- field public static final String METADATA_KEY_DISPLAY_SUBTITLE = "android.media.metadata.DISPLAY_SUBTITLE";
- field public static final String METADATA_KEY_DISPLAY_TITLE = "android.media.metadata.DISPLAY_TITLE";
- field public static final String METADATA_KEY_DOWNLOAD_STATUS = "android.media.metadata.DOWNLOAD_STATUS";
- field public static final String METADATA_KEY_DURATION = "android.media.metadata.DURATION";
- field public static final String METADATA_KEY_GENRE = "android.media.metadata.GENRE";
- field public static final String METADATA_KEY_MEDIA_ID = "android.media.metadata.MEDIA_ID";
- field public static final String METADATA_KEY_MEDIA_URI = "android.media.metadata.MEDIA_URI";
- field public static final String METADATA_KEY_NUM_TRACKS = "android.media.metadata.NUM_TRACKS";
- field public static final String METADATA_KEY_RATING = "android.media.metadata.RATING";
- field public static final String METADATA_KEY_TITLE = "android.media.metadata.TITLE";
- field public static final String METADATA_KEY_TRACK_NUMBER = "android.media.metadata.TRACK_NUMBER";
- field public static final String METADATA_KEY_USER_RATING = "android.media.metadata.USER_RATING";
- field public static final String METADATA_KEY_WRITER = "android.media.metadata.WRITER";
- field public static final String METADATA_KEY_YEAR = "android.media.metadata.YEAR";
- }
-
- public static final class MediaMetadataCompat.Builder {
- ctor public MediaMetadataCompat.Builder();
- ctor public MediaMetadataCompat.Builder(android.support.v4.media.MediaMetadataCompat!);
- method public android.support.v4.media.MediaMetadataCompat! build();
- method public android.support.v4.media.MediaMetadataCompat.Builder! putBitmap(String!, android.graphics.Bitmap!);
- method public android.support.v4.media.MediaMetadataCompat.Builder! putLong(String!, long);
- method public android.support.v4.media.MediaMetadataCompat.Builder! putRating(String!, android.support.v4.media.RatingCompat!);
- method public android.support.v4.media.MediaMetadataCompat.Builder! putString(String!, String!);
- method public android.support.v4.media.MediaMetadataCompat.Builder! putText(String!, CharSequence!);
- }
-
- public final class RatingCompat implements android.os.Parcelable {
- method public int describeContents();
- method public static android.support.v4.media.RatingCompat! fromRating(Object!);
- method public float getPercentRating();
- method public Object! getRating();
- method public int getRatingStyle();
- method public float getStarRating();
- method public boolean hasHeart();
- method public boolean isRated();
- method public boolean isThumbUp();
- method public static android.support.v4.media.RatingCompat! newHeartRating(boolean);
- method public static android.support.v4.media.RatingCompat! newPercentageRating(float);
- method public static android.support.v4.media.RatingCompat! newStarRating(int, float);
- method public static android.support.v4.media.RatingCompat! newThumbRating(boolean);
- method public static android.support.v4.media.RatingCompat! newUnratedRating(int);
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<android.support.v4.media.RatingCompat>! CREATOR;
- field public static final int RATING_3_STARS = 3; // 0x3
- field public static final int RATING_4_STARS = 4; // 0x4
- field public static final int RATING_5_STARS = 5; // 0x5
- field public static final int RATING_HEART = 1; // 0x1
- field public static final int RATING_NONE = 0; // 0x0
- field public static final int RATING_PERCENTAGE = 6; // 0x6
- field public static final int RATING_THUMB_UP_DOWN = 2; // 0x2
- }
-
-}
-
-package android.support.v4.media.session {
-
- public final class MediaControllerCompat {
- ctor public MediaControllerCompat(android.content.Context!, android.support.v4.media.session.MediaSessionCompat);
- ctor public MediaControllerCompat(android.content.Context!, android.support.v4.media.session.MediaSessionCompat.Token) throws android.os.RemoteException;
- method public void addQueueItem(android.support.v4.media.MediaDescriptionCompat!);
- method public void addQueueItem(android.support.v4.media.MediaDescriptionCompat!, int);
- method public void adjustVolume(int, int);
- method public boolean dispatchMediaButtonEvent(android.view.KeyEvent!);
- method public android.os.Bundle! getExtras();
- method public long getFlags();
- method public static android.support.v4.media.session.MediaControllerCompat! getMediaController(android.app.Activity);
- method public Object! getMediaController();
- method public android.support.v4.media.MediaMetadataCompat! getMetadata();
- method public String! getPackageName();
- method public android.support.v4.media.session.MediaControllerCompat.PlaybackInfo! getPlaybackInfo();
- method public android.support.v4.media.session.PlaybackStateCompat! getPlaybackState();
- method public java.util.List<android.support.v4.media.session.MediaSessionCompat.QueueItem>! getQueue();
- method public CharSequence! getQueueTitle();
- method public int getRatingType();
- method public int getRepeatMode();
- method public android.app.PendingIntent! getSessionActivity();
- method public android.support.v4.media.session.MediaSessionCompat.Token! getSessionToken();
- method public int getShuffleMode();
- method public android.support.v4.media.session.MediaControllerCompat.TransportControls! getTransportControls();
- method public boolean isCaptioningEnabled();
- method public boolean isSessionReady();
- method public void registerCallback(android.support.v4.media.session.MediaControllerCompat.Callback);
- method public void registerCallback(android.support.v4.media.session.MediaControllerCompat.Callback, android.os.Handler!);
- method public void removeQueueItem(android.support.v4.media.MediaDescriptionCompat!);
- method @Deprecated public void removeQueueItemAt(int);
- method public void sendCommand(String, android.os.Bundle?, android.os.ResultReceiver?);
- method public static void setMediaController(android.app.Activity, android.support.v4.media.session.MediaControllerCompat!);
- method public void setVolumeTo(int, int);
- method public void unregisterCallback(android.support.v4.media.session.MediaControllerCompat.Callback);
- }
-
- public abstract static class MediaControllerCompat.Callback implements android.os.IBinder.DeathRecipient {
- ctor public MediaControllerCompat.Callback();
- method public void binderDied();
- method public void onAudioInfoChanged(android.support.v4.media.session.MediaControllerCompat.PlaybackInfo!);
- method public void onCaptioningEnabledChanged(boolean);
- method public void onExtrasChanged(android.os.Bundle!);
- method public void onMetadataChanged(android.support.v4.media.MediaMetadataCompat!);
- method public void onPlaybackStateChanged(android.support.v4.media.session.PlaybackStateCompat!);
- method public void onQueueChanged(java.util.List<android.support.v4.media.session.MediaSessionCompat.QueueItem>!);
- method public void onQueueTitleChanged(CharSequence!);
- method public void onRepeatModeChanged(int);
- method public void onSessionDestroyed();
- method public void onSessionEvent(String!, android.os.Bundle!);
- method public void onSessionReady();
- method public void onShuffleModeChanged(int);
- }
-
- public static final class MediaControllerCompat.PlaybackInfo {
- method public androidx.media.AudioAttributesCompat getAudioAttributes();
- method @Deprecated public int getAudioStream();
- method public int getCurrentVolume();
- method public int getMaxVolume();
- method public int getPlaybackType();
- method public int getVolumeControl();
- field public static final int PLAYBACK_TYPE_LOCAL = 1; // 0x1
- field public static final int PLAYBACK_TYPE_REMOTE = 2; // 0x2
- }
-
- public abstract static class MediaControllerCompat.TransportControls {
- method public abstract void fastForward();
- method public abstract void pause();
- method public abstract void play();
- method public abstract void playFromMediaId(String!, android.os.Bundle!);
- method public abstract void playFromSearch(String!, android.os.Bundle!);
- method public abstract void playFromUri(android.net.Uri!, android.os.Bundle!);
- method public abstract void prepare();
- method public abstract void prepareFromMediaId(String!, android.os.Bundle!);
- method public abstract void prepareFromSearch(String!, android.os.Bundle!);
- method public abstract void prepareFromUri(android.net.Uri!, android.os.Bundle!);
- method public abstract void rewind();
- method public abstract void seekTo(long);
- method public abstract void sendCustomAction(android.support.v4.media.session.PlaybackStateCompat.CustomAction!, android.os.Bundle!);
- method public abstract void sendCustomAction(String!, android.os.Bundle!);
- method public abstract void setCaptioningEnabled(boolean);
- method public abstract void setRating(android.support.v4.media.RatingCompat!);
- method public abstract void setRating(android.support.v4.media.RatingCompat!, android.os.Bundle!);
- method public abstract void setRepeatMode(int);
- method public abstract void setShuffleMode(int);
- method public abstract void skipToNext();
- method public abstract void skipToPrevious();
- method public abstract void skipToQueueItem(long);
- method public abstract void stop();
- field public static final String EXTRA_LEGACY_STREAM_TYPE = "android.media.session.extra.LEGACY_STREAM_TYPE";
- }
-
- public class MediaSessionCompat {
- ctor public MediaSessionCompat(android.content.Context!, String!);
- ctor public MediaSessionCompat(android.content.Context!, String!, android.content.ComponentName!, android.app.PendingIntent!);
- method public void addOnActiveChangeListener(android.support.v4.media.session.MediaSessionCompat.OnActiveChangeListener!);
- method public static android.support.v4.media.session.MediaSessionCompat! fromMediaSession(android.content.Context!, Object!);
- method public android.support.v4.media.session.MediaControllerCompat! getController();
- method public final androidx.media.MediaSessionManager.RemoteUserInfo getCurrentControllerInfo();
- method public Object! getMediaSession();
- method public Object! getRemoteControlClient();
- method public android.support.v4.media.session.MediaSessionCompat.Token! getSessionToken();
- method public boolean isActive();
- method public void release();
- method public void removeOnActiveChangeListener(android.support.v4.media.session.MediaSessionCompat.OnActiveChangeListener!);
- method public void sendSessionEvent(String!, android.os.Bundle!);
- method public void setActive(boolean);
- method public void setCallback(android.support.v4.media.session.MediaSessionCompat.Callback!);
- method public void setCallback(android.support.v4.media.session.MediaSessionCompat.Callback!, android.os.Handler!);
- method public void setCaptioningEnabled(boolean);
- method public void setExtras(android.os.Bundle!);
- method public void setFlags(int);
- method public void setMediaButtonReceiver(android.app.PendingIntent!);
- method public void setMetadata(android.support.v4.media.MediaMetadataCompat!);
- method public void setPlaybackState(android.support.v4.media.session.PlaybackStateCompat!);
- method public void setPlaybackToLocal(int);
- method public void setPlaybackToRemote(androidx.media.VolumeProviderCompat!);
- method public void setQueue(java.util.List<android.support.v4.media.session.MediaSessionCompat.QueueItem>!);
- method public void setQueueTitle(CharSequence!);
- method public void setRatingType(int);
- method public void setRepeatMode(int);
- method public void setSessionActivity(android.app.PendingIntent!);
- method public void setShuffleMode(int);
- field public static final String ACTION_FLAG_AS_INAPPROPRIATE = "android.support.v4.media.session.action.FLAG_AS_INAPPROPRIATE";
- field public static final String ACTION_FOLLOW = "android.support.v4.media.session.action.FOLLOW";
- field public static final String ACTION_SKIP_AD = "android.support.v4.media.session.action.SKIP_AD";
- field public static final String ACTION_UNFOLLOW = "android.support.v4.media.session.action.UNFOLLOW";
- field public static final String ARGUMENT_MEDIA_ATTRIBUTE = "android.support.v4.media.session.ARGUMENT_MEDIA_ATTRIBUTE";
- field public static final String ARGUMENT_MEDIA_ATTRIBUTE_VALUE = "android.support.v4.media.session.ARGUMENT_MEDIA_ATTRIBUTE_VALUE";
- field @Deprecated public static final int FLAG_HANDLES_MEDIA_BUTTONS = 1; // 0x1
- field public static final int FLAG_HANDLES_QUEUE_COMMANDS = 4; // 0x4
- field @Deprecated public static final int FLAG_HANDLES_TRANSPORT_CONTROLS = 2; // 0x2
- field public static final int MEDIA_ATTRIBUTE_ALBUM = 1; // 0x1
- field public static final int MEDIA_ATTRIBUTE_ARTIST = 0; // 0x0
- field public static final int MEDIA_ATTRIBUTE_PLAYLIST = 2; // 0x2
- }
-
- public abstract static class MediaSessionCompat.Callback {
- ctor public MediaSessionCompat.Callback();
- method public void onAddQueueItem(android.support.v4.media.MediaDescriptionCompat!);
- method public void onAddQueueItem(android.support.v4.media.MediaDescriptionCompat!, int);
- method public void onCommand(String!, android.os.Bundle!, android.os.ResultReceiver!);
- method public void onCustomAction(String!, android.os.Bundle!);
- method public void onFastForward();
- method public boolean onMediaButtonEvent(android.content.Intent!);
- method public void onPause();
- method public void onPlay();
- method public void onPlayFromMediaId(String!, android.os.Bundle!);
- method public void onPlayFromSearch(String!, android.os.Bundle!);
- method public void onPlayFromUri(android.net.Uri!, android.os.Bundle!);
- method public void onPrepare();
- method public void onPrepareFromMediaId(String!, android.os.Bundle!);
- method public void onPrepareFromSearch(String!, android.os.Bundle!);
- method public void onPrepareFromUri(android.net.Uri!, android.os.Bundle!);
- method public void onRemoveQueueItem(android.support.v4.media.MediaDescriptionCompat!);
- method @Deprecated public void onRemoveQueueItemAt(int);
- method public void onRewind();
- method public void onSeekTo(long);
- method public void onSetCaptioningEnabled(boolean);
- method public void onSetRating(android.support.v4.media.RatingCompat!);
- method public void onSetRating(android.support.v4.media.RatingCompat!, android.os.Bundle!);
- method public void onSetRepeatMode(int);
- method public void onSetShuffleMode(int);
- method public void onSkipToNext();
- method public void onSkipToPrevious();
- method public void onSkipToQueueItem(long);
- method public void onStop();
- }
-
- public static interface MediaSessionCompat.OnActiveChangeListener {
- method public void onActiveChanged();
- }
-
- public static final class MediaSessionCompat.QueueItem implements android.os.Parcelable {
- ctor public MediaSessionCompat.QueueItem(android.support.v4.media.MediaDescriptionCompat!, long);
- method public int describeContents();
- method public static android.support.v4.media.session.MediaSessionCompat.QueueItem! fromQueueItem(Object!);
- method public static java.util.List<android.support.v4.media.session.MediaSessionCompat.QueueItem>! fromQueueItemList(java.util.List<?>!);
- method public android.support.v4.media.MediaDescriptionCompat! getDescription();
- method public long getQueueId();
- method public Object! getQueueItem();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<android.support.v4.media.session.MediaSessionCompat.QueueItem>! CREATOR;
- field public static final int UNKNOWN_ID = -1; // 0xffffffff
- }
-
- public static final class MediaSessionCompat.Token implements android.os.Parcelable {
- method public int describeContents();
- method public static android.support.v4.media.session.MediaSessionCompat.Token! fromToken(Object!);
- method public Object! getToken();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<android.support.v4.media.session.MediaSessionCompat.Token>! CREATOR;
- }
-
- public class ParcelableVolumeInfo implements android.os.Parcelable {
- ctor public ParcelableVolumeInfo(int, int, int, int, int);
- ctor public ParcelableVolumeInfo(android.os.Parcel!);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<android.support.v4.media.session.ParcelableVolumeInfo>! CREATOR;
- field public int audioStream;
- field public int controlType;
- field public int currentVolume;
- field public int maxVolume;
- field public int volumeType;
- }
-
- public final class PlaybackStateCompat implements android.os.Parcelable {
- method public int describeContents();
- method public static android.support.v4.media.session.PlaybackStateCompat! fromPlaybackState(Object!);
- method public long getActions();
- method public long getActiveQueueItemId();
- method public long getBufferedPosition();
- method public java.util.List<android.support.v4.media.session.PlaybackStateCompat.CustomAction>! getCustomActions();
- method public int getErrorCode();
- method public CharSequence! getErrorMessage();
- method public android.os.Bundle? getExtras();
- method public long getLastPositionUpdateTime();
- method public float getPlaybackSpeed();
- method public Object! getPlaybackState();
- method public long getPosition();
- method public int getState();
- method public static int toKeyCode(long);
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final long ACTION_FAST_FORWARD = 64L; // 0x40L
- field public static final long ACTION_PAUSE = 2L; // 0x2L
- field public static final long ACTION_PLAY = 4L; // 0x4L
- field public static final long ACTION_PLAY_FROM_MEDIA_ID = 1024L; // 0x400L
- field public static final long ACTION_PLAY_FROM_SEARCH = 2048L; // 0x800L
- field public static final long ACTION_PLAY_FROM_URI = 8192L; // 0x2000L
- field public static final long ACTION_PLAY_PAUSE = 512L; // 0x200L
- field public static final long ACTION_PREPARE = 16384L; // 0x4000L
- field public static final long ACTION_PREPARE_FROM_MEDIA_ID = 32768L; // 0x8000L
- field public static final long ACTION_PREPARE_FROM_SEARCH = 65536L; // 0x10000L
- field public static final long ACTION_PREPARE_FROM_URI = 131072L; // 0x20000L
- field public static final long ACTION_REWIND = 8L; // 0x8L
- field public static final long ACTION_SEEK_TO = 256L; // 0x100L
- field public static final long ACTION_SET_CAPTIONING_ENABLED = 1048576L; // 0x100000L
- field public static final long ACTION_SET_RATING = 128L; // 0x80L
- field public static final long ACTION_SET_REPEAT_MODE = 262144L; // 0x40000L
- field public static final long ACTION_SET_SHUFFLE_MODE = 2097152L; // 0x200000L
- field @Deprecated public static final long ACTION_SET_SHUFFLE_MODE_ENABLED = 524288L; // 0x80000L
- field public static final long ACTION_SKIP_TO_NEXT = 32L; // 0x20L
- field public static final long ACTION_SKIP_TO_PREVIOUS = 16L; // 0x10L
- field public static final long ACTION_SKIP_TO_QUEUE_ITEM = 4096L; // 0x1000L
- field public static final long ACTION_STOP = 1L; // 0x1L
- field public static final android.os.Parcelable.Creator<android.support.v4.media.session.PlaybackStateCompat>! CREATOR;
- field public static final int ERROR_CODE_ACTION_ABORTED = 10; // 0xa
- field public static final int ERROR_CODE_APP_ERROR = 1; // 0x1
- field public static final int ERROR_CODE_AUTHENTICATION_EXPIRED = 3; // 0x3
- field public static final int ERROR_CODE_CONCURRENT_STREAM_LIMIT = 5; // 0x5
- field public static final int ERROR_CODE_CONTENT_ALREADY_PLAYING = 8; // 0x8
- field public static final int ERROR_CODE_END_OF_QUEUE = 11; // 0xb
- field public static final int ERROR_CODE_NOT_AVAILABLE_IN_REGION = 7; // 0x7
- field public static final int ERROR_CODE_NOT_SUPPORTED = 2; // 0x2
- field public static final int ERROR_CODE_PARENTAL_CONTROL_RESTRICTED = 6; // 0x6
- field public static final int ERROR_CODE_PREMIUM_ACCOUNT_REQUIRED = 4; // 0x4
- field public static final int ERROR_CODE_SKIP_LIMIT_REACHED = 9; // 0x9
- field public static final int ERROR_CODE_UNKNOWN_ERROR = 0; // 0x0
- field public static final long PLAYBACK_POSITION_UNKNOWN = -1L; // 0xffffffffffffffffL
- field public static final int REPEAT_MODE_ALL = 2; // 0x2
- field public static final int REPEAT_MODE_GROUP = 3; // 0x3
- field public static final int REPEAT_MODE_INVALID = -1; // 0xffffffff
- field public static final int REPEAT_MODE_NONE = 0; // 0x0
- field public static final int REPEAT_MODE_ONE = 1; // 0x1
- field public static final int SHUFFLE_MODE_ALL = 1; // 0x1
- field public static final int SHUFFLE_MODE_GROUP = 2; // 0x2
- field public static final int SHUFFLE_MODE_INVALID = -1; // 0xffffffff
- field public static final int SHUFFLE_MODE_NONE = 0; // 0x0
- field public static final int STATE_BUFFERING = 6; // 0x6
- field public static final int STATE_CONNECTING = 8; // 0x8
- field public static final int STATE_ERROR = 7; // 0x7
- field public static final int STATE_FAST_FORWARDING = 4; // 0x4
- field public static final int STATE_NONE = 0; // 0x0
- field public static final int STATE_PAUSED = 2; // 0x2
- field public static final int STATE_PLAYING = 3; // 0x3
- field public static final int STATE_REWINDING = 5; // 0x5
- field public static final int STATE_SKIPPING_TO_NEXT = 10; // 0xa
- field public static final int STATE_SKIPPING_TO_PREVIOUS = 9; // 0x9
- field public static final int STATE_SKIPPING_TO_QUEUE_ITEM = 11; // 0xb
- field public static final int STATE_STOPPED = 1; // 0x1
- }
-
- public static final class PlaybackStateCompat.Builder {
- ctor public PlaybackStateCompat.Builder();
- ctor public PlaybackStateCompat.Builder(android.support.v4.media.session.PlaybackStateCompat!);
- method public android.support.v4.media.session.PlaybackStateCompat.Builder! addCustomAction(String!, String!, int);
- method public android.support.v4.media.session.PlaybackStateCompat.Builder! addCustomAction(android.support.v4.media.session.PlaybackStateCompat.CustomAction!);
- method public android.support.v4.media.session.PlaybackStateCompat! build();
- method public android.support.v4.media.session.PlaybackStateCompat.Builder! setActions(long);
- method public android.support.v4.media.session.PlaybackStateCompat.Builder! setActiveQueueItemId(long);
- method public android.support.v4.media.session.PlaybackStateCompat.Builder! setBufferedPosition(long);
- method @Deprecated public android.support.v4.media.session.PlaybackStateCompat.Builder! setErrorMessage(CharSequence!);
- method public android.support.v4.media.session.PlaybackStateCompat.Builder! setErrorMessage(int, CharSequence!);
- method public android.support.v4.media.session.PlaybackStateCompat.Builder! setExtras(android.os.Bundle!);
- method public android.support.v4.media.session.PlaybackStateCompat.Builder! setState(int, long, float);
- method public android.support.v4.media.session.PlaybackStateCompat.Builder! setState(int, long, float, long);
- }
-
- public static final class PlaybackStateCompat.CustomAction implements android.os.Parcelable {
- method public int describeContents();
- method public static android.support.v4.media.session.PlaybackStateCompat.CustomAction! fromCustomAction(Object!);
- method public String! getAction();
- method public Object! getCustomAction();
- method public android.os.Bundle! getExtras();
- method public int getIcon();
- method public CharSequence! getName();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<android.support.v4.media.session.PlaybackStateCompat.CustomAction>! CREATOR;
- }
-
- public static final class PlaybackStateCompat.CustomAction.Builder {
- ctor public PlaybackStateCompat.CustomAction.Builder(String!, CharSequence!, int);
- method public android.support.v4.media.session.PlaybackStateCompat.CustomAction! build();
- method public android.support.v4.media.session.PlaybackStateCompat.CustomAction.Builder! setExtras(android.os.Bundle!);
- }
-
-}
-
-package androidx.media {
-
- public class AudioAttributesCompat implements androidx.versionedparcelable.VersionedParcelable {
- method public int getContentType();
- method public int getFlags();
- method public int getLegacyStreamType();
- method public int getUsage();
- method public int getVolumeControlStream();
- method public Object? unwrap();
- method public static androidx.media.AudioAttributesCompat? wrap(Object);
- field public static final int CONTENT_TYPE_MOVIE = 3; // 0x3
- field public static final int CONTENT_TYPE_MUSIC = 2; // 0x2
- field public static final int CONTENT_TYPE_SONIFICATION = 4; // 0x4
- field public static final int CONTENT_TYPE_SPEECH = 1; // 0x1
- field public static final int CONTENT_TYPE_UNKNOWN = 0; // 0x0
- field public static final int FLAG_AUDIBILITY_ENFORCED = 1; // 0x1
- field public static final int FLAG_HW_AV_SYNC = 16; // 0x10
- field public static final int USAGE_ALARM = 4; // 0x4
- field public static final int USAGE_ASSISTANCE_ACCESSIBILITY = 11; // 0xb
- field public static final int USAGE_ASSISTANCE_NAVIGATION_GUIDANCE = 12; // 0xc
- field public static final int USAGE_ASSISTANCE_SONIFICATION = 13; // 0xd
- field public static final int USAGE_ASSISTANT = 16; // 0x10
- field public static final int USAGE_GAME = 14; // 0xe
- field public static final int USAGE_MEDIA = 1; // 0x1
- field public static final int USAGE_NOTIFICATION = 5; // 0x5
- field public static final int USAGE_NOTIFICATION_COMMUNICATION_DELAYED = 9; // 0x9
- field public static final int USAGE_NOTIFICATION_COMMUNICATION_INSTANT = 8; // 0x8
- field public static final int USAGE_NOTIFICATION_COMMUNICATION_REQUEST = 7; // 0x7
- field public static final int USAGE_NOTIFICATION_EVENT = 10; // 0xa
- field public static final int USAGE_NOTIFICATION_RINGTONE = 6; // 0x6
- field public static final int USAGE_UNKNOWN = 0; // 0x0
- field public static final int USAGE_VOICE_COMMUNICATION = 2; // 0x2
- field public static final int USAGE_VOICE_COMMUNICATION_SIGNALLING = 3; // 0x3
- }
-
- public static class AudioAttributesCompat.Builder {
- ctor public AudioAttributesCompat.Builder();
- ctor public AudioAttributesCompat.Builder(androidx.media.AudioAttributesCompat!);
- method public androidx.media.AudioAttributesCompat! build();
- method public androidx.media.AudioAttributesCompat.Builder! setContentType(int);
- method public androidx.media.AudioAttributesCompat.Builder! setFlags(int);
- method public androidx.media.AudioAttributesCompat.Builder! setLegacyStreamType(int);
- method public androidx.media.AudioAttributesCompat.Builder! setUsage(int);
- }
-
- public class AudioFocusRequestCompat {
- method public androidx.media.AudioAttributesCompat getAudioAttributesCompat();
- method public android.os.Handler getFocusChangeHandler();
- method public int getFocusGain();
- method public android.media.AudioManager.OnAudioFocusChangeListener getOnAudioFocusChangeListener();
- method public boolean willPauseWhenDucked();
- }
-
- public static final class AudioFocusRequestCompat.Builder {
- ctor public AudioFocusRequestCompat.Builder(int);
- ctor public AudioFocusRequestCompat.Builder(androidx.media.AudioFocusRequestCompat);
- method public androidx.media.AudioFocusRequestCompat! build();
- method public androidx.media.AudioFocusRequestCompat.Builder setAudioAttributes(androidx.media.AudioAttributesCompat);
- method public androidx.media.AudioFocusRequestCompat.Builder setFocusGain(int);
- method public androidx.media.AudioFocusRequestCompat.Builder setOnAudioFocusChangeListener(android.media.AudioManager.OnAudioFocusChangeListener);
- method public androidx.media.AudioFocusRequestCompat.Builder setOnAudioFocusChangeListener(android.media.AudioManager.OnAudioFocusChangeListener, android.os.Handler);
- method public androidx.media.AudioFocusRequestCompat.Builder setWillPauseWhenDucked(boolean);
- }
-
- public final class AudioManagerCompat {
- method public static int abandonAudioFocusRequest(android.media.AudioManager, androidx.media.AudioFocusRequestCompat);
- method public static int requestAudioFocus(android.media.AudioManager, androidx.media.AudioFocusRequestCompat);
- field public static final int AUDIOFOCUS_GAIN = 1; // 0x1
- field public static final int AUDIOFOCUS_GAIN_TRANSIENT = 2; // 0x2
- field public static final int AUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE = 4; // 0x4
- field public static final int AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK = 3; // 0x3
- }
-
- public abstract class MediaBrowserServiceCompat extends android.app.Service {
- ctor public MediaBrowserServiceCompat();
- method public void dump(java.io.FileDescriptor!, java.io.PrintWriter!, String[]!);
- method public final android.os.Bundle! getBrowserRootHints();
- method public final androidx.media.MediaSessionManager.RemoteUserInfo getCurrentBrowserInfo();
- method public android.support.v4.media.session.MediaSessionCompat.Token? getSessionToken();
- method public void notifyChildrenChanged(String);
- method public void notifyChildrenChanged(String, android.os.Bundle);
- method public android.os.IBinder! onBind(android.content.Intent!);
- method public void onCustomAction(String, android.os.Bundle!, androidx.media.MediaBrowserServiceCompat.Result<android.os.Bundle>);
- method public abstract androidx.media.MediaBrowserServiceCompat.BrowserRoot? onGetRoot(String, int, android.os.Bundle?);
- method public abstract void onLoadChildren(String, androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>);
- method public void onLoadChildren(String, androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>, android.os.Bundle);
- method public void onLoadItem(String!, androidx.media.MediaBrowserServiceCompat.Result<android.support.v4.media.MediaBrowserCompat.MediaItem>);
- method public void onSearch(String, android.os.Bundle!, androidx.media.MediaBrowserServiceCompat.Result<java.util.List<android.support.v4.media.MediaBrowserCompat.MediaItem>>);
- method public void setSessionToken(android.support.v4.media.session.MediaSessionCompat.Token!);
- field public static final String SERVICE_INTERFACE = "android.media.browse.MediaBrowserService";
- }
-
- public static final class MediaBrowserServiceCompat.BrowserRoot {
- ctor public MediaBrowserServiceCompat.BrowserRoot(String, android.os.Bundle?);
- method public android.os.Bundle! getExtras();
- method public String! getRootId();
- field public static final String EXTRA_OFFLINE = "android.service.media.extra.OFFLINE";
- field public static final String EXTRA_RECENT = "android.service.media.extra.RECENT";
- field public static final String EXTRA_SUGGESTED = "android.service.media.extra.SUGGESTED";
- field @Deprecated public static final String EXTRA_SUGGESTION_KEYWORDS = "android.service.media.extra.SUGGESTION_KEYWORDS";
- }
-
- public static class MediaBrowserServiceCompat.Result<T> {
- method public void detach();
- method public void sendError(android.os.Bundle!);
- method public void sendProgressUpdate(android.os.Bundle!);
- method public void sendResult(T!);
- }
-
- public final class MediaSessionManager {
- method public static androidx.media.MediaSessionManager getSessionManager(android.content.Context);
- method public boolean isTrustedForMediaControl(androidx.media.MediaSessionManager.RemoteUserInfo);
- }
-
- public static final class MediaSessionManager.RemoteUserInfo {
- ctor public MediaSessionManager.RemoteUserInfo(String, int, int);
- method public String getPackageName();
- method public int getPid();
- method public int getUid();
- field public static final String LEGACY_CONTROLLER = "android.media.session.MediaController";
- }
-
- public abstract class VolumeProviderCompat {
- ctor public VolumeProviderCompat(int, int, int);
- method public final int getCurrentVolume();
- method public final int getMaxVolume();
- method public final int getVolumeControl();
- method public Object! getVolumeProvider();
- method public void onAdjustVolume(int);
- method public void onSetVolumeTo(int);
- method public void setCallback(androidx.media.VolumeProviderCompat.Callback!);
- method public final void setCurrentVolume(int);
- field public static final int VOLUME_CONTROL_ABSOLUTE = 2; // 0x2
- field public static final int VOLUME_CONTROL_FIXED = 0; // 0x0
- field public static final int VOLUME_CONTROL_RELATIVE = 1; // 0x1
- }
-
- public abstract static class VolumeProviderCompat.Callback {
- ctor public VolumeProviderCompat.Callback();
- method public abstract void onVolumeChanged(androidx.media.VolumeProviderCompat!);
- }
-
-}
-
-package androidx.media.app {
-
- public class NotificationCompat {
- }
-
- public static class NotificationCompat.DecoratedMediaCustomViewStyle extends androidx.media.app.NotificationCompat.MediaStyle {
- ctor public NotificationCompat.DecoratedMediaCustomViewStyle();
- }
-
- public static class NotificationCompat.MediaStyle extends androidx.core.app.NotificationCompat.Style {
- ctor public NotificationCompat.MediaStyle();
- ctor public NotificationCompat.MediaStyle(androidx.core.app.NotificationCompat.Builder!);
- method public static android.support.v4.media.session.MediaSessionCompat.Token! getMediaSession(android.app.Notification!);
- method public androidx.media.app.NotificationCompat.MediaStyle! setCancelButtonIntent(android.app.PendingIntent!);
- method public androidx.media.app.NotificationCompat.MediaStyle! setMediaSession(android.support.v4.media.session.MediaSessionCompat.Token!);
- method public androidx.media.app.NotificationCompat.MediaStyle! setShowActionsInCompactView(int...!);
- method public androidx.media.app.NotificationCompat.MediaStyle! setShowCancelButton(boolean);
- }
-
-}
-
-package androidx.media.session {
-
- public class MediaButtonReceiver extends android.content.BroadcastReceiver {
- ctor public MediaButtonReceiver();
- method public static android.app.PendingIntent! buildMediaButtonPendingIntent(android.content.Context!, long);
- method public static android.app.PendingIntent! buildMediaButtonPendingIntent(android.content.Context!, android.content.ComponentName!, long);
- method public static android.view.KeyEvent! handleIntent(android.support.v4.media.session.MediaSessionCompat!, android.content.Intent!);
- method public void onReceive(android.content.Context!, android.content.Intent!);
- }
-
-}
-
diff --git a/media/api/current.txt b/media/api/current.txt
index c4e14c0..0d77d11 100644
--- a/media/api/current.txt
+++ b/media/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package android.support.v4.media {
public final class MediaBrowserCompat {
diff --git a/media/api/res-1.1.0-alpha02.txt b/media/api/res-1.1.0-alpha02.txt
deleted file mode 100644
index 7a1e44d..0000000
--- a/media/api/res-1.1.0-alpha02.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-style TextAppearance_Compat_Notification_Info_Media
-style TextAppearance_Compat_Notification_Line2_Media
-style TextAppearance_Compat_Notification_Media
-style TextAppearance_Compat_Notification_Time_Media
-style TextAppearance_Compat_Notification_Title_Media
diff --git a/media/api/restricted_1.0.0.txt b/media/api/restricted_1.0.0.txt
deleted file mode 100644
index 51c09dd..0000000
--- a/media/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,245 +0,0 @@
-// Signature format: 3.0
-package android.support.v4.media {
-
- public final class MediaBrowserCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.os.Bundle? getNotifyChildrenChangedOptions();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface MediaBrowserCompat.MediaItem.Flags {
- }
-
- public final class MediaDescriptionCompat {
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String DESCRIPTION_KEY_MEDIA_URI = "android.support.v4.media.description.MEDIA_URI";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String DESCRIPTION_KEY_NULL_BUNDLE_FLAG = "android.support.v4.media.description.NULL_BUNDLE_FLAG";
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface MediaMetadataCompat.BitmapKey {
- }
-
- public static final class MediaMetadataCompat.Builder {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public MediaMetadataCompat.Builder(android.support.v4.media.MediaMetadataCompat!, int);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface MediaMetadataCompat.LongKey {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface MediaMetadataCompat.RatingKey {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface MediaMetadataCompat.TextKey {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface RatingCompat.StarStyle {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface RatingCompat.Style {
- }
-
-}
-
-package android.support.v4.media.session {
-
- public final class MediaControllerCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.os.Bundle? getSessionToken2Bundle();
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String COMMAND_ADD_QUEUE_ITEM = "android.support.v4.media.session.command.ADD_QUEUE_ITEM";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String COMMAND_ADD_QUEUE_ITEM_AT = "android.support.v4.media.session.command.ADD_QUEUE_ITEM_AT";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String COMMAND_ARGUMENT_INDEX = "android.support.v4.media.session.command.ARGUMENT_INDEX";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String COMMAND_ARGUMENT_MEDIA_DESCRIPTION = "android.support.v4.media.session.command.ARGUMENT_MEDIA_DESCRIPTION";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String COMMAND_GET_EXTRA_BINDER = "android.support.v4.media.session.command.GET_EXTRA_BINDER";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String COMMAND_REMOVE_QUEUE_ITEM = "android.support.v4.media.session.command.REMOVE_QUEUE_ITEM";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String COMMAND_REMOVE_QUEUE_ITEM_AT = "android.support.v4.media.session.command.REMOVE_QUEUE_ITEM_AT";
- }
-
- public abstract static class MediaControllerCompat.Callback {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.support.v4.media.session.IMediaControllerCallback! getIControllerCallback();
- }
-
- public class MediaSessionCompat {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public MediaSessionCompat(android.content.Context!, String!, android.os.Bundle!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static void ensureClassLoader(android.os.Bundle?);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public String! getCallingPackage();
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_ARGUMENT_CAPTIONING_ENABLED = "android.support.v4.media.session.action.ARGUMENT_CAPTIONING_ENABLED";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_ARGUMENT_EXTRAS = "android.support.v4.media.session.action.ARGUMENT_EXTRAS";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_ARGUMENT_MEDIA_ID = "android.support.v4.media.session.action.ARGUMENT_MEDIA_ID";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_ARGUMENT_QUERY = "android.support.v4.media.session.action.ARGUMENT_QUERY";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_ARGUMENT_RATING = "android.support.v4.media.session.action.ARGUMENT_RATING";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_ARGUMENT_REPEAT_MODE = "android.support.v4.media.session.action.ARGUMENT_REPEAT_MODE";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_ARGUMENT_SHUFFLE_MODE = "android.support.v4.media.session.action.ARGUMENT_SHUFFLE_MODE";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_ARGUMENT_URI = "android.support.v4.media.session.action.ARGUMENT_URI";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_PLAY_FROM_URI = "android.support.v4.media.session.action.PLAY_FROM_URI";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_PREPARE = "android.support.v4.media.session.action.PREPARE";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_PREPARE_FROM_MEDIA_ID = "android.support.v4.media.session.action.PREPARE_FROM_MEDIA_ID";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_PREPARE_FROM_SEARCH = "android.support.v4.media.session.action.PREPARE_FROM_SEARCH";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_PREPARE_FROM_URI = "android.support.v4.media.session.action.PREPARE_FROM_URI";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_SET_CAPTIONING_ENABLED = "android.support.v4.media.session.action.SET_CAPTIONING_ENABLED";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_SET_RATING = "android.support.v4.media.session.action.SET_RATING";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_SET_REPEAT_MODE = "android.support.v4.media.session.action.SET_REPEAT_MODE";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String ACTION_SET_SHUFFLE_MODE = "android.support.v4.media.session.action.SET_SHUFFLE_MODE";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String KEY_EXTRA_BINDER = "android.support.v4.media.session.EXTRA_BINDER";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String KEY_SESSION_TOKEN2_BUNDLE = "android.support.v4.media.session.SESSION_TOKEN2_BUNDLE";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String KEY_TOKEN = "android.support.v4.media.session.TOKEN";
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final class MediaSessionCompat.ResultReceiverWrapper {
- ctor public MediaSessionCompat.ResultReceiverWrapper(android.os.ResultReceiver!);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<android.support.v4.media.session.MediaSessionCompat.ResultReceiverWrapper>! CREATOR;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface MediaSessionCompat.SessionFlags {
- }
-
- public static final class MediaSessionCompat.Token {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static android.support.v4.media.session.MediaSessionCompat.Token! fromBundle(android.os.Bundle!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static android.support.v4.media.session.MediaSessionCompat.Token! fromToken(Object!, android.support.v4.media.session.IMediaSession!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.support.v4.media.session.IMediaSession! getExtraBinder();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.os.Bundle! getSessionToken2Bundle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setExtraBinder(android.support.v4.media.session.IMediaSession!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setSessionToken2Bundle(android.os.Bundle!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.os.Bundle! toBundle();
- }
-
- public final class PlaybackStateCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public long getCurrentPosition(Long!);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface PlaybackStateCompat.Actions {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface PlaybackStateCompat.ErrorCode {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface PlaybackStateCompat.MediaKeyAction {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface PlaybackStateCompat.RepeatMode {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface PlaybackStateCompat.ShuffleMode {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface PlaybackStateCompat.State {
- }
-
-}
-
-package androidx.media {
-
- public class AudioAttributesCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.media.AudioAttributesCompat! fromBundle(android.os.Bundle!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static void setForceLegacyBehavior(boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.os.Bundle toBundle();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface AudioAttributesCompat.AttributeContentType {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface AudioAttributesCompat.AttributeUsage {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final class AudioAttributesCompatParcelizer {
- ctor public AudioAttributesCompatParcelizer();
- method public static androidx.media.AudioAttributesCompat! read(androidx.versionedparcelable.VersionedParcel!);
- method public static void write(androidx.media.AudioAttributesCompat!, androidx.versionedparcelable.VersionedParcel!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final class AudioAttributesImplApi21Parcelizer {
- ctor public AudioAttributesImplApi21Parcelizer();
- method public static androidx.media.AudioAttributesImplApi21! read(androidx.versionedparcelable.VersionedParcel!);
- method public static void write(androidx.media.AudioAttributesImplApi21!, androidx.versionedparcelable.VersionedParcel!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final class AudioAttributesImplBaseParcelizer {
- ctor public AudioAttributesImplBaseParcelizer();
- method public static androidx.media.AudioAttributesImplBase! read(androidx.versionedparcelable.VersionedParcel!);
- method public static void write(androidx.media.AudioAttributesImplBase!, androidx.versionedparcelable.VersionedParcel!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class MediaBrowserCompatUtils {
- method public static boolean areSameOptions(android.os.Bundle!, android.os.Bundle!);
- method public static boolean hasDuplicatedItems(android.os.Bundle!, android.os.Bundle!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class MediaBrowserProtocol {
- field public static final int CLIENT_MSG_ADD_SUBSCRIPTION = 3; // 0x3
- field public static final int CLIENT_MSG_CONNECT = 1; // 0x1
- field public static final int CLIENT_MSG_DISCONNECT = 2; // 0x2
- field public static final int CLIENT_MSG_GET_MEDIA_ITEM = 5; // 0x5
- field public static final int CLIENT_MSG_REGISTER_CALLBACK_MESSENGER = 6; // 0x6
- field public static final int CLIENT_MSG_REMOVE_SUBSCRIPTION = 4; // 0x4
- field public static final int CLIENT_MSG_SEARCH = 8; // 0x8
- field public static final int CLIENT_MSG_SEND_CUSTOM_ACTION = 9; // 0x9
- field public static final int CLIENT_MSG_UNREGISTER_CALLBACK_MESSENGER = 7; // 0x7
- field public static final int CLIENT_VERSION_1 = 1; // 0x1
- field public static final int CLIENT_VERSION_CURRENT = 1; // 0x1
- field public static final String DATA_CALLBACK_TOKEN = "data_callback_token";
- field public static final String DATA_CALLING_PID = "data_calling_pid";
- field public static final String DATA_CALLING_UID = "data_calling_uid";
- field public static final String DATA_CUSTOM_ACTION = "data_custom_action";
- field public static final String DATA_CUSTOM_ACTION_EXTRAS = "data_custom_action_extras";
- field public static final String DATA_MEDIA_ITEM_ID = "data_media_item_id";
- field public static final String DATA_MEDIA_ITEM_LIST = "data_media_item_list";
- field public static final String DATA_MEDIA_SESSION_TOKEN = "data_media_session_token";
- field public static final String DATA_NOTIFY_CHILDREN_CHANGED_OPTIONS = "data_notify_children_changed_options";
- field public static final String DATA_OPTIONS = "data_options";
- field public static final String DATA_PACKAGE_NAME = "data_package_name";
- field public static final String DATA_RESULT_RECEIVER = "data_result_receiver";
- field public static final String DATA_ROOT_HINTS = "data_root_hints";
- field public static final String DATA_SEARCH_EXTRAS = "data_search_extras";
- field public static final String DATA_SEARCH_QUERY = "data_search_query";
- field public static final String EXTRA_CLIENT_VERSION = "extra_client_version";
- field public static final String EXTRA_MESSENGER_BINDER = "extra_messenger";
- field public static final String EXTRA_SERVICE_VERSION = "extra_service_version";
- field public static final String EXTRA_SESSION_BINDER = "extra_session_binder";
- field public static final int SERVICE_MSG_ON_CONNECT = 1; // 0x1
- field public static final int SERVICE_MSG_ON_CONNECT_FAILED = 2; // 0x2
- field public static final int SERVICE_MSG_ON_LOAD_CHILDREN = 3; // 0x3
- field public static final int SERVICE_VERSION_1 = 1; // 0x1
- field public static final int SERVICE_VERSION_2 = 2; // 0x2
- field public static final int SERVICE_VERSION_CURRENT = 2; // 0x2
- }
-
- public abstract class MediaBrowserServiceCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void attachToBaseContext(android.content.Context!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void notifyChildrenChanged(androidx.media.MediaSessionManager.RemoteUserInfo, String, android.os.Bundle);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void onSubscribe(String!, android.os.Bundle!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void onUnsubscribe(String!);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String KEY_MEDIA_ITEM = "media_item";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final String KEY_SEARCH_RESULTS = "search_results";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final int RESULT_ERROR = -1; // 0xffffffff
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final int RESULT_OK = 0; // 0x0
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final int RESULT_PROGRESS_UPDATE = 1; // 0x1
- }
-
- public static final class MediaSessionManager.RemoteUserInfo {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(28) public MediaSessionManager.RemoteUserInfo(android.media.session.MediaSessionManager.RemoteUserInfo!);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface VolumeProviderCompat.ControlType {
- }
-
-}
-
-package androidx.media.app {
-
- public static class NotificationCompat.DecoratedMediaCustomViewStyle extends androidx.media.app.NotificationCompat.MediaStyle {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.widget.RemoteViews! makeHeadsUpContentView(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- }
-
- public static class NotificationCompat.MediaStyle {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void apply(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.widget.RemoteViews! makeBigContentView(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.widget.RemoteViews! makeContentView(androidx.core.app.NotificationBuilderWithBuilderAccessor!);
- }
-
-}
-
-package androidx.media.session {
-
- public class MediaButtonReceiver {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static android.content.ComponentName! getMediaButtonReceiverComponent(android.content.Context!);
- }
-
-}
-
diff --git a/media/build.gradle b/media/build.gradle
index 8f04a69..e1271d4 100644
--- a/media/build.gradle
+++ b/media/build.gradle
@@ -7,9 +7,8 @@
}
dependencies {
- api(project(":annotation"))
+ api("androidx.annotation:annotation:1.0.1")
api(project(":core"))
- implementation(project(":collection"))
api("androidx.versionedparcelable:versionedparcelable:1.1.0-alpha01")
androidTestImplementation(TEST_EXT_JUNIT)
@@ -41,5 +40,4 @@
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."
failOnUncheckedWarnings = false
failOnDeprecationWarnings = false
- trackRestrictedAPIs = false
}
diff --git a/media/src/main/aidl/android/support/v4/media/session/IMediaSession.aidl b/media/src/main/aidl/android/support/v4/media/session/IMediaSession.aidl
index 0fcd811..f32f449 100644
--- a/media/src/main/aidl/android/support/v4/media/session/IMediaSession.aidl
+++ b/media/src/main/aidl/android/support/v4/media/session/IMediaSession.aidl
@@ -34,7 +34,7 @@
* @hide
*/
interface IMediaSession {
- // Next ID: 49
+ // Next ID: 48
void sendCommand(String command, in Bundle args, in MediaSessionCompat.ResultReceiverWrapper cb) = 0;
boolean sendMediaButton(in KeyEvent mediaButton) = 1;
void registerCallbackListener(in IMediaControllerCallback cb) = 2;
@@ -81,7 +81,6 @@
void seekTo(long pos) = 23;
void rate(in RatingCompat rating) = 24;
void rateWithExtras(in RatingCompat rating, in Bundle extras) = 50;
- void setPlaybackSpeed(float speed) = 48;
void setCaptioningEnabled(boolean enabled) = 45;
void setRepeatMode(int repeatMode) = 38;
void setShuffleModeEnabledRemoved(boolean shuffleMode) = 39;
diff --git a/media/src/main/java/android/support/v4/media/MediaBrowserCompat.java b/media/src/main/java/android/support/v4/media/MediaBrowserCompat.java
index 12f7083..2ab22a5 100644
--- a/media/src/main/java/android/support/v4/media/MediaBrowserCompat.java
+++ b/media/src/main/java/android/support/v4/media/MediaBrowserCompat.java
@@ -16,7 +16,7 @@
package android.support.v4.media;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media.MediaBrowserProtocol.CLIENT_MSG_ADD_SUBSCRIPTION;
import static androidx.media.MediaBrowserProtocol.CLIENT_MSG_CONNECT;
import static androidx.media.MediaBrowserProtocol.CLIENT_MSG_DISCONNECT;
@@ -461,7 +461,7 @@
private final MediaDescriptionCompat mDescription;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
@IntDef(flag=true, value = { FLAG_BROWSABLE, FLAG_PLAYABLE })
public @interface Flags { }
diff --git a/media/src/main/java/android/support/v4/media/MediaDescriptionCompat.java b/media/src/main/java/android/support/v4/media/MediaDescriptionCompat.java
index e34708f..4fe7886 100644
--- a/media/src/main/java/android/support/v4/media/MediaDescriptionCompat.java
+++ b/media/src/main/java/android/support/v4/media/MediaDescriptionCompat.java
@@ -15,7 +15,7 @@
*/
package android.support.v4.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
@@ -140,7 +140,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String DESCRIPTION_KEY_MEDIA_URI =
"android.support.v4.media.description.MEDIA_URI";
/**
@@ -148,7 +148,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String DESCRIPTION_KEY_NULL_BUNDLE_FLAG =
"android.support.v4.media.description.NULL_BUNDLE_FLAG";
/**
diff --git a/media/src/main/java/android/support/v4/media/MediaMetadataCompat.java b/media/src/main/java/android/support/v4/media/MediaMetadataCompat.java
index bf8b780..f3d7e45 100644
--- a/media/src/main/java/android/support/v4/media/MediaMetadataCompat.java
+++ b/media/src/main/java/android/support/v4/media/MediaMetadataCompat.java
@@ -15,7 +15,7 @@
*/
package android.support.v4.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
@@ -265,7 +265,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef(value =
{METADATA_KEY_TITLE, METADATA_KEY_ARTIST, METADATA_KEY_ALBUM, METADATA_KEY_AUTHOR,
METADATA_KEY_WRITER, METADATA_KEY_COMPOSER, METADATA_KEY_COMPILATION,
@@ -280,7 +280,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef(value =
{METADATA_KEY_DURATION, METADATA_KEY_YEAR, METADATA_KEY_TRACK_NUMBER,
METADATA_KEY_NUM_TRACKS, METADATA_KEY_DISC_NUMBER, METADATA_KEY_BT_FOLDER_TYPE,
@@ -292,7 +292,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef({METADATA_KEY_ART, METADATA_KEY_ALBUM_ART, METADATA_KEY_DISPLAY_ICON})
@Retention(RetentionPolicy.SOURCE)
public @interface BitmapKey {}
@@ -300,7 +300,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef({METADATA_KEY_USER_RATING, METADATA_KEY_RATING})
@Retention(RetentionPolicy.SOURCE)
public @interface RatingKey {}
@@ -695,7 +695,7 @@
* in the metadata.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Builder(MediaMetadataCompat source, int maxBitmapSize) {
this(source);
for (String key : mBundle.keySet()) {
diff --git a/media/src/main/java/android/support/v4/media/RatingCompat.java b/media/src/main/java/android/support/v4/media/RatingCompat.java
index d109647..6f8a0b1 100644
--- a/media/src/main/java/android/support/v4/media/RatingCompat.java
+++ b/media/src/main/java/android/support/v4/media/RatingCompat.java
@@ -16,7 +16,7 @@
package android.support.v4.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.media.Rating;
@@ -46,7 +46,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({RATING_NONE, RATING_HEART, RATING_THUMB_UP_DOWN, RATING_3_STARS, RATING_4_STARS,
RATING_5_STARS, RATING_PERCENTAGE})
@Retention(RetentionPolicy.SOURCE)
@@ -55,7 +55,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({RATING_3_STARS, RATING_4_STARS, RATING_5_STARS})
@Retention(RetentionPolicy.SOURCE)
public @interface StarStyle {}
diff --git a/media/src/main/java/android/support/v4/media/session/MediaControllerCompat.java b/media/src/main/java/android/support/v4/media/session/MediaControllerCompat.java
index 813f30f..e4cd404 100644
--- a/media/src/main/java/android/support/v4/media/session/MediaControllerCompat.java
+++ b/media/src/main/java/android/support/v4/media/session/MediaControllerCompat.java
@@ -17,7 +17,7 @@
package android.support.v4.media.session;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Activity;
import android.app.PendingIntent;
@@ -541,7 +541,7 @@
* @return The session's token as VersionedParcelable.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @Nullable VersionedParcelable getSession2Token() {
return mToken.getSession2Token();
}
@@ -1301,15 +1301,6 @@
public abstract void setRating(RatingCompat rating, Bundle extras);
/**
- * Set the playback speed.
- *
- * @param speed The playback speed
- * @hide
- */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- public void setPlaybackSpeed(float speed) {}
-
- /**
* Enables/disables captioning for this session.
*
* @param enabled {@code true} to enable captioning, {@code false} to disable.
@@ -1947,15 +1938,6 @@
}
@Override
- public void setPlaybackSpeed(float speed) {
- try {
- mBinder.setPlaybackSpeed(speed);
- } catch (RemoteException e) {
- Log.e(TAG, "Dead object in setPlaybackSpeed.", e);
- }
- }
-
- @Override
public void setCaptioningEnabled(boolean enabled) {
try {
mBinder.setCaptioningEnabled(enabled);
@@ -2447,13 +2429,6 @@
}
@Override
- public void setPlaybackSpeed(float speed) {
- Bundle bundle = new Bundle();
- bundle.putFloat(MediaSessionCompat.ACTION_ARGUMENT_PLAYBACK_SPEED, speed);
- sendCustomAction(MediaSessionCompat.ACTION_SET_PLAYBACK_SPEED, bundle);
- }
-
- @Override
public void setCaptioningEnabled(boolean enabled) {
Bundle bundle = new Bundle();
bundle.putBoolean(MediaSessionCompat.ACTION_ARGUMENT_CAPTIONING_ENABLED, enabled);
diff --git a/media/src/main/java/android/support/v4/media/session/MediaSessionCompat.java b/media/src/main/java/android/support/v4/media/session/MediaSessionCompat.java
index 67639b2..a9188e8 100644
--- a/media/src/main/java/android/support/v4/media/session/MediaSessionCompat.java
+++ b/media/src/main/java/android/support/v4/media/session/MediaSessionCompat.java
@@ -17,7 +17,7 @@
package android.support.v4.media.session;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media.MediaSessionManager.RemoteUserInfo.LEGACY_CONTROLLER;
import static androidx.media.MediaSessionManager.RemoteUserInfo.UNKNOWN_PID;
import static androidx.media.MediaSessionManager.RemoteUserInfo.UNKNOWN_UID;
@@ -128,7 +128,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef(flag=true, value={
FLAG_HANDLES_MEDIA_BUTTONS,
FLAG_HANDLES_TRANSPORT_CONTROLS,
@@ -328,15 +328,6 @@
"android.support.v4.media.session.action.SET_RATING";
/**
- * Custom action to invoke setPlaybackSpeed() with extra fields.
- *
- * @hide
- */
- @RestrictTo(LIBRARY)
- public static final String ACTION_SET_PLAYBACK_SPEED =
- "android.support.v4.media.session.action.SET_PLAYBACK_SPEED";
-
- /**
* Argument for use with {@link #ACTION_PREPARE_FROM_MEDIA_ID} indicating media id to play.
*
* @hide
@@ -374,15 +365,6 @@
"android.support.v4.media.session.action.ARGUMENT_RATING";
/**
- * Argument for use with {@link #ACTION_SET_PLAYBACK_SPEED} indicating the speed to be set.
- *
- * @hide
- */
- @RestrictTo(LIBRARY)
- public static final String ACTION_ARGUMENT_PLAYBACK_SPEED =
- "android.support.v4.media.session.action.ARGUMENT_PLAYBACK_SPEED";
-
- /**
* Argument for use with various actions indicating extra bundle.
*
* @hide
@@ -422,7 +404,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String KEY_TOKEN = "android.support.v4.media.session.TOKEN";
/**
@@ -435,7 +417,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String KEY_SESSION2_TOKEN =
"android.support.v4.media.session.SESSION_TOKEN2";
@@ -496,9 +478,14 @@
/**
* @hide
+ * Creates session for MediaSession.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- public MediaSessionCompat(Context context, String tag, ComponentName mbrComponent,
+ @RestrictTo(LIBRARY_GROUP)
+ public MediaSessionCompat(Context context, String tag, VersionedParcelable session2Token) {
+ this(context, tag, null, null, session2Token);
+ }
+
+ private MediaSessionCompat(Context context, String tag, ComponentName mbrComponent,
PendingIntent mbrIntent, VersionedParcelable session2Token) {
if (context == null) {
throw new IllegalArgumentException("context must not be null");
@@ -908,7 +895,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public String getCallingPackage() {
return mImpl.getCallingPackage();
}
@@ -975,7 +962,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static void ensureClassLoader(@Nullable Bundle bundle) {
if (bundle != null) {
bundle.setClassLoader(MediaSessionCompat.class.getClassLoader());
@@ -1272,21 +1259,6 @@
}
/**
- * Override to handle the playback speed change.
- * To update the new playback speed, create a new {@link PlaybackStateCompat} by using
- * {@link PlaybackStateCompat.Builder#setState(int, long, float)}, and set it with
- * {@link #setPlaybackState(PlaybackStateCompat)}.
- *
- * @param speed the playback speed
- * @see #setPlaybackState(PlaybackStateCompat)
- * @see PlaybackStateCompat.Builder#setState(int, long, float)
- * @hide
- */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- public void onSetPlaybackSpeed(float speed) {
- }
-
- /**
* Override to handle requests to enable/disable captioning.
*
* @param enabled {@code true} to enable captioning, {@code false} to disable.
@@ -1607,9 +1579,6 @@
} else if (action.equals(ACTION_SET_RATING)) {
RatingCompat rating = extras.getParcelable(ACTION_ARGUMENT_RATING);
Callback.this.onSetRating(rating, bundle);
- } else if (action.equals(ACTION_SET_PLAYBACK_SPEED)) {
- float speed = extras.getFloat(ACTION_ARGUMENT_PLAYBACK_SPEED, 1.0f);
- Callback.this.onSetPlaybackSpeed(speed);
} else {
Callback.this.onCustomAction(action, extras);
}
@@ -1732,7 +1701,7 @@
* @return A compat Token for use with {@link MediaControllerCompat}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static Token fromToken(Object token, IMediaSession extraBinder) {
if (token != null && android.os.Build.VERSION.SDK_INT >= 21) {
if (!(token instanceof MediaSession.Token)) {
@@ -1801,7 +1770,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public IMediaSession getExtraBinder() {
return mExtraBinder;
}
@@ -1809,7 +1778,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setExtraBinder(IMediaSession extraBinder) {
mExtraBinder = extraBinder;
}
@@ -1817,7 +1786,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public VersionedParcelable getSession2Token() {
return mSession2Token;
}
@@ -1825,7 +1794,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setSession2Token(VersionedParcelable session2Token) {
mSession2Token = session2Token;
}
@@ -1833,7 +1802,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Bundle toBundle() {
Bundle bundle = new Bundle();
bundle.putParcelable(KEY_TOKEN, this);
@@ -1853,7 +1822,7 @@
* @return A compat Token for use with {@link MediaControllerCompat}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static Token fromBundle(Bundle tokenBundle) {
if (tokenBundle == null) {
return null;
@@ -2978,11 +2947,6 @@
}
@Override
- public void setPlaybackSpeed(float speed) throws RemoteException {
- postToHandler(MessageHandler.MSG_SET_PLAYBACK_SPEED, speed);
- }
-
- @Override
public void setCaptioningEnabled(boolean enabled) throws RemoteException {
postToHandler(MessageHandler.MSG_SET_CAPTIONING_ENABLED, enabled);
}
@@ -3131,7 +3095,6 @@
}
class MessageHandler extends Handler {
- // Next ID: 33
private static final int MSG_COMMAND = 1;
private static final int MSG_ADJUST_VOLUME = 2;
private static final int MSG_PREPARE = 3;
@@ -3152,7 +3115,6 @@
private static final int MSG_SEEK_TO = 18;
private static final int MSG_RATE = 19;
private static final int MSG_RATE_EXTRA = 31;
- private static final int MSG_SET_PLAYBACK_SPEED = 32;
private static final int MSG_CUSTOM_ACTION = 20;
private static final int MSG_MEDIA_BUTTON = 21;
private static final int MSG_SET_VOLUME = 22;
@@ -3257,9 +3219,6 @@
case MSG_RATE_EXTRA:
cb.onSetRating((RatingCompat) msg.obj, extras);
break;
- case MSG_SET_PLAYBACK_SPEED:
- cb.onSetPlaybackSpeed((Float) msg.obj);
- break;
case MSG_CUSTOM_ACTION:
cb.onCustomAction((String) msg.obj, extras);
break;
@@ -3952,12 +3911,6 @@
}
@Override
- public void setPlaybackSpeed(float speed) throws RemoteException {
- // Will not be called.
- throw new AssertionError();
- }
-
- @Override
public void setCaptioningEnabled(boolean enabled) throws RemoteException {
// Will not be called.
throw new AssertionError();
diff --git a/media/src/main/java/android/support/v4/media/session/PlaybackStateCompat.java b/media/src/main/java/android/support/v4/media/session/PlaybackStateCompat.java
index 57a3302..8e88f48 100644
--- a/media/src/main/java/android/support/v4/media/session/PlaybackStateCompat.java
+++ b/media/src/main/java/android/support/v4/media/session/PlaybackStateCompat.java
@@ -15,7 +15,7 @@
*/
package android.support.v4.media.session;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.media.session.PlaybackState;
@@ -48,7 +48,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@LongDef(flag=true, value={ACTION_STOP, ACTION_PAUSE, ACTION_PLAY, ACTION_REWIND,
ACTION_SKIP_TO_PREVIOUS, ACTION_SKIP_TO_NEXT, ACTION_FAST_FORWARD, ACTION_SET_RATING,
ACTION_SEEK_TO, ACTION_PLAY_PAUSE, ACTION_PLAY_FROM_MEDIA_ID, ACTION_PLAY_FROM_SEARCH,
@@ -61,7 +61,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@LongDef({ACTION_STOP, ACTION_PAUSE, ACTION_PLAY, ACTION_REWIND, ACTION_SKIP_TO_PREVIOUS,
ACTION_SKIP_TO_NEXT, ACTION_FAST_FORWARD, ACTION_PLAY_PAUSE})
@Retention(RetentionPolicy.SOURCE)
@@ -226,7 +226,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({STATE_NONE, STATE_STOPPED, STATE_PAUSED, STATE_PLAYING, STATE_FAST_FORWARDING,
STATE_REWINDING, STATE_BUFFERING, STATE_ERROR, STATE_CONNECTING,
STATE_SKIPPING_TO_PREVIOUS, STATE_SKIPPING_TO_NEXT, STATE_SKIPPING_TO_QUEUE_ITEM})
@@ -339,7 +339,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({REPEAT_MODE_INVALID, REPEAT_MODE_NONE, REPEAT_MODE_ONE, REPEAT_MODE_ALL,
REPEAT_MODE_GROUP})
@Retention(RetentionPolicy.SOURCE)
@@ -380,7 +380,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({SHUFFLE_MODE_INVALID, SHUFFLE_MODE_NONE, SHUFFLE_MODE_ALL, SHUFFLE_MODE_GROUP})
@Retention(RetentionPolicy.SOURCE)
public @interface ShuffleMode {}
@@ -414,7 +414,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({ERROR_CODE_UNKNOWN_ERROR, ERROR_CODE_APP_ERROR, ERROR_CODE_NOT_SUPPORTED,
ERROR_CODE_AUTHENTICATION_EXPIRED, ERROR_CODE_PREMIUM_ACCOUNT_REQUIRED,
ERROR_CODE_CONCURRENT_STREAM_LIMIT, ERROR_CODE_PARENTAL_CONTROL_RESTRICTED,
@@ -668,7 +668,7 @@
* @return The current playback position in ms
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public long getCurrentPosition(Long timeDiff) {
long expectedPosition = mPosition + (long) (mSpeed * (
(timeDiff != null) ? timeDiff : SystemClock.elapsedRealtime() - mUpdateTime));
diff --git a/media/src/main/java/androidx/media/AudioAttributesCompat.java b/media/src/main/java/androidx/media/AudioAttributesCompat.java
index 4984976..9e6f75e 100644
--- a/media/src/main/java/androidx/media/AudioAttributesCompat.java
+++ b/media/src/main/java/androidx/media/AudioAttributesCompat.java
@@ -16,7 +16,7 @@
package androidx.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.media.AudioAttributes;
import android.media.AudioManager;
@@ -248,7 +248,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ParcelField(1)
public AudioAttributesImpl mImpl;
@@ -350,7 +350,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @NonNull Bundle toBundle() {
return mImpl.toBundle();
}
@@ -358,7 +358,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static AudioAttributesCompat fromBundle(Bundle bundle) {
AudioAttributesImpl impl;
if (Build.VERSION.SDK_INT >= 21) {
@@ -571,7 +571,7 @@
*
* @hide For testing only.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static void setForceLegacyBehavior(boolean force) {
sForceLegacyBehavior = force;
}
@@ -664,7 +664,7 @@
USAGE_GAME,
USAGE_ASSISTANT,
})
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
public @interface AttributeUsage {
}
@@ -678,7 +678,7 @@
CONTENT_TYPE_SONIFICATION
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface AttributeContentType {
}
}
diff --git a/media/src/main/java/androidx/media/AudioAttributesImplApi21.java b/media/src/main/java/androidx/media/AudioAttributesImplApi21.java
index 88f7ab2..abd68a6 100644
--- a/media/src/main/java/androidx/media/AudioAttributesImplApi21.java
+++ b/media/src/main/java/androidx/media/AudioAttributesImplApi21.java
@@ -16,7 +16,7 @@
package androidx.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media.AudioAttributesCompat.AUDIO_ATTRIBUTES_FRAMEWORKS;
import static androidx.media.AudioAttributesCompat.AUDIO_ATTRIBUTES_LEGACY_STREAM_TYPE;
import static androidx.media.AudioAttributesCompat.INVALID_STREAM_TYPE;
@@ -33,18 +33,18 @@
/** @hide */
@VersionedParcelize(jetifyAs = "android.support.v4.media.AudioAttributesImplApi21")
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(21)
public class AudioAttributesImplApi21 implements AudioAttributesImpl {
private static final String TAG = "AudioAttributesCompat21";
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ParcelField(1)
public AudioAttributes mAudioAttributes;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ParcelField(2)
public int mLegacyStreamType = INVALID_STREAM_TYPE;
diff --git a/media/src/main/java/androidx/media/AudioAttributesImplApi26.java b/media/src/main/java/androidx/media/AudioAttributesImplApi26.java
index 12e14cb..a961e84 100644
--- a/media/src/main/java/androidx/media/AudioAttributesImplApi26.java
+++ b/media/src/main/java/androidx/media/AudioAttributesImplApi26.java
@@ -16,7 +16,7 @@
package androidx.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media.AudioAttributesCompat.INVALID_STREAM_TYPE;
import android.media.AudioAttributes;
@@ -27,7 +27,7 @@
/** @hide */
@VersionedParcelize(jetifyAs = "android.support.v4.media.AudioAttributesImplApi26")
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(26)
public class AudioAttributesImplApi26 extends AudioAttributesImplApi21 {
private static final String TAG = "AudioAttributesCompat26";
diff --git a/media/src/main/java/androidx/media/AudioAttributesImplBase.java b/media/src/main/java/androidx/media/AudioAttributesImplBase.java
index 151eb35..45bd889 100644
--- a/media/src/main/java/androidx/media/AudioAttributesImplBase.java
+++ b/media/src/main/java/androidx/media/AudioAttributesImplBase.java
@@ -16,7 +16,7 @@
package androidx.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media.AudioAttributesCompat.AUDIO_ATTRIBUTES_CONTENT_TYPE;
import static androidx.media.AudioAttributesCompat.AUDIO_ATTRIBUTES_FLAGS;
import static androidx.media.AudioAttributesCompat.AUDIO_ATTRIBUTES_LEGACY_STREAM_TYPE;
@@ -57,22 +57,22 @@
/** @hide */
@VersionedParcelize(jetifyAs = "android.support.v4.media.AudioAttributesImplBase")
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class AudioAttributesImplBase implements AudioAttributesImpl {
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ParcelField(1)
public int mUsage = USAGE_UNKNOWN;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ParcelField(2)
public int mContentType = CONTENT_TYPE_UNKNOWN;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ParcelField(3)
public int mFlags = 0x0;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ParcelField(4)
public int mLegacyStream = INVALID_STREAM_TYPE;
diff --git a/media/src/main/java/androidx/media/AudioFocusRequestCompat.java b/media/src/main/java/androidx/media/AudioFocusRequestCompat.java
index e932d63..da95c3f 100644
--- a/media/src/main/java/androidx/media/AudioFocusRequestCompat.java
+++ b/media/src/main/java/androidx/media/AudioFocusRequestCompat.java
@@ -16,7 +16,7 @@
package androidx.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static java.lang.annotation.RetentionPolicy.SOURCE;
@@ -46,7 +46,7 @@
new AudioAttributesCompat.Builder().setUsage(AudioAttributesCompat.USAGE_MEDIA).build();
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(SOURCE)
@IntDef({
AudioManagerCompat.AUDIOFOCUS_GAIN,
@@ -394,7 +394,7 @@
* @return true if focusGain is a valid value for an audio focus request.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
static boolean isValidFocusGain(@FocusGainType int focusGain) {
switch (focusGain) {
case AudioManagerCompat.AUDIOFOCUS_GAIN:
diff --git a/media/src/main/java/androidx/media/MediaBrowserCompatUtils.java b/media/src/main/java/androidx/media/MediaBrowserCompatUtils.java
index 0ca95e8..b9491b6 100644
--- a/media/src/main/java/androidx/media/MediaBrowserCompatUtils.java
+++ b/media/src/main/java/androidx/media/MediaBrowserCompatUtils.java
@@ -16,7 +16,7 @@
package androidx.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
import android.support.v4.media.MediaBrowserCompat;
@@ -26,7 +26,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class MediaBrowserCompatUtils {
public static boolean areSameOptions(Bundle options1, Bundle options2) {
if (options1 == options2) {
diff --git a/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java b/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java
index b2da6c8..2938c1d 100644
--- a/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java
+++ b/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java
@@ -17,7 +17,7 @@
package androidx.media;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media.MediaBrowserProtocol.CLIENT_MSG_ADD_SUBSCRIPTION;
import static androidx.media.MediaBrowserProtocol.CLIENT_MSG_CONNECT;
import static androidx.media.MediaBrowserProtocol.CLIENT_MSG_DISCONNECT;
@@ -1419,7 +1419,7 @@
* @param option option
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void onSubscribe(String id, Bundle option) {
}
@@ -1429,7 +1429,7 @@
* @param id
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void onUnsubscribe(String id) {
}
@@ -1613,7 +1613,7 @@
* contain the information about the change.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void notifyChildrenChanged(@NonNull RemoteUserInfo remoteUserInfo,
@NonNull String parentId, @NonNull Bundle options) {
if (remoteUserInfo == null) {
diff --git a/media/src/main/java/androidx/media/MediaSessionManager.java b/media/src/main/java/androidx/media/MediaSessionManager.java
index c8acdae..ba9d256 100644
--- a/media/src/main/java/androidx/media/MediaSessionManager.java
+++ b/media/src/main/java/androidx/media/MediaSessionManager.java
@@ -16,7 +16,7 @@
package androidx.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.os.Build;
@@ -127,14 +127,14 @@
* Represents an unknown pid of an application.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int UNKNOWN_PID = -1;
/**
* Represents an unknown uid of an application.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int UNKNOWN_UID = -1;
RemoteUserInfoImpl mImpl;
@@ -168,7 +168,7 @@
* @param remoteUserInfo Framework RemoteUserInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@RequiresApi(28)
public RemoteUserInfo(
android.media.session.MediaSessionManager.RemoteUserInfo remoteUserInfo) {
diff --git a/media/src/main/java/androidx/media/VolumeProviderCompat.java b/media/src/main/java/androidx/media/VolumeProviderCompat.java
index eea4c7b..4ddc486 100644
--- a/media/src/main/java/androidx/media/VolumeProviderCompat.java
+++ b/media/src/main/java/androidx/media/VolumeProviderCompat.java
@@ -16,7 +16,7 @@
package androidx.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.media.VolumeProvider;
import android.os.Build;
@@ -39,7 +39,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({VOLUME_CONTROL_FIXED, VOLUME_CONTROL_RELATIVE, VOLUME_CONTROL_ABSOLUTE})
@Retention(RetentionPolicy.SOURCE)
public @interface ControlType {}
diff --git a/media/src/main/java/androidx/media/app/NotificationCompat.java b/media/src/main/java/androidx/media/app/NotificationCompat.java
index 9e6af2e..99c97e4 100644
--- a/media/src/main/java/androidx/media/app/NotificationCompat.java
+++ b/media/src/main/java/androidx/media/app/NotificationCompat.java
@@ -16,7 +16,7 @@
package androidx.media.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.core.app.NotificationCompat.COLOR_DEFAULT;
import android.app.Notification;
@@ -204,7 +204,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void apply(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 21) {
@@ -229,7 +229,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public RemoteViews makeContentView(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 21) {
@@ -297,7 +297,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public RemoteViews makeBigContentView(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 21) {
@@ -382,7 +382,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void apply(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 24) {
@@ -396,7 +396,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public RemoteViews makeContentView(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 24) {
@@ -438,7 +438,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public RemoteViews makeBigContentView(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 24) {
@@ -470,7 +470,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public RemoteViews makeHeadsUpContentView(NotificationBuilderWithBuilderAccessor builder) {
if (Build.VERSION.SDK_INT >= 24) {
diff --git a/media/version-compat-tests/current/client/src/androidTest/java/android/support/mediacompat/client/ClientBroadcastReceiver.java b/media/version-compat-tests/current/client/src/androidTest/java/android/support/mediacompat/client/ClientBroadcastReceiver.java
index 0f4d8e8..1baba08 100644
--- a/media/version-compat-tests/current/client/src/androidTest/java/android/support/mediacompat/client/ClientBroadcastReceiver.java
+++ b/media/version-compat-tests/current/client/src/androidTest/java/android/support/mediacompat/client/ClientBroadcastReceiver.java
@@ -41,7 +41,6 @@
import static android.support.mediacompat.testlib.MediaControllerConstants
.SEND_CUSTOM_ACTION_PARCELABLE;
import static android.support.mediacompat.testlib.MediaControllerConstants.SET_CAPTIONING_ENABLED;
-import static android.support.mediacompat.testlib.MediaControllerConstants.SET_PLAYBACK_SPEED;
import static android.support.mediacompat.testlib.MediaControllerConstants.SET_RATING;
import static android.support.mediacompat.testlib.MediaControllerConstants.SET_REPEAT_MODE;
import static android.support.mediacompat.testlib.MediaControllerConstants.SET_SHUFFLE_MODE;
@@ -232,9 +231,6 @@
case SET_SHUFFLE_MODE:
controls.setShuffleMode(extras.getInt(KEY_ARGUMENT));
break;
- case SET_PLAYBACK_SPEED:
- controls.setPlaybackSpeed(extras.getFloat(KEY_ARGUMENT));
- break;
}
}
}
diff --git a/media/version-compat-tests/current/service/src/androidTest/java/android/support/mediacompat/service/MediaSessionCompatCallbackTest.java b/media/version-compat-tests/current/service/src/androidTest/java/android/support/mediacompat/service/MediaSessionCompatCallbackTest.java
index 56a99c2..38ac323 100644
--- a/media/version-compat-tests/current/service/src/androidTest/java/android/support/mediacompat/service/MediaSessionCompatCallbackTest.java
+++ b/media/version-compat-tests/current/service/src/androidTest/java/android/support/mediacompat/service/MediaSessionCompatCallbackTest.java
@@ -37,7 +37,6 @@
import static android.support.mediacompat.testlib.MediaControllerConstants.SEND_CUSTOM_ACTION;
import static android.support.mediacompat.testlib.MediaControllerConstants.SEND_CUSTOM_ACTION_PARCELABLE;
import static android.support.mediacompat.testlib.MediaControllerConstants.SET_CAPTIONING_ENABLED;
-import static android.support.mediacompat.testlib.MediaControllerConstants.SET_PLAYBACK_SPEED;
import static android.support.mediacompat.testlib.MediaControllerConstants.SET_RATING;
import static android.support.mediacompat.testlib.MediaControllerConstants.SET_REPEAT_MODE;
import static android.support.mediacompat.testlib.MediaControllerConstants.SET_SHUFFLE_MODE;
@@ -697,26 +696,6 @@
}
/**
- * Tests {@link MediaSessionCompat.Callback#onSetPlaybackSpeed(float)}.
- */
- @Test
- @SmallTest
- public void testCallback_onSetPlaybackSpeed() {
- if (!TextUtils.equals(VERSION_TOT, mClientVersion)) {
- // In previous versions, MediaControllerCompat#setPlaybackSpeed() does not exist.
- return;
- }
-
- mCallback.reset(1);
- final float testSpeed = 2.0f;
- callTransportControlsMethod(
- SET_PLAYBACK_SPEED, testSpeed, getApplicationContext(), mSession.getSessionToken());
- assertTrue(mCallback.await(TIME_OUT_MS));
- assertTrue(mCallback.mOnSetPlaybackSpeedCalled);
- assertEquals(testSpeed, mCallback.mSpeed, 0.0f);
- }
-
- /**
* Tests {@link MediaSessionCompat.Callback#onMediaButtonEvent}.
*/
@Test
@@ -1119,7 +1098,6 @@
private int mQueueIndex;
private MediaDescriptionCompat mQueueDescription;
private List<MediaSessionCompat.QueueItem> mQueue = new ArrayList<>();
- private float mSpeed;
private int mOnPlayCalledCount;
private boolean mOnPauseCalled;
@@ -1146,7 +1124,6 @@
private boolean mOnAddQueueItemCalled;
private boolean mOnAddQueueItemAtCalled;
private boolean mOnRemoveQueueItemCalled;
- private boolean mOnSetPlaybackSpeedCalled;
public void reset(int count) {
mLatch = new CountDownLatch(count);
@@ -1170,7 +1147,6 @@
mShuffleMode = PlaybackStateCompat.SHUFFLE_MODE_NONE;
mQueueIndex = -1;
mQueueDescription = null;
- mSpeed = -1.0f;
mRemoteUserInfoForStop = null;
mOnPlayCalledCount = 0;
@@ -1198,7 +1174,6 @@
mOnAddQueueItemCalled = false;
mOnAddQueueItemAtCalled = false;
mOnRemoveQueueItemCalled = false;
- mOnSetPlaybackSpeedCalled = false;
}
public void reset(int count, String expectedCallerPackageName) {
@@ -1510,17 +1485,6 @@
mLatch.countDown();
}
- @Override
- public void onSetPlaybackSpeed(float speed) {
- if (!isCallerTestClient()) {
- // Ignore
- return;
- }
- mOnSetPlaybackSpeedCalled = true;
- mSpeed = speed;
- mLatch.countDown();
- }
-
private boolean isCallerTestClient() {
RemoteUserInfo info = mSession.getCurrentControllerInfo();
assertNotNull(info);
diff --git a/media/version-compat-tests/lib/src/main/java/android/support/mediacompat/testlib/MediaControllerConstants.java b/media/version-compat-tests/lib/src/main/java/android/support/mediacompat/testlib/MediaControllerConstants.java
index 7bdd2fa..3041315 100644
--- a/media/version-compat-tests/lib/src/main/java/android/support/mediacompat/testlib/MediaControllerConstants.java
+++ b/media/version-compat-tests/lib/src/main/java/android/support/mediacompat/testlib/MediaControllerConstants.java
@@ -54,7 +54,6 @@
public static final int SET_CAPTIONING_ENABLED = 320;
public static final int SET_REPEAT_MODE = 321;
public static final int SET_SHUFFLE_MODE = 322;
- public static final int SET_PLAYBACK_SPEED = 323;
private MediaControllerConstants() {
}
diff --git a/media/version-compat-tests/lib/src/main/java/android/support/mediacompat/testlib/util/IntentUtil.java b/media/version-compat-tests/lib/src/main/java/android/support/mediacompat/testlib/util/IntentUtil.java
index 532b2a76..14ba14c 100644
--- a/media/version-compat-tests/lib/src/main/java/android/support/mediacompat/testlib/util/IntentUtil.java
+++ b/media/version-compat-tests/lib/src/main/java/android/support/mediacompat/testlib/util/IntentUtil.java
@@ -116,8 +116,6 @@
intent.putExtra(KEY_ARGUMENT, (long) arg);
} else if (arg instanceof Boolean) {
intent.putExtra(KEY_ARGUMENT, (boolean) arg);
- } else if (arg instanceof Float) {
- intent.putExtra(KEY_ARGUMENT, (float) arg);
} else if (arg instanceof Parcelable) {
intent.putExtra(KEY_ARGUMENT, (Parcelable) arg);
} else if (arg instanceof ArrayList<?>) {
diff --git a/media2-widget/api/1.0.0-alpha06.txt b/media2-widget/api/1.0.0-alpha06.txt
index a581557..a1e4576 100644
--- a/media2-widget/api/1.0.0-alpha06.txt
+++ b/media2-widget/api/1.0.0-alpha06.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.media2.widget {
public class MediaControlView extends android.view.ViewGroup {
diff --git a/media2-widget/api/1.0.0-alpha07.txt b/media2-widget/api/1.0.0-alpha07.txt
index d73f1c3..f1f22f0 100644
--- a/media2-widget/api/1.0.0-alpha07.txt
+++ b/media2-widget/api/1.0.0-alpha07.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.media2.widget {
public class MediaControlView extends android.view.ViewGroup {
@@ -6,7 +6,7 @@
ctor public MediaControlView(android.content.Context, android.util.AttributeSet?);
ctor public MediaControlView(android.content.Context, android.util.AttributeSet?, int);
method public void requestPlayButtonFocus();
- method public void setOnFullScreenListener(androidx.media2.widget.MediaControlView.OnFullScreenListener?);
+ method public void setOnFullScreenListener(androidx.media2.widget.MediaControlView.OnFullScreenListener);
method public void setSessionToken(androidx.media2.SessionToken);
}
diff --git a/media2-widget/api/1.0.0-alpha5.txt b/media2-widget/api/1.0.0-alpha5.txt
index 9ac0114..944dacb 100644
--- a/media2-widget/api/1.0.0-alpha5.txt
+++ b/media2-widget/api/1.0.0-alpha5.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.media2.widget {
@RequiresApi(21) public class MediaControlView extends android.view.ViewGroup {
diff --git a/media2-widget/api/current.txt b/media2-widget/api/current.txt
index d73f1c3..f1f22f0 100644
--- a/media2-widget/api/current.txt
+++ b/media2-widget/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.media2.widget {
public class MediaControlView extends android.view.ViewGroup {
@@ -6,7 +6,7 @@
ctor public MediaControlView(android.content.Context, android.util.AttributeSet?);
ctor public MediaControlView(android.content.Context, android.util.AttributeSet?, int);
method public void requestPlayButtonFocus();
- method public void setOnFullScreenListener(androidx.media2.widget.MediaControlView.OnFullScreenListener?);
+ method public void setOnFullScreenListener(androidx.media2.widget.MediaControlView.OnFullScreenListener);
method public void setSessionToken(androidx.media2.SessionToken);
}
diff --git a/media2-widget/api/restricted_1.0.0-alpha07.txt b/media2-widget/api/restricted_1.0.0-alpha07.txt
deleted file mode 100644
index c8f6e5b..0000000
--- a/media2-widget/api/restricted_1.0.0-alpha07.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-// Signature format: 3.0
-package androidx.media2.widget {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class RoutePlayer extends androidx.media2.RemoteSessionPlayer {
- ctor public RoutePlayer(android.content.Context!, androidx.mediarouter.media.MediaRouteSelector!, androidx.mediarouter.media.MediaRouter.RouteInfo!);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! addPlaylistItem(int, androidx.media2.MediaItem!);
- method public java.util.concurrent.Future<androidx.media2.SessionPlayer.PlayerResult>! adjustVolume(int);
- method public void close();
- method public androidx.media.AudioAttributesCompat! getAudioAttributes();
- method public long getBufferedPosition();
- method public int getBufferingState();
- method public androidx.media2.MediaItem! getCurrentMediaItem();
- method public int getCurrentMediaItemIndex();
- method public long getCurrentPosition();
- method public long getDuration();
- method public int getMaxVolume();
- method public int getNextMediaItemIndex();
- method public float getPlaybackSpeed();
- method public int getPlayerState();
- method public java.util.List<androidx.media2.MediaItem>! getPlaylist();
- method public androidx.media2.MediaMetadata! getPlaylistMetadata();
- method public int getPreviousMediaItemIndex();
- method public int getRepeatMode();
- method public int getShuffleMode();
- method public int getVolume();
- method public int getVolumeControlType();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! pause();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! play();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! prepare();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! removePlaylistItem(int);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! replacePlaylistItem(int, androidx.media2.MediaItem!);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! seekTo(long);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! setAudioAttributes(androidx.media.AudioAttributesCompat!);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! setMediaItem(androidx.media2.MediaItem!);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! setPlaybackSpeed(float);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! setPlaylist(java.util.List<androidx.media2.MediaItem>!, androidx.media2.MediaMetadata!);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! setRepeatMode(int);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! setShuffleMode(int);
- method public java.util.concurrent.Future<androidx.media2.SessionPlayer.PlayerResult>! setVolume(int);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! skipToNextPlaylistItem();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! skipToPlaylistItem(int);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! skipToPreviousPlaylistItem();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! updatePlaylistMetadata(androidx.media2.MediaMetadata!);
- }
-
- @IntDef({androidx.media2.widget.VideoView.VIEW_TYPE_TEXTUREVIEW, androidx.media2.widget.VideoView.VIEW_TYPE_SURFACEVIEW}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface VideoView.ViewType {
- }
-
-}
-
diff --git a/media2-widget/api/restricted_current.txt b/media2-widget/api/restricted_current.txt
deleted file mode 100644
index c8f6e5b..0000000
--- a/media2-widget/api/restricted_current.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-// Signature format: 3.0
-package androidx.media2.widget {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class RoutePlayer extends androidx.media2.RemoteSessionPlayer {
- ctor public RoutePlayer(android.content.Context!, androidx.mediarouter.media.MediaRouteSelector!, androidx.mediarouter.media.MediaRouter.RouteInfo!);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! addPlaylistItem(int, androidx.media2.MediaItem!);
- method public java.util.concurrent.Future<androidx.media2.SessionPlayer.PlayerResult>! adjustVolume(int);
- method public void close();
- method public androidx.media.AudioAttributesCompat! getAudioAttributes();
- method public long getBufferedPosition();
- method public int getBufferingState();
- method public androidx.media2.MediaItem! getCurrentMediaItem();
- method public int getCurrentMediaItemIndex();
- method public long getCurrentPosition();
- method public long getDuration();
- method public int getMaxVolume();
- method public int getNextMediaItemIndex();
- method public float getPlaybackSpeed();
- method public int getPlayerState();
- method public java.util.List<androidx.media2.MediaItem>! getPlaylist();
- method public androidx.media2.MediaMetadata! getPlaylistMetadata();
- method public int getPreviousMediaItemIndex();
- method public int getRepeatMode();
- method public int getShuffleMode();
- method public int getVolume();
- method public int getVolumeControlType();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! pause();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! play();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! prepare();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! removePlaylistItem(int);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! replacePlaylistItem(int, androidx.media2.MediaItem!);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! seekTo(long);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! setAudioAttributes(androidx.media.AudioAttributesCompat!);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! setMediaItem(androidx.media2.MediaItem!);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! setPlaybackSpeed(float);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! setPlaylist(java.util.List<androidx.media2.MediaItem>!, androidx.media2.MediaMetadata!);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! setRepeatMode(int);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! setShuffleMode(int);
- method public java.util.concurrent.Future<androidx.media2.SessionPlayer.PlayerResult>! setVolume(int);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! skipToNextPlaylistItem();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! skipToPlaylistItem(int);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! skipToPreviousPlaylistItem();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult>! updatePlaylistMetadata(androidx.media2.MediaMetadata!);
- }
-
- @IntDef({androidx.media2.widget.VideoView.VIEW_TYPE_TEXTUREVIEW, androidx.media2.widget.VideoView.VIEW_TYPE_SURFACEVIEW}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface VideoView.ViewType {
- }
-
-}
-
diff --git a/media2-widget/build.gradle b/media2-widget/build.gradle
index a26131a..be9e05c 100644
--- a/media2-widget/build.gradle
+++ b/media2-widget/build.gradle
@@ -25,8 +25,7 @@
dependencies {
api(project(":media2"))
api(project(":mediarouter"))
- // TODO: change to 1.1.0-alpha03 after release
- api(project(":appcompat"))
+ api("androidx.appcompat:appcompat:1.1.0-alpha01")
api("androidx.palette:palette:1.0.0")
implementation(project(":concurrent:concurrent-futures"))
diff --git a/media2-widget/src/androidTest/java/androidx/media2/widget/MediaControlViewTest.java b/media2-widget/src/androidTest/java/androidx/media2/widget/MediaControlViewTest.java
index e6acd7e..f6bd5cc 100644
--- a/media2-widget/src/androidTest/java/androidx/media2/widget/MediaControlViewTest.java
+++ b/media2-widget/src/androidTest/java/androidx/media2/widget/MediaControlViewTest.java
@@ -20,13 +20,8 @@
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
-import static androidx.test.espresso.assertion.ViewAssertions.matches;
-import static androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed;
-import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
-import static org.hamcrest.CoreMatchers.allOf;
-import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -150,7 +145,7 @@
}
});
assertTrue(latchForPausedState.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS));
- onView(allOf(withId(R.id.pause), isCompletelyDisplayed())).perform(click());
+ onView(withId(R.id.pause)).perform(click());
assertTrue(latchForPlayingState.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS));
}
@@ -183,7 +178,7 @@
}
});
assertTrue(latchForPausedState.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS));
- onView(allOf(withId(R.id.ffwd), isCompletelyDisplayed())).perform(click());
+ onView(withId(R.id.ffwd)).perform(click());
assertTrue(latchForFfwd.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS));
}
@@ -191,39 +186,34 @@
public void testRewButtonClick() throws Throwable {
final CountDownLatch latchForFfwd = new CountDownLatch(1);
final CountDownLatch latchForRew = new CountDownLatch(1);
- createController(new MediaController.ControllerCallback() {
- long mExpectedPosition = FFWD_MS;
- final long mDelta = 1000L;
+ final MediaController controller =
+ createController(new MediaController.ControllerCallback() {
+ long mExpectedPosition;
+ final long mDelta = 1000L;
+ @Override
+ public void onPlayerStateChanged(@NonNull MediaController controller,
+ int state) {
+ if (state == SessionPlayer.PLAYER_STATE_PAUSED) {
+ mExpectedPosition = FFWD_MS;
+ controller.seekTo(mExpectedPosition);
+ }
+ }
+ @Override
+ public void onSeekCompleted(@NonNull MediaController controller,
+ long position) {
+ assertTrue(equalsSeekPosition(mExpectedPosition, position, mDelta));
+ if (mExpectedPosition == FFWD_MS) {
+ mExpectedPosition = position - REW_MS;
+ latchForFfwd.countDown();
+ } else {
+ latchForRew.countDown();
+ }
+ }
- @Override
- public void onPlayerStateChanged(@NonNull MediaController controller,
- int state) {
- if (state == SessionPlayer.PLAYER_STATE_PAUSED) {
- mExpectedPosition = FFWD_MS;
- controller.seekTo(mExpectedPosition);
- }
- }
-
- @Override
- public void onSeekCompleted(@NonNull MediaController controller,
- long position) {
- // Ignore the initial seek. Internal MediaPlayer behavior can be changed.
- if (position == 0 && mExpectedPosition == FFWD_MS) {
- return;
- }
- assertTrue(equalsSeekPosition(mExpectedPosition, position, mDelta));
- if (mExpectedPosition == FFWD_MS) {
- mExpectedPosition = position - REW_MS;
- latchForFfwd.countDown();
- } else {
- latchForRew.countDown();
- }
- }
-
- private boolean equalsSeekPosition(long expected, long actual, long delta) {
- return (actual < expected + delta) && (actual > expected - delta);
- }
- });
+ private boolean equalsSeekPosition(long expected, long actual, long delta) {
+ return (actual < expected + delta) && (actual > expected - delta);
+ }
+ });
mActivityRule.runOnUiThread(new Runnable() {
@Override
public void run() {
@@ -231,7 +221,7 @@
}
});
assertTrue(latchForFfwd.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS));
- onView(allOf(withId(R.id.rew), isCompletelyDisplayed())).perform(click());
+ onView(withId(R.id.rew)).perform(click());
assertTrue(latchForRew.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS));
}
@@ -358,45 +348,6 @@
testCheckMediaItemIsFromNetwork(Uri.parse("file:///dummy.mp4"), false);
}
- @Test
- public void testFullScreenListener() throws Throwable {
- onView(withId(R.id.fullscreen)).check(matches(not(isDisplayed())));
-
- final CountDownLatch latchOn = new CountDownLatch(1);
- final CountDownLatch latchOff = new CountDownLatch(1);
-
- mActivityRule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- mVideoView.getMediaControlView().setOnFullScreenListener(
- new MediaControlView.OnFullScreenListener() {
- @Override
- public void onFullScreen(@NonNull View view, boolean fullScreen) {
- if (fullScreen) {
- latchOn.countDown();
- } else {
- latchOff.countDown();
- }
- }
- });
- }
- });
- onView(withId(R.id.fullscreen)).check(matches(isDisplayed()));
-
- onView(withId(R.id.fullscreen)).perform(click());
- assertTrue(latchOn.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS));
- onView(withId(R.id.fullscreen)).perform(click());
- assertTrue(latchOff.await(WAIT_TIME_MS, TimeUnit.MILLISECONDS));
-
- mActivityRule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- mVideoView.getMediaControlView().setOnFullScreenListener(null);
- }
- });
- onView(withId(R.id.fullscreen)).check(matches(not(isDisplayed())));
- }
-
private void testCheckMediaItemIsFromNetwork(Uri uri, boolean isNetwork) throws Throwable {
final MediaItem mediaItem = createTestMediaItem2(uri);
final CountDownLatch latch = new CountDownLatch(1);
diff --git a/media2-widget/src/androidTest/java/androidx/media2/widget/VideoViewTest.java b/media2-widget/src/androidTest/java/androidx/media2/widget/VideoViewTest.java
index a8d4819..612ebc8 100644
--- a/media2-widget/src/androidTest/java/androidx/media2/widget/VideoViewTest.java
+++ b/media2-widget/src/androidTest/java/androidx/media2/widget/VideoViewTest.java
@@ -252,23 +252,10 @@
verify(mControllerCallback, timeout(TIME_OUT).atLeastOnce()).onConnected(
any(MediaController.class), any(SessionCommandGroup.class));
- // TIME_OUT multiplied by the number of operations.
- verify(mControllerCallback, timeout(TIME_OUT * 5).atLeast(1)).onPlayerStateChanged(
+ verify(mControllerCallback, timeout(TIME_OUT).atLeast(1)).onPlayerStateChanged(
any(MediaController.class), eq(SessionPlayer.PLAYER_STATE_PAUSED));
+
assertEquals(mVideoView.getViewType(), mVideoView.VIEW_TYPE_SURFACEVIEW);
-
- mController.play();
- verify(mControllerCallback, timeout(TIME_OUT).atLeastOnce()).onPlayerStateChanged(
- any(MediaController.class), eq(SessionPlayer.PLAYER_STATE_PLAYING));
-
- mActivityRule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- mVideoView.setViewType(mVideoView.VIEW_TYPE_TEXTUREVIEW);
- }
- });
- verify(mockViewTypeListener, timeout(TIME_OUT))
- .onViewTypeChanged(mVideoView, VideoView.VIEW_TYPE_TEXTUREVIEW);
}
@Test
diff --git a/media2-widget/src/main/java/androidx/media2/widget/AnimatorUtil.java b/media2-widget/src/main/java/androidx/media2/widget/AnimatorUtil.java
deleted file mode 100644
index 7006220..0000000
--- a/media2-widget/src/main/java/androidx/media2/widget/AnimatorUtil.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2019 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.media2.widget;
-
-import android.animation.AnimatorSet;
-import android.animation.ObjectAnimator;
-import android.view.View;
-
-class AnimatorUtil {
-
- static ObjectAnimator ofTranslationY(float startValue, float endValue, View target) {
- return ObjectAnimator.ofFloat(target, "translationY", startValue, endValue);
- }
-
- static AnimatorSet ofTranslationYTogether(float startValue, float endValue, View[] targets) {
- AnimatorSet set = new AnimatorSet();
- if (targets.length == 0) return set;
- AnimatorSet.Builder builder = set.play(ofTranslationY(startValue, endValue, targets[0]));
- for (int i = 1; i < targets.length; i++) {
- builder.with(ofTranslationY(startValue, endValue, targets[i]));
- }
- return set;
- }
-}
diff --git a/media2-widget/src/main/java/androidx/media2/widget/BaseLayout.java b/media2-widget/src/main/java/androidx/media2/widget/BaseLayout.java
new file mode 100644
index 0000000..ad7ef35
--- /dev/null
+++ b/media2-widget/src/main/java/androidx/media2/widget/BaseLayout.java
@@ -0,0 +1,234 @@
+/*
+ * 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.media2.widget;
+
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.AttrRes;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+import androidx.annotation.StyleRes;
+
+import java.util.ArrayList;
+
+class BaseLayout extends ViewGroup {
+ private final ArrayList<View> mMatchParentChildren = new ArrayList<>(1);
+
+ BaseLayout(@NonNull Context context) {
+ super(context);
+ }
+
+ BaseLayout(@NonNull Context context, @Nullable AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ BaseLayout(@NonNull Context context, @Nullable AttributeSet attrs,
+ @AttrRes int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ }
+
+ @RequiresApi(21)
+ BaseLayout(@NonNull Context context, @Nullable AttributeSet attrs,
+ @AttrRes int defStyleAttr, @StyleRes int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+ }
+
+ @Override
+ protected boolean checkLayoutParams(LayoutParams p) {
+ return p instanceof MarginLayoutParams;
+ }
+
+ @Override
+ protected LayoutParams generateDefaultLayoutParams() {
+ return new MarginLayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
+ }
+
+ @Override
+ public LayoutParams generateLayoutParams(AttributeSet attrs) {
+ return new MarginLayoutParams(getContext(), attrs);
+ }
+
+ @Override
+ protected LayoutParams generateLayoutParams(LayoutParams lp) {
+ if (lp instanceof MarginLayoutParams) {
+ return lp;
+ }
+ return new MarginLayoutParams(lp);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int count = getChildCount();
+
+ final boolean measureMatchParentChildren =
+ MeasureSpec.getMode(widthMeasureSpec) != MeasureSpec.EXACTLY
+ || MeasureSpec.getMode(heightMeasureSpec) != MeasureSpec.EXACTLY;
+ mMatchParentChildren.clear();
+
+ int maxHeight = 0;
+ int maxWidth = 0;
+ int childState = 0;
+
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.getVisibility() != View.GONE) {
+ measureChildWithMargins(
+ child, widthMeasureSpec, 0, heightMeasureSpec, 0);
+ final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams();
+ maxWidth = Math.max(maxWidth,
+ child.getMeasuredWidth() + lp.leftMargin + lp.rightMargin);
+ maxHeight = Math.max(maxHeight,
+ child.getMeasuredHeight() + lp.topMargin + lp.bottomMargin);
+ childState = childState | child.getMeasuredState();
+ if (measureMatchParentChildren) {
+ if (lp.width == LayoutParams.MATCH_PARENT
+ || lp.height == LayoutParams.MATCH_PARENT) {
+ mMatchParentChildren.add(child);
+ }
+ }
+ }
+ }
+
+ // Account for padding too
+ maxWidth += getPaddingLeftWithForeground() + getPaddingRightWithForeground();
+ maxHeight += getPaddingTopWithForeground() + getPaddingBottomWithForeground();
+
+ // Check against our minimum height and width
+ maxHeight = Math.max(maxHeight, getSuggestedMinimumHeight());
+ maxWidth = Math.max(maxWidth, getSuggestedMinimumWidth());
+
+ if (Build.VERSION.SDK_INT >= 23) {
+ // Check against our foreground's minimum height and width
+ final Drawable drawable = getForeground();
+ if (drawable != null) {
+ maxHeight = Math.max(maxHeight, drawable.getMinimumHeight());
+ maxWidth = Math.max(maxWidth, drawable.getMinimumWidth());
+ }
+ }
+
+ setMeasuredDimension(
+ resolveSizeAndState(maxWidth, widthMeasureSpec, childState),
+ resolveSizeAndState(maxHeight, heightMeasureSpec,
+ childState << View.MEASURED_HEIGHT_STATE_SHIFT));
+
+ count = mMatchParentChildren.size();
+ if (count > 1) {
+ for (int i = 0; i < count; i++) {
+ final View child = mMatchParentChildren.get(i);
+ final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams();
+
+ final int childWidthMeasureSpec;
+ if (lp.width == LayoutParams.MATCH_PARENT) {
+ final int width = Math.max(0, getMeasuredWidth()
+ - getPaddingLeftWithForeground() - getPaddingRightWithForeground()
+ - lp.leftMargin - lp.rightMargin);
+ childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(
+ width, MeasureSpec.EXACTLY);
+ } else {
+ childWidthMeasureSpec = getChildMeasureSpec(widthMeasureSpec,
+ getPaddingLeftWithForeground() + getPaddingRightWithForeground()
+ + lp.leftMargin + lp.rightMargin, lp.width);
+ }
+
+ final int childHeightMeasureSpec;
+ if (lp.height == LayoutParams.MATCH_PARENT) {
+ final int height = Math.max(0, getMeasuredHeight()
+ - getPaddingTopWithForeground() - getPaddingBottomWithForeground()
+ - lp.topMargin - lp.bottomMargin);
+ childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(
+ height, MeasureSpec.EXACTLY);
+ } else {
+ childHeightMeasureSpec = getChildMeasureSpec(heightMeasureSpec,
+ getPaddingTopWithForeground() + getPaddingBottomWithForeground()
+ + lp.topMargin + lp.bottomMargin, lp.height);
+ }
+
+ child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
+ }
+ }
+ }
+
+ @Override
+ protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ final int count = getChildCount();
+
+ final int parentLeft = getPaddingLeftWithForeground();
+ final int parentRight = right - left - getPaddingRightWithForeground();
+
+ final int parentTop = getPaddingTopWithForeground();
+ final int parentBottom = bottom - top - getPaddingBottomWithForeground();
+
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.getVisibility() != View.GONE) {
+ final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams();
+
+ final int width = child.getMeasuredWidth();
+ final int height = child.getMeasuredHeight();
+
+ int childLeft;
+ int childTop;
+
+ childLeft = parentLeft + (parentRight - parentLeft - width) / 2
+ + lp.leftMargin - lp.rightMargin;
+
+ childTop = parentTop + (parentBottom - parentTop - height) / 2
+ + lp.topMargin - lp.bottomMargin;
+
+ child.layout(childLeft, childTop, childLeft + width, childTop + height);
+ }
+ }
+ }
+
+ @Override
+ public boolean shouldDelayChildPressedState() {
+ return false;
+ }
+
+ private int getPaddingLeftWithForeground() {
+ return isForegroundInsidePadding() ? Math.max(getPaddingLeft(), 0) :
+ getPaddingLeft() + 0;
+ }
+
+ private int getPaddingRightWithForeground() {
+ return isForegroundInsidePadding() ? Math.max(getPaddingRight(), 0) :
+ getPaddingRight() + 0;
+ }
+
+ private int getPaddingTopWithForeground() {
+ return isForegroundInsidePadding() ? Math.max(getPaddingTop(), 0) :
+ getPaddingTop() + 0;
+ }
+
+ private int getPaddingBottomWithForeground() {
+ return isForegroundInsidePadding() ? Math.max(getPaddingBottom(), 0) :
+ getPaddingBottom() + 0;
+ }
+
+ // A stub method for View's isForegroundInsidePadding() which is hidden.
+ // Always returns true for now, since the default value is true.
+ // See View's isForegroundInsidePadding method.
+ private boolean isForegroundInsidePadding() {
+ return true;
+ }
+}
diff --git a/media2-widget/src/main/java/androidx/media2/widget/MediaControlView.java b/media2-widget/src/main/java/androidx/media2/widget/MediaControlView.java
index 853e0fd..59ef270 100644
--- a/media2-widget/src/main/java/androidx/media2/widget/MediaControlView.java
+++ b/media2-widget/src/main/java/androidx/media2/widget/MediaControlView.java
@@ -22,33 +22,40 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
+import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.DialogInterface;
+import android.content.pm.ActivityInfo;
import android.content.res.Resources;
+import android.graphics.Point;
+import android.graphics.drawable.ScaleDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.util.AttributeSet;
+import android.util.DisplayMetrics;
import android.util.Log;
-import android.util.SparseArray;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
+import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.LinearInterpolator;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageButton;
import android.widget.ImageView;
+import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
+import android.widget.ProgressBar;
+import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
-import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
@@ -79,7 +86,7 @@
* A View that contains the controls for {@link MediaPlayer}.
* It provides a wide range of buttons that serve the following functions: play/pause,
* rewind/fast-forward, skip to next/previous, select subtitle track, enter/exit full screen mode,
- * select audio track, and adjust playback speed.
+ * adjust video quality, select audio track, and adjust playback speed.
* <p>
* The easiest way to use a MediaControlView is by creating a {@link VideoView}, which will
* internally create a MediaControlView instance and handle all the commands from buttons inside
@@ -103,7 +110,7 @@
* 2) Set full screen behavior by calling {@link #setOnFullScreenListener(OnFullScreenListener)}
*
*/
-public class MediaControlView extends ViewGroup {
+public class MediaControlView extends BaseLayout {
private static final String TAG = "MediaControlView";
static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
@@ -129,13 +136,17 @@
private static final int SETTINGS_MODE_AUDIO_TRACK = 0;
private static final int SETTINGS_MODE_PLAYBACK_SPEED = 1;
private static final int SETTINGS_MODE_SUBTITLE_TRACK = 2;
- private static final int SETTINGS_MODE_MAIN = 3;
+ private static final int SETTINGS_MODE_VIDEO_QUALITY = 3;
+ private static final int SETTINGS_MODE_MAIN = 4;
private static final int PLAYBACK_SPEED_1x_INDEX = 3;
private static final int MEDIA_TYPE_DEFAULT = 0;
private static final int MEDIA_TYPE_MUSIC = 1;
+ private static final int MEDIA_TYPE_ADVERTISEMENT = 2;
- private static final int SIZE_TYPE_UNDEFINED = -1;
+ private static final int BOTTOM_BAR_RIGHT_VIEW_MAX_ICON_NUM_DEFAULT = 3;
+ private static final int BOTTOM_BAR_RIGHT_VIEW_MAX_ICON_NUM_MUSIC = 2;
+
private static final int SIZE_TYPE_EMBEDDED = 0;
private static final int SIZE_TYPE_FULL = 1;
private static final int SIZE_TYPE_MINIMAL = 2;
@@ -150,8 +161,7 @@
// Int for defining the UX state where the views are being animated (shown or hidden).
private static final int UX_STATE_ANIMATING = 3;
- private static final long DISABLE_DELAYED_ANIMATION = -1;
- private static final long DEFAULT_DELAYED_ANIMATION_INTERVAL_MS = 2000;
+ private static final long DEFAULT_SHOW_CONTROLLER_INTERVAL_MS = 2000;
private static final long DEFAULT_PROGRESS_UPDATE_TIME_MS = 1000;
private static final long REWIND_TIME_MS = 10000;
private static final long FORWARD_TIME_MS = 30000;
@@ -168,22 +178,30 @@
Controller mController;
OnFullScreenListener mOnFullScreenListener;
private AccessibilityManager mAccessibilityManager;
+ private WindowManager mWindowManager;
+ private int mPrevWidth;
+ private int mPrevOrientation;
+ private int mOriginalLeftBarWidth;
+ private int mMaxTimeViewWidth;
private int mEmbeddedSettingsItemWidth;
private int mFullSettingsItemWidth;
private int mSettingsItemHeight;
private int mSettingsWindowMargin;
+ private int mIconSize;
int mVideoTrackCount;
int mAudioTrackCount;
int mSubtitleTrackCount;
int mSettingsMode;
int mSelectedSubtitleTrackIndex;
int mSelectedAudioTrackIndex;
+ int mSelectedVideoQualityIndex;
int mSelectedSpeedIndex;
int mMediaType;
- int mSizeType = SIZE_TYPE_UNDEFINED;
+ int mSizeType;
int mUxState;
long mDuration;
- long mDelayedAnimationIntervalMs;
+ long mPlaybackActions;
+ long mShowControllerIntervalMs;
long mCurrentSeekPosition;
long mNextSeekPosition;
boolean mDragging;
@@ -195,33 +213,38 @@
boolean mNeedToHideBars;
boolean mWasPlaying;
- private SparseArray<View> mTransportControlsMap = new SparseArray<>();
-
// Relating to Title Bar View
+ private ViewGroup mRoot;
private View mTitleBar;
private TextView mTitleView;
private View mAdExternalLink;
private MediaRouteButton mRouteButton;
+ private MediaRouteSelector mRouteSelector;
// Relating to Center View
- ViewGroup mCenterView;
- private View mEmbeddedTransportControls;
- private View mMinimalTransportControls;
+ private ViewGroup mCenterView;
+ View mTransportControls;
+ ImageButton mPlayPauseButton;
+ ImageButton mFfwdButton;
+ ImageButton mRewButton;
+ // TODO: Disable Next/Previous buttons when the current item does not have a next/previous
+ // item in the playlist. (b/119159436)
+ private ImageButton mNextButton;
+ private ImageButton mPrevButton;
- // Relating to Minimal Fullscreen View
- ViewGroup mMinimalFullScreenView;
- ImageButton mMinimalFullScreenButton;
+ // Relating to Minimal Size Fullscreen View
+ private LinearLayout mMinimalSizeFullScreenView;
// Relating to Progress Bar View
- private ViewGroup mProgressBar;
- SeekBar mProgress;
+ View mProgressBar;
+ ProgressBar mProgress;
+ private View mProgressBuffer;
// Relating to Bottom Bar View
- private View mBottomBarBackground;
+ private ViewGroup mBottomBar;
// Relating to Bottom Bar Left View
- private ViewGroup mBottomBarLeft;
- private View mFullTransportControls;
+ private ViewGroup mBottomBarLeftView;
private ViewGroup mTimeView;
private TextView mEndTime;
TextView mCurrentTime;
@@ -230,11 +253,16 @@
private Formatter mFormatter;
// Relating to Bottom Bar Right View
+ private ViewGroup mBottomBarRightView;
ViewGroup mBasicControls;
ViewGroup mExtraControls;
ViewGroup mCustomButtons;
ImageButton mSubtitleButton;
ImageButton mFullScreenButton;
+ ImageButton mOverflowShowButton;
+ ImageButton mOverflowHideButton;
+ private ImageButton mVideoQualityButton;
+ private ImageButton mSettingsButton;
private TextView mAdRemainingView;
// Relating to Settings List View
@@ -247,6 +275,7 @@
private List<Integer> mSettingsIconIdsList;
List<String> mSubtitleDescriptionsList;
List<String> mAudioTrackList;
+ List<String> mVideoQualityList;
List<String> mPlaybackSpeedTextList;
List<Integer> mPlaybackSpeedMultBy100List;
int mCustomPlaybackSpeedIndex;
@@ -273,9 +302,10 @@
mResources = context.getResources();
mController = new Controller();
- inflate(context, R.layout.media_controller, this);
- initControllerView();
- mDelayedAnimationIntervalMs = DEFAULT_DELAYED_ANIMATION_INTERVAL_MS;
+ // Inflate MediaControlView from XML
+ mRoot = makeControllerView();
+ addView(mRoot);
+ mShowControllerIntervalMs = DEFAULT_SHOW_CONTROLLER_INTERVAL_MS;
mAccessibilityManager = (AccessibilityManager) context.getSystemService(
Context.ACCESSIBILITY_SERVICE);
}
@@ -292,29 +322,21 @@
}
/**
- * Sets a listener to be called when the fullscreen mode should be changed.
- * A non-null listener needs to be set in order to display the fullscreen button.
- *
- * @param listener The listener to be called. A value of <code>null</code> removes any
- * existing listener and hides the fullscreen button.
+ * Registers a callback to be invoked when the fullscreen mode should be changed.
+ * This needs to be implemented in order to display the fullscreen button.
+ * @param l The callback that will be run
*/
- public void setOnFullScreenListener(@Nullable OnFullScreenListener listener) {
- if (listener == null) {
- mOnFullScreenListener = null;
- mFullScreenButton.setVisibility(View.GONE);
- } else {
- mOnFullScreenListener = listener;
- mFullScreenButton.setVisibility(View.VISIBLE);
- }
+ public void setOnFullScreenListener(@NonNull OnFullScreenListener l) {
+ mOnFullScreenListener = l;
+ mFullScreenButton.setVisibility(View.VISIBLE);
}
/**
* Requests focus for the play/pause button.
*/
public void requestPlayButtonFocus() {
- ImageButton button = findControlButton(mSizeType, R.id.pause);
- if (button != null) {
- button.requestFocus();
+ if (mPlayPauseButton != null) {
+ mPlayPauseButton.requestFocus();
}
}
@@ -331,19 +353,14 @@
@Override
public CharSequence getAccessibilityClassName() {
- // Class name may be obfuscated by Proguard. Hardcode the string for accessibility usage.
- return "androidx.media2.widget.MediaControlView";
+ return MediaControlView.class.getName();
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_UP) {
if (mMediaType != MEDIA_TYPE_MUSIC || mSizeType != SIZE_TYPE_FULL) {
- if (mUxState == UX_STATE_ALL_VISIBLE) {
- hideMediaControlView();
- } else {
- showMediaControlView();
- }
+ toggleMediaControlViewVisibility();
}
}
return true;
@@ -353,11 +370,7 @@
public boolean onTrackballEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_UP) {
if (mMediaType != MEDIA_TYPE_MUSIC || mSizeType != SIZE_TYPE_FULL) {
- if (mUxState == UX_STATE_ALL_VISIBLE) {
- hideMediaControlView();
- } else {
- showMediaControlView();
- }
+ toggleMediaControlViewVisibility();
}
}
return true;
@@ -365,161 +378,89 @@
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- final int width = resolveSize(getSuggestedMinimumWidth(), widthMeasureSpec);
- final int height = resolveSize(getSuggestedMinimumHeight(), heightMeasureSpec);
-
- int childWidth = width - getPaddingLeft() - getPaddingRight();
- int childHeight = height - getPaddingTop() - getPaddingBottom();
- int childState = 0;
-
- if (childWidth < 0) {
- childWidth = 0;
- childState |= View.MEASURED_STATE_TOO_SMALL;
- }
- if (childHeight < 0) {
- childHeight = 0;
- childState |= (View.MEASURED_STATE_TOO_SMALL >> View.MEASURED_HEIGHT_STATE_SHIFT);
- }
-
- final int count = getChildCount();
- for (int i = 0; i < count; i++) {
- final View child = getChildAt(i);
- if (child.getVisibility() == View.GONE) {
- continue;
- }
- LayoutParams lp = child.getLayoutParams();
-
- int childWidthSpec;
- if (lp.width == LayoutParams.MATCH_PARENT) {
- childWidthSpec = MeasureSpec.makeMeasureSpec(childWidth, MeasureSpec.EXACTLY);
- } else if (lp.width == LayoutParams.WRAP_CONTENT) {
- childWidthSpec = MeasureSpec.makeMeasureSpec(childWidth, MeasureSpec.UNSPECIFIED);
- } else {
- childWidthSpec = MeasureSpec.makeMeasureSpec(lp.width, MeasureSpec.EXACTLY);
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+ // Update layout when this view's width changes in order to avoid any UI overlap between
+ // transport controls.
+ if (mPrevWidth != getMeasuredWidth()) {
+ // The following view may not have been initialized yet.
+ if (mTimeView.getWidth() == 0) {
+ return;
}
- int childHeightSpec;
- if (lp.height == LayoutParams.MATCH_PARENT) {
- childHeightSpec = MeasureSpec.makeMeasureSpec(childHeight, MeasureSpec.EXACTLY);
- } else if (lp.height == LayoutParams.WRAP_CONTENT) {
- childHeightSpec = MeasureSpec.makeMeasureSpec(childHeight, MeasureSpec.UNSPECIFIED);
- } else {
- childHeightSpec = MeasureSpec.makeMeasureSpec(lp.height, MeasureSpec.EXACTLY);
+ // Update layout if necessary
+ int currWidth = getMeasuredWidth();
+ int currHeight = getMeasuredHeight();
+ Point screenSize = new Point();
+ mWindowManager.getDefaultDisplay().getSize(screenSize);
+ if (mMediaType == MEDIA_TYPE_DEFAULT) {
+ updateLayout(BOTTOM_BAR_RIGHT_VIEW_MAX_ICON_NUM_DEFAULT, currWidth,
+ currHeight, screenSize.x, screenSize.y);
+ } else if (mMediaType == MEDIA_TYPE_MUSIC) {
+ updateLayout(BOTTOM_BAR_RIGHT_VIEW_MAX_ICON_NUM_MUSIC, currWidth,
+ currHeight, screenSize.x, screenSize.y);
}
+ mPrevWidth = currWidth;
- child.measure(childWidthSpec, childHeightSpec);
- childState |= child.getMeasuredState();
+ // By default, show all bars and hide settings window and overflow view when view size
+ // is changed.
+ showAllBars();
+ hideSettingsAndOverflow();
}
- setMeasuredDimension(
- resolveSizeAndState(width, widthMeasureSpec, childState),
- resolveSizeAndState(height, heightMeasureSpec,
- childState << View.MEASURED_HEIGHT_STATE_SHIFT));
+ // By default, show all bars and hide settings window and overflow view when view
+ // orientation is changed.
+ int currOrientation = retrieveOrientation();
+ if (currOrientation != mPrevOrientation) {
+ showAllBars();
+ hideSettingsAndOverflow();
+ mPrevOrientation = currOrientation;
+ }
}
@Override
- protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
- final int width = right - left - getPaddingLeft() - getPaddingRight();
- final int height = bottom - top - getPaddingTop() - getPaddingBottom();
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
- final int fullWidth = mBottomBarLeft.getMeasuredWidth()
- + mTimeView.getMeasuredWidth()
- + mBasicControls.getMeasuredWidth();
- final int fullHeight = mTitleBar.getMeasuredHeight()
- + mProgressBar.getMeasuredHeight()
- + mBottomBarBackground.getMeasuredHeight();
-
- final int embeddedWidth = mTimeView.getMeasuredWidth()
- + mBasicControls.getMeasuredWidth();
- final int embeddedHeight = mTitleBar.getMeasuredHeight()
- + mEmbeddedTransportControls.getMeasuredHeight()
- + mProgressBar.getMeasuredHeight()
- + mBottomBarBackground.getMeasuredHeight();
-
- int sizeType;
- if (mIsAdvertisement || (fullWidth <= width && fullHeight <= height)) {
- sizeType = SIZE_TYPE_FULL;
- } else if (embeddedWidth <= width && embeddedHeight <= height) {
- sizeType = SIZE_TYPE_EMBEDDED;
- } else {
- sizeType = SIZE_TYPE_MINIMAL;
+ if (mPlayPauseButton != null) {
+ mPlayPauseButton.setEnabled(enabled);
}
-
- if (mSizeType != sizeType) {
- mSizeType = sizeType;
- updateLayoutForSizeChange(sizeType);
+ if (mFfwdButton != null) {
+ mFfwdButton.setEnabled(enabled);
}
-
- mTitleBar.setVisibility(
- sizeType != SIZE_TYPE_MINIMAL ? View.VISIBLE : View.INVISIBLE);
- mEmbeddedTransportControls.setVisibility(
- sizeType == SIZE_TYPE_EMBEDDED ? View.VISIBLE : View.INVISIBLE);
- mMinimalTransportControls.setVisibility(
- sizeType == SIZE_TYPE_MINIMAL ? View.VISIBLE : View.INVISIBLE);
- mBottomBarBackground.setVisibility(
- sizeType != SIZE_TYPE_MINIMAL ? View.VISIBLE : View.INVISIBLE);
- mBottomBarLeft.setVisibility(
- sizeType == SIZE_TYPE_FULL ? View.VISIBLE : View.INVISIBLE);
- mTimeView.setVisibility(
- sizeType != SIZE_TYPE_MINIMAL ? View.VISIBLE : View.INVISIBLE);
- mBasicControls.setVisibility(
- sizeType != SIZE_TYPE_MINIMAL ? View.VISIBLE : View.INVISIBLE);
- mMinimalFullScreenButton.setVisibility(
- sizeType == SIZE_TYPE_MINIMAL ? View.VISIBLE : View.INVISIBLE);
- mCenterView.setVisibility(
- sizeType != SIZE_TYPE_FULL ? View.VISIBLE : View.INVISIBLE);
-
- final int childLeft = getPaddingLeft();
- final int childRight = childLeft + width;
- final int childTop = getPaddingTop();
- final int childBottom = childTop + height;
-
- layoutChild(mTitleBar,
- childLeft,
- childTop);
- layoutChild(mCenterView,
- childLeft,
- childTop);
- layoutChild(mBottomBarBackground,
- childLeft,
- childBottom - mBottomBarBackground.getMeasuredHeight());
- layoutChild(mBottomBarLeft,
- childLeft,
- childBottom - mBottomBarLeft.getMeasuredHeight());
- layoutChild(mTimeView,
- sizeType == SIZE_TYPE_FULL
- ? childRight - mBasicControls.getMeasuredWidth()
- - mTimeView.getMeasuredWidth()
- : childLeft,
- childBottom - mTimeView.getMeasuredHeight());
- layoutChild(mBasicControls,
- childRight - mBasicControls.getMeasuredWidth(),
- childBottom - mBasicControls.getMeasuredHeight());
- layoutChild(mExtraControls,
- childRight,
- childBottom - mExtraControls.getMeasuredHeight());
- layoutChild(mProgressBar,
- childLeft,
- sizeType == SIZE_TYPE_MINIMAL
- ? childBottom - mProgressBar.getMeasuredHeight()
- : childBottom - mProgressBar.getMeasuredHeight()
- - mResources.getDimensionPixelSize(
- R.dimen.mcv2_custom_progress_margin_bottom));
- layoutChild(mMinimalFullScreenView,
- childLeft,
- childBottom - mMinimalFullScreenView.getMeasuredHeight());
- }
-
- private void layoutChild(View child, int left, int top) {
- child.layout(left, top, left + child.getMeasuredWidth(), top + child.getMeasuredHeight());
- }
-
- @Override
- protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- // By default, show all bars and hide settings window and overflow view when view size is
- // changed.
- showAllBars();
- hideSettingsAndOverflow();
+ if (mRewButton != null) {
+ mRewButton.setEnabled(enabled);
+ }
+ if (mNextButton != null) {
+ mNextButton.setEnabled(enabled);
+ }
+ if (mPrevButton != null) {
+ mPrevButton.setEnabled(enabled);
+ }
+ if (mProgress != null) {
+ mProgress.setEnabled(enabled);
+ }
+ if (mSubtitleButton != null) {
+ mSubtitleButton.setEnabled(enabled);
+ }
+ if (mFullScreenButton != null) {
+ mFullScreenButton.setEnabled(enabled);
+ }
+ if (mOverflowShowButton != null) {
+ mOverflowShowButton.setEnabled(enabled);
+ }
+ if (mOverflowHideButton != null) {
+ mOverflowHideButton.setEnabled(enabled);
+ }
+ if (mVideoQualityButton != null) {
+ mVideoQualityButton.setEnabled(enabled);
+ }
+ if (mSettingsButton != null) {
+ mSettingsButton.setEnabled(enabled);
+ }
+ if (mRouteButton != null) {
+ mRouteButton.setEnabled(enabled);
+ }
+ disableUnsupportedButtons();
}
@Override
@@ -527,6 +468,7 @@
super.onVisibilityAggregated(isVisible);
if (isVisible) {
+ disableUnsupportedButtons();
removeCallbacks(mUpdateProgress);
post(mUpdateProgress);
} else {
@@ -535,7 +477,8 @@
}
void setRouteSelector(MediaRouteSelector selector) {
- if (selector != null && !selector.isEmpty()) {
+ mRouteSelector = selector;
+ if (mRouteSelector != null && !mRouteSelector.isEmpty()) {
mRouteButton.setRouteSelector(selector);
mRouteButton.setVisibility(View.VISIBLE);
} else {
@@ -544,73 +487,118 @@
}
}
- void setDelayedAnimationInterval(long interval) {
- mDelayedAnimationIntervalMs = interval;
+ void setShowControllerInterval(long interval) {
+ mShowControllerIntervalMs = interval;
}
///////////////////////////////////////////////////
// Protected or private methods
///////////////////////////////////////////////////
+ /**
+ * Create the view that holds the widgets that control playback.
+ * Derived classes can override this to create their own.
+ *
+ * @return The controller view.
+ */
+ private ViewGroup makeControllerView() {
+ ViewGroup root = (ViewGroup) inflateLayout(getContext(), R.layout.media_controller);
+ initControllerView(root);
+ return root;
+ }
+
static View inflateLayout(Context context, int resId) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
return inflater.inflate(resId, null);
}
- private void initControllerView() {
+ @SuppressWarnings("deprecation")
+ private void initControllerView(ViewGroup v) {
+ mWindowManager = (WindowManager) getContext().getApplicationContext()
+ .getSystemService(Context.WINDOW_SERVICE);
+ mIconSize = mResources.getDimensionPixelSize(R.dimen.mcv2_icon_size);
+
// Relating to Title Bar View
- mTitleBar = findViewById(R.id.title_bar);
- mTitleView = findViewById(R.id.title_text);
- mAdExternalLink = findViewById(R.id.ad_external_link);
- mRouteButton = findViewById(R.id.cast);
+ mTitleBar = v.findViewById(R.id.title_bar);
+ mTitleView = v.findViewById(R.id.title_text);
+ mAdExternalLink = v.findViewById(R.id.ad_external_link);
+ mRouteButton = v.findViewById(R.id.cast);
// Relating to Center View
- mCenterView = findViewById(R.id.center_view);
- mEmbeddedTransportControls = initTransportControls(R.id.embedded_transport_controls);
- mMinimalTransportControls = initTransportControls(R.id.minimal_transport_controls);
+ mCenterView = v.findViewById(R.id.center_view);
+ mTransportControls = inflateTransportControls(R.layout.embedded_transport_controls);
+ mCenterView.addView(mTransportControls);
- // Relating to Minimal Size FullScreen View
- mMinimalFullScreenView = findViewById(R.id.minimal_fullscreen_view);
- mMinimalFullScreenButton = findViewById(R.id.minimal_fullscreen);
- mMinimalFullScreenButton.setOnClickListener(mFullScreenListener);
+ // Relating to Minimal Size FullScreen View. This view is visible only when the current
+ // size type is Minimal and it is a view that stretches from left to right end
+ // and helps locate the fullscreen button at the right end of the screen.
+ mMinimalSizeFullScreenView = (LinearLayout) v.findViewById(R.id.minimal_fullscreen_view);
+ LinearLayout.LayoutParams params =
+ (LinearLayout.LayoutParams) mMinimalSizeFullScreenView.getLayoutParams();
+ int iconSize = mResources.getDimensionPixelSize(R.dimen.mcv2_icon_size);
+ params.setMargins(0, iconSize * (-1), 0, 0);
+ mMinimalSizeFullScreenView.setLayoutParams(params);
+ mMinimalSizeFullScreenView.setVisibility(View.GONE);
// Relating to Progress Bar View
- mProgressBar = findViewById(R.id.progress_bar);
- mProgress = findViewById(R.id.progress);
- mProgress.setOnSeekBarChangeListener(mSeekListener);
- mProgress.setMax(MAX_PROGRESS);
+ mProgressBar = v.findViewById(R.id.progress_bar);
+ mProgress = v.findViewById(R.id.progress);
+ if (mProgress != null) {
+ if (mProgress instanceof SeekBar) {
+ SeekBar seeker = (SeekBar) mProgress;
+ seeker.setOnSeekBarChangeListener(mSeekListener);
+ seeker.setProgressDrawable(mResources.getDrawable(R.drawable.custom_progress));
+ seeker.setThumb(mResources.getDrawable(R.drawable.custom_progress_thumb));
+ seeker.setThumbOffset(0);
+ }
+ mProgress.setMax(MAX_PROGRESS);
+ }
+ mProgressBuffer = v.findViewById(R.id.progress_buffer);
mCurrentSeekPosition = SEEK_POSITION_NOT_SET;
mNextSeekPosition = SEEK_POSITION_NOT_SET;
// Relating to Bottom Bar View
- mBottomBarBackground = findViewById(R.id.bottom_bar_background);
+ mBottomBar = v.findViewById(R.id.bottom_bar);
// Relating to Bottom Bar Left View
- mBottomBarLeft = findViewById(R.id.bottom_bar_left);
- mFullTransportControls = initTransportControls(R.id.full_transport_controls);
- mTimeView = findViewById(R.id.time);
- mEndTime = findViewById(R.id.time_end);
- mCurrentTime = findViewById(R.id.time_current);
- mAdSkipView = findViewById(R.id.ad_skip_time);
+ mBottomBarLeftView = v.findViewById(R.id.bottom_bar_left);
+ mTimeView = v.findViewById(R.id.time);
+ mEndTime = v.findViewById(R.id.time_end);
+ mCurrentTime = v.findViewById(R.id.time_current);
+ mAdSkipView = v.findViewById(R.id.ad_skip_time);
mFormatBuilder = new StringBuilder();
mFormatter = new Formatter(mFormatBuilder, Locale.getDefault());
// Relating to Bottom Bar Right View
- mBasicControls = findViewById(R.id.basic_controls);
- mExtraControls = findViewById(R.id.extra_controls);
- mCustomButtons = findViewById(R.id.custom_buttons);
- mSubtitleButton = findViewById(R.id.subtitle);
- mSubtitleButton.setOnClickListener(mSubtitleListener);
- mFullScreenButton = findViewById(R.id.fullscreen);
- mFullScreenButton.setOnClickListener(mFullScreenListener);
- ImageButton overflowShowButton = findViewById(R.id.overflow_show);
- overflowShowButton.setOnClickListener(mOverflowShowListener);
- ImageButton overflowHideButton = findViewById(R.id.overflow_hide);
- overflowHideButton.setOnClickListener(mOverflowHideListener);
- ImageButton settingsButton = findViewById(R.id.settings);
- settingsButton.setOnClickListener(mSettingsButtonListener);
- mAdRemainingView = findViewById(R.id.ad_remaining);
+ mBasicControls = v.findViewById(R.id.basic_controls);
+ mExtraControls = v.findViewById(R.id.extra_controls);
+ mCustomButtons = v.findViewById(R.id.custom_buttons);
+ mSubtitleButton = v.findViewById(R.id.subtitle);
+ if (mSubtitleButton != null) {
+ mSubtitleButton.setOnClickListener(mSubtitleListener);
+ }
+ mFullScreenButton = v.findViewById(R.id.fullscreen);
+ if (mFullScreenButton != null) {
+ mFullScreenButton.setOnClickListener(mFullScreenListener);
+ }
+ mOverflowShowButton = v.findViewById(R.id.overflow_show);
+ if (mOverflowShowButton != null) {
+ mOverflowShowButton.setOnClickListener(mOverflowShowListener);
+ }
+ mOverflowHideButton = v.findViewById(R.id.overflow_hide);
+ if (mOverflowHideButton != null) {
+ mOverflowHideButton.setOnClickListener(mOverflowHideListener);
+ }
+ mSettingsButton = v.findViewById(R.id.settings);
+ if (mSettingsButton != null) {
+ mSettingsButton.setOnClickListener(mSettingsButtonListener);
+ }
+ mVideoQualityButton = v.findViewById(R.id.video_quality);
+ if (mVideoQualityButton != null) {
+ mVideoQualityButton.setOnClickListener(mVideoQualityListener);
+ }
+ mAdRemainingView = v.findViewById(R.id.ad_remaining);
// Relating to Settings List View
initializeSettingsLists();
@@ -622,11 +610,6 @@
mSettingsListView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
mSettingsListView.setOnItemClickListener(mSettingsItemClickListener);
- // TransportControlsMap
- mTransportControlsMap.append(SIZE_TYPE_EMBEDDED, mEmbeddedTransportControls);
- mTransportControlsMap.append(SIZE_TYPE_FULL, mFullTransportControls);
- mTransportControlsMap.append(SIZE_TYPE_MINIMAL, mMinimalTransportControls);
-
mEmbeddedSettingsItemWidth = mResources.getDimensionPixelSize(
R.dimen.mcv2_embedded_settings_width);
mFullSettingsItemWidth = mResources.getDimensionPixelSize(R.dimen.mcv2_full_settings_width);
@@ -638,12 +621,14 @@
LayoutParams.WRAP_CONTENT, true);
mSettingsWindow.setOnDismissListener(mSettingsDismissListener);
- float titleBarHeight = mResources.getDimension(R.dimen.mcv2_title_bar_height);
- float progressBarHeight = mResources.getDimension(R.dimen.mcv2_custom_progress_thumb_size);
+ int titleBarTranslateY =
+ (-1) * mResources.getDimensionPixelSize(R.dimen.mcv2_title_bar_height);
float bottomBarHeight = mResources.getDimension(R.dimen.mcv2_bottom_bar_height);
-
- View[] bottomBarGroup = { mBottomBarBackground, mBottomBarLeft, mTimeView, mBasicControls,
- mExtraControls, mProgressBar };
+ float progressThumbHeight = mResources.getDimension(
+ R.dimen.mcv2_custom_progress_thumb_size);
+ float progressBarHeight = mResources.getDimension(R.dimen.mcv2_custom_progress_max_size);
+ float bottomBarTranslateY = (float) Math.ceil(bottomBarHeight + progressThumbHeight / 2
+ - progressBarHeight / 2);
ValueAnimator fadeOutAnimator = ValueAnimator.ofFloat(1.0f, 0.0f);
fadeOutAnimator.setInterpolator(new LinearInterpolator());
@@ -651,18 +636,30 @@
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float alpha = (float) animation.getAnimatedValue();
- int scaleLevel = mSizeType == SIZE_TYPE_MINIMAL ? 0 : MAX_SCALE_LEVEL;
- mProgress.getThumb().setLevel((int) (scaleLevel * alpha));
+ SeekBar seekBar = (SeekBar) mProgress;
+ if (mSizeType != SIZE_TYPE_MINIMAL) {
+ ScaleDrawable thumb = (ScaleDrawable) seekBar.getThumb();
+ if (thumb != null) {
+ thumb.setLevel((int) (MAX_SCALE_LEVEL * alpha));
+ }
+ }
- mCenterView.setAlpha(alpha);
- mMinimalFullScreenView.setAlpha(alpha);
- }
- });
- fadeOutAnimator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mCenterView.setVisibility(View.INVISIBLE);
- mMinimalFullScreenView.setVisibility(View.INVISIBLE);
+ mTransportControls.setAlpha(alpha);
+ if (alpha == 0.0f) {
+ mTransportControls.setVisibility(View.GONE);
+ } else if (alpha == 1.0f) {
+ setEnabled(false);
+ }
+ if (mSizeType == SIZE_TYPE_MINIMAL) {
+ mFullScreenButton.setAlpha(alpha);
+ mProgressBar.setAlpha(alpha);
+ if (alpha == 0.0f) {
+ if (mOnFullScreenListener != null) {
+ mFullScreenButton.setVisibility(View.GONE);
+ }
+ mProgressBar.setVisibility(View.GONE);
+ }
+ }
}
});
@@ -672,104 +669,149 @@
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float alpha = (float) animation.getAnimatedValue();
- int scaleLevel = mSizeType == SIZE_TYPE_MINIMAL ? 0 : MAX_SCALE_LEVEL;
- mProgress.getThumb().setLevel((int) (scaleLevel * alpha));
-
- mCenterView.setAlpha(alpha);
- mMinimalFullScreenView.setAlpha(alpha);
- }
- });
- fadeInAnimator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- if (mSizeType != SIZE_TYPE_FULL) {
- mCenterView.setVisibility(View.VISIBLE);
+ SeekBar seekBar = (SeekBar) mProgress;
+ if (mSizeType != SIZE_TYPE_MINIMAL) {
+ ScaleDrawable thumb = (ScaleDrawable) seekBar.getThumb();
+ if (thumb != null) {
+ thumb.setLevel((int) (MAX_SCALE_LEVEL * alpha));
+ }
}
- mMinimalFullScreenView.setVisibility(View.VISIBLE);
+
+ mTransportControls.setAlpha(alpha);
+ if (alpha == 0.0f) {
+ mTransportControls.setVisibility(View.VISIBLE);
+ } else if (alpha == 1.0f) {
+ setEnabled(true);
+ }
+ if (mSizeType == SIZE_TYPE_MINIMAL) {
+ mFullScreenButton.setAlpha(alpha);
+ mProgressBar.setAlpha(alpha);
+ if (alpha == 0.0f) {
+ if (mOnFullScreenListener != null) {
+ mFullScreenButton.setVisibility(View.VISIBLE);
+ }
+ mProgressBar.setVisibility(View.VISIBLE);
+ }
+ }
}
});
mHideMainBarsAnimator = new AnimatorSet();
- mHideMainBarsAnimator.play(fadeOutAnimator)
- .with(AnimatorUtil.ofTranslationY(0, -titleBarHeight, mTitleBar))
- .with(AnimatorUtil.ofTranslationYTogether(0, bottomBarHeight, bottomBarGroup));
+ mHideMainBarsAnimator
+ .play(ObjectAnimator.ofFloat(mTitleBar, "translationY",
+ 0, titleBarTranslateY))
+ .with(ObjectAnimator.ofFloat(mBottomBar, "translationY",
+ 0, bottomBarTranslateY))
+ .with(ObjectAnimator.ofFloat(mProgressBar, "translationY",
+ 0, bottomBarTranslateY))
+ .with(fadeOutAnimator);
mHideMainBarsAnimator.setDuration(HIDE_TIME_MS);
- mHideMainBarsAnimator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- mUxState = UX_STATE_ANIMATING;
- }
+ mHideMainBarsAnimator.getChildAnimations().get(0).addListener(
+ new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ setEnabled(false);
+ mUxState = UX_STATE_ANIMATING;
+ }
- @Override
- public void onAnimationEnd(Animator animation) {
- mUxState = UX_STATE_ONLY_PROGRESS_VISIBLE;
- }
- });
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ setEnabled(true);
+ mUxState = UX_STATE_ONLY_PROGRESS_VISIBLE;
+ }
+ });
- mHideProgressBarAnimator = AnimatorUtil.ofTranslationYTogether(
- bottomBarHeight, bottomBarHeight + progressBarHeight, bottomBarGroup);
+ mHideProgressBarAnimator = new AnimatorSet();
+ mHideProgressBarAnimator
+ .play(ObjectAnimator.ofFloat(mBottomBar, "translationY",
+ bottomBarTranslateY, bottomBarTranslateY + progressBarHeight))
+ .with(ObjectAnimator.ofFloat(mProgressBar, "translationY",
+ bottomBarTranslateY, bottomBarTranslateY + progressBarHeight));
mHideProgressBarAnimator.setDuration(HIDE_TIME_MS);
- mHideProgressBarAnimator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- mUxState = UX_STATE_ANIMATING;
- }
+ mHideProgressBarAnimator.getChildAnimations().get(0).addListener(
+ new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ setEnabled(false);
+ mUxState = UX_STATE_ANIMATING;
+ }
- @Override
- public void onAnimationEnd(Animator animation) {
- mUxState = UX_STATE_NONE_VISIBLE;
- }
- });
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ setEnabled(true);
+ mUxState = UX_STATE_NONE_VISIBLE;
+ }
+ });
mHideAllBarsAnimator = new AnimatorSet();
- mHideAllBarsAnimator.play(fadeOutAnimator)
- .with(AnimatorUtil.ofTranslationY(0, -titleBarHeight, mTitleBar))
- .with(AnimatorUtil.ofTranslationYTogether(
- 0, bottomBarHeight + progressBarHeight, bottomBarGroup));
+ mHideAllBarsAnimator
+ .play(ObjectAnimator.ofFloat(mTitleBar, "translationY",
+ 0, titleBarTranslateY))
+ .with(ObjectAnimator.ofFloat(mBottomBar, "translationY",
+ 0, bottomBarTranslateY + progressBarHeight))
+ .with(ObjectAnimator.ofFloat(mProgressBar, "translationY",
+ 0, bottomBarTranslateY + progressBarHeight))
+ .with(fadeOutAnimator);
mHideAllBarsAnimator.setDuration(HIDE_TIME_MS);
- mHideAllBarsAnimator.addListener(new AnimatorListenerAdapter() {
+ mHideAllBarsAnimator.getChildAnimations().get(0).addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
+ setEnabled(false);
mUxState = UX_STATE_ANIMATING;
}
@Override
public void onAnimationEnd(Animator animation) {
+ setEnabled(true);
mUxState = UX_STATE_NONE_VISIBLE;
}
});
mShowMainBarsAnimator = new AnimatorSet();
- mShowMainBarsAnimator.play(fadeInAnimator)
- .with(AnimatorUtil.ofTranslationY(-titleBarHeight, 0, mTitleBar))
- .with(AnimatorUtil.ofTranslationYTogether(bottomBarHeight, 0, bottomBarGroup));
+ mShowMainBarsAnimator
+ .play(ObjectAnimator.ofFloat(mTitleBar, "translationY",
+ titleBarTranslateY, 0))
+ .with(ObjectAnimator.ofFloat(mBottomBar, "translationY",
+ bottomBarTranslateY, 0))
+ .with(ObjectAnimator.ofFloat(mProgressBar, "translationY",
+ bottomBarTranslateY, 0))
+ .with(fadeInAnimator);
mShowMainBarsAnimator.setDuration(SHOW_TIME_MS);
- mShowMainBarsAnimator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationStart(Animator animation) {
- mUxState = UX_STATE_ANIMATING;
- }
+ mShowMainBarsAnimator.getChildAnimations().get(0).addListener(
+ new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ setEnabled(false);
+ mUxState = UX_STATE_ANIMATING;
+ }
- @Override
- public void onAnimationEnd(Animator animation) {
- mUxState = UX_STATE_ALL_VISIBLE;
- }
- });
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ setEnabled(true);
+ mUxState = UX_STATE_ALL_VISIBLE;
+ }
+ });
mShowAllBarsAnimator = new AnimatorSet();
- mShowAllBarsAnimator.play(fadeInAnimator)
- .with(AnimatorUtil.ofTranslationY(-titleBarHeight, 0, mTitleBar))
- .with(AnimatorUtil.ofTranslationYTogether(
- bottomBarHeight + progressBarHeight, 0, bottomBarGroup));
+ mShowAllBarsAnimator
+ .play(ObjectAnimator.ofFloat(mTitleBar, "translationY",
+ titleBarTranslateY, 0))
+ .with(ObjectAnimator.ofFloat(mBottomBar, "translationY",
+ bottomBarTranslateY + progressBarHeight, 0))
+ .with(ObjectAnimator.ofFloat(mProgressBar, "translationY",
+ bottomBarTranslateY + progressBarHeight, 0))
+ .with(fadeInAnimator);
mShowAllBarsAnimator.setDuration(SHOW_TIME_MS);
- mShowAllBarsAnimator.addListener(new AnimatorListenerAdapter() {
+ mShowAllBarsAnimator.getChildAnimations().get(0).addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
+ setEnabled(false);
mUxState = UX_STATE_ANIMATING;
}
@Override
public void onAnimationEnd(Animator animation) {
+ setEnabled(true);
mUxState = UX_STATE_ALL_VISIBLE;
}
});
@@ -779,21 +821,24 @@
mOverflowShowAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
- animateOverflow((float) animation.getAnimatedValue());
+ animateOverflow(animation);
}
});
mOverflowShowAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
mExtraControls.setVisibility(View.VISIBLE);
+ mOverflowShowButton.setVisibility(View.GONE);
+ mOverflowHideButton.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationEnd(Animator animation) {
- mBasicControls.setVisibility(View.INVISIBLE);
+ mBasicControls.setVisibility(View.GONE);
- findControlButton(SIZE_TYPE_FULL, R.id.ffwd).setVisibility(
- mController.canSeekForward() ? View.INVISIBLE : View.GONE);
+ if (mSizeType == SIZE_TYPE_FULL && mMediaType == MEDIA_TYPE_DEFAULT) {
+ mFfwdButton.setVisibility(View.GONE);
+ }
}
});
@@ -802,16 +847,19 @@
mOverflowHideAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
- animateOverflow((float) animation.getAnimatedValue());
+ animateOverflow(animation);
}
});
mOverflowHideAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
mBasicControls.setVisibility(View.VISIBLE);
+ mOverflowShowButton.setVisibility(View.VISIBLE);
+ mOverflowHideButton.setVisibility(View.GONE);
- findControlButton(SIZE_TYPE_FULL, R.id.ffwd).setVisibility(
- mController.canSeekForward() ? View.VISIBLE : View.GONE);
+ if (mSizeType == SIZE_TYPE_FULL && mMediaType == MEDIA_TYPE_DEFAULT) {
+ mFfwdButton.setVisibility(View.VISIBLE);
+ }
}
@Override
@@ -821,13 +869,41 @@
});
}
+ /**
+ * Disable pause or seek buttons if the stream cannot be paused or seeked.
+ * This requires the control interface to be a MediaPlayerControlExt
+ * TODO: b/110905302
+ */
+ private void disableUnsupportedButtons() {
+ try {
+ if (mPlayPauseButton != null && !mController.canPause()) {
+ mPlayPauseButton.setEnabled(false);
+ }
+ if (mRewButton != null && !mController.canSeekBackward()) {
+ mRewButton.setEnabled(false);
+ }
+ if (mFfwdButton != null && !mController.canSeekForward()) {
+ mFfwdButton.setEnabled(false);
+ }
+ if (mProgress != null && !mController.canSeekBackward()
+ && !mController.canSeekForward()) {
+ mProgress.setEnabled(false);
+ }
+ } catch (IncompatibleClassChangeError ex) {
+ // We were given an old version of the interface, that doesn't have
+ // the canPause/canSeekXYZ methods. This is OK, it just means we
+ // assume the media can be paused and seeked, and so we don't disable
+ // the buttons.
+ }
+ }
+
final Runnable mUpdateProgress = new Runnable() {
@Override
public void run() {
boolean isShowing = getVisibility() == View.VISIBLE;
if (!mDragging && isShowing && mController.isPlaying()) {
long pos = setProgress();
- postDelayedRunnable(mUpdateProgress,
+ postDelayed(mUpdateProgress,
DEFAULT_PROGRESS_UPDATE_TIME_MS - (pos % DEFAULT_PROGRESS_UPDATE_TIME_MS));
}
}
@@ -890,8 +966,8 @@
} else {
if (mAdSkipView.getVisibility() == View.VISIBLE) {
mAdSkipView.setVisibility(View.GONE);
- findControlButton(SIZE_TYPE_FULL, R.id.next).setEnabled(true);
- findControlButton(SIZE_TYPE_FULL, R.id.next).clearColorFilter();
+ mNextButton.setEnabled(true);
+ mNextButton.clearColorFilter();
}
}
}
@@ -909,55 +985,51 @@
}
void togglePausePlayState() {
- ImageButton playPauseButton = findControlButton(mSizeType, R.id.pause);
if (mController.isPlaying()) {
mController.pause();
- playPauseButton.setImageDrawable(
+ mPlayPauseButton.setImageDrawable(
mResources.getDrawable(R.drawable.ic_play_circle_filled));
- playPauseButton.setContentDescription(
+ mPlayPauseButton.setContentDescription(
mResources.getString(R.string.mcv2_play_button_desc));
} else {
if (mIsStopped) {
mController.seekTo(0);
}
mController.play();
- playPauseButton.setImageDrawable(
+ mPlayPauseButton.setImageDrawable(
mResources.getDrawable(R.drawable.ic_pause_circle_filled));
- playPauseButton.setContentDescription(
+ mPlayPauseButton.setContentDescription(
mResources.getString(R.string.mcv2_pause_button_desc));
}
}
- private void showMediaControlView() {
- if (mUxState == UX_STATE_ANIMATING) {
+ private void toggleMediaControlViewVisibility() {
+ if (shouldNotHideBars() || mShowControllerIntervalMs == 0
+ || mUxState == UX_STATE_ANIMATING) {
return;
}
removeCallbacks(mHideMainBars);
removeCallbacks(mHideProgressBar);
- if (mUxState == UX_STATE_NONE_VISIBLE) {
- post(mShowAllBars);
- } else if (mUxState == UX_STATE_ONLY_PROGRESS_VISIBLE) {
- post(mShowMainBars);
+ switch (mUxState) {
+ case UX_STATE_NONE_VISIBLE:
+ post(mShowAllBars);
+ break;
+ case UX_STATE_ONLY_PROGRESS_VISIBLE:
+ post(mShowMainBars);
+ break;
+ case UX_STATE_ALL_VISIBLE:
+ post(mHideAllBars);
+ break;
}
}
- private void hideMediaControlView() {
- if (shouldNotHideBars() || mUxState == UX_STATE_ANIMATING) {
- return;
- }
- removeCallbacks(mHideMainBars);
- removeCallbacks(mHideProgressBar);
-
- post(mHideAllBars);
- }
-
private final Runnable mShowAllBars = new Runnable() {
@Override
public void run() {
mShowAllBarsAnimator.start();
if (mController.isPlaying()) {
- postDelayedRunnable(mHideMainBars, mDelayedAnimationIntervalMs);
+ postDelayed(mHideMainBars, mShowControllerIntervalMs);
}
}
};
@@ -966,7 +1038,7 @@
@Override
public void run() {
mShowMainBarsAnimator.start();
- postDelayedRunnable(mHideMainBars, mDelayedAnimationIntervalMs);
+ postDelayed(mHideMainBars, mShowControllerIntervalMs);
}
};
@@ -987,7 +1059,7 @@
return;
}
mHideMainBarsAnimator.start();
- postDelayedRunnable(mHideProgressBar, mDelayedAnimationIntervalMs);
+ postDelayed(mHideProgressBar, mShowControllerIntervalMs);
}
};
@@ -1099,14 +1171,14 @@
resetHideCallbacks();
removeCallbacks(mUpdateProgress);
- // If the media is currently stopped, rewinding will start the media from the
- // beginning. Instead, seek to 10 seconds before the end of the media.
- boolean stoppedWithDuration = mIsStopped && mDuration != 0;
- long currentPosition = stoppedWithDuration ? mDuration : getLatestSeekPosition();
- long seekPosition = Math.max(currentPosition - REWIND_TIME_MS, 0);
- seekTo(seekPosition, /* shouldSeekNow= */ true);
- if (stoppedWithDuration) {
- updateForStoppedState(/* isStopped= */ false);
+ long latestSeekPosition = getLatestSeekPosition();
+ if (mIsStopped && mDuration != 0) {
+ // If the media is currently stopped, rewinding will start the media from the
+ // beginning. Instead, seek to 10 seconds before the end of the media.
+ seekTo(mDuration - REWIND_TIME_MS, true);
+ updateForStoppedState(false);
+ } else {
+ seekTo(Math.max(latestSeekPosition - REWIND_TIME_MS, 0), true);
}
}
};
@@ -1157,6 +1229,19 @@
}
};
+ private final OnClickListener mVideoQualityListener = new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ removeCallbacks(mHideMainBars);
+ removeCallbacks(mHideProgressBar);
+
+ mSettingsMode = SETTINGS_MODE_VIDEO_QUALITY;
+ mSubSettingsAdapter.setTexts(mVideoQualityList);
+ mSubSettingsAdapter.setCheckPosition(mSelectedVideoQualityIndex);
+ displaySettingsWindow(mSubSettingsAdapter);
+ }
+ };
+
private final OnClickListener mFullScreenListener = new OnClickListener() {
@Override
public void onClick(View v) {
@@ -1170,13 +1255,9 @@
if (isEnteringFullScreen) {
mFullScreenButton.setImageDrawable(
mResources.getDrawable(R.drawable.ic_fullscreen_exit));
- mMinimalFullScreenButton.setImageDrawable(
- mResources.getDrawable(R.drawable.ic_fullscreen_exit));
} else {
mFullScreenButton.setImageDrawable(
mResources.getDrawable(R.drawable.ic_fullscreen));
- mMinimalFullScreenButton.setImageDrawable(
- mResources.getDrawable(R.drawable.ic_fullscreen));
}
mIsFullScreen = isEnteringFullScreen;
mOnFullScreenListener.onFullScreen(MediaControlView.this,
@@ -1269,6 +1350,10 @@
}
dismissSettingsWindow();
break;
+ case SETTINGS_MODE_VIDEO_QUALITY:
+ mSelectedVideoQualityIndex = position;
+ dismissSettingsWindow();
+ break;
}
}
};
@@ -1278,7 +1363,7 @@
@Override
public void onDismiss() {
if (mNeedToHideBars) {
- postDelayedRunnable(mHideMainBars, mDelayedAnimationIntervalMs);
+ postDelayed(mHideMainBars, mShowControllerIntervalMs);
}
}
};
@@ -1291,6 +1376,7 @@
long duration = mController.getDurationMs();
if (duration != 0) {
mDuration = duration;
+ mTimeView.setVisibility(View.VISIBLE);
setProgress();
}
@@ -1310,86 +1396,247 @@
}
// Update title for Embedded size type
mTitleView.setText(title.toString() + " - " + artist.toString());
+
+ // Remove unnecessary buttons
+ mVideoQualityButton.setVisibility(View.GONE);
+ if (mFfwdButton != null) {
+ mFfwdButton.setVisibility(View.GONE);
+ }
+ if (mRewButton != null) {
+ mRewButton.setVisibility(View.GONE);
+ }
+
+ Point screenSize = new Point();
+ mWindowManager.getDefaultDisplay().getSize(screenSize);
+ updateLayout(BOTTOM_BAR_RIGHT_VIEW_MAX_ICON_NUM_MUSIC, getMeasuredWidth(),
+ getMeasuredHeight(), screenSize.x, screenSize.y);
}
}
void updateLayoutForAd() {
if (mIsAdvertisement) {
- findControlButton(SIZE_TYPE_FULL, R.id.rew).setVisibility(View.GONE);
- findControlButton(SIZE_TYPE_FULL, R.id.ffwd).setVisibility(View.GONE);
- findControlButton(SIZE_TYPE_FULL, R.id.prev).setVisibility(View.GONE);
-
- findControlButton(SIZE_TYPE_FULL, R.id.next).setVisibility(View.VISIBLE);
- findControlButton(SIZE_TYPE_FULL, R.id.next).setEnabled(false);
- findControlButton(SIZE_TYPE_FULL, R.id.next).setColorFilter(R.color.gray);
-
+ mRewButton.setVisibility(View.GONE);
+ mFfwdButton.setVisibility(View.GONE);
+ mPrevButton.setVisibility(View.GONE);
mTimeView.setVisibility(View.GONE);
+
mAdSkipView.setVisibility(View.VISIBLE);
mAdRemainingView.setVisibility(View.VISIBLE);
mAdExternalLink.setVisibility(View.VISIBLE);
mProgress.setEnabled(false);
+ mNextButton.setEnabled(false);
+ mNextButton.setColorFilter(R.color.gray);
} else {
- findControlButton(SIZE_TYPE_FULL, R.id.rew).setVisibility(
- mController.canSeekBackward() ? View.VISIBLE : View.GONE);
- findControlButton(SIZE_TYPE_FULL, R.id.ffwd).setVisibility(
- mController.canSeekForward() ? View.VISIBLE : View.GONE);
- findControlButton(SIZE_TYPE_FULL, R.id.prev).setVisibility(
- mController.canSkipToPrevious() ? View.VISIBLE : View.GONE);
-
- findControlButton(SIZE_TYPE_FULL, R.id.next).setVisibility(
- mController.canSkipToNext() ? View.VISIBLE : View.GONE);
- findControlButton(SIZE_TYPE_FULL, R.id.next).setEnabled(true);
- findControlButton(SIZE_TYPE_FULL, R.id.next).clearColorFilter();
-
+ mRewButton.setVisibility(View.VISIBLE);
+ mFfwdButton.setVisibility(View.VISIBLE);
+ mPrevButton.setVisibility(View.VISIBLE);
mTimeView.setVisibility(View.VISIBLE);
+
mAdSkipView.setVisibility(View.GONE);
mAdRemainingView.setVisibility(View.GONE);
mAdExternalLink.setVisibility(View.GONE);
- mProgress.setEnabled(mSeekAvailable);
+ mProgress.setEnabled(true);
+ mNextButton.setEnabled(true);
+ mNextButton.clearColorFilter();
+ disableUnsupportedButtons();
}
}
+ private void updateLayout(int maxIconNum, int currWidth, int currHeight, int screenWidth,
+ int screenHeight) {
+ if (mMaxTimeViewWidth == 0) {
+ // Save the width of the initial time view since it represents the maximum width that
+ // this class supports (00:00:00 · 00:00:00).
+ mMaxTimeViewWidth = mTimeView.getWidth();
+ }
+ int bottomBarRightWidthMax = mIconSize * maxIconNum;
+ int fullWidth = mTransportControls.getWidth() + mMaxTimeViewWidth + bottomBarRightWidthMax;
+ int screenMaxLength = Math.max(screenWidth, screenHeight);
+ int embeddedWidth = mMaxTimeViewWidth + bottomBarRightWidthMax;
+
+ // If Media type is default, the size of MCV2 is full only when the current width is equal
+ // to the max length of the screen (only landscape mode). If Media type is music, however,
+ // the size of MCV2 is full when the current width is equal to the current screen width
+ // (both landscape and portrait modes).
+ boolean isFullSize = (mMediaType == MEDIA_TYPE_DEFAULT) ? currWidth == screenMaxLength
+ : currWidth == screenWidth;
+ if (isFullSize) {
+ if (mSizeType != SIZE_TYPE_FULL) {
+ updateLayoutForSizeChange(SIZE_TYPE_FULL);
+ if (mMediaType == MEDIA_TYPE_MUSIC) {
+ mTitleView.setVisibility(View.GONE);
+ } else {
+ mUxState = UX_STATE_NONE_VISIBLE;
+ toggleMediaControlViewVisibility();
+ }
+ }
+ } else if (embeddedWidth <= currWidth) {
+ if (mSizeType != SIZE_TYPE_EMBEDDED) {
+ updateLayoutForSizeChange(SIZE_TYPE_EMBEDDED);
+ if (mMediaType == MEDIA_TYPE_MUSIC) {
+ mTitleView.setVisibility(View.VISIBLE);
+ }
+ }
+ } else {
+ if (mSizeType != SIZE_TYPE_MINIMAL) {
+ updateLayoutForSizeChange(SIZE_TYPE_MINIMAL);
+ if (mMediaType == MEDIA_TYPE_MUSIC) {
+ mTitleView.setVisibility(View.GONE);
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("deprecation")
private void updateLayoutForSizeChange(int sizeType) {
- switch (sizeType) {
- case SIZE_TYPE_FULL:
+ mSizeType = sizeType;
+ RelativeLayout.LayoutParams timeViewParams =
+ (RelativeLayout.LayoutParams) mTimeView.getLayoutParams();
+ SeekBar seeker = (SeekBar) mProgress;
+ switch (mSizeType) {
case SIZE_TYPE_EMBEDDED:
+ // Relating to Title Bar
+ mTitleBar.setVisibility(View.VISIBLE);
+
+ // Relating to Full Screen Button
+ if (mOnFullScreenListener != null) {
+ mMinimalSizeFullScreenView.setVisibility(View.GONE);
+ mFullScreenButton = mBasicControls.findViewById(R.id.fullscreen);
+ mFullScreenButton.setOnClickListener(mFullScreenListener);
+ }
+
+ // Relating to Center View
+ mCenterView.removeAllViews();
+ mBottomBarLeftView.removeView(mTransportControls);
+ mBottomBarLeftView.setVisibility(View.GONE);
+ mTransportControls = inflateTransportControls(R.layout.embedded_transport_controls);
+ mCenterView.addView(mTransportControls);
+
// Relating to Progress Bar
- mProgress.getThumb().setLevel(MAX_SCALE_LEVEL);
+ seeker.setThumb(mResources.getDrawable(R.drawable.custom_progress_thumb));
+ seeker.setThumbOffset(0);
+ seeker.invalidate();
+ mProgressBuffer.setVisibility(View.VISIBLE);
+
+ // Relating to Bottom Bar
+ mBottomBar.setVisibility(View.VISIBLE);
+ if (timeViewParams.getRules()[RelativeLayout.LEFT_OF] != 0) {
+ timeViewParams.removeRule(RelativeLayout.LEFT_OF);
+ timeViewParams.addRule(RelativeLayout.RIGHT_OF, R.id.bottom_bar_left);
+ }
+ break;
+ case SIZE_TYPE_FULL:
+ // Relating to Title Bar
+ mTitleBar.setVisibility(View.VISIBLE);
+
+ // Relating to Full Screen Button
+ if (mOnFullScreenListener != null) {
+ mMinimalSizeFullScreenView.setVisibility(View.GONE);
+ mFullScreenButton = mBasicControls.findViewById(R.id.fullscreen);
+ mFullScreenButton.setOnClickListener(mFullScreenListener);
+ }
+
+ // Relating to Center View
+ mCenterView.removeAllViews();
+ mBottomBarLeftView.removeView(mTransportControls);
+ mTransportControls = inflateTransportControls(R.layout.full_transport_controls);
+ mBottomBarLeftView.addView(mTransportControls, 0);
+ mBottomBarLeftView.setVisibility(View.VISIBLE);
+
+ // Relating to Progress Bar
+ seeker.setThumb(mResources.getDrawable(R.drawable.custom_progress_thumb));
+ seeker.setThumbOffset(0);
+ seeker.invalidate();
+ mProgressBuffer.setVisibility(View.VISIBLE);
+
+ // Relating to Bottom Bar
+ mBottomBar.setVisibility(View.VISIBLE);
+ if (timeViewParams.getRules()[RelativeLayout.RIGHT_OF] != 0) {
+ timeViewParams.removeRule(RelativeLayout.RIGHT_OF);
+ timeViewParams.addRule(RelativeLayout.LEFT_OF, R.id.basic_controls);
+ }
break;
case SIZE_TYPE_MINIMAL:
+ // Relating to Title Bar
+ mTitleBar.setVisibility(View.GONE);
+
+ // Relating to Full Screen Button
+ if (mOnFullScreenListener != null) {
+ mMinimalSizeFullScreenView.setVisibility(View.VISIBLE);
+ mFullScreenButton = mMinimalSizeFullScreenView.findViewById(
+ R.id.minimal_fullscreen);
+ mFullScreenButton.setOnClickListener(mFullScreenListener);
+ }
+
+ // Relating to Center View
+ mCenterView.removeAllViews();
+ mBottomBarLeftView.removeView(mTransportControls);
+ mTransportControls = inflateTransportControls(R.layout.minimal_transport_controls);
+ mCenterView.addView(mTransportControls);
+
// Relating to Progress Bar
- mProgress.getThumb().setLevel(0);
+ seeker.setThumb(null);
+ mProgressBuffer.setVisibility(View.GONE);
+
+ // Relating to Bottom Bar
+ mBottomBar.setVisibility(View.GONE);
break;
}
+ mTimeView.setLayoutParams(timeViewParams);
// Update play/pause and ffwd buttons based on whether the media is currently stopped or
// not.
updateForStoppedState(mIsStopped);
+
+ if (mIsFullScreen) {
+ mFullScreenButton.setImageDrawable(
+ mResources.getDrawable(R.drawable.ic_fullscreen_exit));
+ } else {
+ mFullScreenButton.setImageDrawable(
+ mResources.getDrawable(R.drawable.ic_fullscreen));
+ }
}
- private View initTransportControls(int id) {
- View v = findViewById(id);
- ImageButton playPauseButton = v.findViewById(R.id.pause);
- if (playPauseButton != null) {
- playPauseButton.setOnClickListener(mPlayPauseListener);
+ private View inflateTransportControls(int layoutId) {
+ View v = inflateLayout(getContext(), layoutId);
+ mPlayPauseButton = v.findViewById(R.id.pause);
+ if (mPlayPauseButton != null) {
+ mPlayPauseButton.requestFocus();
+ mPlayPauseButton.setOnClickListener(mPlayPauseListener);
}
- ImageButton ffwdButton = v.findViewById(R.id.ffwd);
- if (ffwdButton != null) {
- ffwdButton.setOnClickListener(mFfwdListener);
+ mFfwdButton = v.findViewById(R.id.ffwd);
+ if (mFfwdButton != null) {
+ if (mMediaType == MEDIA_TYPE_MUSIC) {
+ mFfwdButton.setVisibility(View.GONE);
+ } else {
+ mFfwdButton.setOnClickListener(mFfwdListener);
+ }
}
- ImageButton rewButton = v.findViewById(R.id.rew);
- if (rewButton != null) {
- rewButton.setOnClickListener(mRewListener);
+ mRewButton = v.findViewById(R.id.rew);
+ if (mRewButton != null) {
+ if (mMediaType == MEDIA_TYPE_MUSIC) {
+ mRewButton.setVisibility(View.GONE);
+ } else {
+ mRewButton.setOnClickListener(mRewListener);
+ }
}
- ImageButton nextButton = v.findViewById(R.id.next);
- if (nextButton != null) {
- nextButton.setOnClickListener(mNextListener);
+ mNextButton = v.findViewById(R.id.next);
+ if (mNextButton != null) {
+ if (mController.canSkipToNext()) {
+ mNextButton.setOnClickListener(mNextListener);
+ } else {
+ mNextButton.setVisibility(View.GONE);
+ }
}
- ImageButton prevButton = v.findViewById(R.id.prev);
- if (prevButton != null) {
- prevButton.setOnClickListener(mPrevListener);
+ mPrevButton = v.findViewById(R.id.prev);
+ if (mPrevButton != null) {
+ if (mController.canSkipToPrevious()) {
+ mPrevButton.setOnClickListener(mPrevListener);
+ } else {
+ mPrevButton.setVisibility(View.GONE);
+ }
}
return v;
}
@@ -1410,12 +1657,16 @@
mSettingsIconIdsList = new ArrayList<Integer>();
mSettingsIconIdsList.add(R.drawable.ic_audiotrack);
- mSettingsIconIdsList.add(R.drawable.ic_speed);
+ mSettingsIconIdsList.add(R.drawable.ic_play_circle_filled);
mAudioTrackList = new ArrayList<String>();
mAudioTrackList.add(
mResources.getString(R.string.MediaControlView_audio_track_none_text));
+ mVideoQualityList = new ArrayList<String>();
+ mVideoQualityList.add(
+ mResources.getString(R.string.MediaControlView_video_quality_auto_text));
+
mPlaybackSpeedTextList = new ArrayList<String>(Arrays.asList(
mResources.getStringArray(R.array.MediaControlView_playback_speeds)));
// Select the normal speed (1x) as the default value.
@@ -1430,10 +1681,6 @@
mCustomPlaybackSpeedIndex = -1;
}
- ImageButton findControlButton(int sizeType, @IdRes int id) {
- return mTransportControlsMap.get(sizeType).findViewById(id);
- }
-
/**
* @return true iff the current media item is from network.
*/
@@ -1480,24 +1727,38 @@
mSettingsWindow.dismiss();
}
- void animateOverflow(float animatedValue) {
- int extraControlWidth = mExtraControls.getWidth();
- int extraControlTranslationX = (-1) * (int) (extraControlWidth * animatedValue);
- mExtraControls.setTranslationX(extraControlTranslationX);
+ void animateOverflow(ValueAnimator animation) {
+ RelativeLayout.LayoutParams extraControlsParams =
+ (RelativeLayout.LayoutParams) mExtraControls.getLayoutParams();
+ int iconWidth = mResources.getDimensionPixelSize(R.dimen.mcv2_icon_size);
+ // Currently, mExtraControls view is set to the right end of the bottom bar
+ // view. This animates the view by setting the initial margin value to the
+ // negative value of its width ((-2) * iconWidth) and the final margin value
+ // to the positive value of the overflow button width (iconWidth).
+ int extraControlMargin = (-2 * iconWidth)
+ + (int) (3 * iconWidth * (float) animation.getAnimatedValue());
+ extraControlsParams.setMargins(0, 0, extraControlMargin, 0);
+ mExtraControls.setLayoutParams(extraControlsParams);
- mTimeView.setAlpha(1 - animatedValue);
- mBasicControls.setAlpha(1 - animatedValue);
+ mTimeView.setAlpha(1 - (float) animation.getAnimatedValue());
+ mBasicControls.setAlpha(1 - (float) animation.getAnimatedValue());
- int transportControlLeftWidth = findControlButton(SIZE_TYPE_FULL, R.id.pause).getLeft();
- int transportControlTranslationX = (-1) * (int) (transportControlLeftWidth * animatedValue);
- mFullTransportControls.setTranslationX(transportControlTranslationX);
- findControlButton(SIZE_TYPE_FULL, R.id.ffwd).setAlpha(1 - animatedValue);
+ if (mSizeType == SIZE_TYPE_FULL && mMediaType == MEDIA_TYPE_DEFAULT) {
+ int transportControlMargin =
+ (-1) * (int) (iconWidth * (float) animation.getAnimatedValue());
+ LinearLayout.LayoutParams transportControlsParams =
+ (LinearLayout.LayoutParams) mTransportControls.getLayoutParams();
+ transportControlsParams.setMargins(transportControlMargin, 0, 0, 0);
+ mTransportControls.setLayoutParams(transportControlsParams);
+
+ mFfwdButton.setAlpha(1 - (float) animation.getAnimatedValue());
+ }
}
void resetHideCallbacks() {
removeCallbacks(mHideMainBars);
removeCallbacks(mHideProgressBar);
- postDelayedRunnable(mHideMainBars, mDelayedAnimationIntervalMs);
+ postDelayed(mHideMainBars, mShowControllerIntervalMs);
}
void updateAllowedCommands(SessionCommandGroup commands) {
@@ -1510,37 +1771,54 @@
}
mController.setAllowedCommands(commands);
- boolean canPause = commands.hasCommand(SessionCommand.COMMAND_CODE_PLAYER_PAUSE);
- boolean canRew = commands.hasCommand(SessionCommand.COMMAND_CODE_SESSION_REWIND);
- boolean canFfwd = commands.hasCommand(SessionCommand.COMMAND_CODE_SESSION_FAST_FORWARD);
- boolean canPrev = commands.hasCommand(
- SessionCommand.COMMAND_CODE_PLAYER_SKIP_TO_PREVIOUS_PLAYLIST_ITEM);
- boolean canNext = commands.hasCommand(
- SessionCommand.COMMAND_CODE_PLAYER_SKIP_TO_NEXT_PLAYLIST_ITEM);
-
- int n = mTransportControlsMap.size();
- for (int i = 0; i < n; i++) {
- int sizeType = mTransportControlsMap.keyAt(i);
-
- View playPauseButton = findControlButton(sizeType, R.id.pause);
- if (playPauseButton != null) {
- playPauseButton.setVisibility(canPause ? View.VISIBLE : View.GONE);
+ if (commands.hasCommand(SessionCommand.COMMAND_CODE_PLAYER_PAUSE)) {
+ mPlayPauseButton.setVisibility(View.VISIBLE);
+ mPlayPauseButton.setEnabled(true);
+ } else {
+ mPlayPauseButton.setVisibility(View.GONE);
+ }
+ if (commands.hasCommand(SessionCommand.COMMAND_CODE_SESSION_REWIND)
+ && mMediaType != MEDIA_TYPE_MUSIC) {
+ if (mRewButton != null) {
+ mRewButton.setVisibility(View.VISIBLE);
+ mRewButton.setEnabled(true);
}
- View rewButton = findControlButton(sizeType, R.id.rew);
- if (rewButton != null) {
- rewButton.setVisibility(canRew ? View.VISIBLE : View.GONE);
+ } else {
+ if (mRewButton != null) {
+ mRewButton.setVisibility(View.GONE);
}
- View ffwdButton = findControlButton(sizeType, R.id.ffwd);
- if (ffwdButton != null) {
- ffwdButton.setVisibility(canFfwd ? View.VISIBLE : View.GONE);
+ }
+ if (commands.hasCommand(SessionCommand.COMMAND_CODE_SESSION_FAST_FORWARD)
+ && mMediaType != MEDIA_TYPE_MUSIC) {
+ if (mFfwdButton != null) {
+ mFfwdButton.setVisibility(View.VISIBLE);
+ mFfwdButton.setEnabled(true);
}
- View prevButton = findControlButton(sizeType, R.id.prev);
- if (prevButton != null) {
- prevButton.setVisibility(canPrev ? View.VISIBLE : View.GONE);
+ } else {
+ if (mFfwdButton != null) {
+ mFfwdButton.setVisibility(View.GONE);
}
- View nextButton = findControlButton(sizeType, R.id.next);
- if (nextButton != null) {
- nextButton.setVisibility(canNext ? View.VISIBLE : View.GONE);
+ }
+ if (commands.hasCommand(
+ SessionCommand.COMMAND_CODE_PLAYER_SKIP_TO_PREVIOUS_PLAYLIST_ITEM)) {
+ if (mPrevButton != null) {
+ mPrevButton.setVisibility(VISIBLE);
+ mPrevButton.setEnabled(true);
+ }
+ } else {
+ if (mPrevButton != null) {
+ mPrevButton.setVisibility(View.GONE);
+ }
+ }
+ if (commands.hasCommand(
+ SessionCommand.COMMAND_CODE_PLAYER_SKIP_TO_NEXT_PLAYLIST_ITEM)) {
+ if (mNextButton != null) {
+ mNextButton.setVisibility(VISIBLE);
+ mNextButton.setEnabled(true);
+ }
+ } else {
+ if (mNextButton != null) {
+ mNextButton.setVisibility(View.GONE);
}
}
if (commands.hasCommand(SessionCommand.COMMAND_CODE_PLAYER_SEEK_TO)) {
@@ -1555,6 +1833,16 @@
}
}
+ private int retrieveOrientation() {
+ DisplayMetrics dm = Resources.getSystem().getDisplayMetrics();
+ int width = dm.widthPixels;
+ int height = dm.heightPixels;
+
+ return (height > width)
+ ? ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
+ : ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
+ }
+
boolean shouldNotHideBars() {
return (mMediaType == MEDIA_TYPE_MUSIC && mSizeType == SIZE_TYPE_FULL)
|| mAccessibilityManager.isTouchExplorationEnabled()
@@ -1595,7 +1883,6 @@
private void hideSettingsAndOverflow() {
mSettingsWindow.dismiss();
if (mOverflowIsShowing) {
- mOverflowIsShowing = false;
mOverflowHideAnimator.start();
}
}
@@ -1623,48 +1910,40 @@
}
void updateForStoppedState(boolean isStopped) {
- ImageButton playPauseButton = findControlButton(mSizeType, R.id.pause);
- ImageButton ffwdButton = findControlButton(mSizeType, R.id.ffwd);
if (isStopped) {
mIsStopped = true;
- if (playPauseButton != null) {
- playPauseButton.setImageDrawable(
+ if (mPlayPauseButton != null) {
+ mPlayPauseButton.setImageDrawable(
mResources.getDrawable(R.drawable.ic_replay_circle_filled));
- playPauseButton.setContentDescription(
+ mPlayPauseButton.setContentDescription(
mResources.getString(R.string.mcv2_replay_button_desc));
}
- if (ffwdButton != null) {
- ffwdButton.setAlpha(0.5f);
- ffwdButton.setEnabled(false);
+ if (mFfwdButton != null) {
+ mFfwdButton.setAlpha(0.5f);
+ mFfwdButton.setEnabled(false);
}
} else {
mIsStopped = false;
- if (playPauseButton != null) {
+ if (mPlayPauseButton != null) {
if (mController.isPlaying()) {
- playPauseButton.setImageDrawable(
+ mPlayPauseButton.setImageDrawable(
mResources.getDrawable(R.drawable.ic_pause_circle_filled));
- playPauseButton.setContentDescription(
+ mPlayPauseButton.setContentDescription(
mResources.getString(R.string.mcv2_pause_button_desc));
} else {
- playPauseButton.setImageDrawable(
+ mPlayPauseButton.setImageDrawable(
mResources.getDrawable(R.drawable.ic_play_circle_filled));
- playPauseButton.setContentDescription(
+ mPlayPauseButton.setContentDescription(
mResources.getString(R.string.mcv2_play_button_desc));
}
}
- if (ffwdButton != null) {
- ffwdButton.setAlpha(1.0f);
- ffwdButton.setEnabled(true);
+ if (mFfwdButton != null) {
+ mFfwdButton.setAlpha(1.0f);
+ mFfwdButton.setEnabled(true);
}
}
}
- void postDelayedRunnable(Runnable runnable, long interval) {
- if (interval != DISABLE_DELAYED_ANIMATION) {
- postDelayed(runnable, interval);
- }
- }
-
private class SettingsAdapter extends BaseAdapter {
private List<Integer> mIconIds;
private List<String> mMainTexts;
@@ -1710,7 +1989,12 @@
@Override
public View getView(int position, View convertView, ViewGroup container) {
- View row = inflateLayout(getContext(), R.layout.settings_list_item);
+ View row;
+ if (mSizeType == SIZE_TYPE_FULL) {
+ row = inflateLayout(getContext(), R.layout.full_settings_list_item);
+ } else {
+ row = inflateLayout(getContext(), R.layout.embedded_settings_list_item);
+ }
TextView mainTextView = (TextView) row.findViewById(R.id.main_text);
TextView subTextView = (TextView) row.findViewById(R.id.sub_text);
ImageView iconView = (ImageView) row.findViewById(R.id.icon);
@@ -1780,7 +2064,12 @@
@Override
public View getView(int position, View convertView, ViewGroup container) {
- View row = inflateLayout(getContext(), R.layout.sub_settings_list_item);
+ View row;
+ if (mSizeType == SIZE_TYPE_FULL) {
+ row = inflateLayout(getContext(), R.layout.full_sub_settings_list_item);
+ } else {
+ row = inflateLayout(getContext(), R.layout.embedded_sub_settings_list_item);
+ }
TextView textView = (TextView) row.findViewById(R.id.text);
ImageView checkView = (ImageView) row.findViewById(R.id.check);
@@ -2001,7 +2290,6 @@
// activity is resumed.
// 2) Need to handle case where the media file reaches end of duration.
if (mPlaybackState != mPrevState) {
- ImageButton playPauseButton = findControlButton(mSizeType, R.id.pause);
switch (mPlaybackState) {
case SessionPlayer.PLAYER_STATE_PLAYING:
removeCallbacks(mUpdateProgress);
@@ -2010,16 +2298,17 @@
updateForStoppedState(false);
break;
case SessionPlayer.PLAYER_STATE_PAUSED:
- playPauseButton.setImageDrawable(
+ mPlayPauseButton.setImageDrawable(
mResources.getDrawable(R.drawable.ic_play_circle_filled));
- playPauseButton.setContentDescription(
+ mPlayPauseButton.setContentDescription(
mResources.getString(R.string.mcv2_play_button_desc));
removeCallbacks(mUpdateProgress);
break;
case SessionPlayer.PLAYER_STATE_ERROR:
- playPauseButton.setImageDrawable(
+ MediaControlView.this.setEnabled(false);
+ mPlayPauseButton.setImageDrawable(
mResources.getDrawable(R.drawable.ic_play_circle_filled));
- playPauseButton.setContentDescription(
+ mPlayPauseButton.setContentDescription(
mResources.getString(R.string.mcv2_play_button_desc));
removeCallbacks(mUpdateProgress);
if (getWindowToken() != null) {
@@ -2066,7 +2355,7 @@
removeCallbacks(mUpdateProgress);
removeCallbacks(mHideMainBars);
post(mUpdateProgress);
- postDelayedRunnable(mHideMainBars, mDelayedAnimationIntervalMs);
+ postDelayed(mHideMainBars, mShowControllerIntervalMs);
}
}
diff --git a/media2-widget/src/main/java/androidx/media2/widget/MusicView.java b/media2-widget/src/main/java/androidx/media2/widget/MusicView.java
index 1b73802..73a4350 100644
--- a/media2-widget/src/main/java/androidx/media2/widget/MusicView.java
+++ b/media2-widget/src/main/java/androidx/media2/widget/MusicView.java
@@ -50,8 +50,8 @@
if (width > height) {
mType = MusicViewType.WITH_TITLE_LANDSCAPE;
- mWithTitleLandscape.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.UNSPECIFIED),
- MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST));
+ mWithTitleLandscape.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST),
+ MeasureSpec.makeMeasureSpec(height, MeasureSpec.UNSPECIFIED));
if (hasTooSmallMeasuredState(mWithTitleLandscape)
|| mWithTitleLandscape.getMeasuredWidth() > width) {
mType = MusicViewType.WITHOUT_TITLE;
diff --git a/media2-widget/src/main/java/androidx/media2/widget/RoutePlayer.java b/media2-widget/src/main/java/androidx/media2/widget/RoutePlayer.java
index c392f85..d977c8b 100644
--- a/media2-widget/src/main/java/androidx/media2/widget/RoutePlayer.java
+++ b/media2-widget/src/main/java/androidx/media2/widget/RoutePlayer.java
@@ -16,10 +16,10 @@
package androidx.media2.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media2.SessionPlayer.PlayerResult.RESULT_ERROR_BAD_VALUE;
import static androidx.media2.SessionPlayer.PlayerResult.RESULT_ERROR_INVALID_STATE;
-import static androidx.media2.SessionPlayer.PlayerResult.RESULT_ERROR_UNKNOWN;
+import static androidx.media2.SessionPlayer.PlayerResult.RESULT_ERROR_UNKNOWN_ERROR;
import static androidx.media2.SessionPlayer.PlayerResult.RESULT_SUCCESS;
import android.content.Context;
@@ -56,7 +56,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class RoutePlayer extends RemoteSessionPlayer {
private static final String TAG = "RoutePlayer";
static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
@@ -233,7 +233,7 @@
});
}
} else {
- result.set(new PlayerResult(RESULT_ERROR_UNKNOWN,
+ result.set(new PlayerResult(RESULT_ERROR_UNKNOWN_ERROR,
getCurrentMediaItem()));
}
}
diff --git a/media2-widget/src/main/java/androidx/media2/widget/SubtitleAnchorView.java b/media2-widget/src/main/java/androidx/media2/widget/SubtitleAnchorView.java
index 7c36f80..1ab96ae 100644
--- a/media2-widget/src/main/java/androidx/media2/widget/SubtitleAnchorView.java
+++ b/media2-widget/src/main/java/androidx/media2/widget/SubtitleAnchorView.java
@@ -133,7 +133,6 @@
@Override
public CharSequence getAccessibilityClassName() {
- // Class name may be obfuscated by Proguard. Hardcode the string for accessibility usage.
- return "androidx.media2.widget.SubtitleAnchorView";
+ return SubtitleAnchorView.class.getName();
}
}
diff --git a/media2-widget/src/main/java/androidx/media2/widget/VideoSurfaceView.java b/media2-widget/src/main/java/androidx/media2/widget/VideoSurfaceView.java
index 98227ce..b9e0022 100644
--- a/media2-widget/src/main/java/androidx/media2/widget/VideoSurfaceView.java
+++ b/media2-widget/src/main/java/androidx/media2/widget/VideoSurfaceView.java
@@ -27,6 +27,7 @@
import androidx.core.content.ContextCompat;
import androidx.media2.MediaPlayer;
+import androidx.media2.VideoSize;
class VideoSurfaceView extends SurfaceView
implements VideoViewInterface, SurfaceHolder.Callback {
@@ -125,19 +126,23 @@
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- final int videoWidth = mMediaPlayer != null ? mMediaPlayer.getVideoSize().getWidth() : 0;
- final int videoHeight = mMediaPlayer != null ? mMediaPlayer.getVideoSize().getHeight() : 0;
+ if (mMediaPlayer == null) {
+ setMeasuredDimension(0, 0);
+ return;
+ }
+
+ VideoSize videoSize = mMediaPlayer.getVideoSize();
+ final int videoWidth = videoSize.getWidth();
+ final int videoHeight = videoSize.getHeight();
+
+ if (videoWidth == 0 || videoHeight == 0) {
+ setMeasuredDimension(0, 0);
+ return;
+ }
int width;
int height;
- if (videoWidth == 0 || videoHeight == 0) {
- width = getDefaultSize(videoWidth, widthMeasureSpec);
- height = getDefaultSize(videoHeight, heightMeasureSpec);
- setMeasuredDimension(width, height);
- return;
- }
-
final int widthSpecMode = MeasureSpec.getMode(widthMeasureSpec);
final int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
final int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec);
diff --git a/media2-widget/src/main/java/androidx/media2/widget/VideoTextureView.java b/media2-widget/src/main/java/androidx/media2/widget/VideoTextureView.java
index 270ce70..3010552 100644
--- a/media2-widget/src/main/java/androidx/media2/widget/VideoTextureView.java
+++ b/media2-widget/src/main/java/androidx/media2/widget/VideoTextureView.java
@@ -26,6 +26,7 @@
import androidx.core.content.ContextCompat;
import androidx.media2.MediaPlayer;
+import androidx.media2.VideoSize;
class VideoTextureView extends TextureView
implements VideoViewInterface, TextureView.SurfaceTextureListener {
@@ -130,19 +131,23 @@
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- final int videoWidth = mMediaPlayer != null ? mMediaPlayer.getVideoSize().getWidth() : 0;
- final int videoHeight = mMediaPlayer != null ? mMediaPlayer.getVideoSize().getHeight() : 0;
+ if (mMediaPlayer == null) {
+ setMeasuredDimension(0, 0);
+ return;
+ }
+
+ VideoSize videoSize = mMediaPlayer.getVideoSize();
+ final int videoWidth = videoSize.getWidth();
+ final int videoHeight = videoSize.getHeight();
+
+ if (videoWidth == 0 || videoHeight == 0) {
+ setMeasuredDimension(0, 0);
+ return;
+ }
int width;
int height;
- if (videoWidth == 0 || videoHeight == 0) {
- width = getDefaultSize(videoWidth, widthMeasureSpec);
- height = getDefaultSize(videoHeight, heightMeasureSpec);
- setMeasuredDimension(width, height);
- return;
- }
-
final int widthSpecMode = MeasureSpec.getMode(widthMeasureSpec);
final int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
final int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec);
diff --git a/media2-widget/src/main/java/androidx/media2/widget/VideoView.java b/media2-widget/src/main/java/androidx/media2/widget/VideoView.java
index 2a16f90..03dd4cb 100644
--- a/media2-widget/src/main/java/androidx/media2/widget/VideoView.java
+++ b/media2-widget/src/main/java/androidx/media2/widget/VideoView.java
@@ -16,7 +16,8 @@
package androidx.media2.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media2.SessionResult.RESULT_ERROR_INVALID_STATE;
import static androidx.media2.SessionResult.RESULT_SUCCESS;
@@ -126,9 +127,9 @@
* {@link androidx.media2.widget.R.attr#enableControlView}
* {@link androidx.media2.widget.R.attr#viewType}
*/
-public class VideoView extends SelectiveLayout {
+public class VideoView extends SelectiveLayout implements VideoViewInterface.SurfaceListener {
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({
VIEW_TYPE_TEXTUREVIEW,
VIEW_TYPE_SURFACEVIEW
@@ -167,7 +168,7 @@
private AudioAttributesCompat mAudioAttributes;
- VideoView.OnViewTypeChangedListener mViewTypeChangedListener;
+ private VideoView.OnViewTypeChangedListener mViewTypeChangedListener;
VideoViewInterface mCurrentView;
VideoViewInterface mTargetView;
@@ -178,12 +179,12 @@
MediaItem mMediaItem;
MediaControlView mMediaControlView;
MediaSession mMediaSession;
- String mTitle;
+ private String mTitle;
Executor mCallbackExecutor;
MusicView mMusicView;
- Drawable mMusicAlbumDrawable;
- String mMusicArtistText;
+ private Drawable mMusicAlbumDrawable;
+ private String mMusicArtistText;
int mDominantColor;
@@ -253,67 +254,6 @@
}
};
- private final VideoViewInterface.SurfaceListener mSurfaceListener =
- new VideoViewInterface.SurfaceListener() {
- @Override
- public void onSurfaceCreated(View view, int width, int height) {
- if (DEBUG) {
- Log.d(TAG, "onSurfaceCreated(). mCurrentState=" + mCurrentState
- + ", mTargetState=" + mTargetState
- + ", width/height: " + width + "/" + height
- + ", " + view.toString());
- }
- if (view == mTargetView) {
- ((VideoViewInterface) view).takeOver();
- }
- if (needToStart()) {
- mMediaSession.getPlayer().play();
- }
- }
-
- @Override
- public void onSurfaceDestroyed(View view) {
- if (DEBUG) {
- Log.d(TAG, "onSurfaceDestroyed(). mCurrentState=" + mCurrentState
- + ", mTargetState=" + mTargetState + ", " + view.toString());
- }
- }
-
- @Override
- public void onSurfaceChanged(View view, int width, int height) {
- if (DEBUG) {
- Log.d(TAG, "onSurfaceChanged(). width/height: " + width + "/" + height
- + ", " + view.toString());
- }
- }
-
- @Override
- public void onSurfaceTakeOverDone(VideoViewInterface view) {
- if (view != mTargetView) {
- if (DEBUG) {
- Log.d(TAG, "onSurfaceTakeOverDone(). view is not targetView. ignore.: " + view);
- }
- return;
- }
- if (DEBUG) {
- Log.d(TAG, "onSurfaceTakeOverDone(). Now current view is: " + view);
- }
- if (mCurrentState != STATE_PLAYING && mMediaSession != null) {
- mMediaSession.getPlayer().seekTo(mMediaSession.getPlayer().getCurrentPosition());
- }
- if (view != mCurrentView) {
- ((View) mCurrentView).setVisibility(View.GONE);
- mCurrentView = view;
- if (mViewTypeChangedListener != null) {
- mViewTypeChangedListener.onViewTypeChanged(VideoView.this, view.getViewType());
- }
- }
-
- if (needToStart()) {
- mMediaSession.getPlayer().play();
- }
- }
- };
public VideoView(@NonNull Context context) {
this(context, null);
@@ -343,8 +283,8 @@
mTextureView = new VideoTextureView(context);
mSurfaceView = new VideoSurfaceView(context);
- mTextureView.setSurfaceListener(mSurfaceListener);
- mSurfaceView.setSurfaceListener(mSurfaceListener);
+ mTextureView.setSurfaceListener(this);
+ mSurfaceView.setSurfaceListener(this);
addView(mTextureView);
addView(mSurfaceView);
@@ -405,7 +345,7 @@
*/
public void setMediaControlView(@NonNull MediaControlView mediaControlView, long intervalMs) {
mMediaControlView = mediaControlView;
- mMediaControlView.setDelayedAnimationInterval(intervalMs);
+ mMediaControlView.setShowControllerInterval(intervalMs);
if (isAttachedToWindow()) {
attachMediaControlView();
@@ -509,15 +449,12 @@
}
/**
- * Sets a listener to be called when a view type change is done.
- *
- * @see #setViewType(int)
- *
- * @param listener The listener to be called. A value of <code>null</code> removes any existing
- * listener.
+ * Registers a callback to be invoked when a view type change is done.
+ * {@see #setViewType(int)}
+ * @param l The callback that will be run
*/
- public void setOnViewTypeChangedListener(@Nullable OnViewTypeChangedListener listener) {
- mViewTypeChangedListener = listener;
+ public void setOnViewTypeChangedListener(@Nullable OnViewTypeChangedListener l) {
+ mViewTypeChangedListener = l;
}
@Override
@@ -584,8 +521,7 @@
@Override
public CharSequence getAccessibilityClassName() {
- // Class name may be obfuscated by Proguard. Hardcode the string for accessibility usage.
- return "androidx.media2.widget.VideoView";
+ return VideoView.class.getName();
}
@Override
@@ -612,6 +548,76 @@
}
///////////////////////////////////////////////////
+ // Implements VideoViewInterface.SurfaceListener
+ ///////////////////////////////////////////////////
+
+ /** @hide */
+ @RestrictTo(LIBRARY)
+ @Override
+ public void onSurfaceCreated(View view, int width, int height) {
+ if (DEBUG) {
+ Log.d(TAG, "onSurfaceCreated(). mCurrentState=" + mCurrentState
+ + ", mTargetState=" + mTargetState + ", width/height: " + width + "/" + height
+ + ", " + view.toString());
+ }
+ if (view == mTargetView) {
+ ((VideoViewInterface) view).takeOver();
+ }
+ if (needToStart()) {
+ mMediaSession.getPlayer().play();
+ }
+ }
+
+ /** @hide */
+ @RestrictTo(LIBRARY)
+ @Override
+ public void onSurfaceDestroyed(View view) {
+ if (DEBUG) {
+ Log.d(TAG, "onSurfaceDestroyed(). mCurrentState=" + mCurrentState
+ + ", mTargetState=" + mTargetState + ", " + view.toString());
+ }
+ }
+
+ /** @hide */
+ @RestrictTo(LIBRARY)
+ @Override
+ public void onSurfaceChanged(View view, int width, int height) {
+ if (DEBUG) {
+ Log.d(TAG, "onSurfaceChanged(). width/height: " + width + "/" + height
+ + ", " + view.toString());
+ }
+ }
+
+ /** @hide */
+ @RestrictTo(LIBRARY)
+ @Override
+ public void onSurfaceTakeOverDone(VideoViewInterface view) {
+ if (view != mTargetView) {
+ if (DEBUG) {
+ Log.d(TAG, "onSurfaceTakeOverDone(). view is not targetView. ignore.: " + view);
+ }
+ return;
+ }
+ if (DEBUG) {
+ Log.d(TAG, "onSurfaceTakeOverDone(). Now current view is: " + view);
+ }
+ if (mCurrentState != STATE_PLAYING && mMediaSession != null) {
+ mMediaSession.getPlayer().seekTo(mMediaSession.getPlayer().getCurrentPosition());
+ }
+ if (view != mCurrentView) {
+ ((View) mCurrentView).setVisibility(View.GONE);
+ mCurrentView = view;
+ if (mViewTypeChangedListener != null) {
+ mViewTypeChangedListener.onViewTypeChanged(this, view.getViewType());
+ }
+ }
+
+ if (needToStart()) {
+ mMediaSession.getPlayer().play();
+ }
+ }
+
+ ///////////////////////////////////////////////////
// Protected or private methods
///////////////////////////////////////////////////
private void attachMediaControlView() {
@@ -643,7 +649,7 @@
player.registerPlayerCallback(mCallbackExecutor, mMediaPlayerCallback);
}
- boolean isMediaPrepared() {
+ private boolean isMediaPrepared() {
return mMediaSession != null
&& mMediaSession.getPlayer().getPlayerState() != SessionPlayer.PLAYER_STATE_ERROR
&& mMediaSession.getPlayer().getPlayerState() != SessionPlayer.PLAYER_STATE_IDLE;
@@ -795,6 +801,128 @@
return data;
}
+ MediaMetadata extractMetadata(MediaItem mediaItem, boolean isMusic) {
+ MediaMetadataRetriever retriever = null;
+ String path = "";
+ try {
+ if (mediaItem == null) {
+ return null;
+ } else if (mediaItem instanceof UriMediaItem) {
+ Uri uri = ((UriMediaItem) mediaItem).getUri();
+
+ // Save file name as title since the file may not have a title Metadata.
+ if (UriUtil.isFromNetwork(uri)) {
+ path = uri.getPath();
+ } else if ("file".equals(uri.getScheme())) {
+ path = uri.getLastPathSegment();
+ } else {
+ // TODO: needs default title. b/120515913
+ }
+ retriever = new MediaMetadataRetriever();
+ retriever.setDataSource(getContext(), uri);
+ } else if (mediaItem instanceof FileMediaItem) {
+ retriever = new MediaMetadataRetriever();
+ retriever.setDataSource(
+ ((FileMediaItem) mediaItem).getParcelFileDescriptor().getFileDescriptor(),
+ ((FileMediaItem) mediaItem).getFileDescriptorOffset(),
+ ((FileMediaItem) mediaItem).getFileDescriptorLength());
+ }
+ } catch (IllegalArgumentException e) {
+ Log.v(TAG, "Cannot retrieve metadata for this media file.");
+ retriever = null;
+ }
+
+ MediaMetadata metadata = mediaItem.getMetadata();
+
+ // Do not extract metadata of a media item which is not the current item.
+ if (mediaItem != mMediaItem) {
+ if (retriever != null) {
+ retriever.release();
+ }
+ return null;
+ }
+ if (!isMusic) {
+ mTitle = extractString(metadata,
+ MediaMetadata.METADATA_KEY_TITLE, retriever,
+ MediaMetadataRetriever.METADATA_KEY_TITLE, path);
+ } else {
+ Resources resources = getResources();
+ mTitle = extractString(metadata,
+ MediaMetadata.METADATA_KEY_TITLE, retriever,
+ MediaMetadataRetriever.METADATA_KEY_TITLE,
+ resources.getString(R.string.mcv2_music_title_unknown_text));
+ mMusicArtistText = extractString(metadata,
+ MediaMetadata.METADATA_KEY_ARTIST,
+ retriever,
+ MediaMetadataRetriever.METADATA_KEY_ARTIST,
+ resources.getString(R.string.mcv2_music_artist_unknown_text));
+ mMusicAlbumDrawable = extractAlbumArt(metadata, retriever,
+ resources.getDrawable(R.drawable.ic_default_album_image));
+ }
+
+ if (retriever != null) {
+ retriever.release();
+ }
+
+ // Set duration and title values as MediaMetadata for MediaControlView
+ MediaMetadata.Builder builder = new MediaMetadata.Builder();
+
+ if (isMusic) {
+ builder.putString(MediaMetadata.METADATA_KEY_ARTIST, mMusicArtistText);
+ }
+ builder.putString(MediaMetadata.METADATA_KEY_TITLE, mTitle);
+ builder.putLong(
+ MediaMetadata.METADATA_KEY_DURATION, mMediaSession.getPlayer().getDuration());
+ builder.putString(
+ MediaMetadata.METADATA_KEY_MEDIA_ID, mediaItem.getMediaId());
+ builder.putLong(MediaMetadata.METADATA_KEY_PLAYABLE, 1);
+ return builder.build();
+ }
+
+ // TODO: move this method inside callback to make sure it runs inside the callback thread.
+ private String extractString(MediaMetadata metadata, String stringKey,
+ MediaMetadataRetriever retriever, int intKey, String defaultValue) {
+ String value = null;
+
+ if (metadata != null) {
+ value = metadata.getString(stringKey);
+ if (value != null && !value.isEmpty()) {
+ return value;
+ }
+ }
+ if (retriever != null) {
+ value = retriever.extractMetadata(intKey);
+ }
+ return value == null ? defaultValue : value;
+ }
+
+ // TODO: move this method inside callback to make sure it runs inside the callback thread.
+ private Drawable extractAlbumArt(MediaMetadata metadata, MediaMetadataRetriever retriever,
+ Drawable defaultDrawable) {
+ Bitmap bitmap = null;
+
+ if (metadata != null && metadata.containsKey(MediaMetadata.METADATA_KEY_ALBUM_ART)) {
+ bitmap = metadata.getBitmap(MediaMetadata.METADATA_KEY_ALBUM_ART);
+ } else if (retriever != null) {
+ byte[] album = retriever.getEmbeddedPicture();
+ if (album != null) {
+ bitmap = BitmapFactory.decodeByteArray(album, 0, album.length);
+ }
+ }
+ if (bitmap != null) {
+ Palette.Builder builder = Palette.from(bitmap);
+ builder.generate(new Palette.PaletteAsyncListener() {
+ @Override
+ public void onGenerated(Palette palette) {
+ mDominantColor = palette.getDominantColor(0);
+ mMusicView.setBackgroundColor(mDominantColor);
+ }
+ });
+ return new BitmapDrawable(getResources(), bitmap);
+ }
+ return defaultDrawable;
+ }
+
boolean isCurrentItemMusic() {
return mVideoTrackIndices != null && mVideoTrackIndices.size() == 0
&& mAudioTrackIndices != null && mAudioTrackIndices.size() > 0;
@@ -961,12 +1089,13 @@
// extractMetadata() contains file IO indirectly,
// via MediaMetadataRetriever.
boolean isMusic = isCurrentItemMusic();
- MetadataExtractTask task = new MetadataExtractTask(mMediaItem, isMusic,
- getContext());
+ MetadataExtractTask task = new MetadataExtractTask(mMediaItem, isMusic);
task.execute();
}
if (mMediaControlView != null) {
+ mMediaControlView.setEnabled(true);
+
Uri uri = (mMediaItem instanceof UriMediaItem)
? ((UriMediaItem) mMediaItem).getUri() : null;
if (uri != null && UriUtil.isFromNetwork(uri)) {
@@ -1023,23 +1152,6 @@
}
@Override
- public void onPostConnect(@NonNull MediaSession session,
- @NonNull MediaSession.ControllerInfo controller) {
- if (session != mMediaSession) {
- if (DEBUG) {
- Log.w(TAG, "onPostConnect() is ignored. session is already gone.");
- }
- }
- if (isMediaPrepared()) {
- Bundle data = extractTrackInfoData();
- if (data != null) {
- mMediaSession.broadcastCustomCommand(new SessionCommand(
- MediaControlView.EVENT_UPDATE_TRACK_STATUS, null), data);
- }
- }
- }
-
- @Override
public SessionResult onCustomCommand(@NonNull MediaSession session,
@NonNull MediaSession.ControllerInfo controller,
@NonNull SessionCommand customCommand, @Nullable Bundle args) {
@@ -1111,12 +1223,10 @@
private class MetadataExtractTask extends AsyncTask<Void, Void, MediaMetadata> {
private MediaItem mItem;
private boolean mIsMusic;
- private Context mContext;
- MetadataExtractTask(MediaItem mediaItem, boolean isMusic, Context context) {
+ MetadataExtractTask(MediaItem mediaItem, boolean isMusic) {
mItem = mediaItem;
mIsMusic = isMusic;
- mContext = context;
}
@Override
@@ -1139,128 +1249,6 @@
mMusicView.setVisibility(View.GONE);
}
}
-
- @SuppressLint("RestrictedApi")
- MediaMetadata extractMetadata(MediaItem mediaItem, boolean isMusic) {
- MediaMetadataRetriever retriever = null;
- String path = "";
- try {
- if (mediaItem == null) {
- return null;
- } else if (mediaItem instanceof UriMediaItem) {
- Uri uri = ((UriMediaItem) mediaItem).getUri();
-
- // Save file name as title since the file may not have a title Metadata.
- if (UriUtil.isFromNetwork(uri)) {
- path = uri.getPath();
- } else if ("file".equals(uri.getScheme())) {
- path = uri.getLastPathSegment();
- } else {
- // TODO: needs default title. b/120515913
- }
- retriever = new MediaMetadataRetriever();
- retriever.setDataSource(mContext, uri);
- } else if (mediaItem instanceof FileMediaItem) {
- retriever = new MediaMetadataRetriever();
- retriever.setDataSource(
- ((FileMediaItem) mediaItem).getParcelFileDescriptor()
- .getFileDescriptor(),
- ((FileMediaItem) mediaItem).getFileDescriptorOffset(),
- ((FileMediaItem) mediaItem).getFileDescriptorLength());
- }
- } catch (IllegalArgumentException e) {
- Log.v(TAG, "Cannot retrieve metadata for this media file.");
- retriever = null;
- }
-
- MediaMetadata metadata = mediaItem.getMetadata();
-
- // Do not extract metadata of a media item which is not the current item.
- if (mediaItem != mMediaItem) {
- if (retriever != null) {
- retriever.release();
- }
- return null;
- }
- if (!isMusic) {
- mTitle = extractString(metadata,
- MediaMetadata.METADATA_KEY_TITLE, retriever,
- MediaMetadataRetriever.METADATA_KEY_TITLE, path);
- } else {
- Resources resources = getResources();
- mTitle = extractString(metadata,
- MediaMetadata.METADATA_KEY_TITLE, retriever,
- MediaMetadataRetriever.METADATA_KEY_TITLE,
- resources.getString(R.string.mcv2_music_title_unknown_text));
- mMusicArtistText = extractString(metadata,
- MediaMetadata.METADATA_KEY_ARTIST,
- retriever,
- MediaMetadataRetriever.METADATA_KEY_ARTIST,
- resources.getString(R.string.mcv2_music_artist_unknown_text));
- mMusicAlbumDrawable = extractAlbumArt(metadata, retriever,
- resources.getDrawable(R.drawable.ic_default_album_image));
- }
-
- if (retriever != null) {
- retriever.release();
- }
-
- // Set duration and title values as MediaMetadata for MediaControlView
- MediaMetadata.Builder builder = new MediaMetadata.Builder();
-
- if (isMusic) {
- builder.putString(MediaMetadata.METADATA_KEY_ARTIST, mMusicArtistText);
- }
- builder.putString(MediaMetadata.METADATA_KEY_TITLE, mTitle);
- builder.putLong(
- MediaMetadata.METADATA_KEY_DURATION, mMediaSession.getPlayer().getDuration());
- builder.putString(
- MediaMetadata.METADATA_KEY_MEDIA_ID, mediaItem.getMediaId());
- builder.putLong(MediaMetadata.METADATA_KEY_PLAYABLE, 1);
- return builder.build();
- }
-
- private String extractString(MediaMetadata metadata, String stringKey,
- MediaMetadataRetriever retriever, int intKey, String defaultValue) {
- String value = null;
-
- if (metadata != null) {
- value = metadata.getString(stringKey);
- if (value != null && !value.isEmpty()) {
- return value;
- }
- }
- if (retriever != null) {
- value = retriever.extractMetadata(intKey);
- }
- return value == null ? defaultValue : value;
- }
-
- private Drawable extractAlbumArt(MediaMetadata metadata, MediaMetadataRetriever retriever,
- Drawable defaultDrawable) {
- Bitmap bitmap = null;
-
- if (metadata != null && metadata.containsKey(MediaMetadata.METADATA_KEY_ALBUM_ART)) {
- bitmap = metadata.getBitmap(MediaMetadata.METADATA_KEY_ALBUM_ART);
- } else if (retriever != null) {
- byte[] album = retriever.getEmbeddedPicture();
- if (album != null) {
- bitmap = BitmapFactory.decodeByteArray(album, 0, album.length);
- }
- }
- if (bitmap != null) {
- Palette.Builder builder = Palette.from(bitmap);
- builder.generate(new Palette.PaletteAsyncListener() {
- @Override
- public void onGenerated(Palette palette) {
- mDominantColor = palette.getDominantColor(0);
- mMusicView.setBackgroundColor(mDominantColor);
- }
- });
- return new BitmapDrawable(getResources(), bitmap);
- }
- return defaultDrawable;
- }
}
/**
diff --git a/media2-widget/src/main/res/drawable/ic_audiotrack.xml b/media2-widget/src/main/res/drawable/ic_audiotrack.xml
index 4a5cd33..27c12b5 100644
--- a/media2-widget/src/main/res/drawable/ic_audiotrack.xml
+++ b/media2-widget/src/main/res/drawable/ic_audiotrack.xml
@@ -1,31 +1,9 @@
-<!--
- Copyright 2019 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.
- -->
-
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
- android:viewportWidth="24"
- android:viewportHeight="24">
- <path
- android:pathData="M18.2,1L9.8,1C8.81,1 8,1.81 8,2.8v14.4c0,0.99 0.81,1.79 1.8,1.79l8.4,0.01c0.99,0 1.8,-0.81 1.8,-1.8L20,2.8c0,-0.99 -0.81,-1.8 -1.8,-1.8zM14,3c1.1,0 2,0.89 2,2s-0.9,2 -2,2 -2,-0.89 -2,-2 0.9,-2 2,-2zM14,16.5c-2.21,0 -4,-1.79 -4,-4s1.79,-4 4,-4 4,1.79 4,4 -1.79,4 -4,4z"
- android:fillColor="#FFFFFF"/>
- <path
- android:pathData="M14,12.5m-2.5,0a2.5,2.5 0,1 1,5 0a2.5,2.5 0,1 1,-5 0"
- android:fillColor="#FFFFFF"/>
- <path
- android:pathData="M6,5H4v16c0,1.1 0.89,2 2,2h10v-2H6V5z"
- android:fillColor="#FFFFFF"/>
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M12,3v9.28c-0.47,-0.17 -0.97,-0.28 -1.5,-0.28C8.01,12 6,14.01 6,16.5S8.01,21 10.5,21c2.31,0 4.2,-1.75 4.45,-4H15V6h4V3h-7z"/>
</vector>
diff --git a/media2-widget/src/main/res/drawable/ic_high_quality.xml b/media2-widget/src/main/res/drawable/ic_high_quality.xml
new file mode 100644
index 0000000..f76e22f
--- /dev/null
+++ b/media2-widget/src/main/res/drawable/ic_high_quality.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="34dp"
+ android:height="34dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+
+ <path
+ android:pathData="M0 0h24v24H0z" />
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M19 4H5c-1.11 0-2 0.9-2 2v12c0 1.1 0.89 2 2 2h14c1.1 0 2-0.9 2-2V6c0-1.1-0.9-2-2-2zm-8 11H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm7-1c0 0.55-0.45 1-1 1h-0.75v1.5h-1.5V15H14c-0.55 0-1-0.45-1-1v-4c0-0.55 0.45 -1 1-1h3c0.55 0 1 0.45 1 1v4zm-3.5-0.5h2v-3h-2v3z" />
+</vector>
\ No newline at end of file
diff --git a/media2-widget/src/main/res/drawable/ic_speed.xml b/media2-widget/src/main/res/drawable/ic_speed.xml
deleted file mode 100644
index 7c066bf..0000000
--- a/media2-widget/src/main/res/drawable/ic_speed.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
- Copyright 2019 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.
- -->
-
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="24"
- android:viewportHeight="24">
- <path
- android:pathData="M13.05,9.79L10,7.5v9l3.05,-2.29L16,12zM13.05,9.79L10,7.5v9l3.05,-2.29L16,12zM13.05,9.79L10,7.5v9l3.05,-2.29L16,12zM11,4.07L11,2.05c-2.01,0.2 -3.84,1 -5.32,2.21L7.1,5.69c1.11,-0.86 2.44,-1.44 3.9,-1.62zM5.69,7.1L4.26,5.68C3.05,7.16 2.25,8.99 2.05,11h2.02c0.18,-1.46 0.76,-2.79 1.62,-3.9zM4.07,13L2.05,13c0.2,2.01 1,3.84 2.21,5.32l1.43,-1.43c-0.86,-1.1 -1.44,-2.43 -1.62,-3.89zM5.68,19.74C7.16,20.95 9,21.75 11,21.95v-2.02c-1.46,-0.18 -2.79,-0.76 -3.9,-1.62l-1.42,1.43zM22,12c0,5.16 -3.92,9.42 -8.95,9.95v-2.02C16.97,19.41 20,16.05 20,12s-3.03,-7.41 -6.95,-7.93L13.05,2.05C18.08,2.58 22,6.84 22,12z"
- android:fillColor="#FFFFFF"/>
-</vector>
diff --git a/media2-widget/src/main/res/drawable/title_bar_gradient.xml b/media2-widget/src/main/res/drawable/title_bar_gradient.xml
index 5aef9b8d..1e3bb82 100644
--- a/media2-widget/src/main/res/drawable/title_bar_gradient.xml
+++ b/media2-widget/src/main/res/drawable/title_bar_gradient.xml
@@ -23,5 +23,5 @@
android:layout_width="match_parent"
android:startColor="@color/title_bar_gradient_start"
android:endColor="@color/title_bar_gradient_end"
- android:angle="270" />
+ android:angle="-270" />
</shape>
\ No newline at end of file
diff --git a/media2-widget/src/main/res/layout/embedded_settings_list_item.xml b/media2-widget/src/main/res/layout/embedded_settings_list_item.xml
new file mode 100644
index 0000000..1472b2b
--- /dev/null
+++ b/media2-widget/src/main/res/layout/embedded_settings_list_item.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/mcv2_settings_height"
+ android:orientation="horizontal"
+ android:background="@color/black_opacity_70">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/mcv2_settings_height"
+ android:gravity="center"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/icon"
+ android:layout_width="@dimen/mcv2_settings_icon_size"
+ android:layout_height="@dimen/mcv2_settings_icon_size"
+ android:layout_margin="8dp"
+ android:gravity="center" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:gravity="center|start">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center|start"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/main_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingStart="2dp"
+ android:textColor="@color/white"
+ android:textSize="@dimen/mcv2_settings_main_text_size"/>
+
+ <TextView
+ android:id="@+id/sub_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingStart="2dp"
+ android:textColor="@color/white_opacity_70"
+ android:textSize="@dimen/mcv2_settings_sub_text_size"/>
+ </LinearLayout>
+ </LinearLayout>
+</LinearLayout>
diff --git a/media2-widget/src/main/res/layout/embedded_sub_settings_list_item.xml b/media2-widget/src/main/res/layout/embedded_sub_settings_list_item.xml
new file mode 100644
index 0000000..07319de
--- /dev/null
+++ b/media2-widget/src/main/res/layout/embedded_sub_settings_list_item.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/mcv2_settings_height"
+ android:orientation="horizontal"
+ android:background="@color/black_opacity_70">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/mcv2_settings_height"
+ android:gravity="center"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/check"
+ android:layout_width="@dimen/mcv2_settings_icon_size"
+ android:layout_height="@dimen/mcv2_settings_icon_size"
+ android:layout_margin="8dp"
+ android:gravity="center"
+ android:src="@drawable/ic_check"/>
+ </LinearLayout>
+
+ <RelativeLayout
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/mcv2_settings_height"
+ android:gravity="center"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/text"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/mcv2_settings_text_height"
+ android:gravity="center"
+ android:paddingStart="2dp"
+ android:textColor="@color/white"
+ android:textSize="@dimen/mcv2_settings_main_text_size"/>
+ </RelativeLayout>
+</LinearLayout>
diff --git a/media2-widget/src/main/res/layout/full_settings_list_item.xml b/media2-widget/src/main/res/layout/full_settings_list_item.xml
new file mode 100644
index 0000000..4987472
--- /dev/null
+++ b/media2-widget/src/main/res/layout/full_settings_list_item.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/mcv2_settings_height"
+ android:orientation="horizontal"
+ android:background="@color/black_opacity_70">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/mcv2_settings_height"
+ android:gravity="center"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/icon"
+ android:layout_width="@dimen/mcv2_settings_icon_size"
+ android:layout_height="@dimen/mcv2_settings_icon_size"
+ android:layout_margin="8dp"
+ android:gravity="center"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:gravity="center|start">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center|start"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/main_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingStart="2dp"
+ android:textColor="@color/white"
+ android:textSize="@dimen/mcv2_settings_main_text_size"/>
+
+ <TextView
+ android:id="@+id/sub_text"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingStart="2dp"
+ android:textColor="@color/white_opacity_70"
+ android:textSize="@dimen/mcv2_settings_sub_text_size"/>
+ </LinearLayout>
+ </LinearLayout>
+</LinearLayout>
diff --git a/media2-widget/src/main/res/layout/full_sub_settings_list_item.xml b/media2-widget/src/main/res/layout/full_sub_settings_list_item.xml
new file mode 100644
index 0000000..f07cedc
--- /dev/null
+++ b/media2-widget/src/main/res/layout/full_sub_settings_list_item.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/mcv2_settings_height"
+ android:orientation="horizontal"
+ android:background="@color/black_opacity_70">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/mcv2_settings_height"
+ android:gravity="center"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/check"
+ android:layout_width="@dimen/mcv2_settings_icon_size"
+ android:layout_height="@dimen/mcv2_settings_icon_size"
+ android:layout_margin="8dp"
+ android:gravity="center"
+ android:src="@drawable/ic_check"/>
+ </LinearLayout>
+
+ <RelativeLayout
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/mcv2_settings_height"
+ android:gravity="center"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/text"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/mcv2_settings_text_height"
+ android:gravity="center"
+ android:paddingStart="2dp"
+ android:textColor="@color/white"
+ android:textSize="@dimen/mcv2_settings_main_text_size"/>
+ </RelativeLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/media2-widget/src/main/res/layout/media_controller.xml b/media2-widget/src/main/res/layout/media_controller.xml
index a61317d..73eca03 100644
--- a/media2-widget/src/main/res/layout/media_controller.xml
+++ b/media2-widget/src/main/res/layout/media_controller.xml
@@ -14,33 +14,14 @@
limitations under the License.
-->
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <FrameLayout
- android:id="@+id/center_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/center_view_background"
- android:layoutDirection="ltr">
-
- <include
- android:id="@+id/embedded_transport_controls"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- layout="@layout/embedded_transport_controls" />
-
- <include
- android:id="@+id/minimal_transport_controls"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- layout="@layout/minimal_transport_controls" />
- </FrameLayout>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
<LinearLayout
android:id="@+id/title_bar"
android:background="@drawable/title_bar_gradient"
- android:baselineAligned="false"
style="@style/TitleBar">
<LinearLayout
@@ -49,6 +30,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
+ android:layout_alignParentStart="true"
android:orientation="horizontal">
<TextView
@@ -68,6 +50,7 @@
android:id="@+id/title_bar_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
android:orientation="horizontal">
<LinearLayout
@@ -75,6 +58,7 @@
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
android:paddingStart="5dip"
android:paddingEnd="10dip"
android:orientation="horizontal"
@@ -84,7 +68,6 @@
android:id="@+id/ad_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
android:paddingEnd="5dip"
android:text="@string/MediaControlView_ad_text"
android:textSize="10sp"
@@ -102,126 +85,33 @@
android:visibility="gone"
style="@style/TitleBarButton" />
</LinearLayout>
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/center_view"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"
+ android:gravity="center"
+ android:orientation="vertical"
+ android:layoutDirection="ltr">
</LinearLayout>
<LinearLayout
android:id="@+id/minimal_fullscreen_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:gravity="end"
+ android:gravity="right"
android:layoutDirection="ltr">
<ImageButton
android:id="@+id/minimal_fullscreen"
+ android:gravity="right"
style="@style/BottomBarButton.FullScreen" />
</LinearLayout>
- <View
- android:id="@+id/bottom_bar_background"
- android:layout_width="match_parent"
- android:layout_height="@dimen/mcv2_bottom_bar_height"
- android:background="@color/bottom_bar_background"
- android:layoutDirection="ltr" />
-
- <LinearLayout
- android:id="@+id/bottom_bar_left"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/mcv2_bottom_bar_height"
- android:layoutDirection="ltr">
-
- <include
- android:id="@+id/full_transport_controls"
- layout="@layout/full_transport_controls" />
-
- <TextView
- android:id="@+id/ad_skip_time"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_marginStart="4dp"
- android:gravity="center"
- android:textColor="#FFFFFF"
- android:textSize="12sp"
- android:visibility="gone" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/time"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/mcv2_bottom_bar_height"
- android:paddingStart="10dp"
- android:paddingEnd="10dp"
- android:layoutDirection="ltr">
-
- <TextView
- android:id="@+id/time_current"
- style="@style/TimeText.Current" />
-
- <TextView
- android:id="@+id/time_interpunct"
- style="@style/TimeText.Interpunct" />
-
- <TextView
- android:id="@+id/time_end"
- style="@style/TimeText.End" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/basic_controls"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layoutDirection="ltr">
-
- <TextView
- android:id="@+id/ad_remaining"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:textColor="#FFFFFF"
- android:textSize="12sp"
- android:visibility="gone" />
-
- <ImageButton
- android:id="@+id/subtitle"
- style="@style/BottomBarButton.CC"
- android:alpha="0.5"
- android:scaleType="fitCenter"
- android:visibility="gone" />
-
- <ImageButton
- android:id="@+id/fullscreen"
- style="@style/BottomBarButton.FullScreen"
- android:visibility="gone" />
-
- <ImageButton
- android:id="@+id/overflow_show"
- style="@style/BottomBarButton.OverflowShow" />
- </LinearLayout>
-
- <LinearLayout
- android:id="@+id/extra_controls"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:visibility="gone"
- android:layoutDirection="ltr">
-
- <LinearLayout
- android:id="@+id/custom_buttons"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal" />
-
- <ImageButton
- android:id="@+id/settings"
- style="@style/BottomBarButton.Settings" />
-
- <ImageButton
- android:id="@+id/overflow_hide"
- style="@style/BottomBarButton.OverflowHide" />
- </LinearLayout>
-
- <FrameLayout
+ <RelativeLayout
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/mcv2_custom_progress_thumb_size"
@@ -230,16 +120,142 @@
<SeekBar
android:id="@+id/progress"
android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_height="@dimen/mcv2_custom_progress_thumb_size"
android:contentDescription="@string/mcv2_seek_bar_desc"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:maxHeight="@dimen/mcv2_custom_progress_max_size"
android:minHeight="@dimen/mcv2_custom_progress_max_size"
- android:progressDrawable="@drawable/custom_progress"
- android:thumb="@drawable/custom_progress_thumb"
- android:thumbOffset="0dp"
android:splitTrack="false"
- android:elevation="10dp" />
- </FrameLayout>
-</merge>
+ android:elevation="10dp"/>
+
+ <View
+ android:id="@+id/progress_buffer"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/mcv2_buffer_view_height"
+ android:layout_alignParentBottom="true"
+ android:background="@color/bottom_bar_background"
+ android:elevation="0dp"/>
+ </RelativeLayout>
+
+ <RelativeLayout
+ android:id="@+id/bottom_bar"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/mcv2_bottom_bar_height"
+ android:background="@color/bottom_bar_background"
+ android:orientation="horizontal"
+ android:layoutDirection="ltr">
+
+ <LinearLayout
+ android:id="@+id/bottom_bar_left"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_alignParentStart="true"
+ android:layout_centerVertical="true">
+
+ <TextView
+ android:id="@+id/ad_skip_time"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_marginStart="4dp"
+ android:gravity="center"
+ android:textColor="#FFFFFF"
+ android:textSize="12sp"
+ android:visibility="gone" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/time"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_toEndOf="@id/bottom_bar_left"
+ android:visibility="invisible"
+ android:gravity="center"
+ android:paddingStart="10dp"
+ android:paddingEnd="10dp">
+
+ <TextView
+ android:id="@+id/time_current"
+ style="@style/TimeText.Current" />
+
+ <TextView
+ android:id="@+id/time_interpunct"
+ style="@style/TimeText.Interpunct" />
+
+ <TextView
+ android:id="@+id/time_end"
+ style="@style/TimeText.End" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/bottom_bar_overflow"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentEnd="true"
+ android:layout_centerVertical="true">
+
+ <ImageButton
+ android:id="@+id/overflow_show"
+ style="@style/BottomBarButton.OverflowShow" />
+
+ <ImageButton
+ android:id="@+id/overflow_hide"
+ android:visibility="gone"
+ style="@style/BottomBarButton.OverflowHide" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/basic_controls"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_toStartOf="@id/bottom_bar_overflow"
+ android:layout_centerVertical="true"
+ android:orientation="horizontal">
+
+ <TextView
+ android:id="@+id/ad_remaining"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:textColor="#FFFFFF"
+ android:textSize="12sp"
+ android:visibility="gone" />
+
+ <ImageButton
+ android:id="@+id/subtitle"
+ style="@style/BottomBarButton.CC"
+ android:alpha="0.5"
+ android:scaleType="fitCenter"
+ android:visibility="gone" />
+
+ <ImageButton
+ android:id="@+id/fullscreen"
+ style="@style/BottomBarButton.FullScreen"
+ android:visibility="gone" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/extra_controls"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:layout_alignParentEnd="true"
+ android:orientation="horizontal"
+ android:visibility="gone">
+
+ <LinearLayout
+ android:id="@+id/custom_buttons"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal" />
+
+ <ImageButton
+ android:id="@+id/video_quality"
+ style="@style/BottomBarButton.VideoQuality" />
+
+ <ImageButton
+ android:id="@+id/settings"
+ style="@style/BottomBarButton.Settings" />
+ </LinearLayout>
+ </RelativeLayout>
+</LinearLayout>
diff --git a/media2-widget/src/main/res/layout/music_with_title_portrait.xml b/media2-widget/src/main/res/layout/music_with_title_portrait.xml
index 66af0fd..bd19b00 100644
--- a/media2-widget/src/main/res/layout/music_with_title_portrait.xml
+++ b/media2-widget/src/main/res/layout/music_with_title_portrait.xml
@@ -30,8 +30,7 @@
<TextView
android:id="@+id/title"
- android:maxWidth="@dimen/MusicView_full_image_size"
- android:layout_width="wrap_content"
+ android:layout_width="@dimen/MusicView_full_image_size"
android:layout_height="wrap_content"
android:text="@string/mcv2_music_title_unknown_text"
android:textSize="@dimen/MusicView_title_text_size"
@@ -40,8 +39,7 @@
<TextView
android:id="@+id/artist"
- android:maxWidth="@dimen/MusicView_full_image_size"
- android:layout_width="wrap_content"
+ android:layout_width="@dimen/MusicView_full_image_size"
android:layout_height="wrap_content"
android:text="@string/mcv2_music_artist_unknown_text"
android:textSize="@dimen/MusicView_artist_text_size"
diff --git a/media2-widget/src/main/res/layout/settings_list_item.xml b/media2-widget/src/main/res/layout/settings_list_item.xml
deleted file mode 100644
index d7bc0b4..0000000
--- a/media2-widget/src/main/res/layout/settings_list_item.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/mcv2_settings_height"
- android:orientation="horizontal"
- android:background="@color/black_opacity_70">
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="@dimen/mcv2_settings_height"
- android:gravity="center|start"
- android:orientation="horizontal">
-
- <ImageView
- android:id="@+id/icon"
- android:layout_width="@dimen/mcv2_settings_icon_size"
- android:layout_height="@dimen/mcv2_settings_icon_size"
- android:layout_margin="8dp" />
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:gravity="center|start">
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/main_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:paddingStart="2dp"
- android:textColor="@color/white"
- android:textSize="@dimen/mcv2_settings_main_text_size"/>
-
- <TextView
- android:id="@+id/sub_text"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:paddingStart="2dp"
- android:textColor="@color/white_opacity_70"
- android:textSize="@dimen/mcv2_settings_sub_text_size"/>
- </LinearLayout>
- </LinearLayout>
-</LinearLayout>
diff --git a/media2-widget/src/main/res/layout/sub_settings_list_item.xml b/media2-widget/src/main/res/layout/sub_settings_list_item.xml
deleted file mode 100644
index 0b1bf1e..0000000
--- a/media2-widget/src/main/res/layout/sub_settings_list_item.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/mcv2_settings_height"
- android:orientation="horizontal"
- android:background="@color/black_opacity_70">
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="@dimen/mcv2_settings_height"
- android:gravity="center|start"
- android:orientation="horizontal">
-
- <ImageView
- android:id="@+id/check"
- android:layout_width="@dimen/mcv2_settings_icon_size"
- android:layout_height="@dimen/mcv2_settings_icon_size"
- android:layout_margin="8dp"
- android:src="@drawable/ic_check"/>
- </LinearLayout>
-
- <RelativeLayout
- android:layout_width="wrap_content"
- android:layout_height="@dimen/mcv2_settings_height"
- android:gravity="center|start"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/text"
- android:layout_width="wrap_content"
- android:layout_height="@dimen/mcv2_settings_text_height"
- android:paddingStart="2dp"
- android:textColor="@color/white"
- android:textSize="@dimen/mcv2_settings_main_text_size"/>
- </RelativeLayout>
-</LinearLayout>
\ No newline at end of file
diff --git a/media2-widget/src/main/res/values/colors.xml b/media2-widget/src/main/res/values/colors.xml
index 56cda35..3aff9da 100644
--- a/media2-widget/src/main/res/values/colors.xml
+++ b/media2-widget/src/main/res/values/colors.xml
@@ -24,8 +24,7 @@
<color name="white">#ffffff</color>
<color name="white_opacity_70">#B3ffffff</color>
<color name="black_opacity_70">#B3000000</color>
- <color name="title_bar_gradient_start">#d0000000</color>
+ <color name="title_bar_gradient_start">#50000000</color>
<color name="title_bar_gradient_end">#00000000</color>
- <color name="center_view_background">#90000000</color>
- <color name="bottom_bar_background">#b0000000</color>
-</resources>
+ <color name="bottom_bar_background">#40202020</color>
+</resources>
\ No newline at end of file
diff --git a/media2-widget/src/main/res/values/dimens.xml b/media2-widget/src/main/res/values/dimens.xml
index d27e6fb..b002ad0 100644
--- a/media2-widget/src/main/res/values/dimens.xml
+++ b/media2-widget/src/main/res/values/dimens.xml
@@ -33,7 +33,7 @@
<dimen name="mcv2_custom_progress_max_size">2dp</dimen>
<dimen name="mcv2_custom_progress_thumb_size">12dp</dimen>
- <dimen name="mcv2_custom_progress_margin_bottom">43dp</dimen>
+ <dimen name="mcv2_buffer_view_height">5dp</dimen>
<dimen name="mcv2_title_bar_height">48dp</dimen>
<dimen name="mcv2_bottom_bar_height">48dp</dimen>
diff --git a/media2-widget/src/main/res/values/styles.xml b/media2-widget/src/main/res/values/styles.xml
index 517f546..3e6a07c 100644
--- a/media2-widget/src/main/res/values/styles.xml
+++ b/media2-widget/src/main/res/values/styles.xml
@@ -121,7 +121,6 @@
<style name="TimeText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
- <item name="android:layout_gravity">center_vertical</item>
<item name="android:paddingLeft">4dp</item>
<item name="android:paddingRight">4dp</item>
<item name="android:textStyle">bold</item>
@@ -177,4 +176,9 @@
<item name="android:src">@drawable/ic_settings</item>
<item name="android:contentDescription">@string/mcv2_settings_button_desc</item>
</style>
+
+ <style name="BottomBarButton.VideoQuality">
+ <item name="android:src">@drawable/ic_high_quality</item>
+ <item name="android:contentDescription">@string/mcv2_video_quality_button_desc</item>
+ </style>
</resources>
diff --git a/media2/api/1.0.0-alpha03.txt b/media2/api/1.0.0-alpha03.txt
index 60039ed..b80bd0b 100644
--- a/media2/api/1.0.0-alpha03.txt
+++ b/media2/api/1.0.0-alpha03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.media2 {
public class CallbackMediaItem extends androidx.media2.MediaItem {
diff --git a/media2/api/1.0.0-alpha04.txt b/media2/api/1.0.0-alpha04.txt
index 4fdd9cb..4ebdcb2 100644
--- a/media2/api/1.0.0-alpha04.txt
+++ b/media2/api/1.0.0-alpha04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.media2 {
public class CallbackMediaItem extends androidx.media2.MediaItem {
diff --git a/media2/api/1.0.0-alpha05.txt b/media2/api/1.0.0-alpha05.txt
index 331fa20..48e9b5b 100644
--- a/media2/api/1.0.0-alpha05.txt
+++ b/media2/api/1.0.0-alpha05.txt
@@ -1,16 +1,16 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.media2 {
public class CallbackMediaItem extends androidx.media2.MediaItem {
method public androidx.media2.DataSourceCallback getDataSourceCallback();
}
- public static final class CallbackMediaItem.Builder extends androidx.media2.MediaItem.Builder {
+ public static final class CallbackMediaItem.Builder {
ctor public CallbackMediaItem.Builder(androidx.media2.DataSourceCallback);
method public androidx.media2.CallbackMediaItem build();
- method public androidx.media2.CallbackMediaItem.Builder setEndPosition(long);
- method public androidx.media2.CallbackMediaItem.Builder setMetadata(androidx.media2.MediaMetadata?);
- method public androidx.media2.CallbackMediaItem.Builder setStartPosition(long);
+ method public androidx.media2.CallbackMediaItem.Builder! setEndPosition(long);
+ method public androidx.media2.CallbackMediaItem.Builder! setMetadata(androidx.media2.MediaMetadata!);
+ method public androidx.media2.CallbackMediaItem.Builder! setStartPosition(long);
}
public abstract class DataSourceCallback implements java.io.Closeable {
@@ -26,13 +26,13 @@
field public static final long FD_LENGTH_UNKNOWN = 576460752303423487L; // 0x7ffffffffffffffL
}
- public static final class FileMediaItem.Builder extends androidx.media2.MediaItem.Builder {
+ public static final class FileMediaItem.Builder {
ctor public FileMediaItem.Builder(android.os.ParcelFileDescriptor);
ctor public FileMediaItem.Builder(android.os.ParcelFileDescriptor, long, long);
method public androidx.media2.FileMediaItem build();
- method public androidx.media2.FileMediaItem.Builder setEndPosition(long);
- method public androidx.media2.FileMediaItem.Builder setMetadata(androidx.media2.MediaMetadata?);
- method public androidx.media2.FileMediaItem.Builder setStartPosition(long);
+ method public androidx.media2.FileMediaItem.Builder! setEndPosition(long);
+ method public androidx.media2.FileMediaItem.Builder! setMetadata(androidx.media2.MediaMetadata!);
+ method public androidx.media2.FileMediaItem.Builder! setStartPosition(long);
}
public final class HeartRating implements androidx.media2.Rating {
@@ -53,7 +53,7 @@
method public int getResultCode();
field public static final int RESULT_ERROR_BAD_VALUE = -3; // 0xfffffffd
field public static final int RESULT_ERROR_INVALID_STATE = -2; // 0xfffffffe
- field public static final int RESULT_ERROR_IO = -5; // 0xfffffffb
+ field public static final int RESULT_ERROR_IO_ERROR = -5; // 0xfffffffb
field public static final int RESULT_ERROR_NOT_SUPPORTED = -6; // 0xfffffffa
field public static final int RESULT_ERROR_PERMISSION_DENIED = -4; // 0xfffffffc
field public static final int RESULT_ERROR_SESSION_AUTHENTICATION_EXPIRED = -102; // 0xffffff9a
@@ -64,7 +64,7 @@
field public static final int RESULT_ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED = -103; // 0xffffff99
field public static final int RESULT_ERROR_SESSION_SETUP_REQUIRED = -108; // 0xffffff94
field public static final int RESULT_ERROR_SESSION_SKIP_LIMIT_REACHED = -107; // 0xffffff95
- field public static final int RESULT_ERROR_UNKNOWN = -1; // 0xffffffff
+ field public static final int RESULT_ERROR_UNKNOWN_ERROR = -1; // 0xffffffff
field public static final int RESULT_INFO_SKIPPED = 1; // 0x1
field public static final int RESULT_SUCCESS = 0; // 0x0
}
@@ -176,10 +176,10 @@
public static class MediaItem.Builder {
ctor public MediaItem.Builder();
- method public androidx.media2.MediaItem build();
- method public androidx.media2.MediaItem.Builder setEndPosition(long);
- method public androidx.media2.MediaItem.Builder setMetadata(androidx.media2.MediaMetadata?);
- method public androidx.media2.MediaItem.Builder setStartPosition(long);
+ method public androidx.media2.MediaItem! build();
+ method public androidx.media2.MediaItem.Builder! setEndPosition(long);
+ method public androidx.media2.MediaItem.Builder! setMetadata(androidx.media2.MediaMetadata!);
+ method public androidx.media2.MediaItem.Builder! setStartPosition(long);
}
public abstract class MediaLibraryService extends androidx.media2.MediaSessionService {
@@ -579,15 +579,15 @@
method public abstract int getBufferingState();
method protected final java.util.List<androidx.core.util.Pair<androidx.media2.SessionPlayer.PlayerCallback,java.util.concurrent.Executor>> getCallbacks();
method public abstract androidx.media2.MediaItem? getCurrentMediaItem();
- method @IntRange(from=androidx.media2.SessionPlayer.INVALID_ITEM_INDEX) public abstract int getCurrentMediaItemIndex();
+ method public abstract int getCurrentMediaItemIndex();
method public abstract long getCurrentPosition();
method public abstract long getDuration();
- method @IntRange(from=androidx.media2.SessionPlayer.INVALID_ITEM_INDEX) public abstract int getNextMediaItemIndex();
+ method public abstract int getNextMediaItemIndex();
method public abstract float getPlaybackSpeed();
method public abstract int getPlayerState();
method public abstract java.util.List<androidx.media2.MediaItem>? getPlaylist();
method public abstract androidx.media2.MediaMetadata? getPlaylistMetadata();
- method @IntRange(from=androidx.media2.SessionPlayer.INVALID_ITEM_INDEX) public abstract int getPreviousMediaItemIndex();
+ method public abstract int getPreviousMediaItemIndex();
method public abstract int getRepeatMode();
method public abstract int getShuffleMode();
method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult> pause();
@@ -649,10 +649,10 @@
method public int getResultCode();
field public static final int RESULT_ERROR_BAD_VALUE = -3; // 0xfffffffd
field public static final int RESULT_ERROR_INVALID_STATE = -2; // 0xfffffffe
- field public static final int RESULT_ERROR_IO = -5; // 0xfffffffb
+ field public static final int RESULT_ERROR_IO_ERROR = -5; // 0xfffffffb
field public static final int RESULT_ERROR_NOT_SUPPORTED = -6; // 0xfffffffa
field public static final int RESULT_ERROR_PERMISSION_DENIED = -4; // 0xfffffffc
- field public static final int RESULT_ERROR_UNKNOWN = -1; // 0xffffffff
+ field public static final int RESULT_ERROR_UNKNOWN_ERROR = -1; // 0xffffffff
field public static final int RESULT_INFO_SKIPPED = 1; // 0x1
field public static final int RESULT_SUCCESS = 0; // 0x0
}
@@ -665,7 +665,7 @@
method public int getResultCode();
field public static final int RESULT_ERROR_BAD_VALUE = -3; // 0xfffffffd
field public static final int RESULT_ERROR_INVALID_STATE = -2; // 0xfffffffe
- field public static final int RESULT_ERROR_IO = -5; // 0xfffffffb
+ field public static final int RESULT_ERROR_IO_ERROR = -5; // 0xfffffffb
field public static final int RESULT_ERROR_NOT_SUPPORTED = -6; // 0xfffffffa
field public static final int RESULT_ERROR_PERMISSION_DENIED = -4; // 0xfffffffc
field public static final int RESULT_ERROR_SESSION_AUTHENTICATION_EXPIRED = -102; // 0xffffff9a
@@ -676,7 +676,7 @@
field public static final int RESULT_ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED = -103; // 0xffffff99
field public static final int RESULT_ERROR_SESSION_SETUP_REQUIRED = -108; // 0xffffff94
field public static final int RESULT_ERROR_SESSION_SKIP_LIMIT_REACHED = -107; // 0xffffff95
- field public static final int RESULT_ERROR_UNKNOWN = -1; // 0xffffffff
+ field public static final int RESULT_ERROR_UNKNOWN_ERROR = -1; // 0xffffffff
field public static final int RESULT_INFO_SKIPPED = 1; // 0x1
field public static final int RESULT_SUCCESS = 0; // 0x0
}
@@ -729,13 +729,13 @@
method public java.util.Map<java.lang.String,java.lang.String>? getUriHeaders();
}
- public static final class UriMediaItem.Builder extends androidx.media2.MediaItem.Builder {
+ public static final class UriMediaItem.Builder {
ctor public UriMediaItem.Builder(android.content.Context, android.net.Uri);
ctor public UriMediaItem.Builder(android.content.Context, android.net.Uri, java.util.Map<java.lang.String,java.lang.String>?, java.util.List<java.net.HttpCookie>?);
method public androidx.media2.UriMediaItem build();
- method public androidx.media2.UriMediaItem.Builder setEndPosition(long);
- method public androidx.media2.UriMediaItem.Builder setMetadata(androidx.media2.MediaMetadata?);
- method public androidx.media2.UriMediaItem.Builder setStartPosition(long);
+ method public androidx.media2.UriMediaItem.Builder! setEndPosition(long);
+ method public androidx.media2.UriMediaItem.Builder! setMetadata(androidx.media2.MediaMetadata!);
+ method public androidx.media2.UriMediaItem.Builder! setStartPosition(long);
}
public final class VideoSize {
diff --git a/media2/api/current.txt b/media2/api/current.txt
index 331fa20..48e9b5b 100644
--- a/media2/api/current.txt
+++ b/media2/api/current.txt
@@ -1,16 +1,16 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.media2 {
public class CallbackMediaItem extends androidx.media2.MediaItem {
method public androidx.media2.DataSourceCallback getDataSourceCallback();
}
- public static final class CallbackMediaItem.Builder extends androidx.media2.MediaItem.Builder {
+ public static final class CallbackMediaItem.Builder {
ctor public CallbackMediaItem.Builder(androidx.media2.DataSourceCallback);
method public androidx.media2.CallbackMediaItem build();
- method public androidx.media2.CallbackMediaItem.Builder setEndPosition(long);
- method public androidx.media2.CallbackMediaItem.Builder setMetadata(androidx.media2.MediaMetadata?);
- method public androidx.media2.CallbackMediaItem.Builder setStartPosition(long);
+ method public androidx.media2.CallbackMediaItem.Builder! setEndPosition(long);
+ method public androidx.media2.CallbackMediaItem.Builder! setMetadata(androidx.media2.MediaMetadata!);
+ method public androidx.media2.CallbackMediaItem.Builder! setStartPosition(long);
}
public abstract class DataSourceCallback implements java.io.Closeable {
@@ -26,13 +26,13 @@
field public static final long FD_LENGTH_UNKNOWN = 576460752303423487L; // 0x7ffffffffffffffL
}
- public static final class FileMediaItem.Builder extends androidx.media2.MediaItem.Builder {
+ public static final class FileMediaItem.Builder {
ctor public FileMediaItem.Builder(android.os.ParcelFileDescriptor);
ctor public FileMediaItem.Builder(android.os.ParcelFileDescriptor, long, long);
method public androidx.media2.FileMediaItem build();
- method public androidx.media2.FileMediaItem.Builder setEndPosition(long);
- method public androidx.media2.FileMediaItem.Builder setMetadata(androidx.media2.MediaMetadata?);
- method public androidx.media2.FileMediaItem.Builder setStartPosition(long);
+ method public androidx.media2.FileMediaItem.Builder! setEndPosition(long);
+ method public androidx.media2.FileMediaItem.Builder! setMetadata(androidx.media2.MediaMetadata!);
+ method public androidx.media2.FileMediaItem.Builder! setStartPosition(long);
}
public final class HeartRating implements androidx.media2.Rating {
@@ -53,7 +53,7 @@
method public int getResultCode();
field public static final int RESULT_ERROR_BAD_VALUE = -3; // 0xfffffffd
field public static final int RESULT_ERROR_INVALID_STATE = -2; // 0xfffffffe
- field public static final int RESULT_ERROR_IO = -5; // 0xfffffffb
+ field public static final int RESULT_ERROR_IO_ERROR = -5; // 0xfffffffb
field public static final int RESULT_ERROR_NOT_SUPPORTED = -6; // 0xfffffffa
field public static final int RESULT_ERROR_PERMISSION_DENIED = -4; // 0xfffffffc
field public static final int RESULT_ERROR_SESSION_AUTHENTICATION_EXPIRED = -102; // 0xffffff9a
@@ -64,7 +64,7 @@
field public static final int RESULT_ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED = -103; // 0xffffff99
field public static final int RESULT_ERROR_SESSION_SETUP_REQUIRED = -108; // 0xffffff94
field public static final int RESULT_ERROR_SESSION_SKIP_LIMIT_REACHED = -107; // 0xffffff95
- field public static final int RESULT_ERROR_UNKNOWN = -1; // 0xffffffff
+ field public static final int RESULT_ERROR_UNKNOWN_ERROR = -1; // 0xffffffff
field public static final int RESULT_INFO_SKIPPED = 1; // 0x1
field public static final int RESULT_SUCCESS = 0; // 0x0
}
@@ -176,10 +176,10 @@
public static class MediaItem.Builder {
ctor public MediaItem.Builder();
- method public androidx.media2.MediaItem build();
- method public androidx.media2.MediaItem.Builder setEndPosition(long);
- method public androidx.media2.MediaItem.Builder setMetadata(androidx.media2.MediaMetadata?);
- method public androidx.media2.MediaItem.Builder setStartPosition(long);
+ method public androidx.media2.MediaItem! build();
+ method public androidx.media2.MediaItem.Builder! setEndPosition(long);
+ method public androidx.media2.MediaItem.Builder! setMetadata(androidx.media2.MediaMetadata!);
+ method public androidx.media2.MediaItem.Builder! setStartPosition(long);
}
public abstract class MediaLibraryService extends androidx.media2.MediaSessionService {
@@ -579,15 +579,15 @@
method public abstract int getBufferingState();
method protected final java.util.List<androidx.core.util.Pair<androidx.media2.SessionPlayer.PlayerCallback,java.util.concurrent.Executor>> getCallbacks();
method public abstract androidx.media2.MediaItem? getCurrentMediaItem();
- method @IntRange(from=androidx.media2.SessionPlayer.INVALID_ITEM_INDEX) public abstract int getCurrentMediaItemIndex();
+ method public abstract int getCurrentMediaItemIndex();
method public abstract long getCurrentPosition();
method public abstract long getDuration();
- method @IntRange(from=androidx.media2.SessionPlayer.INVALID_ITEM_INDEX) public abstract int getNextMediaItemIndex();
+ method public abstract int getNextMediaItemIndex();
method public abstract float getPlaybackSpeed();
method public abstract int getPlayerState();
method public abstract java.util.List<androidx.media2.MediaItem>? getPlaylist();
method public abstract androidx.media2.MediaMetadata? getPlaylistMetadata();
- method @IntRange(from=androidx.media2.SessionPlayer.INVALID_ITEM_INDEX) public abstract int getPreviousMediaItemIndex();
+ method public abstract int getPreviousMediaItemIndex();
method public abstract int getRepeatMode();
method public abstract int getShuffleMode();
method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.media2.SessionPlayer.PlayerResult> pause();
@@ -649,10 +649,10 @@
method public int getResultCode();
field public static final int RESULT_ERROR_BAD_VALUE = -3; // 0xfffffffd
field public static final int RESULT_ERROR_INVALID_STATE = -2; // 0xfffffffe
- field public static final int RESULT_ERROR_IO = -5; // 0xfffffffb
+ field public static final int RESULT_ERROR_IO_ERROR = -5; // 0xfffffffb
field public static final int RESULT_ERROR_NOT_SUPPORTED = -6; // 0xfffffffa
field public static final int RESULT_ERROR_PERMISSION_DENIED = -4; // 0xfffffffc
- field public static final int RESULT_ERROR_UNKNOWN = -1; // 0xffffffff
+ field public static final int RESULT_ERROR_UNKNOWN_ERROR = -1; // 0xffffffff
field public static final int RESULT_INFO_SKIPPED = 1; // 0x1
field public static final int RESULT_SUCCESS = 0; // 0x0
}
@@ -665,7 +665,7 @@
method public int getResultCode();
field public static final int RESULT_ERROR_BAD_VALUE = -3; // 0xfffffffd
field public static final int RESULT_ERROR_INVALID_STATE = -2; // 0xfffffffe
- field public static final int RESULT_ERROR_IO = -5; // 0xfffffffb
+ field public static final int RESULT_ERROR_IO_ERROR = -5; // 0xfffffffb
field public static final int RESULT_ERROR_NOT_SUPPORTED = -6; // 0xfffffffa
field public static final int RESULT_ERROR_PERMISSION_DENIED = -4; // 0xfffffffc
field public static final int RESULT_ERROR_SESSION_AUTHENTICATION_EXPIRED = -102; // 0xffffff9a
@@ -676,7 +676,7 @@
field public static final int RESULT_ERROR_SESSION_PREMIUM_ACCOUNT_REQUIRED = -103; // 0xffffff99
field public static final int RESULT_ERROR_SESSION_SETUP_REQUIRED = -108; // 0xffffff94
field public static final int RESULT_ERROR_SESSION_SKIP_LIMIT_REACHED = -107; // 0xffffff95
- field public static final int RESULT_ERROR_UNKNOWN = -1; // 0xffffffff
+ field public static final int RESULT_ERROR_UNKNOWN_ERROR = -1; // 0xffffffff
field public static final int RESULT_INFO_SKIPPED = 1; // 0x1
field public static final int RESULT_SUCCESS = 0; // 0x0
}
@@ -729,13 +729,13 @@
method public java.util.Map<java.lang.String,java.lang.String>? getUriHeaders();
}
- public static final class UriMediaItem.Builder extends androidx.media2.MediaItem.Builder {
+ public static final class UriMediaItem.Builder {
ctor public UriMediaItem.Builder(android.content.Context, android.net.Uri);
ctor public UriMediaItem.Builder(android.content.Context, android.net.Uri, java.util.Map<java.lang.String,java.lang.String>?, java.util.List<java.net.HttpCookie>?);
method public androidx.media2.UriMediaItem build();
- method public androidx.media2.UriMediaItem.Builder setEndPosition(long);
- method public androidx.media2.UriMediaItem.Builder setMetadata(androidx.media2.MediaMetadata?);
- method public androidx.media2.UriMediaItem.Builder setStartPosition(long);
+ method public androidx.media2.UriMediaItem.Builder! setEndPosition(long);
+ method public androidx.media2.UriMediaItem.Builder! setMetadata(androidx.media2.MediaMetadata!);
+ method public androidx.media2.UriMediaItem.Builder! setStartPosition(long);
}
public final class VideoSize {
diff --git a/media2/build.gradle b/media2/build.gradle
index 9c4a928..4cab638 100644
--- a/media2/build.gradle
+++ b/media2/build.gradle
@@ -12,7 +12,6 @@
api('androidx.versionedparcelable:versionedparcelable:1.1.0-alpha01')
api(GUAVA_LISTENABLE_FUTURE)
implementation(project(":concurrent:concurrent-futures"))
- implementation(project(":collection"))
compileOnly(CHECKER_FRAMEWORK)
// Depend on media2-exoplayer so that the library groupId is set to match media2.
implementation(project(":media2-exoplayer"))
@@ -46,5 +45,4 @@
description = "Media2"
failOnUncheckedWarnings = false
failOnDeprecationWarnings = false
- trackRestrictedAPIs = false
}
diff --git a/media2/src/androidTest/java/androidx/media2/MediaBrowserLegacyTest.java b/media2/src/androidTest/java/androidx/media2/MediaBrowserLegacyTest.java
index 2c7b9a7..bbdc4af 100644
--- a/media2/src/androidTest/java/androidx/media2/MediaBrowserLegacyTest.java
+++ b/media2/src/androidTest/java/androidx/media2/MediaBrowserLegacyTest.java
@@ -42,7 +42,7 @@
import androidx.media2.MediaController.ControllerCallback;
import androidx.media2.MediaLibraryService.LibraryParams;
import androidx.media2.MockMediaBrowserServiceCompat.Proxy;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import com.google.common.util.concurrent.ListenableFuture;
@@ -59,7 +59,7 @@
/**
* Tests {@link MediaBrowser} with {@link MediaBrowserServiceCompat}.
*/
-@LargeTest
+@SmallTest
public class MediaBrowserLegacyTest extends MediaSessionTestBase {
private static final String TAG = "MediaBrowserLegacyTest";
diff --git a/media2/src/androidTest/java/androidx/media2/MediaBrowserTest.java b/media2/src/androidTest/java/androidx/media2/MediaBrowserTest.java
index 3d02ea1..d3e73eb 100644
--- a/media2/src/androidTest/java/androidx/media2/MediaBrowserTest.java
+++ b/media2/src/androidTest/java/androidx/media2/MediaBrowserTest.java
@@ -47,6 +47,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -65,7 +66,7 @@
// TODO(jaewan): Implement host-side test so browser and service can run in different processes.
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class MediaBrowserTest extends MediaControllerTest {
private static final String TAG = "MediaBrowserTest";
diff --git a/media2/src/androidTest/java/androidx/media2/MediaControllerTest.java b/media2/src/androidTest/java/androidx/media2/MediaControllerTest.java
index 533eec9..b4f8d12 100644
--- a/media2/src/androidTest/java/androidx/media2/MediaControllerTest.java
+++ b/media2/src/androidTest/java/androidx/media2/MediaControllerTest.java
@@ -52,6 +52,7 @@
import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.testutils.PollingCheck;
import org.junit.After;
@@ -73,7 +74,7 @@
// TODO(jaeawn): Revisit create/close session in the sHandler. It's no longer necessary.
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
@FlakyTest
public class MediaControllerTest extends MediaSessionTestBase {
private static final String TAG = "MediaControllerTest";
diff --git a/media2/src/androidTest/java/androidx/media2/MediaPlayer2StateTest.java b/media2/src/androidTest/java/androidx/media2/MediaPlayer2StateTest.java
index d18f681..e35c92c 100644
--- a/media2/src/androidTest/java/androidx/media2/MediaPlayer2StateTest.java
+++ b/media2/src/androidTest/java/androidx/media2/MediaPlayer2StateTest.java
@@ -489,10 +489,7 @@
private static final PlayerOperation sGetMetricsOperation = new PlayerOperation() {
@Override
public void doOperation(MediaPlayer2 player) {
- // Validate media metrics from API 21 where PersistableBundle was added.
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- player.getMetrics();
- }
+ player.getMetrics();
}
@Override
diff --git a/media2/src/androidTest/java/androidx/media2/MediaPlayer2Test.java b/media2/src/androidTest/java/androidx/media2/MediaPlayer2Test.java
index 1ac7d97..8bbd569 100644
--- a/media2/src/androidTest/java/androidx/media2/MediaPlayer2Test.java
+++ b/media2/src/androidTest/java/androidx/media2/MediaPlayer2Test.java
@@ -46,6 +46,7 @@
import androidx.test.filters.LargeTest;
import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -655,7 +656,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testGetDuration() throws Exception {
if (!checkLoadResource(R.raw.testvideo)) {
@@ -690,7 +691,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testGetCurrentPosition() throws Exception {
assertEquals(MediaPlayer2.PLAYER_STATE_IDLE, mPlayer.getState());
@@ -702,7 +703,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testGetBufferedPosition() throws Exception {
assertEquals(MediaPlayer2.PLAYER_STATE_IDLE, mPlayer.getState());
@@ -714,7 +715,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testGetPlayerParams() throws Exception {
assertEquals(MediaPlayer2.PLAYER_STATE_IDLE, mPlayer.getState());
@@ -2181,9 +2182,13 @@
mOnPlayCalled.reset();
mPlayer.play();
mOnPlayCalled.waitForSignal();
- mOnCompletionCalled.waitForSignal();
+ while (mPlayer.getState() == MediaPlayer2.PLAYER_STATE_PLAYING) {
+ Log.i("@@@@", "position: " + mPlayer.getCurrentPosition());
+ Thread.sleep(100);
+ }
+ Log.i("@@@@", "final position: " + mPlayer.getCurrentPosition());
long pos = mPlayer.getCurrentPosition();
- assertTrue("current pos (" + pos + "ms) does not match the duration (" + duration + "ms).",
+ assertTrue("current pos (" + pos + "us) does not match the duration (" + duration + "us).",
Math.abs(pos - duration) < 1000);
mPlayer.reset();
return 1;
@@ -2550,7 +2555,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testClearPendingCommands() throws Exception {
final Monitor readRequested = new Monitor();
@@ -2905,7 +2910,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testGetWidthAndHeightWithNonSquarePixels() throws Exception {
assertTrue(loadResource(R.raw.testvideo_with_2_subtitle_tracks));
@@ -2930,7 +2935,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testSkipUnnecessarySeek() throws Exception {
final int resid = R.raw.video_480x360_mp4_h264_1350kbps_30fps_aac_stereo_192kbps_44100hz;
@@ -3126,7 +3131,7 @@
}
@Test
- @LargeTest
+ @MediumTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testClose() throws Exception {
assertTrue(loadResource(R.raw.testmp3_2));
diff --git a/media2/src/androidTest/java/androidx/media2/MediaPlayerTest.java b/media2/src/androidTest/java/androidx/media2/MediaPlayerTest.java
index 8213785..4cbf0b0 100644
--- a/media2/src/androidTest/java/androidx/media2/MediaPlayerTest.java
+++ b/media2/src/androidTest/java/androidx/media2/MediaPlayerTest.java
@@ -43,6 +43,7 @@
import androidx.test.filters.LargeTest;
import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import com.google.common.util.concurrent.ListenableFuture;
@@ -318,7 +319,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testGetDuration() throws Exception {
if (!loadResource(R.raw.testvideo)) {
@@ -339,7 +340,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testGetCurrentPosition() throws Exception {
assertEquals(MediaPlayer.PLAYER_STATE_IDLE, mPlayer.getPlayerState());
@@ -347,7 +348,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testGetBufferedPosition() throws Exception {
assertEquals(MediaPlayer.PLAYER_STATE_IDLE, mPlayer.getPlayerState());
@@ -355,7 +356,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testGetPlaybackSpeed() throws Exception {
assertEquals(MediaPlayer.PLAYER_STATE_IDLE, mPlayer.getPlayerState());
@@ -944,7 +945,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testSkipUnnecessarySeek() throws Exception {
final int resid = R.raw.video_480x360_mp4_h264_1350kbps_30fps_aac_stereo_192kbps_44100hz;
@@ -1120,7 +1121,7 @@
}
@Test
- @LargeTest
+ @MediumTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testClose() throws Exception {
assertTrue(loadResource(R.raw.testmp3_2));
@@ -1221,7 +1222,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testSetAndGetShuffleMode() throws Exception {
final TestUtils.Monitor onShuffleModeChangedMonitor = new TestUtils.Monitor();
@@ -1278,7 +1279,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testSetAndGetRepeatMode() throws Exception {
final TestUtils.Monitor onRepeatModeChangedMonitor = new TestUtils.Monitor();
@@ -1335,7 +1336,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testSetPlaylist() throws Exception {
List<MediaItem> playlist = createPlaylist(10);
@@ -1361,7 +1362,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testSetFileMediaItem() throws Exception {
MediaItem closedItem = createMediaItem(0);
@@ -1407,7 +1408,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testSkipToPlaylistItems() throws Exception {
int listSize = 5;
@@ -1427,7 +1428,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testSkipToNextItems() throws Exception {
int listSize = 5;
@@ -1452,7 +1453,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testSkipToPreviousItems() throws Exception {
int listSize = 5;
@@ -1479,7 +1480,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testSkipToNextPreviousItemsWithRepeatMode() throws Exception {
int listSize = 5;
@@ -1503,7 +1504,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testPlaylistAfterSkipToNextItem() throws Exception {
int listSize = 2;
@@ -1533,7 +1534,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testPlaylistAfterSkipToPreviousItem() throws Exception {
int listSize = 2;
@@ -1558,7 +1559,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testCurrentMediaItemChangedCalledAfterSetMediaItem() throws Exception {
final int currentIdx = -1;
@@ -1580,7 +1581,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
public void testCurrentMediaItemChangedCalledAfterSetPlayList() throws Exception {
int listSize = 2;
diff --git a/media2/src/androidTest/java/androidx/media2/MediaPlayer_AudioFocusTest.java b/media2/src/androidTest/java/androidx/media2/MediaPlayer_AudioFocusTest.java
index 04906cc..c590a88 100644
--- a/media2/src/androidTest/java/androidx/media2/MediaPlayer_AudioFocusTest.java
+++ b/media2/src/androidTest/java/androidx/media2/MediaPlayer_AudioFocusTest.java
@@ -53,7 +53,7 @@
import androidx.media.AudioAttributesCompat;
import androidx.media2.test.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
import androidx.test.platform.app.InstrumentationRegistry;
@@ -78,7 +78,7 @@
// TODO: Lower the minSdk version. Currently instantiating ExoPlayerMediaPlayer2Impl fails in API26
@RunWith(AndroidJUnit4.class)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.P)
-@LargeTest
+@MediumTest
public class MediaPlayer_AudioFocusTest extends MediaPlayerTestBase {
private static final int WAIT_TIME_MS = 2000;
diff --git a/media2/src/androidTest/java/androidx/media2/MediaSessionManager_MediaSessionTest.java b/media2/src/androidTest/java/androidx/media2/MediaSessionManager_MediaSessionTest.java
index dfd2f65..b986c69 100644
--- a/media2/src/androidTest/java/androidx/media2/MediaSessionManager_MediaSessionTest.java
+++ b/media2/src/androidTest/java/androidx/media2/MediaSessionManager_MediaSessionTest.java
@@ -22,7 +22,6 @@
import androidx.media2.MediaSession.ControllerInfo;
import androidx.media2.MediaSession.SessionCallback;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SdkSuppress;
import androidx.test.filters.SmallTest;
import org.junit.After;
@@ -37,7 +36,7 @@
*/
@RunWith(AndroidJUnit4.class)
@SmallTest
-@SdkSuppress(minSdkVersion = 21)
+@Ignore
public class MediaSessionManager_MediaSessionTest extends MediaSessionTestBase {
private static final String TAG = "MediaSessionManager_MediaSessionTest";
@@ -102,7 +101,6 @@
* @throws InterruptedException
*/
@Test
- @Ignore
public void testGetSessionTokens_sessionRejected() throws InterruptedException {
prepareLooper();
mSession.close();
@@ -131,7 +129,6 @@
}
@Test
- @Ignore
public void testGetMediaSessionTokens_sessionClosed() throws InterruptedException {
prepareLooper();
mSession.close();
@@ -147,7 +144,6 @@
}
@Test
- @Ignore
public void testGetMediaSessionServiceToken() throws InterruptedException {
prepareLooper();
boolean foundTestSessionService = false;
@@ -172,7 +168,6 @@
}
@Test
- @Ignore
public void testGetAllSessionTokens() throws InterruptedException {
prepareLooper();
boolean foundTestSession = false;
@@ -209,7 +204,6 @@
}
@Test
- @Ignore
public void testAddOnSessionTokensChangedListener() throws InterruptedException {
// prepareLooper();
// TokensChangedListener listener = new TokensChangedListener();
@@ -265,7 +259,6 @@
}
@Test
- @Ignore
public void testRemoveOnSessionTokensChangedListener() throws InterruptedException {
// prepareLooper();
// TokensChangedListener listener = new TokensChangedListener();
diff --git a/media2/src/androidTest/java/androidx/media2/MediaSessionTest.java b/media2/src/androidTest/java/androidx/media2/MediaSessionTest.java
index dd3a8f1..06a9487 100644
--- a/media2/src/androidTest/java/androidx/media2/MediaSessionTest.java
+++ b/media2/src/androidTest/java/androidx/media2/MediaSessionTest.java
@@ -47,8 +47,8 @@
import androidx.media2.MediaSession.ControllerInfo;
import androidx.media2.MediaSession.SessionCallback;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import junit.framework.Assert;
@@ -68,7 +68,7 @@
*/
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class MediaSessionTest extends MediaSessionTestBase {
private static final String TAG = "MediaSessionTest";
diff --git a/media2/src/androidTest/java/androidx/media2/TestUtils.java b/media2/src/androidTest/java/androidx/media2/TestUtils.java
index 5f1e0b8..6c277c6 100644
--- a/media2/src/androidTest/java/androidx/media2/TestUtils.java
+++ b/media2/src/androidTest/java/androidx/media2/TestUtils.java
@@ -215,7 +215,6 @@
public static void assertMediaItemListEquals(List<MediaItem> a, List<MediaItem> b) {
if (a == null || b == null) {
assertEquals(a, b);
- return;
}
assertEquals(a.size(), b.size());
@@ -313,7 +312,6 @@
}
public static class Monitor {
- private static final long DEFAULT_TIME_OUT_MS = 20000; // 20 seconds
private int mNumSignal;
public synchronized void reset() {
@@ -330,24 +328,22 @@
}
public synchronized int waitForCountedSignals(int targetCount) throws InterruptedException {
- return waitForCountedSignals(targetCount, 0);
+ while (mNumSignal < targetCount) {
+ wait();
+ }
+ return mNumSignal;
}
public synchronized boolean waitForSignal(long timeoutMs) throws InterruptedException {
return waitForCountedSignals(1, timeoutMs) > 0;
}
- /**
- * @param targetCount It should be greater than zero.
- * @param timeoutMs It should be equals to or greater than zero. If this is zero,
- * then internal default timeout will be used.
- * @return The number of received signals within given timeoutMs.
- * @throws InterruptedException
- */
public synchronized int waitForCountedSignals(int targetCount, long timeoutMs)
throws InterruptedException {
- long internalTimeoutMs = timeoutMs > 0 ? timeoutMs : DEFAULT_TIME_OUT_MS * targetCount;
- long deadline = System.currentTimeMillis() + internalTimeoutMs;
+ if (timeoutMs == 0) {
+ return waitForCountedSignals(targetCount);
+ }
+ long deadline = System.currentTimeMillis() + timeoutMs;
while (mNumSignal < targetCount) {
long delay = deadline - System.currentTimeMillis();
if (delay <= 0) {
diff --git a/media2/src/main/java/androidx/media2/BaseResult.java b/media2/src/main/java/androidx/media2/BaseResult.java
index 58c37b1..d203f32 100644
--- a/media2/src/main/java/androidx/media2/BaseResult.java
+++ b/media2/src/main/java/androidx/media2/BaseResult.java
@@ -40,7 +40,7 @@
/**
* Result code represents that call is ended with an unknown error.
*/
- int RESULT_ERROR_UNKNOWN = -1;
+ int RESULT_ERROR_UNKNOWN_ERROR = -1;
/**
* Result code representing that the command cannot be completed because the current state is
@@ -61,7 +61,7 @@
/**
* Result code representing a file or network related command error.
*/
- int RESULT_ERROR_IO = -5;
+ int RESULT_ERROR_IO_ERROR = -5;
/**
* Result code representing that the command is not supported nor implemented.
diff --git a/media2/src/main/java/androidx/media2/CallbackMediaItem.java b/media2/src/main/java/androidx/media2/CallbackMediaItem.java
index 0c9acdb..5ccbc97 100644
--- a/media2/src/main/java/androidx/media2/CallbackMediaItem.java
+++ b/media2/src/main/java/androidx/media2/CallbackMediaItem.java
@@ -17,7 +17,6 @@
package androidx.media2;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import androidx.core.util.Preconditions;
import androidx.versionedparcelable.NonParcelField;
import androidx.versionedparcelable.ParcelUtils;
@@ -37,7 +36,7 @@
public class CallbackMediaItem extends MediaItem {
@NonParcelField
@SuppressWarnings("WeakerAccess") /* synthetic access */
- DataSourceCallback mDataSourceCallback;
+ DataSourceCallback mDataSourceCallback;
/**
* Used for VersionedParcelable
@@ -65,7 +64,7 @@
/**
* This Builder class simplifies the creation of a {@link CallbackMediaItem} object.
*/
- public static final class Builder extends MediaItem.Builder {
+ public static final class Builder extends BuilderBase<Builder> {
@SuppressWarnings("WeakerAccess") /* synthetic access */
DataSourceCallback mDataSourceCallback;
@@ -79,33 +78,11 @@
mDataSourceCallback = dsc2;
}
- // Override just to change return type.
- @NonNull
- @Override
- public Builder setMetadata(@Nullable MediaMetadata metadata) {
- return (Builder) super.setMetadata(metadata);
- }
-
- // Override just to change return type.
- @NonNull
- @Override
- public Builder setStartPosition(long position) {
- return (Builder) super.setStartPosition(position);
- }
-
- // Override just to change return type.
- @NonNull
- @Override
- public Builder setEndPosition(long position) {
- return (Builder) super.setEndPosition(position);
- }
-
/**
* @return A new CallbackMediaItem with values supplied by the Builder.
*/
- @NonNull
@Override
- public CallbackMediaItem build() {
+ public @NonNull CallbackMediaItem build() {
return new CallbackMediaItem(this);
}
}
diff --git a/media2/src/main/java/androidx/media2/ConnectionResult.java b/media2/src/main/java/androidx/media2/ConnectionResult.java
index 1b9fb9b..6aa0eb2 100644
--- a/media2/src/main/java/androidx/media2/ConnectionResult.java
+++ b/media2/src/main/java/androidx/media2/ConnectionResult.java
@@ -16,7 +16,6 @@
package androidx.media2;
-import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.os.IBinder;
import android.os.SystemClock;
@@ -39,7 +38,6 @@
* All fields here are effectively final. Do not modify.
*/
@VersionedParcelize(isCustom = true)
-@SuppressLint("RestrictedApi")
class ConnectionResult extends CustomVersionedParcelable {
@ParcelField(0)
int mVersion;
diff --git a/media2/src/main/java/androidx/media2/FileMediaItem.java b/media2/src/main/java/androidx/media2/FileMediaItem.java
index fcb36ab..4ea0f95 100644
--- a/media2/src/main/java/androidx/media2/FileMediaItem.java
+++ b/media2/src/main/java/androidx/media2/FileMediaItem.java
@@ -16,13 +16,12 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.ParcelFileDescriptor;
import android.util.Log;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
import androidx.core.util.Preconditions;
@@ -110,7 +109,7 @@
* Increases reference count for underlying ParcelFileDescriptor.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void increaseRefCount() {
synchronized (mRefCount) {
if (mClosed) {
@@ -126,7 +125,7 @@
* be closed when the count becomes zero.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void decreaseRefCount() {
synchronized (mRefCount) {
if (mClosed) {
@@ -172,7 +171,7 @@
/**
* This Builder class simplifies the creation of a {@link FileMediaItem} object.
*/
- public static final class Builder extends MediaItem.Builder {
+ public static final class Builder extends BuilderBase<Builder> {
@SuppressWarnings("WeakerAccess") /* synthetic access */
ParcelFileDescriptor mPFD;
@@ -224,33 +223,11 @@
mFDLength = length;
}
- // Override just to change return type.
- @NonNull
- @Override
- public Builder setMetadata(@Nullable MediaMetadata metadata) {
- return (Builder) super.setMetadata(metadata);
- }
-
- // Override just to change return type.
- @NonNull
- @Override
- public Builder setStartPosition(long position) {
- return (Builder) super.setStartPosition(position);
- }
-
- // Override just to change return type.
- @NonNull
- @Override
- public Builder setEndPosition(long position) {
- return (Builder) super.setEndPosition(position);
- }
-
/**
* @return A new FileMediaItem with values supplied by the Builder.
*/
- @NonNull
@Override
- public FileMediaItem build() {
+ public @NonNull FileMediaItem build() {
return new FileMediaItem(this);
}
}
diff --git a/media2/src/main/java/androidx/media2/LibraryResult.java b/media2/src/main/java/androidx/media2/LibraryResult.java
index ebf745f..eb25ad4 100644
--- a/media2/src/main/java/androidx/media2/LibraryResult.java
+++ b/media2/src/main/java/androidx/media2/LibraryResult.java
@@ -17,9 +17,8 @@
package androidx.media2;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
-import android.annotation.SuppressLint;
import android.os.SystemClock;
import androidx.annotation.IntDef;
@@ -42,18 +41,17 @@
* {@link androidx.media2.MediaLibraryService.MediaLibrarySession} and {@link MediaBrowser}.
*/
@VersionedParcelize(isCustom = true)
-@SuppressLint("RestrictedApi")
public class LibraryResult extends CustomVersionedParcelable implements RemoteResult {
/**
* @hide
*/
@IntDef(flag = false, /*prefix = "RESULT_CODE",*/ value = {
RESULT_SUCCESS,
- RESULT_ERROR_UNKNOWN,
+ RESULT_ERROR_UNKNOWN_ERROR,
RESULT_ERROR_INVALID_STATE,
RESULT_ERROR_BAD_VALUE,
RESULT_ERROR_PERMISSION_DENIED,
- RESULT_ERROR_IO,
+ RESULT_ERROR_IO_ERROR,
RESULT_INFO_SKIPPED,
RESULT_ERROR_SESSION_DISCONNECTED,
RESULT_ERROR_NOT_SUPPORTED,
@@ -65,7 +63,7 @@
RESULT_ERROR_SESSION_SKIP_LIMIT_REACHED,
RESULT_ERROR_SESSION_SETUP_REQUIRED})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface ResultCode {}
@ParcelField(1)
@@ -142,11 +140,11 @@
*
* @return result code
* @see #RESULT_SUCCESS
- * @see #RESULT_ERROR_UNKNOWN
+ * @see #RESULT_ERROR_UNKNOWN_ERROR
* @see #RESULT_ERROR_INVALID_STATE
* @see #RESULT_ERROR_BAD_VALUE
* @see #RESULT_ERROR_PERMISSION_DENIED
- * @see #RESULT_ERROR_IO
+ * @see #RESULT_ERROR_IO_ERROR
* @see #RESULT_INFO_SKIPPED
* @see #RESULT_ERROR_SESSION_DISCONNECTED
* @see #RESULT_ERROR_NOT_SUPPORTED
diff --git a/media2/src/main/java/androidx/media2/MediaBrowser.java b/media2/src/main/java/androidx/media2/MediaBrowser.java
index 8360a0a..51832aa 100644
--- a/media2/src/main/java/androidx/media2/MediaBrowser.java
+++ b/media2/src/main/java/androidx/media2/MediaBrowser.java
@@ -223,7 +223,7 @@
* item.
*
* @param mediaId non-empty media id for specifying the item
- * @see LibraryResult#getMediaItem()
+ * @see LibraryResult#getMediaItems()
*/
public @NonNull ListenableFuture<LibraryResult> getItem(@NonNull final String mediaId) {
if (TextUtils.isEmpty(mediaId)) {
diff --git a/media2/src/main/java/androidx/media2/MediaBrowserImplLegacy.java b/media2/src/main/java/androidx/media2/MediaBrowserImplLegacy.java
index fb14397..8c28ac8 100644
--- a/media2/src/main/java/androidx/media2/MediaBrowserImplLegacy.java
+++ b/media2/src/main/java/androidx/media2/MediaBrowserImplLegacy.java
@@ -18,14 +18,13 @@
import static androidx.media2.LibraryResult.RESULT_ERROR_BAD_VALUE;
import static androidx.media2.LibraryResult.RESULT_ERROR_SESSION_DISCONNECTED;
-import static androidx.media2.LibraryResult.RESULT_ERROR_UNKNOWN;
+import static androidx.media2.LibraryResult.RESULT_ERROR_UNKNOWN_ERROR;
import static androidx.media2.LibraryResult.RESULT_SUCCESS;
import static androidx.media2.MediaMetadata.BROWSABLE_TYPE_MIXED;
import static androidx.media2.MediaMetadata.METADATA_KEY_BROWSABLE;
import static androidx.media2.MediaMetadata.METADATA_KEY_MEDIA_ID;
import static androidx.media2.MediaMetadata.METADATA_KEY_PLAYABLE;
-import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.media.MediaBrowserCompat;
@@ -200,7 +199,7 @@
getCallbackExecutor().execute(new Runnable() {
@Override
public void run() {
- result.set(new LibraryResult(RESULT_ERROR_UNKNOWN));
+ result.set(new LibraryResult(RESULT_ERROR_UNKNOWN_ERROR));
}
});
}
@@ -283,7 +282,7 @@
getCallbackExecutor().execute(new Runnable() {
@Override
public void run() {
- future.set(new LibraryResult(RESULT_ERROR_UNKNOWN));
+ future.set(new LibraryResult(RESULT_ERROR_UNKNOWN_ERROR));
}
});
}
@@ -341,7 +340,7 @@
}
if (browserCompat == null) {
// Shouldn't be happen. Internal error?
- mResult.set(new LibraryResult(RESULT_ERROR_UNKNOWN));
+ mResult.set(new LibraryResult(RESULT_ERROR_UNKNOWN_ERROR));
} else {
mResult.set(new LibraryResult(RESULT_SUCCESS,
createRootMediaItem(browserCompat),
@@ -382,7 +381,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public void onChildrenLoaded(final String parentId,
List<MediaBrowserCompat.MediaItem> children, final Bundle options) {
if (TextUtils.isEmpty(parentId)) {
@@ -426,12 +424,12 @@
@Override
public void onError(String parentId) {
- mFuture.set(new LibraryResult(RESULT_ERROR_UNKNOWN));
+ mFuture.set(new LibraryResult(RESULT_ERROR_UNKNOWN_ERROR));
}
@Override
public void onError(String parentId, Bundle options) {
- mFuture.set(new LibraryResult(RESULT_ERROR_UNKNOWN));
+ mFuture.set(new LibraryResult(RESULT_ERROR_UNKNOWN_ERROR));
}
@Override
@@ -456,7 +454,7 @@
final List<MediaItem> items = new ArrayList<>();
if (children == null) {
// list are non-Null, so it must be internal error.
- mFuture.set(new LibraryResult(RESULT_ERROR_UNKNOWN));
+ mFuture.set(new LibraryResult(RESULT_ERROR_UNKNOWN_ERROR));
} else {
for (int i = 0; i < children.size(); i++) {
items.add(MediaUtils.convertToMediaItem(children.get(i)));
diff --git a/media2/src/main/java/androidx/media2/MediaController.java b/media2/src/main/java/androidx/media2/MediaController.java
index a1c4039..193014d 100644
--- a/media2/src/main/java/androidx/media2/MediaController.java
+++ b/media2/src/main/java/androidx/media2/MediaController.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media2.SessionPlayer.BUFFERING_STATE_UNKNOWN;
import static androidx.media2.SessionPlayer.PLAYER_STATE_IDLE;
import static androidx.media2.SessionPlayer.REPEAT_MODE_NONE;
@@ -100,7 +100,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({AudioManager.ADJUST_LOWER, AudioManager.ADJUST_RAISE, AudioManager.ADJUST_SAME,
AudioManager.ADJUST_MUTE, AudioManager.ADJUST_UNMUTE, AudioManager.ADJUST_TOGGLE_MUTE})
@Retention(RetentionPolicy.SOURCE)
@@ -109,7 +109,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef(value = {AudioManager.FLAG_SHOW_UI, AudioManager.FLAG_ALLOW_RINGER_MODES,
AudioManager.FLAG_PLAY_SOUND, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE,
AudioManager.FLAG_VIBRATE}, flag = true)
@@ -413,7 +413,7 @@
* to be played.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ListenableFuture<SessionResult> playFromMediaId(@NonNull String mediaId,
@Nullable Bundle extras) {
if (TextUtils.isEmpty(mediaId)) {
@@ -432,7 +432,7 @@
* @param extras Optional extras that can include extra information about the query.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ListenableFuture<SessionResult> playFromSearch(@NonNull String query,
@Nullable Bundle extras) {
if (TextUtils.isEmpty(query)) {
@@ -452,7 +452,7 @@
* to be played.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ListenableFuture<SessionResult> playFromUri(@NonNull Uri uri,
@Nullable Bundle extras) {
if (uri == null) {
@@ -478,7 +478,7 @@
* to be prepared.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ListenableFuture<SessionResult> prepareFromMediaId(@NonNull String mediaId,
@Nullable Bundle extras) {
if (TextUtils.isEmpty(mediaId)) {
@@ -503,7 +503,7 @@
* @param extras Optional extras that can include extra information about the query.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ListenableFuture<SessionResult> prepareFromSearch(@NonNull String query,
@Nullable Bundle extras) {
if (TextUtils.isEmpty(query)) {
@@ -529,7 +529,7 @@
* to be prepared.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ListenableFuture<SessionResult> prepareFromUri(@NonNull Uri uri,
@Nullable Bundle extras) {
if (uri == null) {
@@ -749,16 +749,15 @@
}
/**
- * Returns the cached playlist from {@link ControllerCallback#onPlaylistChanged}. Can be
- * {@code null} if the playlist hasn't been set or it's reset by {@link #setMediaItem}.
+ * Returns the cached playlist from {@link ControllerCallback#onPlaylistChanged}.
* <p>
* This list may differ with the list that was specified with
* {@link #setPlaylist(List, MediaMetadata)} depending on the {@link SessionPlayer}
* implementation. Use media items returned here for other playlist agent APIs such as
- * {@link SessionPlayer#skipToPlaylistItem}.
+ * {@link SessionPlayer#skipToPlaylistItem(MediaItem)}.
*
- * @return playlist, or {@code null} if the playlist hasn't been set, controller isn't
- * connected, or it doesn't have enough permission.
+ * @return playlist, or {@code null} if the playlist hasn't set, controller isn't connected,
+ * or it doesn't have enough permission
* @see SessionCommand#COMMAND_CODE_PLAYER_GET_PLAYLIST
*/
@Nullable
@@ -767,22 +766,13 @@
}
/**
- * Sets the playlist with the list of media IDs. Use this or {@link #setMediaItem} to specify
- * which items to play.
- * <p>
- * All media IDs in the list shouldn't be an empty string.
- * <p>
- * The {@link ControllerCallback#onPlaylistChanged} and
- * {@link ControllerCallback#onCurrentMediaItemChanged} would be called when it's completed.
- * The current item would be the first item in the playlist.
+ * Sets the playlist with the list of media IDs. All media IDs in the list shouldn't be empty.
*
* @param list list of media id. Shouldn't contain an empty id.
* @param metadata metadata of the playlist
- * @see #setMediaItem
- * @see ControllerCallback#onCurrentMediaItemChanged
+ * @see #getPlaylist()
* @see ControllerCallback#onPlaylistChanged
* @see MediaMetadata#METADATA_KEY_MEDIA_ID
- * @throws IllegalArgumentException if the list is {@code null} or contains any empty string.
*/
@NonNull
public ListenableFuture<SessionResult> setPlaylist(@NonNull List<String> list,
@@ -802,19 +792,9 @@
}
/**
- * Sets a {@link MediaItem} for playback with the media ID. Use this or {@link #setPlaylist}
- * to specify which items to play. If you want to change current item in the playlist, use one
- * of {@link #skipToPlaylistItem}, {@link #skipToNextPlaylistItem}, or
- * {@link #skipToPreviousPlaylistItem} instead of this method.
- * <p>
- * The {@link ControllerCallback#onPlaylistChanged} and
- * {@link ControllerCallback#onCurrentMediaItemChanged} would be called when it's completed.
- * The current item would be the item given here.
+ * Sets a {@link MediaItem} for playback.
*
* @param mediaId The non-empty media id of the item to play
- * @see #setPlaylist
- * @see ControllerCallback#onCurrentMediaItemChanged
- * @see ControllerCallback#onPlaylistChanged
* @see MediaMetadata#METADATA_KEY_MEDIA_ID
*/
@NonNull
@@ -929,8 +909,6 @@
* {@link ControllerCallback#onCurrentMediaItemChanged(MediaController, MediaItem)}.
*
* @return the currently playing item, or null if unknown or not connected
- * @see #setMediaItem
- * @see #setPlaylist
*/
@Nullable
public MediaItem getCurrentMediaItem() {
@@ -1091,7 +1069,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setTimeDiff(Long timeDiff) {
mTimeDiff = timeDiff;
}
@@ -1257,7 +1235,7 @@
/**
* Called when the session sent a custom command. Returns a {@link SessionResult} for
* session to get notification back. If the {@code null} is returned,
- * {@link SessionResult#RESULT_ERROR_UNKNOWN} will be returned.
+ * {@link SessionResult#RESULT_ERROR_UNKNOWN_ERROR} will be returned.
* <p>
* Default implementation returns {@link SessionResult#RESULT_ERROR_NOT_SUPPORTED}.
*
@@ -1311,31 +1289,25 @@
public void onSeekCompleted(@NonNull MediaController controller, long position) {}
/**
- * Called when the player's current item is changed. It's also called after
- * {@link #setPlaylist} or {@link #setMediaItem}.
+ * Called when the player's currently playing item is changed
* <p>
* When it's called, you should invalidate previous playback information and wait for later
* callbacks. Also, current, previous, and next media item indices may need to be updated.
*
* @param controller the controller for this event
- * @param item new current media item
- * @see #getPlaylist()
- * @see #getPlaylistMetadata()
+ * @param item new item
*/
public void onCurrentMediaItemChanged(@NonNull MediaController controller,
@Nullable MediaItem item) {}
/**
- * Called when a playlist is changed. It's also called after {@link #setPlaylist} or
- * {@link #setMediaItem}.
+ * Called when a playlist is changed.
* <p>
* When it's called, current, previous, and next media item indices may need to be updated.
*
* @param controller the controller for this event
* @param list new playlist
* @param metadata new metadata
- * @see #getPlaylist()
- * @see #getPlaylistMetadata()
*/
public void onPlaylistChanged(@NonNull MediaController controller,
@Nullable List<MediaItem> list, @Nullable MediaMetadata metadata) {}
diff --git a/media2/src/main/java/androidx/media2/MediaControllerImplBase.java b/media2/src/main/java/androidx/media2/MediaControllerImplBase.java
index a552820..d92ef58 100644
--- a/media2/src/main/java/androidx/media2/MediaControllerImplBase.java
+++ b/media2/src/main/java/androidx/media2/MediaControllerImplBase.java
@@ -51,7 +51,7 @@
import static androidx.media2.SessionPlayer.UNKNOWN_TIME;
import static androidx.media2.SessionResult.RESULT_ERROR_PERMISSION_DENIED;
import static androidx.media2.SessionResult.RESULT_ERROR_SESSION_DISCONNECTED;
-import static androidx.media2.SessionResult.RESULT_ERROR_UNKNOWN;
+import static androidx.media2.SessionResult.RESULT_ERROR_UNKNOWN_ERROR;
import static androidx.media2.SessionResult.RESULT_INFO_SKIPPED;
import static androidx.media2.SessionToken.TYPE_SESSION;
@@ -183,17 +183,14 @@
}
};
- boolean connectionRequested;
+ IMediaSession iSession = IMediaSession.Stub.asInterface((IBinder) mToken.getBinder());
if (mToken.getType() == SessionToken.TYPE_SESSION) {
// Session
mServiceConnection = null;
- connectionRequested = requestConnectToSession();
+ connectToSession();
} else {
mServiceConnection = new SessionServiceConnection();
- connectionRequested = requestConnectToService();
- }
- if (!connectionRequested) {
- mInstance.close();
+ connectToService();
}
}
@@ -793,7 +790,7 @@
return mInstance;
}
- private boolean requestConnectToService() {
+ private void connectToService() {
// Service. Needs to get fresh binder whenever connection is needed.
final Intent intent = new Intent(MediaSessionService.SERVICE_INTERFACE);
intent.setClassName(mToken.getPackageName(), mToken.getServiceName());
@@ -817,16 +814,13 @@
intent, mServiceConnection, Context.BIND_AUTO_CREATE);
if (!result) {
Log.w(TAG, "bind to " + mToken + " failed");
- return false;
+ } else if (DEBUG) {
+ Log.d(TAG, "bind to " + mToken + " succeeded");
}
}
- if (DEBUG) {
- Log.d(TAG, "bind to " + mToken + " succeeded");
- }
- return true;
}
- private boolean requestConnectToSession() {
+ private void connectToSession() {
IMediaSession iSession = IMediaSession.Stub.asInterface((IBinder) mToken.getBinder());
int seq = mSequencedFutureManager.obtainNextSequenceNumber();
ConnectionRequest request =
@@ -834,10 +828,9 @@
try {
iSession.connect(mControllerStub, seq, MediaUtils.toParcelable(request));
} catch (RemoteException e) {
- Log.w(TAG, "Failed to call connection request.", e);
- return false;
+ Log.w(TAG, "Failed to call connection request. Framework will retry"
+ + " automatically");
}
- return true;
}
// Returns session interface if the controller can send the command.
@@ -1174,7 +1167,7 @@
throw new RuntimeException("ControllerCallback#onCustomCommand() has"
+ " returned null, command=" + command.getCustomCommand());
} else {
- result = new SessionResult(RESULT_ERROR_UNKNOWN);
+ result = new SessionResult(RESULT_ERROR_UNKNOWN_ERROR);
}
}
sendControllerResult(seq, result);
@@ -1209,46 +1202,39 @@
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
- boolean connectionRequested = false;
+ // Note that it's always main-thread.
+ if (DEBUG) {
+ Log.d(TAG, "onServiceConnected " + name + " " + this);
+ }
+ // Sanity check
+ if (!mToken.getPackageName().equals(name.getPackageName())) {
+ Log.wtf(TAG, "Expected connection to " + mToken.getPackageName() + " but is"
+ + " connected to " + name);
+ return;
+ }
+ IMediaSessionService iService = IMediaSessionService.Stub.asInterface(service);
+ if (iService == null) {
+ Log.wtf(TAG, "Service interface is missing.");
+ return;
+ }
+ ConnectionRequest request =
+ new ConnectionRequest(getContext().getPackageName(), Process.myPid());
try {
- // Note that it's always main-thread.
- if (DEBUG) {
- Log.d(TAG, "onServiceConnected " + name + " " + this);
- }
- // Sanity check
- if (!mToken.getPackageName().equals(name.getPackageName())) {
- Log.wtf(TAG, "Expected connection to " + mToken.getPackageName() + " but is"
- + " connected to " + name);
- return;
- }
- IMediaSessionService iService = IMediaSessionService.Stub.asInterface(service);
- if (iService == null) {
- Log.wtf(TAG, "Service interface is missing.");
- return;
- }
- ConnectionRequest request =
- new ConnectionRequest(getContext().getPackageName(), Process.myPid());
+
iService.connect(mControllerStub, MediaUtils.toParcelable(request));
- connectionRequested = true;
} catch (RemoteException e) {
Log.w(TAG, "Service " + name + " has died prematurely");
- } finally {
- if (!connectionRequested) {
- mInstance.close();
- }
+ mInstance.close();
}
}
@Override
public void onServiceDisconnected(ComponentName name) {
// Temporal lose of the binding because of the service crash. System will automatically
- // rebind, but we'd better to close() here. Otherwise ControllerCallback#onConnected()
- // would be called multiple times, and the controller would be connected to the
- // different session everytime.
+ // rebind, so just no-op.
if (DEBUG) {
Log.w(TAG, "Session service " + name + " is disconnected.");
}
- mInstance.close();
}
@Override
@@ -1256,7 +1242,7 @@
// Permanent lose of the binding because of the service package update or removed.
// This SessionServiceRecord will be removed accordingly, but forget session binder here
// for sure.
- mInstance.close();
+ close();
}
}
}
diff --git a/media2/src/main/java/androidx/media2/MediaControllerImplLegacy.java b/media2/src/main/java/androidx/media2/MediaControllerImplLegacy.java
index d88a058..6c00e15 100644
--- a/media2/src/main/java/androidx/media2/MediaControllerImplLegacy.java
+++ b/media2/src/main/java/androidx/media2/MediaControllerImplLegacy.java
@@ -513,6 +513,12 @@
}
@Override
+ public ListenableFuture<SessionResult> setPlaybackSpeed(float speed) {
+ // Unsupported action
+ return createFutureWithResult(RESULT_ERROR_NOT_SUPPORTED);
+ }
+
+ @Override
public @BuffState int getBufferingState() {
synchronized (mLock) {
if (!mConnected) {
@@ -548,7 +554,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public ListenableFuture<SessionResult> setRating(@NonNull String mediaId,
@NonNull Rating rating) {
synchronized (mLock) {
@@ -565,18 +570,6 @@
}
@Override
- public ListenableFuture<SessionResult> setPlaybackSpeed(float speed) {
- synchronized (mLock) {
- if (!mConnected) {
- Log.w(TAG, "Session isn't active", new IllegalStateException());
- return createFutureWithResult(RESULT_ERROR_SESSION_DISCONNECTED);
- }
- mControllerCompat.getTransportControls().setPlaybackSpeed(speed);
- }
- return createFutureWithResult(RESULT_SUCCESS);
- }
-
- @Override
public ListenableFuture<SessionResult> sendCustomCommand(@NonNull SessionCommand command,
@Nullable Bundle args) {
synchronized (mLock) {
@@ -936,7 +929,6 @@
sendCommand(command, null, receiver);
}
- @SuppressLint("RestrictedApi")
private void sendCommand(String command, Bundle args, ResultReceiver receiver) {
if (args == null) {
args = new Bundle();
diff --git a/media2/src/main/java/androidx/media2/MediaItem.java b/media2/src/main/java/androidx/media2/MediaItem.java
index c2745b0..aa04d4f 100644
--- a/media2/src/main/java/androidx/media2/MediaItem.java
+++ b/media2/src/main/java/androidx/media2/MediaItem.java
@@ -61,7 +61,6 @@
* This object is thread safe.
*/
@VersionedParcelize(isCustom = true)
-@SuppressLint("RestrictedApi")
public class MediaItem extends CustomVersionedParcelable {
private static final String TAG = "MediaItem";
@@ -103,7 +102,7 @@
// Note: Needs to be protected when we want to allow 3rd party player to define customized
// MediaItem.
@SuppressWarnings("WeakerAccess") /* synthetic access */
- MediaItem(Builder builder) {
+ MediaItem(BuilderBase builder) {
this(builder.mMetadata, builder.mStartPositionMs, builder.mEndPositionMs);
}
@@ -209,7 +208,7 @@
* @hide
*/
// TODO: Remove
- @RestrictTo(LIBRARY_GROUP)
+ @RestrictTo(LIBRARY)
public @Nullable String getMediaId() {
synchronized (mLock) {
return mMetadata != null
@@ -240,9 +239,13 @@
}
/**
- * Builder for {@link MediaItem}.
+ * Base builder for {@link MediaItem} and its subclass.
+ *
+ * @param <T> builder class
+ * @hide
*/
- public static class Builder {
+ @RestrictTo(LIBRARY_GROUP)
+ public static class BuilderBase<T extends BuilderBase> {
@SuppressWarnings("WeakerAccess") /* synthetic access */
MediaMetadata mMetadata;
@SuppressWarnings("WeakerAccess") /* synthetic access */
@@ -251,21 +254,14 @@
long mEndPositionMs = POSITION_UNKNOWN;
/**
- * Default constructor
- */
- public Builder() {
- }
-
- /**
* Set the metadata of this instance. {@code null} for unset.
*
* @param metadata metadata
* @return this instance for chaining
*/
- @NonNull
- public Builder setMetadata(@Nullable MediaMetadata metadata) {
+ public @NonNull T setMetadata(@Nullable MediaMetadata metadata) {
mMetadata = metadata;
- return this;
+ return (T) this;
}
/**
@@ -273,15 +269,14 @@
* Any negative number is treated as 0.
*
* @param position the start position in milliseconds at which the playback will start
- * @return this instance for chaining
+ * @return the same Builder instance.
*/
- @NonNull
- public Builder setStartPosition(long position) {
+ public @NonNull T setStartPosition(long position) {
if (position < 0) {
position = 0;
}
mStartPositionMs = position;
- return this;
+ return (T) this;
}
/**
@@ -289,15 +284,14 @@
* Any negative number is treated as maximum length of the media item.
*
* @param position the end position in milliseconds at which the playback will end
- * @return this instance for chaining
+ * @return the same Builder instance.
*/
- @NonNull
- public Builder setEndPosition(long position) {
+ public @NonNull T setEndPosition(long position) {
if (position < 0) {
position = POSITION_UNKNOWN;
}
mEndPositionMs = position;
- return this;
+ return (T) this;
}
/**
@@ -305,12 +299,23 @@
*
* @return a new {@link MediaItem}.
*/
- @NonNull
- public MediaItem build() {
+ public @NonNull MediaItem build() {
return new MediaItem(this);
}
}
+ /**
+ * Builder for {@link MediaItem}.
+ */
+ public static class Builder extends BuilderBase<Builder> {
+ /**
+ * Default constructor
+ */
+ public Builder() {
+ super();
+ }
+ }
+
interface OnMetadataChangedListener {
void onMetadataChanged(MediaItem item);
}
@@ -324,7 +329,8 @@
@SuppressLint("RestrictedApi")
public void onPreParceling(boolean isStream) {
if (getClass() != MediaItem.class) {
- throw new RuntimeException("MediaItem's subclasses shouldn't be parcelized.");
+ throw new RuntimeException("MediaItem's subclasses shouldn't be parcelized."
+ + " Use instead");
}
super.onPreParceling(isStream);
}
diff --git a/media2/src/main/java/androidx/media2/MediaLibrarySessionImplBase.java b/media2/src/main/java/androidx/media2/MediaLibrarySessionImplBase.java
index ba62ce5..570bb6f 100644
--- a/media2/src/main/java/androidx/media2/MediaLibrarySessionImplBase.java
+++ b/media2/src/main/java/androidx/media2/MediaLibrarySessionImplBase.java
@@ -16,10 +16,9 @@
package androidx.media2;
-import static androidx.media2.LibraryResult.RESULT_ERROR_UNKNOWN;
+import static androidx.media2.LibraryResult.RESULT_ERROR_UNKNOWN_ERROR;
import static androidx.media2.LibraryResult.RESULT_SUCCESS;
-import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.Context;
import android.os.RemoteException;
@@ -162,7 +161,7 @@
}
for (MediaItem item : items) {
if (!isValidItem(item)) {
- return new LibraryResult(RESULT_ERROR_UNKNOWN);
+ return new LibraryResult(RESULT_ERROR_UNKNOWN_ERROR);
}
}
}
@@ -173,13 +172,12 @@
returnedResult = ensureNonNullResult(returnedResult);
if (returnedResult.getResultCode() == RESULT_SUCCESS) {
if (!isValidItem(returnedResult.getMediaItem())) {
- return new LibraryResult(RESULT_ERROR_UNKNOWN);
+ return new LibraryResult(RESULT_ERROR_UNKNOWN_ERROR);
}
}
return returnedResult;
}
- @SuppressLint("RestrictedApi")
private boolean isValidItem(MediaItem item) {
if (item == null) {
throw new RuntimeException("Item shouldn't be null for the success");
diff --git a/media2/src/main/java/androidx/media2/MediaMetadata.java b/media2/src/main/java/androidx/media2/MediaMetadata.java
index 0244fde..7f5a8b2 100644
--- a/media2/src/main/java/androidx/media2/MediaMetadata.java
+++ b/media2/src/main/java/androidx/media2/MediaMetadata.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.graphics.Bitmap;
@@ -116,8 +116,7 @@
// - Don't implement Parcelable for updatable support.
// - Also support MediaDescription features. MediaDescription is deprecated instead because
// it was insufficient for controller to display media contents. (e.g. duration is missing)
-// TODO: Remove once the minSdkVersion is lowered enough.
-@SuppressLint({"ObsoleteSdkInt", "RestrictedApi"})
+@SuppressLint("ObsoleteSdkInt") // TODO: Remove once the minSdkVersion is lowered enough.
@VersionedParcelize(isCustom = true)
public final class MediaMetadata extends CustomVersionedParcelable {
private static final String TAG = "MediaMetadata";
@@ -466,7 +465,7 @@
* @see Builder#putFloat(String, float)
* @see #getFloat(String)
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String METADATA_KEY_RADIO_FREQUENCY =
"androidx.media2.metadata.RADIO_FREQUENCY";
@@ -480,7 +479,7 @@
* @see #getText(String)
* @see #getString(String)
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String METADATA_KEY_RADIO_PROGRAM_NAME =
"androidx.media2.metadata.RADIO_PROGRAM_NAME";
@@ -640,7 +639,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef({METADATA_KEY_TITLE, METADATA_KEY_ARTIST, METADATA_KEY_ALBUM, METADATA_KEY_AUTHOR,
METADATA_KEY_WRITER, METADATA_KEY_COMPOSER, METADATA_KEY_COMPILATION,
METADATA_KEY_DATE, METADATA_KEY_GENRE, METADATA_KEY_ALBUM_ARTIST, METADATA_KEY_ART_URI,
@@ -653,7 +652,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef({METADATA_KEY_DURATION, METADATA_KEY_YEAR, METADATA_KEY_TRACK_NUMBER,
METADATA_KEY_NUM_TRACKS, METADATA_KEY_DISC_NUMBER, METADATA_KEY_BROWSABLE,
METADATA_KEY_PLAYABLE, METADATA_KEY_ADVERTISEMENT, METADATA_KEY_DOWNLOAD_STATUS})
@@ -663,7 +662,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef({METADATA_KEY_ART, METADATA_KEY_ALBUM_ART, METADATA_KEY_DISPLAY_ICON})
@Retention(RetentionPolicy.SOURCE)
public @interface BitmapKey {}
@@ -671,7 +670,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef({METADATA_KEY_USER_RATING, METADATA_KEY_RATING})
@Retention(RetentionPolicy.SOURCE)
public @interface RatingKey {}
@@ -679,7 +678,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef({METADATA_KEY_RADIO_FREQUENCY})
@Retention(RetentionPolicy.SOURCE)
public @interface FloatKey {}
@@ -687,7 +686,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef({METADATA_KEY_EXTRAS})
@Retention(RetentionPolicy.SOURCE)
public @interface BundleKey {}
@@ -957,7 +956,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @Nullable Object getObject(@NonNull String key) {
if (key == null) {
throw new IllegalArgumentException("key shouldn't be null");
@@ -969,7 +968,7 @@
* @hide
*/
@Override
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void onPreParceling(boolean isStream) {
List<ParcelImpl> parcelImplList = new ArrayList<>();
List<String> keysForBitmap = new ArrayList<>();
@@ -993,7 +992,7 @@
* @hide
*/
@Override
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void onPostParceling() {
List<ParcelImpl> parcelImplList = mBitmapListSlice.getList();
for (ParcelImpl parcelImpl : parcelImplList) {
diff --git a/media2/src/main/java/androidx/media2/MediaNotificationHandler.java b/media2/src/main/java/androidx/media2/MediaNotificationHandler.java
index dbaabc6..934f9b8 100644
--- a/media2/src/main/java/androidx/media2/MediaNotificationHandler.java
+++ b/media2/src/main/java/androidx/media2/MediaNotificationHandler.java
@@ -24,7 +24,6 @@
import static androidx.annotation.VisibleForTesting.PACKAGE_PRIVATE;
-import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
@@ -67,7 +66,6 @@
private final NotificationCompat.Action mSkipToPrevAction;
private final NotificationCompat.Action mSkipToNextAction;
- @SuppressLint("RestrictedApi")
public MediaNotificationHandler(MediaSessionService service) {
mServiceInstance = service;
mStartSelfIntent = new Intent(mServiceInstance, mServiceInstance.getClass());
@@ -77,17 +75,13 @@
mNotificationChannelName = mServiceInstance.getResources().getString(
R.string.default_notification_channel_name);
- mPlayAction = createNotificationAction(
- R.drawable.media_session_service_notification_ic_play,
+ mPlayAction = createNotificationAction(R.drawable.ic_play,
R.string.play_button_content_description, ACTION_PLAY);
- mPauseAction = createNotificationAction(
- R.drawable.media_session_service_notification_ic_pause,
+ mPauseAction = createNotificationAction(R.drawable.ic_pause,
R.string.pause_button_content_description, ACTION_PAUSE);
- mSkipToPrevAction = createNotificationAction(
- R.drawable.media_session_service_notification_ic_skip_to_previous,
+ mSkipToPrevAction = createNotificationAction(R.drawable.ic_skip_to_previous,
R.string.skip_to_previous_item_button_content_description, ACTION_SKIP_TO_PREVIOUS);
- mSkipToNextAction = createNotificationAction(
- R.drawable.media_session_service_notification_ic_skip_to_next,
+ mSkipToNextAction = createNotificationAction(R.drawable.ic_skip_to_next,
R.string.skip_to_next_item_button_content_description, ACTION_SKIP_TO_NEXT);
}
@@ -98,7 +92,6 @@
* @param state player state
*/
@Override
- @SuppressLint("RestrictedApi")
public void onPlayerStateChanged(MediaSession session,
@SessionPlayer.PlayerState int state) {
MediaSessionService.MediaNotification mediaNotification =
@@ -124,13 +117,11 @@
}
@Override
- @SuppressLint("RestrictedApi")
public void onSessionClosed(MediaSession session) {
mServiceInstance.removeSession(session);
stopForegroundServiceIfNeeded();
}
- @SuppressLint("RestrictedApi")
private void stopForegroundServiceIfNeeded() {
List<MediaSession> sessions = mServiceInstance.getSessions();
for (int i = 0; i < sessions.size(); i++) {
@@ -147,7 +138,6 @@
/**
* Creates a default media style notification for {@link MediaSessionService}.
*/
- @SuppressLint("RestrictedApi")
public MediaSessionService.MediaNotification onUpdateNotification(MediaSession session) {
ensureNotificationChannel();
@@ -195,14 +185,12 @@
return new MediaSessionService.MediaNotification(NOTIFICATION_ID, notification);
}
- @SuppressLint("RestrictedApi")
private NotificationCompat.Action createNotificationAction(int iconResId, int titleResId,
@PlaybackStateCompat.Actions long action) {
CharSequence title = mServiceInstance.getResources().getText(titleResId);
return new NotificationCompat.Action(iconResId, title, createPendingIntent(action));
}
- @SuppressLint("RestrictedApi")
private PendingIntent createPendingIntent(@PlaybackStateCompat.Actions long action) {
int keyCode = PlaybackStateCompat.toKeyCode(action);
Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
@@ -235,7 +223,7 @@
return appIcon;
} else {
// App icon is not set.
- return R.drawable.media_session_service_notification_ic_music_note;
+ return R.drawable.ic_music_note;
}
}
diff --git a/media2/src/main/java/androidx/media2/MediaPlayer.java b/media2/src/main/java/androidx/media2/MediaPlayer.java
index 5b2c128..113840d 100644
--- a/media2/src/main/java/androidx/media2/MediaPlayer.java
+++ b/media2/src/main/java/androidx/media2/MediaPlayer.java
@@ -16,16 +16,15 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media2.SessionPlayer.PlayerResult.RESULT_ERROR_BAD_VALUE;
import static androidx.media2.SessionPlayer.PlayerResult.RESULT_ERROR_INVALID_STATE;
-import static androidx.media2.SessionPlayer.PlayerResult.RESULT_ERROR_IO;
+import static androidx.media2.SessionPlayer.PlayerResult.RESULT_ERROR_IO_ERROR;
import static androidx.media2.SessionPlayer.PlayerResult.RESULT_ERROR_PERMISSION_DENIED;
-import static androidx.media2.SessionPlayer.PlayerResult.RESULT_ERROR_UNKNOWN;
+import static androidx.media2.SessionPlayer.PlayerResult.RESULT_ERROR_UNKNOWN_ERROR;
import static androidx.media2.SessionPlayer.PlayerResult.RESULT_INFO_SKIPPED;
import static androidx.media2.SessionPlayer.PlayerResult.RESULT_SUCCESS;
-import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.SurfaceTexture;
import android.media.DeniedByServerException;
@@ -164,7 +163,7 @@
* @see PlayerCallback#onError
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int PLAYER_ERROR_SYSTEM = -2147483648;
/**
@@ -179,7 +178,7 @@
PLAYER_ERROR_SYSTEM
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface MediaError {}
/**
@@ -187,7 +186,7 @@
* @see PlayerCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_UNKNOWN = 1;
/**
@@ -195,7 +194,7 @@
* @see PlayerCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_MEDIA_ITEM_START = 2;
/**
@@ -209,7 +208,7 @@
* @see PlayerCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_MEDIA_ITEM_END = 5;
/**
@@ -218,7 +217,7 @@
* @see PlayerCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_MEDIA_ITEM_LIST_END = 6;
/**
@@ -227,7 +226,7 @@
* @see PlayerCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_MEDIA_ITEM_REPEAT = 7;
/**
@@ -250,7 +249,7 @@
* @see PlayerCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_BUFFERING_START = 701;
/**
@@ -258,7 +257,7 @@
* @see PlayerCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_BUFFERING_END = 702;
/**
@@ -268,7 +267,7 @@
* @see PlayerCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_NETWORK_BANDWIDTH = 703;
/**
@@ -303,7 +302,7 @@
* @see PlayerCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_METADATA_UPDATE = 802;
/**
@@ -311,7 +310,7 @@
* JAVA framework to avoid triggering track scanning.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_EXTERNAL_METADATA_UPDATE = 803;
/**
@@ -332,7 +331,7 @@
* @see PlayerCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_TIMED_TEXT_ERROR = 900;
/**
@@ -340,7 +339,7 @@
* @see PlayerCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_UNSUPPORTED_SUBTITLE = 901;
/**
@@ -348,7 +347,7 @@
* @see PlayerCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_SUBTITLE_TIMED_OUT = 902;
/**
@@ -378,7 +377,7 @@
MEDIA_INFO_SUBTITLE_TIMED_OUT
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface MediaInfo {}
/**
@@ -422,7 +421,7 @@
SEEK_CLOSEST,
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface SeekMode {}
private static final int CALL_COMPLETE_PLAYLIST_BASE = -1000;
@@ -443,13 +442,13 @@
static {
sResultCodeMap = new ArrayMap<>();
sResultCodeMap.put(MediaPlayer2.CALL_STATUS_NO_ERROR, RESULT_SUCCESS);
- sResultCodeMap.put(MediaPlayer2.CALL_STATUS_ERROR_UNKNOWN, RESULT_ERROR_UNKNOWN);
+ sResultCodeMap.put(MediaPlayer2.CALL_STATUS_ERROR_UNKNOWN, RESULT_ERROR_UNKNOWN_ERROR);
sResultCodeMap.put(
MediaPlayer2.CALL_STATUS_INVALID_OPERATION, RESULT_ERROR_INVALID_STATE);
sResultCodeMap.put(MediaPlayer2.CALL_STATUS_BAD_VALUE, RESULT_ERROR_BAD_VALUE);
sResultCodeMap.put(
MediaPlayer2.CALL_STATUS_PERMISSION_DENIED, RESULT_ERROR_PERMISSION_DENIED);
- sResultCodeMap.put(MediaPlayer2.CALL_STATUS_ERROR_IO, RESULT_ERROR_IO);
+ sResultCodeMap.put(MediaPlayer2.CALL_STATUS_ERROR_IO, RESULT_ERROR_IO_ERROR);
sResultCodeMap.put(MediaPlayer2.CALL_STATUS_SKIPPED, RESULT_INFO_SKIPPED);
sErrorCodeMap = new ArrayMap<>();
@@ -653,7 +652,6 @@
@GuardedBy("mPlaylistLock")
private boolean mSetMediaItemCalled;
- @SuppressLint("RestrictedApi")
public MediaPlayer(@NonNull Context context) {
mState = PLAYER_STATE_IDLE;
mPlayer = MediaPlayer2.create(context);
@@ -694,7 +692,6 @@
@Override
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> play() {
PendingFuture<PlayerResult> pendingFuture = new PendingFuture<PlayerResult>(mExecutor) {
@Override
@@ -711,7 +708,7 @@
addPendingCommandLocked(MediaPlayer2.CALL_COMPLETED_PLAY, future, token);
}
} else {
- future = createFutureForResultCode(RESULT_ERROR_UNKNOWN);
+ future = createFutureForResultCode(RESULT_ERROR_UNKNOWN_ERROR);
}
futures.add(future);
return futures;
@@ -723,7 +720,6 @@
@Override
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> pause() {
PendingFuture<PlayerResult> pendingFuture = new PendingFuture<PlayerResult>(mExecutor) {
@Override
@@ -751,7 +747,6 @@
*/
@Override
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> prepare() {
PendingFuture<PlayerResult> pendingFuture = new PendingFuture<PlayerResult>(mExecutor) {
@Override
@@ -776,7 +771,6 @@
@Override
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> seekTo(final long position) {
PendingFuture<PlayerResult> pendingFuture =
new PendingFuture<PlayerResult>(mExecutor, true) {
@@ -798,7 +792,6 @@
@Override
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> setPlaybackSpeed(final float playbackSpeed) {
PendingFuture<PlayerResult> pendingFuture = new PendingFuture<PlayerResult>(mExecutor) {
@Override
@@ -822,7 +815,6 @@
@NonNull
@Override
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> setAudioAttributes(
@NonNull final AudioAttributesCompat attr) {
PendingFuture<PlayerResult> pendingFuture = new PendingFuture<PlayerResult>(mExecutor) {
@@ -850,7 +842,6 @@
}
}
- @SuppressLint("RestrictedApi")
@Override
public long getCurrentPosition() {
try {
@@ -861,7 +852,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public long getDuration() {
try {
return mPlayer.getDuration();
@@ -871,7 +861,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public long getBufferedPosition() {
try {
return mPlayer.getBufferedPosition();
@@ -881,7 +870,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public int getBufferingState() {
Integer buffState;
synchronized (mStateLock) {
@@ -891,7 +879,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public float getPlaybackSpeed() {
try {
return mPlayer.getPlaybackParams().getSpeed();
@@ -902,7 +889,6 @@
@Override
@Nullable
- @SuppressLint("RestrictedApi")
public AudioAttributesCompat getAudioAttributes() {
try {
return mPlayer.getAudioAttributes();
@@ -1398,7 +1384,6 @@
@Override
@Nullable
- @SuppressLint("RestrictedApi")
public MediaItem getCurrentMediaItem() {
return mPlayer.getCurrentMediaItem();
}
@@ -1450,7 +1435,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public void close() throws Exception {
reset();
mAudioFocusHandler.close();
@@ -1461,7 +1445,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
public AudioFocusHandler getAudioFocusHandler() {
return mAudioFocusHandler;
@@ -1472,7 +1456,6 @@
* this method, you will have to initialize it again by setting the
* media item and calling {@link #prepare()}.
*/
- @SuppressLint("RestrictedApi")
public void reset() {
// Cancel the pending commands.
synchronized (mPendingCommands) {
@@ -1526,7 +1509,6 @@
* {@link PlayerResult} will be delivered when the command completes.
*/
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> setSurface(@Nullable final Surface surface) {
PendingFuture<PlayerResult> pendingFuture = new PendingFuture<PlayerResult>(mExecutor) {
@Override
@@ -1575,7 +1557,6 @@
* @return the current volume of this player to this player. Note that it does not take into
* account the associated stream volume.
*/
- @SuppressLint("RestrictedApi")
public float getPlayerVolume() {
return mPlayer.getPlayerVolume();
}
@@ -1583,7 +1564,6 @@
/**
* @return the maximum volume that can be used in {@link #setPlayerVolume(float)}.
*/
- @SuppressLint("RestrictedApi")
public float getMaxPlayerVolume() {
return mPlayer.getMaxPlayerVolume();
}
@@ -1598,7 +1578,6 @@
* receive a notification {@link PlayerCallback#onVideoSizeChanged} when the size
* is available.
*/
- @SuppressLint("RestrictedApi")
public @NonNull VideoSize getVideoSize() {
return new VideoSize(mPlayer.getVideoWidth(), mPlayer.getVideoHeight());
}
@@ -1611,9 +1590,8 @@
* Additional vendor-specific fields may also be present in the return value.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@RequiresApi(21)
- @SuppressLint("RestrictedApi")
public PersistableBundle getMetrics() {
return mPlayer.getMetrics();
}
@@ -1631,7 +1609,6 @@
* {@link PlayerResult} will be delivered when the command completes.
*/
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> setPlaybackParams(@NonNull final PlaybackParams params) {
PendingFuture<PlayerResult> pendingFuture = new PendingFuture<PlayerResult>(mExecutor) {
@Override
@@ -1657,7 +1634,6 @@
* @return the playback params.
*/
@NonNull
- @SuppressLint("RestrictedApi")
public PlaybackParams getPlaybackParams() {
return mPlayer.getPlaybackParams();
}
@@ -1680,7 +1656,6 @@
* {@link PlayerResult} will be delivered when the command completes.
*/
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> seekTo(final long msec, @SeekMode final int mode) {
PendingFuture<PlayerResult> pendingFuture =
new PendingFuture<PlayerResult>(mExecutor, true) {
@@ -1721,7 +1696,6 @@
* @see MediaTimestamp
*/
@Nullable
- @SuppressLint("RestrictedApi")
public MediaTimestamp getTimestamp() {
return mPlayer.getTimestamp();
}
@@ -1744,7 +1718,6 @@
* {@link PlayerResult} will be delivered when the command completes.
*/
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> setAudioSessionId(final int sessionId) {
PendingFuture<PlayerResult> pendingFuture = new PendingFuture<PlayerResult>(mExecutor) {
@Override
@@ -1771,7 +1744,6 @@
* Note that the audio session ID is 0 only if a problem occured when the MediaPlayer2 was
* contructed.
*/
- @SuppressLint("RestrictedApi")
public int getAudioSessionId() {
return mPlayer.getAudioSessionId();
}
@@ -1792,7 +1764,6 @@
* {@link PlayerResult} will be delivered when the command completes.
*/
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> attachAuxEffect(final int effectId) {
PendingFuture<PlayerResult> pendingFuture = new PendingFuture<PlayerResult>(mExecutor) {
@Override
@@ -1828,7 +1799,6 @@
* {@link PlayerResult} will be delivered when the command completes.
*/
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> setAuxEffectSendLevel(final float level) {
PendingFuture<PlayerResult> pendingFuture = new PendingFuture<PlayerResult>(mExecutor) {
@Override
@@ -1854,7 +1824,6 @@
* @return List of track info. The total number of tracks is the size of the list.
*/
@NonNull
- @SuppressLint("RestrictedApi")
public List<TrackInfo> getTrackInfo() {
List<MediaPlayer2.TrackInfo> list = mPlayer.getTrackInfo();
List<TrackInfo> trackList = new ArrayList<>();
@@ -1881,7 +1850,6 @@
* @see #selectTrack(int)
* @see #deselectTrack(int)
*/
- @SuppressLint("RestrictedApi")
public int getSelectedTrack(int trackType) {
return mPlayer.getSelectedTrack(trackType);
}
@@ -1915,7 +1883,6 @@
* {@link PlayerResult} will be delivered when the command completes.
*/
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> selectTrack(final int index) {
PendingFuture<PlayerResult> pendingFuture = new PendingFuture<PlayerResult>(mExecutor) {
@Override
@@ -1950,7 +1917,6 @@
* {@link PlayerResult} will be delivered when the command completes.
*/
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<PlayerResult> deselectTrack(final int index) {
PendingFuture<PlayerResult> pendingFuture = new PendingFuture<PlayerResult>(mExecutor) {
@Override
@@ -1977,8 +1943,7 @@
* @hide
*/
@Nullable
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- @SuppressLint("RestrictedApi")
+ @RestrictTo(LIBRARY_GROUP)
public DrmInfo getDrmInfo() {
MediaPlayer2.DrmInfo info = mPlayer.getDrmInfo();
return info == null ? null : new DrmInfo(info);
@@ -2008,10 +1973,9 @@
* {@link DrmResult} will be delivered when the command completes.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
// This is an asynchronous call.
@NonNull
- @SuppressLint("RestrictedApi")
public ListenableFuture<DrmResult> prepareDrm(@NonNull final UUID uuid) {
PendingFuture<DrmResult> pendingFuture = new PendingFuture<DrmResult>(mExecutor) {
@Override
@@ -2041,8 +2005,7 @@
* @throws NoDrmSchemeException if there is no active DRM session to release
* @hide
*/
- @SuppressLint("RestrictedApi")
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void releaseDrm() throws NoDrmSchemeException {
try {
mPlayer.releaseDrm();
@@ -2089,9 +2052,8 @@
* @throws NoDrmSchemeException if there is no active DRM session
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@NonNull
- @SuppressLint("RestrictedApi")
public MediaDrm.KeyRequest getDrmKeyRequest(
@Nullable byte[] keySetId, @Nullable byte[] initData,
@Nullable String mimeType, int keyType,
@@ -2126,8 +2088,7 @@
* @hide
*/
@Nullable
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- @SuppressLint("RestrictedApi")
+ @RestrictTo(LIBRARY_GROUP)
public byte[] provideDrmKeyResponse(
@Nullable byte[] keySetId, @NonNull byte[] response)
throws NoDrmSchemeException, DeniedByServerException {
@@ -2145,8 +2106,7 @@
* @param keySetId identifies the saved key set to restore
* @hide
*/
- @SuppressLint("RestrictedApi")
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void restoreDrmKeys(@NonNull byte[] keySetId) throws NoDrmSchemeException {
try {
mPlayer.restoreDrmKeys(keySetId);
@@ -2165,9 +2125,8 @@
* {@link MediaDrm#PROPERTY_DESCRIPTION}, {@link MediaDrm#PROPERTY_ALGORITHMS}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@NonNull
- @SuppressLint("RestrictedApi")
public String getDrmPropertyString(@NonNull String propertyName) throws NoDrmSchemeException {
try {
return mPlayer.getDrmPropertyString(propertyName);
@@ -2187,8 +2146,7 @@
* {@link MediaDrm#PROPERTY_DESCRIPTION}, {@link MediaDrm#PROPERTY_ALGORITHMS}
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
- @SuppressLint("RestrictedApi")
+ @RestrictTo(LIBRARY_GROUP)
public void setDrmPropertyString(@NonNull String propertyName, @NonNull String value)
throws NoDrmSchemeException {
try {
@@ -2207,8 +2165,7 @@
* @param listener the callback that will be run
* @hide
*/
- @SuppressLint("RestrictedApi")
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setOnDrmConfigHelper(@Nullable final OnDrmConfigHelper listener) {
mPlayer.setOnDrmConfigHelper(listener == null ? null :
new MediaPlayer2.OnDrmConfigHelper() {
@@ -2314,7 +2271,6 @@
return futures;
}
- @SuppressLint("RestrictedApi")
private ResolvableFuture<PlayerResult> setMediaItemInternal(MediaItem item) {
ResolvableFuture<PlayerResult> future = ResolvableFuture.create();
synchronized (mPendingCommands) {
@@ -2327,7 +2283,7 @@
return future;
}
- @SuppressWarnings({"WeakerAccess", "RestrictedApi"}) /* synthetic access */
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
ResolvableFuture<PlayerResult> setNextMediaItemInternal(MediaItem item) {
ResolvableFuture<PlayerResult> future = ResolvableFuture.create();
synchronized (mPendingCommands) {
@@ -2338,7 +2294,7 @@
return future;
}
- @SuppressWarnings({"WeakerAccess", "RestrictedApi"}) /* synthetic access */
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
ResolvableFuture<PlayerResult> skipToNextInternal() {
ResolvableFuture<PlayerResult> future = ResolvableFuture.create();
synchronized (mPendingCommands) {
@@ -2349,7 +2305,7 @@
return future;
}
- @SuppressWarnings({"WeakerAccess", "RestrictedApi"}) /* synthetic access */
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
ResolvableFuture<PlayerResult> setPlayerVolumeInternal(float volume) {
ResolvableFuture<PlayerResult> future = ResolvableFuture.create();
synchronized (mPendingCommands) {
@@ -2365,7 +2321,7 @@
return createFutureForResultCode(resultCode, null);
}
- @SuppressWarnings({"WeakerAccess", "RestrictedApi"}) /* synthetic access */
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
ResolvableFuture<PlayerResult> createFutureForResultCode(int resultCode, MediaItem item) {
ResolvableFuture<PlayerResult> future = ResolvableFuture.create();
future.set(new PlayerResult(resultCode,
@@ -2447,7 +2403,7 @@
return (value > maxValue) ? maxValue : value;
}
- @SuppressWarnings({"WeakerAccess", "RestrictedApi"}) /* synthetic access */
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
void handleCallComplete(MediaPlayer2 mp, final MediaItem item, int what, int status) {
PendingCommand expected;
synchronized (mPendingCommands) {
@@ -2515,7 +2471,7 @@
}
if (what != MediaPlayer2.CALL_COMPLETED_PREPARE_DRM) {
Integer resultCode = sResultCodeMap.containsKey(status)
- ? sResultCodeMap.get(status) : RESULT_ERROR_UNKNOWN;
+ ? sResultCodeMap.get(status) : RESULT_ERROR_UNKNOWN_ERROR;
expected.mFuture.set(new PlayerResult(resultCode, item));
} else {
Integer resultCode = sPrepareDrmStatusMap.containsKey(status)
@@ -2777,7 +2733,7 @@
* of crypto schemes supported by this device
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void onDrmInfo(@NonNull MediaPlayer mp,
@NonNull MediaItem item, @NonNull DrmInfo drmInfo) { }
}
@@ -2792,7 +2748,7 @@
public static final int MEDIA_TRACK_TYPE_VIDEO = 1;
public static final int MEDIA_TRACK_TYPE_AUDIO = 2;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_TRACK_TYPE_TIMEDTEXT = 3;
public static final int MEDIA_TRACK_TYPE_SUBTITLE = 4;
public static final int MEDIA_TRACK_TYPE_METADATA = 5;
@@ -2870,7 +2826,7 @@
* Encapsulates the DRM properties of the source.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final class DrmInfo {
private final MediaPlayer2.DrmInfo mMp2DrmInfo;
@@ -2908,7 +2864,7 @@
* and {@link #setDrmPropertyString}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public interface OnDrmConfigHelper {
/**
* Called to give the app the opportunity to configure DRM before the session is created
@@ -2924,7 +2880,7 @@
* Extends MediaDrm.MediaDrmException
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class NoDrmSchemeException extends MediaDrmException {
public NoDrmSchemeException(@Nullable String detailMessage) {
super(detailMessage);
@@ -2935,7 +2891,7 @@
* Definitions for the metrics that are reported via the {@link #getMetrics} call.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final class MetricsConstants {
private MetricsConstants() {}
@@ -3032,7 +2988,7 @@
* Result class of the asynchronous DRM APIs.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class DrmResult extends PlayerResult {
/**
* The device required DRM provisioning but couldn't reach the provisioning server.
@@ -3069,7 +3025,7 @@
RESULT_ERROR_RESOURCE_BUSY,
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface DrmResultCode {}
/**
diff --git a/media2/src/main/java/androidx/media2/MediaPlayer2.java b/media2/src/main/java/androidx/media2/MediaPlayer2.java
index f8b05bb..2c82372 100644
--- a/media2/src/main/java/androidx/media2/MediaPlayer2.java
+++ b/media2/src/main/java/androidx/media2/MediaPlayer2.java
@@ -17,9 +17,8 @@
package androidx.media2;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
-import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.SurfaceTexture;
import android.media.DeniedByServerException;
@@ -227,7 +226,6 @@
* @hide
*/
@RestrictTo(LIBRARY)
-@SuppressLint("RestrictedApi")
public abstract class MediaPlayer2 {
/**
@@ -253,7 +251,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public MediaPlayer2() { }
/**
@@ -263,7 +261,7 @@
* @return {@code false} if the task could not be cancelled; {@code true} otherwise.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public abstract boolean cancel(Object token);
/**
@@ -333,7 +331,6 @@
* @return a token which can be used to cancel the operation later with {@link #cancel}.
*/
// This is an asynchronous call.
- @SuppressLint("RestrictedApi")
public Object seekTo(long msec) {
return seekTo(msec, SEEK_PREVIOUS_SYNC /* mode */);
}
@@ -633,7 +630,7 @@
SEEK_CLOSEST,
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface SeekMode {}
/**
@@ -781,7 +778,7 @@
public static final int MEDIA_TRACK_TYPE_AUDIO = 2;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_TRACK_TYPE_TIMEDTEXT = 3;
public static final int MEDIA_TRACK_TYPE_SUBTITLE = 4;
@@ -1035,7 +1032,7 @@
PLAYER_STATE_PLAYING,
PLAYER_STATE_ERROR})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface MediaPlayer2State {}
/** Unspecified media player error.
@@ -1071,7 +1068,7 @@
* @see EventCallback#onError
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_ERROR_SYSTEM = -2147483648;
/**
@@ -1086,7 +1083,7 @@
MEDIA_ERROR_SYSTEM
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface MediaError {}
/** Unspecified media player info.
@@ -1154,7 +1151,7 @@
* @see EventCallback#onInfo
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_NETWORK_BANDWIDTH = 703;
/**
@@ -1191,7 +1188,7 @@
* JAVA framework to avoid triggering track scanning.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_EXTERNAL_METADATA_UPDATE = 803;
/** Informs that audio is not playing. Note that playback of the video
@@ -1208,9 +1205,9 @@
/** Failed to handle timed text track properly.
* @see EventCallback#onInfo
- * @hide
+ * {@hide}
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int MEDIA_INFO_TIMED_TEXT_ERROR = 900;
/** Subtitle track was not supported by the media framework.
@@ -1251,7 +1248,7 @@
MEDIA_INFO_SUBTITLE_TIMED_OUT
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface MediaInfo {}
//--------------------------------------------------------------------------
@@ -1350,14 +1347,14 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int SEPARATE_CALL_COMPLETE_CALLBACK_START = 1000;
/** The player just completed a call {@code notifyWhenCommandLabelReached}.
* @see EventCallback#onCommandLabelReached
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int CALL_COMPLETED_NOTIFY_WHEN_COMMAND_LABEL_REACHED =
SEPARATE_CALL_COMPLETE_CALLBACK_START;
@@ -1365,7 +1362,7 @@
* @see EventCallback#onCommandLabelReached
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int CALL_COMPLETED_PREPARE_DRM =
SEPARATE_CALL_COMPLETE_CALLBACK_START + 1;
@@ -1395,7 +1392,7 @@
CALL_COMPLETED_PREPARE_DRM,
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface CallCompleted {}
/** Status code represents that call is completed without an error.
@@ -1446,7 +1443,7 @@
CALL_STATUS_ERROR_IO,
CALL_STATUS_SKIPPED})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface CallStatus {}
// Modular DRM begin
@@ -1568,7 +1565,7 @@
PREPARE_DRM_STATUS_RESOURCE_BUSY,
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface PrepareDrmStatusCode {}
/**
diff --git a/media2/src/main/java/androidx/media2/MediaPlayer2Impl.java b/media2/src/main/java/androidx/media2/MediaPlayer2Impl.java
index dd94224..3b9de63 100644
--- a/media2/src/main/java/androidx/media2/MediaPlayer2Impl.java
+++ b/media2/src/main/java/androidx/media2/MediaPlayer2Impl.java
@@ -15,9 +15,8 @@
*/
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
-import android.annotation.SuppressLint;
import android.media.AudioAttributes;
import android.media.DeniedByServerException;
import android.media.MediaDataSource;
@@ -67,8 +66,7 @@
* @hide
*/
@RequiresApi(28)
-@RestrictTo(LIBRARY_GROUP_PREFIX)
-@SuppressLint("RestrictedApi")
+@RestrictTo(LIBRARY_GROUP)
public final class MediaPlayer2Impl extends MediaPlayer2 {
private static final String TAG = "MediaPlayer2Impl";
diff --git a/media2/src/main/java/androidx/media2/MediaSession.java b/media2/src/main/java/androidx/media2/MediaSession.java
index ed4d99f..759768d 100644
--- a/media2/src/main/java/androidx/media2/MediaSession.java
+++ b/media2/src/main/java/androidx/media2/MediaSession.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media2.SessionResult.RESULT_ERROR_NOT_SUPPORTED;
import static androidx.media2.SessionResult.RESULT_SUCCESS;
@@ -50,7 +50,7 @@
import com.google.common.util.concurrent.ListenableFuture;
-import java.util.HashMap;
+import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executor;
@@ -130,23 +130,20 @@
public class MediaSession implements AutoCloseable {
static final String TAG = "MediaSession";
- // It's better to have private static lock instead of using MediaSession.class because the
- // private lock object isn't exposed.
- private static final Object STATIC_LOCK = new Object();
// Note: This checks the uniqueness of a session ID only in single process.
// When the framework becomes able to check the uniqueness, this logic should be removed.
- @GuardedBy("STATIC_LOCK")
- private static final HashMap<String, MediaSession> SESSION_ID_TO_SESSION_MAP = new HashMap<>();
+ @GuardedBy("MediaSession.class")
+ private static final List<String> SESSION_ID_LIST = new ArrayList<>();
private final MediaSessionImpl mImpl;
MediaSession(Context context, String id, SessionPlayer player,
PendingIntent sessionActivity, Executor callbackExecutor, SessionCallback callback) {
- synchronized (STATIC_LOCK) {
- if (SESSION_ID_TO_SESSION_MAP.containsKey(id)) {
+ synchronized (MediaSession.class) {
+ if (SESSION_ID_LIST.contains(id)) {
throw new IllegalStateException("Session ID must be unique. ID=" + id);
}
- SESSION_ID_TO_SESSION_MAP.put(id, this);
+ SESSION_ID_LIST.add(id);
}
mImpl = createImpl(context, id, player, sessionActivity, callbackExecutor,
callback);
@@ -165,17 +162,6 @@
return mImpl;
}
- static MediaSession getSession(Uri sessionUri) {
- synchronized (STATIC_LOCK) {
- for (MediaSession session : SESSION_ID_TO_SESSION_MAP.values()) {
- if (ObjectsCompat.equals(session.getUri(), sessionUri)) {
- return session;
- }
- }
- }
- return null;
- }
-
/**
* Updates the underlying {@link SessionPlayer} for this session to dispatch incoming event to.
*
@@ -191,8 +177,8 @@
@Override
public void close() {
try {
- synchronized (STATIC_LOCK) {
- SESSION_ID_TO_SESSION_MAP.remove(mImpl.getId());
+ synchronized (MediaSession.class) {
+ SESSION_ID_LIST.remove(mImpl.getId());
}
mImpl.close();
} catch (Exception e) {
@@ -203,7 +189,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isClosed() {
return mImpl.isClosed();
}
@@ -357,7 +343,7 @@
* @hide
* @return Bundle
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public MediaSessionCompat getSessionCompat() {
return mImpl.getSessionCompat();
}
@@ -379,11 +365,6 @@
return mImpl.getLegacyBrowserServiceBinder();
}
- @NonNull
- private Uri getUri() {
- return mImpl.getUri();
- }
-
/**
* Callback to be called for all incoming commands from {@link MediaController}s.
* <p>
@@ -577,7 +558,7 @@
* @see SessionCommand#COMMAND_CODE_SESSION_PLAY_FROM_MEDIA_ID
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ResultCode
public int onPlayFromMediaId(@NonNull MediaSession session,
@NonNull ControllerInfo controller, @NonNull String mediaId,
@@ -596,7 +577,7 @@
* @see SessionCommand#COMMAND_CODE_SESSION_PLAY_FROM_SEARCH
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ResultCode
public int onPlayFromSearch(@NonNull MediaSession session,
@NonNull ControllerInfo controller, @NonNull String query,
@@ -615,7 +596,7 @@
* @see SessionCommand#COMMAND_CODE_SESSION_PLAY_FROM_URI
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ResultCode
public int onPlayFromUri(@NonNull MediaSession session,
@NonNull ControllerInfo controller, @NonNull Uri uri,
@@ -644,7 +625,7 @@
* @see SessionCommand#COMMAND_CODE_SESSION_PREPARE_FROM_MEDIA_ID
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ResultCode
public int onPrepareFromMediaId(@NonNull MediaSession session,
@NonNull ControllerInfo controller, @NonNull String mediaId,
@@ -673,7 +654,7 @@
* @see SessionCommand#COMMAND_CODE_SESSION_PREPARE_FROM_SEARCH
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ResultCode
public int onPrepareFromSearch(@NonNull MediaSession session,
@NonNull ControllerInfo controller, @NonNull String query,
@@ -702,7 +683,7 @@
* @see SessionCommand#COMMAND_CODE_SESSION_PREPARE_FROM_URI
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@ResultCode
public int onPrepareFromUri(@NonNull MediaSession session,
@NonNull ControllerInfo controller, @NonNull Uri uri, @Nullable Bundle extras) {
@@ -850,7 +831,7 @@
* SessionCallback#onConnected().
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
ControllerInfo(@NonNull RemoteUserInfo remoteUserInfo, boolean trusted,
@Nullable ControllerCb cb) {
mRemoteUserInfo = remoteUserInfo;
@@ -861,7 +842,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @NonNull RemoteUserInfo getRemoteUserInfo() {
return mRemoteUserInfo;
}
@@ -890,7 +871,7 @@
* @return {@code true} if the controller is trusted.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isTrusted() {
return mIsTrusted;
}
@@ -1136,7 +1117,6 @@
void updatePlayer(@NonNull SessionPlayer player);
@NonNull SessionPlayer getPlayer();
@NonNull String getId();
- @NonNull Uri getUri();
@NonNull SessionToken getToken();
@NonNull List<ControllerInfo> getConnectedControllers();
boolean isConnected(@NonNull ControllerInfo controller);
@@ -1180,7 +1160,7 @@
* T, U, C extends androidx.media2.MediaSession.SessionCallback>, C></pre>
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
abstract static class BuilderBase
<T extends MediaSession, U extends BuilderBase<T, U, C>, C extends SessionCallback> {
final Context mContext;
diff --git a/media2/src/main/java/androidx/media2/MediaSessionImplBase.java b/media2/src/main/java/androidx/media2/MediaSessionImplBase.java
index dc26a9f..2498a0e 100644
--- a/media2/src/main/java/androidx/media2/MediaSessionImplBase.java
+++ b/media2/src/main/java/androidx/media2/MediaSessionImplBase.java
@@ -28,22 +28,16 @@
import static androidx.media2.SessionPlayer.UNKNOWN_TIME;
import static androidx.media2.SessionResult.RESULT_ERROR_INVALID_STATE;
import static androidx.media2.SessionResult.RESULT_ERROR_SESSION_DISCONNECTED;
-import static androidx.media2.SessionResult.RESULT_ERROR_UNKNOWN;
+import static androidx.media2.SessionResult.RESULT_ERROR_UNKNOWN_ERROR;
import static androidx.media2.SessionResult.RESULT_INFO_SKIPPED;
import static androidx.media2.SessionResult.RESULT_SUCCESS;
import static androidx.media2.SessionToken.TYPE_SESSION;
import android.annotation.SuppressLint;
import android.app.PendingIntent;
-import android.content.BroadcastReceiver;
-import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
import android.media.AudioManager;
-import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.DeadObjectException;
@@ -58,7 +52,6 @@
import android.support.v4.media.session.PlaybackStateCompat;
import android.text.TextUtils;
import android.util.Log;
-import android.view.KeyEvent;
import androidx.annotation.GuardedBy;
import androidx.annotation.NonNull;
@@ -88,42 +81,29 @@
private static final String DEFAULT_MEDIA_SESSION_TAG_DELIM = ".";
private static final int ITEM_NONE = -1;
- // Create a static lock for synchronize methods below.
- // We'd better not use MediaSessionImplBase.class for synchronized(), which indirectly exposes
- // lock object to the outside of the class.
- private static final Object STATIC_LOCK = new Object();
- @GuardedBy("STATIC_LOCK")
- private static boolean sComponentNamesInitialized = false;
- @GuardedBy("STATIC_LOCK")
- private static ComponentName sServiceComponentName;
-
static final String TAG = "MSImplBase";
static final boolean DEBUG = true; //Log.isLoggable(TAG, Log.DEBUG);
private static final SessionResult RESULT_WHEN_CLOSED = new SessionResult(RESULT_INFO_SKIPPED);
- final Object mLock = new Object();
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- final Uri mSessionUri;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- final Executor mCallbackExecutor;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- final SessionCallback mCallback;
-
private final Context mContext;
private final HandlerThread mHandlerThread;
private final Handler mHandler;
private final MediaSessionCompat mSessionCompat;
private final MediaSessionStub mSessionStub;
private final MediaSessionLegacyStub mSessionLegacyStub;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ final Executor mCallbackExecutor;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ final SessionCallback mCallback;
private final String mSessionId;
private final SessionToken mSessionToken;
private final AudioManager mAudioManager;
private final SessionPlayer.PlayerCallback mPlayerCallback;
private final MediaSession mInstance;
private final PendingIntent mSessionActivity;
- private final PendingIntent mMediaButtonIntent;
- private final BroadcastReceiver mBroadcastReceiver;
+
+ final Object mLock = new Object();
@GuardedBy("mLock")
@SuppressWarnings("WeakerAccess") /* synthetic access */
@@ -152,65 +132,12 @@
mPlayerCallback = new SessionPlayerCallback(this);
mSessionId = id;
- // Build Uri that differentiate sessions across the creation/destruction in PendingIntent.
- // Here's the reason why Session ID / SessionToken aren't suitable here.
- // - Session ID
- // PendingIntent from the previously closed session with the same ID can be sent to the
- // newly created session.
- // - SessionToken
- // SessionToken is a Parcelable so we can only put it into the intent extra.
- // However, creating two different PendingIntent that only differs extras isn't allowed.
- // See {@link PendingIntent} and {@link Intent#filterEquals} for details.
- mSessionUri = new Uri.Builder().scheme(MediaSessionImplBase.class.getName()).appendPath(id)
- .appendPath(String.valueOf(SystemClock.elapsedRealtime())).build();
mSessionToken = new SessionToken(new SessionTokenImplBase(Process.myUid(),
TYPE_SESSION, context.getPackageName(), mSessionStub));
String sessionCompatId = TextUtils.join(DEFAULT_MEDIA_SESSION_TAG_DELIM,
new String[] {DEFAULT_MEDIA_SESSION_TAG_PREFIX, id});
- ComponentName mbrComponent = null;
- synchronized (STATIC_LOCK) {
- if (!sComponentNamesInitialized) {
- sServiceComponentName = getServiceComponentByAction(
- MediaLibraryService.SERVICE_INTERFACE);
- if (sServiceComponentName == null) {
- sServiceComponentName = getServiceComponentByAction(
- MediaSessionService.SERVICE_INTERFACE);
- }
- sComponentNamesInitialized = true;
- mbrComponent = sServiceComponentName;
- }
- }
- if (mbrComponent == null) {
- // No service to revive playback after it's dead.
- // Create a PendingIntent that points to the runtime broadcast receiver.
- mbrComponent = new ComponentName(context, context.getClass());
- Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
- intent.setPackage(context.getPackageName());
- mMediaButtonIntent = PendingIntent.getBroadcast(
- context, 0 /* requestCode */, intent, 0 /* flags */);
-
- // Create and register a BroadcastReceiver for receiving PendingIntent.
- // TODO: Introduce MediaButtonReceiver in AndroidManifest instead of this,
- // or register only one receiver for all sessions.
- mBroadcastReceiver = new MediaButtonReceiver();
- context.registerReceiver(mBroadcastReceiver,
- new IntentFilter(Intent.ACTION_MEDIA_BUTTON));
- } else {
- // Has MediaSessionService to revive playback after it's dead.
- Intent intent = new Intent(Intent.ACTION_MEDIA_BUTTON);
- intent.setData(mSessionUri);
- intent.setComponent(mbrComponent);
- if (Build.VERSION.SDK_INT >= 26) {
- mMediaButtonIntent = PendingIntent.getForegroundService(mContext, 0, intent, 0);
- } else {
- mMediaButtonIntent = PendingIntent.getService(mContext, 0, intent, 0);
- }
- mBroadcastReceiver = null;
- }
-
- mSessionCompat = new MediaSessionCompat(context, sessionCompatId, mbrComponent,
- mMediaButtonIntent, mSessionToken);
+ mSessionCompat = new MediaSessionCompat(context, sessionCompatId, mSessionToken);
// NOTE: mSessionLegacyStub should be created after mSessionCompat created.
mSessionLegacyStub = new MediaSessionLegacyStub(this);
@@ -355,10 +282,6 @@
}
mPlayer.unregisterPlayerCallback(mPlayerCallback);
mSessionCompat.release();
- mMediaButtonIntent.cancel();
- if (mBroadcastReceiver != null) {
- mContext.unregisterReceiver(mBroadcastReceiver);
- }
mCallback.onSessionClosed(mInstance);
dispatchRemoteControllerTaskWithoutReturn(new RemoteControllerTask() {
@Override
@@ -390,11 +313,6 @@
}
@Override
- public Uri getUri() {
- return mSessionUri;
- }
-
- @Override
public @NonNull SessionToken getToken() {
return mSessionToken;
}
@@ -1180,7 +1098,7 @@
// - DeadSystemException means that errors around it can be ignored.
Log.w(TAG, "Exception in " + controller.toString(), e);
}
- return SessionResult.createFutureWithResult(RESULT_ERROR_UNKNOWN);
+ return SessionResult.createFutureWithResult(RESULT_ERROR_UNKNOWN_ERROR);
}
/**
@@ -1195,19 +1113,6 @@
mSessionStub.getConnectedControllersManager().removeController(controller);
}
- @Nullable
- private ComponentName getServiceComponentByAction(@NonNull String action) {
- PackageManager pm = mContext.getPackageManager();
- Intent queryIntent = new Intent(action);
- queryIntent.setPackage(mContext.getPackageName());
- List<ResolveInfo> resolveInfos = pm.queryIntentServices(queryIntent, 0 /* flags */);
- if (resolveInfos == null || resolveInfos.isEmpty()) {
- return null;
- }
- ResolveInfo resolveInfo = resolveInfos.get(0);
- return new ComponentName(resolveInfo.serviceInfo.packageName, resolveInfo.serviceInfo.name);
- }
-
///////////////////////////////////////////////////
// Inner classes
///////////////////////////////////////////////////
@@ -1431,7 +1336,6 @@
session.dispatchRemoteControllerTaskWithoutReturn(task);
}
- @SuppressLint("RestrictedApi")
private void updateDurationIfNeeded(@NonNull final SessionPlayer player,
@Nullable final MediaItem item) {
if (item == null) {
@@ -1604,23 +1508,4 @@
}
}
}
-
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- final class MediaButtonReceiver extends BroadcastReceiver {
- @Override
- public void onReceive(Context context, Intent intent) {
- if (!Intent.ACTION_MEDIA_BUTTON.equals(intent.getAction())) {
- return;
- }
- Uri sessionUri = intent.getData();
- if (!ObjectsCompat.equals(sessionUri, mSessionUri)) {
- return;
- }
- KeyEvent keyEvent = (KeyEvent) intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
- if (keyEvent == null) {
- return;
- }
- getSessionCompat().getController().dispatchMediaButtonEvent(keyEvent);
- }
- };
}
diff --git a/media2/src/main/java/androidx/media2/MediaSessionLegacyStub.java b/media2/src/main/java/androidx/media2/MediaSessionLegacyStub.java
index f1a0b4b..5372ed8 100644
--- a/media2/src/main/java/androidx/media2/MediaSessionLegacyStub.java
+++ b/media2/src/main/java/androidx/media2/MediaSessionLegacyStub.java
@@ -23,7 +23,6 @@
import static androidx.media2.SessionCommand.COMMAND_VERSION_CURRENT;
import static androidx.media2.SessionResult.RESULT_SUCCESS;
-import android.annotation.SuppressLint;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
@@ -68,7 +67,6 @@
new SparseArray<>();
static {
- @SuppressLint("RestrictedApi")
SessionCommandGroup group = new SessionCommandGroup.Builder()
.addAllPlayerCommands(COMMAND_VERSION_CURRENT)
.addAllVolumeCommands(COMMAND_VERSION_CURRENT)
@@ -299,16 +297,6 @@
}
@Override
- public void onSetPlaybackSpeed(final float speed) {
- dispatchSessionTask(SessionCommand.COMMAND_CODE_PLAYER_SET_SPEED, new SessionTask() {
- @Override
- public void run(ControllerInfo controller) throws RemoteException {
- mSessionImpl.setPlaybackSpeed(speed);
- }
- });
- }
-
- @Override
public void onSkipToQueueItem(final long queueId) {
dispatchSessionTask(SessionCommand.COMMAND_CODE_PLAYER_SKIP_TO_PLAYLIST_ITEM,
new SessionTask() {
@@ -354,7 +342,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public void onSetRating(final RatingCompat rating, Bundle extras) {
if (rating == null) {
return;
@@ -434,7 +421,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public void onRemoveQueueItem(final MediaDescriptionCompat description) {
if (description == null) {
return;
diff --git a/media2/src/main/java/androidx/media2/MediaSessionService.java b/media2/src/main/java/androidx/media2/MediaSessionService.java
index 92e8f22..6a913f6 100644
--- a/media2/src/main/java/androidx/media2/MediaSessionService.java
+++ b/media2/src/main/java/androidx/media2/MediaSessionService.java
@@ -105,7 +105,6 @@
* connecting any session in this service. In that case, {@link #onGetPrimarySession()} will be
* called to know which session to handle incoming connection request. Pick the best session among
* added sessions, or create new one and return from the {@link #onGetPrimarySession()}.
- * </div>
*/
public abstract class MediaSessionService extends Service {
/**
diff --git a/media2/src/main/java/androidx/media2/MediaSessionServiceImplBase.java b/media2/src/main/java/androidx/media2/MediaSessionServiceImplBase.java
index 982fdcb..2f59f06 100644
--- a/media2/src/main/java/androidx/media2/MediaSessionServiceImplBase.java
+++ b/media2/src/main/java/androidx/media2/MediaSessionServiceImplBase.java
@@ -18,7 +18,6 @@
import static android.app.Service.START_STICKY;
-import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Binder;
import android.os.Handler;
@@ -60,7 +59,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public void onCreate(MediaSessionService service) {
synchronized (mLock) {
mInstance = service;
@@ -107,7 +105,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public void addSession(final MediaSession session) {
final MediaSession old;
synchronized (mLock) {
@@ -149,10 +146,7 @@
if (instance == null) {
Log.wtf(TAG, "Service hasn't created");
}
- MediaSession session = MediaSession.getSession(intent.getData());
- if (session == null) {
- session = instance.onGetPrimarySession();
- }
+ final MediaSession session = instance.onGetPrimarySession();
if (session == null) {
Log.w(TAG, "No session for handling media key");
break;
@@ -168,7 +162,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public MediaNotification onUpdateNotification(MediaSession session) {
final MediaNotificationHandler handler;
synchronized (mLock) {
diff --git a/media2/src/main/java/androidx/media2/MediaSessionServiceLegacyStub.java b/media2/src/main/java/androidx/media2/MediaSessionServiceLegacyStub.java
index ee7011e..dab23c2 100644
--- a/media2/src/main/java/androidx/media2/MediaSessionServiceLegacyStub.java
+++ b/media2/src/main/java/androidx/media2/MediaSessionServiceLegacyStub.java
@@ -16,7 +16,6 @@
package androidx.media2;
-import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.media.MediaBrowserCompat.MediaItem;
@@ -40,7 +39,6 @@
final MediaSessionManager mManager;
- @SuppressLint("RestrictedApi")
MediaSessionServiceLegacyStub(Context context, MediaSessionImpl sessionImpl,
MediaSessionCompat.Token token) {
super();
diff --git a/media2/src/main/java/androidx/media2/MediaSessionStub.java b/media2/src/main/java/androidx/media2/MediaSessionStub.java
index 1de652f..e551743 100644
--- a/media2/src/main/java/androidx/media2/MediaSessionStub.java
+++ b/media2/src/main/java/androidx/media2/MediaSessionStub.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.media2.BaseResult.RESULT_ERROR_UNKNOWN;
+import static androidx.media2.BaseResult.RESULT_ERROR_UNKNOWN_ERROR;
import static androidx.media2.MediaUtils.DIRECT_EXECUTOR;
import static androidx.media2.SessionCommand.COMMAND_CODE_CUSTOM;
import static androidx.media2.SessionCommand.COMMAND_VERSION_CURRENT;
@@ -24,7 +24,6 @@
import static androidx.media2.SessionResult.RESULT_ERROR_INVALID_STATE;
import static androidx.media2.SessionResult.RESULT_SUCCESS;
-import android.annotation.SuppressLint;
import android.content.Context;
import android.net.Uri;
import android.os.Binder;
@@ -77,7 +76,6 @@
new SparseArray<>();
static {
- @SuppressLint("RestrictedApi")
SessionCommandGroup group = new SessionCommandGroup.Builder()
.addAllPlayerCommands(COMMAND_VERSION_CURRENT)
.addAllVolumeCommands(COMMAND_VERSION_CURRENT)
@@ -288,13 +286,13 @@
if (task instanceof PlayerTask) {
sendPlayerResult(controller, seq,
new PlayerResult(
- PlayerResult.RESULT_ERROR_UNKNOWN, null));
+ PlayerResult.RESULT_ERROR_UNKNOWN_ERROR, null));
} else if (task instanceof SessionCallbackTask) {
sendSessionResult(controller, seq,
- SessionResult.RESULT_ERROR_UNKNOWN);
+ SessionResult.RESULT_ERROR_UNKNOWN_ERROR);
} else if (task instanceof LibrarySessionCallbackTask) {
sendLibraryResult(controller, seq,
- LibraryResult.RESULT_ERROR_UNKNOWN);
+ LibraryResult.RESULT_ERROR_UNKNOWN_ERROR);
}
}
}
@@ -644,7 +642,7 @@
throw new RuntimeException("SessionCallback#onCustomCommand has returned"
+ " null, command=" + sessionCommand);
} else {
- result = new SessionResult(RESULT_ERROR_UNKNOWN);
+ result = new SessionResult(RESULT_ERROR_UNKNOWN_ERROR);
}
}
return result;
@@ -1230,7 +1228,7 @@
@Override
void onSessionResult(int seq, @Nullable SessionResult result) throws RemoteException {
if (result == null) {
- result = new SessionResult(RESULT_ERROR_UNKNOWN, null);
+ result = new SessionResult(RESULT_ERROR_UNKNOWN_ERROR, null);
}
mIControllerCallback.onSessionResult(seq, MediaUtils.toParcelable(result));
}
@@ -1238,7 +1236,7 @@
@Override
void onLibraryResult(int seq, LibraryResult result) throws RemoteException {
if (result == null) {
- result = new LibraryResult(LibraryResult.RESULT_ERROR_UNKNOWN);
+ result = new LibraryResult(LibraryResult.RESULT_ERROR_UNKNOWN_ERROR);
}
mIControllerCallback.onLibraryResult(seq, MediaUtils.toParcelable(result));
}
diff --git a/media2/src/main/java/androidx/media2/MediaTimestamp.java b/media2/src/main/java/androidx/media2/MediaTimestamp.java
index c72cc62..653c323 100644
--- a/media2/src/main/java/androidx/media2/MediaTimestamp.java
+++ b/media2/src/main/java/androidx/media2/MediaTimestamp.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
@@ -77,7 +77,7 @@
private final float mClockRate;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public MediaTimestamp(long mediaUs, long systemNs, float rate) {
mMediaTimeUs = mediaUs;
mNanoTime = systemNs;
@@ -86,7 +86,7 @@
/** @hide */
@RequiresApi(23)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
MediaTimestamp(android.media.MediaTimestamp timestamp) {
mMediaTimeUs = timestamp.getAnchorMediaTimeUs();
mNanoTime = timestamp.getAnchorSytemNanoTime();
@@ -94,7 +94,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
MediaTimestamp() {
mMediaTimeUs = 0;
mNanoTime = 0;
diff --git a/media2/src/main/java/androidx/media2/MediaUtils.java b/media2/src/main/java/androidx/media2/MediaUtils.java
index f9f8151..8e25b57 100644
--- a/media2/src/main/java/androidx/media2/MediaUtils.java
+++ b/media2/src/main/java/androidx/media2/MediaUtils.java
@@ -76,7 +76,7 @@
/**
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE)
public class MediaUtils {
public static final String TAG = "MediaUtils";
@@ -128,7 +128,6 @@
* @param item2 an item.
* @return The newly created media item.
*/
- @SuppressLint("RestrictedApi")
public static MediaBrowserCompat.MediaItem convertToMediaItem(MediaItem item2) {
if (item2 == null) {
return null;
@@ -315,7 +314,6 @@
* Convert a list of {@link MediaItem} to a list of {@link QueueItem}. The index of the item
* would be used as the queue ID to match the behavior of {@link MediaController}.
*/
- @SuppressLint("RestrictedApi")
public static List<QueueItem> convertToQueueItemList(List<MediaItem> items) {
if (items == null) {
return null;
@@ -799,7 +797,6 @@
* @return the converted session command group
*/
@NonNull
- @SuppressLint("RestrictedApi")
public static SessionCommandGroup convertToSessionCommandGroup(long sessionFlags,
PlaybackStateCompat state) {
SessionCommandGroup.Builder commandsBuilder = new SessionCommandGroup.Builder();
@@ -868,7 +865,6 @@
return ParcelUtils.<T>fromParcelable(p);
}
- @SuppressLint("RestrictedApi")
private static class MediaItemParcelImpl extends ParcelImpl {
private final MediaItem mItem;
@SuppressLint("RestrictedApi")
diff --git a/media2/src/main/java/androidx/media2/ParcelImplListSlice.java b/media2/src/main/java/androidx/media2/ParcelImplListSlice.java
index 0996678..3a22249 100644
--- a/media2/src/main/java/androidx/media2/ParcelImplListSlice.java
+++ b/media2/src/main/java/androidx/media2/ParcelImplListSlice.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.os.Binder;
@@ -41,7 +41,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("BanParcelableUsage")
public class ParcelImplListSlice implements Parcelable {
private static final String TAG = "ParcelImplListSlice";
diff --git a/media2/src/main/java/androidx/media2/PlaybackParams.java b/media2/src/main/java/androidx/media2/PlaybackParams.java
index 2b93cd6..c9c441a 100644
--- a/media2/src/main/java/androidx/media2/PlaybackParams.java
+++ b/media2/src/main/java/androidx/media2/PlaybackParams.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.media.AudioTrack;
import android.os.Build;
@@ -63,7 +63,7 @@
*/
public final class PlaybackParams {
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef(
value = {
AUDIO_FALLBACK_MODE_DEFAULT,
@@ -148,7 +148,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@RequiresApi(23)
public android.media.PlaybackParams getPlaybackParams() {
if (Build.VERSION.SDK_INT >= 23) {
@@ -168,9 +168,6 @@
private Float mSpeed;
private android.media.PlaybackParams mPlaybackParams;
- /**
- * Default constructor
- */
public Builder() {
if (Build.VERSION.SDK_INT >= 23) {
mPlaybackParams = new android.media.PlaybackParams();
@@ -178,17 +175,12 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@RequiresApi(23)
public Builder(android.media.PlaybackParams playbackParams) {
mPlaybackParams = playbackParams;
}
- /**
- * Constructs a new PlaybackParams builder using data from {@code playbackParams}.
- *
- * @param playbackParams the non-null instance to initialize from.
- */
public Builder(@NonNull PlaybackParams playbackParams) {
if (Build.VERSION.SDK_INT >= 23) {
mPlaybackParams = playbackParams.getPlaybackParams();
@@ -247,7 +239,6 @@
/**
* Takes the values of the Builder object and creates a PlaybackParams object.
- *
* @return PlaybackParams object with values from the Builder.
*/
public @NonNull PlaybackParams build() {
diff --git a/media2/src/main/java/androidx/media2/RemoteSessionPlayer.java b/media2/src/main/java/androidx/media2/RemoteSessionPlayer.java
index e9070d6..0efddc7 100644
--- a/media2/src/main/java/androidx/media2/RemoteSessionPlayer.java
+++ b/media2/src/main/java/androidx/media2/RemoteSessionPlayer.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
@@ -24,7 +24,6 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-import java.util.concurrent.Executor;
import java.util.concurrent.Future;
/**
@@ -33,14 +32,15 @@
* <p>
* If you use this to the {@link MediaSession}, session would dispatch incoming volume change event
* to the player instead of changing device stream volume.
+ *
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public abstract class RemoteSessionPlayer extends SessionPlayer {
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({VOLUME_CONTROL_FIXED, VOLUME_CONTROL_RELATIVE, VOLUME_CONTROL_ABSOLUTE})
@Retention(RetentionPolicy.SOURCE)
public @interface VolumeControlType {}
@@ -69,13 +69,13 @@
* Adjust player volume with the direction. Override this API to customize volume change in
* remote device
* <p>
+ * Default implement adjust volume by 1
+ * <p>
* This would be ignored when volume control type is {@link #VOLUME_CONTROL_FIXED}.
*
* @param direction direction of the volume changes. Positive value for volume up, negative for
* volume down.
- * @return result of adjusting the volume. Shouldn't be {@code null}.
*/
- @NonNull
public abstract Future<PlayerResult> adjustVolume(int direction);
/**
@@ -88,10 +88,8 @@
* A value of {@code 0} indicates muting. See {@link #getMaxVolume()} for the volume range
* supported by this player.
*
- * @param volume a value between {@code 0} and {@link #getMaxVolume()}.
- * @return result of setting the volume. Shouldn't be {@code null}.
+ * @param volume a value between 0.0f and {@link #getMaxVolume()}.
*/
- @NonNull
public abstract Future<PlayerResult> setVolume(int volume);
/**
@@ -124,23 +122,18 @@
public abstract @VolumeControlType int getVolumeControlType();
/**
- * A callback class to receive notifications for events on the remote session player. See
- * {@link #registerPlayerCallback(Executor, PlayerCallback)} to register this callback.
- * <p>
- * This is registered by {@link MediaSession} to notify volume changes to the
- * {@link MediaController}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class Callback extends SessionPlayer.PlayerCallback {
/**
* Called to indicate that the volume has changed.
*
- * @param player the player that has changed volume.
+ * @param player2 the player that has completed volume changes.
* @param volume the new volume
* @see #setVolume(int)
*/
- public void onVolumeChanged(@NonNull RemoteSessionPlayer player, int volume) {
+ public void onVolumeChanged(@NonNull RemoteSessionPlayer player2, int volume) {
}
}
}
diff --git a/media2/src/main/java/androidx/media2/SessionCommand.java b/media2/src/main/java/androidx/media2/SessionCommand.java
index fb891ac..39abc08 100644
--- a/media2/src/main/java/androidx/media2/SessionCommand.java
+++ b/media2/src/main/java/androidx/media2/SessionCommand.java
@@ -17,7 +17,7 @@
package androidx.media2;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.net.Uri;
import android.os.Bundle;
@@ -69,7 +69,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({COMMAND_VERSION_1})
@Retention(RetentionPolicy.SOURCE)
public @interface CommandVersion {}
@@ -77,7 +77,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({COMMAND_CODE_CUSTOM,
COMMAND_CODE_PLAYER_PLAY,
COMMAND_CODE_PLAYER_PAUSE,
@@ -421,7 +421,7 @@
* Code version is {@link #COMMAND_VERSION_1}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int COMMAND_CODE_SESSION_PLAY_FROM_MEDIA_ID = 40004;
/**
@@ -430,7 +430,7 @@
* Code version is {@link #COMMAND_VERSION_1}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int COMMAND_CODE_SESSION_PLAY_FROM_SEARCH = 40005;
/**
@@ -439,7 +439,7 @@
* Code version is {@link #COMMAND_VERSION_1}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int COMMAND_CODE_SESSION_PLAY_FROM_URI = 40006;
/**
@@ -448,7 +448,7 @@
* Code version is {@link #COMMAND_VERSION_1}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int COMMAND_CODE_SESSION_PREPARE_FROM_MEDIA_ID = 40007;
/**
@@ -457,7 +457,7 @@
* Code version is {@link #COMMAND_VERSION_1}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int COMMAND_CODE_SESSION_PREPARE_FROM_SEARCH = 40008;
/**
@@ -466,7 +466,7 @@
* Code version is {@link #COMMAND_VERSION_1}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int COMMAND_CODE_SESSION_PREPARE_FROM_URI = 40009;
/**
diff --git a/media2/src/main/java/androidx/media2/SessionCommandGroup.java b/media2/src/main/java/androidx/media2/SessionCommandGroup.java
index 1225c89..3288a16 100644
--- a/media2/src/main/java/androidx/media2/SessionCommandGroup.java
+++ b/media2/src/main/java/androidx/media2/SessionCommandGroup.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media2.SessionCommand.COMMAND_CODE_CUSTOM;
import static androidx.media2.SessionCommand.COMMAND_VERSION_1;
@@ -67,7 +67,7 @@
* @param command A command to add. Shouldn't be {@code null}.
* @hide TODO remove this method
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void addCommand(@NonNull SessionCommand command) {
if (command == null) {
throw new IllegalArgumentException("command shouldn't be null");
@@ -84,7 +84,7 @@
* Shouldn't be {@link SessionCommand#COMMAND_CODE_CUSTOM}.
* @hide TODO remove this method
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void addCommand(@CommandCode int commandCode) {
if (commandCode == COMMAND_CODE_CUSTOM) {
throw new IllegalArgumentException(
diff --git a/media2/src/main/java/androidx/media2/SessionPlayer.java b/media2/src/main/java/androidx/media2/SessionPlayer.java
index 329278f..0dd5ad9 100644
--- a/media2/src/main/java/androidx/media2/SessionPlayer.java
+++ b/media2/src/main/java/androidx/media2/SessionPlayer.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.ParcelFileDescriptor;
import android.os.SystemClock;
@@ -149,7 +149,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({
PLAYER_STATE_IDLE,
PLAYER_STATE_PAUSED,
@@ -162,7 +162,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({
BUFFERING_STATE_UNKNOWN,
BUFFERING_STATE_BUFFERING_AND_PLAYABLE,
@@ -219,7 +219,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({REPEAT_MODE_NONE, REPEAT_MODE_ONE, REPEAT_MODE_ALL,
REPEAT_MODE_GROUP})
@Retention(RetentionPolicy.SOURCE)
@@ -251,7 +251,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({SHUFFLE_MODE_NONE, SHUFFLE_MODE_ALL, SHUFFLE_MODE_GROUP})
@Retention(RetentionPolicy.SOURCE)
public @interface ShuffleMode {
@@ -383,11 +383,9 @@
public abstract float getPlaybackSpeed();
/**
- * Sets a list of {@link MediaItem} with metadata. Use this or {@link #setMediaItem} to specify
- * which items to play.
- * <p>
- * Ensure uniqueness of each {@link MediaItem} in the playlist so the session can uniquely
- * identity individual items. All {@link MediaItem}s shouldn't be {@code null} as well.
+ * Sets a list of {@link MediaItem} with metadata. Ensure uniqueness of each {@link MediaItem}
+ * in the playlist so the session can uniquely identity individual items. All
+ * {@link MediaItem}s shouldn't be {@code null} as well.
* <p>
* It's recommended to fill {@link MediaMetadata} in each {@link MediaItem} especially for the
* duration information with the key {@link MediaMetadata#METADATA_KEY_DURATION}. Without the
@@ -395,8 +393,8 @@
* it to the controller.
* <p>
* The implementation must notify registered callbacks with
- * {@link PlayerCallback#onPlaylistChanged} and {@link PlayerCallback#onCurrentMediaItemChanged}
- * when it's completed. The current media item would be the first item in the playlist.
+ * {@link PlayerCallback#onPlaylistChanged(SessionPlayer, List, MediaMetadata)} when it's
+ * completed.
* <p>
* The implementation must close the {@link ParcelFileDescriptor} in the {@link FileMediaItem}
* when a media item in the playlist is a {@link FileMediaItem}.
@@ -405,9 +403,7 @@
* @throws IllegalArgumentException if the given list is {@code null} or empty, or has
* duplicated media items.
* @return a {@link ListenableFuture} which represents the pending completion of the command.
- * @see #setMediaItem
- * @see PlayerCallback#onPlaylistChanged
- * @see PlayerCallback#onCurrentMediaItemChanged
+ * @see PlayerCallback#onPlaylistChanged(SessionPlayer, List, MediaMetadata)
*/
public abstract @NonNull ListenableFuture<PlayerResult> setPlaylist(
@NonNull List<MediaItem> list, @Nullable MediaMetadata metadata);
@@ -418,28 +414,22 @@
public abstract @Nullable AudioAttributesCompat getAudioAttributes();
/**
- * Sets a {@link MediaItem} for playback. Use this or {@link #setPlaylist} to specify which
- * items to play. If you want to change current item in the playlist, use one of
- * {@link #skipToPlaylistItem}, {@link #skipToNextPlaylistItem}, or
- * {@link #skipToPreviousPlaylistItem} instead of this method.
+ * Sets a {@link MediaItem} for playback.
* <p>
- * It's recommended to fill {@link MediaMetadata} in {@link MediaItem} especially for the
+ * It's recommended to fill {@link MediaMetadata} in each {@link MediaItem} especially for the
* duration information with the key {@link MediaMetadata#METADATA_KEY_DURATION}. Without the
* duration information in the metadata, session will do extra work to get the duration and send
* it to the controller.
* <p>
* The implementation must notify registered callbacks with
- * {@link PlayerCallback#onPlaylistChanged} and {@link PlayerCallback#onCurrentMediaItemChanged}
- * when it's completed. The current item would be the item given here.
+ * {@link PlayerCallback#onPlaylistChanged(SessionPlayer, List, MediaMetadata)} when it's
+ * completed.
* <p>
* The implementation must close the {@link ParcelFileDescriptor} in the {@link FileMediaItem}
* if the given media item is a {@link FileMediaItem}.
*
* @param item the descriptor of media item you want to play
* @return a {@link ListenableFuture} which represents the pending completion of the command.
- * @see #setPlaylist
- * @see PlayerCallback#onPlaylistChanged
- * @see PlayerCallback#onCurrentMediaItemChanged
* @throws IllegalArgumentException if the given item is {@code null}.
*/
public abstract @NonNull ListenableFuture<PlayerResult> setMediaItem(
@@ -581,10 +571,9 @@
@ShuffleMode int shuffleMode);
/**
- * Gets the playlist. Can be {@code null} if the playlist hasn't been set or it's reset by
- * {@link #setMediaItem}.
+ * Gets the playlist.
*
- * @return playlist, or {@code null}
+ * @return playlist, or null if none is set.
* @see PlayerCallback#onPlaylistChanged(SessionPlayer, List, MediaMetadata)
*/
public abstract @Nullable List<MediaItem> getPlaylist();
@@ -622,16 +611,13 @@
public abstract @ShuffleMode int getShuffleMode();
/**
- * Gets the current media item, which is currently playing or would be played with later
- * {@link #play}. This value may be updated when
+ * Gets the current media item. This value may be updated when
* {@link PlayerCallback#onCurrentMediaItemChanged(SessionPlayer, MediaItem)} or
* {@link PlayerCallback#onPlaylistChanged(SessionPlayer, List, MediaMetadata)} is
* called.
*
* @return the current media item. Can be {@code null} only when media item or playlist hasn't
* been set.
- * @see #setMediaItem
- * @see #setPlaylist
*/
public abstract @Nullable MediaItem getCurrentMediaItem();
@@ -643,7 +629,7 @@
* @return the index of current media item. Can be {@link #INVALID_ITEM_INDEX} when current
* media item is null or not in the playlist, and when the playlist hasn't been set.
*/
- public abstract @IntRange(from = INVALID_ITEM_INDEX) int getCurrentMediaItemIndex();
+ public abstract int getCurrentMediaItemIndex();
/**
* Gets the previous item index in the playlist. The returned value can be outdated after
@@ -653,7 +639,7 @@
* @return the index of previous media item. Can be {@link #INVALID_ITEM_INDEX} only when
* previous media item does not exist or playlist hasn't been set.
*/
- public abstract @IntRange(from = INVALID_ITEM_INDEX) int getPreviousMediaItemIndex();
+ public abstract int getPreviousMediaItemIndex();
/**
* Gets the next item index in the playlist. The returned value can be outdated after
@@ -663,7 +649,7 @@
* @return the index of next media item. Can be {@link #INVALID_ITEM_INDEX} only when next media
* item does not exist or playlist hasn't been set.
*/
- public abstract @IntRange(from = INVALID_ITEM_INDEX) int getNextMediaItemIndex();
+ public abstract int getNextMediaItemIndex();
// Listeners / Callback related
// Intentionally final not to allow developers to change the behavior
@@ -777,8 +763,7 @@
}
/**
- * Called when a playlist is changed. It's also called after {@link #setPlaylist} or
- * {@link #setMediaItem}.
+ * Called when a playlist is changed.
*
* @param player the player that has changed the playlist and playlist metadata.
* @param list new playlist
@@ -839,8 +824,7 @@
}
/**
- * Called when the player's current media item has changed. It's also called after
- * {@link #setPlaylist} or {@link #setMediaItem}.
+ * Called when the player's current media item has changed.
*
* @param player the player whose media item changed.
* @param item the new current media item.
@@ -893,14 +877,14 @@
*/
@IntDef(flag = false, /*prefix = "RESULT_CODE",*/ value = {
RESULT_SUCCESS,
- RESULT_ERROR_UNKNOWN,
+ RESULT_ERROR_UNKNOWN_ERROR,
RESULT_ERROR_INVALID_STATE,
RESULT_ERROR_BAD_VALUE,
RESULT_ERROR_PERMISSION_DENIED,
- RESULT_ERROR_IO,
+ RESULT_ERROR_IO_ERROR,
RESULT_INFO_SKIPPED})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface ResultCode {}
private final int mResultCode;
@@ -938,11 +922,11 @@
* codes defined here. Check the documentation of the class that you're interested in.
*
* @return result code.
- * @see #RESULT_ERROR_UNKNOWN
+ * @see #RESULT_ERROR_UNKNOWN_ERROR
* @see #RESULT_ERROR_INVALID_STATE
* @see #RESULT_ERROR_BAD_VALUE
* @see #RESULT_ERROR_PERMISSION_DENIED
- * @see #RESULT_ERROR_IO
+ * @see #RESULT_ERROR_IO_ERROR
* @see #RESULT_INFO_SKIPPED
*/
@Override
diff --git a/media2/src/main/java/androidx/media2/SessionResult.java b/media2/src/main/java/androidx/media2/SessionResult.java
index dac076d..23167f1 100644
--- a/media2/src/main/java/androidx/media2/SessionResult.java
+++ b/media2/src/main/java/androidx/media2/SessionResult.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
import android.os.SystemClock;
@@ -57,11 +57,11 @@
*/
@IntDef(flag = false, /*prefix = "RESULT_CODE",*/ value = {
RESULT_SUCCESS,
- RESULT_ERROR_UNKNOWN,
+ RESULT_ERROR_UNKNOWN_ERROR,
RESULT_ERROR_INVALID_STATE,
RESULT_ERROR_BAD_VALUE,
RESULT_ERROR_PERMISSION_DENIED,
- RESULT_ERROR_IO,
+ RESULT_ERROR_IO_ERROR,
RESULT_INFO_SKIPPED,
RESULT_ERROR_SESSION_DISCONNECTED,
RESULT_ERROR_NOT_SUPPORTED,
@@ -73,7 +73,7 @@
RESULT_ERROR_SESSION_SKIP_LIMIT_REACHED,
RESULT_ERROR_SESSION_SETUP_REQUIRED})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface ResultCode {}
@ParcelField(1)
@@ -137,11 +137,11 @@
*
* @return result code
* @see #RESULT_SUCCESS
- * @see #RESULT_ERROR_UNKNOWN
+ * @see #RESULT_ERROR_UNKNOWN_ERROR
* @see #RESULT_ERROR_INVALID_STATE
* @see #RESULT_ERROR_BAD_VALUE
* @see #RESULT_ERROR_PERMISSION_DENIED
- * @see #RESULT_ERROR_IO
+ * @see #RESULT_ERROR_IO_ERROR
* @see #RESULT_INFO_SKIPPED
* @see #RESULT_ERROR_SESSION_DISCONNECTED
* @see #RESULT_ERROR_NOT_SUPPORTED
diff --git a/media2/src/main/java/androidx/media2/SessionToken.java b/media2/src/main/java/androidx/media2/SessionToken.java
index 01494db..0a2e259 100644
--- a/media2/src/main/java/androidx/media2/SessionToken.java
+++ b/media2/src/main/java/androidx/media2/SessionToken.java
@@ -17,7 +17,7 @@
package androidx.media2;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.ComponentName;
@@ -77,7 +77,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
@IntDef(value = {TYPE_SESSION, TYPE_SESSION_SERVICE, TYPE_LIBRARY_SERVICE})
public @interface TokenType {
@@ -148,7 +148,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
SessionToken(SessionTokenImpl impl) {
mImpl = impl;
}
@@ -206,7 +206,7 @@
* @hide
* @return component name of the session. Can be {@code null} for {@link #TYPE_SESSION}.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ComponentName getComponentName() {
return mImpl.getComponentName();
}
@@ -224,7 +224,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isLegacySession() {
return mImpl.isLegacySession();
}
@@ -232,7 +232,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Object getBinder() {
return mImpl.getBinder();
}
@@ -244,7 +244,7 @@
* TODO: Consider to use this in the constructor of MediaController.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static void createSessionToken(@NonNull final Context context,
@NonNull final MediaSessionCompat.Token tokenCompat, @NonNull final Executor executor,
@NonNull final OnSessionTokenCreatedListener listener) {
@@ -375,7 +375,7 @@
*
* @see #createSessionToken
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public interface OnSessionTokenCreatedListener {
/**
* Called when SessionToken object is created.
diff --git a/media2/src/main/java/androidx/media2/SessionTokenImplBase.java b/media2/src/main/java/androidx/media2/SessionTokenImplBase.java
index ac0da51..34e8528 100644
--- a/media2/src/main/java/androidx/media2/SessionTokenImplBase.java
+++ b/media2/src/main/java/androidx/media2/SessionTokenImplBase.java
@@ -17,7 +17,7 @@
package androidx.media2;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ComponentName;
import android.os.IBinder;
@@ -52,7 +52,7 @@
* to use by {@link MediaController} or {@link MediaBrowser}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
SessionTokenImplBase(@NonNull ComponentName serviceComponent, int uid, int type) {
if (serviceComponent == null) {
throw new IllegalArgumentException("serviceComponent shouldn't be null");
@@ -68,7 +68,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
SessionTokenImplBase(int uid, int type, String packageName, IMediaSession iSession) {
mUid = uid;
mType = type;
@@ -135,7 +135,7 @@
* @hide
* @return component name of this session token. Can be null for TYPE_SESSION.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public ComponentName getComponentName() {
return mComponentName;
diff --git a/media2/src/main/java/androidx/media2/SessionTokenImplLegacy.java b/media2/src/main/java/androidx/media2/SessionTokenImplLegacy.java
index 975f9a1..bce372b 100644
--- a/media2/src/main/java/androidx/media2/SessionTokenImplLegacy.java
+++ b/media2/src/main/java/androidx/media2/SessionTokenImplLegacy.java
@@ -22,7 +22,6 @@
import static androidx.media2.SessionToken.TYPE_SESSION;
import static androidx.media2.SessionToken.TYPE_SESSION_LEGACY;
-import android.annotation.SuppressLint;
import android.content.ComponentName;
import android.os.Bundle;
import android.support.v4.media.session.MediaSessionCompat;
@@ -40,7 +39,6 @@
import androidx.versionedparcelable.VersionedParcelize;
@VersionedParcelize(isCustom = true)
-@SuppressLint("RestrictedApi")
final class SessionTokenImplLegacy extends CustomVersionedParcelable implements SessionTokenImpl {
// Don't mark mLegacyToken @ParcelField, because we need to use toBundle()/fromBundle() instead
// of the writeToParcel()/Parcelable.Creator for sending extra binder.
diff --git a/media2/src/main/java/androidx/media2/SubtitleData.java b/media2/src/main/java/androidx/media2/SubtitleData.java
index dbc4ac6..f405377 100644
--- a/media2/src/main/java/androidx/media2/SubtitleData.java
+++ b/media2/src/main/java/androidx/media2/SubtitleData.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
@@ -91,7 +91,7 @@
/** @hide */
@RequiresApi(28)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public SubtitleData(android.media.SubtitleData subtitleData) {
mTrackIndex = subtitleData.getTrackIndex();
mStartTimeUs = subtitleData.getStartTimeUs();
@@ -100,7 +100,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public SubtitleData(int trackIndex, long startTimeUs, long durationUs, byte[] data) {
mTrackIndex = trackIndex;
mStartTimeUs = startTimeUs;
diff --git a/media2/src/main/java/androidx/media2/TimedMetaData.java b/media2/src/main/java/androidx/media2/TimedMetaData.java
index 6d57214c..b3f44a5 100644
--- a/media2/src/main/java/androidx/media2/TimedMetaData.java
+++ b/media2/src/main/java/androidx/media2/TimedMetaData.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
@@ -41,7 +41,7 @@
* @hide
*/
@RequiresApi(23)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public TimedMetaData(android.media.TimedMetaData timedMetaData) {
mTimestampUs = timedMetaData.getTimestamp();
mMetaData = timedMetaData.getMetaData();
@@ -50,7 +50,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public TimedMetaData(long timestampUs, byte[] metaData) {
mTimestampUs = timestampUs;
mMetaData = metaData;
diff --git a/media2/src/main/java/androidx/media2/UriMediaItem.java b/media2/src/main/java/androidx/media2/UriMediaItem.java
index a867f40..5d70552 100644
--- a/media2/src/main/java/androidx/media2/UriMediaItem.java
+++ b/media2/src/main/java/androidx/media2/UriMediaItem.java
@@ -115,7 +115,7 @@
/**
* This Builder class simplifies the creation of a {@link UriMediaItem} object.
*/
- public static final class Builder extends MediaItem.Builder {
+ public static final class Builder extends BuilderBase<Builder> {
@SuppressWarnings("WeakerAccess") /* synthetic access */
Uri mUri;
@@ -180,33 +180,11 @@
mUriContext = context;
}
- // Override just to change return type.
- @NonNull
- @Override
- public Builder setMetadata(@Nullable MediaMetadata metadata) {
- return (Builder) super.setMetadata(metadata);
- }
-
- // Override just to change return type.
- @NonNull
- @Override
- public Builder setStartPosition(long position) {
- return (Builder) super.setStartPosition(position);
- }
-
- // Override just to change return type.
- @NonNull
- @Override
- public Builder setEndPosition(long position) {
- return (Builder) super.setEndPosition(position);
- }
-
/**
* @return A new UriMediaItem with values supplied by the Builder.
*/
- @NonNull
@Override
- public UriMediaItem build() {
+ public @NonNull UriMediaItem build() {
return new UriMediaItem(this);
}
}
diff --git a/media2/src/main/java/androidx/media2/VideoSize.java b/media2/src/main/java/androidx/media2/VideoSize.java
index 5edeef0..ed2f2e3 100644
--- a/media2/src/main/java/androidx/media2/VideoSize.java
+++ b/media2/src/main/java/androidx/media2/VideoSize.java
@@ -16,7 +16,7 @@
package androidx.media2;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
@@ -31,7 +31,7 @@
* @param height The height of the video
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public VideoSize(int width, int height) {
mWidth = width;
mHeight = height;
diff --git a/media2/src/main/java/androidx/media2/common/TrackInfoImpl.java b/media2/src/main/java/androidx/media2/common/TrackInfoImpl.java
index 71a9316..ec8078c 100644
--- a/media2/src/main/java/androidx/media2/common/TrackInfoImpl.java
+++ b/media2/src/main/java/androidx/media2/common/TrackInfoImpl.java
@@ -16,7 +16,7 @@
package androidx.media2.common;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.media.MediaFormat;
@@ -29,7 +29,7 @@
* @see MediaPlayer2#getTrackInfo
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public final class TrackInfoImpl extends MediaPlayer2.TrackInfo {
private final int mTrackType;
private final MediaFormat mFormat;
diff --git a/media2/src/main/java/androidx/media2/exoplayer/ByteArrayFrame.java b/media2/src/main/java/androidx/media2/exoplayer/ByteArrayFrame.java
index 6723611..b5fa694 100644
--- a/media2/src/main/java/androidx/media2/exoplayer/ByteArrayFrame.java
+++ b/media2/src/main/java/androidx/media2/exoplayer/ByteArrayFrame.java
@@ -16,7 +16,7 @@
package androidx.media2.exoplayer;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.os.Parcel;
@@ -33,7 +33,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
/* package */ final class ByteArrayFrame implements Metadata.Entry {
diff --git a/media2/src/main/java/androidx/media2/exoplayer/DataSourceCallbackDataSource.java b/media2/src/main/java/androidx/media2/exoplayer/DataSourceCallbackDataSource.java
index 47f4af0..bb3bf61 100644
--- a/media2/src/main/java/androidx/media2/exoplayer/DataSourceCallbackDataSource.java
+++ b/media2/src/main/java/androidx/media2/exoplayer/DataSourceCallbackDataSource.java
@@ -16,7 +16,7 @@
package androidx.media2.exoplayer;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.net.Uri;
@@ -38,7 +38,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
public final class DataSourceCallbackDataSource extends BaseDataSource {
diff --git a/media2/src/main/java/androidx/media2/exoplayer/DurationProvidingMediaSource.java b/media2/src/main/java/androidx/media2/exoplayer/DurationProvidingMediaSource.java
index 72987d7..83406e4 100644
--- a/media2/src/main/java/androidx/media2/exoplayer/DurationProvidingMediaSource.java
+++ b/media2/src/main/java/androidx/media2/exoplayer/DurationProvidingMediaSource.java
@@ -16,7 +16,7 @@
package androidx.media2.exoplayer;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
@@ -36,7 +36,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
/* package */ class DurationProvidingMediaSource extends CompositeMediaSource<Void> {
diff --git a/media2/src/main/java/androidx/media2/exoplayer/ExoPlayerMediaPlayer2Impl.java b/media2/src/main/java/androidx/media2/exoplayer/ExoPlayerMediaPlayer2Impl.java
index e6ea668..483c0c5 100644
--- a/media2/src/main/java/androidx/media2/exoplayer/ExoPlayerMediaPlayer2Impl.java
+++ b/media2/src/main/java/androidx/media2/exoplayer/ExoPlayerMediaPlayer2Impl.java
@@ -16,7 +16,7 @@
package androidx.media2.exoplayer;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -60,7 +60,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
public final class ExoPlayerMediaPlayer2Impl extends MediaPlayer2
implements ExoPlayerWrapper.Listener {
diff --git a/media2/src/main/java/androidx/media2/exoplayer/ExoPlayerUtils.java b/media2/src/main/java/androidx/media2/exoplayer/ExoPlayerUtils.java
index 14ca1ba..6c66cd4 100644
--- a/media2/src/main/java/androidx/media2/exoplayer/ExoPlayerUtils.java
+++ b/media2/src/main/java/androidx/media2/exoplayer/ExoPlayerUtils.java
@@ -16,7 +16,7 @@
package androidx.media2.exoplayer;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media2.MediaPlayer2.MEDIA_ERROR_IO;
import static androidx.media2.MediaPlayer2.MEDIA_ERROR_MALFORMED;
import static androidx.media2.MediaPlayer2.MEDIA_ERROR_TIMED_OUT;
@@ -73,7 +73,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
/* package */ class ExoPlayerUtils {
diff --git a/media2/src/main/java/androidx/media2/exoplayer/ExoPlayerWrapper.java b/media2/src/main/java/androidx/media2/exoplayer/ExoPlayerWrapper.java
index 289dabb..81d8c07 100644
--- a/media2/src/main/java/androidx/media2/exoplayer/ExoPlayerWrapper.java
+++ b/media2/src/main/java/androidx/media2/exoplayer/ExoPlayerWrapper.java
@@ -16,7 +16,7 @@
package androidx.media2.exoplayer;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media2.MediaPlayer2.MEDIA_ERROR_UNKNOWN;
import static androidx.media2.MediaPlayer2.TrackInfo.MEDIA_TRACK_TYPE_SUBTITLE;
@@ -88,7 +88,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
/* package */ final class ExoPlayerWrapper {
@@ -538,10 +538,7 @@
maybeNotifyReadyEvents();
break;
case Player.STATE_ENDED:
- if (playWhenReady) {
- mMediaItemQueue.onPlayerEnded();
- mPlayer.setPlayWhenReady(false);
- }
+ mMediaItemQueue.onPlayerEnded();
break;
case Player.STATE_IDLE:
// Do nothing.
@@ -661,8 +658,7 @@
// start position.
mPendingSeek = false;
mListener.onSeekCompleted();
- }
- if (mRebuffering) {
+ } else if (mRebuffering) {
mRebuffering = false;
if (mMediaItemQueue.getCurrentMediaItemIsRemote()) {
mListener.onBandwidthSample(
diff --git a/media2/src/main/java/androidx/media2/exoplayer/FileDescriptorDataSource.java b/media2/src/main/java/androidx/media2/exoplayer/FileDescriptorDataSource.java
index ec17bee..da8ec5d 100644
--- a/media2/src/main/java/androidx/media2/exoplayer/FileDescriptorDataSource.java
+++ b/media2/src/main/java/androidx/media2/exoplayer/FileDescriptorDataSource.java
@@ -16,7 +16,7 @@
package androidx.media2.exoplayer;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.net.Uri;
@@ -40,7 +40,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
/* package */ class FileDescriptorDataSource extends BaseDataSource {
diff --git a/media2/src/main/java/androidx/media2/exoplayer/FileDescriptorUtil.java b/media2/src/main/java/androidx/media2/exoplayer/FileDescriptorUtil.java
index 20078fb..e97434f 100644
--- a/media2/src/main/java/androidx/media2/exoplayer/FileDescriptorUtil.java
+++ b/media2/src/main/java/androidx/media2/exoplayer/FileDescriptorUtil.java
@@ -16,7 +16,7 @@
package androidx.media2.exoplayer;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.os.Build;
@@ -38,7 +38,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
/* package */ final class FileDescriptorUtil {
diff --git a/media2/src/main/java/androidx/media2/exoplayer/Id3MetadataDecoderFactory.java b/media2/src/main/java/androidx/media2/exoplayer/Id3MetadataDecoderFactory.java
index 0e0ed9c..ae3672a 100644
--- a/media2/src/main/java/androidx/media2/exoplayer/Id3MetadataDecoderFactory.java
+++ b/media2/src/main/java/androidx/media2/exoplayer/Id3MetadataDecoderFactory.java
@@ -17,7 +17,7 @@
package androidx.media2.exoplayer;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
@@ -36,7 +36,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
/* package */ final class Id3MetadataDecoderFactory implements MetadataDecoderFactory {
diff --git a/media2/src/main/java/androidx/media2/exoplayer/RenderersFactory.java b/media2/src/main/java/androidx/media2/exoplayer/RenderersFactory.java
index 2d04ff5..f262c74 100644
--- a/media2/src/main/java/androidx/media2/exoplayer/RenderersFactory.java
+++ b/media2/src/main/java/androidx/media2/exoplayer/RenderersFactory.java
@@ -16,7 +16,7 @@
package androidx.media2.exoplayer;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -47,7 +47,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
/* package */ final class RenderersFactory extends DefaultRenderersFactory {
diff --git a/media2/src/main/java/androidx/media2/exoplayer/TextRenderer.java b/media2/src/main/java/androidx/media2/exoplayer/TextRenderer.java
index 55314f4..e9076c7 100644
--- a/media2/src/main/java/androidx/media2/exoplayer/TextRenderer.java
+++ b/media2/src/main/java/androidx/media2/exoplayer/TextRenderer.java
@@ -16,7 +16,7 @@
package androidx.media2.exoplayer;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.os.Handler;
@@ -47,7 +47,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
/* package */ class TextRenderer extends BaseRenderer {
diff --git a/media2/src/main/java/androidx/media2/exoplayer/TrackSelector.java b/media2/src/main/java/androidx/media2/exoplayer/TrackSelector.java
index 4bc7878..78b92bc33 100644
--- a/media2/src/main/java/androidx/media2/exoplayer/TrackSelector.java
+++ b/media2/src/main/java/androidx/media2/exoplayer/TrackSelector.java
@@ -16,7 +16,7 @@
package androidx.media2.exoplayer;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.media2.MediaPlayer2.TrackInfo.MEDIA_TRACK_TYPE_AUDIO;
import static androidx.media2.MediaPlayer2.TrackInfo.MEDIA_TRACK_TYPE_METADATA;
import static androidx.media2.MediaPlayer2.TrackInfo.MEDIA_TRACK_TYPE_SUBTITLE;
@@ -59,7 +59,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("RestrictedApi") // TODO(b/68398926): Remove once RestrictedApi checks are fixed.
/* package */ final class TrackSelector {
diff --git a/media2/src/main/java/androidx/media2/subtitle/Cea708CaptionRenderer.java b/media2/src/main/java/androidx/media2/subtitle/Cea708CaptionRenderer.java
index d93fec3..0b4d8f5 100644
--- a/media2/src/main/java/androidx/media2/subtitle/Cea708CaptionRenderer.java
+++ b/media2/src/main/java/androidx/media2/subtitle/Cea708CaptionRenderer.java
@@ -16,7 +16,7 @@
package androidx.media2.subtitle;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Canvas;
@@ -57,7 +57,7 @@
// Note: This is forked from android.media.Cea708CaptionRenderer since P
/** @hide */
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class Cea708CaptionRenderer extends SubtitleController.Renderer {
private final Context mContext;
private Cea708CCWidget mCCWidget;
diff --git a/media2/src/main/java/androidx/media2/subtitle/ClosedCaptionRenderer.java b/media2/src/main/java/androidx/media2/subtitle/ClosedCaptionRenderer.java
index d147e31..563bbf2 100644
--- a/media2/src/main/java/androidx/media2/subtitle/ClosedCaptionRenderer.java
+++ b/media2/src/main/java/androidx/media2/subtitle/ClosedCaptionRenderer.java
@@ -16,7 +16,7 @@
package androidx.media2.subtitle;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Resources;
@@ -47,7 +47,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ClosedCaptionRenderer extends SubtitleController.Renderer {
private static final String TAG = "ClosedCaptionRenderer";
private final Context mContext;
diff --git a/media2/src/main/java/androidx/media2/subtitle/MediaTimeProvider.java b/media2/src/main/java/androidx/media2/subtitle/MediaTimeProvider.java
index e4b340f..2c2c40f 100644
--- a/media2/src/main/java/androidx/media2/subtitle/MediaTimeProvider.java
+++ b/media2/src/main/java/androidx/media2/subtitle/MediaTimeProvider.java
@@ -16,7 +16,7 @@
package androidx.media2.subtitle;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
@@ -24,7 +24,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public interface MediaTimeProvider {
// we do not allow negative media time
/**
diff --git a/media2/src/main/java/androidx/media2/subtitle/SubtitleController.java b/media2/src/main/java/androidx/media2/subtitle/SubtitleController.java
index 7b246fa..596d8f7 100644
--- a/media2/src/main/java/androidx/media2/subtitle/SubtitleController.java
+++ b/media2/src/main/java/androidx/media2/subtitle/SubtitleController.java
@@ -16,7 +16,7 @@
package androidx.media2.subtitle;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.media.MediaFormat;
@@ -41,7 +41,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class SubtitleController {
private MediaTimeProvider mTimeProvider;
private ArrayList<Renderer> mRenderers;
diff --git a/media2/src/main/java/androidx/media2/subtitle/SubtitleTrack.java b/media2/src/main/java/androidx/media2/subtitle/SubtitleTrack.java
index ea8e082..87fc373 100644
--- a/media2/src/main/java/androidx/media2/subtitle/SubtitleTrack.java
+++ b/media2/src/main/java/androidx/media2/subtitle/SubtitleTrack.java
@@ -16,7 +16,7 @@
package androidx.media2.subtitle;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Canvas;
import android.media.MediaFormat;
@@ -42,7 +42,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public abstract class SubtitleTrack implements MediaTimeProvider.OnMediaTimeListener {
private static final String TAG = "SubtitleTrack";
private long mLastUpdateTimeMs;
diff --git a/media2/src/main/res/drawable/media_session_service_notification_ic_music_note.xml b/media2/src/main/res/drawable/ic_music_note.xml
similarity index 100%
rename from media2/src/main/res/drawable/media_session_service_notification_ic_music_note.xml
rename to media2/src/main/res/drawable/ic_music_note.xml
diff --git a/media2/src/main/res/drawable/media_session_service_notification_ic_pause.xml b/media2/src/main/res/drawable/ic_pause.xml
similarity index 100%
rename from media2/src/main/res/drawable/media_session_service_notification_ic_pause.xml
rename to media2/src/main/res/drawable/ic_pause.xml
diff --git a/media2/src/main/res/drawable/media_session_service_notification_ic_play.xml b/media2/src/main/res/drawable/ic_play.xml
similarity index 100%
rename from media2/src/main/res/drawable/media_session_service_notification_ic_play.xml
rename to media2/src/main/res/drawable/ic_play.xml
diff --git a/media2/src/main/res/drawable/media_session_service_notification_ic_skip_to_next.xml b/media2/src/main/res/drawable/ic_skip_to_next.xml
similarity index 100%
rename from media2/src/main/res/drawable/media_session_service_notification_ic_skip_to_next.xml
rename to media2/src/main/res/drawable/ic_skip_to_next.xml
diff --git a/media2/src/main/res/drawable/media_session_service_notification_ic_skip_to_previous.xml b/media2/src/main/res/drawable/ic_skip_to_previous.xml
similarity index 100%
rename from media2/src/main/res/drawable/media_session_service_notification_ic_skip_to_previous.xml
rename to media2/src/main/res/drawable/ic_skip_to_previous.xml
diff --git a/media2/src/main/res/values-as/strings.xml b/media2/src/main/res/values-as/strings.xml
deleted file mode 100644
index 73e9775..0000000
--- a/media2/src/main/res/values-as/strings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="default_notification_channel_name" msgid="3980628489251198480">"এতিয়া প্লে’ হৈ আছে"</string>
- <string name="play_button_content_description" msgid="5898492519310326971">"প্লে\'"</string>
- <string name="pause_button_content_description" msgid="7844788760550939526">"পজ"</string>
- <string name="skip_to_previous_item_button_content_description" msgid="250823119142607886">"পূৰ্বৱৰ্তী বস্তুটোলৈ যাওক"</string>
- <string name="skip_to_next_item_button_content_description" msgid="3508534122676007656">"পৰৱৰ্তী বস্তুটোলৈ যাওক"</string>
-</resources>
diff --git a/media2/version-compat-tests/common/src/main/aidl/androidx/media2/test/common/IRemoteMediaControllerCompat.aidl b/media2/version-compat-tests/common/src/main/aidl/androidx/media2/test/common/IRemoteMediaControllerCompat.aidl
index 335fc00..53a2e99 100644
--- a/media2/version-compat-tests/common/src/main/aidl/androidx/media2/test/common/IRemoteMediaControllerCompat.aidl
+++ b/media2/version-compat-tests/common/src/main/aidl/androidx/media2/test/common/IRemoteMediaControllerCompat.aidl
@@ -44,7 +44,6 @@
void pause(String controllerId);
void stop(String controllerId);
void seekTo(String controllerId, long pos);
- void setPlaybackSpeed(String controllerId, float speed);
void fastForward(String controllerId);
void skipToNext(String controllerId);
void rewind(String controllerId);
diff --git a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/MediaControllerCompatProviderService.java b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/MediaControllerCompatProviderService.java
index 3100d5c..213ca3b 100644
--- a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/MediaControllerCompatProviderService.java
+++ b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/MediaControllerCompatProviderService.java
@@ -240,12 +240,6 @@
}
@Override
- public void setPlaybackSpeed(String controllerId, float speed) throws RemoteException {
- MediaControllerCompat controller = mMediaControllerCompatMap.get(controllerId);
- controller.getTransportControls().setPlaybackSpeed(speed);
- }
-
- @Override
public void fastForward(String controllerId) throws RemoteException {
MediaControllerCompat controller = mMediaControllerCompatMap.get(controllerId);
controller.getTransportControls().fastForward();
diff --git a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCallbackTest.java b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCallbackTest.java
index 8ea9111..978c8ed 100644
--- a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCallbackTest.java
+++ b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCallbackTest.java
@@ -67,6 +67,7 @@
import androidx.test.filters.FlakyTest;
import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.versionedparcelable.ParcelUtils;
import org.junit.Test;
@@ -88,7 +89,7 @@
// TODO: (internal cleanup) Move tests that aren't related with callbacks.
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class MediaBrowserCallbackTest extends MediaControllerCallbackTest {
private static final String TAG = "MediaBrowserCallbackTest";
diff --git a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatTestWithMediaLibraryService.java b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatTestWithMediaLibraryService.java
index ef98527..71f3192 100644
--- a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatTestWithMediaLibraryService.java
+++ b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatTestWithMediaLibraryService.java
@@ -55,6 +55,7 @@
import androidx.media2.MediaLibraryService;
import androidx.media2.test.common.TestUtils;
import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Ignore;
import org.junit.Test;
@@ -66,7 +67,7 @@
/**
* Tests whether {@link MediaBrowserCompat} works well with {@link MediaLibraryService}.
*/
-@LargeTest
+@SmallTest
public class MediaBrowserCompatTestWithMediaLibraryService extends
MediaBrowserCompatTestWithMediaSessionService {
@Override
@@ -174,6 +175,7 @@
}
@Test
+ @LargeTest
public void testGetChildren_withLongList() throws InterruptedException {
prepareLooper();
final String testParentId = PARENT_ID_LONG_LIST;
@@ -326,6 +328,7 @@
}
@Test
+ @LargeTest
public void testSearch_withLongList() throws InterruptedException {
prepareLooper();
final String testQuery = SEARCH_QUERY_LONG_LIST;
diff --git a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatTestWithMediaSessionService.java b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatTestWithMediaSessionService.java
index 3f33df4..5b813c0 100644
--- a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatTestWithMediaSessionService.java
+++ b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaBrowserCompatTestWithMediaSessionService.java
@@ -27,7 +27,7 @@
import android.support.v4.media.session.MediaControllerCompat;
import androidx.media2.MediaSessionService;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -40,7 +40,7 @@
/**
* Tests whether {@link MediaBrowserCompat} works well with {@link MediaSessionService}.
*/
-@LargeTest
+@SmallTest
public class MediaBrowserCompatTestWithMediaSessionService extends MediaSessionTestBase {
MediaBrowserCompat mBrowserCompat;
TestConnectionCallback mConnectionCallback;
@@ -74,8 +74,7 @@
void connectAndWait() throws InterruptedException {
mBrowserCompat.connect();
- assertTrue(mConnectionCallback.mConnectedLatch.await(
- BROWSER_COMPAT_CONNECT_TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ assertTrue(mConnectionCallback.mConnectedLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
}
@Test
diff --git a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerCallbackTest.java b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerCallbackTest.java
index 22c9492..85dbf06 100644
--- a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerCallbackTest.java
+++ b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerCallbackTest.java
@@ -55,6 +55,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -73,7 +74,7 @@
*/
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class MediaControllerCallbackTest extends MediaSessionTestBase {
// Since ControllerInfo cannot be passed, we just pass null and the service app chooses the
diff --git a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerCompatCallbackTestWithMediaSession.java b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerCompatCallbackTestWithMediaSession.java
index d8e6f54..018f1fe 100644
--- a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerCompatCallbackTestWithMediaSession.java
+++ b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerCompatCallbackTestWithMediaSession.java
@@ -41,8 +41,8 @@
import androidx.media2.test.client.RemoteMediaSession;
import androidx.media2.test.common.TestUtils;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -58,7 +58,7 @@
*/
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class MediaControllerCompatCallbackTestWithMediaSession extends MediaSessionTestBase {
private static final String TAG = "MCCCallbackTestWithMS2";
diff --git a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerLegacyTest.java b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerLegacyTest.java
index 4448dca..902c58f 100644
--- a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerLegacyTest.java
+++ b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerLegacyTest.java
@@ -54,7 +54,7 @@
import androidx.media2.test.client.RemoteMediaSessionCompat;
import androidx.media2.test.common.MockActivity;
import androidx.media2.test.common.TestUtils;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -70,7 +70,7 @@
*
* TODO: Pull out callback tests to a separate file (i.e. MediaControllerLegacyCallbackTest).
*/
-@MediumTest
+@SmallTest
public class MediaControllerLegacyTest extends MediaSessionTestBase {
private static final String TAG = "MediaControllerLegacyTest";
diff --git a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerTest.java b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerTest.java
index 618c257..01bc977 100644
--- a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerTest.java
+++ b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerTest.java
@@ -44,8 +44,8 @@
import androidx.media2.test.client.RemoteMediaSession;
import androidx.media2.test.common.PollingCheck;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -61,7 +61,7 @@
*/
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class MediaControllerTest extends MediaSessionTestBase {
final List<RemoteMediaSession> mRemoteSessionList = new ArrayList<>();
diff --git a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerTest_copied.java b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerTest_copied.java
new file mode 100644
index 0000000..6deaf1f
--- /dev/null
+++ b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaControllerTest_copied.java
@@ -0,0 +1,147 @@
+/*
+ * 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.media2.test.client.tests;
+
+import androidx.media2.MediaController;
+
+import org.junit.Ignore;
+
+/**
+ * Tests {@link MediaController}.
+ */
+@Ignore("b/111487997")
+public class MediaControllerTest_copied extends MediaSessionTestBase {
+ private static final String TAG = "MediaControllerTest_copied";
+
+// Temporaily commenting out, since we don't have the Mock services yet.
+// @Test
+// public void testGetServiceToken() {
+// prepareLooper();
+// SessionToken token = MediaTestUtils.getServiceToken(
+// mContext, MockMediaSessionService.ID);
+// assertNotNull(token);
+// assertEquals(mContext.getPackageName(), token.getPackageName());
+// assertEquals(MockMediaSessionService.ID, token.getSessionId());
+// assertEquals(SessionToken.TYPE_SESSION_SERVICE, token.getType());
+// }
+//
+// @Test
+// public void testConnectToService_sessionService() throws InterruptedException {
+// prepareLooper();
+// testConnectToService(MockMediaSessionService.ID);
+// }
+//
+// @Test
+// public void testConnectToService_libraryService() throws InterruptedException {
+// prepareLooper();
+// testConnectToService(MockMediaLibraryService.ID);
+// }
+//
+// public void testConnectToService(String id) throws InterruptedException {
+// prepareLooper();
+// final CountDownLatch latch = new CountDownLatch(1);
+// final MediaLibrarySessionCallback sessionCallback = new MediaLibrarySessionCallback() {
+// @Override
+// public SessionCommandGroup onConnect(@NonNull MediaSession session,
+// @NonNull ControllerInfo controller) {
+// if (Process.myUid() == controller.getUid()) {
+// if (mSession != null) {
+// mSession.close();
+// }
+// mSession = session;
+// mPlayer = (MockPlayer) session.getPlayer();
+// assertEquals(mContext.getPackageName(), controller.getPackageName());
+// assertFalse(controller.isTrusted());
+// latch.countDown();
+// }
+// return super.onConnect(session, controller);
+// }
+// };
+// TestServiceRegistry.getInstance().setSessionCallback(sessionCallback);
+//
+// final SessionCommand testCommand = new SessionCommand("testConnectToService", null);
+// final CountDownLatch controllerLatch = new CountDownLatch(1);
+// mController = createController(MediaTestUtils.getServiceToken(mContext, id), true,
+// new ControllerCallback() {
+// @Override
+// public void onCustomCommand(MediaController controller,
+// SessionCommand command, Bundle args, ResultReceiver receiver) {
+// if (testCommand.equals(command)) {
+// controllerLatch.countDown();
+// }
+// }
+// }
+// );
+// assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+//
+// // Test command from controller to session service.
+// mController.play();
+// assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+// assertTrue(mPlayer.mPlayCalled);
+//
+// // Test command from session service to controller.
+// mSession.broadcastCustomCommand(testCommand, null);
+// assertTrue(controllerLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+// }
+
+
+// Temporaily commenting out, since we don't have the Mock services yet.
+// @Test
+// public void testControllerAfterSessionIsClosed_sessionService() throws InterruptedException {
+// prepareLooper();
+// testConnectToService(MockMediaSessionService.ID);
+// testControllerAfterSessionIsClosed(MockMediaSessionService.ID);
+// }
+
+// Temporaily commenting out, since we don't have the Mock services yet.
+// @Test
+// public void testClose_sessionService() throws InterruptedException {
+// prepareLooper();
+// testCloseFromService(MockMediaSessionService.ID);
+// }
+//
+// @Test
+// public void testClose_libraryService() throws InterruptedException {
+// prepareLooper();
+// testCloseFromService(MockMediaLibraryService.ID);
+// }
+//
+// private void testCloseFromService(String id) throws InterruptedException {
+// final CountDownLatch latch = new CountDownLatch(1);
+// TestServiceRegistry.getInstance().setSessionServiceCallback(new SessionServiceCallback() {
+// @Override
+// public void onCreated() {
+// // Do nothing.
+// }
+//
+// @Override
+// public void onDestroyed() {
+// latch.countDown();
+// }
+// });
+// mController = createController(MediaTestUtils.getServiceToken(mContext, id));
+// mController.close();
+// // Wait until close triggers onDestroy() of the session service.
+// assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+// assertNull(TestServiceRegistry.getInstance().getServiceInstance());
+// testNoInteraction();
+//
+// // Test whether the controller is notified about later close of the session or
+// // re-creation.
+// testControllerAfterSessionIsClosed(id);
+// }
+}
diff --git a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaSessionTestBase.java b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaSessionTestBase.java
index 674c1fa..00b8365 100644
--- a/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaSessionTestBase.java
+++ b/media2/version-compat-tests/current/client/src/androidTest/java/androidx/media2/test/client/tests/MediaSessionTestBase.java
@@ -60,7 +60,6 @@
*/
abstract class MediaSessionTestBase {
static final int TIMEOUT_MS = 1000;
- static final int BROWSER_COMPAT_CONNECT_TIMEOUT_MS = 3000;
static SyncHandler sHandler;
static Executor sHandlerExecutor;
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/RemoteMediaControllerCompat.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/RemoteMediaControllerCompat.java
index d13e523..faf93f4 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/RemoteMediaControllerCompat.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/RemoteMediaControllerCompat.java
@@ -248,14 +248,6 @@
}
}
- public void setPlaybackSpeed(float speed) {
- try {
- mBinder.setPlaybackSpeed(mControllerId, speed);
- } catch (RemoteException ex) {
- Log.e(TAG, "Failed to call setPlaybackSpeed()");
- }
- }
-
public void fastForward() {
try {
mBinder.fastForward(mControllerId);
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaBrowserServiceCompatCallbackTestWithMediaBrowser.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaBrowserServiceCompatCallbackTestWithMediaBrowser.java
index b26fdbe..22cfdce 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaBrowserServiceCompatCallbackTestWithMediaBrowser.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaBrowserServiceCompatCallbackTestWithMediaBrowser.java
@@ -38,7 +38,7 @@
import androidx.media2.test.service.MockMediaBrowserServiceCompat;
import androidx.media2.test.service.MockMediaBrowserServiceCompat.Proxy;
import androidx.media2.test.service.RemoteMediaBrowser;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -52,7 +52,7 @@
/**
* Tests {@link MediaBrowser} with {@link MediaBrowserServiceCompat}.
*/
-@LargeTest
+@SmallTest
public class MediaBrowserServiceCompatCallbackTestWithMediaBrowser extends MediaSessionTestBase {
private SessionToken mToken;
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaItemTest.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaItemTest.java
index 8a44064..ddcdb32 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaItemTest.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaItemTest.java
@@ -17,26 +17,21 @@
package androidx.media2.test.service.tests;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.fail;
import android.content.Context;
-import android.content.res.AssetFileDescriptor;
import android.net.Uri;
import android.os.Build;
import android.os.Parcel;
-import android.os.ParcelFileDescriptor;
-import androidx.annotation.NonNull;
-import androidx.media2.CallbackMediaItem;
-import androidx.media2.DataSourceCallback;
-import androidx.media2.FileMediaItem;
import androidx.media2.MediaItem;
import androidx.media2.MediaMetadata;
import androidx.media2.MediaUtils;
import androidx.media2.UriMediaItem;
import androidx.media2.test.service.MediaTestUtils;
-import androidx.media2.test.service.test.R;
import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SdkSuppress;
import androidx.test.filters.SmallTest;
import androidx.versionedparcelable.ParcelImpl;
@@ -45,181 +40,75 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Arrays;
-import java.util.Collection;
/**
- * Tests {@link MediaItem} and its subclasses.
+ * Tests {@link MediaItem}.
*/
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
-@RunWith(Parameterized.class)
+@RunWith(AndroidJUnit4.class)
@SmallTest
public class MediaItemTest {
- private final MediaItemFactory mItemFactory;
- private final Class mItemBuilderClass;
private Context mContext;
- private MediaItem mTestItem;
-
- private static final MediaItemFactory sMediaItemFactory = new MediaItemFactory() {
- @Override
- public MediaItem create(Context context) {
- final MediaMetadata testMetadata = new MediaMetadata.Builder()
- .putLong("MediaItemTest", 1).build();
- return new MediaItem.Builder()
- .setMetadata(testMetadata)
- .setStartPosition(1)
- .setEndPosition(10)
- .build();
- }
- };
-
- private static final MediaItemFactory sUriMediaItemFactory = new MediaItemFactory() {
- @Override
- public MediaItem create(Context context) {
- final MediaMetadata testMetadata = new MediaMetadata.Builder()
- .putString("MediaItemTest", "MediaItemTest").build();
- return new UriMediaItem.Builder(context, Uri.parse("test://test"))
- .setMetadata(testMetadata)
- .setStartPosition(1)
- .setEndPosition(1000)
- .build();
- }
- };
-
- private static final MediaItemFactory sCallbackMediaItemFactory = new MediaItemFactory() {
- @Override
- public MediaItem create(Context context) {
- final MediaMetadata testMetadata = new MediaMetadata.Builder()
- .putText("MediaItemTest", "testtest").build();
- final DataSourceCallback callback = new DataSourceCallback() {
- @Override
- public int readAt(long position, @NonNull byte[] buffer, int offset, int size)
- throws IOException {
- return 0;
- }
-
- @Override
- public long getSize() throws IOException {
- return 0;
- }
-
- @Override
- public void close() throws IOException {
- // no-op
- }
- };
- return new CallbackMediaItem.Builder(callback)
- .setMetadata(testMetadata)
- .setStartPosition(0)
- .setEndPosition(0)
- .build();
- }
- };
-
- private static final MediaItemFactory sFileMediaItemFactory = new MediaItemFactory() {
- @Override
- public MediaItem create(Context context) {
- int resId = R.raw.midi8sec;
- try (AssetFileDescriptor afd = context.getResources().openRawResourceFd(resId)) {
- return new FileMediaItem.Builder(
- ParcelFileDescriptor.dup(afd.getFileDescriptor())).build();
- } catch (Exception e) {
- return null;
- }
- }
- };
-
- @Parameterized.Parameters
- public static Collection<Object[]> data() {
- return Arrays.asList(new Object[][]{
- {sMediaItemFactory, MediaItem.Builder.class},
- {sUriMediaItemFactory, UriMediaItem.Builder.class},
- {sCallbackMediaItemFactory, CallbackMediaItem.Builder.class},
- {sFileMediaItemFactory, FileMediaItem.Builder.class}});
- }
-
- public MediaItemTest(MediaItemFactory factory, Class builderClass) {
- mItemFactory = factory;
- mItemBuilderClass = builderClass;
- }
@Before
public void setUp() {
mContext = ApplicationProvider.getApplicationContext();
- mTestItem = mItemFactory.create(mContext);
}
@Test
public void testSubclass_sameProcess() {
- final ParcelImpl parcel = MediaUtils.toParcelable(mTestItem);
+ final UriMediaItem testUriItem = createUriMediaItem();
+ final ParcelImpl parcel = MediaUtils.toParcelable(testUriItem);
final MediaItem testRemoteItem = MediaUtils.fromParcelable(parcel);
- assertEquals(mTestItem, testRemoteItem);
+ assertEquals(testUriItem, testRemoteItem);
}
@Test
public void testSubclass_acrossProcessWithMediaUtils() {
+ final UriMediaItem testUriItem = createUriMediaItem();
+
// Mocks the binder call across the processes by using writeParcelable/readParcelable
// which only happens between processes. Code snippets are copied from
// VersionedParcelIntegTest#parcelCopy.
final Parcel p = Parcel.obtain();
- p.writeParcelable(MediaUtils.toParcelable(mTestItem), 0);
+ p.writeParcelable(MediaUtils.toParcelable(testUriItem), 0);
p.setDataPosition(0);
final MediaItem testRemoteItem = MediaUtils.fromParcelable(
(ParcelImpl) p.readParcelable(MediaItem.class.getClassLoader()));
- assertEquals(MediaItem.class, testRemoteItem.getClass());
- assertEquals(mTestItem.getStartPosition(), testRemoteItem.getStartPosition());
- assertEquals(mTestItem.getEndPosition(), testRemoteItem.getEndPosition());
+ assertFalse(testRemoteItem instanceof UriMediaItem);
+ assertEquals(testUriItem.getStartPosition(), testRemoteItem.getStartPosition());
+ assertEquals(testUriItem.getEndPosition(), testRemoteItem.getEndPosition());
MediaTestUtils.assertMediaMetadataEquals(
- mTestItem.getMetadata(), testRemoteItem.getMetadata());
+ testUriItem.getMetadata(), testRemoteItem.getMetadata());
}
@Test
public void testSubclass_acrossProcessWithParcelUtils() {
- if (mTestItem.getClass() == MediaItem.class) {
- return;
- }
+ final UriMediaItem testUriItem = createUriMediaItem();
+
+ // Mocks the binder call across the processes by using writeParcelable/readParcelable
+ // which only happens between processes. Code snippets are copied from
+ // VersionedParcelIntegTest#parcelCopy.
try {
- // Mocks the binder call across the processes by using writeParcelable/readParcelable
- // which only happens between processes. Code snippets are copied from
- // VersionedParcelIntegTest#parcelCopy.
final Parcel p = Parcel.obtain();
- p.writeParcelable(ParcelUtils.toParcelable(mTestItem), 0);
+ p.writeParcelable(ParcelUtils.toParcelable(testUriItem), 0);
p.setDataPosition(0);
final MediaItem testRemoteItem = ParcelUtils.fromParcelable(
(ParcelImpl) p.readParcelable(MediaItem.class.getClassLoader()));
-
- assertTrue("Write to parcel should fail for subclass of MediaItem",
- mTestItem.getClass() == MediaItem.class);
+ fail("Write to parcel should fail for subclass of MediaItem");
} catch (Exception e) {
}
}
- /**
- * Tests whether the methods in MediaItem.Builder have been hidden in subclasses by overriding
- * them all.
- */
- @Test
- public void testSubclass_overriddenAllMethods() throws Exception {
- Method[] mediaItemBuilderMethods = MediaItem.Builder.class.getDeclaredMethods();
- for (int i = 0; i < mediaItemBuilderMethods.length; i++) {
- Method mediaItemBuilderMethod = mediaItemBuilderMethods[i];
- if (!Modifier.isPublic(mediaItemBuilderMethod.getModifiers())) {
- continue;
- }
- Method subclassMethod = mItemBuilderClass.getMethod(
- mediaItemBuilderMethod.getName(), mediaItemBuilderMethod.getParameterTypes());
- assertEquals(subclassMethod.getDeclaringClass(), mItemBuilderClass);
- }
- }
-
- interface MediaItemFactory {
- MediaItem create(Context context);
+ private UriMediaItem createUriMediaItem() {
+ final MediaMetadata testMetadata = new MediaMetadata.Builder()
+ .putString("MediaItemTest", "MediaItemTest").build();
+ return new UriMediaItem.Builder(mContext, Uri.parse("test://test"))
+ .setMetadata(testMetadata)
+ .setStartPosition(1)
+ .setEndPosition(1000)
+ .build();
}
}
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaLibrarySessionCallbackTest.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaLibrarySessionCallbackTest.java
index 3c94004..1e8e350 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaLibrarySessionCallbackTest.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaLibrarySessionCallbackTest.java
@@ -31,8 +31,8 @@
import androidx.media2.test.service.MockPlayer;
import androidx.media2.test.service.RemoteMediaBrowser;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -50,7 +50,7 @@
*/
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
public class MediaLibrarySessionCallbackTest extends MediaSessionTestBase {
MockPlayer mPlayer;
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaMetadataTest.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaMetadataTest.java
index 53d0f99..65c30db 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaMetadataTest.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaMetadataTest.java
@@ -42,8 +42,8 @@
import androidx.media2.ThumbRating;
import androidx.media2.test.common.TestUtils;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.versionedparcelable.ParcelImpl;
import androidx.versionedparcelable.ParcelUtils;
@@ -56,7 +56,7 @@
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
public class MediaMetadataTest {
@Test
public void testBuilder() {
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackTest.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackTest.java
index ef2070c..15c9e3c 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackTest.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackTest.java
@@ -44,8 +44,8 @@
import androidx.media2.test.service.MockPlayer;
import androidx.media2.test.service.RemoteMediaController;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -63,7 +63,7 @@
*/
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class MediaSessionCallbackTest extends MediaSessionTestBase {
private static final String TAG = "MediaSessionCallbackTest";
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackTestWithMediaControllerCompat.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackTestWithMediaControllerCompat.java
deleted file mode 100644
index 912c37d..0000000
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCallbackTestWithMediaControllerCompat.java
+++ /dev/null
@@ -1,938 +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.media2.test.service.tests;
-
-import static androidx.media.MediaSessionManager.RemoteUserInfo.LEGACY_CONTROLLER;
-import static androidx.media2.SessionResult.RESULT_ERROR_INVALID_STATE;
-import static androidx.media2.SessionResult.RESULT_SUCCESS;
-import static androidx.media2.test.common.CommonConstants.CLIENT_PACKAGE_NAME;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import android.app.PendingIntent;
-import android.content.Context;
-import android.content.Intent;
-import android.media.AudioManager;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.HandlerThread;
-import android.support.v4.media.MediaDescriptionCompat;
-import android.support.v4.media.RatingCompat;
-import android.support.v4.media.session.MediaControllerCompat;
-import android.support.v4.media.session.MediaSessionCompat.QueueItem;
-
-import androidx.annotation.NonNull;
-import androidx.media.AudioAttributesCompat;
-import androidx.media.VolumeProviderCompat;
-import androidx.media2.MediaItem;
-import androidx.media2.MediaSession;
-import androidx.media2.MediaSession.ControllerInfo;
-import androidx.media2.MediaSession.SessionCallback;
-import androidx.media2.MediaUtils;
-import androidx.media2.Rating;
-import androidx.media2.SessionCommand;
-import androidx.media2.SessionCommandGroup;
-import androidx.media2.SessionPlayer;
-import androidx.media2.SessionResult;
-import androidx.media2.test.common.MockActivity;
-import androidx.media2.test.common.PollingCheck;
-import androidx.media2.test.common.TestUtils;
-import androidx.media2.test.common.TestUtils.SyncHandler;
-import androidx.media2.test.service.MediaTestUtils;
-import androidx.media2.test.service.MockPlayer;
-import androidx.media2.test.service.MockRemotePlayer;
-import androidx.media2.test.service.RemoteMediaControllerCompat;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Tests {@link SessionCallback} working with {@link MediaControllerCompat}.
- */
-@RunWith(AndroidJUnit4.class)
-@LargeTest
-public class MediaSessionCallbackTestWithMediaControllerCompat extends MediaSessionTestBase {
- private static final String TAG = "MediaSessionCallbackTestWithMediaControllerCompat";
-
- private static final String EXPECTED_CONTROLLER_PACKAGE_NAME =
- (Build.VERSION.SDK_INT < 21 || Build.VERSION.SDK_INT >= 24)
- ? CLIENT_PACKAGE_NAME : LEGACY_CONTROLLER;
-
- PendingIntent mIntent;
- MediaSession mSession;
- RemoteMediaControllerCompat mController;
- MockPlayer mPlayer;
- AudioManager mAudioManager;
-
- @Before
- @Override
- public void setUp() throws Exception {
- super.setUp();
- final Intent sessionActivity = new Intent(mContext, MockActivity.class);
- // Create this test specific MediaSession to use our own Handler.
- mIntent = PendingIntent.getActivity(mContext, 0, sessionActivity, 0);
-
- mPlayer = new MockPlayer(1);
- if (mSession != null && !mSession.isClosed()) {
- mSession.close();
- }
- mSession = new MediaSession.Builder(mContext, mPlayer)
- .setId(TAG)
- .setSessionCallback(sHandlerExecutor, new SessionCallback() {
- @Override
- public SessionCommandGroup onConnect(MediaSession session,
- ControllerInfo controller) {
- if (EXPECTED_CONTROLLER_PACKAGE_NAME.equals(controller.getPackageName())) {
- return super.onConnect(session, controller);
- }
- return null;
- }
-
- @Override
- public MediaItem onCreateMediaItem(MediaSession session,
- ControllerInfo controller, String mediaId) {
- return MediaTestUtils.createMediaItem(mediaId);
- }
- })
- .setSessionActivity(mIntent)
- .build();
- mController = new RemoteMediaControllerCompat(
- mContext, mSession.getSessionCompat().getSessionToken(), true);
- mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
- }
-
- @After
- @Override
- public void cleanUp() throws Exception {
- super.cleanUp();
- if (mSession != null) {
- mSession.close();
- }
- if (mController != null) {
- mController.cleanUp();
- mController = null;
- }
- }
-
- @Test
- public void testPlay() {
- prepareLooper();
- mController.getTransportControls().play();
- try {
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- } catch (InterruptedException e) {
- fail(e.getMessage());
- }
- assertTrue(mPlayer.mPlayCalled);
- }
-
- @Test
- public void testPause() {
- prepareLooper();
- mController.getTransportControls().pause();
- try {
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- } catch (InterruptedException e) {
- fail(e.getMessage());
- }
- assertTrue(mPlayer.mPauseCalled);
- }
-
- @Test
- public void testStop() {
- prepareLooper();
-
- // MediaControllerCompat#stop() will call MediaSession#pause() and MediaSession#seekTo(0).
- // Therefore, the latch's initial count is 2.
- MockPlayer player = new MockPlayer(2);
- player.mCurrentPosition = 1530;
- mSession.updatePlayer(player);
-
- mController.getTransportControls().stop();
- try {
- assertTrue(player.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- } catch (InterruptedException e) {
- fail(e.getMessage());
- }
- assertTrue(player.mPauseCalled);
- assertTrue(player.mSeekToCalled);
- assertEquals(0, player.mSeekPosition);
- }
-
- @Test
- public void testPrepare() {
- prepareLooper();
- mController.getTransportControls().prepare();
- try {
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- } catch (InterruptedException e) {
- fail(e.getMessage());
- }
- assertTrue(mPlayer.mPrepareCalled);
- }
-
- @Test
- public void testSeekTo() {
- prepareLooper();
- final long seekPosition = 12125L;
- mController.getTransportControls().seekTo(seekPosition);
- try {
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- } catch (InterruptedException e) {
- fail(e.getMessage());
- }
- assertTrue(mPlayer.mSeekToCalled);
- assertEquals(seekPosition, mPlayer.mSeekPosition);
- }
-
- @Test
- public void testSetPlaybackSpeed() {
- prepareLooper();
- final float testSpeed = 2.0f;
- mController.getTransportControls().setPlaybackSpeed(testSpeed);
- try {
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- } catch (InterruptedException e) {
- fail(e.getMessage());
- }
- assertTrue(mPlayer.mSetPlaybackSpeedCalled);
- assertEquals(testSpeed, mPlayer.mPlaybackSpeed, 0.0f);
- }
-
- @Test
- public void testAddQueueItem() throws InterruptedException {
- prepareLooper();
- final int playlistSize = 10;
-
- List<MediaItem> playlist = MediaTestUtils.createPlaylist(playlistSize);
- mPlayer.mPlaylist = playlist;
- mPlayer.notifyPlaylistChanged();
- // Wait some time for setting the playlist.
- Thread.sleep(TIMEOUT_MS);
-
- // Prepare an item to add.
- final String mediaId = "media_id";
- MediaDescriptionCompat desc = new MediaDescriptionCompat.Builder()
- .setMediaId(mediaId)
- .build();
- mController.addQueueItem(desc);
-
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- assertTrue(mPlayer.mAddPlaylistItemCalled);
- assertEquals(mediaId, mPlayer.mItem.getMediaId());
- }
-
- @Test
- public void testAddQueueItemWithIndex() throws InterruptedException {
- prepareLooper();
- final int playlistSize = 10;
-
- List<MediaItem> playlist = MediaTestUtils.createPlaylist(playlistSize);
- mPlayer.mPlaylist = playlist;
- mPlayer.notifyPlaylistChanged();
- // Wait some time for setting the playlist.
- Thread.sleep(TIMEOUT_MS);
-
- // Prepare an item to add.
- final int testIndex = 0;
- final String mediaId = "media_id";
- MediaDescriptionCompat desc = new MediaDescriptionCompat.Builder()
- .setMediaId(mediaId)
- .build();
- mController.addQueueItem(desc, testIndex);
-
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- assertTrue(mPlayer.mAddPlaylistItemCalled);
- assertEquals(testIndex, mPlayer.mIndex);
- assertEquals(mediaId, mPlayer.mItem.getMediaId());
- }
-
- @Test
- public void testRemoveQueueItem() throws InterruptedException {
- prepareLooper();
- final int playlistSize = 10;
-
- List<MediaItem> playlist = MediaTestUtils.createPlaylist(playlistSize);
- mPlayer.mPlaylist = playlist;
- mPlayer.notifyPlaylistChanged();
- // Wait some time for setting the playlist.
- Thread.sleep(TIMEOUT_MS);
-
- // Select an item to remove.
- final int targetIndex = 3;
- final MediaItem targetItem = playlist.get(targetIndex);
- MediaDescriptionCompat desc = new MediaDescriptionCompat.Builder()
- .setMediaId(targetItem.getMediaId())
- .build();
- mController.removeQueueItem(desc);
-
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- assertTrue(mPlayer.mRemovePlaylistItemCalled);
- assertEquals(targetIndex, mPlayer.mIndex);
- }
-
- @Test
- public void testSkipToPrevious() throws InterruptedException {
- prepareLooper();
- mController.getTransportControls().skipToPrevious();
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- assertTrue(mPlayer.mSkipToPreviousItemCalled);
- }
-
- @Test
- public void testSkipToNext() throws InterruptedException {
- prepareLooper();
- mController.getTransportControls().skipToNext();
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- assertTrue(mPlayer.mSkipToNextItemCalled);
- }
-
- @Test
- public void testSkipToQueueItem() throws InterruptedException {
- prepareLooper();
- final int playlistSize = 10;
-
- List<MediaItem> playlist = MediaTestUtils.createPlaylist(playlistSize);
- mPlayer.mPlaylist = playlist;
- mPlayer.notifyPlaylistChanged();
- // Wait some time for setting the playlist.
- Thread.sleep(TIMEOUT_MS);
-
- // Get Queue from local MediaControllerCompat.
- List<QueueItem> queue = mSession.getSessionCompat().getController().getQueue();
- final int targetIndex = 3;
- mController.getTransportControls().skipToQueueItem(queue.get(targetIndex).getQueueId());
-
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- assertTrue(mPlayer.mSkipToPlaylistItemCalled);
- assertEquals(targetIndex, mPlayer.mIndex);
- }
-
- @Test
- public void testSetShuffleMode() throws InterruptedException {
- prepareLooper();
- final int testShuffleMode = SessionPlayer.SHUFFLE_MODE_GROUP;
- mController.getTransportControls().setShuffleMode(testShuffleMode);
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
-
- assertTrue(mPlayer.mSetShuffleModeCalled);
- assertEquals(testShuffleMode, mPlayer.mShuffleMode);
- }
-
- @Test
- public void testSetRepeatMode() throws InterruptedException {
- prepareLooper();
- final int testRepeatMode = SessionPlayer.REPEAT_MODE_GROUP;
- mController.getTransportControls().setRepeatMode(testRepeatMode);
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
-
- assertTrue(mPlayer.mSetRepeatModeCalled);
- assertEquals(testRepeatMode, mPlayer.mRepeatMode);
- }
-
- @Test
- public void testSetVolumeTo() throws Exception {
- prepareLooper();
- final int maxVolume = 100;
- final int currentVolume = 23;
- final int volumeControlType = VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE;
- MockRemotePlayer remotePlayer =
- new MockRemotePlayer(volumeControlType, maxVolume, currentVolume);
-
- mSession.updatePlayer(remotePlayer);
-
- final int targetVolume = 50;
- mController.setVolumeTo(targetVolume, 0 /* flags */);
- assertTrue(remotePlayer.mLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- assertTrue(remotePlayer.mSetVolumeToCalled);
- assertEquals(targetVolume, (int) remotePlayer.mCurrentVolume);
- }
-
- @Test
- public void testAdjustVolume() throws Exception {
- prepareLooper();
- final int maxVolume = 100;
- final int currentVolume = 23;
- final int volumeControlType = VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE;
- MockRemotePlayer remotePlayer =
- new MockRemotePlayer(volumeControlType, maxVolume, currentVolume);
-
- mSession.updatePlayer(remotePlayer);
-
- final int direction = AudioManager.ADJUST_RAISE;
- mController.adjustVolume(direction, 0 /* flags */);
- assertTrue(remotePlayer.mLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- assertTrue(remotePlayer.mAdjustVolumeCalled);
- assertEquals(direction, remotePlayer.mDirection);
- }
-
- @Test
- public void testSetVolumeWithLocalVolume() throws Exception {
- prepareLooper();
- if (Build.VERSION.SDK_INT >= 21 && mAudioManager.isVolumeFixed()) {
- // This test is not eligible for this device.
- return;
- }
-
- // Here, we intentionally choose STREAM_ALARM in order not to consider
- // 'Do Not Disturb' or 'Volume limit'.
- final int stream = AudioManager.STREAM_ALARM;
- final int maxVolume = mAudioManager.getStreamMaxVolume(stream);
- final int minVolume = 1;
- if (maxVolume <= minVolume) {
- return;
- }
-
- // Set stream of the session.
- AudioAttributesCompat attrs = new AudioAttributesCompat.Builder()
- .setLegacyStreamType(stream)
- .build();
- mPlayer.setAudioAttributes(attrs);
- mSession.updatePlayer(mPlayer);
-
- final int originalVolume = mAudioManager.getStreamVolume(stream);
- final int targetVolume = originalVolume == minVolume
- ? originalVolume + 1 : originalVolume - 1;
-
- mController.setVolumeTo(targetVolume, AudioManager.FLAG_SHOW_UI);
- new PollingCheck(TIMEOUT_MS) {
- @Override
- protected boolean check() {
- return targetVolume == mAudioManager.getStreamVolume(stream);
- }
- }.run();
-
- // Set back to original volume.
- mAudioManager.setStreamVolume(stream, originalVolume, 0 /* flags */);
- }
-
- @Test
- public void testAdjustVolumeWithLocalVolume() throws Exception {
- prepareLooper();
- if (Build.VERSION.SDK_INT >= 21 && mAudioManager.isVolumeFixed()) {
- // This test is not eligible for this device.
- return;
- }
-
- // Here, we intentionally choose STREAM_ALARM in order not to consider
- // 'Do Not Disturb' or 'Volume limit'.
- final int stream = AudioManager.STREAM_ALARM;
- final int maxVolume = mAudioManager.getStreamMaxVolume(stream);
- final int minVolume = 1;
- if (maxVolume <= minVolume) {
- return;
- }
-
- // Set stream of the session.
- AudioAttributesCompat attrs = new AudioAttributesCompat.Builder()
- .setLegacyStreamType(stream)
- .build();
- mPlayer.setAudioAttributes(attrs);
- mSession.updatePlayer(mPlayer);
-
- final int originalVolume = mAudioManager.getStreamVolume(stream);
- final int direction = originalVolume == minVolume
- ? AudioManager.ADJUST_RAISE : AudioManager.ADJUST_LOWER;
- final int targetVolume = originalVolume + direction;
-
- mController.adjustVolume(direction, AudioManager.FLAG_SHOW_UI);
- new PollingCheck(TIMEOUT_MS) {
- @Override
- protected boolean check() {
- return targetVolume == mAudioManager.getStreamVolume(stream);
- }
- }.run();
-
- // Set back to original volume.
- mAudioManager.setStreamVolume(stream, originalVolume, 0 /* flags */);
- }
-
- @Test
- public void testSendCommand() throws InterruptedException {
- prepareLooper();
- // TODO(jaewan): Need to revisit with the permission.
- final String testCommand = "test_command";
- final Bundle testArgs = new Bundle();
- testArgs.putString("args", "test_args");
-
- final CountDownLatch latch = new CountDownLatch(1);
- final SessionCallback callback = new SessionCallback() {
- @Override
- public SessionCommandGroup onConnect(@NonNull MediaSession session,
- @NonNull ControllerInfo controller) {
- SessionCommandGroup commands = super.onConnect(session, controller);
- commands.addCommand(new SessionCommand(testCommand, null));
- return commands;
- }
-
- @Override
- public SessionResult onCustomCommand(MediaSession session,
- ControllerInfo controller, SessionCommand customCommand, Bundle args) {
- assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
- assertEquals(testCommand, customCommand.getCustomCommand());
- assertTrue(TestUtils.equals(testArgs, args));
- latch.countDown();
- return new SessionResult(RESULT_SUCCESS, null);
- }
- };
- mSession.close();
- mSession = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, callback).setId(TAG).build();
- final RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, mSession.getSessionCompat().getSessionToken(), true);
- controller.sendCommand(testCommand, testArgs, null);
- assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- }
-
- @Test
- public void testControllerCallback_sessionRejects() throws Exception {
- prepareLooper();
- final SessionCallback sessionCallback = new SessionCallback() {
- @Override
- public SessionCommandGroup onConnect(MediaSession session,
- ControllerInfo controller) {
- return null;
- }
- };
- sHandler.postAndSync(new Runnable() {
- @Override
- public void run() {
- mSession.close();
- mSession = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, sessionCallback).build();
- }
- });
-
- // Session will not accept the controller's commands.
- RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, mSession.getSessionCompat().getSessionToken(), true);
- controller.getTransportControls().play();
- assertFalse(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- }
-
- @Test
- public void testFastForward() throws InterruptedException {
- prepareLooper();
- final CountDownLatch latch = new CountDownLatch(1);
- final SessionCallback callback = new SessionCallback() {
- @Override
- public int onFastForward(MediaSession session, ControllerInfo controller) {
- assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
- latch.countDown();
- return RESULT_SUCCESS;
- }
- };
- try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, callback)
- .setId("testFastForward").build()) {
- RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, session.getSessionCompat().getSessionToken(), true);
- controller.getTransportControls().fastForward();
- assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- }
- }
-
- @Test
- public void testRewind() throws InterruptedException {
- prepareLooper();
- final CountDownLatch latch = new CountDownLatch(1);
- final SessionCallback callback = new SessionCallback() {
- @Override
- public int onRewind(MediaSession session, ControllerInfo controller) {
- assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
- latch.countDown();
- return RESULT_SUCCESS;
- }
- };
- try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, callback)
- .setId("testRewind").build()) {
- RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, session.getSessionCompat().getSessionToken(), true);
- controller.getTransportControls().rewind();
- assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- }
- }
-
- @Test
- public void testPlayFromSearch() throws InterruptedException {
- prepareLooper();
- final String request = "random query";
- final Bundle bundle = new Bundle();
- bundle.putString("key", "value");
- final CountDownLatch latch = new CountDownLatch(1);
- final SessionCallback callback = new SessionCallback() {
- @Override
- public int onPlayFromSearch(MediaSession session, ControllerInfo controller,
- String query, Bundle extras) {
- super.onPlayFromSearch(session, controller, query, extras);
- assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
- assertEquals(request, query);
- assertTrue(TestUtils.equals(bundle, extras));
- latch.countDown();
- return RESULT_SUCCESS;
- }
- };
- try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, callback)
- .setId("testPlayFromSearch").build()) {
- RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, session.getSessionCompat().getSessionToken(), true);
- controller.getTransportControls().playFromSearch(request, bundle);
- assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- }
- }
-
- @Test
- public void testPlayFromUri() throws InterruptedException {
- prepareLooper();
- final Uri request = Uri.parse("foo://boo");
- final Bundle bundle = new Bundle();
- bundle.putString("key", "value");
- final CountDownLatch latch = new CountDownLatch(1);
- final SessionCallback callback = new SessionCallback() {
- @Override
- public int onPlayFromUri(MediaSession session, ControllerInfo controller, Uri uri,
- Bundle extras) {
- assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
- assertEquals(request, uri);
- assertTrue(TestUtils.equals(bundle, extras));
- latch.countDown();
- return RESULT_SUCCESS;
- }
- };
- try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, callback)
- .setId("testPlayFromUri").build()) {
- RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, session.getSessionCompat().getSessionToken(), true);
- controller.getTransportControls().playFromUri(request, bundle);
- assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- }
- }
-
- @Test
- public void testPlayFromMediaId() throws InterruptedException {
- prepareLooper();
- final String request = "media_id";
- final Bundle bundle = new Bundle();
- bundle.putString("key", "value");
- final CountDownLatch latch = new CountDownLatch(1);
- final SessionCallback callback = new SessionCallback() {
- @Override
- public int onPlayFromMediaId(MediaSession session, ControllerInfo controller,
- String mediaId, Bundle extras) {
- assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
- assertEquals(request, mediaId);
- assertTrue(TestUtils.equals(bundle, extras));
- latch.countDown();
- return RESULT_SUCCESS;
- }
- };
- try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, callback)
- .setId("testPlayFromMediaId").build()) {
- RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, session.getSessionCompat().getSessionToken(), true);
- controller.getTransportControls().playFromMediaId(request, bundle);
- assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- }
- }
-
- @Test
- public void testPrepareFromSearch() throws InterruptedException {
- prepareLooper();
- final String request = "random query";
- final Bundle bundle = new Bundle();
- bundle.putString("key", "value");
- final CountDownLatch latch = new CountDownLatch(1);
- final SessionCallback callback = new SessionCallback() {
- @Override
- public int onPrepareFromSearch(MediaSession session, ControllerInfo controller,
- String query, Bundle extras) {
- assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
- assertEquals(request, query);
- assertTrue(TestUtils.equals(bundle, extras));
- latch.countDown();
- return RESULT_SUCCESS;
- }
- };
- try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, callback)
- .setId("testPrepareFromSearch").build()) {
- RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, session.getSessionCompat().getSessionToken(), true);
- controller.getTransportControls().prepareFromSearch(request, bundle);
- assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- }
- }
-
- @Test
- public void testPrepareFromUri() throws InterruptedException {
- prepareLooper();
- final Uri request = Uri.parse("foo://boo");
- final Bundle bundle = new Bundle();
- bundle.putString("key", "value");
- final CountDownLatch latch = new CountDownLatch(1);
- final SessionCallback callback = new SessionCallback() {
- @Override
- public int onPrepareFromUri(MediaSession session, ControllerInfo controller, Uri uri,
- Bundle extras) {
- assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
- assertEquals(request, uri);
- assertTrue(TestUtils.equals(bundle, extras));
- latch.countDown();
- return RESULT_SUCCESS;
- }
- };
- try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, callback)
- .setId("testPrepareFromUri").build()) {
- RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, session.getSessionCompat().getSessionToken(), true);
- controller.getTransportControls().prepareFromUri(request, bundle);
- assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- }
- }
-
- @Test
- public void testPrepareFromMediaId() throws InterruptedException {
- prepareLooper();
- final String request = "media_id";
- final Bundle bundle = new Bundle();
- bundle.putString("key", "value");
- final CountDownLatch latch = new CountDownLatch(1);
- final SessionCallback callback = new SessionCallback() {
- @Override
- public int onPrepareFromMediaId(MediaSession session, ControllerInfo controller,
- String mediaId, Bundle extras) {
- assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
- assertEquals(request, mediaId);
- assertTrue(TestUtils.equals(bundle, extras));
- latch.countDown();
- return RESULT_SUCCESS;
- }
- };
- try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, callback)
- .setId("testPrepareFromMediaId").build()) {
- RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, session.getSessionCompat().getSessionToken(), true);
- controller.getTransportControls().prepareFromMediaId(request, bundle);
- assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- }
- }
-
- @Test
- public void testSetRating() throws InterruptedException {
- prepareLooper();
- final int ratingType = RatingCompat.RATING_5_STARS;
- final float ratingValue = 3.5f;
- final RatingCompat rating = RatingCompat.newStarRating(ratingType, ratingValue);
- final String mediaId = "media_id";
-
- final CountDownLatch latch = new CountDownLatch(1);
- final SessionCallback callback = new SessionCallback() {
- @Override
- public int onSetRating(MediaSession session, ControllerInfo controller,
- String mediaIdOut, Rating ratingOut) {
- assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
- assertEquals(mediaId, mediaIdOut);
- assertEquals(MediaUtils.convertToRating(rating), ratingOut);
- latch.countDown();
- return RESULT_SUCCESS;
- }
- };
-
- mPlayer.mCurrentMediaItem = MediaTestUtils.createMediaItem(mediaId);
- try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, callback)
- .setId("testSetRating").build()) {
- RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, session.getSessionCompat().getSessionToken(), true);
- controller.getTransportControls().setRating(rating);
- assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- }
- }
-
- @Test
- public void testOnCommandCallback() throws InterruptedException {
- prepareLooper();
- final ArrayList<SessionCommand> commands = new ArrayList<>();
- final CountDownLatch latchForPause = new CountDownLatch(1);
- final SessionCallback callback = new SessionCallback() {
- @Override
- public int onCommandRequest(MediaSession session, ControllerInfo controllerInfo,
- SessionCommand command) {
- assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controllerInfo.getPackageName());
- assertFalse(controllerInfo.isTrusted());
- commands.add(command);
- if (command.getCommandCode() == SessionCommand.COMMAND_CODE_PLAYER_PAUSE) {
- latchForPause.countDown();
- return RESULT_ERROR_INVALID_STATE;
- }
- return RESULT_SUCCESS;
- }
- };
-
- sHandler.postAndSync(new Runnable() {
- @Override
- public void run() {
- mSession.close();
- mPlayer = new MockPlayer(1);
- mSession = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, callback).build();
- }
- });
- RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, mSession.getSessionCompat().getSessionToken(), true);
-
- controller.getTransportControls().pause();
- assertTrue(latchForPause.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- assertFalse(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- assertFalse(mPlayer.mPauseCalled);
- assertEquals(1, commands.size());
- assertEquals(SessionCommand.COMMAND_CODE_PLAYER_PAUSE,
- (long) commands.get(0).getCommandCode());
-
- controller.getTransportControls().play();
- assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- assertTrue(mPlayer.mPlayCalled);
- assertFalse(mPlayer.mPauseCalled);
- assertEquals(2, commands.size());
- assertEquals(SessionCommand.COMMAND_CODE_PLAYER_PLAY,
- (long) commands.get(1).getCommandCode());
- }
-
- /**
- * Test potential deadlock for calls between controller and session.
- */
- @Test
- @LargeTest
- public void testDeadlock() throws InterruptedException {
- prepareLooper();
- sHandler.postAndSync(new Runnable() {
- @Override
- public void run() {
- mSession.close();
- mSession = null;
- }
- });
-
- // Two more threads are needed not to block test thread nor test wide thread (sHandler).
- final HandlerThread sessionThread = new HandlerThread("testDeadlock_session");
- final HandlerThread testThread = new HandlerThread("testDeadlock_test");
- sessionThread.start();
- testThread.start();
- final SyncHandler sessionHandler = new SyncHandler(sessionThread.getLooper());
- final Handler testHandler = new Handler(testThread.getLooper());
- final CountDownLatch latch = new CountDownLatch(1);
- try {
- final MockPlayer player = new MockPlayer(0);
- sessionHandler.postAndSync(new Runnable() {
- @Override
- public void run() {
- mSession = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, new SessionCallback() {})
- .setId("testDeadlock").build();
- }
- });
- final RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
- mContext, mSession.getSessionCompat().getSessionToken(), true);
- testHandler.post(new Runnable() {
- @Override
- public void run() {
- final int state = SessionPlayer.PLAYER_STATE_ERROR;
- for (int i = 0; i < 100; i++) {
- // triggers call from session to controller.
- player.notifyPlayerStateChanged(state);
- // triggers call from controller to session.
- controller.getTransportControls().play();
-
- // Repeat above
- player.notifyPlayerStateChanged(state);
- controller.getTransportControls().pause();
- player.notifyPlayerStateChanged(state);
- controller.getTransportControls().stop();
- player.notifyPlayerStateChanged(state);
- controller.getTransportControls().skipToNext();
- player.notifyPlayerStateChanged(state);
- controller.getTransportControls().skipToPrevious();
- }
- // This may hang if deadlock happens.
- latch.countDown();
- }
- });
- assertTrue(latch.await(3, TimeUnit.SECONDS));
- } finally {
- if (mSession != null) {
- sessionHandler.postAndSync(new Runnable() {
- @Override
- public void run() {
- // Clean up here because sessionHandler will be removed afterwards.
- mSession.close();
- mSession = null;
- }
- });
- }
-
- if (Build.VERSION.SDK_INT >= 18) {
- sessionThread.quitSafely();
- testThread.quitSafely();
- } else {
- sessionThread.quit();
- testThread.quit();
- }
- }
- }
-
- @Test
- @LargeTest
- public void testControllerAfterSessionIsGone() throws InterruptedException {
- prepareLooper();
- mSession.close();
- testSessionCallbackIsNotCalled();
-
- // Ensure that the controller cannot use newly create session with the same ID.
- // Recreated session has different session stub, so previously created controller
- // shouldn't be available.
- mSession = new MediaSession.Builder(mContext, mPlayer)
- .setSessionCallback(sHandlerExecutor, new SessionCallback() {})
- .setId(TAG)
- .build();
- testSessionCallbackIsNotCalled();
- }
-
- void testSessionCallbackIsNotCalled() throws InterruptedException {
- mController.getTransportControls().play();
- assertFalse(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
- }
-}
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCompatCallbackTestWithMediaController.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCompatCallbackTestWithMediaController.java
index 59349bf..758a680 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCompatCallbackTestWithMediaController.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionCompatCallbackTestWithMediaController.java
@@ -173,19 +173,6 @@
}
@Test
- public void testSetPlaybackSpeed() throws Exception {
- prepareLooper();
- RemoteMediaController controller = createControllerAndWaitConnection();
- mSessionCallback.reset(1);
-
- final float testSpeed = 2.0f;
- controller.setPlaybackSpeed(testSpeed);
- assertTrue(mSessionCallback.await(TIME_OUT_MS));
- assertTrue(mSessionCallback.mOnSetPlaybackSpeedCalled);
- assertEquals(testSpeed, mSessionCallback.mSpeed, 0.0f);
- }
-
- @Test
public void testAddPlaylistItem() throws Exception {
prepareLooper();
final List<MediaItem> testList = MediaTestUtils.createPlaylist(2);
@@ -625,7 +612,6 @@
private class MediaSessionCallback extends MediaSessionCompat.Callback {
private CountDownLatch mLatch = new CountDownLatch(1);
private long mSeekPosition;
- private float mSpeed;
private long mQueueItemId;
private RatingCompat mRating;
private String mMediaId;
@@ -650,7 +636,6 @@
private boolean mOnSkipToPreviousCalled;
private boolean mOnSkipToNextCalled;
private boolean mOnSeekToCalled;
- private boolean mOnSetPlaybackSpeedCalled;
private boolean mOnSkipToQueueItemCalled;
private boolean mOnSetRatingCalled;
private boolean mOnPlayFromMediaIdCalled;
@@ -672,7 +657,6 @@
public void reset(int count) {
mLatch = new CountDownLatch(count);
mSeekPosition = -1;
- mSpeed = -1.0f;
mQueueItemId = -1;
mRating = null;
mMediaId = null;
@@ -698,7 +682,6 @@
mOnSkipToNextCalled = false;
mOnSkipToQueueItemCalled = false;
mOnSeekToCalled = false;
- mOnSetPlaybackSpeedCalled = false;
mOnSetRatingCalled = false;
mOnPlayFromMediaIdCalled = false;
mOnPlayFromSearchCalled = false;
@@ -778,13 +761,6 @@
}
@Override
- public void onSetPlaybackSpeed(float speed) {
- mOnSetPlaybackSpeedCalled = true;
- mSpeed = speed;
- mLatch.countDown();
- }
-
- @Override
public void onSetRating(RatingCompat rating) {
mOnSetRatingCalled = true;
mRating = rating;
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionLegacyCallbackTest.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionLegacyCallbackTest.java
new file mode 100644
index 0000000..d7576b3
--- /dev/null
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionLegacyCallbackTest.java
@@ -0,0 +1,925 @@
+/*
+ * 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.media2.test.service.tests;
+
+import static androidx.media.MediaSessionManager.RemoteUserInfo.LEGACY_CONTROLLER;
+import static androidx.media2.SessionResult.RESULT_ERROR_INVALID_STATE;
+import static androidx.media2.SessionResult.RESULT_SUCCESS;
+import static androidx.media2.test.common.CommonConstants.CLIENT_PACKAGE_NAME;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.media.AudioManager;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.support.v4.media.MediaDescriptionCompat;
+import android.support.v4.media.RatingCompat;
+import android.support.v4.media.session.MediaControllerCompat;
+import android.support.v4.media.session.MediaSessionCompat.QueueItem;
+
+import androidx.annotation.NonNull;
+import androidx.media.AudioAttributesCompat;
+import androidx.media.VolumeProviderCompat;
+import androidx.media2.MediaItem;
+import androidx.media2.MediaSession;
+import androidx.media2.MediaSession.ControllerInfo;
+import androidx.media2.MediaSession.SessionCallback;
+import androidx.media2.MediaUtils;
+import androidx.media2.Rating;
+import androidx.media2.SessionCommand;
+import androidx.media2.SessionCommandGroup;
+import androidx.media2.SessionPlayer;
+import androidx.media2.SessionResult;
+import androidx.media2.test.common.MockActivity;
+import androidx.media2.test.common.PollingCheck;
+import androidx.media2.test.common.TestUtils;
+import androidx.media2.test.common.TestUtils.SyncHandler;
+import androidx.media2.test.service.MediaTestUtils;
+import androidx.media2.test.service.MockPlayer;
+import androidx.media2.test.service.MockRemotePlayer;
+import androidx.media2.test.service.RemoteMediaControllerCompat;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Tests {@link SessionCallback} working with {@link MediaControllerCompat}.
+ */
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class MediaSessionLegacyCallbackTest extends MediaSessionTestBase {
+ private static final String TAG = "MediaSessionLegacyCallbackTest";
+
+ private static final String EXPECTED_CONTROLLER_PACKAGE_NAME =
+ (Build.VERSION.SDK_INT < 21 || Build.VERSION.SDK_INT >= 24)
+ ? CLIENT_PACKAGE_NAME : LEGACY_CONTROLLER;
+
+ PendingIntent mIntent;
+ MediaSession mSession;
+ RemoteMediaControllerCompat mController;
+ MockPlayer mPlayer;
+ AudioManager mAudioManager;
+
+ @Before
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ final Intent sessionActivity = new Intent(mContext, MockActivity.class);
+ // Create this test specific MediaSession to use our own Handler.
+ mIntent = PendingIntent.getActivity(mContext, 0, sessionActivity, 0);
+
+ mPlayer = new MockPlayer(1);
+ if (mSession != null && !mSession.isClosed()) {
+ mSession.close();
+ }
+ mSession = new MediaSession.Builder(mContext, mPlayer)
+ .setId(TAG)
+ .setSessionCallback(sHandlerExecutor, new SessionCallback() {
+ @Override
+ public SessionCommandGroup onConnect(MediaSession session,
+ ControllerInfo controller) {
+ if (EXPECTED_CONTROLLER_PACKAGE_NAME.equals(controller.getPackageName())) {
+ return super.onConnect(session, controller);
+ }
+ return null;
+ }
+
+ @Override
+ public MediaItem onCreateMediaItem(MediaSession session,
+ ControllerInfo controller, String mediaId) {
+ return MediaTestUtils.createMediaItem(mediaId);
+ }
+ })
+ .setSessionActivity(mIntent)
+ .build();
+ mController = new RemoteMediaControllerCompat(
+ mContext, mSession.getSessionCompat().getSessionToken(), true);
+ mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
+ }
+
+ @After
+ @Override
+ public void cleanUp() throws Exception {
+ super.cleanUp();
+ if (mSession != null) {
+ mSession.close();
+ }
+ if (mController != null) {
+ mController.cleanUp();
+ mController = null;
+ }
+ }
+
+ @Test
+ public void testPlay() {
+ prepareLooper();
+ mController.getTransportControls().play();
+ try {
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ } catch (InterruptedException e) {
+ fail(e.getMessage());
+ }
+ assertTrue(mPlayer.mPlayCalled);
+ }
+
+ @Test
+ public void testPause() {
+ prepareLooper();
+ mController.getTransportControls().pause();
+ try {
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ } catch (InterruptedException e) {
+ fail(e.getMessage());
+ }
+ assertTrue(mPlayer.mPauseCalled);
+ }
+
+ @Test
+ public void testStop() {
+ prepareLooper();
+
+ // MediaControllerCompat#stop() will call MediaSession#pause() and MediaSession#seekTo(0).
+ // Therefore, the latch's initial count is 2.
+ MockPlayer player = new MockPlayer(2);
+ player.mCurrentPosition = 1530;
+ mSession.updatePlayer(player);
+
+ mController.getTransportControls().stop();
+ try {
+ assertTrue(player.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ } catch (InterruptedException e) {
+ fail(e.getMessage());
+ }
+ assertTrue(player.mPauseCalled);
+ assertTrue(player.mSeekToCalled);
+ assertEquals(0, player.mSeekPosition);
+ }
+
+ @Test
+ public void testPrepare() {
+ prepareLooper();
+ mController.getTransportControls().prepare();
+ try {
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ } catch (InterruptedException e) {
+ fail(e.getMessage());
+ }
+ assertTrue(mPlayer.mPrepareCalled);
+ }
+
+ @Test
+ public void testSeekTo() {
+ prepareLooper();
+ final long seekPosition = 12125L;
+ mController.getTransportControls().seekTo(seekPosition);
+ try {
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ } catch (InterruptedException e) {
+ fail(e.getMessage());
+ }
+ assertTrue(mPlayer.mSeekToCalled);
+ assertEquals(seekPosition, mPlayer.mSeekPosition);
+ }
+
+ @Test
+ public void testAddQueueItem() throws InterruptedException {
+ prepareLooper();
+ final int playlistSize = 10;
+
+ List<MediaItem> playlist = MediaTestUtils.createPlaylist(playlistSize);
+ mPlayer.mPlaylist = playlist;
+ mPlayer.notifyPlaylistChanged();
+ // Wait some time for setting the playlist.
+ Thread.sleep(TIMEOUT_MS);
+
+ // Prepare an item to add.
+ final String mediaId = "media_id";
+ MediaDescriptionCompat desc = new MediaDescriptionCompat.Builder()
+ .setMediaId(mediaId)
+ .build();
+ mController.addQueueItem(desc);
+
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ assertTrue(mPlayer.mAddPlaylistItemCalled);
+ assertEquals(mediaId, mPlayer.mItem.getMediaId());
+ }
+
+ @Test
+ public void testAddQueueItemWithIndex() throws InterruptedException {
+ prepareLooper();
+ final int playlistSize = 10;
+
+ List<MediaItem> playlist = MediaTestUtils.createPlaylist(playlistSize);
+ mPlayer.mPlaylist = playlist;
+ mPlayer.notifyPlaylistChanged();
+ // Wait some time for setting the playlist.
+ Thread.sleep(TIMEOUT_MS);
+
+ // Prepare an item to add.
+ final int testIndex = 0;
+ final String mediaId = "media_id";
+ MediaDescriptionCompat desc = new MediaDescriptionCompat.Builder()
+ .setMediaId(mediaId)
+ .build();
+ mController.addQueueItem(desc, testIndex);
+
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ assertTrue(mPlayer.mAddPlaylistItemCalled);
+ assertEquals(testIndex, mPlayer.mIndex);
+ assertEquals(mediaId, mPlayer.mItem.getMediaId());
+ }
+
+ @Test
+ public void testRemoveQueueItem() throws InterruptedException {
+ prepareLooper();
+ final int playlistSize = 10;
+
+ List<MediaItem> playlist = MediaTestUtils.createPlaylist(playlistSize);
+ mPlayer.mPlaylist = playlist;
+ mPlayer.notifyPlaylistChanged();
+ // Wait some time for setting the playlist.
+ Thread.sleep(TIMEOUT_MS);
+
+ // Select an item to remove.
+ final int targetIndex = 3;
+ final MediaItem targetItem = playlist.get(targetIndex);
+ MediaDescriptionCompat desc = new MediaDescriptionCompat.Builder()
+ .setMediaId(targetItem.getMediaId())
+ .build();
+ mController.removeQueueItem(desc);
+
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ assertTrue(mPlayer.mRemovePlaylistItemCalled);
+ assertEquals(targetIndex, mPlayer.mIndex);
+ }
+
+ @Test
+ public void testSkipToPrevious() throws InterruptedException {
+ prepareLooper();
+ mController.getTransportControls().skipToPrevious();
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ assertTrue(mPlayer.mSkipToPreviousItemCalled);
+ }
+
+ @Test
+ public void testSkipToNext() throws InterruptedException {
+ prepareLooper();
+ mController.getTransportControls().skipToNext();
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ assertTrue(mPlayer.mSkipToNextItemCalled);
+ }
+
+ @Test
+ public void testSkipToQueueItem() throws InterruptedException {
+ prepareLooper();
+ final int playlistSize = 10;
+
+ List<MediaItem> playlist = MediaTestUtils.createPlaylist(playlistSize);
+ mPlayer.mPlaylist = playlist;
+ mPlayer.notifyPlaylistChanged();
+ // Wait some time for setting the playlist.
+ Thread.sleep(TIMEOUT_MS);
+
+ // Get Queue from local MediaControllerCompat.
+ List<QueueItem> queue = mSession.getSessionCompat().getController().getQueue();
+ final int targetIndex = 3;
+ mController.getTransportControls().skipToQueueItem(queue.get(targetIndex).getQueueId());
+
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ assertTrue(mPlayer.mSkipToPlaylistItemCalled);
+ assertEquals(targetIndex, mPlayer.mIndex);
+ }
+
+ @Test
+ public void testSetShuffleMode() throws InterruptedException {
+ prepareLooper();
+ final int testShuffleMode = SessionPlayer.SHUFFLE_MODE_GROUP;
+ mController.getTransportControls().setShuffleMode(testShuffleMode);
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+
+ assertTrue(mPlayer.mSetShuffleModeCalled);
+ assertEquals(testShuffleMode, mPlayer.mShuffleMode);
+ }
+
+ @Test
+ public void testSetRepeatMode() throws InterruptedException {
+ prepareLooper();
+ final int testRepeatMode = SessionPlayer.REPEAT_MODE_GROUP;
+ mController.getTransportControls().setRepeatMode(testRepeatMode);
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+
+ assertTrue(mPlayer.mSetRepeatModeCalled);
+ assertEquals(testRepeatMode, mPlayer.mRepeatMode);
+ }
+
+ @Test
+ public void testSetVolumeTo() throws Exception {
+ prepareLooper();
+ final int maxVolume = 100;
+ final int currentVolume = 23;
+ final int volumeControlType = VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE;
+ MockRemotePlayer remotePlayer =
+ new MockRemotePlayer(volumeControlType, maxVolume, currentVolume);
+
+ mSession.updatePlayer(remotePlayer);
+
+ final int targetVolume = 50;
+ mController.setVolumeTo(targetVolume, 0 /* flags */);
+ assertTrue(remotePlayer.mLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ assertTrue(remotePlayer.mSetVolumeToCalled);
+ assertEquals(targetVolume, (int) remotePlayer.mCurrentVolume);
+ }
+
+ @Test
+ public void testAdjustVolume() throws Exception {
+ prepareLooper();
+ final int maxVolume = 100;
+ final int currentVolume = 23;
+ final int volumeControlType = VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE;
+ MockRemotePlayer remotePlayer =
+ new MockRemotePlayer(volumeControlType, maxVolume, currentVolume);
+
+ mSession.updatePlayer(remotePlayer);
+
+ final int direction = AudioManager.ADJUST_RAISE;
+ mController.adjustVolume(direction, 0 /* flags */);
+ assertTrue(remotePlayer.mLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ assertTrue(remotePlayer.mAdjustVolumeCalled);
+ assertEquals(direction, remotePlayer.mDirection);
+ }
+
+ @Test
+ public void testSetVolumeWithLocalVolume() throws Exception {
+ prepareLooper();
+ if (Build.VERSION.SDK_INT >= 21 && mAudioManager.isVolumeFixed()) {
+ // This test is not eligible for this device.
+ return;
+ }
+
+ // Here, we intentionally choose STREAM_ALARM in order not to consider
+ // 'Do Not Disturb' or 'Volume limit'.
+ final int stream = AudioManager.STREAM_ALARM;
+ final int maxVolume = mAudioManager.getStreamMaxVolume(stream);
+ final int minVolume = 1;
+ if (maxVolume <= minVolume) {
+ return;
+ }
+
+ // Set stream of the session.
+ AudioAttributesCompat attrs = new AudioAttributesCompat.Builder()
+ .setLegacyStreamType(stream)
+ .build();
+ mPlayer.setAudioAttributes(attrs);
+ mSession.updatePlayer(mPlayer);
+
+ final int originalVolume = mAudioManager.getStreamVolume(stream);
+ final int targetVolume = originalVolume == minVolume
+ ? originalVolume + 1 : originalVolume - 1;
+
+ mController.setVolumeTo(targetVolume, AudioManager.FLAG_SHOW_UI);
+ new PollingCheck(TIMEOUT_MS) {
+ @Override
+ protected boolean check() {
+ return targetVolume == mAudioManager.getStreamVolume(stream);
+ }
+ }.run();
+
+ // Set back to original volume.
+ mAudioManager.setStreamVolume(stream, originalVolume, 0 /* flags */);
+ }
+
+ @Test
+ public void testAdjustVolumeWithLocalVolume() throws Exception {
+ prepareLooper();
+ if (Build.VERSION.SDK_INT >= 21 && mAudioManager.isVolumeFixed()) {
+ // This test is not eligible for this device.
+ return;
+ }
+
+ // Here, we intentionally choose STREAM_ALARM in order not to consider
+ // 'Do Not Disturb' or 'Volume limit'.
+ final int stream = AudioManager.STREAM_ALARM;
+ final int maxVolume = mAudioManager.getStreamMaxVolume(stream);
+ final int minVolume = 1;
+ if (maxVolume <= minVolume) {
+ return;
+ }
+
+ // Set stream of the session.
+ AudioAttributesCompat attrs = new AudioAttributesCompat.Builder()
+ .setLegacyStreamType(stream)
+ .build();
+ mPlayer.setAudioAttributes(attrs);
+ mSession.updatePlayer(mPlayer);
+
+ final int originalVolume = mAudioManager.getStreamVolume(stream);
+ final int direction = originalVolume == minVolume
+ ? AudioManager.ADJUST_RAISE : AudioManager.ADJUST_LOWER;
+ final int targetVolume = originalVolume + direction;
+
+ mController.adjustVolume(direction, AudioManager.FLAG_SHOW_UI);
+ new PollingCheck(TIMEOUT_MS) {
+ @Override
+ protected boolean check() {
+ return targetVolume == mAudioManager.getStreamVolume(stream);
+ }
+ }.run();
+
+ // Set back to original volume.
+ mAudioManager.setStreamVolume(stream, originalVolume, 0 /* flags */);
+ }
+
+ @Test
+ public void testSendCommand() throws InterruptedException {
+ prepareLooper();
+ // TODO(jaewan): Need to revisit with the permission.
+ final String testCommand = "test_command";
+ final Bundle testArgs = new Bundle();
+ testArgs.putString("args", "test_args");
+
+ final CountDownLatch latch = new CountDownLatch(1);
+ final SessionCallback callback = new SessionCallback() {
+ @Override
+ public SessionCommandGroup onConnect(@NonNull MediaSession session,
+ @NonNull ControllerInfo controller) {
+ SessionCommandGroup commands = super.onConnect(session, controller);
+ commands.addCommand(new SessionCommand(testCommand, null));
+ return commands;
+ }
+
+ @Override
+ public SessionResult onCustomCommand(MediaSession session,
+ ControllerInfo controller, SessionCommand customCommand, Bundle args) {
+ assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
+ assertEquals(testCommand, customCommand.getCustomCommand());
+ assertTrue(TestUtils.equals(testArgs, args));
+ latch.countDown();
+ return new SessionResult(RESULT_SUCCESS, null);
+ }
+ };
+ mSession.close();
+ mSession = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, callback).setId(TAG).build();
+ final RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, mSession.getSessionCompat().getSessionToken(), true);
+ controller.sendCommand(testCommand, testArgs, null);
+ assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ }
+
+ @Test
+ public void testControllerCallback_sessionRejects() throws Exception {
+ prepareLooper();
+ final SessionCallback sessionCallback = new SessionCallback() {
+ @Override
+ public SessionCommandGroup onConnect(MediaSession session,
+ ControllerInfo controller) {
+ return null;
+ }
+ };
+ sHandler.postAndSync(new Runnable() {
+ @Override
+ public void run() {
+ mSession.close();
+ mSession = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, sessionCallback).build();
+ }
+ });
+
+ // Session will not accept the controller's commands.
+ RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, mSession.getSessionCompat().getSessionToken(), true);
+ controller.getTransportControls().play();
+ assertFalse(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ }
+
+ @Test
+ public void testFastForward() throws InterruptedException {
+ prepareLooper();
+ final CountDownLatch latch = new CountDownLatch(1);
+ final SessionCallback callback = new SessionCallback() {
+ @Override
+ public int onFastForward(MediaSession session, ControllerInfo controller) {
+ assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
+ latch.countDown();
+ return RESULT_SUCCESS;
+ }
+ };
+ try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, callback)
+ .setId("testFastForward").build()) {
+ RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, session.getSessionCompat().getSessionToken(), true);
+ controller.getTransportControls().fastForward();
+ assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ }
+ }
+
+ @Test
+ public void testRewind() throws InterruptedException {
+ prepareLooper();
+ final CountDownLatch latch = new CountDownLatch(1);
+ final SessionCallback callback = new SessionCallback() {
+ @Override
+ public int onRewind(MediaSession session, ControllerInfo controller) {
+ assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
+ latch.countDown();
+ return RESULT_SUCCESS;
+ }
+ };
+ try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, callback)
+ .setId("testRewind").build()) {
+ RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, session.getSessionCompat().getSessionToken(), true);
+ controller.getTransportControls().rewind();
+ assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ }
+ }
+
+ @Test
+ public void testPlayFromSearch() throws InterruptedException {
+ prepareLooper();
+ final String request = "random query";
+ final Bundle bundle = new Bundle();
+ bundle.putString("key", "value");
+ final CountDownLatch latch = new CountDownLatch(1);
+ final SessionCallback callback = new SessionCallback() {
+ @Override
+ public int onPlayFromSearch(MediaSession session, ControllerInfo controller,
+ String query, Bundle extras) {
+ super.onPlayFromSearch(session, controller, query, extras);
+ assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
+ assertEquals(request, query);
+ assertTrue(TestUtils.equals(bundle, extras));
+ latch.countDown();
+ return RESULT_SUCCESS;
+ }
+ };
+ try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, callback)
+ .setId("testPlayFromSearch").build()) {
+ RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, session.getSessionCompat().getSessionToken(), true);
+ controller.getTransportControls().playFromSearch(request, bundle);
+ assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ }
+ }
+
+ @Test
+ public void testPlayFromUri() throws InterruptedException {
+ prepareLooper();
+ final Uri request = Uri.parse("foo://boo");
+ final Bundle bundle = new Bundle();
+ bundle.putString("key", "value");
+ final CountDownLatch latch = new CountDownLatch(1);
+ final SessionCallback callback = new SessionCallback() {
+ @Override
+ public int onPlayFromUri(MediaSession session, ControllerInfo controller, Uri uri,
+ Bundle extras) {
+ assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
+ assertEquals(request, uri);
+ assertTrue(TestUtils.equals(bundle, extras));
+ latch.countDown();
+ return RESULT_SUCCESS;
+ }
+ };
+ try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, callback)
+ .setId("testPlayFromUri").build()) {
+ RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, session.getSessionCompat().getSessionToken(), true);
+ controller.getTransportControls().playFromUri(request, bundle);
+ assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ }
+ }
+
+ @Test
+ public void testPlayFromMediaId() throws InterruptedException {
+ prepareLooper();
+ final String request = "media_id";
+ final Bundle bundle = new Bundle();
+ bundle.putString("key", "value");
+ final CountDownLatch latch = new CountDownLatch(1);
+ final SessionCallback callback = new SessionCallback() {
+ @Override
+ public int onPlayFromMediaId(MediaSession session, ControllerInfo controller,
+ String mediaId, Bundle extras) {
+ assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
+ assertEquals(request, mediaId);
+ assertTrue(TestUtils.equals(bundle, extras));
+ latch.countDown();
+ return RESULT_SUCCESS;
+ }
+ };
+ try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, callback)
+ .setId("testPlayFromMediaId").build()) {
+ RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, session.getSessionCompat().getSessionToken(), true);
+ controller.getTransportControls().playFromMediaId(request, bundle);
+ assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ }
+ }
+
+ @Test
+ public void testPrepareFromSearch() throws InterruptedException {
+ prepareLooper();
+ final String request = "random query";
+ final Bundle bundle = new Bundle();
+ bundle.putString("key", "value");
+ final CountDownLatch latch = new CountDownLatch(1);
+ final SessionCallback callback = new SessionCallback() {
+ @Override
+ public int onPrepareFromSearch(MediaSession session, ControllerInfo controller,
+ String query, Bundle extras) {
+ assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
+ assertEquals(request, query);
+ assertTrue(TestUtils.equals(bundle, extras));
+ latch.countDown();
+ return RESULT_SUCCESS;
+ }
+ };
+ try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, callback)
+ .setId("testPrepareFromSearch").build()) {
+ RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, session.getSessionCompat().getSessionToken(), true);
+ controller.getTransportControls().prepareFromSearch(request, bundle);
+ assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ }
+ }
+
+ @Test
+ public void testPrepareFromUri() throws InterruptedException {
+ prepareLooper();
+ final Uri request = Uri.parse("foo://boo");
+ final Bundle bundle = new Bundle();
+ bundle.putString("key", "value");
+ final CountDownLatch latch = new CountDownLatch(1);
+ final SessionCallback callback = new SessionCallback() {
+ @Override
+ public int onPrepareFromUri(MediaSession session, ControllerInfo controller, Uri uri,
+ Bundle extras) {
+ assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
+ assertEquals(request, uri);
+ assertTrue(TestUtils.equals(bundle, extras));
+ latch.countDown();
+ return RESULT_SUCCESS;
+ }
+ };
+ try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, callback)
+ .setId("testPrepareFromUri").build()) {
+ RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, session.getSessionCompat().getSessionToken(), true);
+ controller.getTransportControls().prepareFromUri(request, bundle);
+ assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ }
+ }
+
+ @Test
+ public void testPrepareFromMediaId() throws InterruptedException {
+ prepareLooper();
+ final String request = "media_id";
+ final Bundle bundle = new Bundle();
+ bundle.putString("key", "value");
+ final CountDownLatch latch = new CountDownLatch(1);
+ final SessionCallback callback = new SessionCallback() {
+ @Override
+ public int onPrepareFromMediaId(MediaSession session, ControllerInfo controller,
+ String mediaId, Bundle extras) {
+ assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
+ assertEquals(request, mediaId);
+ assertTrue(TestUtils.equals(bundle, extras));
+ latch.countDown();
+ return RESULT_SUCCESS;
+ }
+ };
+ try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, callback)
+ .setId("testPrepareFromMediaId").build()) {
+ RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, session.getSessionCompat().getSessionToken(), true);
+ controller.getTransportControls().prepareFromMediaId(request, bundle);
+ assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ }
+ }
+
+ @Test
+ public void testSetRating() throws InterruptedException {
+ prepareLooper();
+ final int ratingType = RatingCompat.RATING_5_STARS;
+ final float ratingValue = 3.5f;
+ final RatingCompat rating = RatingCompat.newStarRating(ratingType, ratingValue);
+ final String mediaId = "media_id";
+
+ final CountDownLatch latch = new CountDownLatch(1);
+ final SessionCallback callback = new SessionCallback() {
+ @Override
+ public int onSetRating(MediaSession session, ControllerInfo controller,
+ String mediaIdOut, Rating ratingOut) {
+ assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controller.getPackageName());
+ assertEquals(mediaId, mediaIdOut);
+ assertEquals(MediaUtils.convertToRating(rating), ratingOut);
+ latch.countDown();
+ return RESULT_SUCCESS;
+ }
+ };
+
+ mPlayer.mCurrentMediaItem = MediaTestUtils.createMediaItem(mediaId);
+ try (MediaSession session = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, callback)
+ .setId("testSetRating").build()) {
+ RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, session.getSessionCompat().getSessionToken(), true);
+ controller.getTransportControls().setRating(rating);
+ assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ }
+ }
+
+ @Test
+ public void testOnCommandCallback() throws InterruptedException {
+ prepareLooper();
+ final ArrayList<SessionCommand> commands = new ArrayList<>();
+ final CountDownLatch latchForPause = new CountDownLatch(1);
+ final SessionCallback callback = new SessionCallback() {
+ @Override
+ public int onCommandRequest(MediaSession session, ControllerInfo controllerInfo,
+ SessionCommand command) {
+ assertEquals(EXPECTED_CONTROLLER_PACKAGE_NAME, controllerInfo.getPackageName());
+ assertFalse(controllerInfo.isTrusted());
+ commands.add(command);
+ if (command.getCommandCode() == SessionCommand.COMMAND_CODE_PLAYER_PAUSE) {
+ latchForPause.countDown();
+ return RESULT_ERROR_INVALID_STATE;
+ }
+ return RESULT_SUCCESS;
+ }
+ };
+
+ sHandler.postAndSync(new Runnable() {
+ @Override
+ public void run() {
+ mSession.close();
+ mPlayer = new MockPlayer(1);
+ mSession = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, callback).build();
+ }
+ });
+ RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, mSession.getSessionCompat().getSessionToken(), true);
+
+ controller.getTransportControls().pause();
+ assertTrue(latchForPause.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ assertFalse(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ assertFalse(mPlayer.mPauseCalled);
+ assertEquals(1, commands.size());
+ assertEquals(SessionCommand.COMMAND_CODE_PLAYER_PAUSE,
+ (long) commands.get(0).getCommandCode());
+
+ controller.getTransportControls().play();
+ assertTrue(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ assertTrue(mPlayer.mPlayCalled);
+ assertFalse(mPlayer.mPauseCalled);
+ assertEquals(2, commands.size());
+ assertEquals(SessionCommand.COMMAND_CODE_PLAYER_PLAY,
+ (long) commands.get(1).getCommandCode());
+ }
+
+ /**
+ * Test potential deadlock for calls between controller and session.
+ */
+ @Test
+ @LargeTest
+ public void testDeadlock() throws InterruptedException {
+ prepareLooper();
+ sHandler.postAndSync(new Runnable() {
+ @Override
+ public void run() {
+ mSession.close();
+ mSession = null;
+ }
+ });
+
+ // Two more threads are needed not to block test thread nor test wide thread (sHandler).
+ final HandlerThread sessionThread = new HandlerThread("testDeadlock_session");
+ final HandlerThread testThread = new HandlerThread("testDeadlock_test");
+ sessionThread.start();
+ testThread.start();
+ final SyncHandler sessionHandler = new SyncHandler(sessionThread.getLooper());
+ final Handler testHandler = new Handler(testThread.getLooper());
+ final CountDownLatch latch = new CountDownLatch(1);
+ try {
+ final MockPlayer player = new MockPlayer(0);
+ sessionHandler.postAndSync(new Runnable() {
+ @Override
+ public void run() {
+ mSession = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, new SessionCallback() {})
+ .setId("testDeadlock").build();
+ }
+ });
+ final RemoteMediaControllerCompat controller = new RemoteMediaControllerCompat(
+ mContext, mSession.getSessionCompat().getSessionToken(), true);
+ testHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ final int state = SessionPlayer.PLAYER_STATE_ERROR;
+ for (int i = 0; i < 100; i++) {
+ // triggers call from session to controller.
+ player.notifyPlayerStateChanged(state);
+ // triggers call from controller to session.
+ controller.getTransportControls().play();
+
+ // Repeat above
+ player.notifyPlayerStateChanged(state);
+ controller.getTransportControls().pause();
+ player.notifyPlayerStateChanged(state);
+ controller.getTransportControls().stop();
+ player.notifyPlayerStateChanged(state);
+ controller.getTransportControls().skipToNext();
+ player.notifyPlayerStateChanged(state);
+ controller.getTransportControls().skipToPrevious();
+ }
+ // This may hang if deadlock happens.
+ latch.countDown();
+ }
+ });
+ assertTrue(latch.await(3, TimeUnit.SECONDS));
+ } finally {
+ if (mSession != null) {
+ sessionHandler.postAndSync(new Runnable() {
+ @Override
+ public void run() {
+ // Clean up here because sessionHandler will be removed afterwards.
+ mSession.close();
+ mSession = null;
+ }
+ });
+ }
+
+ if (Build.VERSION.SDK_INT >= 18) {
+ sessionThread.quitSafely();
+ testThread.quitSafely();
+ } else {
+ sessionThread.quit();
+ testThread.quit();
+ }
+ }
+ }
+
+ @Test
+ @LargeTest
+ public void testControllerAfterSessionIsGone() throws InterruptedException {
+ prepareLooper();
+ mSession.close();
+ testSessionCallbackIsNotCalled();
+
+ // Ensure that the controller cannot use newly create session with the same ID.
+ // Recreated session has different session stub, so previously created controller
+ // shouldn't be available.
+ mSession = new MediaSession.Builder(mContext, mPlayer)
+ .setSessionCallback(sHandlerExecutor, new SessionCallback() {})
+ .setId(TAG)
+ .build();
+ testSessionCallbackIsNotCalled();
+ }
+
+ void testSessionCallbackIsNotCalled() throws InterruptedException {
+ mController.getTransportControls().play();
+ assertFalse(mPlayer.mCountDownLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS));
+ }
+}
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionServiceNotificationTest.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionServiceNotificationTest.java
index deebd40..a5bccf9 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionServiceNotificationTest.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionServiceNotificationTest.java
@@ -62,6 +62,7 @@
*/
@LargeTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
+@Ignore("Comment out this line and manually run the test.")
public class MediaSessionServiceNotificationTest extends MediaSessionTestBase {
private static final long NOTIFICATION_SHOW_TIME_MS = 15000;
@@ -81,7 +82,6 @@
}
@Test
- @Ignore("Comment out this line and manually run the test.")
public void testNotification() throws InterruptedException {
prepareLooper();
final CountDownLatch latch = new CountDownLatch(1);
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionServiceTest.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionServiceTest.java
index 4335ab9..eb7d558 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionServiceTest.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionServiceTest.java
@@ -30,7 +30,7 @@
import androidx.media2.test.service.MockPlayer;
import androidx.media2.test.service.RemoteMediaController;
import androidx.media2.test.service.TestServiceRegistry;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -44,7 +44,7 @@
/**
* Tests {@link MediaSessionService}.
*/
-@MediumTest
+@SmallTest
public class MediaSessionServiceTest extends MediaSessionTestBase {
private SessionToken mToken;
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionTest.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionTest.java
index 9afb460..d381c309 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionTest.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSessionTest.java
@@ -40,6 +40,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -55,7 +56,7 @@
*/
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class MediaSessionTest extends MediaSessionTestBase {
private static final String TAG = "MediaSessionTest";
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSession_KeyEventTest.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSession_KeyEventTest.java
index d632960..ca4ed2c 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSession_KeyEventTest.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSession_KeyEventTest.java
@@ -37,8 +37,8 @@
import androidx.media2.test.service.MockPlayer;
import androidx.media2.test.service.R;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -53,9 +53,9 @@
* In order to get the media key events, the player state is set to 'Playing' before every test
* method.
*/
-@SdkSuppress(minSdkVersion = Build.VERSION_CODES.KITKAT)
+@SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP)
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class MediaSession_KeyEventTest extends MediaSessionTestBase {
private static String sExpectedControllerPackageName;
@@ -65,7 +65,7 @@
private TestSessionCallback mSessionCallback;
static {
- if (Build.VERSION.SDK_INT >= 28 || Build.VERSION.SDK_INT < 21) {
+ if (Build.VERSION.SDK_INT >= 28) {
sExpectedControllerPackageName = SERVICE_PACKAGE_NAME;
} else if (Build.VERSION.SDK_INT >= 24) {
// KeyEvent from system service has the package name "android".
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSession_PermissionTest.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSession_PermissionTest.java
index de06b70..b7376b8 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSession_PermissionTest.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/MediaSession_PermissionTest.java
@@ -68,7 +68,7 @@
import androidx.media2.test.service.MockPlayer;
import androidx.media2.test.service.RemoteMediaController;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
import org.junit.After;
@@ -85,7 +85,7 @@
*/
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@MediumTest
public class MediaSession_PermissionTest extends MediaSessionTestBase {
private static final String SESSION_ID = "MediaSessionTest_permission";
diff --git a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/SessionPlayerTest.java b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/SessionPlayerTest.java
index 6b1a627..6a83159 100644
--- a/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/SessionPlayerTest.java
+++ b/media2/version-compat-tests/current/service/src/androidTest/java/androidx/media2/test/service/tests/SessionPlayerTest.java
@@ -40,6 +40,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -55,7 +56,7 @@
*/
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class SessionPlayerTest extends MediaSessionTestBase {
MediaSession mSession;
diff --git a/media2/version-compat-tests/current/service/src/androidTest/res/raw/midi8sec.mid b/media2/version-compat-tests/current/service/src/androidTest/res/raw/midi8sec.mid
deleted file mode 100644
index 746aca1..0000000
--- a/media2/version-compat-tests/current/service/src/androidTest/res/raw/midi8sec.mid
+++ /dev/null
Binary files differ
diff --git a/mediarouter/OWNERS b/mediarouter/OWNERS
index 526fcca..e67af3b 100644
--- a/mediarouter/OWNERS
+++ b/mediarouter/OWNERS
@@ -1,7 +1,3 @@
-gyumin@google.com
-hdmoon@google.com
-insun@google.com
+akersten@google.com
jaewan@google.com
-jinpark@google.com
-klhyun@google.com
sungsoo@google.com
diff --git a/mediarouter/api/1.1.0-alpha01.txt b/mediarouter/api/1.1.0-alpha01.txt
index c5be66c..4a73f6a 100644
--- a/mediarouter/api/1.1.0-alpha01.txt
+++ b/mediarouter/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.mediarouter.app {
public class MediaRouteActionProvider extends androidx.core.view.ActionProvider {
diff --git a/mediarouter/api/1.1.0-alpha02.txt b/mediarouter/api/1.1.0-alpha02.txt
deleted file mode 100644
index f0c7243..0000000
--- a/mediarouter/api/1.1.0-alpha02.txt
+++ /dev/null
@@ -1,522 +0,0 @@
-// Signature format: 3.0
-package androidx.mediarouter.app {
-
- public class MediaRouteActionProvider extends androidx.core.view.ActionProvider {
- ctor public MediaRouteActionProvider(android.content.Context!);
- method public void enableDynamicGroup();
- method public androidx.mediarouter.app.MediaRouteDialogFactory getDialogFactory();
- method public androidx.mediarouter.app.MediaRouteButton? getMediaRouteButton();
- method public androidx.mediarouter.media.MediaRouteSelector getRouteSelector();
- method public android.view.View! onCreateActionView();
- method public androidx.mediarouter.app.MediaRouteButton! onCreateMediaRouteButton();
- method public void setAlwaysVisible(boolean);
- method public void setDialogFactory(androidx.mediarouter.app.MediaRouteDialogFactory);
- method public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector);
- }
-
- public class MediaRouteButton extends android.view.View {
- ctor public MediaRouteButton(android.content.Context!);
- ctor public MediaRouteButton(android.content.Context!, android.util.AttributeSet!);
- ctor public MediaRouteButton(android.content.Context!, android.util.AttributeSet!, int);
- method public void enableDynamicGroup();
- method public androidx.mediarouter.app.MediaRouteDialogFactory getDialogFactory();
- method public androidx.mediarouter.media.MediaRouteSelector getRouteSelector();
- method public void onAttachedToWindow();
- method public void onDetachedFromWindow();
- method public void setAlwaysVisible(boolean);
- method public void setDialogFactory(androidx.mediarouter.app.MediaRouteDialogFactory);
- method public void setRemoteIndicatorDrawable(android.graphics.drawable.Drawable!);
- method public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector!);
- method public boolean showDialog();
- }
-
- public class MediaRouteChooserDialog extends androidx.appcompat.app.AppCompatDialog {
- ctor public MediaRouteChooserDialog(android.content.Context!);
- ctor public MediaRouteChooserDialog(android.content.Context!, int);
- method public androidx.mediarouter.media.MediaRouteSelector getRouteSelector();
- method public boolean onFilterRoute(androidx.mediarouter.media.MediaRouter.RouteInfo);
- method public void onFilterRoutes(java.util.List<androidx.mediarouter.media.MediaRouter.RouteInfo>);
- method public void refreshRoutes();
- method public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector);
- }
-
- public class MediaRouteChooserDialogFragment extends androidx.fragment.app.DialogFragment {
- ctor public MediaRouteChooserDialogFragment();
- method public androidx.mediarouter.media.MediaRouteSelector! getRouteSelector();
- method public androidx.mediarouter.app.MediaRouteChooserDialog! onCreateChooserDialog(android.content.Context!, android.os.Bundle!);
- method public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector!);
- }
-
- public class MediaRouteControllerDialog extends androidx.appcompat.app.AlertDialog {
- ctor public MediaRouteControllerDialog(android.content.Context!);
- ctor public MediaRouteControllerDialog(android.content.Context!, int);
- method public android.view.View! getMediaControlView();
- method public android.support.v4.media.session.MediaSessionCompat.Token! getMediaSession();
- method public androidx.mediarouter.media.MediaRouter.RouteInfo! getRoute();
- method public boolean isVolumeControlEnabled();
- method public android.view.View! onCreateMediaControlView(android.os.Bundle!);
- method public void setVolumeControlEnabled(boolean);
- }
-
- public class MediaRouteControllerDialogFragment extends androidx.fragment.app.DialogFragment {
- ctor public MediaRouteControllerDialogFragment();
- method public androidx.mediarouter.app.MediaRouteControllerDialog! onCreateControllerDialog(android.content.Context!, android.os.Bundle!);
- }
-
- public class MediaRouteDialogFactory {
- ctor public MediaRouteDialogFactory();
- method public static androidx.mediarouter.app.MediaRouteDialogFactory getDefault();
- method public androidx.mediarouter.app.MediaRouteChooserDialogFragment onCreateChooserDialogFragment();
- method public androidx.mediarouter.app.MediaRouteControllerDialogFragment onCreateControllerDialogFragment();
- }
-
- public class MediaRouteDiscoveryFragment extends androidx.fragment.app.Fragment {
- ctor public MediaRouteDiscoveryFragment();
- method public androidx.mediarouter.media.MediaRouter! getMediaRouter();
- method public androidx.mediarouter.media.MediaRouteSelector! getRouteSelector();
- method public androidx.mediarouter.media.MediaRouter.Callback! onCreateCallback();
- method public int onPrepareCallbackFlags();
- method public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector!);
- }
-
-}
-
-package androidx.mediarouter.media {
-
- public final class MediaControlIntent {
- field public static final String ACTION_END_SESSION = "android.media.intent.action.END_SESSION";
- field public static final String ACTION_ENQUEUE = "android.media.intent.action.ENQUEUE";
- field public static final String ACTION_GET_SESSION_STATUS = "android.media.intent.action.GET_SESSION_STATUS";
- field public static final String ACTION_GET_STATUS = "android.media.intent.action.GET_STATUS";
- field public static final String ACTION_PAUSE = "android.media.intent.action.PAUSE";
- field public static final String ACTION_PLAY = "android.media.intent.action.PLAY";
- field public static final String ACTION_REMOVE = "android.media.intent.action.REMOVE";
- field public static final String ACTION_RESUME = "android.media.intent.action.RESUME";
- field public static final String ACTION_SEEK = "android.media.intent.action.SEEK";
- field public static final String ACTION_SEND_MESSAGE = "android.media.intent.action.SEND_MESSAGE";
- field public static final String ACTION_START_SESSION = "android.media.intent.action.START_SESSION";
- field public static final String ACTION_STOP = "android.media.intent.action.STOP";
- field public static final String CATEGORY_LIVE_AUDIO = "android.media.intent.category.LIVE_AUDIO";
- field public static final String CATEGORY_LIVE_VIDEO = "android.media.intent.category.LIVE_VIDEO";
- field public static final String CATEGORY_REMOTE_PLAYBACK = "android.media.intent.category.REMOTE_PLAYBACK";
- field public static final int ERROR_INVALID_ITEM_ID = 3; // 0x3
- field public static final int ERROR_INVALID_SESSION_ID = 2; // 0x2
- field public static final int ERROR_UNKNOWN = 0; // 0x0
- field public static final int ERROR_UNSUPPORTED_OPERATION = 1; // 0x1
- field public static final String EXTRA_ERROR_CODE = "android.media.intent.extra.ERROR_CODE";
- field public static final String EXTRA_ITEM_CONTENT_POSITION = "android.media.intent.extra.ITEM_POSITION";
- field public static final String EXTRA_ITEM_HTTP_HEADERS = "android.media.intent.extra.HTTP_HEADERS";
- field public static final String EXTRA_ITEM_ID = "android.media.intent.extra.ITEM_ID";
- field public static final String EXTRA_ITEM_METADATA = "android.media.intent.extra.ITEM_METADATA";
- field public static final String EXTRA_ITEM_STATUS = "android.media.intent.extra.ITEM_STATUS";
- field public static final String EXTRA_ITEM_STATUS_UPDATE_RECEIVER = "android.media.intent.extra.ITEM_STATUS_UPDATE_RECEIVER";
- field public static final String EXTRA_MESSAGE = "android.media.intent.extra.MESSAGE";
- field public static final String EXTRA_MESSAGE_RECEIVER = "android.media.intent.extra.MESSAGE_RECEIVER";
- field public static final String EXTRA_SESSION_ID = "android.media.intent.extra.SESSION_ID";
- field public static final String EXTRA_SESSION_STATUS = "android.media.intent.extra.SESSION_STATUS";
- field public static final String EXTRA_SESSION_STATUS_UPDATE_RECEIVER = "android.media.intent.extra.SESSION_STATUS_UPDATE_RECEIVER";
- }
-
- public final class MediaItemMetadata {
- field public static final String KEY_ALBUM_ARTIST = "android.media.metadata.ALBUM_ARTIST";
- field public static final String KEY_ALBUM_TITLE = "android.media.metadata.ALBUM_TITLE";
- field public static final String KEY_ARTIST = "android.media.metadata.ARTIST";
- field public static final String KEY_ARTWORK_URI = "android.media.metadata.ARTWORK_URI";
- field public static final String KEY_AUTHOR = "android.media.metadata.AUTHOR";
- field public static final String KEY_COMPOSER = "android.media.metadata.COMPOSER";
- field public static final String KEY_DISC_NUMBER = "android.media.metadata.DISC_NUMBER";
- field public static final String KEY_DURATION = "android.media.metadata.DURATION";
- field public static final String KEY_TITLE = "android.media.metadata.TITLE";
- field public static final String KEY_TRACK_NUMBER = "android.media.metadata.TRACK_NUMBER";
- field public static final String KEY_YEAR = "android.media.metadata.YEAR";
- }
-
- public final class MediaItemStatus {
- method public android.os.Bundle! asBundle();
- method public static androidx.mediarouter.media.MediaItemStatus! fromBundle(android.os.Bundle!);
- method public long getContentDuration();
- method public long getContentPosition();
- method public android.os.Bundle! getExtras();
- method public int getPlaybackState();
- method public long getTimestamp();
- field public static final String EXTRA_HTTP_RESPONSE_HEADERS = "android.media.status.extra.HTTP_RESPONSE_HEADERS";
- field public static final String EXTRA_HTTP_STATUS_CODE = "android.media.status.extra.HTTP_STATUS_CODE";
- field public static final int PLAYBACK_STATE_BUFFERING = 3; // 0x3
- field public static final int PLAYBACK_STATE_CANCELED = 5; // 0x5
- field public static final int PLAYBACK_STATE_ERROR = 7; // 0x7
- field public static final int PLAYBACK_STATE_FINISHED = 4; // 0x4
- field public static final int PLAYBACK_STATE_INVALIDATED = 6; // 0x6
- field public static final int PLAYBACK_STATE_PAUSED = 2; // 0x2
- field public static final int PLAYBACK_STATE_PENDING = 0; // 0x0
- field public static final int PLAYBACK_STATE_PLAYING = 1; // 0x1
- }
-
- public static final class MediaItemStatus.Builder {
- ctor public MediaItemStatus.Builder(int);
- ctor public MediaItemStatus.Builder(androidx.mediarouter.media.MediaItemStatus!);
- method public androidx.mediarouter.media.MediaItemStatus! build();
- method public androidx.mediarouter.media.MediaItemStatus.Builder! setContentDuration(long);
- method public androidx.mediarouter.media.MediaItemStatus.Builder! setContentPosition(long);
- method public androidx.mediarouter.media.MediaItemStatus.Builder! setExtras(android.os.Bundle!);
- method public androidx.mediarouter.media.MediaItemStatus.Builder! setPlaybackState(int);
- method public androidx.mediarouter.media.MediaItemStatus.Builder! setTimestamp(long);
- }
-
- public final class MediaRouteDescriptor {
- method public android.os.Bundle! asBundle();
- method public boolean canDisconnectAndKeepPlaying();
- method public static androidx.mediarouter.media.MediaRouteDescriptor! fromBundle(android.os.Bundle!);
- method public int getConnectionState();
- method public java.util.List<android.content.IntentFilter>! getControlFilters();
- method public String! getDescription();
- method public int getDeviceType();
- method public android.os.Bundle! getExtras();
- method public android.net.Uri! getIconUri();
- method public String! getId();
- method public String! getName();
- method public int getPlaybackStream();
- method public int getPlaybackType();
- method public int getPresentationDisplayId();
- method public android.content.IntentSender! getSettingsActivity();
- method public int getVolume();
- method public int getVolumeHandling();
- method public int getVolumeMax();
- method @Deprecated public boolean isConnecting();
- method public boolean isDynamicGroupRoute();
- method public boolean isEnabled();
- method public boolean isValid();
- }
-
- public static final class MediaRouteDescriptor.Builder {
- ctor public MediaRouteDescriptor.Builder(String!, String!);
- ctor public MediaRouteDescriptor.Builder(androidx.mediarouter.media.MediaRouteDescriptor!);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! addControlFilter(android.content.IntentFilter!);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! addControlFilters(java.util.Collection<android.content.IntentFilter>!);
- method public androidx.mediarouter.media.MediaRouteDescriptor! build();
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setCanDisconnect(boolean);
- method @Deprecated public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setConnecting(boolean);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setConnectionState(int);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setDescription(String!);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setDeviceType(int);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setEnabled(boolean);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setExtras(android.os.Bundle!);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setIconUri(android.net.Uri!);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setId(String!);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setIsDynamicGroupRoute(boolean);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setName(String!);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setPlaybackStream(int);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setPlaybackType(int);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setPresentationDisplayId(int);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setSettingsActivity(android.content.IntentSender!);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setVolume(int);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setVolumeHandling(int);
- method public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setVolumeMax(int);
- }
-
- public final class MediaRouteDiscoveryRequest {
- ctor public MediaRouteDiscoveryRequest(androidx.mediarouter.media.MediaRouteSelector!, boolean);
- method public android.os.Bundle! asBundle();
- method public static androidx.mediarouter.media.MediaRouteDiscoveryRequest! fromBundle(android.os.Bundle!);
- method public androidx.mediarouter.media.MediaRouteSelector! getSelector();
- method public boolean isActiveScan();
- method public boolean isValid();
- }
-
- public abstract class MediaRouteProvider {
- ctor public MediaRouteProvider(android.content.Context);
- method public final android.content.Context! getContext();
- method public final androidx.mediarouter.media.MediaRouteProviderDescriptor? getDescriptor();
- method public final androidx.mediarouter.media.MediaRouteDiscoveryRequest? getDiscoveryRequest();
- method public final android.os.Handler! getHandler();
- method public final androidx.mediarouter.media.MediaRouteProvider.ProviderMetadata! getMetadata();
- method public androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController? onCreateDynamicGroupRouteController(String);
- method public androidx.mediarouter.media.MediaRouteProvider.RouteController? onCreateRouteController(String);
- method public void onDiscoveryRequestChanged(androidx.mediarouter.media.MediaRouteDiscoveryRequest?);
- method public final void setCallback(androidx.mediarouter.media.MediaRouteProvider.Callback?);
- method public final void setDescriptor(androidx.mediarouter.media.MediaRouteProviderDescriptor?);
- method public final void setDiscoveryRequest(androidx.mediarouter.media.MediaRouteDiscoveryRequest!);
- }
-
- public abstract static class MediaRouteProvider.Callback {
- ctor public MediaRouteProvider.Callback();
- method public void onDescriptorChanged(androidx.mediarouter.media.MediaRouteProvider, androidx.mediarouter.media.MediaRouteProviderDescriptor?);
- }
-
- public abstract static class MediaRouteProvider.DynamicGroupRouteController extends androidx.mediarouter.media.MediaRouteProvider.RouteController {
- ctor public MediaRouteProvider.DynamicGroupRouteController();
- method public String? getGroupableSelectionTitle();
- method public String? getTransferableSectionTitle();
- method public abstract void onAddMemberRoute(String);
- method public abstract void onRemoveMemberRoute(String!);
- method public abstract void onUpdateMemberRoutes(java.util.List<java.lang.String>?);
- method public abstract void setOnDynamicRoutesChangedListener(java.util.concurrent.Executor, androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.OnDynamicRoutesChangedListener);
- }
-
- public static final class MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor {
- method public androidx.mediarouter.media.MediaRouteDescriptor getRouteDescriptor();
- method public int getSelectionState();
- method public boolean isGroupable();
- method public boolean isTransferable();
- method public boolean isUnselectable();
- field public static final int SELECTED = 3; // 0x3
- field public static final int SELECTING = 2; // 0x2
- field public static final int UNSELECTED = 1; // 0x1
- field public static final int UNSELECTING = 0; // 0x0
- }
-
- public static final class MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.Builder {
- ctor public MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.Builder(androidx.mediarouter.media.MediaRouteDescriptor!);
- ctor public MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.Builder(androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor!);
- method public androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor! build();
- method public androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.Builder! setIsGroupable(boolean);
- method public androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.Builder! setIsTransferable(boolean);
- method public androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.Builder! setIsUnselectable(boolean);
- method public androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.Builder! setSelectionState(int);
- }
-
- public static interface MediaRouteProvider.DynamicGroupRouteController.OnDynamicRoutesChangedListener {
- method public void onRoutesChanged(androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController!, java.util.Collection<androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor>!);
- }
-
- public static final class MediaRouteProvider.ProviderMetadata {
- method public android.content.ComponentName! getComponentName();
- method public String! getPackageName();
- }
-
- public abstract static class MediaRouteProvider.RouteController {
- ctor public MediaRouteProvider.RouteController();
- method public boolean onControlRequest(android.content.Intent!, androidx.mediarouter.media.MediaRouter.ControlRequestCallback?);
- method public void onRelease();
- method public void onSelect();
- method public void onSetVolume(int);
- method public void onUnselect();
- method public void onUnselect(int);
- method public void onUpdateVolume(int);
- }
-
- public final class MediaRouteProviderDescriptor {
- method public android.os.Bundle! asBundle();
- method public static androidx.mediarouter.media.MediaRouteProviderDescriptor! fromBundle(android.os.Bundle!);
- method public java.util.List<androidx.mediarouter.media.MediaRouteDescriptor> getRoutes();
- method public boolean isValid();
- method public boolean supportsDynamicGroupRoute();
- }
-
- public static final class MediaRouteProviderDescriptor.Builder {
- ctor public MediaRouteProviderDescriptor.Builder();
- ctor public MediaRouteProviderDescriptor.Builder(androidx.mediarouter.media.MediaRouteProviderDescriptor!);
- method public androidx.mediarouter.media.MediaRouteProviderDescriptor.Builder! addRoute(androidx.mediarouter.media.MediaRouteDescriptor!);
- method public androidx.mediarouter.media.MediaRouteProviderDescriptor.Builder! addRoutes(java.util.Collection<androidx.mediarouter.media.MediaRouteDescriptor>!);
- method public androidx.mediarouter.media.MediaRouteProviderDescriptor! build();
- method public androidx.mediarouter.media.MediaRouteProviderDescriptor.Builder! setSupportsDynamicGroupRoute(boolean);
- }
-
- public abstract class MediaRouteProviderService extends android.app.Service {
- ctor public MediaRouteProviderService();
- method public androidx.mediarouter.media.MediaRouteProvider! getMediaRouteProvider();
- method public android.os.IBinder! onBind(android.content.Intent!);
- method public abstract androidx.mediarouter.media.MediaRouteProvider! onCreateMediaRouteProvider();
- field public static final String SERVICE_INTERFACE = "android.media.MediaRouteProviderService";
- }
-
- public final class MediaRouteSelector {
- method public android.os.Bundle! asBundle();
- method public boolean contains(androidx.mediarouter.media.MediaRouteSelector!);
- method public static androidx.mediarouter.media.MediaRouteSelector! fromBundle(android.os.Bundle?);
- method public java.util.List<java.lang.String>! getControlCategories();
- method public boolean hasControlCategory(String!);
- method public boolean isEmpty();
- method public boolean isValid();
- method public boolean matchesControlFilters(java.util.List<android.content.IntentFilter>!);
- field public static final androidx.mediarouter.media.MediaRouteSelector! EMPTY;
- }
-
- public static final class MediaRouteSelector.Builder {
- ctor public MediaRouteSelector.Builder();
- ctor public MediaRouteSelector.Builder(androidx.mediarouter.media.MediaRouteSelector);
- method public androidx.mediarouter.media.MediaRouteSelector.Builder addControlCategories(java.util.Collection<java.lang.String>);
- method public androidx.mediarouter.media.MediaRouteSelector.Builder addControlCategory(String);
- method public androidx.mediarouter.media.MediaRouteSelector.Builder addSelector(androidx.mediarouter.media.MediaRouteSelector);
- method public androidx.mediarouter.media.MediaRouteSelector build();
- }
-
- public final class MediaRouter {
- method public void addCallback(androidx.mediarouter.media.MediaRouteSelector!, androidx.mediarouter.media.MediaRouter.Callback!);
- method public void addCallback(androidx.mediarouter.media.MediaRouteSelector, androidx.mediarouter.media.MediaRouter.Callback, int);
- method public void addProvider(androidx.mediarouter.media.MediaRouteProvider);
- method public void addRemoteControlClient(Object);
- method public androidx.mediarouter.media.MediaRouter.RouteInfo! getBluetoothRoute();
- method public androidx.mediarouter.media.MediaRouter.RouteInfo getDefaultRoute();
- method public static androidx.mediarouter.media.MediaRouter! getInstance(android.content.Context);
- method public android.support.v4.media.session.MediaSessionCompat.Token! getMediaSessionToken();
- method public java.util.List<androidx.mediarouter.media.MediaRouter.ProviderInfo>! getProviders();
- method public java.util.List<androidx.mediarouter.media.MediaRouter.RouteInfo>! getRoutes();
- method public androidx.mediarouter.media.MediaRouter.RouteInfo getSelectedRoute();
- method public boolean isRouteAvailable(androidx.mediarouter.media.MediaRouteSelector, int);
- method public void removeCallback(androidx.mediarouter.media.MediaRouter.Callback);
- method public void removeProvider(androidx.mediarouter.media.MediaRouteProvider);
- method public void removeRemoteControlClient(Object);
- method public void selectRoute(androidx.mediarouter.media.MediaRouter.RouteInfo);
- method public void setMediaSession(Object!);
- method public void setMediaSessionCompat(android.support.v4.media.session.MediaSessionCompat!);
- method public void unselect(int);
- method public androidx.mediarouter.media.MediaRouter.RouteInfo updateSelectedRoute(androidx.mediarouter.media.MediaRouteSelector);
- field public static final int AVAILABILITY_FLAG_IGNORE_DEFAULT_ROUTE = 1; // 0x1
- field public static final int AVAILABILITY_FLAG_REQUIRE_MATCH = 2; // 0x2
- field public static final int CALLBACK_FLAG_FORCE_DISCOVERY = 8; // 0x8
- field public static final int CALLBACK_FLAG_PERFORM_ACTIVE_SCAN = 1; // 0x1
- field public static final int CALLBACK_FLAG_REQUEST_DISCOVERY = 4; // 0x4
- field public static final int CALLBACK_FLAG_UNFILTERED_EVENTS = 2; // 0x2
- field public static final int UNSELECT_REASON_DISCONNECTED = 1; // 0x1
- field public static final int UNSELECT_REASON_ROUTE_CHANGED = 3; // 0x3
- field public static final int UNSELECT_REASON_STOPPED = 2; // 0x2
- field public static final int UNSELECT_REASON_UNKNOWN = 0; // 0x0
- }
-
- public abstract static class MediaRouter.Callback {
- ctor public MediaRouter.Callback();
- method public void onProviderAdded(androidx.mediarouter.media.MediaRouter!, androidx.mediarouter.media.MediaRouter.ProviderInfo!);
- method public void onProviderChanged(androidx.mediarouter.media.MediaRouter!, androidx.mediarouter.media.MediaRouter.ProviderInfo!);
- method public void onProviderRemoved(androidx.mediarouter.media.MediaRouter!, androidx.mediarouter.media.MediaRouter.ProviderInfo!);
- method public void onRouteAdded(androidx.mediarouter.media.MediaRouter!, androidx.mediarouter.media.MediaRouter.RouteInfo!);
- method public void onRouteChanged(androidx.mediarouter.media.MediaRouter!, androidx.mediarouter.media.MediaRouter.RouteInfo!);
- method public void onRoutePresentationDisplayChanged(androidx.mediarouter.media.MediaRouter!, androidx.mediarouter.media.MediaRouter.RouteInfo!);
- method public void onRouteRemoved(androidx.mediarouter.media.MediaRouter!, androidx.mediarouter.media.MediaRouter.RouteInfo!);
- method public void onRouteSelected(androidx.mediarouter.media.MediaRouter!, androidx.mediarouter.media.MediaRouter.RouteInfo!);
- method public void onRouteUnselected(androidx.mediarouter.media.MediaRouter!, androidx.mediarouter.media.MediaRouter.RouteInfo!);
- method public void onRouteUnselected(androidx.mediarouter.media.MediaRouter!, androidx.mediarouter.media.MediaRouter.RouteInfo!, int);
- method public void onRouteVolumeChanged(androidx.mediarouter.media.MediaRouter!, androidx.mediarouter.media.MediaRouter.RouteInfo!);
- }
-
- public abstract static class MediaRouter.ControlRequestCallback {
- ctor public MediaRouter.ControlRequestCallback();
- method public void onError(String!, android.os.Bundle!);
- method public void onResult(android.os.Bundle!);
- }
-
- public static final class MediaRouter.ProviderInfo {
- method public android.content.ComponentName! getComponentName();
- method public String! getPackageName();
- method public androidx.mediarouter.media.MediaRouteProvider! getProviderInstance();
- method public java.util.List<androidx.mediarouter.media.MediaRouter.RouteInfo>! getRoutes();
- }
-
- public static class MediaRouter.RouteInfo {
- method public boolean canDisconnect();
- method public int getConnectionState();
- method public java.util.List<android.content.IntentFilter>! getControlFilters();
- method public String? getDescription();
- method public int getDeviceType();
- method public android.os.Bundle? getExtras();
- method public android.net.Uri! getIconUri();
- method public String getId();
- method public String! getName();
- method public int getPlaybackStream();
- method public int getPlaybackType();
- method public android.view.Display? getPresentationDisplay();
- method public androidx.mediarouter.media.MediaRouter.ProviderInfo! getProvider();
- method public android.content.IntentSender? getSettingsIntent();
- method public int getVolume();
- method public int getVolumeHandling();
- method public int getVolumeMax();
- method public boolean isBluetooth();
- method @Deprecated public boolean isConnecting();
- method public boolean isDefault();
- method public boolean isDeviceSpeaker();
- method public boolean isEnabled();
- method public boolean isSelected();
- method public boolean matchesSelector(androidx.mediarouter.media.MediaRouteSelector);
- method public void requestSetVolume(int);
- method public void requestUpdateVolume(int);
- method public void select();
- method public void sendControlRequest(android.content.Intent, androidx.mediarouter.media.MediaRouter.ControlRequestCallback?);
- method public boolean supportsControlAction(String, String);
- method public boolean supportsControlCategory(String);
- method public boolean supportsControlRequest(android.content.Intent);
- field public static final int CONNECTION_STATE_CONNECTED = 2; // 0x2
- field public static final int CONNECTION_STATE_CONNECTING = 1; // 0x1
- field public static final int CONNECTION_STATE_DISCONNECTED = 0; // 0x0
- field public static final int DEVICE_TYPE_SPEAKER = 2; // 0x2
- field public static final int DEVICE_TYPE_TV = 1; // 0x1
- field public static final int PLAYBACK_TYPE_LOCAL = 0; // 0x0
- field public static final int PLAYBACK_TYPE_REMOTE = 1; // 0x1
- field public static final int PLAYBACK_VOLUME_FIXED = 0; // 0x0
- field public static final int PLAYBACK_VOLUME_VARIABLE = 1; // 0x1
- }
-
- public final class MediaSessionStatus {
- method public android.os.Bundle! asBundle();
- method public static androidx.mediarouter.media.MediaSessionStatus! fromBundle(android.os.Bundle!);
- method public android.os.Bundle! getExtras();
- method public int getSessionState();
- method public long getTimestamp();
- method public boolean isQueuePaused();
- field public static final int SESSION_STATE_ACTIVE = 0; // 0x0
- field public static final int SESSION_STATE_ENDED = 1; // 0x1
- field public static final int SESSION_STATE_INVALIDATED = 2; // 0x2
- }
-
- public static final class MediaSessionStatus.Builder {
- ctor public MediaSessionStatus.Builder(int);
- ctor public MediaSessionStatus.Builder(androidx.mediarouter.media.MediaSessionStatus!);
- method public androidx.mediarouter.media.MediaSessionStatus! build();
- method public androidx.mediarouter.media.MediaSessionStatus.Builder! setExtras(android.os.Bundle!);
- method public androidx.mediarouter.media.MediaSessionStatus.Builder! setQueuePaused(boolean);
- method public androidx.mediarouter.media.MediaSessionStatus.Builder! setSessionState(int);
- method public androidx.mediarouter.media.MediaSessionStatus.Builder! setTimestamp(long);
- }
-
- public class RemotePlaybackClient {
- ctor public RemotePlaybackClient(android.content.Context!, androidx.mediarouter.media.MediaRouter.RouteInfo!);
- method public void endSession(android.os.Bundle!, androidx.mediarouter.media.RemotePlaybackClient.SessionActionCallback!);
- method public void enqueue(android.net.Uri!, String!, android.os.Bundle!, long, android.os.Bundle!, androidx.mediarouter.media.RemotePlaybackClient.ItemActionCallback!);
- method public String! getSessionId();
- method public void getSessionStatus(android.os.Bundle!, androidx.mediarouter.media.RemotePlaybackClient.SessionActionCallback!);
- method public void getStatus(String!, android.os.Bundle!, androidx.mediarouter.media.RemotePlaybackClient.ItemActionCallback!);
- method public boolean hasSession();
- method public boolean isMessagingSupported();
- method public boolean isQueuingSupported();
- method public boolean isRemotePlaybackSupported();
- method public boolean isSessionManagementSupported();
- method public void pause(android.os.Bundle!, androidx.mediarouter.media.RemotePlaybackClient.SessionActionCallback!);
- method public void play(android.net.Uri!, String!, android.os.Bundle!, long, android.os.Bundle!, androidx.mediarouter.media.RemotePlaybackClient.ItemActionCallback!);
- method public void release();
- method public void remove(String!, android.os.Bundle!, androidx.mediarouter.media.RemotePlaybackClient.ItemActionCallback!);
- method public void resume(android.os.Bundle!, androidx.mediarouter.media.RemotePlaybackClient.SessionActionCallback!);
- method public void seek(String!, long, android.os.Bundle!, androidx.mediarouter.media.RemotePlaybackClient.ItemActionCallback!);
- method public void sendMessage(android.os.Bundle!, androidx.mediarouter.media.RemotePlaybackClient.SessionActionCallback!);
- method public void setOnMessageReceivedListener(androidx.mediarouter.media.RemotePlaybackClient.OnMessageReceivedListener!);
- method public void setSessionId(String!);
- method public void setStatusCallback(androidx.mediarouter.media.RemotePlaybackClient.StatusCallback!);
- method public void startSession(android.os.Bundle!, androidx.mediarouter.media.RemotePlaybackClient.SessionActionCallback!);
- method public void stop(android.os.Bundle!, androidx.mediarouter.media.RemotePlaybackClient.SessionActionCallback!);
- }
-
- public abstract static class RemotePlaybackClient.ActionCallback {
- ctor public RemotePlaybackClient.ActionCallback();
- method public void onError(String!, int, android.os.Bundle!);
- }
-
- public abstract static class RemotePlaybackClient.ItemActionCallback extends androidx.mediarouter.media.RemotePlaybackClient.ActionCallback {
- ctor public RemotePlaybackClient.ItemActionCallback();
- method public void onResult(android.os.Bundle!, String!, androidx.mediarouter.media.MediaSessionStatus!, String!, androidx.mediarouter.media.MediaItemStatus!);
- }
-
- public static interface RemotePlaybackClient.OnMessageReceivedListener {
- method public void onMessageReceived(String!, android.os.Bundle!);
- }
-
- public abstract static class RemotePlaybackClient.SessionActionCallback extends androidx.mediarouter.media.RemotePlaybackClient.ActionCallback {
- ctor public RemotePlaybackClient.SessionActionCallback();
- method public void onResult(android.os.Bundle!, String!, androidx.mediarouter.media.MediaSessionStatus!);
- }
-
- public abstract static class RemotePlaybackClient.StatusCallback {
- ctor public RemotePlaybackClient.StatusCallback();
- method public void onItemStatusChanged(android.os.Bundle!, String!, androidx.mediarouter.media.MediaSessionStatus!, String!, androidx.mediarouter.media.MediaItemStatus!);
- method public void onSessionChanged(String!);
- method public void onSessionStatusChanged(android.os.Bundle!, String!, androidx.mediarouter.media.MediaSessionStatus!);
- }
-
-}
-
diff --git a/mediarouter/api/current.txt b/mediarouter/api/current.txt
index f0c7243..4a73f6a 100644
--- a/mediarouter/api/current.txt
+++ b/mediarouter/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.mediarouter.app {
public class MediaRouteActionProvider extends androidx.core.view.ActionProvider {
@@ -9,7 +9,6 @@
method public androidx.mediarouter.media.MediaRouteSelector getRouteSelector();
method public android.view.View! onCreateActionView();
method public androidx.mediarouter.app.MediaRouteButton! onCreateMediaRouteButton();
- method public void setAlwaysVisible(boolean);
method public void setDialogFactory(androidx.mediarouter.app.MediaRouteDialogFactory);
method public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector);
}
@@ -23,7 +22,6 @@
method public androidx.mediarouter.media.MediaRouteSelector getRouteSelector();
method public void onAttachedToWindow();
method public void onDetachedFromWindow();
- method public void setAlwaysVisible(boolean);
method public void setDialogFactory(androidx.mediarouter.app.MediaRouteDialogFactory);
method public void setRemoteIndicatorDrawable(android.graphics.drawable.Drawable!);
method public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector!);
diff --git a/mediarouter/api/res-1.1.0-alpha02.txt b/mediarouter/api/res-1.1.0-alpha02.txt
deleted file mode 100644
index e69de29..0000000
--- a/mediarouter/api/res-1.1.0-alpha02.txt
+++ /dev/null
diff --git a/mediarouter/api/restricted_1.1.0-alpha02.txt b/mediarouter/api/restricted_1.1.0-alpha02.txt
deleted file mode 100644
index fc748c3..0000000
--- a/mediarouter/api/restricted_1.1.0-alpha02.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-// Signature format: 3.0
-package androidx.mediarouter.app {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MediaRouteCastDialog extends androidx.appcompat.app.AppCompatDialog {
- ctor public MediaRouteCastDialog(android.content.Context!);
- ctor public MediaRouteCastDialog(android.content.Context!, int);
- method public android.support.v4.media.session.MediaSessionCompat.Token! getMediaSession();
- method public androidx.mediarouter.media.MediaRouteSelector getRouteSelector();
- method public boolean onFilterRoute(androidx.mediarouter.media.MediaRouter.RouteInfo);
- method public void onFilterRoutes(java.util.List<androidx.mediarouter.media.MediaRouter.RouteInfo>);
- method public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector);
- }
-
- public class MediaRouteChooserDialogFragment extends androidx.fragment.app.DialogFragment {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.app.MediaRouteDevicePickerDialog! onCreateDevicePickerDialog(android.content.Context!);
- }
-
- public class MediaRouteControllerDialogFragment extends androidx.fragment.app.DialogFragment {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteSelector! getRouteSelector();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.app.MediaRouteCastDialog! onCreateCastDialog(android.content.Context!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MediaRouteDevicePickerDialog extends androidx.appcompat.app.AppCompatDialog {
- ctor public MediaRouteDevicePickerDialog(android.content.Context!);
- ctor public MediaRouteDevicePickerDialog(android.content.Context!, int);
- method public androidx.mediarouter.media.MediaRouteSelector getRouteSelector();
- method public boolean onFilterRoute(androidx.mediarouter.media.MediaRouter.RouteInfo);
- method public void onFilterRoutes(java.util.List<androidx.mediarouter.media.MediaRouter.RouteInfo>);
- method public void refreshRoutes();
- method public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector);
- }
-
-}
-
-package androidx.mediarouter.media {
-
- public final class MediaRouteDescriptor {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public java.util.List<java.lang.String>! getGroupMemberIds();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getMaxClientVersion();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getMinClientVersion();
- }
-
- public static final class MediaRouteDescriptor.Builder {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteDescriptor.Builder! addGroupMemberId(String!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteDescriptor.Builder! addGroupMemberIds(java.util.Collection<java.lang.String>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteDescriptor.Builder! removeGroupMemberId(String!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setMaxClientVersion(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setMinClientVersion(int);
- }
-
- public abstract class MediaRouteProvider {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteProvider.RouteController? onCreateRouteController(String, String);
- }
-
- @IntDef({androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.UNSELECTING, androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.UNSELECTED, androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.SELECTING, androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.SELECTED}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.SelectionState {
- }
-
- public final class MediaRouter {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void addMemberToSelectedRoute(androidx.mediarouter.media.MediaRouter.RouteInfo!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void removeMemberFromSelectedRoute(androidx.mediarouter.media.MediaRouter.RouteInfo!);
- }
-
- public static class MediaRouter.RouteInfo {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController? getDynamicGroupController();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public java.util.List<androidx.mediarouter.media.MediaRouter.RouteInfo> getMemberRoutes();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getPresentationDisplayId();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteProvider! getProviderInstance();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getSelectionState();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isDefaultOrBluetooth();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isDynamicRoute();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isGroup();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isGroupable();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isTransferable();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isUnselectable();
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int DEVICE_TYPE_BLUETOOTH = 3; // 0x3
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int DEVICE_TYPE_UNKNOWN = 0; // 0x0
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int PRESENTATION_DISPLAY_ID_NONE = -1; // 0xffffffff
- }
-
-}
-
diff --git a/mediarouter/api/restricted_current.txt b/mediarouter/api/restricted_current.txt
deleted file mode 100644
index fc748c3..0000000
--- a/mediarouter/api/restricted_current.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-// Signature format: 3.0
-package androidx.mediarouter.app {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MediaRouteCastDialog extends androidx.appcompat.app.AppCompatDialog {
- ctor public MediaRouteCastDialog(android.content.Context!);
- ctor public MediaRouteCastDialog(android.content.Context!, int);
- method public android.support.v4.media.session.MediaSessionCompat.Token! getMediaSession();
- method public androidx.mediarouter.media.MediaRouteSelector getRouteSelector();
- method public boolean onFilterRoute(androidx.mediarouter.media.MediaRouter.RouteInfo);
- method public void onFilterRoutes(java.util.List<androidx.mediarouter.media.MediaRouter.RouteInfo>);
- method public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector);
- }
-
- public class MediaRouteChooserDialogFragment extends androidx.fragment.app.DialogFragment {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.app.MediaRouteDevicePickerDialog! onCreateDevicePickerDialog(android.content.Context!);
- }
-
- public class MediaRouteControllerDialogFragment extends androidx.fragment.app.DialogFragment {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteSelector! getRouteSelector();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.app.MediaRouteCastDialog! onCreateCastDialog(android.content.Context!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MediaRouteDevicePickerDialog extends androidx.appcompat.app.AppCompatDialog {
- ctor public MediaRouteDevicePickerDialog(android.content.Context!);
- ctor public MediaRouteDevicePickerDialog(android.content.Context!, int);
- method public androidx.mediarouter.media.MediaRouteSelector getRouteSelector();
- method public boolean onFilterRoute(androidx.mediarouter.media.MediaRouter.RouteInfo);
- method public void onFilterRoutes(java.util.List<androidx.mediarouter.media.MediaRouter.RouteInfo>);
- method public void refreshRoutes();
- method public void setRouteSelector(androidx.mediarouter.media.MediaRouteSelector);
- }
-
-}
-
-package androidx.mediarouter.media {
-
- public final class MediaRouteDescriptor {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public java.util.List<java.lang.String>! getGroupMemberIds();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getMaxClientVersion();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getMinClientVersion();
- }
-
- public static final class MediaRouteDescriptor.Builder {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteDescriptor.Builder! addGroupMemberId(String!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteDescriptor.Builder! addGroupMemberIds(java.util.Collection<java.lang.String>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteDescriptor.Builder! removeGroupMemberId(String!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setMaxClientVersion(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteDescriptor.Builder! setMinClientVersion(int);
- }
-
- public abstract class MediaRouteProvider {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteProvider.RouteController? onCreateRouteController(String, String);
- }
-
- @IntDef({androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.UNSELECTING, androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.UNSELECTED, androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.SELECTING, androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.SELECTED}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface MediaRouteProvider.DynamicGroupRouteController.DynamicRouteDescriptor.SelectionState {
- }
-
- public final class MediaRouter {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void addMemberToSelectedRoute(androidx.mediarouter.media.MediaRouter.RouteInfo!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void removeMemberFromSelectedRoute(androidx.mediarouter.media.MediaRouter.RouteInfo!);
- }
-
- public static class MediaRouter.RouteInfo {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController? getDynamicGroupController();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public java.util.List<androidx.mediarouter.media.MediaRouter.RouteInfo> getMemberRoutes();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getPresentationDisplayId();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.mediarouter.media.MediaRouteProvider! getProviderInstance();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public int getSelectionState();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isDefaultOrBluetooth();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isDynamicRoute();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isGroup();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isGroupable();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isTransferable();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isUnselectable();
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int DEVICE_TYPE_BLUETOOTH = 3; // 0x3
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int DEVICE_TYPE_UNKNOWN = 0; // 0x0
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int PRESENTATION_DISPLAY_ID_NONE = -1; // 0xffffffff
- }
-
-}
-
diff --git a/mediarouter/jellybean/androidx/mediarouter/media/MediaRouterJellybean.java b/mediarouter/jellybean/androidx/mediarouter/media/MediaRouterJellybean.java
index 36bd97b..d73edb7 100644
--- a/mediarouter/jellybean/androidx/mediarouter/media/MediaRouterJellybean.java
+++ b/mediarouter/jellybean/androidx/mediarouter/media/MediaRouterJellybean.java
@@ -18,6 +18,7 @@
import android.content.Context;
import android.graphics.drawable.Drawable;
+import android.media.AudioManager;
import android.os.Build;
import android.util.Log;
@@ -119,6 +120,19 @@
return new VolumeCallbackProxy<VolumeCallback>(callback);
}
+ static boolean checkRoutedToBluetooth(Context context) {
+ try {
+ AudioManager audioManager = (AudioManager) context.getSystemService(
+ Context.AUDIO_SERVICE);
+ Method method = audioManager.getClass().getDeclaredMethod(
+ "getDevicesForStream", int.class);
+ int device = (Integer) method.invoke(audioManager, AudioManager.STREAM_MUSIC);
+ return (device & DEVICE_OUT_BLUETOOTH) != 0;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
public static final class RouteInfo {
public static CharSequence getName(Object routeObj, Context context) {
return ((android.media.MediaRouter.RouteInfo)routeObj).getName(context);
diff --git a/mediarouter/src/androidTest/java/androidx/mediarouter/app/MediaRouteChooserDialogTest.java b/mediarouter/src/androidTest/java/androidx/mediarouter/app/MediaRouteChooserDialogTest.java
index 9fd335a..2c93718 100644
--- a/mediarouter/src/androidTest/java/androidx/mediarouter/app/MediaRouteChooserDialogTest.java
+++ b/mediarouter/src/androidTest/java/androidx/mediarouter/app/MediaRouteChooserDialogTest.java
@@ -27,6 +27,7 @@
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
@@ -52,7 +53,7 @@
}
@Test
- @LargeTest
+ @SmallTest
@UiThreadTest
public void testWindowNoTitle() {
final Context context = mActivityTestRule.getActivity();
diff --git a/mediarouter/src/androidTest/java/androidx/mediarouter/media/MediaRouterInitializationTest.java b/mediarouter/src/androidTest/java/androidx/mediarouter/media/MediaRouterInitializationTest.java
index a1c7ea0..c6b936b 100644
--- a/mediarouter/src/androidTest/java/androidx/mediarouter/media/MediaRouterInitializationTest.java
+++ b/mediarouter/src/androidTest/java/androidx/mediarouter/media/MediaRouterInitializationTest.java
@@ -25,8 +25,8 @@
import android.os.Build;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -41,7 +41,7 @@
*/
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
@Test
- @MediumTest
+ @SmallTest
public void testEmptyUserRoute() throws Exception {
getInstrumentation().runOnMainSync(new Runnable() {
@Override
diff --git a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteActionProvider.java b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteActionProvider.java
index 6dd4e27..cb22394 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteActionProvider.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteActionProvider.java
@@ -138,7 +138,6 @@
private MediaRouteDialogFactory mDialogFactory = MediaRouteDialogFactory.getDefault();
private MediaRouteButton mButton;
private boolean mUseDynamicGroup;
- private boolean mAlwaysVisible;
/**
* Creates the action provider.
@@ -199,13 +198,6 @@
/**
* Enables dynamic group feature.
- * With this enabled, a different set of {@link MediaRouteChooserDialog} and
- * {@link MediaRouteControllerDialog} is shown when the button is clicked.
- * If a {@link androidx.mediarouter.media.MediaRouteProvider media route provider}
- * supports dynamic group, the users can use that feature with the dialogs.
- *
- * @see MediaRouteButton#enableDynamicGroup()
- * @see androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController
*/
public void enableDynamicGroup() {
mUseDynamicGroup = true;
@@ -215,25 +207,6 @@
}
/**
- * Sets whether {@link MediaRouteButton} is visible when no routes are available.
- * When true, the button is visible even if there are no routes to connect.
- * The default is false.
- *
- * @param alwaysVisible true to show MediaRouteButton always.
- *
- * @see MediaRouteButton#setAlwaysVisible(boolean)
- */
- public void setAlwaysVisible(boolean alwaysVisible) {
- if (mAlwaysVisible != alwaysVisible) {
- mAlwaysVisible = alwaysVisible;
- refreshVisibility();
- if (mButton != null) {
- mButton.setAlwaysVisible(mAlwaysVisible);
- }
- }
- }
-
- /**
* Gets the media route dialog factory to use when showing the route chooser
* or controller dialog.
*
@@ -297,7 +270,6 @@
if (mUseDynamicGroup) {
mButton.enableDynamicGroup();
}
- mButton.setAlwaysVisible(mAlwaysVisible);
mButton.setDialogFactory(mDialogFactory);
mButton.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
@@ -320,7 +292,7 @@
@Override
public boolean isVisible() {
- return mAlwaysVisible || mRouter.isRouteAvailable(mSelector,
+ return mRouter.isRouteAvailable(mSelector,
MediaRouter.AVAILABILITY_FLAG_IGNORE_DEFAULT_ROUTE);
}
diff --git a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteButton.java b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteButton.java
index 2ff24e0..0dbd32c 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteButton.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteButton.java
@@ -125,7 +125,6 @@
private int mMinHeight;
private boolean mUseDynamicGroup;
- private boolean mAlwaysVisible;
// The checked state is used when connected to a remote route.
private static final int[] CHECKED_STATE_SET = {
@@ -148,16 +147,7 @@
public MediaRouteButton(Context context, AttributeSet attrs, int defStyleAttr) {
super(MediaRouterThemeHelper.createThemedButtonContext(context), attrs, defStyleAttr);
context = getContext();
- TypedArray a = context.obtainStyledAttributes(attrs,
- R.styleable.MediaRouteButton, defStyleAttr, 0);
- if (isInEditMode()) {
- mRouter = null;
- mCallback = null;
- int remoteIndicatorStaticResId = a.getResourceId(
- R.styleable.MediaRouteButton_externalRouteEnabledDrawableStatic, 0);
- mRemoteIndicator = getResources().getDrawable(remoteIndicatorStaticResId);
- return;
- }
+
mRouter = MediaRouter.getInstance(context);
mCallback = new MediaRouterCallback();
@@ -165,6 +155,8 @@
sConnectivityReceiver = new ConnectivityReceiver(context.getApplicationContext());
}
+ TypedArray a = context.obtainStyledAttributes(attrs,
+ R.styleable.MediaRouteButton, defStyleAttr, 0);
mButtonTint = a.getColorStateList(R.styleable.MediaRouteButton_mediaRouteButtonTint);
mMinWidth = a.getDimensionPixelSize(
R.styleable.MediaRouteButton_android_minWidth, 0);
@@ -190,8 +182,7 @@
if (remoteIndicatorStaticState != null) {
setRemoteIndicatorDrawableInternal(remoteIndicatorStaticState.newDrawable());
} else {
- mRemoteIndicatorLoader = new RemoteIndicatorLoader(remoteIndicatorStaticResId,
- getContext());
+ mRemoteIndicatorLoader = new RemoteIndicatorLoader(remoteIndicatorStaticResId);
mRemoteIndicatorLoader.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
}
}
@@ -263,12 +254,6 @@
/**
* Enables dynamic group feature.
- * With this enabled, a different set of {@link MediaRouteChooserDialog} and
- * {@link MediaRouteControllerDialog} is shown when the button is clicked.
- * If a {@link androidx.mediarouter.media.MediaRouteProvider media route provider}
- * supports dynamic group, the users can use that feature with the dialogs.
- *
- * @see androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController
*/
public void enableDynamicGroup() {
mUseDynamicGroup = true;
@@ -412,24 +397,6 @@
setRemoteIndicatorDrawableInternal(d);
}
- /**
- * Sets whether the button is visible when no routes are available.
- * When true, the button is visible even if there are no routes to connect.
- * You may want to override {@link View#performClick()} to change the behavior
- * when the button is clicked.
- * The default is false.
- * It doesn't overrides the {@link View#getVisibility visibility} status of the button.
- *
- * @param alwaysVisible true to show button always.
- */
- public void setAlwaysVisible(boolean alwaysVisible) {
- if (alwaysVisible != mAlwaysVisible) {
- mAlwaysVisible = alwaysVisible;
- refreshVisibility();
- refreshRoute();
- }
- }
-
@Override
protected boolean verifyDrawable(Drawable who) {
return super.verifyDrawable(who) || who == mRemoteIndicator;
@@ -459,10 +426,6 @@
public void onAttachedToWindow() {
super.onAttachedToWindow();
- if (isInEditMode()) {
- return;
- }
-
mAttachedToWindow = true;
if (!mSelector.isEmpty()) {
mRouter.addCallback(mSelector, mCallback);
@@ -474,15 +437,13 @@
@Override
public void onDetachedFromWindow() {
- if (!isInEditMode()) {
- mAttachedToWindow = false;
- if (!mSelector.isEmpty()) {
- mRouter.removeCallback(mCallback);
- }
-
- sConnectivityReceiver.unregisterReceiver(this);
+ mAttachedToWindow = false;
+ if (!mSelector.isEmpty()) {
+ mRouter.removeCallback(mCallback);
}
+ sConnectivityReceiver.unregisterReceiver(this);
+
super.onDetachedFromWindow();
}
@@ -555,8 +516,7 @@
if (mRemoteIndicatorLoader != null) {
mRemoteIndicatorLoader.cancel(false);
}
- mRemoteIndicatorLoader = new RemoteIndicatorLoader(mRemoteIndicatorResIdToLoad,
- getContext());
+ mRemoteIndicatorLoader = new RemoteIndicatorLoader(mRemoteIndicatorResIdToLoad);
mRemoteIndicatorResIdToLoad = 0;
mRemoteIndicatorLoader.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
}
@@ -600,8 +560,7 @@
}
void refreshVisibility() {
- super.setVisibility(mVisibility == VISIBLE
- && !(mAlwaysVisible || sConnectivityReceiver.isConnected())
+ super.setVisibility(mVisibility == VISIBLE && !sConnectivityReceiver.isConnected()
? INVISIBLE : mVisibility);
if (mRemoteIndicator != null) {
mRemoteIndicator.setVisible(getVisibility() == VISIBLE, false);
@@ -630,7 +589,7 @@
}
if (mAttachedToWindow) {
- setEnabled(mAlwaysVisible || mRouter.isRouteAvailable(mSelector,
+ setEnabled(mRouter.isRouteAvailable(mSelector,
MediaRouter.AVAILABILITY_FLAG_IGNORE_DEFAULT_ROUTE));
}
if (mRemoteIndicator != null
@@ -716,18 +675,16 @@
private final class RemoteIndicatorLoader extends AsyncTask<Void, Void, Drawable> {
private final int mResId;
- private final Context mContext;
- RemoteIndicatorLoader(int resId, Context context) {
+ RemoteIndicatorLoader(int resId) {
mResId = resId;
- mContext = context;
}
@Override
protected Drawable doInBackground(Void... params) {
Drawable.ConstantState remoteIndicatorState = sRemoteIndicatorCache.get(mResId);
if (remoteIndicatorState == null) {
- return mContext.getResources().getDrawable(mResId);
+ return getContext().getResources().getDrawable(mResId);
} else {
return null;
}
diff --git a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteCastDialog.java b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteCastDialog.java
index ea8178a..2ced044 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteCastDialog.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteCastDialog.java
@@ -16,7 +16,7 @@
package androidx.mediarouter.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ContentResolver;
import android.content.Context;
@@ -97,10 +97,9 @@
* @see MediaRouteActionProvider
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class MediaRouteCastDialog extends AppCompatDialog {
- private static final String TAG = "MediaRouteCastDialog";
- @SuppressWarnings("WeakerAccess") /* synthetic access */
+ static final String TAG = "MediaRouteCastDialog";
static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
// Do not update the route list immediately to avoid unnatural dialog change.
@@ -108,35 +107,28 @@
private static final int CONNECTION_TIMEOUT_MS = 30000;
private static final int UPDATE_VOLUME_DELAY_MS = 500;
- private static final int MSG_UPDATE_ROUTES_VIEW = 1;
- private static final int MSG_UPDATE_ROUTE_VOLUME_BY_USER = 2;
+ static final int MSG_UPDATE_ROUTES_VIEW = 1;
+ static final int MSG_UPDATE_ROUTE_VOLUME_BY_USER = 2;
// TODO (b/111731099): Remove this once dark theme is implemented inside MediaRouterThemeHelper.
- private static final int COLOR_WHITE_ON_DARK_BACKGROUND = Color.WHITE;
+ static final int COLOR_WHITE_ON_DARK_BACKGROUND = Color.WHITE;
- private static final int MUTED_VOLUME = 0;
- private static final int MIN_UNMUTED_VOLUME = 1;
+ static final int MUTED_VOLUME = 0;
+ static final int MIN_UNMUTED_VOLUME = 1;
private static final int BLUR_RADIUS = 10;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
final MediaRouter mRouter;
private final MediaRouterCallback mCallback;
private MediaRouteSelector mSelector = MediaRouteSelector.EMPTY;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
MediaRouter.RouteInfo mSelectedRoute;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
final List<MediaRouter.RouteInfo> mMemberRoutes = new ArrayList<>();
- @SuppressWarnings("WeakerAccess") /* synthetic access */
final List<MediaRouter.RouteInfo> mGroupableRoutes = new ArrayList<>();
- @SuppressWarnings("WeakerAccess") /* synthetic access */
final List<MediaRouter.RouteInfo> mTransferableRoutes = new ArrayList<>();
// List of routes that were previously groupable but temporarily ungroupable.
- @SuppressWarnings("WeakerAccess") /* synthetic access */
final List<MediaRouter.RouteInfo> mUngroupableRoutes = new ArrayList<>();
- @SuppressWarnings("WeakerAccess") /* synthetic access */
Context mContext;
private boolean mCreated;
private boolean mAttachedToWindow;
@@ -164,15 +156,15 @@
RecyclerView mRecyclerView;
@SuppressWarnings("WeakerAccess") /* synthetic access */
RecyclerAdapter mAdapter;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
VolumeChangeListener mVolumeChangeListener;
+ int mVolumeSliderColor;
@SuppressWarnings("WeakerAccess") /* synthetic access */
Map<String, MediaRouteVolumeSliderHolder> mVolumeSliderHolderMap;
@SuppressWarnings("WeakerAccess") /* synthetic access */
MediaRouter.RouteInfo mRouteForVolumeUpdatingByUser;
@SuppressWarnings("WeakerAccess") /* synthetic access */
- Map<String, Integer> mUnmutedVolumeMap;
+ Map<String, Integer> mBeforeMuteVolumeMap;
@SuppressWarnings("WeakerAccess") /* synthetic access */
boolean mIsSelectingRoute;
@SuppressWarnings("WeakerAccess") /* synthetic access */
@@ -186,30 +178,20 @@
private ImageView mMetadataBackground;
private View mMetadataBlackScrim;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- ImageView mArtView;
+ private ImageView mArtView;
private TextView mTitleView;
private TextView mSubtitleView;
private String mTitlePlaceholder;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
MediaControllerCompat mMediaController;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
MediaControllerCallback mControllerCallback;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
MediaDescriptionCompat mDescription;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
FetchArtTask mFetchArtTask;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
Bitmap mArtIconBitmap;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
Uri mArtIconUri;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
boolean mArtIconIsLoaded;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
Bitmap mArtIconLoadedBitmap;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
int mArtIconBackgroundColor;
public MediaRouteCastDialog(Context context) {
@@ -257,7 +239,7 @@
MediaMetadataCompat metadata = mMediaController == null ? null
: mMediaController.getMetadata();
mDescription = metadata == null ? null : metadata.getDescription();
- reloadIconIfNeeded();
+ updateArtIconIfNeeded();
updateMetadataViews();
}
@@ -366,8 +348,9 @@
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
mVolumeChangeListener = new VolumeChangeListener();
+ mVolumeSliderColor = MediaRouterThemeHelper.getControllerColor(mContext, 0);
mVolumeSliderHolderMap = new HashMap<>();
- mUnmutedVolumeMap = new HashMap<>();
+ mBeforeMuteVolumeMap = new HashMap<>();
mMetadataBackground = findViewById(R.id.mr_cast_meta_background);
mMetadataBlackScrim = findViewById(R.id.mr_cast_meta_black_scrim);
@@ -393,7 +376,7 @@
mArtIconBitmap = null;
mArtIconUri = null;
- reloadIconIfNeeded();
+ updateArtIconIfNeeded();
updateMetadataViews();
updateRoutesView();
}
@@ -424,14 +407,12 @@
}
@SuppressWarnings("WeakerAccess") /* synthetic access */
- void reloadIconIfNeeded() {
- Bitmap newBitmap = mDescription == null ? null : mDescription.getIconBitmap();
- Uri newUri = mDescription == null ? null : mDescription.getIconUri();
- Bitmap oldBitmap = mFetchArtTask == null ? mArtIconBitmap : mFetchArtTask.getIconBitmap();
- Uri oldUri = mFetchArtTask == null ? mArtIconUri : mFetchArtTask.getIconUri();
+ int getDesiredArtHeight(int originalWidth, int originalHeight) {
+ return mArtView.getHeight();
+ }
- if (oldBitmap == newBitmap
- && (oldBitmap != null || ObjectsCompat.equals(oldUri, newUri))) {
+ void updateArtIconIfNeeded() {
+ if (!isIconChanged()) {
return;
}
if (mFetchArtTask != null) {
@@ -445,7 +426,6 @@
* Clear the bitmap loaded by FetchArtTask. Will be called after the loaded bitmaps are applied
* to artwork, or no longer valid.
*/
- @SuppressWarnings("WeakerAccess") /* synthetic access */
void clearLoadedBitmap() {
mArtIconIsLoaded = false;
mArtIconLoadedBitmap = null;
@@ -453,6 +433,24 @@
}
/**
+ * Returns whether a new art image is different from an original art image. Compares
+ * Bitmap objects first, and then compares URIs only if bitmap is unchanged with
+ * a null value.
+ */
+ private boolean isIconChanged() {
+ Bitmap newBitmap = mDescription == null ? null : mDescription.getIconBitmap();
+ Uri newUri = mDescription == null ? null : mDescription.getIconUri();
+ Bitmap oldBitmap = mFetchArtTask == null ? mArtIconBitmap : mFetchArtTask.getIconBitmap();
+ Uri oldUri = mFetchArtTask == null ? mArtIconUri : mFetchArtTask.getIconUri();
+ if (oldBitmap != newBitmap) {
+ return true;
+ } else if (oldBitmap == null && ObjectsCompat.equals(oldUri, newUri)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
* Returns whether updateMetadataViews and updateRoutesView should defer updating views.
*/
private boolean shouldDeferUpdateViews() {
@@ -465,7 +463,10 @@
return true;
}
// Defer updating views if corresponding views aren't created yet.
- return !mCreated;
+ if (!mCreated) {
+ return true;
+ }
+ return false;
}
@SuppressWarnings("WeakerAccess") /* synthetic access */
@@ -536,7 +537,6 @@
}
}
- @SuppressWarnings("WeakerAccess") /* synthetic access */
static void setLayoutHeight(View view, int height) {
ViewGroup.LayoutParams lp = view.getLayoutParams();
lp.height = height;
@@ -579,26 +579,21 @@
}
/**
- * Returns a list of currently groupable routes of the selected route.
- * If the selected route is not dynamic group, returns empty list.
+ * Returns a list of groupable routes of selected route.
+ * If selected route is not dynamic group, returns empty list.
*/
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- List<MediaRouter.RouteInfo> getCurrentGroupableRoutes() {
+ List<MediaRouter.RouteInfo> getGroupableRoutes() {
List<MediaRouter.RouteInfo> groupableRoutes = new ArrayList<>();
if (mSelectedRoute.isDynamicRoute()) {
for (MediaRouter.RouteInfo route : mSelectedRoute.getProvider().getRoutes()) {
- if (route.isGroupable()) {
- groupableRoutes.add(route);
- }
-
+ if (route.isGroupable()) groupableRoutes.add(route);
}
}
return groupableRoutes;
}
/**
- * Updates the visible status(groupable/unselectable status and volume) of routes.
- * The position of the routes is not changed and no routes are added/removed.
+ * Updates the routes view that are shown in the cast dialog.
*/
@SuppressWarnings("WeakerAccess") /* synthetic access */
void updateRoutesView() {
@@ -623,12 +618,6 @@
}
}
- /**
- * Updates routes and items of the adapter.
- * It introduces new routes or hides removed routes.
- * Calling this method would result in sudden UI changes due to change of the adapter.
- */
- @SuppressWarnings("WeakerAccess") /* synthetic access */
void updateRoutes() {
mMemberRoutes.clear();
mGroupableRoutes.clear();
@@ -655,7 +644,7 @@
Collections.sort(mGroupableRoutes, RouteComparator.sInstance);
Collections.sort(mTransferableRoutes, RouteComparator.sInstance);
- mAdapter.updateItems();
+ mAdapter.setItems();
}
@RequiresApi(17)
@@ -746,14 +735,14 @@
if (mute) {
// Save current progress, who is the progress just before muted, so that the volume
// can be restored to that value when user unmutes it.
- mUnmutedVolumeMap.put(mRoute.getId(), mVolumeSlider.getProgress());
+ mBeforeMuteVolumeMap.put(mRoute.getId(), mVolumeSlider.getProgress());
} else {
- mUnmutedVolumeMap.remove(mRoute.getId());
+ mBeforeMuteVolumeMap.remove(mRoute.getId());
}
}
int getUnmutedVolume() {
- Integer beforeMuteVolume = mUnmutedVolumeMap.get(mRoute.getId());
+ Integer beforeMuteVolume = mBeforeMuteVolumeMap.get(mRoute.getId());
return (beforeMuteVolume == null)
? MIN_UNMUTED_VOLUME : Math.max(MIN_UNMUTED_VOLUME, beforeMuteVolume);
@@ -789,7 +778,7 @@
R.integer.mr_cast_volume_slider_layout_animation_duration_ms);
mAccelerateDecelerateInterpolator = new AccelerateDecelerateInterpolator();
- updateItems();
+ setItems();
}
boolean isGroupVolumeNeeded() {
@@ -845,7 +834,6 @@
}
boolean wasShown = isGroupVolumeNeeded();
- // Group volume is shown when two or more members are in the selected route.
boolean shouldShow = memberCount >= 2;
if (wasShown != shouldShow) {
@@ -861,7 +849,7 @@
}
// Create a list of items with mMemberRoutes and add them to mItems
- void updateItems() {
+ void setItems() {
mItems.clear();
mGroupVolumeItem = new Item(mSelectedRoute, ITEM_TYPE_GROUP_VOLUME);
@@ -924,12 +912,12 @@
// routes at groupable routes section.
mUngroupableRoutes.clear();
mUngroupableRoutes.addAll(MediaRouteDialogHelper.getItemsRemoved(mGroupableRoutes,
- getCurrentGroupableRoutes()));
+ getGroupableRoutes()));
notifyDataSetChanged();
}
@Override
- public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+ public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view;
switch (viewType) {
@@ -952,7 +940,7 @@
}
@Override
- public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
int viewType = getItemViewType(position);
Item item = getItem(position);
@@ -987,7 +975,7 @@
}
@Override
- public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) {
+ public void onViewRecycled(RecyclerView.ViewHolder holder) {
super.onViewRecycled(holder);
mVolumeSliderHolderMap.values().remove(holder);
}
@@ -1082,7 +1070,7 @@
mExpandedHeight = (int) value.getDimension(metrics);
}
- void bindGroupVolumeViewHolder(Item item) {
+ public void bindGroupVolumeViewHolder(Item item) {
setLayoutHeight(itemView, isGroupVolumeNeeded() ? mExpandedHeight : 0);
MediaRouter.RouteInfo route = (MediaRouter.RouteInfo) item.getData();
@@ -1091,7 +1079,7 @@
mTextView.setText(route.getName());
}
- int getExpandedHeight() {
+ public int getExpandedHeight() {
return mExpandedHeight;
}
}
@@ -1104,7 +1092,7 @@
mTextView = itemView.findViewById(R.id.mr_cast_header_name);
}
- void bindHeaderViewHolder(Item item) {
+ public void bindHeaderViewHolder(Item item) {
String headerName = item.getData().toString();
mTextView.setText(headerName);
@@ -1191,10 +1179,6 @@
if (mUngroupableRoutes.contains(route)) {
return false;
}
- // The last member route can not be removed.
- if (isSelected(route) && mSelectedRoute.getMemberRoutes().size() < 2) {
- return false;
- }
// Selected route that can't be unselected has to be disabled.
if (isSelected(route) && mSelectedRoute.isDynamicRoute()) {
return route.isUnselectable();
@@ -1202,7 +1186,7 @@
return true;
}
- void bindRouteViewHolder(Item item) {
+ public void bindRouteViewHolder(Item item) {
MediaRouter.RouteInfo route = (MediaRouter.RouteInfo) item.getData();
// This is required to sync volume and the name of the route
@@ -1302,7 +1286,7 @@
return true;
}
- void bindGroupViewHolder(Item item) {
+ public void bindGroupViewHolder(Item item) {
final MediaRouter.RouteInfo route = (MediaRouter.RouteInfo) item.getData();
mRoute = route;
mImageView.setVisibility(View.VISIBLE);
@@ -1325,17 +1309,42 @@
}
}
- // When a new route is selected, member/groupable/transferable routes are not updated
- // immediately in onRouteSelected(). Instead, onRouteChanged() is called after a while.
- // So we should refresh items in onRouteChanged().
- // But onRouteChanged() is also called when a member is added/removed so we refresh
- // items only when a new route is found, which happens right after a new member is selected.
+ /*
+ * The following comment is to improve readability. It explains about the sequence of callback
+ * triggering when selecting a route whose provider supports dynamic group.
+ *
+ * When selecting a route, the sequence of callback triggered depends on whether the provider
+ * supports dynamic group or not. If the provider supports dynamic group, the sequence becomes
+ * more complex, which is shown below with parameters of callbacks.
+ * 1) onRouteUnselected
+ * Previously selected route is passed as a parameter.
+ * 2) onRouteSelected
+ * Dynamic group route of selecting route isn't published at this point, which means passed
+ * route is not dynamic group route yet.
+ * 3) onRouteAdded
+ * Published dynamic group route is passed as a parameter, but its member/groupable/
+ * transferable routes are not initialized yet.
+ * 4) onRouteChanged
+ * member/groupable/transferable routes of dynamic group route is initialized and
+ * corresponding dynamic group route is passed as a parameter.
+ */
private final class MediaRouterCallback extends MediaRouter.Callback {
MediaRouterCallback() {
}
+ // This method is to check if selecting a route is in progress and the provider of selecting
+ // route supports dynamic group or not.
+ private boolean isSelectingDynamicRoute() {
+ // Because MediaRouteCastDialog shows routes with same provider, we can check if the
+ // provider of selecting route supports dynamic group or not by checking instance of
+ // mSelectedRoute.
+ return mIsSelectingRoute && mSelectedRoute.isDynamicRoute();
+ }
+
@Override
public void onRouteAdded(MediaRouter router, MediaRouter.RouteInfo info) {
+ // Defer updating because member/groupable/transferable routes of selecting route isn't
+ // initialized yet.
updateRoutesView();
}
@@ -1368,7 +1377,6 @@
if (mSelectedRoute.getMemberRoutes().contains(memberRoute)) {
continue;
}
- // Refresh items only when a new groupable route is found.
if (memberRoute.isGroupable() && !mGroupableRoutes.contains(memberRoute)) {
shouldRefreshRoute = true;
break;
@@ -1377,7 +1385,6 @@
}
if (shouldRefreshRoute) {
updateViewsIfNeeded();
- // Calls updateRoutes to show new routes.
updateRoutes();
} else {
updateRoutesView();
@@ -1414,7 +1421,7 @@
@Override
public void onMetadataChanged(MediaMetadataCompat metadata) {
mDescription = metadata == null ? null : metadata.getDescription();
- reloadIconIfNeeded();
+ updateArtIconIfNeeded();
updateMetadataViews();
}
}
@@ -1434,11 +1441,11 @@
mIconUri = mDescription == null ? null : mDescription.getIconUri();
}
- Bitmap getIconBitmap() {
+ public Bitmap getIconBitmap() {
return mIconBitmap;
}
- Uri getIconUri() {
+ public Uri getIconUri() {
return mIconUri;
}
@@ -1479,8 +1486,7 @@
}
// Calculate required size to decode the art and possibly resize it.
options.inJustDecodeBounds = false;
- int reqHeight = mContext.getResources().getDimensionPixelSize(
- R.dimen.mr_cast_meta_art_size);
+ int reqHeight = getDesiredArtHeight(options.outWidth, options.outHeight);
int ratio = options.outHeight / reqHeight;
options.inSampleSize = Math.max(1, Integer.highestOneBit(ratio));
if (isCancelled()) {
@@ -1545,7 +1551,7 @@
}
static final class RouteComparator implements Comparator<MediaRouter.RouteInfo> {
- static final RouteComparator sInstance = new RouteComparator();
+ public static final RouteComparator sInstance = new RouteComparator();
@Override
public int compare(MediaRouter.RouteInfo lhs, MediaRouter.RouteInfo rhs) {
diff --git a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteChooserDialogFragment.java b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteChooserDialogFragment.java
index 08e087a..59c88e2 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteChooserDialogFragment.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteChooserDialogFragment.java
@@ -16,7 +16,7 @@
package androidx.mediarouter.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Dialog;
import android.content.Context;
@@ -122,7 +122,7 @@
* Called when the device picker dialog is being created.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public MediaRouteDevicePickerDialog onCreateDevicePickerDialog(Context context) {
return new MediaRouteDevicePickerDialog(context);
}
diff --git a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteControllerDialogFragment.java b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteControllerDialogFragment.java
index 15d8e8f..b4580a5 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteControllerDialogFragment.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteControllerDialogFragment.java
@@ -16,7 +16,7 @@
package androidx.mediarouter.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Dialog;
import android.content.Context;
@@ -56,7 +56,7 @@
* @return The selector, never null.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public MediaRouteSelector getRouteSelector() {
ensureRouteSelector();
return mSelector;
@@ -95,7 +95,7 @@
* @param selector The selector to set.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setRouteSelector(MediaRouteSelector selector) {
if (selector == null) {
throw new IllegalArgumentException("selector must not be null");
@@ -124,7 +124,7 @@
* Called when the cast dialog is being created.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public MediaRouteCastDialog onCreateCastDialog(Context context) {
return new MediaRouteCastDialog(context);
}
diff --git a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteDevicePickerDialog.java b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteDevicePickerDialog.java
index 94ff389..0aa336c 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteDevicePickerDialog.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteDevicePickerDialog.java
@@ -16,7 +16,7 @@
package androidx.mediarouter.app;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.drawable.Drawable;
@@ -60,7 +60,7 @@
* @see MediaRouteActionProvider
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class MediaRouteDevicePickerDialog extends AppCompatDialog {
private static final String TAG = "MediaRouteDevicePickerDialog";
@@ -69,7 +69,7 @@
private static final int ITEM_TYPE_ROUTE = 2;
// Do not update the route list immediately to avoid unnatural dialog change.
- private static final int MSG_UPDATE_ROUTES = 1;
+ static final int MSG_UPDATE_ROUTES = 1;
final MediaRouter mRouter;
private final MediaRouteDevicePickerDialog.MediaRouterCallback mCallback;
@@ -251,7 +251,7 @@
mLastUpdateTime = SystemClock.uptimeMillis();
mRoutes.clear();
mRoutes.addAll(routes);
- mAdapter.rebuildItems();
+ mAdapter.setItems();
}
private final class MediaRouterCallback extends MediaRouter.Callback {
@@ -310,11 +310,11 @@
mTvIcon = MediaRouterThemeHelper.getTvDrawableIcon(mContext);
mSpeakerIcon = MediaRouterThemeHelper.getSpeakerDrawableIcon(mContext);
mSpeakerGroupIcon = MediaRouterThemeHelper.getSpeakerGroupDrawableIcon(mContext);
- rebuildItems();
+ setItems();
}
// Create a list of items with mMemberRoutes and add them to mItems
- void rebuildItems() {
+ void setItems() {
mItems.clear();
mItems.add(new Item(mContext.getString(R.string.mr_chooser_title)));
@@ -349,7 +349,7 @@
switch (viewType) {
case ITEM_TYPE_HEADER:
- ((HeaderViewHolder) holder).bindHeaderView(item);
+ ((HeaderViewHolder) holder).binHeaderView(item);
break;
case ITEM_TYPE_ROUTE:
((RouteViewHolder) holder).bindRouteView(item);
@@ -446,7 +446,7 @@
mTextView = itemView.findViewById(R.id.mr_picker_header_name);
}
- public void bindHeaderView(Item item) {
+ public void binHeaderView(Item item) {
String headerName = item.getData().toString();
mTextView.setText(headerName);
diff --git a/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteDescriptor.java b/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteDescriptor.java
index 9279e58..a9c4deb 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteDescriptor.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteDescriptor.java
@@ -15,7 +15,7 @@
*/
package androidx.mediarouter.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.IntentFilter;
import android.content.IntentSender;
@@ -92,7 +92,7 @@
* </p>
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public List<String> getGroupMemberIds() {
ensureGroupMemberIds();
return mGroupMemberIds;
@@ -310,7 +310,7 @@
* Gets the minimum client version required for this route.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public int getMinClientVersion() {
return mBundle.getInt(KEY_MIN_CLIENT_VERSION,
MediaRouteProviderProtocol.CLIENT_VERSION_START);
@@ -320,7 +320,7 @@
* Gets the maximum client version required for this route.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public int getMaxClientVersion() {
return mBundle.getInt(KEY_MAX_CLIENT_VERSION, Integer.MAX_VALUE);
}
@@ -446,7 +446,7 @@
* </p>
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Builder addGroupMemberId(String groupMemberId) {
if (TextUtils.isEmpty(groupMemberId)) {
throw new IllegalArgumentException("groupMemberId must not be empty");
@@ -469,7 +469,7 @@
* </p>
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Builder addGroupMemberIds(Collection<String> groupMemberIds) {
if (groupMemberIds == null) {
throw new IllegalArgumentException("groupMemberIds must not be null");
@@ -491,7 +491,7 @@
* </p>
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Builder removeGroupMemberId(String memberRouteId) {
if (TextUtils.isEmpty(memberRouteId)) {
throw new IllegalArgumentException("memberRouteId must not be empty");
@@ -726,7 +726,7 @@
* A router whose version is lower than this will not be able to connect to this route.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Builder setMinClientVersion(int minVersion) {
mBundle.putInt(KEY_MIN_CLIENT_VERSION, minVersion);
return this;
@@ -737,7 +737,7 @@
* A router whose version is higher than this will not be able to connect to this route.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Builder setMaxClientVersion(int maxVersion) {
mBundle.putInt(KEY_MAX_CLIENT_VERSION, maxVersion);
return this;
diff --git a/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProvider.java b/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProvider.java
index 2beba1a..43e2696 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProvider.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProvider.java
@@ -16,7 +16,7 @@
package androidx.mediarouter.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ComponentName;
import android.content.Context;
@@ -56,12 +56,6 @@
* by implementing {@link #onCreateRouteController} to return a {@link RouteController}
* for a particular route.
* </p><p>
- * A media route provider can support
- * {@link MediaRouteProviderDescriptor#supportsDynamicGroupRoute dynamic group} that
- * allows the user to add or remove a route from the selected route dynamically.
- * To control dynamic group, {@link DynamicGroupRouteController} returned by
- * {@link #onCreateDynamicGroupRouteController} is used instead of {@link RouteController}.
- * </p><p>
* A media route provider may be used privately within the scope of a single
* application process by calling {@link MediaRouter#addProvider MediaRouter.addProvider}
* to add it to the local {@link MediaRouter}. A media route provider may also be made
@@ -289,7 +283,7 @@
* cannot be controlled using the route controller interface.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Nullable
public RouteController onCreateRouteController(@NonNull String routeId,
@NonNull String routeGroupId) {
@@ -453,13 +447,18 @@
/**
* Provides control over a dynamic group route.
- * A dynamic group route is a group of routes such that a route can be added or removed
- * from the group by the user dynamically.
*/
public abstract static class DynamicGroupRouteController extends RouteController {
/**
- * Gets the title of the groupable routes section which will be shown to the user.
- * It is provided by {@link MediaRouteProvider}.
+ * Gets the ID of the dynamic group route. Note that the route may have not been
+ * published yet by the time the {@link DynamicGroupRouteController} is created.
+ */
+
+ // TODO add @link annotation in front of MediaRouteCastDialog.
+ /**
+ * Gets the title of the groupable routes section on the UX such as
+ * androidx.mediarouter.app.MediaRouteCastDialog, which is proposed by
+ * {@link MediaRouteProvider}.
* e.g. "Add a device."
*/
@Nullable
@@ -467,9 +466,10 @@
return null;
}
+ // TODO add @link annotation in front of MediaRouteCastDialog.
/**
- * Gets the title of the transferable routes section which will be shown to the user.
- * It is provided by {@link MediaRouteProvider}.
+ * Gets the title of the transferable routes section on the UX such as
+ * androidx.mediarouter.app.MediaRouteCastDialog, which is proposed by
* {@link MediaRouteProvider}.
* e.g. "Play on group."
*/
@@ -517,9 +517,6 @@
*/
public interface OnDynamicRoutesChangedListener {
/**
- * The provider should call this method when routes' properties change.
- * (e.g. when a route becomes ungroupable)
- *
* @param controller the {@link DynamicGroupRouteController} which keeps this listener.
* @param routes the collection of routes contains selected routes
* (can be unselectable or not)
@@ -544,7 +541,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({
UNSELECTING,
UNSELECTED,
diff --git a/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProviderDescriptor.java b/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProviderDescriptor.java
index 0ffb1e9..a39195fc 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProviderDescriptor.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProviderDescriptor.java
@@ -79,8 +79,6 @@
/**
* Indicates whether a {@link MediaRouteProvider} supports dynamic group route.
- *
- * @see androidx.mediarouter.media.MediaRouteProvider.DynamicGroupRouteController
*/
public boolean supportsDynamicGroupRoute() {
return mSupportsDynamicGroupRoute;
diff --git a/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProviderService.java b/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProviderService.java
index a008054..b0d2a2e 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProviderService.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouteProviderService.java
@@ -839,8 +839,7 @@
case CLIENT_MSG_CREATE_ROUTE_CONTROLLER: {
String routeId = data.getString(CLIENT_DATA_ROUTE_ID);
- String routeGroupId =
- data.getString(CLIENT_DATA_ROUTE_LIBRARY_GROUP);
+ String routeGroupId = data.getString(CLIENT_DATA_ROUTE_LIBRARY_GROUP);
if (routeId != null) {
return service.onCreateRouteController(
messenger, requestId, arg, routeId, routeGroupId);
diff --git a/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouter.java b/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouter.java
index 5aba0e9..b897495 100644
--- a/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouter.java
+++ b/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouter.java
@@ -16,7 +16,7 @@
package androidx.mediarouter.media;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
@@ -452,7 +452,7 @@
* Adds the specified route as a member to the current dynamic group.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void addMemberToSelectedRoute(RouteInfo route) {
checkCallingThread();
sGlobal.addMemberToSelectedRoute(route);
@@ -462,7 +462,7 @@
* Removes the specified route from the current dynamic group.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void removeMemberFromSelectedRoute(RouteInfo route) {
checkCallingThread();
sGlobal.removeMemberFromSelectedRoute(route);
@@ -908,7 +908,7 @@
* @see #getDeviceType
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int DEVICE_TYPE_UNKNOWN = 0;
/**
@@ -934,7 +934,7 @@
* @see #getDeviceType
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int DEVICE_TYPE_BLUETOOTH = 3;
@IntDef({PLAYBACK_VOLUME_FIXED,PLAYBACK_VOLUME_VARIABLE})
@@ -964,7 +964,7 @@
* with the route.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final int PRESENTATION_DISPLAY_ID_NONE = -1;
static final int CHANGE_GENERAL = 1 << 0;
@@ -1082,7 +1082,7 @@
* {@link DynamicRouteDescriptor#SELECTING}, or {@link DynamicRouteDescriptor#SELECTED}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public int getSelectionState() {
return (mDynamicDescriptor != null) ? mDynamicDescriptor.getSelectionState()
: DynamicRouteDescriptor.UNSELECTED;
@@ -1334,7 +1334,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isDefaultOrBluetooth() {
if (isDefault() || mDeviceType == DEVICE_TYPE_BLUETOOTH) {
return true;
@@ -1474,7 +1474,7 @@
* Gets the route's presentation display id, or -1 if none.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public int getPresentationDisplayId() {
return mPresentationDisplayId;
}
@@ -1509,7 +1509,7 @@
* Returns true if the route has one or more members
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isGroup() {
return getMemberRoutes().size() >= 1;
}
@@ -1518,7 +1518,7 @@
* Returns true if the route is a dynamic group
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isDynamicRoute() {
// If the provider of the route supports dynamic group, it should be a dynamic group.
return getProvider() != null && getProvider().supportsDynamicGroup();
@@ -1528,7 +1528,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isUnselectable() {
return mDynamicDescriptor == null || mDynamicDescriptor.isUnselectable();
}
@@ -1537,7 +1537,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isGroupable() {
return mDynamicDescriptor != null && mDynamicDescriptor.isGroupable();
}
@@ -1546,7 +1546,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isTransferable() {
return mDynamicDescriptor != null && mDynamicDescriptor.isTransferable();
}
@@ -1557,7 +1557,7 @@
* @hide
* @return The list of the routes in this group
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@NonNull
public List<RouteInfo> getMemberRoutes() {
return Collections.unmodifiableList(mMemberRoutes);
@@ -1567,7 +1567,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Nullable
public DynamicGroupRouteController getDynamicGroupController() {
//TODO: handle multiple controllers case
@@ -1771,7 +1771,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public MediaRouteProvider getProviderInstance() {
return mProvider.getProviderInstance();
}
@@ -2292,11 +2292,6 @@
+ "dynamic group route.");
}
if (!mSelectedRoute.getMemberRoutes().contains(route) || !route.isUnselectable()) {
- Log.w(TAG, "Ignoring attempt to remove not unselectable member route : " + route);
- return;
- }
- if (mSelectedRoute.getMemberRoutes().size() <= 1) {
- Log.w(TAG, "Ignoring attempt to remove the last member route.");
return;
}
((DynamicGroupRouteController) mSelectedRouteController)
@@ -2802,10 +2797,14 @@
MediaRouteProvider.DynamicGroupRouteController controller =
route.getProviderInstance().onCreateDynamicGroupRouteController(
route.mDescriptorId);
+ // Note: Controller doesn't have a valid route id yet.
+ // It will be informed with updated provider's route descriptors.
controller.setOnDynamicRoutesChangedListener(
ContextCompat.getMainExecutor(mApplicationContext),
mDynamicRoutesListener);
mSelectedRouteController = controller;
+ // Select the initial member route for now. It is replaced with dynamic group
+ // route once MRP publishes corresponding route descriptor.
mSelectedRoute = route;
} else {
mSelectedRouteController = route.getProviderInstance().onCreateRouteController(
diff --git a/mediarouter/src/main/res/layout/mr_cast_media_metadata.xml b/mediarouter/src/main/res/layout/mr_cast_media_metadata.xml
index 93165e1..4cb0353 100644
--- a/mediarouter/src/main/res/layout/mr_cast_media_metadata.xml
+++ b/mediarouter/src/main/res/layout/mr_cast_media_metadata.xml
@@ -47,8 +47,8 @@
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView android:id="@+id/mr_cast_meta_art"
- android:layout_width="@dimen/mr_cast_meta_art_size"
- android:layout_height="@dimen/mr_cast_meta_art_size"
+ android:layout_width="36dp"
+ android:layout_height="36dp"
android:scaleType="fitCenter" />
<LinearLayout android:layout_width="0dp"
android:layout_height="wrap_content"
diff --git a/mediarouter/src/main/res/values-pa/strings.xml b/mediarouter/src/main/res/values-pa/strings.xml
index 46a04e3..71224a6 100644
--- a/mediarouter/src/main/res/values-pa/strings.xml
+++ b/mediarouter/src/main/res/values-pa/strings.xml
@@ -22,7 +22,7 @@
<string name="mr_cast_button_disconnected" msgid="5501231066847739632">"\'ਕਾਸਟ ਕਰੋ\' ਬਟਨ। ਡਿਸਕਨੈਕਟ ਕੀਤਾ ਗਿਆ"</string>
<string name="mr_cast_button_connecting" msgid="8959304318293841992">"\'ਕਾਸਟ ਕਰੋ\' ਬਟਨ। ਕਨੈਕਟ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ"</string>
<string name="mr_cast_button_connected" msgid="1350095112462806159">"\'ਕਾਸਟ ਕਰੋ\' ਬਟਨ। ਕਨੈਕਟ ਕੀਤਾ ਗਿਆ"</string>
- <string name="mr_chooser_title" msgid="7548226170787476564">"ਇਸਦੇ ਨਾਲ ਕਾਸਟ ਕਰੋ"</string>
+ <string name="mr_chooser_title" msgid="7548226170787476564">"ਏਥੇ ਕਾਸਟ ਕਰੋ"</string>
<string name="mr_chooser_searching" msgid="5504553798429329689">"ਡੀਵਾਈਸ ਲੱਭੇ ਜਾ ਰਹੇ ਹਨ"</string>
<string name="mr_controller_disconnect" msgid="1370654436555555647">"ਡਿਸਕਨੈਕਟ ਕਰੋ"</string>
<string name="mr_controller_stop_casting" msgid="7617024847862349259">"ਕਾਸਟ ਕਰਨਾ ਬੰਦ ਕਰੋ"</string>
diff --git a/mediarouter/src/main/res/values/dimens.xml b/mediarouter/src/main/res/values/dimens.xml
index e8744a1..b7a91d7 100644
--- a/mediarouter/src/main/res/values/dimens.xml
+++ b/mediarouter/src/main/res/values/dimens.xml
@@ -61,8 +61,6 @@
<dimen name="mr_cast_group_volume_seekbar_height">4dp</dimen>
<!-- Size of a seekbar thumb for both route volume and group volume. -->
<dimen name="mr_cast_seekbar_thumb_size">8dp</dimen>
- <!-- Size of image view for art metadata. -->
- <dimen name="mr_cast_meta_art_size">36dp</dimen>
<!-- Volume slider layout expand/collapse animation duration. -->
<integer name="mr_cast_volume_slider_layout_animation_duration_ms">400</integer>
diff --git a/navigation/benchmark/src/androidTest/java/androidx/navigation/NavInflaterBenchmark.kt b/navigation/benchmark/src/androidTest/java/androidx/navigation/NavInflaterBenchmark.kt
index 4b1e8bd..d494054 100644
--- a/navigation/benchmark/src/androidTest/java/androidx/navigation/NavInflaterBenchmark.kt
+++ b/navigation/benchmark/src/androidTest/java/androidx/navigation/NavInflaterBenchmark.kt
@@ -20,13 +20,13 @@
import androidx.navigation.testing.TestNavigatorProvider
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.MediumTest
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
-@LargeTest
+@MediumTest
class NavInflaterBenchmark {
@get:Rule
diff --git a/navigation/common/api/1.0.0-alpha08.txt b/navigation/common/api/1.0.0-alpha08.txt
index afd5999..d5e17ab 100644
--- a/navigation/common/api/1.0.0-alpha08.txt
+++ b/navigation/common/api/1.0.0-alpha08.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
public final class NavAction {
diff --git a/navigation/common/api/1.0.0-alpha09.txt b/navigation/common/api/1.0.0-alpha09.txt
index b9499b6..436cda3 100644
--- a/navigation/common/api/1.0.0-alpha09.txt
+++ b/navigation/common/api/1.0.0-alpha09.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
public final class NavAction {
diff --git a/navigation/common/api/1.0.0-alpha10.txt b/navigation/common/api/1.0.0-alpha10.txt
index 6dd3420..67258d3 100644
--- a/navigation/common/api/1.0.0-alpha10.txt
+++ b/navigation/common/api/1.0.0-alpha10.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
public final class ActionOnlyNavDirections implements androidx.navigation.NavDirections {
diff --git a/navigation/common/api/1.0.0-alpha11.txt b/navigation/common/api/1.0.0-alpha11.txt
index 6dd3420..67258d3 100644
--- a/navigation/common/api/1.0.0-alpha11.txt
+++ b/navigation/common/api/1.0.0-alpha11.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
public final class ActionOnlyNavDirections implements androidx.navigation.NavDirections {
diff --git a/navigation/common/api/1.0.0-beta01.txt b/navigation/common/api/1.0.0-beta01.txt
deleted file mode 100644
index 6dd3420..0000000
--- a/navigation/common/api/1.0.0-beta01.txt
+++ /dev/null
@@ -1,192 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public final class ActionOnlyNavDirections implements androidx.navigation.NavDirections {
- ctor public ActionOnlyNavDirections(int);
- method public int getActionId();
- method public android.os.Bundle getArguments();
- }
-
- public final class NavAction {
- ctor public NavAction(@IdRes int);
- ctor public NavAction(@IdRes int, androidx.navigation.NavOptions?);
- ctor public NavAction(@IdRes int, androidx.navigation.NavOptions?, android.os.Bundle?);
- method public android.os.Bundle? getDefaultArguments();
- method public int getDestinationId();
- method public androidx.navigation.NavOptions? getNavOptions();
- method public void setDefaultArguments(android.os.Bundle?);
- method public void setNavOptions(androidx.navigation.NavOptions?);
- }
-
- public interface NavArgs {
- }
-
- public final class NavArgument {
- method public Object? getDefaultValue();
- method public androidx.navigation.NavType<?> getType();
- method public boolean isDefaultValuePresent();
- method public boolean isNullable();
- }
-
- public static final class NavArgument.Builder {
- ctor public NavArgument.Builder();
- method public androidx.navigation.NavArgument build();
- method public androidx.navigation.NavArgument.Builder setDefaultValue(Object?);
- method public androidx.navigation.NavArgument.Builder setIsNullable(boolean);
- method public androidx.navigation.NavArgument.Builder setType(androidx.navigation.NavType<?>);
- }
-
- public class NavDestination {
- ctor public NavDestination(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- ctor public NavDestination(String);
- method public final void addArgument(String, androidx.navigation.NavArgument);
- method public final void addDeepLink(String);
- method public final androidx.navigation.NavAction? getAction(@IdRes int);
- method public final java.util.Map<java.lang.String,androidx.navigation.NavArgument> getArguments();
- method @IdRes public final int getId();
- method public final CharSequence? getLabel();
- method public final String getNavigatorName();
- method public final androidx.navigation.NavGraph? getParent();
- method @CallSuper public void onInflate(android.content.Context, android.util.AttributeSet);
- method protected static <C> Class<? extends C> parseClassFromName(android.content.Context, String, Class<? extends C>);
- method public final void putAction(@IdRes int, @IdRes int);
- method public final void putAction(@IdRes int, androidx.navigation.NavAction);
- method public final void removeAction(@IdRes int);
- method public final void removeArgument(String);
- method public final void setId(@IdRes int);
- method public final void setLabel(CharSequence?);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface NavDestination.ClassType {
- method public abstract Class value();
- }
-
- public interface NavDirections {
- method @IdRes public int getActionId();
- method public android.os.Bundle getArguments();
- }
-
- public class NavGraph extends androidx.navigation.NavDestination implements java.lang.Iterable<androidx.navigation.NavDestination> {
- ctor public NavGraph(androidx.navigation.Navigator<? extends androidx.navigation.NavGraph>);
- method public final void addAll(androidx.navigation.NavGraph);
- method public final void addDestination(androidx.navigation.NavDestination);
- method public final void addDestinations(java.util.Collection<androidx.navigation.NavDestination>);
- method public final void addDestinations(androidx.navigation.NavDestination...);
- method public final void clear();
- method public final androidx.navigation.NavDestination? findNode(@IdRes int);
- method @IdRes public final int getStartDestination();
- method public final java.util.Iterator<androidx.navigation.NavDestination> iterator();
- method public final void remove(androidx.navigation.NavDestination);
- method public final void setStartDestination(@IdRes int);
- }
-
- @androidx.navigation.Navigator.Name("navigation") public class NavGraphNavigator extends androidx.navigation.Navigator<androidx.navigation.NavGraph> {
- ctor public NavGraphNavigator(androidx.navigation.NavigatorProvider);
- method public androidx.navigation.NavGraph createDestination();
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.NavGraph, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- public final class NavOptions {
- method @AnimRes @AnimatorRes public int getEnterAnim();
- method @AnimRes @AnimatorRes public int getExitAnim();
- method @AnimRes @AnimatorRes public int getPopEnterAnim();
- method @AnimRes @AnimatorRes public int getPopExitAnim();
- method @IdRes public int getPopUpTo();
- method public boolean isPopUpToInclusive();
- method public boolean shouldLaunchSingleTop();
- }
-
- public static final class NavOptions.Builder {
- ctor public NavOptions.Builder();
- method public androidx.navigation.NavOptions build();
- method public androidx.navigation.NavOptions.Builder setEnterAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setExitAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setLaunchSingleTop(boolean);
- method public androidx.navigation.NavOptions.Builder setPopEnterAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setPopExitAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setPopUpTo(@IdRes int, boolean);
- }
-
- public abstract class NavType<T> {
- method public static androidx.navigation.NavType<?> fromArgType(String?, String?);
- method public abstract T? get(android.os.Bundle, String);
- method public abstract String getName();
- method public boolean isNullableAllowed();
- method public abstract T parseValue(String);
- method public abstract void put(android.os.Bundle, String, T?);
- field public static final androidx.navigation.NavType<boolean[]> BoolArrayType;
- field public static final androidx.navigation.NavType<java.lang.Boolean> BoolType;
- field public static final androidx.navigation.NavType<float[]> FloatArrayType;
- field public static final androidx.navigation.NavType<java.lang.Float> FloatType;
- field public static final androidx.navigation.NavType<int[]> IntArrayType;
- field public static final androidx.navigation.NavType<java.lang.Integer> IntType;
- field public static final androidx.navigation.NavType<long[]> LongArrayType;
- field public static final androidx.navigation.NavType<java.lang.Long> LongType;
- field public static final androidx.navigation.NavType<java.lang.Integer> ReferenceType;
- field public static final androidx.navigation.NavType<java.lang.String[]> StringArrayType;
- field public static final androidx.navigation.NavType<java.lang.String> StringType;
- }
-
- public static final class NavType.EnumType<D extends java.lang.Enum> extends androidx.navigation.NavType.SerializableType<D> {
- ctor public NavType.EnumType(Class<D>);
- }
-
- public static final class NavType.ParcelableArrayType<D extends android.os.Parcelable> extends androidx.navigation.NavType<D[]> {
- ctor public NavType.ParcelableArrayType(Class<D>);
- method public D[]? get(android.os.Bundle, String);
- method public String getName();
- method public D[] parseValue(String);
- method public void put(android.os.Bundle, String, D[]?);
- }
-
- public static final class NavType.ParcelableType<D> extends androidx.navigation.NavType<D> {
- ctor public NavType.ParcelableType(Class<D>);
- method public D? get(android.os.Bundle, String);
- method public String getName();
- method public D parseValue(String);
- method public void put(android.os.Bundle, String, D?);
- }
-
- public static final class NavType.SerializableArrayType<D extends java.io.Serializable> extends androidx.navigation.NavType<D[]> {
- ctor public NavType.SerializableArrayType(Class<D>);
- method public D[]? get(android.os.Bundle, String);
- method public String getName();
- method public D[] parseValue(String);
- method public void put(android.os.Bundle, String, D[]?);
- }
-
- public static class NavType.SerializableType<D extends java.io.Serializable> extends androidx.navigation.NavType<D> {
- ctor public NavType.SerializableType(Class<D>);
- method public D? get(android.os.Bundle, String);
- method public String getName();
- method public D parseValue(String);
- method public void put(android.os.Bundle, String, D?);
- }
-
- public abstract class Navigator<D extends androidx.navigation.NavDestination> {
- ctor public Navigator();
- method public abstract D createDestination();
- method public abstract androidx.navigation.NavDestination? navigate(D, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public void onRestoreState(android.os.Bundle);
- method public android.os.Bundle? onSaveState();
- method public abstract boolean popBackStack();
- }
-
- public static interface Navigator.Extras {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface Navigator.Name {
- method public abstract String value();
- }
-
- public class NavigatorProvider {
- ctor public NavigatorProvider();
- method public final androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? addNavigator(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- method @CallSuper public androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? addNavigator(String, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- method public final <T extends androidx.navigation.Navigator<?>> T getNavigator(Class<T>);
- method @CallSuper public <T extends androidx.navigation.Navigator<?>> T getNavigator(String);
- }
-
-}
-
diff --git a/navigation/common/api/1.0.0-beta02.txt b/navigation/common/api/1.0.0-beta02.txt
deleted file mode 100644
index 6dd3420..0000000
--- a/navigation/common/api/1.0.0-beta02.txt
+++ /dev/null
@@ -1,192 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public final class ActionOnlyNavDirections implements androidx.navigation.NavDirections {
- ctor public ActionOnlyNavDirections(int);
- method public int getActionId();
- method public android.os.Bundle getArguments();
- }
-
- public final class NavAction {
- ctor public NavAction(@IdRes int);
- ctor public NavAction(@IdRes int, androidx.navigation.NavOptions?);
- ctor public NavAction(@IdRes int, androidx.navigation.NavOptions?, android.os.Bundle?);
- method public android.os.Bundle? getDefaultArguments();
- method public int getDestinationId();
- method public androidx.navigation.NavOptions? getNavOptions();
- method public void setDefaultArguments(android.os.Bundle?);
- method public void setNavOptions(androidx.navigation.NavOptions?);
- }
-
- public interface NavArgs {
- }
-
- public final class NavArgument {
- method public Object? getDefaultValue();
- method public androidx.navigation.NavType<?> getType();
- method public boolean isDefaultValuePresent();
- method public boolean isNullable();
- }
-
- public static final class NavArgument.Builder {
- ctor public NavArgument.Builder();
- method public androidx.navigation.NavArgument build();
- method public androidx.navigation.NavArgument.Builder setDefaultValue(Object?);
- method public androidx.navigation.NavArgument.Builder setIsNullable(boolean);
- method public androidx.navigation.NavArgument.Builder setType(androidx.navigation.NavType<?>);
- }
-
- public class NavDestination {
- ctor public NavDestination(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- ctor public NavDestination(String);
- method public final void addArgument(String, androidx.navigation.NavArgument);
- method public final void addDeepLink(String);
- method public final androidx.navigation.NavAction? getAction(@IdRes int);
- method public final java.util.Map<java.lang.String,androidx.navigation.NavArgument> getArguments();
- method @IdRes public final int getId();
- method public final CharSequence? getLabel();
- method public final String getNavigatorName();
- method public final androidx.navigation.NavGraph? getParent();
- method @CallSuper public void onInflate(android.content.Context, android.util.AttributeSet);
- method protected static <C> Class<? extends C> parseClassFromName(android.content.Context, String, Class<? extends C>);
- method public final void putAction(@IdRes int, @IdRes int);
- method public final void putAction(@IdRes int, androidx.navigation.NavAction);
- method public final void removeAction(@IdRes int);
- method public final void removeArgument(String);
- method public final void setId(@IdRes int);
- method public final void setLabel(CharSequence?);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface NavDestination.ClassType {
- method public abstract Class value();
- }
-
- public interface NavDirections {
- method @IdRes public int getActionId();
- method public android.os.Bundle getArguments();
- }
-
- public class NavGraph extends androidx.navigation.NavDestination implements java.lang.Iterable<androidx.navigation.NavDestination> {
- ctor public NavGraph(androidx.navigation.Navigator<? extends androidx.navigation.NavGraph>);
- method public final void addAll(androidx.navigation.NavGraph);
- method public final void addDestination(androidx.navigation.NavDestination);
- method public final void addDestinations(java.util.Collection<androidx.navigation.NavDestination>);
- method public final void addDestinations(androidx.navigation.NavDestination...);
- method public final void clear();
- method public final androidx.navigation.NavDestination? findNode(@IdRes int);
- method @IdRes public final int getStartDestination();
- method public final java.util.Iterator<androidx.navigation.NavDestination> iterator();
- method public final void remove(androidx.navigation.NavDestination);
- method public final void setStartDestination(@IdRes int);
- }
-
- @androidx.navigation.Navigator.Name("navigation") public class NavGraphNavigator extends androidx.navigation.Navigator<androidx.navigation.NavGraph> {
- ctor public NavGraphNavigator(androidx.navigation.NavigatorProvider);
- method public androidx.navigation.NavGraph createDestination();
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.NavGraph, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- public final class NavOptions {
- method @AnimRes @AnimatorRes public int getEnterAnim();
- method @AnimRes @AnimatorRes public int getExitAnim();
- method @AnimRes @AnimatorRes public int getPopEnterAnim();
- method @AnimRes @AnimatorRes public int getPopExitAnim();
- method @IdRes public int getPopUpTo();
- method public boolean isPopUpToInclusive();
- method public boolean shouldLaunchSingleTop();
- }
-
- public static final class NavOptions.Builder {
- ctor public NavOptions.Builder();
- method public androidx.navigation.NavOptions build();
- method public androidx.navigation.NavOptions.Builder setEnterAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setExitAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setLaunchSingleTop(boolean);
- method public androidx.navigation.NavOptions.Builder setPopEnterAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setPopExitAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setPopUpTo(@IdRes int, boolean);
- }
-
- public abstract class NavType<T> {
- method public static androidx.navigation.NavType<?> fromArgType(String?, String?);
- method public abstract T? get(android.os.Bundle, String);
- method public abstract String getName();
- method public boolean isNullableAllowed();
- method public abstract T parseValue(String);
- method public abstract void put(android.os.Bundle, String, T?);
- field public static final androidx.navigation.NavType<boolean[]> BoolArrayType;
- field public static final androidx.navigation.NavType<java.lang.Boolean> BoolType;
- field public static final androidx.navigation.NavType<float[]> FloatArrayType;
- field public static final androidx.navigation.NavType<java.lang.Float> FloatType;
- field public static final androidx.navigation.NavType<int[]> IntArrayType;
- field public static final androidx.navigation.NavType<java.lang.Integer> IntType;
- field public static final androidx.navigation.NavType<long[]> LongArrayType;
- field public static final androidx.navigation.NavType<java.lang.Long> LongType;
- field public static final androidx.navigation.NavType<java.lang.Integer> ReferenceType;
- field public static final androidx.navigation.NavType<java.lang.String[]> StringArrayType;
- field public static final androidx.navigation.NavType<java.lang.String> StringType;
- }
-
- public static final class NavType.EnumType<D extends java.lang.Enum> extends androidx.navigation.NavType.SerializableType<D> {
- ctor public NavType.EnumType(Class<D>);
- }
-
- public static final class NavType.ParcelableArrayType<D extends android.os.Parcelable> extends androidx.navigation.NavType<D[]> {
- ctor public NavType.ParcelableArrayType(Class<D>);
- method public D[]? get(android.os.Bundle, String);
- method public String getName();
- method public D[] parseValue(String);
- method public void put(android.os.Bundle, String, D[]?);
- }
-
- public static final class NavType.ParcelableType<D> extends androidx.navigation.NavType<D> {
- ctor public NavType.ParcelableType(Class<D>);
- method public D? get(android.os.Bundle, String);
- method public String getName();
- method public D parseValue(String);
- method public void put(android.os.Bundle, String, D?);
- }
-
- public static final class NavType.SerializableArrayType<D extends java.io.Serializable> extends androidx.navigation.NavType<D[]> {
- ctor public NavType.SerializableArrayType(Class<D>);
- method public D[]? get(android.os.Bundle, String);
- method public String getName();
- method public D[] parseValue(String);
- method public void put(android.os.Bundle, String, D[]?);
- }
-
- public static class NavType.SerializableType<D extends java.io.Serializable> extends androidx.navigation.NavType<D> {
- ctor public NavType.SerializableType(Class<D>);
- method public D? get(android.os.Bundle, String);
- method public String getName();
- method public D parseValue(String);
- method public void put(android.os.Bundle, String, D?);
- }
-
- public abstract class Navigator<D extends androidx.navigation.NavDestination> {
- ctor public Navigator();
- method public abstract D createDestination();
- method public abstract androidx.navigation.NavDestination? navigate(D, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public void onRestoreState(android.os.Bundle);
- method public android.os.Bundle? onSaveState();
- method public abstract boolean popBackStack();
- }
-
- public static interface Navigator.Extras {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface Navigator.Name {
- method public abstract String value();
- }
-
- public class NavigatorProvider {
- ctor public NavigatorProvider();
- method public final androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? addNavigator(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- method @CallSuper public androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? addNavigator(String, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- method public final <T extends androidx.navigation.Navigator<?>> T getNavigator(Class<T>);
- method @CallSuper public <T extends androidx.navigation.Navigator<?>> T getNavigator(String);
- }
-
-}
-
diff --git a/navigation/common/api/1.0.0-rc01.txt b/navigation/common/api/1.0.0-rc01.txt
deleted file mode 100644
index 6dd3420..0000000
--- a/navigation/common/api/1.0.0-rc01.txt
+++ /dev/null
@@ -1,192 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public final class ActionOnlyNavDirections implements androidx.navigation.NavDirections {
- ctor public ActionOnlyNavDirections(int);
- method public int getActionId();
- method public android.os.Bundle getArguments();
- }
-
- public final class NavAction {
- ctor public NavAction(@IdRes int);
- ctor public NavAction(@IdRes int, androidx.navigation.NavOptions?);
- ctor public NavAction(@IdRes int, androidx.navigation.NavOptions?, android.os.Bundle?);
- method public android.os.Bundle? getDefaultArguments();
- method public int getDestinationId();
- method public androidx.navigation.NavOptions? getNavOptions();
- method public void setDefaultArguments(android.os.Bundle?);
- method public void setNavOptions(androidx.navigation.NavOptions?);
- }
-
- public interface NavArgs {
- }
-
- public final class NavArgument {
- method public Object? getDefaultValue();
- method public androidx.navigation.NavType<?> getType();
- method public boolean isDefaultValuePresent();
- method public boolean isNullable();
- }
-
- public static final class NavArgument.Builder {
- ctor public NavArgument.Builder();
- method public androidx.navigation.NavArgument build();
- method public androidx.navigation.NavArgument.Builder setDefaultValue(Object?);
- method public androidx.navigation.NavArgument.Builder setIsNullable(boolean);
- method public androidx.navigation.NavArgument.Builder setType(androidx.navigation.NavType<?>);
- }
-
- public class NavDestination {
- ctor public NavDestination(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- ctor public NavDestination(String);
- method public final void addArgument(String, androidx.navigation.NavArgument);
- method public final void addDeepLink(String);
- method public final androidx.navigation.NavAction? getAction(@IdRes int);
- method public final java.util.Map<java.lang.String,androidx.navigation.NavArgument> getArguments();
- method @IdRes public final int getId();
- method public final CharSequence? getLabel();
- method public final String getNavigatorName();
- method public final androidx.navigation.NavGraph? getParent();
- method @CallSuper public void onInflate(android.content.Context, android.util.AttributeSet);
- method protected static <C> Class<? extends C> parseClassFromName(android.content.Context, String, Class<? extends C>);
- method public final void putAction(@IdRes int, @IdRes int);
- method public final void putAction(@IdRes int, androidx.navigation.NavAction);
- method public final void removeAction(@IdRes int);
- method public final void removeArgument(String);
- method public final void setId(@IdRes int);
- method public final void setLabel(CharSequence?);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface NavDestination.ClassType {
- method public abstract Class value();
- }
-
- public interface NavDirections {
- method @IdRes public int getActionId();
- method public android.os.Bundle getArguments();
- }
-
- public class NavGraph extends androidx.navigation.NavDestination implements java.lang.Iterable<androidx.navigation.NavDestination> {
- ctor public NavGraph(androidx.navigation.Navigator<? extends androidx.navigation.NavGraph>);
- method public final void addAll(androidx.navigation.NavGraph);
- method public final void addDestination(androidx.navigation.NavDestination);
- method public final void addDestinations(java.util.Collection<androidx.navigation.NavDestination>);
- method public final void addDestinations(androidx.navigation.NavDestination...);
- method public final void clear();
- method public final androidx.navigation.NavDestination? findNode(@IdRes int);
- method @IdRes public final int getStartDestination();
- method public final java.util.Iterator<androidx.navigation.NavDestination> iterator();
- method public final void remove(androidx.navigation.NavDestination);
- method public final void setStartDestination(@IdRes int);
- }
-
- @androidx.navigation.Navigator.Name("navigation") public class NavGraphNavigator extends androidx.navigation.Navigator<androidx.navigation.NavGraph> {
- ctor public NavGraphNavigator(androidx.navigation.NavigatorProvider);
- method public androidx.navigation.NavGraph createDestination();
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.NavGraph, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- public final class NavOptions {
- method @AnimRes @AnimatorRes public int getEnterAnim();
- method @AnimRes @AnimatorRes public int getExitAnim();
- method @AnimRes @AnimatorRes public int getPopEnterAnim();
- method @AnimRes @AnimatorRes public int getPopExitAnim();
- method @IdRes public int getPopUpTo();
- method public boolean isPopUpToInclusive();
- method public boolean shouldLaunchSingleTop();
- }
-
- public static final class NavOptions.Builder {
- ctor public NavOptions.Builder();
- method public androidx.navigation.NavOptions build();
- method public androidx.navigation.NavOptions.Builder setEnterAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setExitAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setLaunchSingleTop(boolean);
- method public androidx.navigation.NavOptions.Builder setPopEnterAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setPopExitAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setPopUpTo(@IdRes int, boolean);
- }
-
- public abstract class NavType<T> {
- method public static androidx.navigation.NavType<?> fromArgType(String?, String?);
- method public abstract T? get(android.os.Bundle, String);
- method public abstract String getName();
- method public boolean isNullableAllowed();
- method public abstract T parseValue(String);
- method public abstract void put(android.os.Bundle, String, T?);
- field public static final androidx.navigation.NavType<boolean[]> BoolArrayType;
- field public static final androidx.navigation.NavType<java.lang.Boolean> BoolType;
- field public static final androidx.navigation.NavType<float[]> FloatArrayType;
- field public static final androidx.navigation.NavType<java.lang.Float> FloatType;
- field public static final androidx.navigation.NavType<int[]> IntArrayType;
- field public static final androidx.navigation.NavType<java.lang.Integer> IntType;
- field public static final androidx.navigation.NavType<long[]> LongArrayType;
- field public static final androidx.navigation.NavType<java.lang.Long> LongType;
- field public static final androidx.navigation.NavType<java.lang.Integer> ReferenceType;
- field public static final androidx.navigation.NavType<java.lang.String[]> StringArrayType;
- field public static final androidx.navigation.NavType<java.lang.String> StringType;
- }
-
- public static final class NavType.EnumType<D extends java.lang.Enum> extends androidx.navigation.NavType.SerializableType<D> {
- ctor public NavType.EnumType(Class<D>);
- }
-
- public static final class NavType.ParcelableArrayType<D extends android.os.Parcelable> extends androidx.navigation.NavType<D[]> {
- ctor public NavType.ParcelableArrayType(Class<D>);
- method public D[]? get(android.os.Bundle, String);
- method public String getName();
- method public D[] parseValue(String);
- method public void put(android.os.Bundle, String, D[]?);
- }
-
- public static final class NavType.ParcelableType<D> extends androidx.navigation.NavType<D> {
- ctor public NavType.ParcelableType(Class<D>);
- method public D? get(android.os.Bundle, String);
- method public String getName();
- method public D parseValue(String);
- method public void put(android.os.Bundle, String, D?);
- }
-
- public static final class NavType.SerializableArrayType<D extends java.io.Serializable> extends androidx.navigation.NavType<D[]> {
- ctor public NavType.SerializableArrayType(Class<D>);
- method public D[]? get(android.os.Bundle, String);
- method public String getName();
- method public D[] parseValue(String);
- method public void put(android.os.Bundle, String, D[]?);
- }
-
- public static class NavType.SerializableType<D extends java.io.Serializable> extends androidx.navigation.NavType<D> {
- ctor public NavType.SerializableType(Class<D>);
- method public D? get(android.os.Bundle, String);
- method public String getName();
- method public D parseValue(String);
- method public void put(android.os.Bundle, String, D?);
- }
-
- public abstract class Navigator<D extends androidx.navigation.NavDestination> {
- ctor public Navigator();
- method public abstract D createDestination();
- method public abstract androidx.navigation.NavDestination? navigate(D, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public void onRestoreState(android.os.Bundle);
- method public android.os.Bundle? onSaveState();
- method public abstract boolean popBackStack();
- }
-
- public static interface Navigator.Extras {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface Navigator.Name {
- method public abstract String value();
- }
-
- public class NavigatorProvider {
- ctor public NavigatorProvider();
- method public final androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? addNavigator(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- method @CallSuper public androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? addNavigator(String, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- method public final <T extends androidx.navigation.Navigator<?>> T getNavigator(Class<T>);
- method @CallSuper public <T extends androidx.navigation.Navigator<?>> T getNavigator(String);
- }
-
-}
-
diff --git a/navigation/common/api/1.0.0-rc02.txt b/navigation/common/api/1.0.0-rc02.txt
deleted file mode 100644
index 6dd3420..0000000
--- a/navigation/common/api/1.0.0-rc02.txt
+++ /dev/null
@@ -1,192 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public final class ActionOnlyNavDirections implements androidx.navigation.NavDirections {
- ctor public ActionOnlyNavDirections(int);
- method public int getActionId();
- method public android.os.Bundle getArguments();
- }
-
- public final class NavAction {
- ctor public NavAction(@IdRes int);
- ctor public NavAction(@IdRes int, androidx.navigation.NavOptions?);
- ctor public NavAction(@IdRes int, androidx.navigation.NavOptions?, android.os.Bundle?);
- method public android.os.Bundle? getDefaultArguments();
- method public int getDestinationId();
- method public androidx.navigation.NavOptions? getNavOptions();
- method public void setDefaultArguments(android.os.Bundle?);
- method public void setNavOptions(androidx.navigation.NavOptions?);
- }
-
- public interface NavArgs {
- }
-
- public final class NavArgument {
- method public Object? getDefaultValue();
- method public androidx.navigation.NavType<?> getType();
- method public boolean isDefaultValuePresent();
- method public boolean isNullable();
- }
-
- public static final class NavArgument.Builder {
- ctor public NavArgument.Builder();
- method public androidx.navigation.NavArgument build();
- method public androidx.navigation.NavArgument.Builder setDefaultValue(Object?);
- method public androidx.navigation.NavArgument.Builder setIsNullable(boolean);
- method public androidx.navigation.NavArgument.Builder setType(androidx.navigation.NavType<?>);
- }
-
- public class NavDestination {
- ctor public NavDestination(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- ctor public NavDestination(String);
- method public final void addArgument(String, androidx.navigation.NavArgument);
- method public final void addDeepLink(String);
- method public final androidx.navigation.NavAction? getAction(@IdRes int);
- method public final java.util.Map<java.lang.String,androidx.navigation.NavArgument> getArguments();
- method @IdRes public final int getId();
- method public final CharSequence? getLabel();
- method public final String getNavigatorName();
- method public final androidx.navigation.NavGraph? getParent();
- method @CallSuper public void onInflate(android.content.Context, android.util.AttributeSet);
- method protected static <C> Class<? extends C> parseClassFromName(android.content.Context, String, Class<? extends C>);
- method public final void putAction(@IdRes int, @IdRes int);
- method public final void putAction(@IdRes int, androidx.navigation.NavAction);
- method public final void removeAction(@IdRes int);
- method public final void removeArgument(String);
- method public final void setId(@IdRes int);
- method public final void setLabel(CharSequence?);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface NavDestination.ClassType {
- method public abstract Class value();
- }
-
- public interface NavDirections {
- method @IdRes public int getActionId();
- method public android.os.Bundle getArguments();
- }
-
- public class NavGraph extends androidx.navigation.NavDestination implements java.lang.Iterable<androidx.navigation.NavDestination> {
- ctor public NavGraph(androidx.navigation.Navigator<? extends androidx.navigation.NavGraph>);
- method public final void addAll(androidx.navigation.NavGraph);
- method public final void addDestination(androidx.navigation.NavDestination);
- method public final void addDestinations(java.util.Collection<androidx.navigation.NavDestination>);
- method public final void addDestinations(androidx.navigation.NavDestination...);
- method public final void clear();
- method public final androidx.navigation.NavDestination? findNode(@IdRes int);
- method @IdRes public final int getStartDestination();
- method public final java.util.Iterator<androidx.navigation.NavDestination> iterator();
- method public final void remove(androidx.navigation.NavDestination);
- method public final void setStartDestination(@IdRes int);
- }
-
- @androidx.navigation.Navigator.Name("navigation") public class NavGraphNavigator extends androidx.navigation.Navigator<androidx.navigation.NavGraph> {
- ctor public NavGraphNavigator(androidx.navigation.NavigatorProvider);
- method public androidx.navigation.NavGraph createDestination();
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.NavGraph, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- public final class NavOptions {
- method @AnimRes @AnimatorRes public int getEnterAnim();
- method @AnimRes @AnimatorRes public int getExitAnim();
- method @AnimRes @AnimatorRes public int getPopEnterAnim();
- method @AnimRes @AnimatorRes public int getPopExitAnim();
- method @IdRes public int getPopUpTo();
- method public boolean isPopUpToInclusive();
- method public boolean shouldLaunchSingleTop();
- }
-
- public static final class NavOptions.Builder {
- ctor public NavOptions.Builder();
- method public androidx.navigation.NavOptions build();
- method public androidx.navigation.NavOptions.Builder setEnterAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setExitAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setLaunchSingleTop(boolean);
- method public androidx.navigation.NavOptions.Builder setPopEnterAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setPopExitAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setPopUpTo(@IdRes int, boolean);
- }
-
- public abstract class NavType<T> {
- method public static androidx.navigation.NavType<?> fromArgType(String?, String?);
- method public abstract T? get(android.os.Bundle, String);
- method public abstract String getName();
- method public boolean isNullableAllowed();
- method public abstract T parseValue(String);
- method public abstract void put(android.os.Bundle, String, T?);
- field public static final androidx.navigation.NavType<boolean[]> BoolArrayType;
- field public static final androidx.navigation.NavType<java.lang.Boolean> BoolType;
- field public static final androidx.navigation.NavType<float[]> FloatArrayType;
- field public static final androidx.navigation.NavType<java.lang.Float> FloatType;
- field public static final androidx.navigation.NavType<int[]> IntArrayType;
- field public static final androidx.navigation.NavType<java.lang.Integer> IntType;
- field public static final androidx.navigation.NavType<long[]> LongArrayType;
- field public static final androidx.navigation.NavType<java.lang.Long> LongType;
- field public static final androidx.navigation.NavType<java.lang.Integer> ReferenceType;
- field public static final androidx.navigation.NavType<java.lang.String[]> StringArrayType;
- field public static final androidx.navigation.NavType<java.lang.String> StringType;
- }
-
- public static final class NavType.EnumType<D extends java.lang.Enum> extends androidx.navigation.NavType.SerializableType<D> {
- ctor public NavType.EnumType(Class<D>);
- }
-
- public static final class NavType.ParcelableArrayType<D extends android.os.Parcelable> extends androidx.navigation.NavType<D[]> {
- ctor public NavType.ParcelableArrayType(Class<D>);
- method public D[]? get(android.os.Bundle, String);
- method public String getName();
- method public D[] parseValue(String);
- method public void put(android.os.Bundle, String, D[]?);
- }
-
- public static final class NavType.ParcelableType<D> extends androidx.navigation.NavType<D> {
- ctor public NavType.ParcelableType(Class<D>);
- method public D? get(android.os.Bundle, String);
- method public String getName();
- method public D parseValue(String);
- method public void put(android.os.Bundle, String, D?);
- }
-
- public static final class NavType.SerializableArrayType<D extends java.io.Serializable> extends androidx.navigation.NavType<D[]> {
- ctor public NavType.SerializableArrayType(Class<D>);
- method public D[]? get(android.os.Bundle, String);
- method public String getName();
- method public D[] parseValue(String);
- method public void put(android.os.Bundle, String, D[]?);
- }
-
- public static class NavType.SerializableType<D extends java.io.Serializable> extends androidx.navigation.NavType<D> {
- ctor public NavType.SerializableType(Class<D>);
- method public D? get(android.os.Bundle, String);
- method public String getName();
- method public D parseValue(String);
- method public void put(android.os.Bundle, String, D?);
- }
-
- public abstract class Navigator<D extends androidx.navigation.NavDestination> {
- ctor public Navigator();
- method public abstract D createDestination();
- method public abstract androidx.navigation.NavDestination? navigate(D, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public void onRestoreState(android.os.Bundle);
- method public android.os.Bundle? onSaveState();
- method public abstract boolean popBackStack();
- }
-
- public static interface Navigator.Extras {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface Navigator.Name {
- method public abstract String value();
- }
-
- public class NavigatorProvider {
- ctor public NavigatorProvider();
- method public final androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? addNavigator(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- method @CallSuper public androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? addNavigator(String, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- method public final <T extends androidx.navigation.Navigator<?>> T getNavigator(Class<T>);
- method @CallSuper public <T extends androidx.navigation.Navigator<?>> T getNavigator(String);
- }
-
-}
-
diff --git a/navigation/common/api/2.0.0-rc02.txt b/navigation/common/api/2.0.0-rc02.txt
deleted file mode 100644
index 6dd3420..0000000
--- a/navigation/common/api/2.0.0-rc02.txt
+++ /dev/null
@@ -1,192 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public final class ActionOnlyNavDirections implements androidx.navigation.NavDirections {
- ctor public ActionOnlyNavDirections(int);
- method public int getActionId();
- method public android.os.Bundle getArguments();
- }
-
- public final class NavAction {
- ctor public NavAction(@IdRes int);
- ctor public NavAction(@IdRes int, androidx.navigation.NavOptions?);
- ctor public NavAction(@IdRes int, androidx.navigation.NavOptions?, android.os.Bundle?);
- method public android.os.Bundle? getDefaultArguments();
- method public int getDestinationId();
- method public androidx.navigation.NavOptions? getNavOptions();
- method public void setDefaultArguments(android.os.Bundle?);
- method public void setNavOptions(androidx.navigation.NavOptions?);
- }
-
- public interface NavArgs {
- }
-
- public final class NavArgument {
- method public Object? getDefaultValue();
- method public androidx.navigation.NavType<?> getType();
- method public boolean isDefaultValuePresent();
- method public boolean isNullable();
- }
-
- public static final class NavArgument.Builder {
- ctor public NavArgument.Builder();
- method public androidx.navigation.NavArgument build();
- method public androidx.navigation.NavArgument.Builder setDefaultValue(Object?);
- method public androidx.navigation.NavArgument.Builder setIsNullable(boolean);
- method public androidx.navigation.NavArgument.Builder setType(androidx.navigation.NavType<?>);
- }
-
- public class NavDestination {
- ctor public NavDestination(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- ctor public NavDestination(String);
- method public final void addArgument(String, androidx.navigation.NavArgument);
- method public final void addDeepLink(String);
- method public final androidx.navigation.NavAction? getAction(@IdRes int);
- method public final java.util.Map<java.lang.String,androidx.navigation.NavArgument> getArguments();
- method @IdRes public final int getId();
- method public final CharSequence? getLabel();
- method public final String getNavigatorName();
- method public final androidx.navigation.NavGraph? getParent();
- method @CallSuper public void onInflate(android.content.Context, android.util.AttributeSet);
- method protected static <C> Class<? extends C> parseClassFromName(android.content.Context, String, Class<? extends C>);
- method public final void putAction(@IdRes int, @IdRes int);
- method public final void putAction(@IdRes int, androidx.navigation.NavAction);
- method public final void removeAction(@IdRes int);
- method public final void removeArgument(String);
- method public final void setId(@IdRes int);
- method public final void setLabel(CharSequence?);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface NavDestination.ClassType {
- method public abstract Class value();
- }
-
- public interface NavDirections {
- method @IdRes public int getActionId();
- method public android.os.Bundle getArguments();
- }
-
- public class NavGraph extends androidx.navigation.NavDestination implements java.lang.Iterable<androidx.navigation.NavDestination> {
- ctor public NavGraph(androidx.navigation.Navigator<? extends androidx.navigation.NavGraph>);
- method public final void addAll(androidx.navigation.NavGraph);
- method public final void addDestination(androidx.navigation.NavDestination);
- method public final void addDestinations(java.util.Collection<androidx.navigation.NavDestination>);
- method public final void addDestinations(androidx.navigation.NavDestination...);
- method public final void clear();
- method public final androidx.navigation.NavDestination? findNode(@IdRes int);
- method @IdRes public final int getStartDestination();
- method public final java.util.Iterator<androidx.navigation.NavDestination> iterator();
- method public final void remove(androidx.navigation.NavDestination);
- method public final void setStartDestination(@IdRes int);
- }
-
- @androidx.navigation.Navigator.Name("navigation") public class NavGraphNavigator extends androidx.navigation.Navigator<androidx.navigation.NavGraph> {
- ctor public NavGraphNavigator(androidx.navigation.NavigatorProvider);
- method public androidx.navigation.NavGraph createDestination();
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.NavGraph, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- public final class NavOptions {
- method @AnimRes @AnimatorRes public int getEnterAnim();
- method @AnimRes @AnimatorRes public int getExitAnim();
- method @AnimRes @AnimatorRes public int getPopEnterAnim();
- method @AnimRes @AnimatorRes public int getPopExitAnim();
- method @IdRes public int getPopUpTo();
- method public boolean isPopUpToInclusive();
- method public boolean shouldLaunchSingleTop();
- }
-
- public static final class NavOptions.Builder {
- ctor public NavOptions.Builder();
- method public androidx.navigation.NavOptions build();
- method public androidx.navigation.NavOptions.Builder setEnterAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setExitAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setLaunchSingleTop(boolean);
- method public androidx.navigation.NavOptions.Builder setPopEnterAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setPopExitAnim(@AnimRes @AnimatorRes int);
- method public androidx.navigation.NavOptions.Builder setPopUpTo(@IdRes int, boolean);
- }
-
- public abstract class NavType<T> {
- method public static androidx.navigation.NavType<?> fromArgType(String?, String?);
- method public abstract T? get(android.os.Bundle, String);
- method public abstract String getName();
- method public boolean isNullableAllowed();
- method public abstract T parseValue(String);
- method public abstract void put(android.os.Bundle, String, T?);
- field public static final androidx.navigation.NavType<boolean[]> BoolArrayType;
- field public static final androidx.navigation.NavType<java.lang.Boolean> BoolType;
- field public static final androidx.navigation.NavType<float[]> FloatArrayType;
- field public static final androidx.navigation.NavType<java.lang.Float> FloatType;
- field public static final androidx.navigation.NavType<int[]> IntArrayType;
- field public static final androidx.navigation.NavType<java.lang.Integer> IntType;
- field public static final androidx.navigation.NavType<long[]> LongArrayType;
- field public static final androidx.navigation.NavType<java.lang.Long> LongType;
- field public static final androidx.navigation.NavType<java.lang.Integer> ReferenceType;
- field public static final androidx.navigation.NavType<java.lang.String[]> StringArrayType;
- field public static final androidx.navigation.NavType<java.lang.String> StringType;
- }
-
- public static final class NavType.EnumType<D extends java.lang.Enum> extends androidx.navigation.NavType.SerializableType<D> {
- ctor public NavType.EnumType(Class<D>);
- }
-
- public static final class NavType.ParcelableArrayType<D extends android.os.Parcelable> extends androidx.navigation.NavType<D[]> {
- ctor public NavType.ParcelableArrayType(Class<D>);
- method public D[]? get(android.os.Bundle, String);
- method public String getName();
- method public D[] parseValue(String);
- method public void put(android.os.Bundle, String, D[]?);
- }
-
- public static final class NavType.ParcelableType<D> extends androidx.navigation.NavType<D> {
- ctor public NavType.ParcelableType(Class<D>);
- method public D? get(android.os.Bundle, String);
- method public String getName();
- method public D parseValue(String);
- method public void put(android.os.Bundle, String, D?);
- }
-
- public static final class NavType.SerializableArrayType<D extends java.io.Serializable> extends androidx.navigation.NavType<D[]> {
- ctor public NavType.SerializableArrayType(Class<D>);
- method public D[]? get(android.os.Bundle, String);
- method public String getName();
- method public D[] parseValue(String);
- method public void put(android.os.Bundle, String, D[]?);
- }
-
- public static class NavType.SerializableType<D extends java.io.Serializable> extends androidx.navigation.NavType<D> {
- ctor public NavType.SerializableType(Class<D>);
- method public D? get(android.os.Bundle, String);
- method public String getName();
- method public D parseValue(String);
- method public void put(android.os.Bundle, String, D?);
- }
-
- public abstract class Navigator<D extends androidx.navigation.NavDestination> {
- ctor public Navigator();
- method public abstract D createDestination();
- method public abstract androidx.navigation.NavDestination? navigate(D, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public void onRestoreState(android.os.Bundle);
- method public android.os.Bundle? onSaveState();
- method public abstract boolean popBackStack();
- }
-
- public static interface Navigator.Extras {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public static @interface Navigator.Name {
- method public abstract String value();
- }
-
- public class NavigatorProvider {
- ctor public NavigatorProvider();
- method public final androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? addNavigator(androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- method @CallSuper public androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? addNavigator(String, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>);
- method public final <T extends androidx.navigation.Navigator<?>> T getNavigator(Class<T>);
- method @CallSuper public <T extends androidx.navigation.Navigator<?>> T getNavigator(String);
- }
-
-}
-
diff --git a/navigation/common/api/current.txt b/navigation/common/api/current.txt
index 6dd3420..67258d3 100644
--- a/navigation/common/api/current.txt
+++ b/navigation/common/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
public final class ActionOnlyNavDirections implements androidx.navigation.NavDirections {
diff --git a/navigation/common/api/res-1.0.0-beta01.txt b/navigation/common/api/res-1.0.0-beta01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/common/api/res-1.0.0-beta01.txt
+++ /dev/null
diff --git a/navigation/common/api/res-1.0.0-beta02.txt b/navigation/common/api/res-1.0.0-beta02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/common/api/res-1.0.0-beta02.txt
+++ /dev/null
diff --git a/navigation/common/api/res-1.0.0-rc01.txt b/navigation/common/api/res-1.0.0-rc01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/common/api/res-1.0.0-rc01.txt
+++ /dev/null
diff --git a/navigation/common/api/res-1.0.0-rc02.txt b/navigation/common/api/res-1.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/common/api/res-1.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/common/api/res-2.0.0-rc02.txt b/navigation/common/api/res-2.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/common/api/res-2.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/common/api/restricted_1.0.0-beta01.txt b/navigation/common/api/restricted_1.0.0-beta01.txt
deleted file mode 100644
index 6b517ce..0000000
--- a/navigation/common/api/restricted_1.0.0-beta01.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public abstract class Navigator<D extends androidx.navigation.NavDestination> {
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final void addOnNavigatorBackPressListener(androidx.navigation.Navigator.OnNavigatorBackPressListener);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final void dispatchOnNavigatorBackPress();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void onBackPressAdded();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void onBackPressRemoved();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final void removeOnNavigatorBackPressListener(androidx.navigation.Navigator.OnNavigatorBackPressListener);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static interface Navigator.OnNavigatorBackPressListener {
- method public void onPopBackStack(androidx.navigation.Navigator);
- }
-
-}
-
diff --git a/navigation/common/api/restricted_1.0.0-beta02.txt b/navigation/common/api/restricted_1.0.0-beta02.txt
deleted file mode 100644
index fddd508..0000000
--- a/navigation/common/api/restricted_1.0.0-beta02.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public abstract class Navigator<D extends androidx.navigation.NavDestination> {
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void addOnNavigatorBackPressListener(androidx.navigation.Navigator.OnNavigatorBackPressListener);
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void dispatchOnNavigatorBackPress();
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) protected void onBackPressAdded();
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) protected void onBackPressRemoved();
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void removeOnNavigatorBackPressListener(androidx.navigation.Navigator.OnNavigatorBackPressListener);
- }
-
- @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static interface Navigator.OnNavigatorBackPressListener {
- method public void onPopBackStack(androidx.navigation.Navigator);
- }
-
-}
-
diff --git a/navigation/common/api/restricted_1.0.0-rc01.txt b/navigation/common/api/restricted_1.0.0-rc01.txt
deleted file mode 100644
index fddd508..0000000
--- a/navigation/common/api/restricted_1.0.0-rc01.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public abstract class Navigator<D extends androidx.navigation.NavDestination> {
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void addOnNavigatorBackPressListener(androidx.navigation.Navigator.OnNavigatorBackPressListener);
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void dispatchOnNavigatorBackPress();
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) protected void onBackPressAdded();
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) protected void onBackPressRemoved();
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void removeOnNavigatorBackPressListener(androidx.navigation.Navigator.OnNavigatorBackPressListener);
- }
-
- @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static interface Navigator.OnNavigatorBackPressListener {
- method public void onPopBackStack(androidx.navigation.Navigator);
- }
-
-}
-
diff --git a/navigation/common/api/restricted_1.0.0-rc02.txt b/navigation/common/api/restricted_1.0.0-rc02.txt
deleted file mode 100644
index fddd508..0000000
--- a/navigation/common/api/restricted_1.0.0-rc02.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public abstract class Navigator<D extends androidx.navigation.NavDestination> {
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void addOnNavigatorBackPressListener(androidx.navigation.Navigator.OnNavigatorBackPressListener);
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void dispatchOnNavigatorBackPress();
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) protected void onBackPressAdded();
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) protected void onBackPressRemoved();
- method @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void removeOnNavigatorBackPressListener(androidx.navigation.Navigator.OnNavigatorBackPressListener);
- }
-
- @RestrictTo(android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static interface Navigator.OnNavigatorBackPressListener {
- method public void onPopBackStack(androidx.navigation.Navigator);
- }
-
-}
-
diff --git a/navigation/common/api/restricted_2.0.0-rc02.txt b/navigation/common/api/restricted_2.0.0-rc02.txt
deleted file mode 100644
index 37d70c2..0000000
--- a/navigation/common/api/restricted_2.0.0-rc02.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public abstract class Navigator<D extends androidx.navigation.NavDestination> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void addOnNavigatorBackPressListener(androidx.navigation.Navigator.OnNavigatorBackPressListener);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void dispatchOnNavigatorBackPress();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) protected void onBackPressAdded();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) protected void onBackPressRemoved();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void removeOnNavigatorBackPressListener(androidx.navigation.Navigator.OnNavigatorBackPressListener);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static interface Navigator.OnNavigatorBackPressListener {
- method public void onPopBackStack(androidx.navigation.Navigator);
- }
-
-}
-
diff --git a/navigation/common/api/restricted_current.txt b/navigation/common/api/restricted_current.txt
deleted file mode 100644
index 37d70c2..0000000
--- a/navigation/common/api/restricted_current.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public abstract class Navigator<D extends androidx.navigation.NavDestination> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void addOnNavigatorBackPressListener(androidx.navigation.Navigator.OnNavigatorBackPressListener);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void dispatchOnNavigatorBackPress();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) protected void onBackPressAdded();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) protected void onBackPressRemoved();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public final void removeOnNavigatorBackPressListener(androidx.navigation.Navigator.OnNavigatorBackPressListener);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static interface Navigator.OnNavigatorBackPressListener {
- method public void onPopBackStack(androidx.navigation.Navigator);
- }
-
-}
-
diff --git a/navigation/common/build.gradle b/navigation/common/build.gradle
index 9aa6e63..30df98c 100644
--- a/navigation/common/build.gradle
+++ b/navigation/common/build.gradle
@@ -32,7 +32,6 @@
dependencies {
api(NAV_SUPPORT_COMPAT)
- implementation(NAV_SUPPORT_COLLECTIONS)
testImplementation(JUNIT)
testImplementation(MOCKITO_CORE)
@@ -57,8 +56,8 @@
def name = variant.name
def suffix = name.capitalize()
project.tasks.create(name: "jar${suffix}", type: Jar){
- dependsOn variant.javaCompileProvider.get()
- from variant.javaCompileProvider.get().destinationDir
+ dependsOn variant.javaCompile
+ from variant.javaCompile.destinationDir
destinationDir new File(project.buildDir, "libJar")
}
}
diff --git a/navigation/common/ktx/api/1.0.0-alpha08.txt b/navigation/common/ktx/api/1.0.0-alpha08.txt
index a114147..503aca4 100644
--- a/navigation/common/ktx/api/1.0.0-alpha08.txt
+++ b/navigation/common/ktx/api/1.0.0-alpha08.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
@androidx.navigation.NavOptionsDsl public final class AnimBuilder {
diff --git a/navigation/common/ktx/api/1.0.0-alpha09.txt b/navigation/common/ktx/api/1.0.0-alpha09.txt
index f59538e..931b33c 100644
--- a/navigation/common/ktx/api/1.0.0-alpha09.txt
+++ b/navigation/common/ktx/api/1.0.0-alpha09.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
@androidx.navigation.NavOptionsDsl public final class AnimBuilder {
diff --git a/navigation/common/ktx/api/1.0.0-alpha10.txt b/navigation/common/ktx/api/1.0.0-alpha10.txt
index 12ddf7b..b9914ba 100644
--- a/navigation/common/ktx/api/1.0.0-alpha10.txt
+++ b/navigation/common/ktx/api/1.0.0-alpha10.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
@androidx.navigation.NavOptionsDsl public final class AnimBuilder {
diff --git a/navigation/common/ktx/api/1.0.0-alpha11.txt b/navigation/common/ktx/api/1.0.0-alpha11.txt
index 6da57db..b9914ba 100644
--- a/navigation/common/ktx/api/1.0.0-alpha11.txt
+++ b/navigation/common/ktx/api/1.0.0-alpha11.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
@androidx.navigation.NavOptionsDsl public final class AnimBuilder {
@@ -77,17 +77,17 @@
public final class NavGraphBuilderKt {
ctor public NavGraphBuilderKt();
- method public static inline androidx.navigation.NavGraph navigation(androidx.navigation.NavigatorProvider, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- method public static inline void navigation(androidx.navigation.NavGraphBuilder, @IdRes int id, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
+ method public static androidx.navigation.NavGraph navigation(androidx.navigation.NavigatorProvider, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
+ method public static void navigation(androidx.navigation.NavGraphBuilder, @IdRes int id, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
}
public final class NavGraphKt {
ctor public NavGraphKt();
method public static operator boolean contains(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator androidx.navigation.NavDestination get(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator void minusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavGraph other);
+ method public static operator androidx.navigation.NavDestination get(androidx.navigation.NavGraph, @IdRes int id);
+ method public static operator void minusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
+ method public static operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
+ method public static operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavGraph other);
}
@androidx.navigation.NavOptionsDsl public final class NavOptionsBuilder {
@@ -112,10 +112,10 @@
public final class NavigatorProviderKt {
ctor public NavigatorProviderKt();
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, String name);
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, kotlin.reflect.KClass<T> clazz);
- method public static inline operator void plusAssign(androidx.navigation.NavigatorProvider, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
- method public static inline operator androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? set(androidx.navigation.NavigatorProvider, String name, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
+ method public static operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, String name);
+ method public static operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, kotlin.reflect.KClass<T> clazz);
+ method public static operator void plusAssign(androidx.navigation.NavigatorProvider, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
+ method public static operator androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? set(androidx.navigation.NavigatorProvider, String name, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
}
@androidx.navigation.NavOptionsDsl public final class PopUpToBuilder {
diff --git a/navigation/common/ktx/api/1.0.0-beta01.txt b/navigation/common/ktx/api/1.0.0-beta01.txt
deleted file mode 100644
index 6da57db..0000000
--- a/navigation/common/ktx/api/1.0.0-beta01.txt
+++ /dev/null
@@ -1,129 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- @androidx.navigation.NavOptionsDsl public final class AnimBuilder {
- ctor public AnimBuilder();
- method public int getEnter();
- method public int getExit();
- method public int getPopEnter();
- method public int getPopExit();
- method public void setEnter(int p);
- method public void setExit(int p);
- method public void setPopEnter(int p);
- method public void setPopExit(int p);
- property public final int enter;
- property public final int exit;
- property public final int popEnter;
- property public final int popExit;
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavActionBuilder {
- ctor public NavActionBuilder();
- method public int getDestinationId();
- method public void navOptions(kotlin.jvm.functions.Function1<? super androidx.navigation.NavOptionsBuilder,kotlin.Unit> optionsBuilder);
- method public void setDestinationId(int p);
- property public final int destinationId;
- }
-
- public final class NavArgsLazy<Args extends androidx.navigation.NavArgs> implements kotlin.Lazy<Args> {
- ctor public NavArgsLazy(kotlin.reflect.KClass<Args> navArgsClass, kotlin.jvm.functions.Function0<android.os.Bundle> argumentProducer);
- method public Args getValue();
- method public boolean isInitialized();
- property public Args value;
- }
-
- public final class NavArgsLazyKt {
- ctor public NavArgsLazyKt();
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavArgumentBuilder {
- ctor public NavArgumentBuilder();
- method public androidx.navigation.NavArgument build();
- method public Object? getDefaultValue();
- method public boolean getNullable();
- method public androidx.navigation.NavType<?> getType();
- method public void setDefaultValue(Object? value);
- method public void setNullable(boolean value);
- method public void setType(androidx.navigation.NavType<?> value);
- property public final Object? defaultValue;
- property public final boolean nullable;
- property public final androidx.navigation.NavType<?> type;
- }
-
- @androidx.navigation.NavDestinationDsl public class NavDestinationBuilder<D extends androidx.navigation.NavDestination> {
- ctor public NavDestinationBuilder(androidx.navigation.Navigator<? extends D> navigator, @IdRes int id);
- method public final void action(int actionId, kotlin.jvm.functions.Function1<? super androidx.navigation.NavActionBuilder,kotlin.Unit> actionBuilder);
- method public final void argument(String name, kotlin.jvm.functions.Function1<? super androidx.navigation.NavArgumentBuilder,kotlin.Unit> argumentBuilder);
- method public D build();
- method public final void deepLink(String uriPattern);
- method public final int getId();
- method public final CharSequence? getLabel();
- method protected final androidx.navigation.Navigator<? extends D> getNavigator();
- method public final void setLabel(CharSequence? p);
- property public final CharSequence? label;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface NavDestinationDsl {
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavGraphBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.NavGraph> {
- ctor public NavGraphBuilder(androidx.navigation.NavigatorProvider provider, @IdRes int id, @IdRes int startDestination);
- method public void addDestination(androidx.navigation.NavDestination destination);
- method public androidx.navigation.NavGraph build();
- method public <D extends androidx.navigation.NavDestination> void destination(androidx.navigation.NavDestinationBuilder<? extends D> navDestination);
- method public androidx.navigation.NavigatorProvider getProvider();
- method public operator void unaryPlus(androidx.navigation.NavDestination);
- }
-
- public final class NavGraphBuilderKt {
- ctor public NavGraphBuilderKt();
- method public static inline androidx.navigation.NavGraph navigation(androidx.navigation.NavigatorProvider, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- method public static inline void navigation(androidx.navigation.NavGraphBuilder, @IdRes int id, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class NavGraphKt {
- ctor public NavGraphKt();
- method public static operator boolean contains(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator androidx.navigation.NavDestination get(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator void minusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavGraph other);
- }
-
- @androidx.navigation.NavOptionsDsl public final class NavOptionsBuilder {
- ctor public NavOptionsBuilder();
- method public void anim(kotlin.jvm.functions.Function1<? super androidx.navigation.AnimBuilder,kotlin.Unit> animBuilder);
- method public boolean getLaunchSingleTop();
- method public int getPopUpTo();
- method public void popUpTo(@IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.PopUpToBuilder,kotlin.Unit> popUpToBuilder);
- method public void setLaunchSingleTop(boolean p);
- method public void setPopUpTo(int value);
- property public final boolean launchSingleTop;
- property public final int popUpTo;
- }
-
- public final class NavOptionsBuilderKt {
- ctor public NavOptionsBuilderKt();
- method public static androidx.navigation.NavOptions navOptions(kotlin.jvm.functions.Function1<? super androidx.navigation.NavOptionsBuilder,kotlin.Unit> optionsBuilder);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface NavOptionsDsl {
- }
-
- public final class NavigatorProviderKt {
- ctor public NavigatorProviderKt();
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, String name);
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, kotlin.reflect.KClass<T> clazz);
- method public static inline operator void plusAssign(androidx.navigation.NavigatorProvider, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
- method public static inline operator androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? set(androidx.navigation.NavigatorProvider, String name, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
- }
-
- @androidx.navigation.NavOptionsDsl public final class PopUpToBuilder {
- ctor public PopUpToBuilder();
- method public boolean getInclusive();
- method public void setInclusive(boolean p);
- property public final boolean inclusive;
- }
-
-}
-
diff --git a/navigation/common/ktx/api/1.0.0-beta02.txt b/navigation/common/ktx/api/1.0.0-beta02.txt
deleted file mode 100644
index 6da57db..0000000
--- a/navigation/common/ktx/api/1.0.0-beta02.txt
+++ /dev/null
@@ -1,129 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- @androidx.navigation.NavOptionsDsl public final class AnimBuilder {
- ctor public AnimBuilder();
- method public int getEnter();
- method public int getExit();
- method public int getPopEnter();
- method public int getPopExit();
- method public void setEnter(int p);
- method public void setExit(int p);
- method public void setPopEnter(int p);
- method public void setPopExit(int p);
- property public final int enter;
- property public final int exit;
- property public final int popEnter;
- property public final int popExit;
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavActionBuilder {
- ctor public NavActionBuilder();
- method public int getDestinationId();
- method public void navOptions(kotlin.jvm.functions.Function1<? super androidx.navigation.NavOptionsBuilder,kotlin.Unit> optionsBuilder);
- method public void setDestinationId(int p);
- property public final int destinationId;
- }
-
- public final class NavArgsLazy<Args extends androidx.navigation.NavArgs> implements kotlin.Lazy<Args> {
- ctor public NavArgsLazy(kotlin.reflect.KClass<Args> navArgsClass, kotlin.jvm.functions.Function0<android.os.Bundle> argumentProducer);
- method public Args getValue();
- method public boolean isInitialized();
- property public Args value;
- }
-
- public final class NavArgsLazyKt {
- ctor public NavArgsLazyKt();
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavArgumentBuilder {
- ctor public NavArgumentBuilder();
- method public androidx.navigation.NavArgument build();
- method public Object? getDefaultValue();
- method public boolean getNullable();
- method public androidx.navigation.NavType<?> getType();
- method public void setDefaultValue(Object? value);
- method public void setNullable(boolean value);
- method public void setType(androidx.navigation.NavType<?> value);
- property public final Object? defaultValue;
- property public final boolean nullable;
- property public final androidx.navigation.NavType<?> type;
- }
-
- @androidx.navigation.NavDestinationDsl public class NavDestinationBuilder<D extends androidx.navigation.NavDestination> {
- ctor public NavDestinationBuilder(androidx.navigation.Navigator<? extends D> navigator, @IdRes int id);
- method public final void action(int actionId, kotlin.jvm.functions.Function1<? super androidx.navigation.NavActionBuilder,kotlin.Unit> actionBuilder);
- method public final void argument(String name, kotlin.jvm.functions.Function1<? super androidx.navigation.NavArgumentBuilder,kotlin.Unit> argumentBuilder);
- method public D build();
- method public final void deepLink(String uriPattern);
- method public final int getId();
- method public final CharSequence? getLabel();
- method protected final androidx.navigation.Navigator<? extends D> getNavigator();
- method public final void setLabel(CharSequence? p);
- property public final CharSequence? label;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface NavDestinationDsl {
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavGraphBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.NavGraph> {
- ctor public NavGraphBuilder(androidx.navigation.NavigatorProvider provider, @IdRes int id, @IdRes int startDestination);
- method public void addDestination(androidx.navigation.NavDestination destination);
- method public androidx.navigation.NavGraph build();
- method public <D extends androidx.navigation.NavDestination> void destination(androidx.navigation.NavDestinationBuilder<? extends D> navDestination);
- method public androidx.navigation.NavigatorProvider getProvider();
- method public operator void unaryPlus(androidx.navigation.NavDestination);
- }
-
- public final class NavGraphBuilderKt {
- ctor public NavGraphBuilderKt();
- method public static inline androidx.navigation.NavGraph navigation(androidx.navigation.NavigatorProvider, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- method public static inline void navigation(androidx.navigation.NavGraphBuilder, @IdRes int id, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class NavGraphKt {
- ctor public NavGraphKt();
- method public static operator boolean contains(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator androidx.navigation.NavDestination get(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator void minusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavGraph other);
- }
-
- @androidx.navigation.NavOptionsDsl public final class NavOptionsBuilder {
- ctor public NavOptionsBuilder();
- method public void anim(kotlin.jvm.functions.Function1<? super androidx.navigation.AnimBuilder,kotlin.Unit> animBuilder);
- method public boolean getLaunchSingleTop();
- method public int getPopUpTo();
- method public void popUpTo(@IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.PopUpToBuilder,kotlin.Unit> popUpToBuilder);
- method public void setLaunchSingleTop(boolean p);
- method public void setPopUpTo(int value);
- property public final boolean launchSingleTop;
- property public final int popUpTo;
- }
-
- public final class NavOptionsBuilderKt {
- ctor public NavOptionsBuilderKt();
- method public static androidx.navigation.NavOptions navOptions(kotlin.jvm.functions.Function1<? super androidx.navigation.NavOptionsBuilder,kotlin.Unit> optionsBuilder);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface NavOptionsDsl {
- }
-
- public final class NavigatorProviderKt {
- ctor public NavigatorProviderKt();
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, String name);
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, kotlin.reflect.KClass<T> clazz);
- method public static inline operator void plusAssign(androidx.navigation.NavigatorProvider, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
- method public static inline operator androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? set(androidx.navigation.NavigatorProvider, String name, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
- }
-
- @androidx.navigation.NavOptionsDsl public final class PopUpToBuilder {
- ctor public PopUpToBuilder();
- method public boolean getInclusive();
- method public void setInclusive(boolean p);
- property public final boolean inclusive;
- }
-
-}
-
diff --git a/navigation/common/ktx/api/1.0.0-rc01.txt b/navigation/common/ktx/api/1.0.0-rc01.txt
deleted file mode 100644
index 6da57db..0000000
--- a/navigation/common/ktx/api/1.0.0-rc01.txt
+++ /dev/null
@@ -1,129 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- @androidx.navigation.NavOptionsDsl public final class AnimBuilder {
- ctor public AnimBuilder();
- method public int getEnter();
- method public int getExit();
- method public int getPopEnter();
- method public int getPopExit();
- method public void setEnter(int p);
- method public void setExit(int p);
- method public void setPopEnter(int p);
- method public void setPopExit(int p);
- property public final int enter;
- property public final int exit;
- property public final int popEnter;
- property public final int popExit;
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavActionBuilder {
- ctor public NavActionBuilder();
- method public int getDestinationId();
- method public void navOptions(kotlin.jvm.functions.Function1<? super androidx.navigation.NavOptionsBuilder,kotlin.Unit> optionsBuilder);
- method public void setDestinationId(int p);
- property public final int destinationId;
- }
-
- public final class NavArgsLazy<Args extends androidx.navigation.NavArgs> implements kotlin.Lazy<Args> {
- ctor public NavArgsLazy(kotlin.reflect.KClass<Args> navArgsClass, kotlin.jvm.functions.Function0<android.os.Bundle> argumentProducer);
- method public Args getValue();
- method public boolean isInitialized();
- property public Args value;
- }
-
- public final class NavArgsLazyKt {
- ctor public NavArgsLazyKt();
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavArgumentBuilder {
- ctor public NavArgumentBuilder();
- method public androidx.navigation.NavArgument build();
- method public Object? getDefaultValue();
- method public boolean getNullable();
- method public androidx.navigation.NavType<?> getType();
- method public void setDefaultValue(Object? value);
- method public void setNullable(boolean value);
- method public void setType(androidx.navigation.NavType<?> value);
- property public final Object? defaultValue;
- property public final boolean nullable;
- property public final androidx.navigation.NavType<?> type;
- }
-
- @androidx.navigation.NavDestinationDsl public class NavDestinationBuilder<D extends androidx.navigation.NavDestination> {
- ctor public NavDestinationBuilder(androidx.navigation.Navigator<? extends D> navigator, @IdRes int id);
- method public final void action(int actionId, kotlin.jvm.functions.Function1<? super androidx.navigation.NavActionBuilder,kotlin.Unit> actionBuilder);
- method public final void argument(String name, kotlin.jvm.functions.Function1<? super androidx.navigation.NavArgumentBuilder,kotlin.Unit> argumentBuilder);
- method public D build();
- method public final void deepLink(String uriPattern);
- method public final int getId();
- method public final CharSequence? getLabel();
- method protected final androidx.navigation.Navigator<? extends D> getNavigator();
- method public final void setLabel(CharSequence? p);
- property public final CharSequence? label;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface NavDestinationDsl {
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavGraphBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.NavGraph> {
- ctor public NavGraphBuilder(androidx.navigation.NavigatorProvider provider, @IdRes int id, @IdRes int startDestination);
- method public void addDestination(androidx.navigation.NavDestination destination);
- method public androidx.navigation.NavGraph build();
- method public <D extends androidx.navigation.NavDestination> void destination(androidx.navigation.NavDestinationBuilder<? extends D> navDestination);
- method public androidx.navigation.NavigatorProvider getProvider();
- method public operator void unaryPlus(androidx.navigation.NavDestination);
- }
-
- public final class NavGraphBuilderKt {
- ctor public NavGraphBuilderKt();
- method public static inline androidx.navigation.NavGraph navigation(androidx.navigation.NavigatorProvider, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- method public static inline void navigation(androidx.navigation.NavGraphBuilder, @IdRes int id, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class NavGraphKt {
- ctor public NavGraphKt();
- method public static operator boolean contains(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator androidx.navigation.NavDestination get(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator void minusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavGraph other);
- }
-
- @androidx.navigation.NavOptionsDsl public final class NavOptionsBuilder {
- ctor public NavOptionsBuilder();
- method public void anim(kotlin.jvm.functions.Function1<? super androidx.navigation.AnimBuilder,kotlin.Unit> animBuilder);
- method public boolean getLaunchSingleTop();
- method public int getPopUpTo();
- method public void popUpTo(@IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.PopUpToBuilder,kotlin.Unit> popUpToBuilder);
- method public void setLaunchSingleTop(boolean p);
- method public void setPopUpTo(int value);
- property public final boolean launchSingleTop;
- property public final int popUpTo;
- }
-
- public final class NavOptionsBuilderKt {
- ctor public NavOptionsBuilderKt();
- method public static androidx.navigation.NavOptions navOptions(kotlin.jvm.functions.Function1<? super androidx.navigation.NavOptionsBuilder,kotlin.Unit> optionsBuilder);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface NavOptionsDsl {
- }
-
- public final class NavigatorProviderKt {
- ctor public NavigatorProviderKt();
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, String name);
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, kotlin.reflect.KClass<T> clazz);
- method public static inline operator void plusAssign(androidx.navigation.NavigatorProvider, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
- method public static inline operator androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? set(androidx.navigation.NavigatorProvider, String name, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
- }
-
- @androidx.navigation.NavOptionsDsl public final class PopUpToBuilder {
- ctor public PopUpToBuilder();
- method public boolean getInclusive();
- method public void setInclusive(boolean p);
- property public final boolean inclusive;
- }
-
-}
-
diff --git a/navigation/common/ktx/api/1.0.0-rc02.txt b/navigation/common/ktx/api/1.0.0-rc02.txt
deleted file mode 100644
index 6da57db..0000000
--- a/navigation/common/ktx/api/1.0.0-rc02.txt
+++ /dev/null
@@ -1,129 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- @androidx.navigation.NavOptionsDsl public final class AnimBuilder {
- ctor public AnimBuilder();
- method public int getEnter();
- method public int getExit();
- method public int getPopEnter();
- method public int getPopExit();
- method public void setEnter(int p);
- method public void setExit(int p);
- method public void setPopEnter(int p);
- method public void setPopExit(int p);
- property public final int enter;
- property public final int exit;
- property public final int popEnter;
- property public final int popExit;
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavActionBuilder {
- ctor public NavActionBuilder();
- method public int getDestinationId();
- method public void navOptions(kotlin.jvm.functions.Function1<? super androidx.navigation.NavOptionsBuilder,kotlin.Unit> optionsBuilder);
- method public void setDestinationId(int p);
- property public final int destinationId;
- }
-
- public final class NavArgsLazy<Args extends androidx.navigation.NavArgs> implements kotlin.Lazy<Args> {
- ctor public NavArgsLazy(kotlin.reflect.KClass<Args> navArgsClass, kotlin.jvm.functions.Function0<android.os.Bundle> argumentProducer);
- method public Args getValue();
- method public boolean isInitialized();
- property public Args value;
- }
-
- public final class NavArgsLazyKt {
- ctor public NavArgsLazyKt();
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavArgumentBuilder {
- ctor public NavArgumentBuilder();
- method public androidx.navigation.NavArgument build();
- method public Object? getDefaultValue();
- method public boolean getNullable();
- method public androidx.navigation.NavType<?> getType();
- method public void setDefaultValue(Object? value);
- method public void setNullable(boolean value);
- method public void setType(androidx.navigation.NavType<?> value);
- property public final Object? defaultValue;
- property public final boolean nullable;
- property public final androidx.navigation.NavType<?> type;
- }
-
- @androidx.navigation.NavDestinationDsl public class NavDestinationBuilder<D extends androidx.navigation.NavDestination> {
- ctor public NavDestinationBuilder(androidx.navigation.Navigator<? extends D> navigator, @IdRes int id);
- method public final void action(int actionId, kotlin.jvm.functions.Function1<? super androidx.navigation.NavActionBuilder,kotlin.Unit> actionBuilder);
- method public final void argument(String name, kotlin.jvm.functions.Function1<? super androidx.navigation.NavArgumentBuilder,kotlin.Unit> argumentBuilder);
- method public D build();
- method public final void deepLink(String uriPattern);
- method public final int getId();
- method public final CharSequence? getLabel();
- method protected final androidx.navigation.Navigator<? extends D> getNavigator();
- method public final void setLabel(CharSequence? p);
- property public final CharSequence? label;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface NavDestinationDsl {
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavGraphBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.NavGraph> {
- ctor public NavGraphBuilder(androidx.navigation.NavigatorProvider provider, @IdRes int id, @IdRes int startDestination);
- method public void addDestination(androidx.navigation.NavDestination destination);
- method public androidx.navigation.NavGraph build();
- method public <D extends androidx.navigation.NavDestination> void destination(androidx.navigation.NavDestinationBuilder<? extends D> navDestination);
- method public androidx.navigation.NavigatorProvider getProvider();
- method public operator void unaryPlus(androidx.navigation.NavDestination);
- }
-
- public final class NavGraphBuilderKt {
- ctor public NavGraphBuilderKt();
- method public static inline androidx.navigation.NavGraph navigation(androidx.navigation.NavigatorProvider, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- method public static inline void navigation(androidx.navigation.NavGraphBuilder, @IdRes int id, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class NavGraphKt {
- ctor public NavGraphKt();
- method public static operator boolean contains(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator androidx.navigation.NavDestination get(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator void minusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavGraph other);
- }
-
- @androidx.navigation.NavOptionsDsl public final class NavOptionsBuilder {
- ctor public NavOptionsBuilder();
- method public void anim(kotlin.jvm.functions.Function1<? super androidx.navigation.AnimBuilder,kotlin.Unit> animBuilder);
- method public boolean getLaunchSingleTop();
- method public int getPopUpTo();
- method public void popUpTo(@IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.PopUpToBuilder,kotlin.Unit> popUpToBuilder);
- method public void setLaunchSingleTop(boolean p);
- method public void setPopUpTo(int value);
- property public final boolean launchSingleTop;
- property public final int popUpTo;
- }
-
- public final class NavOptionsBuilderKt {
- ctor public NavOptionsBuilderKt();
- method public static androidx.navigation.NavOptions navOptions(kotlin.jvm.functions.Function1<? super androidx.navigation.NavOptionsBuilder,kotlin.Unit> optionsBuilder);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface NavOptionsDsl {
- }
-
- public final class NavigatorProviderKt {
- ctor public NavigatorProviderKt();
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, String name);
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, kotlin.reflect.KClass<T> clazz);
- method public static inline operator void plusAssign(androidx.navigation.NavigatorProvider, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
- method public static inline operator androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? set(androidx.navigation.NavigatorProvider, String name, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
- }
-
- @androidx.navigation.NavOptionsDsl public final class PopUpToBuilder {
- ctor public PopUpToBuilder();
- method public boolean getInclusive();
- method public void setInclusive(boolean p);
- property public final boolean inclusive;
- }
-
-}
-
diff --git a/navigation/common/ktx/api/2.0.0-rc02.txt b/navigation/common/ktx/api/2.0.0-rc02.txt
deleted file mode 100644
index 6da57db..0000000
--- a/navigation/common/ktx/api/2.0.0-rc02.txt
+++ /dev/null
@@ -1,129 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- @androidx.navigation.NavOptionsDsl public final class AnimBuilder {
- ctor public AnimBuilder();
- method public int getEnter();
- method public int getExit();
- method public int getPopEnter();
- method public int getPopExit();
- method public void setEnter(int p);
- method public void setExit(int p);
- method public void setPopEnter(int p);
- method public void setPopExit(int p);
- property public final int enter;
- property public final int exit;
- property public final int popEnter;
- property public final int popExit;
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavActionBuilder {
- ctor public NavActionBuilder();
- method public int getDestinationId();
- method public void navOptions(kotlin.jvm.functions.Function1<? super androidx.navigation.NavOptionsBuilder,kotlin.Unit> optionsBuilder);
- method public void setDestinationId(int p);
- property public final int destinationId;
- }
-
- public final class NavArgsLazy<Args extends androidx.navigation.NavArgs> implements kotlin.Lazy<Args> {
- ctor public NavArgsLazy(kotlin.reflect.KClass<Args> navArgsClass, kotlin.jvm.functions.Function0<android.os.Bundle> argumentProducer);
- method public Args getValue();
- method public boolean isInitialized();
- property public Args value;
- }
-
- public final class NavArgsLazyKt {
- ctor public NavArgsLazyKt();
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavArgumentBuilder {
- ctor public NavArgumentBuilder();
- method public androidx.navigation.NavArgument build();
- method public Object? getDefaultValue();
- method public boolean getNullable();
- method public androidx.navigation.NavType<?> getType();
- method public void setDefaultValue(Object? value);
- method public void setNullable(boolean value);
- method public void setType(androidx.navigation.NavType<?> value);
- property public final Object? defaultValue;
- property public final boolean nullable;
- property public final androidx.navigation.NavType<?> type;
- }
-
- @androidx.navigation.NavDestinationDsl public class NavDestinationBuilder<D extends androidx.navigation.NavDestination> {
- ctor public NavDestinationBuilder(androidx.navigation.Navigator<? extends D> navigator, @IdRes int id);
- method public final void action(int actionId, kotlin.jvm.functions.Function1<? super androidx.navigation.NavActionBuilder,kotlin.Unit> actionBuilder);
- method public final void argument(String name, kotlin.jvm.functions.Function1<? super androidx.navigation.NavArgumentBuilder,kotlin.Unit> argumentBuilder);
- method public D build();
- method public final void deepLink(String uriPattern);
- method public final int getId();
- method public final CharSequence? getLabel();
- method protected final androidx.navigation.Navigator<? extends D> getNavigator();
- method public final void setLabel(CharSequence? p);
- property public final CharSequence? label;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface NavDestinationDsl {
- }
-
- @androidx.navigation.NavDestinationDsl public final class NavGraphBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.NavGraph> {
- ctor public NavGraphBuilder(androidx.navigation.NavigatorProvider provider, @IdRes int id, @IdRes int startDestination);
- method public void addDestination(androidx.navigation.NavDestination destination);
- method public androidx.navigation.NavGraph build();
- method public <D extends androidx.navigation.NavDestination> void destination(androidx.navigation.NavDestinationBuilder<? extends D> navDestination);
- method public androidx.navigation.NavigatorProvider getProvider();
- method public operator void unaryPlus(androidx.navigation.NavDestination);
- }
-
- public final class NavGraphBuilderKt {
- ctor public NavGraphBuilderKt();
- method public static inline androidx.navigation.NavGraph navigation(androidx.navigation.NavigatorProvider, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- method public static inline void navigation(androidx.navigation.NavGraphBuilder, @IdRes int id, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class NavGraphKt {
- ctor public NavGraphKt();
- method public static operator boolean contains(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator androidx.navigation.NavDestination get(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator void minusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavGraph other);
- }
-
- @androidx.navigation.NavOptionsDsl public final class NavOptionsBuilder {
- ctor public NavOptionsBuilder();
- method public void anim(kotlin.jvm.functions.Function1<? super androidx.navigation.AnimBuilder,kotlin.Unit> animBuilder);
- method public boolean getLaunchSingleTop();
- method public int getPopUpTo();
- method public void popUpTo(@IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.PopUpToBuilder,kotlin.Unit> popUpToBuilder);
- method public void setLaunchSingleTop(boolean p);
- method public void setPopUpTo(int value);
- property public final boolean launchSingleTop;
- property public final int popUpTo;
- }
-
- public final class NavOptionsBuilderKt {
- ctor public NavOptionsBuilderKt();
- method public static androidx.navigation.NavOptions navOptions(kotlin.jvm.functions.Function1<? super androidx.navigation.NavOptionsBuilder,kotlin.Unit> optionsBuilder);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface NavOptionsDsl {
- }
-
- public final class NavigatorProviderKt {
- ctor public NavigatorProviderKt();
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, String name);
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, kotlin.reflect.KClass<T> clazz);
- method public static inline operator void plusAssign(androidx.navigation.NavigatorProvider, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
- method public static inline operator androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? set(androidx.navigation.NavigatorProvider, String name, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
- }
-
- @androidx.navigation.NavOptionsDsl public final class PopUpToBuilder {
- ctor public PopUpToBuilder();
- method public boolean getInclusive();
- method public void setInclusive(boolean p);
- property public final boolean inclusive;
- }
-
-}
-
diff --git a/navigation/common/ktx/api/current.txt b/navigation/common/ktx/api/current.txt
index 6da57db..b9914ba 100644
--- a/navigation/common/ktx/api/current.txt
+++ b/navigation/common/ktx/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
@androidx.navigation.NavOptionsDsl public final class AnimBuilder {
@@ -77,17 +77,17 @@
public final class NavGraphBuilderKt {
ctor public NavGraphBuilderKt();
- method public static inline androidx.navigation.NavGraph navigation(androidx.navigation.NavigatorProvider, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- method public static inline void navigation(androidx.navigation.NavGraphBuilder, @IdRes int id, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
+ method public static androidx.navigation.NavGraph navigation(androidx.navigation.NavigatorProvider, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
+ method public static void navigation(androidx.navigation.NavGraphBuilder, @IdRes int id, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
}
public final class NavGraphKt {
ctor public NavGraphKt();
method public static operator boolean contains(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator androidx.navigation.NavDestination get(androidx.navigation.NavGraph, @IdRes int id);
- method public static inline operator void minusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
- method public static inline operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavGraph other);
+ method public static operator androidx.navigation.NavDestination get(androidx.navigation.NavGraph, @IdRes int id);
+ method public static operator void minusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
+ method public static operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavDestination node);
+ method public static operator void plusAssign(androidx.navigation.NavGraph, androidx.navigation.NavGraph other);
}
@androidx.navigation.NavOptionsDsl public final class NavOptionsBuilder {
@@ -112,10 +112,10 @@
public final class NavigatorProviderKt {
ctor public NavigatorProviderKt();
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, String name);
- method public static inline operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, kotlin.reflect.KClass<T> clazz);
- method public static inline operator void plusAssign(androidx.navigation.NavigatorProvider, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
- method public static inline operator androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? set(androidx.navigation.NavigatorProvider, String name, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
+ method public static operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, String name);
+ method public static operator <T extends androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>> T get(androidx.navigation.NavigatorProvider, kotlin.reflect.KClass<T> clazz);
+ method public static operator void plusAssign(androidx.navigation.NavigatorProvider, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
+ method public static operator androidx.navigation.Navigator<? extends androidx.navigation.NavDestination>? set(androidx.navigation.NavigatorProvider, String name, androidx.navigation.Navigator<? extends androidx.navigation.NavDestination> navigator);
}
@androidx.navigation.NavOptionsDsl public final class PopUpToBuilder {
diff --git a/navigation/common/ktx/api/res-1.0.0-beta01.txt b/navigation/common/ktx/api/res-1.0.0-beta01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/common/ktx/api/res-1.0.0-beta01.txt
+++ /dev/null
diff --git a/navigation/common/ktx/api/res-1.0.0-beta02.txt b/navigation/common/ktx/api/res-1.0.0-beta02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/common/ktx/api/res-1.0.0-beta02.txt
+++ /dev/null
diff --git a/navigation/common/ktx/api/res-1.0.0-rc01.txt b/navigation/common/ktx/api/res-1.0.0-rc01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/common/ktx/api/res-1.0.0-rc01.txt
+++ /dev/null
diff --git a/navigation/common/ktx/api/res-1.0.0-rc02.txt b/navigation/common/ktx/api/res-1.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/common/ktx/api/res-1.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/common/ktx/api/res-2.0.0-rc02.txt b/navigation/common/ktx/api/res-2.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/common/ktx/api/res-2.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/common/ktx/api/restricted_1.0.0-beta01.txt b/navigation/common/ktx/api/restricted_1.0.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/common/ktx/api/restricted_1.0.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/common/ktx/api/restricted_1.0.0-beta02.txt b/navigation/common/ktx/api/restricted_1.0.0-beta02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/common/ktx/api/restricted_1.0.0-beta02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/common/ktx/api/restricted_1.0.0-rc01.txt b/navigation/common/ktx/api/restricted_1.0.0-rc01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/common/ktx/api/restricted_1.0.0-rc01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/common/ktx/api/restricted_1.0.0-rc02.txt b/navigation/common/ktx/api/restricted_1.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/common/ktx/api/restricted_1.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/common/ktx/api/restricted_2.0.0-rc02.txt b/navigation/common/ktx/api/restricted_2.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/common/ktx/api/restricted_2.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/common/ktx/api/restricted_current.txt b/navigation/common/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/common/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/common/ktx/build.gradle b/navigation/common/ktx/build.gradle
index ca21a30..ed4016b 100644
--- a/navigation/common/ktx/build.gradle
+++ b/navigation/common/ktx/build.gradle
@@ -38,8 +38,6 @@
dependencies {
api(project(":navigation:navigation-common"))
- implementation(NAV_SUPPORT_COLLECTIONS)
-
api(KOTLIN_STDLIB)
testImplementation(JUNIT)
testImplementation(TEST_EXT_JUNIT)
diff --git a/navigation/common/ktx/src/androidTest/java/androidx/navigation/NavDestinationBuilderTest.kt b/navigation/common/ktx/src/androidTest/java/androidx/navigation/NavDestinationBuilderTest.kt
index eea00fe..1e455a7 100644
--- a/navigation/common/ktx/src/androidTest/java/androidx/navigation/NavDestinationBuilderTest.kt
+++ b/navigation/common/ktx/src/androidTest/java/androidx/navigation/NavDestinationBuilderTest.kt
@@ -16,7 +16,7 @@
package androidx.navigation
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertWithMessage
diff --git a/navigation/common/ktx/src/androidTest/java/androidx/navigation/NavGraphBuilderTest.kt b/navigation/common/ktx/src/androidTest/java/androidx/navigation/NavGraphBuilderTest.kt
index cef5597..00d32b0 100644
--- a/navigation/common/ktx/src/androidTest/java/androidx/navigation/NavGraphBuilderTest.kt
+++ b/navigation/common/ktx/src/androidTest/java/androidx/navigation/NavGraphBuilderTest.kt
@@ -16,7 +16,7 @@
package androidx.navigation
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertWithMessage
diff --git a/navigation/common/ktx/src/main/java/androidx/navigation/NavArgsLazy.kt b/navigation/common/ktx/src/main/java/androidx/navigation/NavArgsLazy.kt
index c9c5475..d8ff201 100644
--- a/navigation/common/ktx/src/main/java/androidx/navigation/NavArgsLazy.kt
+++ b/navigation/common/ktx/src/main/java/androidx/navigation/NavArgsLazy.kt
@@ -17,7 +17,7 @@
package androidx.navigation
import android.os.Bundle
-import androidx.collection.ArrayMap
+import android.support.v4.util.ArrayMap
import java.lang.reflect.Method
import kotlin.reflect.KClass
diff --git a/navigation/common/ktx/src/main/java/androidx/navigation/NavDestinationBuilder.kt b/navigation/common/ktx/src/main/java/androidx/navigation/NavDestinationBuilder.kt
index adb4d73..93723e69 100644
--- a/navigation/common/ktx/src/main/java/androidx/navigation/NavDestinationBuilder.kt
+++ b/navigation/common/ktx/src/main/java/androidx/navigation/NavDestinationBuilder.kt
@@ -16,7 +16,8 @@
package androidx.navigation
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
+import java.lang.IllegalStateException
@DslMarker
annotation class NavDestinationDsl
diff --git a/navigation/common/ktx/src/main/java/androidx/navigation/NavGraph.kt b/navigation/common/ktx/src/main/java/androidx/navigation/NavGraph.kt
index 26aaf72..eaf2775 100644
--- a/navigation/common/ktx/src/main/java/androidx/navigation/NavGraph.kt
+++ b/navigation/common/ktx/src/main/java/androidx/navigation/NavGraph.kt
@@ -18,7 +18,7 @@
package androidx.navigation
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
/**
* Returns the destination with `id`.
diff --git a/navigation/common/ktx/src/main/java/androidx/navigation/NavGraphBuilder.kt b/navigation/common/ktx/src/main/java/androidx/navigation/NavGraphBuilder.kt
index 31c3d8c..0ba3324 100644
--- a/navigation/common/ktx/src/main/java/androidx/navigation/NavGraphBuilder.kt
+++ b/navigation/common/ktx/src/main/java/androidx/navigation/NavGraphBuilder.kt
@@ -16,7 +16,7 @@
package androidx.navigation
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
/**
* Construct a new [NavGraph]
diff --git a/navigation/common/ktx/src/main/java/androidx/navigation/NavOptionsBuilder.kt b/navigation/common/ktx/src/main/java/androidx/navigation/NavOptionsBuilder.kt
index ad9cf24..b664963 100644
--- a/navigation/common/ktx/src/main/java/androidx/navigation/NavOptionsBuilder.kt
+++ b/navigation/common/ktx/src/main/java/androidx/navigation/NavOptionsBuilder.kt
@@ -16,9 +16,9 @@
package androidx.navigation
-import androidx.annotation.AnimRes
-import androidx.annotation.AnimatorRes
-import androidx.annotation.IdRes
+import android.support.annotation.AnimRes
+import android.support.annotation.AnimatorRes
+import android.support.annotation.IdRes
@DslMarker
annotation class NavOptionsDsl
@@ -50,7 +50,7 @@
* from the back stack until this destination is found.
*/
@IdRes
- var popUpTo: Int = -1
+ var popUpTo: Int = 0
set(value) {
field = value
inclusive = false
diff --git a/navigation/common/src/androidTest/java/androidx/navigation/NavDestinationAndroidTest.kt b/navigation/common/src/androidTest/java/androidx/navigation/NavDestinationAndroidTest.kt
index 09cc1fc..3a090c0 100644
--- a/navigation/common/src/androidTest/java/androidx/navigation/NavDestinationAndroidTest.kt
+++ b/navigation/common/src/androidTest/java/androidx/navigation/NavDestinationAndroidTest.kt
@@ -42,50 +42,11 @@
.isNotNull()
assertWithMessage("Deep link should extract id argument correctly")
- .that(match?.matchingArgs?.getInt("id"))
+ .that(match?.second?.getInt("id"))
.isEqualTo(43)
}
@Test
- fun matchDeepLinkBestMatchExact() {
- val destination = NoOpNavigator().createDestination()
-
- destination.addDeepLink("www.example.com/users/index.html")
-
- val idArgument = NavArgument.Builder()
- .setType(NavType.StringType)
- .build()
- destination.addArgument("id", idArgument)
- destination.addDeepLink("www.example.com/users/{name}")
-
- val match = destination.matchDeepLink(
- Uri.parse("https://www.example.com/users/index.html"))
-
- assertWithMessage("Deep link should match")
- .that(match)
- .isNotNull()
- assertWithMessage("Deep link should pick the exact match")
- .that(match?.matchingArgs?.size())
- .isEqualTo(0)
- }
-
- @Test
- fun matchDotStar() {
- val destination = NoOpNavigator().createDestination()
-
- destination.addDeepLink("www.example.com/.*")
- destination.addDeepLink("www.example.com/{name}")
-
- val match = destination.matchDeepLink(Uri.parse("https://www.example.com/foo"))
- assertWithMessage("Deep link should match")
- .that(match)
- .isNotNull()
- assertWithMessage("Deep link should pick name over .*")
- .that(match?.matchingArgs?.size())
- .isEqualTo(1)
- }
-
- @Test
fun matchDeepLinkBestMatch() {
val destination = NoOpNavigator().createDestination()
@@ -108,13 +69,13 @@
.that(match)
.isNotNull()
assertWithMessage("Deep link should pick the argument with more matching arguments")
- .that(match?.matchingArgs?.size())
+ .that(match?.second?.size())
.isEqualTo(2)
assertWithMessage("Deep link should extract id argument correctly")
- .that(match?.matchingArgs?.getInt("id"))
+ .that(match?.second?.getInt("id"))
.isEqualTo(43)
assertWithMessage("Deep link should extract postId argument correctly")
- .that(match?.matchingArgs?.getInt("postId"))
+ .that(match?.second?.getInt("postId"))
.isEqualTo(99)
}
diff --git a/navigation/common/src/androidTest/java/androidx/navigation/NavGraphAndroidTest.kt b/navigation/common/src/androidTest/java/androidx/navigation/NavGraphAndroidTest.kt
index 50f3902..46496ab 100644
--- a/navigation/common/src/androidTest/java/androidx/navigation/NavGraphAndroidTest.kt
+++ b/navigation/common/src/androidTest/java/androidx/navigation/NavGraphAndroidTest.kt
@@ -45,58 +45,11 @@
.isNotNull()
assertWithMessage("Deep link should extract id argument correctly")
- .that(match?.matchingArgs?.getInt("id"))
+ .that(match?.second?.getInt("id"))
.isEqualTo(43)
}
@Test
- fun matchDeepLinkBestMatchExact() {
- val navigatorProvider = NavigatorProvider().apply {
- addNavigator(NavGraphNavigator(this))
- }
- val graph = navigatorProvider.getNavigator(NavGraphNavigator::class.java)
- .createDestination()
-
- graph.addDeepLink("www.example.com/users/index.html")
-
- val idArgument = NavArgument.Builder()
- .setType(NavType.StringType)
- .build()
- graph.addArgument("id", idArgument)
- graph.addDeepLink("www.example.com/users/{name}")
-
- val match = graph.matchDeepLink(
- Uri.parse("https://www.example.com/users/index.html"))
-
- assertWithMessage("Deep link should match")
- .that(match)
- .isNotNull()
- assertWithMessage("Deep link should pick the exact match")
- .that(match?.matchingArgs?.size())
- .isEqualTo(0)
- }
-
- @Test
- fun matchDotStar() {
- val navigatorProvider = NavigatorProvider().apply {
- addNavigator(NavGraphNavigator(this))
- }
- val graph = navigatorProvider.getNavigator(NavGraphNavigator::class.java)
- .createDestination()
-
- graph.addDeepLink("www.example.com/.*")
- graph.addDeepLink("www.example.com/{name}")
-
- val match = graph.matchDeepLink(Uri.parse("https://www.example.com/foo"))
- assertWithMessage("Deep link should match")
- .that(match)
- .isNotNull()
- assertWithMessage("Deep link should pick name over .*")
- .that(match?.matchingArgs?.size())
- .isEqualTo(1)
- }
-
- @Test
fun matchDeepLinkBestMatch() {
val navigatorProvider = NavigatorProvider().apply {
addNavigator(NavGraphNavigator(this))
@@ -124,13 +77,13 @@
.isNotNull()
assertWithMessage("Deep link should pick the argument with more matching arguments")
- .that(match?.matchingArgs?.size())
+ .that(match?.second?.size())
.isEqualTo(2)
assertWithMessage("Deep link should extract id argument correctly")
- .that(match?.matchingArgs?.getInt("id"))
+ .that(match?.second?.getInt("id"))
.isEqualTo(43)
assertWithMessage("Deep link should extract postId argument correctly")
- .that(match?.matchingArgs?.getInt("postId"))
+ .that(match?.second?.getInt("postId"))
.isEqualTo(99)
}
@@ -172,13 +125,13 @@
.isNotNull()
assertWithMessage("Deep link should point to correct destination")
- .that(match?.destination)
+ .that(match?.first)
.isSameAs(postDestination)
assertWithMessage("Deep link should extract id argument correctly")
- .that(match?.matchingArgs?.getInt("id"))
+ .that(match?.second?.getInt("id"))
.isEqualTo(43)
assertWithMessage("Deep link should extract postId argument correctly")
- .that(match?.matchingArgs?.getInt("postId"))
+ .that(match?.second?.getInt("postId"))
.isEqualTo(99)
}
}
diff --git a/navigation/common/src/androidTest/java/androidx/navigation/NavGraphNavigatorStateTest.kt b/navigation/common/src/androidTest/java/androidx/navigation/NavGraphNavigatorStateTest.kt
index 11f5871..3d37870 100644
--- a/navigation/common/src/androidTest/java/androidx/navigation/NavGraphNavigatorStateTest.kt
+++ b/navigation/common/src/androidTest/java/androidx/navigation/NavGraphNavigatorStateTest.kt
@@ -16,7 +16,7 @@
package androidx.navigation
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import org.junit.Before
diff --git a/navigation/common/src/main/java/androidx/navigation/ActionOnlyNavDirections.java b/navigation/common/src/main/java/androidx/navigation/ActionOnlyNavDirections.java
index 2f8139a..38b0cf5 100644
--- a/navigation/common/src/main/java/androidx/navigation/ActionOnlyNavDirections.java
+++ b/navigation/common/src/main/java/androidx/navigation/ActionOnlyNavDirections.java
@@ -17,8 +17,7 @@
package androidx.navigation;
import android.os.Bundle;
-
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
/**
* An implementation of {@link NavDirections} without any arguments.
diff --git a/navigation/common/src/main/java/androidx/navigation/NavAction.java b/navigation/common/src/main/java/androidx/navigation/NavAction.java
index cf0f42f..795d78b 100644
--- a/navigation/common/src/main/java/androidx/navigation/NavAction.java
+++ b/navigation/common/src/main/java/androidx/navigation/NavAction.java
@@ -17,9 +17,8 @@
package androidx.navigation;
import android.os.Bundle;
-
-import androidx.annotation.IdRes;
-import androidx.annotation.Nullable;
+import android.support.annotation.IdRes;
+import android.support.annotation.Nullable;
/**
* Navigation actions provide a level of indirection between your navigation code and the
diff --git a/navigation/common/src/main/java/androidx/navigation/NavArgument.java b/navigation/common/src/main/java/androidx/navigation/NavArgument.java
index 9f13b83..6e7832a 100644
--- a/navigation/common/src/main/java/androidx/navigation/NavArgument.java
+++ b/navigation/common/src/main/java/androidx/navigation/NavArgument.java
@@ -17,9 +17,8 @@
package androidx.navigation;
import android.os.Bundle;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
/**
* NavArgument denotes an argument that is supported by a {@link NavDestination}.
diff --git a/navigation/common/src/main/java/androidx/navigation/NavBackStackEntry.java b/navigation/common/src/main/java/androidx/navigation/NavBackStackEntry.java
index fb5b671..48537ce 100644
--- a/navigation/common/src/main/java/androidx/navigation/NavBackStackEntry.java
+++ b/navigation/common/src/main/java/androidx/navigation/NavBackStackEntry.java
@@ -17,9 +17,8 @@
package androidx.navigation;
import android.os.Bundle;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
/**
* Representation of an entry in the back stack of a {@link NavController}.
diff --git a/navigation/common/src/main/java/androidx/navigation/NavDeepLink.java b/navigation/common/src/main/java/androidx/navigation/NavDeepLink.java
index 65846a0..33908be 100644
--- a/navigation/common/src/main/java/androidx/navigation/NavDeepLink.java
+++ b/navigation/common/src/main/java/androidx/navigation/NavDeepLink.java
@@ -18,9 +18,8 @@
import android.net.Uri;
import android.os.Bundle;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import java.util.ArrayList;
import java.util.Map;
@@ -35,7 +34,6 @@
private final ArrayList<String> mArguments = new ArrayList<>();
private final Pattern mPattern;
- private final boolean mExactDeepLink;
/**
* NavDestinations should be created via {@link Navigator#createDestination}.
@@ -49,8 +47,6 @@
Pattern fillInPattern = Pattern.compile("\\{(.+?)\\}");
Matcher matcher = fillInPattern.matcher(uri);
int appendPos = 0;
- // Track whether this is an exact deep link
- boolean exactDeepLink = !uri.contains(".*");
while (matcher.find()) {
String argName = matcher.group(1);
mArguments.add(argName);
@@ -58,7 +54,6 @@
uriRegex.append(Pattern.quote(uri.substring(appendPos, matcher.start())));
uriRegex.append("(.+?)");
appendPos = matcher.end();
- exactDeepLink = false;
}
if (appendPos < uri.length()) {
// Use Pattern.quote() to treat the input string as a literal
@@ -69,17 +64,12 @@
// they are still treated as wildcards in our final regex
String finalRegex = uriRegex.toString().replace(".*", "\\E.*\\Q");
mPattern = Pattern.compile(finalRegex);
- mExactDeepLink = exactDeepLink;
}
boolean matches(@NonNull Uri deepLink) {
return mPattern.matcher(deepLink.toString()).matches();
}
- boolean isExactDeepLink() {
- return mExactDeepLink;
- }
-
@Nullable
Bundle getMatchingArguments(@NonNull Uri deepLink,
@NonNull Map<String, NavArgument> arguments) {
diff --git a/navigation/common/src/main/java/androidx/navigation/NavDestination.java b/navigation/common/src/main/java/androidx/navigation/NavDestination.java
index 94d6e90..f032f29d 100644
--- a/navigation/common/src/main/java/androidx/navigation/NavDestination.java
+++ b/navigation/common/src/main/java/androidx/navigation/NavDestination.java
@@ -25,13 +25,14 @@
import android.content.res.TypedArray;
import android.net.Uri;
import android.os.Bundle;
+import android.support.annotation.CallSuper;
+import android.support.annotation.IdRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.util.Pair;
+import android.support.v4.util.SparseArrayCompat;
import android.util.AttributeSet;
-import androidx.annotation.CallSuper;
-import androidx.annotation.IdRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.collection.SparseArrayCompat;
import androidx.navigation.common.R;
import java.lang.annotation.Retention;
@@ -71,43 +72,6 @@
Class value();
}
- static class DeepLinkMatch implements Comparable<DeepLinkMatch> {
- @NonNull
- private final NavDestination mDestination;
- @NonNull
- private final Bundle mMatchingArgs;
- private final boolean mIsExactDeepLink;
-
- DeepLinkMatch(@NonNull NavDestination destination, @NonNull Bundle matchingArgs,
- boolean isExactDeepLink) {
- mDestination = destination;
- mMatchingArgs = matchingArgs;
- mIsExactDeepLink = isExactDeepLink;
- }
-
- @NonNull
- NavDestination getDestination() {
- return mDestination;
- }
-
- @NonNull
- Bundle getMatchingArgs() {
- return mMatchingArgs;
- }
-
- @Override
- public int compareTo(DeepLinkMatch other) {
- // Prefer exact deep links
- if (mIsExactDeepLink && !other.mIsExactDeepLink) {
- return 1;
- } else if (!mIsExactDeepLink && other.mIsExactDeepLink) {
- return -1;
- }
- // Prefer matches with more matching arguments
- return mMatchingArgs.size() - other.mMatchingArgs.size();
- }
- }
-
private static final HashMap<String, Class> sClasses = new HashMap<>();
/**
@@ -336,22 +300,19 @@
* extracted from the Uri, or null if no match was found.
*/
@Nullable
- DeepLinkMatch matchDeepLink(@NonNull Uri uri) {
+ Pair<NavDestination, Bundle> matchDeepLink(@NonNull Uri uri) {
if (mDeepLinks == null) {
return null;
}
- DeepLinkMatch bestMatch = null;
+ Bundle bestMatchingArguments = null;
for (NavDeepLink deepLink : mDeepLinks) {
Bundle matchingArguments = deepLink.getMatchingArguments(uri, getArguments());
- if (matchingArguments != null) {
- DeepLinkMatch newMatch = new DeepLinkMatch(this, matchingArguments,
- deepLink.isExactDeepLink());
- if (bestMatch == null || newMatch.compareTo(bestMatch) > 0) {
- bestMatch = newMatch;
- }
+ if (matchingArguments != null && (bestMatchingArguments == null
+ || matchingArguments.size() > bestMatchingArguments.size())) {
+ bestMatchingArguments = matchingArguments;
}
}
- return bestMatch;
+ return bestMatchingArguments != null ? new Pair<>(this, bestMatchingArguments) : null;
}
/**
diff --git a/navigation/common/src/main/java/androidx/navigation/NavDirections.java b/navigation/common/src/main/java/androidx/navigation/NavDirections.java
index 7020d9c..03a4a3e 100644
--- a/navigation/common/src/main/java/androidx/navigation/NavDirections.java
+++ b/navigation/common/src/main/java/androidx/navigation/NavDirections.java
@@ -18,9 +18,8 @@
import android.os.Bundle;
-
-import androidx.annotation.IdRes;
-import androidx.annotation.NonNull;
+import android.support.annotation.IdRes;
+import android.support.annotation.NonNull;
/**
* An interface that describes a navigation operation: action's id and arguments
diff --git a/navigation/common/src/main/java/androidx/navigation/NavGraph.java b/navigation/common/src/main/java/androidx/navigation/NavGraph.java
index ddf118b..39375e2 100644
--- a/navigation/common/src/main/java/androidx/navigation/NavGraph.java
+++ b/navigation/common/src/main/java/androidx/navigation/NavGraph.java
@@ -19,12 +19,14 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.net.Uri;
+import android.os.Bundle;
+import android.support.annotation.IdRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.util.Pair;
+import android.support.v4.util.SparseArrayCompat;
import android.util.AttributeSet;
-import androidx.annotation.IdRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.collection.SparseArrayCompat;
import androidx.navigation.common.R;
import java.util.Collection;
@@ -71,14 +73,14 @@
@Override
@Nullable
- DeepLinkMatch matchDeepLink(@NonNull Uri uri) {
+ Pair<NavDestination, Bundle> matchDeepLink(@NonNull Uri uri) {
// First search through any deep links directly added to this NavGraph
- DeepLinkMatch bestMatch = super.matchDeepLink(uri);
+ Pair<NavDestination, Bundle> bestMatch = super.matchDeepLink(uri);
// Then search through all child destinations for a matching deep link
for (NavDestination child : this) {
- DeepLinkMatch childBestMatch = child.matchDeepLink(uri);
+ Pair<NavDestination, Bundle> childBestMatch = child.matchDeepLink(uri);
if (childBestMatch != null && (bestMatch == null
- || childBestMatch.compareTo(bestMatch) > 0)) {
+ || childBestMatch.second.size() > bestMatch.second.size())) {
bestMatch = childBestMatch;
}
}
diff --git a/navigation/common/src/main/java/androidx/navigation/NavGraphNavigator.java b/navigation/common/src/main/java/androidx/navigation/NavGraphNavigator.java
index 7bac4bd..a57a667 100644
--- a/navigation/common/src/main/java/androidx/navigation/NavGraphNavigator.java
+++ b/navigation/common/src/main/java/androidx/navigation/NavGraphNavigator.java
@@ -17,9 +17,8 @@
package androidx.navigation;
import android.os.Bundle;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import java.util.ArrayDeque;
diff --git a/navigation/common/src/main/java/androidx/navigation/NavOptions.java b/navigation/common/src/main/java/androidx/navigation/NavOptions.java
index 05b79f9..51b9743 100644
--- a/navigation/common/src/main/java/androidx/navigation/NavOptions.java
+++ b/navigation/common/src/main/java/androidx/navigation/NavOptions.java
@@ -16,10 +16,10 @@
package androidx.navigation;
-import androidx.annotation.AnimRes;
-import androidx.annotation.AnimatorRes;
-import androidx.annotation.IdRes;
-import androidx.annotation.NonNull;
+import android.support.annotation.AnimRes;
+import android.support.annotation.AnimatorRes;
+import android.support.annotation.IdRes;
+import android.support.annotation.NonNull;
/**
* NavOptions stores special options for navigate actions
@@ -126,7 +126,7 @@
public static final class Builder {
boolean mSingleTop;
@IdRes
- int mPopUpTo = -1;
+ int mPopUpTo;
boolean mPopUpToInclusive;
@AnimRes @AnimatorRes
int mEnterAnim = -1;
diff --git a/navigation/common/src/main/java/androidx/navigation/NavType.java b/navigation/common/src/main/java/androidx/navigation/NavType.java
index 248de6f..0997c34 100644
--- a/navigation/common/src/main/java/androidx/navigation/NavType.java
+++ b/navigation/common/src/main/java/androidx/navigation/NavType.java
@@ -18,10 +18,9 @@
import android.os.Bundle;
import android.os.Parcelable;
-
-import androidx.annotation.AnyRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
+import android.support.annotation.AnyRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import java.io.Serializable;
import java.text.ParseException;
diff --git a/navigation/common/src/main/java/androidx/navigation/Navigator.java b/navigation/common/src/main/java/androidx/navigation/Navigator.java
index 979e8d6..85e77e8 100644
--- a/navigation/common/src/main/java/androidx/navigation/Navigator.java
+++ b/navigation/common/src/main/java/androidx/navigation/Navigator.java
@@ -22,10 +22,9 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RestrictTo;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.annotation.RestrictTo;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
diff --git a/navigation/common/src/main/java/androidx/navigation/NavigatorProvider.java b/navigation/common/src/main/java/androidx/navigation/NavigatorProvider.java
index e24dee37..90d2170 100644
--- a/navigation/common/src/main/java/androidx/navigation/NavigatorProvider.java
+++ b/navigation/common/src/main/java/androidx/navigation/NavigatorProvider.java
@@ -17,10 +17,9 @@
package androidx.navigation;
import android.annotation.SuppressLint;
-
-import androidx.annotation.CallSuper;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
+import android.support.annotation.CallSuper;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import java.util.HashMap;
import java.util.Map;
diff --git a/navigation/common/src/main/java/androidx/navigation/NoOpNavigator.java b/navigation/common/src/main/java/androidx/navigation/NoOpNavigator.java
index 441a1b5..62c83f9 100644
--- a/navigation/common/src/main/java/androidx/navigation/NoOpNavigator.java
+++ b/navigation/common/src/main/java/androidx/navigation/NoOpNavigator.java
@@ -17,9 +17,8 @@
package androidx.navigation;
import android.os.Bundle;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
/**
* A {@link Navigator} that only supports creating destinations.
diff --git a/navigation/common/src/test/java/androidx/navigation/NavActionTest.kt b/navigation/common/src/test/java/androidx/navigation/NavActionTest.kt
index a5b393b..37f9ff3 100644
--- a/navigation/common/src/test/java/androidx/navigation/NavActionTest.kt
+++ b/navigation/common/src/test/java/androidx/navigation/NavActionTest.kt
@@ -16,7 +16,7 @@
package androidx.navigation
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import org.junit.Test
diff --git a/navigation/common/src/test/java/androidx/navigation/NavDestinationTest.kt b/navigation/common/src/test/java/androidx/navigation/NavDestinationTest.kt
index 848caed..8817924 100644
--- a/navigation/common/src/test/java/androidx/navigation/NavDestinationTest.kt
+++ b/navigation/common/src/test/java/androidx/navigation/NavDestinationTest.kt
@@ -17,7 +17,7 @@
package androidx.navigation
import android.content.Context
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import org.junit.Assert.fail
diff --git a/navigation/common/src/test/java/androidx/navigation/NavGraphNavigatorTest.kt b/navigation/common/src/test/java/androidx/navigation/NavGraphNavigatorTest.kt
index 00743cd..228e738 100644
--- a/navigation/common/src/test/java/androidx/navigation/NavGraphNavigatorTest.kt
+++ b/navigation/common/src/test/java/androidx/navigation/NavGraphNavigatorTest.kt
@@ -16,7 +16,7 @@
package androidx.navigation
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
diff --git a/navigation/common/src/test/java/androidx/navigation/NavGraphTest.kt b/navigation/common/src/test/java/androidx/navigation/NavGraphTest.kt
index a8ad344..680b2c6 100644
--- a/navigation/common/src/test/java/androidx/navigation/NavGraphTest.kt
+++ b/navigation/common/src/test/java/androidx/navigation/NavGraphTest.kt
@@ -16,7 +16,7 @@
package androidx.navigation
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import org.junit.Before
diff --git a/navigation/fragment/api/1.0.0-alpha08.txt b/navigation/fragment/api/1.0.0-alpha08.txt
index 8759a64..c73995b 100644
--- a/navigation/fragment/api/1.0.0-alpha08.txt
+++ b/navigation/fragment/api/1.0.0-alpha08.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.fragment {
@androidx.navigation.Navigator.Name("fragment") public class FragmentNavigator extends androidx.navigation.Navigator<androidx.navigation.fragment.FragmentNavigator.Destination> {
diff --git a/navigation/fragment/api/1.0.0-alpha09.txt b/navigation/fragment/api/1.0.0-alpha09.txt
index 8759a64..c73995b 100644
--- a/navigation/fragment/api/1.0.0-alpha09.txt
+++ b/navigation/fragment/api/1.0.0-alpha09.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.fragment {
@androidx.navigation.Navigator.Name("fragment") public class FragmentNavigator extends androidx.navigation.Navigator<androidx.navigation.fragment.FragmentNavigator.Destination> {
diff --git a/navigation/fragment/api/1.0.0-alpha10.txt b/navigation/fragment/api/1.0.0-alpha10.txt
index 8759a64..c73995b 100644
--- a/navigation/fragment/api/1.0.0-alpha10.txt
+++ b/navigation/fragment/api/1.0.0-alpha10.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.fragment {
@androidx.navigation.Navigator.Name("fragment") public class FragmentNavigator extends androidx.navigation.Navigator<androidx.navigation.fragment.FragmentNavigator.Destination> {
diff --git a/navigation/fragment/api/1.0.0-alpha11.txt b/navigation/fragment/api/1.0.0-alpha11.txt
index 8759a64..c73995b 100644
--- a/navigation/fragment/api/1.0.0-alpha11.txt
+++ b/navigation/fragment/api/1.0.0-alpha11.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.fragment {
@androidx.navigation.Navigator.Name("fragment") public class FragmentNavigator extends androidx.navigation.Navigator<androidx.navigation.fragment.FragmentNavigator.Destination> {
diff --git a/navigation/fragment/api/1.0.0-beta01.txt b/navigation/fragment/api/1.0.0-beta01.txt
deleted file mode 100644
index 8759a64..0000000
--- a/navigation/fragment/api/1.0.0-beta01.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.fragment {
-
- @androidx.navigation.Navigator.Name("fragment") public class FragmentNavigator extends androidx.navigation.Navigator<androidx.navigation.fragment.FragmentNavigator.Destination> {
- ctor public FragmentNavigator(android.content.Context, android.support.v4.app.FragmentManager, int);
- method public androidx.navigation.fragment.FragmentNavigator.Destination createDestination();
- method public android.support.v4.app.Fragment instantiateFragment(android.content.Context, android.support.v4.app.FragmentManager, String, android.os.Bundle?);
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.fragment.FragmentNavigator.Destination, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- @androidx.navigation.NavDestination.ClassType(Fragment.class) public static class FragmentNavigator.Destination extends androidx.navigation.NavDestination {
- ctor public FragmentNavigator.Destination(androidx.navigation.NavigatorProvider);
- ctor public FragmentNavigator.Destination(androidx.navigation.Navigator<? extends androidx.navigation.fragment.FragmentNavigator.Destination>);
- method public final String getClassName();
- method public final androidx.navigation.fragment.FragmentNavigator.Destination setClassName(String);
- }
-
- public static final class FragmentNavigator.Extras implements androidx.navigation.Navigator.Extras {
- method public java.util.Map<android.view.View,java.lang.String> getSharedElements();
- }
-
- public static final class FragmentNavigator.Extras.Builder {
- ctor public FragmentNavigator.Extras.Builder();
- method public androidx.navigation.fragment.FragmentNavigator.Extras.Builder addSharedElement(android.view.View, String);
- method public androidx.navigation.fragment.FragmentNavigator.Extras.Builder addSharedElements(java.util.Map<android.view.View,java.lang.String>);
- method public androidx.navigation.fragment.FragmentNavigator.Extras build();
- }
-
- public class NavHostFragment extends android.support.v4.app.Fragment implements androidx.navigation.NavHost {
- ctor public NavHostFragment();
- method public static androidx.navigation.fragment.NavHostFragment create(@NavigationRes int);
- method public static androidx.navigation.fragment.NavHostFragment create(@NavigationRes int, android.os.Bundle?);
- method protected androidx.navigation.Navigator<? extends androidx.navigation.fragment.FragmentNavigator.Destination> createFragmentNavigator();
- method public static androidx.navigation.NavController findNavController(android.support.v4.app.Fragment);
- method public final androidx.navigation.NavController getNavController();
- }
-
-}
-
diff --git a/navigation/fragment/api/1.0.0-beta02.txt b/navigation/fragment/api/1.0.0-beta02.txt
deleted file mode 100644
index 8759a64..0000000
--- a/navigation/fragment/api/1.0.0-beta02.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.fragment {
-
- @androidx.navigation.Navigator.Name("fragment") public class FragmentNavigator extends androidx.navigation.Navigator<androidx.navigation.fragment.FragmentNavigator.Destination> {
- ctor public FragmentNavigator(android.content.Context, android.support.v4.app.FragmentManager, int);
- method public androidx.navigation.fragment.FragmentNavigator.Destination createDestination();
- method public android.support.v4.app.Fragment instantiateFragment(android.content.Context, android.support.v4.app.FragmentManager, String, android.os.Bundle?);
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.fragment.FragmentNavigator.Destination, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- @androidx.navigation.NavDestination.ClassType(Fragment.class) public static class FragmentNavigator.Destination extends androidx.navigation.NavDestination {
- ctor public FragmentNavigator.Destination(androidx.navigation.NavigatorProvider);
- ctor public FragmentNavigator.Destination(androidx.navigation.Navigator<? extends androidx.navigation.fragment.FragmentNavigator.Destination>);
- method public final String getClassName();
- method public final androidx.navigation.fragment.FragmentNavigator.Destination setClassName(String);
- }
-
- public static final class FragmentNavigator.Extras implements androidx.navigation.Navigator.Extras {
- method public java.util.Map<android.view.View,java.lang.String> getSharedElements();
- }
-
- public static final class FragmentNavigator.Extras.Builder {
- ctor public FragmentNavigator.Extras.Builder();
- method public androidx.navigation.fragment.FragmentNavigator.Extras.Builder addSharedElement(android.view.View, String);
- method public androidx.navigation.fragment.FragmentNavigator.Extras.Builder addSharedElements(java.util.Map<android.view.View,java.lang.String>);
- method public androidx.navigation.fragment.FragmentNavigator.Extras build();
- }
-
- public class NavHostFragment extends android.support.v4.app.Fragment implements androidx.navigation.NavHost {
- ctor public NavHostFragment();
- method public static androidx.navigation.fragment.NavHostFragment create(@NavigationRes int);
- method public static androidx.navigation.fragment.NavHostFragment create(@NavigationRes int, android.os.Bundle?);
- method protected androidx.navigation.Navigator<? extends androidx.navigation.fragment.FragmentNavigator.Destination> createFragmentNavigator();
- method public static androidx.navigation.NavController findNavController(android.support.v4.app.Fragment);
- method public final androidx.navigation.NavController getNavController();
- }
-
-}
-
diff --git a/navigation/fragment/api/1.0.0-rc01.txt b/navigation/fragment/api/1.0.0-rc01.txt
deleted file mode 100644
index 8759a64..0000000
--- a/navigation/fragment/api/1.0.0-rc01.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.fragment {
-
- @androidx.navigation.Navigator.Name("fragment") public class FragmentNavigator extends androidx.navigation.Navigator<androidx.navigation.fragment.FragmentNavigator.Destination> {
- ctor public FragmentNavigator(android.content.Context, android.support.v4.app.FragmentManager, int);
- method public androidx.navigation.fragment.FragmentNavigator.Destination createDestination();
- method public android.support.v4.app.Fragment instantiateFragment(android.content.Context, android.support.v4.app.FragmentManager, String, android.os.Bundle?);
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.fragment.FragmentNavigator.Destination, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- @androidx.navigation.NavDestination.ClassType(Fragment.class) public static class FragmentNavigator.Destination extends androidx.navigation.NavDestination {
- ctor public FragmentNavigator.Destination(androidx.navigation.NavigatorProvider);
- ctor public FragmentNavigator.Destination(androidx.navigation.Navigator<? extends androidx.navigation.fragment.FragmentNavigator.Destination>);
- method public final String getClassName();
- method public final androidx.navigation.fragment.FragmentNavigator.Destination setClassName(String);
- }
-
- public static final class FragmentNavigator.Extras implements androidx.navigation.Navigator.Extras {
- method public java.util.Map<android.view.View,java.lang.String> getSharedElements();
- }
-
- public static final class FragmentNavigator.Extras.Builder {
- ctor public FragmentNavigator.Extras.Builder();
- method public androidx.navigation.fragment.FragmentNavigator.Extras.Builder addSharedElement(android.view.View, String);
- method public androidx.navigation.fragment.FragmentNavigator.Extras.Builder addSharedElements(java.util.Map<android.view.View,java.lang.String>);
- method public androidx.navigation.fragment.FragmentNavigator.Extras build();
- }
-
- public class NavHostFragment extends android.support.v4.app.Fragment implements androidx.navigation.NavHost {
- ctor public NavHostFragment();
- method public static androidx.navigation.fragment.NavHostFragment create(@NavigationRes int);
- method public static androidx.navigation.fragment.NavHostFragment create(@NavigationRes int, android.os.Bundle?);
- method protected androidx.navigation.Navigator<? extends androidx.navigation.fragment.FragmentNavigator.Destination> createFragmentNavigator();
- method public static androidx.navigation.NavController findNavController(android.support.v4.app.Fragment);
- method public final androidx.navigation.NavController getNavController();
- }
-
-}
-
diff --git a/navigation/fragment/api/1.0.0-rc02.txt b/navigation/fragment/api/1.0.0-rc02.txt
deleted file mode 100644
index 8759a64..0000000
--- a/navigation/fragment/api/1.0.0-rc02.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.fragment {
-
- @androidx.navigation.Navigator.Name("fragment") public class FragmentNavigator extends androidx.navigation.Navigator<androidx.navigation.fragment.FragmentNavigator.Destination> {
- ctor public FragmentNavigator(android.content.Context, android.support.v4.app.FragmentManager, int);
- method public androidx.navigation.fragment.FragmentNavigator.Destination createDestination();
- method public android.support.v4.app.Fragment instantiateFragment(android.content.Context, android.support.v4.app.FragmentManager, String, android.os.Bundle?);
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.fragment.FragmentNavigator.Destination, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- @androidx.navigation.NavDestination.ClassType(Fragment.class) public static class FragmentNavigator.Destination extends androidx.navigation.NavDestination {
- ctor public FragmentNavigator.Destination(androidx.navigation.NavigatorProvider);
- ctor public FragmentNavigator.Destination(androidx.navigation.Navigator<? extends androidx.navigation.fragment.FragmentNavigator.Destination>);
- method public final String getClassName();
- method public final androidx.navigation.fragment.FragmentNavigator.Destination setClassName(String);
- }
-
- public static final class FragmentNavigator.Extras implements androidx.navigation.Navigator.Extras {
- method public java.util.Map<android.view.View,java.lang.String> getSharedElements();
- }
-
- public static final class FragmentNavigator.Extras.Builder {
- ctor public FragmentNavigator.Extras.Builder();
- method public androidx.navigation.fragment.FragmentNavigator.Extras.Builder addSharedElement(android.view.View, String);
- method public androidx.navigation.fragment.FragmentNavigator.Extras.Builder addSharedElements(java.util.Map<android.view.View,java.lang.String>);
- method public androidx.navigation.fragment.FragmentNavigator.Extras build();
- }
-
- public class NavHostFragment extends android.support.v4.app.Fragment implements androidx.navigation.NavHost {
- ctor public NavHostFragment();
- method public static androidx.navigation.fragment.NavHostFragment create(@NavigationRes int);
- method public static androidx.navigation.fragment.NavHostFragment create(@NavigationRes int, android.os.Bundle?);
- method protected androidx.navigation.Navigator<? extends androidx.navigation.fragment.FragmentNavigator.Destination> createFragmentNavigator();
- method public static androidx.navigation.NavController findNavController(android.support.v4.app.Fragment);
- method public final androidx.navigation.NavController getNavController();
- }
-
-}
-
diff --git a/navigation/fragment/api/2.0.0-rc02.txt b/navigation/fragment/api/2.0.0-rc02.txt
deleted file mode 100644
index b81501d..0000000
--- a/navigation/fragment/api/2.0.0-rc02.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.fragment {
-
- @androidx.navigation.Navigator.Name("fragment") public class FragmentNavigator extends androidx.navigation.Navigator<androidx.navigation.fragment.FragmentNavigator.Destination> {
- ctor public FragmentNavigator(android.content.Context, androidx.fragment.app.FragmentManager, int);
- method public androidx.navigation.fragment.FragmentNavigator.Destination createDestination();
- method public androidx.fragment.app.Fragment instantiateFragment(android.content.Context, androidx.fragment.app.FragmentManager, String, android.os.Bundle?);
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.fragment.FragmentNavigator.Destination, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- @androidx.navigation.NavDestination.ClassType(Fragment.class) public static class FragmentNavigator.Destination extends androidx.navigation.NavDestination {
- ctor public FragmentNavigator.Destination(androidx.navigation.NavigatorProvider);
- ctor public FragmentNavigator.Destination(androidx.navigation.Navigator<? extends androidx.navigation.fragment.FragmentNavigator.Destination>);
- method public final String getClassName();
- method public final androidx.navigation.fragment.FragmentNavigator.Destination setClassName(String);
- }
-
- public static final class FragmentNavigator.Extras implements androidx.navigation.Navigator.Extras {
- method public java.util.Map<android.view.View,java.lang.String> getSharedElements();
- }
-
- public static final class FragmentNavigator.Extras.Builder {
- ctor public FragmentNavigator.Extras.Builder();
- method public androidx.navigation.fragment.FragmentNavigator.Extras.Builder addSharedElement(android.view.View, String);
- method public androidx.navigation.fragment.FragmentNavigator.Extras.Builder addSharedElements(java.util.Map<android.view.View,java.lang.String>);
- method public androidx.navigation.fragment.FragmentNavigator.Extras build();
- }
-
- public class NavHostFragment extends androidx.fragment.app.Fragment implements androidx.navigation.NavHost {
- ctor public NavHostFragment();
- method public static androidx.navigation.fragment.NavHostFragment create(@NavigationRes int);
- method public static androidx.navigation.fragment.NavHostFragment create(@NavigationRes int, android.os.Bundle?);
- method protected androidx.navigation.Navigator<? extends androidx.navigation.fragment.FragmentNavigator.Destination> createFragmentNavigator();
- method public static androidx.navigation.NavController findNavController(androidx.fragment.app.Fragment);
- method public final androidx.navigation.NavController getNavController();
- }
-
-}
-
diff --git a/navigation/fragment/api/current.txt b/navigation/fragment/api/current.txt
index b81501d..c73995b 100644
--- a/navigation/fragment/api/current.txt
+++ b/navigation/fragment/api/current.txt
@@ -1,10 +1,10 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.fragment {
@androidx.navigation.Navigator.Name("fragment") public class FragmentNavigator extends androidx.navigation.Navigator<androidx.navigation.fragment.FragmentNavigator.Destination> {
- ctor public FragmentNavigator(android.content.Context, androidx.fragment.app.FragmentManager, int);
+ ctor public FragmentNavigator(android.content.Context, android.support.v4.app.FragmentManager, int);
method public androidx.navigation.fragment.FragmentNavigator.Destination createDestination();
- method public androidx.fragment.app.Fragment instantiateFragment(android.content.Context, androidx.fragment.app.FragmentManager, String, android.os.Bundle?);
+ method public android.support.v4.app.Fragment instantiateFragment(android.content.Context, android.support.v4.app.FragmentManager, String, android.os.Bundle?);
method public androidx.navigation.NavDestination? navigate(androidx.navigation.fragment.FragmentNavigator.Destination, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
method public boolean popBackStack();
}
@@ -27,12 +27,12 @@
method public androidx.navigation.fragment.FragmentNavigator.Extras build();
}
- public class NavHostFragment extends androidx.fragment.app.Fragment implements androidx.navigation.NavHost {
+ public class NavHostFragment extends android.support.v4.app.Fragment implements androidx.navigation.NavHost {
ctor public NavHostFragment();
method public static androidx.navigation.fragment.NavHostFragment create(@NavigationRes int);
method public static androidx.navigation.fragment.NavHostFragment create(@NavigationRes int, android.os.Bundle?);
method protected androidx.navigation.Navigator<? extends androidx.navigation.fragment.FragmentNavigator.Destination> createFragmentNavigator();
- method public static androidx.navigation.NavController findNavController(androidx.fragment.app.Fragment);
+ method public static androidx.navigation.NavController findNavController(android.support.v4.app.Fragment);
method public final androidx.navigation.NavController getNavController();
}
diff --git a/navigation/fragment/api/res-1.0.0-beta01.txt b/navigation/fragment/api/res-1.0.0-beta01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/fragment/api/res-1.0.0-beta01.txt
+++ /dev/null
diff --git a/navigation/fragment/api/res-1.0.0-beta02.txt b/navigation/fragment/api/res-1.0.0-beta02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/fragment/api/res-1.0.0-beta02.txt
+++ /dev/null
diff --git a/navigation/fragment/api/res-1.0.0-rc01.txt b/navigation/fragment/api/res-1.0.0-rc01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/fragment/api/res-1.0.0-rc01.txt
+++ /dev/null
diff --git a/navigation/fragment/api/res-1.0.0-rc02.txt b/navigation/fragment/api/res-1.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/fragment/api/res-1.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/fragment/api/res-2.0.0-rc02.txt b/navigation/fragment/api/res-2.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/fragment/api/res-2.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/fragment/api/restricted_1.0.0-beta01.txt b/navigation/fragment/api/restricted_1.0.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/fragment/api/restricted_1.0.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/fragment/api/restricted_1.0.0-beta02.txt b/navigation/fragment/api/restricted_1.0.0-beta02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/fragment/api/restricted_1.0.0-beta02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/fragment/api/restricted_1.0.0-rc01.txt b/navigation/fragment/api/restricted_1.0.0-rc01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/fragment/api/restricted_1.0.0-rc01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/fragment/api/restricted_1.0.0-rc02.txt b/navigation/fragment/api/restricted_1.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/fragment/api/restricted_1.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/fragment/api/restricted_2.0.0-rc02.txt b/navigation/fragment/api/restricted_2.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/fragment/api/restricted_2.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/fragment/api/restricted_current.txt b/navigation/fragment/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/fragment/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/fragment/ktx/api/1.0.0-alpha08.txt b/navigation/fragment/ktx/api/1.0.0-alpha08.txt
index 07491e2..b126ace 100644
--- a/navigation/fragment/ktx/api/1.0.0-alpha08.txt
+++ b/navigation/fragment/ktx/api/1.0.0-alpha08.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.fragment {
public final class FragmentKt {
diff --git a/navigation/fragment/ktx/api/1.0.0-alpha09.txt b/navigation/fragment/ktx/api/1.0.0-alpha09.txt
index 07491e2..b126ace 100644
--- a/navigation/fragment/ktx/api/1.0.0-alpha09.txt
+++ b/navigation/fragment/ktx/api/1.0.0-alpha09.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.fragment {
public final class FragmentKt {
diff --git a/navigation/fragment/ktx/api/1.0.0-alpha10.txt b/navigation/fragment/ktx/api/1.0.0-alpha10.txt
index e0961d2..9d0cbae 100644
--- a/navigation/fragment/ktx/api/1.0.0-alpha10.txt
+++ b/navigation/fragment/ktx/api/1.0.0-alpha10.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.fragment {
public final class FragmentKt {
diff --git a/navigation/fragment/ktx/api/1.0.0-alpha11.txt b/navigation/fragment/ktx/api/1.0.0-alpha11.txt
index 0e75320..9d0cbae 100644
--- a/navigation/fragment/ktx/api/1.0.0-alpha11.txt
+++ b/navigation/fragment/ktx/api/1.0.0-alpha11.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.fragment {
public final class FragmentKt {
@@ -8,7 +8,6 @@
public final class FragmentNavArgsLazyKt {
ctor public FragmentNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(android.support.v4.app.Fragment);
}
public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
@@ -18,8 +17,6 @@
public final class FragmentNavigatorDestinationBuilderKt {
ctor public FragmentNavigatorDestinationBuilderKt();
- method public static inline <reified F extends android.support.v4.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends android.support.v4.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,kotlin.Unit>! builder);
}
public final class FragmentNavigatorExtrasKt {
diff --git a/navigation/fragment/ktx/api/1.0.0-beta01.txt b/navigation/fragment/ktx/api/1.0.0-beta01.txt
deleted file mode 100644
index 0e75320..0000000
--- a/navigation/fragment/ktx/api/1.0.0-beta01.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.fragment {
-
- public final class FragmentKt {
- ctor public FragmentKt();
- method public static androidx.navigation.NavController findNavController(android.support.v4.app.Fragment);
- }
-
- public final class FragmentNavArgsLazyKt {
- ctor public FragmentNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(android.support.v4.app.Fragment);
- }
-
- public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
- ctor public FragmentNavigatorDestinationBuilder(androidx.navigation.fragment.FragmentNavigator navigator, @IdRes int id, kotlin.reflect.KClass<? extends android.support.v4.app.Fragment> fragmentClass);
- method public androidx.navigation.fragment.FragmentNavigator.Destination build();
- }
-
- public final class FragmentNavigatorDestinationBuilderKt {
- ctor public FragmentNavigatorDestinationBuilderKt();
- method public static inline <reified F extends android.support.v4.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends android.support.v4.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,kotlin.Unit>! builder);
- }
-
- public final class FragmentNavigatorExtrasKt {
- ctor public FragmentNavigatorExtrasKt();
- method public static androidx.navigation.fragment.FragmentNavigator.Extras FragmentNavigatorExtras(kotlin.Pair<? extends android.view.View,java.lang.String>... sharedElements);
- }
-
-}
-
diff --git a/navigation/fragment/ktx/api/1.0.0-beta02.txt b/navigation/fragment/ktx/api/1.0.0-beta02.txt
deleted file mode 100644
index 0e75320..0000000
--- a/navigation/fragment/ktx/api/1.0.0-beta02.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.fragment {
-
- public final class FragmentKt {
- ctor public FragmentKt();
- method public static androidx.navigation.NavController findNavController(android.support.v4.app.Fragment);
- }
-
- public final class FragmentNavArgsLazyKt {
- ctor public FragmentNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(android.support.v4.app.Fragment);
- }
-
- public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
- ctor public FragmentNavigatorDestinationBuilder(androidx.navigation.fragment.FragmentNavigator navigator, @IdRes int id, kotlin.reflect.KClass<? extends android.support.v4.app.Fragment> fragmentClass);
- method public androidx.navigation.fragment.FragmentNavigator.Destination build();
- }
-
- public final class FragmentNavigatorDestinationBuilderKt {
- ctor public FragmentNavigatorDestinationBuilderKt();
- method public static inline <reified F extends android.support.v4.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends android.support.v4.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,kotlin.Unit>! builder);
- }
-
- public final class FragmentNavigatorExtrasKt {
- ctor public FragmentNavigatorExtrasKt();
- method public static androidx.navigation.fragment.FragmentNavigator.Extras FragmentNavigatorExtras(kotlin.Pair<? extends android.view.View,java.lang.String>... sharedElements);
- }
-
-}
-
diff --git a/navigation/fragment/ktx/api/1.0.0-rc01.txt b/navigation/fragment/ktx/api/1.0.0-rc01.txt
deleted file mode 100644
index 0e75320..0000000
--- a/navigation/fragment/ktx/api/1.0.0-rc01.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.fragment {
-
- public final class FragmentKt {
- ctor public FragmentKt();
- method public static androidx.navigation.NavController findNavController(android.support.v4.app.Fragment);
- }
-
- public final class FragmentNavArgsLazyKt {
- ctor public FragmentNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(android.support.v4.app.Fragment);
- }
-
- public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
- ctor public FragmentNavigatorDestinationBuilder(androidx.navigation.fragment.FragmentNavigator navigator, @IdRes int id, kotlin.reflect.KClass<? extends android.support.v4.app.Fragment> fragmentClass);
- method public androidx.navigation.fragment.FragmentNavigator.Destination build();
- }
-
- public final class FragmentNavigatorDestinationBuilderKt {
- ctor public FragmentNavigatorDestinationBuilderKt();
- method public static inline <reified F extends android.support.v4.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends android.support.v4.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,kotlin.Unit>! builder);
- }
-
- public final class FragmentNavigatorExtrasKt {
- ctor public FragmentNavigatorExtrasKt();
- method public static androidx.navigation.fragment.FragmentNavigator.Extras FragmentNavigatorExtras(kotlin.Pair<? extends android.view.View,java.lang.String>... sharedElements);
- }
-
-}
-
diff --git a/navigation/fragment/ktx/api/1.0.0-rc02.txt b/navigation/fragment/ktx/api/1.0.0-rc02.txt
deleted file mode 100644
index 0e75320..0000000
--- a/navigation/fragment/ktx/api/1.0.0-rc02.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.fragment {
-
- public final class FragmentKt {
- ctor public FragmentKt();
- method public static androidx.navigation.NavController findNavController(android.support.v4.app.Fragment);
- }
-
- public final class FragmentNavArgsLazyKt {
- ctor public FragmentNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(android.support.v4.app.Fragment);
- }
-
- public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
- ctor public FragmentNavigatorDestinationBuilder(androidx.navigation.fragment.FragmentNavigator navigator, @IdRes int id, kotlin.reflect.KClass<? extends android.support.v4.app.Fragment> fragmentClass);
- method public androidx.navigation.fragment.FragmentNavigator.Destination build();
- }
-
- public final class FragmentNavigatorDestinationBuilderKt {
- ctor public FragmentNavigatorDestinationBuilderKt();
- method public static inline <reified F extends android.support.v4.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends android.support.v4.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,kotlin.Unit>! builder);
- }
-
- public final class FragmentNavigatorExtrasKt {
- ctor public FragmentNavigatorExtrasKt();
- method public static androidx.navigation.fragment.FragmentNavigator.Extras FragmentNavigatorExtras(kotlin.Pair<? extends android.view.View,java.lang.String>... sharedElements);
- }
-
-}
-
diff --git a/navigation/fragment/ktx/api/2.0.0-rc02.txt b/navigation/fragment/ktx/api/2.0.0-rc02.txt
deleted file mode 100644
index b8b9aba..0000000
--- a/navigation/fragment/ktx/api/2.0.0-rc02.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.fragment {
-
- public final class FragmentKt {
- ctor public FragmentKt();
- method public static androidx.navigation.NavController findNavController(androidx.fragment.app.Fragment);
- }
-
- public final class FragmentNavArgsLazyKt {
- ctor public FragmentNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(androidx.fragment.app.Fragment);
- }
-
- public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
- ctor public FragmentNavigatorDestinationBuilder(androidx.navigation.fragment.FragmentNavigator navigator, @IdRes int id, kotlin.reflect.KClass<? extends androidx.fragment.app.Fragment> fragmentClass);
- method public androidx.navigation.fragment.FragmentNavigator.Destination build();
- }
-
- public final class FragmentNavigatorDestinationBuilderKt {
- ctor public FragmentNavigatorDestinationBuilderKt();
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,kotlin.Unit>! builder);
- }
-
- public final class FragmentNavigatorExtrasKt {
- ctor public FragmentNavigatorExtrasKt();
- method public static androidx.navigation.fragment.FragmentNavigator.Extras FragmentNavigatorExtras(kotlin.Pair<? extends android.view.View,java.lang.String>... sharedElements);
- }
-
-}
-
diff --git a/navigation/fragment/ktx/api/current.txt b/navigation/fragment/ktx/api/current.txt
index b8b9aba..9d0cbae 100644
--- a/navigation/fragment/ktx/api/current.txt
+++ b/navigation/fragment/ktx/api/current.txt
@@ -1,25 +1,22 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.fragment {
public final class FragmentKt {
ctor public FragmentKt();
- method public static androidx.navigation.NavController findNavController(androidx.fragment.app.Fragment);
+ method public static androidx.navigation.NavController findNavController(android.support.v4.app.Fragment);
}
public final class FragmentNavArgsLazyKt {
ctor public FragmentNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(androidx.fragment.app.Fragment);
}
public final class FragmentNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.fragment.FragmentNavigator.Destination> {
- ctor public FragmentNavigatorDestinationBuilder(androidx.navigation.fragment.FragmentNavigator navigator, @IdRes int id, kotlin.reflect.KClass<? extends androidx.fragment.app.Fragment> fragmentClass);
+ ctor public FragmentNavigatorDestinationBuilder(androidx.navigation.fragment.FragmentNavigator navigator, @IdRes int id, kotlin.reflect.KClass<? extends android.support.v4.app.Fragment> fragmentClass);
method public androidx.navigation.fragment.FragmentNavigator.Destination build();
}
public final class FragmentNavigatorDestinationBuilderKt {
ctor public FragmentNavigatorDestinationBuilderKt();
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline <reified F extends androidx.fragment.app.Fragment> void fragment(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.fragment.FragmentNavigatorDestinationBuilder,kotlin.Unit>! builder);
}
public final class FragmentNavigatorExtrasKt {
diff --git a/navigation/fragment/ktx/api/res-1.0.0-beta01.txt b/navigation/fragment/ktx/api/res-1.0.0-beta01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/fragment/ktx/api/res-1.0.0-beta01.txt
+++ /dev/null
diff --git a/navigation/fragment/ktx/api/res-1.0.0-beta02.txt b/navigation/fragment/ktx/api/res-1.0.0-beta02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/fragment/ktx/api/res-1.0.0-beta02.txt
+++ /dev/null
diff --git a/navigation/fragment/ktx/api/res-1.0.0-rc01.txt b/navigation/fragment/ktx/api/res-1.0.0-rc01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/fragment/ktx/api/res-1.0.0-rc01.txt
+++ /dev/null
diff --git a/navigation/fragment/ktx/api/res-1.0.0-rc02.txt b/navigation/fragment/ktx/api/res-1.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/fragment/ktx/api/res-1.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/fragment/ktx/api/res-2.0.0-rc02.txt b/navigation/fragment/ktx/api/res-2.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/fragment/ktx/api/res-2.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/fragment/ktx/api/restricted_1.0.0-beta01.txt b/navigation/fragment/ktx/api/restricted_1.0.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/fragment/ktx/api/restricted_1.0.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/fragment/ktx/api/restricted_1.0.0-beta02.txt b/navigation/fragment/ktx/api/restricted_1.0.0-beta02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/fragment/ktx/api/restricted_1.0.0-beta02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/fragment/ktx/api/restricted_1.0.0-rc01.txt b/navigation/fragment/ktx/api/restricted_1.0.0-rc01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/fragment/ktx/api/restricted_1.0.0-rc01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/fragment/ktx/api/restricted_1.0.0-rc02.txt b/navigation/fragment/ktx/api/restricted_1.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/fragment/ktx/api/restricted_1.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/fragment/ktx/api/restricted_2.0.0-rc02.txt b/navigation/fragment/ktx/api/restricted_2.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/fragment/ktx/api/restricted_2.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/fragment/ktx/api/restricted_current.txt b/navigation/fragment/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/fragment/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderTest.kt b/navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderTest.kt
index e1ad9dc..97dbd9c 100644
--- a/navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderTest.kt
+++ b/navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorDestinationBuilderTest.kt
@@ -16,7 +16,7 @@
package androidx.navigation.fragment
-import androidx.fragment.app.Fragment
+import android.support.v4.app.Fragment
import androidx.navigation.contains
import androidx.navigation.createGraph
import androidx.navigation.get
diff --git a/navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorExtrasTest.kt b/navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorExtrasTest.kt
index baa4910e..f6820e4 100644
--- a/navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorExtrasTest.kt
+++ b/navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorExtrasTest.kt
@@ -18,14 +18,14 @@
import android.view.View
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.mock
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4::class)
class FragmentNavigatorExtrasTest {
diff --git a/navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentTest.kt b/navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentTest.kt
index 9e55a1f..3dcac78 100644
--- a/navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentTest.kt
+++ b/navigation/fragment/ktx/src/androidTest/java/androidx/navigation/fragment/FragmentTest.kt
@@ -17,12 +17,12 @@
package androidx.navigation.fragment
import android.os.Bundle
-import androidx.fragment.app.Fragment
-import androidx.fragment.app.FragmentActivity
+import android.support.v4.app.Fragment
+import android.support.v4.app.FragmentActivity
import androidx.navigation.NavArgs
import androidx.navigation.fragment.ktx.test.R
import androidx.test.annotation.UiThreadTest
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import androidx.test.rule.ActivityTestRule
import com.google.common.truth.Truth.assertThat
import org.junit.Assert.assertTrue
@@ -30,7 +30,7 @@
import org.junit.Rule
import org.junit.Test
-@LargeTest
+@SmallTest
class ActivityTest {
@get:Rule val activityRule = ActivityTestRule<TestActivity>(TestActivity::class.java)
private val fragmentManager get() = activityRule.activity.supportFragmentManager
diff --git a/navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/Fragment.kt b/navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/Fragment.kt
index 56a51a7..e803052 100644
--- a/navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/Fragment.kt
+++ b/navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/Fragment.kt
@@ -16,7 +16,7 @@
package androidx.navigation.fragment
-import androidx.fragment.app.Fragment
+import android.support.v4.app.Fragment
import androidx.navigation.NavController
/**
diff --git a/navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/FragmentNavArgsLazy.kt b/navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/FragmentNavArgsLazy.kt
index a093a99..42ac876 100644
--- a/navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/FragmentNavArgsLazy.kt
+++ b/navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/FragmentNavArgsLazy.kt
@@ -16,8 +16,8 @@
package androidx.navigation.fragment
-import androidx.annotation.MainThread
-import androidx.fragment.app.Fragment
+import android.support.annotation.MainThread
+import android.support.v4.app.Fragment
import androidx.navigation.NavArgs
import androidx.navigation.NavArgsLazy
diff --git a/navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder.kt b/navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder.kt
index f59a3ae..6b7e500 100644
--- a/navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder.kt
+++ b/navigation/fragment/ktx/src/main/java/androidx/navigation/fragment/FragmentNavigatorDestinationBuilder.kt
@@ -16,8 +16,8 @@
package androidx.navigation.fragment
-import androidx.annotation.IdRes
-import androidx.fragment.app.Fragment
+import android.support.annotation.IdRes
+import android.support.v4.app.Fragment
import androidx.navigation.NavDestinationBuilder
import androidx.navigation.NavDestinationDsl
import androidx.navigation.NavGraphBuilder
diff --git a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/BaseNavControllerTest.kt b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/BaseNavControllerTest.kt
index 2206d43..dd6fd0a2 100644
--- a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/BaseNavControllerTest.kt
+++ b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/BaseNavControllerTest.kt
@@ -21,9 +21,9 @@
import android.content.Intent
import android.net.Uri
import android.os.Bundle
-import androidx.annotation.IdRes
-import androidx.annotation.NavigationRes
-import androidx.fragment.app.FragmentActivity
+import android.support.annotation.IdRes
+import android.support.annotation.NavigationRes
+import android.support.v4.app.FragmentActivity
import androidx.navigation.NavController
import androidx.navigation.NavDeepLinkBuilder
import androidx.navigation.Navigation
diff --git a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/DynamicNavControllerTest.kt b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/DynamicNavControllerTest.kt
index 01c531c..a0d9441 100644
--- a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/DynamicNavControllerTest.kt
+++ b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/DynamicNavControllerTest.kt
@@ -20,10 +20,10 @@
import androidx.navigation.NavController
import androidx.navigation.fragment.test.R
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import org.junit.runner.RunWith
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4::class)
class DynamicNavControllerTest : BaseNavControllerTest<DynamicNavigationActivity>(
DynamicNavigationActivity::class.java)
diff --git a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/EmbeddedXmlTest.kt b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/EmbeddedXmlTest.kt
index 19455e5..cc8b40d 100644
--- a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/EmbeddedXmlTest.kt
+++ b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/EmbeddedXmlTest.kt
@@ -18,22 +18,22 @@
import android.content.Intent
import android.os.Bundle
+import android.support.v4.app.Fragment
+import android.support.v4.app.FragmentActivity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import androidx.fragment.app.Fragment
-import androidx.fragment.app.FragmentActivity
import androidx.navigation.NavController
import androidx.navigation.fragment.test.R
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4::class)
class EmbeddedXmlTest {
diff --git a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorExtrasTest.kt b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorExtrasTest.kt
index 1222a4e..4b42dfb 100644
--- a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorExtrasTest.kt
+++ b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorExtrasTest.kt
@@ -18,14 +18,14 @@
import android.view.View
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.mock
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4::class)
class FragmentNavigatorExtrasTest {
diff --git a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
index 07c19b3..e6af504 100644
--- a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
+++ b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
@@ -16,21 +16,22 @@
package androidx.navigation.fragment
+import android.arch.lifecycle.Lifecycle
import android.os.Bundle
-import androidx.fragment.app.FragmentActivity
-import androidx.fragment.app.FragmentManager
-import androidx.lifecycle.Lifecycle
+import android.support.v4.app.FragmentActivity
+import android.support.v4.app.FragmentManager
import androidx.navigation.NavOptions
import androidx.navigation.Navigator
import androidx.navigation.fragment.test.EmptyFragment
import androidx.navigation.fragment.test.R
import androidx.test.annotation.UiThreadTest
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import androidx.test.rule.ActivityTestRule
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
import org.junit.Assert.assertEquals
+import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertTrue
@@ -42,7 +43,7 @@
import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4::class)
class FragmentNavigatorTest {
@@ -221,61 +222,34 @@
@Test
fun testSingleTop() {
val fragmentNavigator = FragmentNavigator(emptyActivity, fragmentManager, R.id.container)
- val backPressListener = mock(Navigator.OnNavigatorBackPressListener::class.java)
- fragmentNavigator.addOnNavigatorBackPressListener(backPressListener)
val destination = fragmentNavigator.createDestination()
destination.className = EmptyFragment::class.java.name
// First push an initial Fragment
assertThat(fragmentNavigator.navigate(destination, null, null, null))
.isEqualTo(destination)
- fragmentManager.executePendingTransactions()
- val initialFragment = fragmentManager.findFragmentById(R.id.container)
- assertWithMessage("Initial Fragment should be added")
- .that(initialFragment)
- .isNotNull()
// Now push the Fragment that we want to replace with a singleTop operation
- destination.id = 1
assertThat(fragmentNavigator.navigate(destination, null, null, null))
.isEqualTo(destination)
fragmentManager.executePendingTransactions()
val fragment = fragmentManager.findFragmentById(R.id.container)
- assertWithMessage("Fragment should be added")
- .that(fragment)
- .isNotNull()
+ assertNotNull("Fragment should be added", fragment)
assertThat(fragmentNavigator.navigate(destination, null,
NavOptions.Builder().setLaunchSingleTop(true).build(), null))
.isNull()
fragmentManager.executePendingTransactions()
val replacementFragment = fragmentManager.findFragmentById(R.id.container)
- assertWithMessage("Replacement Fragment should be added")
- .that(replacementFragment)
- .isNotNull()
- assertWithMessage("Replacement Fragment should be the correct type")
- .that(replacementFragment)
- .isInstanceOf(EmptyFragment::class.java)
- assertWithMessage("Replacement Fragment should be the primary navigation Fragment")
- .that(fragmentManager.primaryNavigationFragment)
- .isSameAs(replacementFragment)
- assertWithMessage("Replacement should be a new instance")
- .that(replacementFragment)
- .isNotSameAs(fragment)
- assertWithMessage("Old instance should be destroyed")
- .that(fragment!!.lifecycle.currentState)
- .isEqualTo(Lifecycle.State.DESTROYED)
-
- assertThat(fragmentNavigator.popBackStack())
- .isTrue()
- fragmentManager.executePendingTransactions()
- assertWithMessage("Initial Fragment should be on top of back stack after pop")
- .that(fragmentManager.findFragmentById(R.id.container))
- .isSameAs(initialFragment)
- // TODO enable after fixing b/124332597 and moving to depend on AndroidX
- /*assertWithMessage("Initial Fragment should be the primary navigation Fragment")
- .that(fragmentManager.primaryNavigationFragment)
- .isSameAs(initialFragment)*/
+ assertNotNull("Replacement Fragment should be added", replacementFragment)
+ assertTrue("Replacement Fragment should be the correct type",
+ replacementFragment is EmptyFragment)
+ assertEquals("Replacement Fragment should be the primary navigation Fragment",
+ replacementFragment, fragmentManager.primaryNavigationFragment)
+ assertNotEquals("Replacement should be a new instance", fragment,
+ replacementFragment)
+ assertEquals("Old instance should be destroyed", Lifecycle.State.DESTROYED,
+ fragment!!.lifecycle.currentState)
}
@UiThreadTest
@@ -293,10 +267,8 @@
// Now pop the initial Fragment
val popped = fragmentNavigator.popBackStack()
- assertWithMessage("FragmentNavigator should return false when popping " +
- "the initial Fragment")
- .that(popped)
- .isTrue()
+ assertFalse("FragmentNavigator should return false when popping the initial Fragment",
+ popped)
}
@UiThreadTest
@@ -336,61 +308,6 @@
@UiThreadTest
@Test
- fun testPopWithSameDestinationTwice() {
- val fragmentNavigator = FragmentNavigator(emptyActivity, fragmentManager, R.id.container)
- val destination = fragmentNavigator.createDestination()
- destination.id = INITIAL_FRAGMENT
- destination.className = EmptyFragment::class.java.name
-
- // First push an initial Fragment
- assertThat(fragmentNavigator.navigate(destination, null, null, null))
- .isEqualTo(destination)
- fragmentManager.executePendingTransactions()
- val fragment = fragmentManager.findFragmentById(R.id.container)
- assertWithMessage("Fragment should be added")
- .that(fragment)
- .isNotNull()
-
- // Now push a second Fragment
- destination.id = SECOND_FRAGMENT
- assertThat(fragmentNavigator.navigate(destination, null, null, null))
- .isEqualTo(destination)
- fragmentManager.executePendingTransactions()
- val replacementFragment = fragmentManager.findFragmentById(R.id.container)
- assertWithMessage("Replacement Fragment should be added")
- .that(replacementFragment)
- .isNotNull()
- assertWithMessage("Replacement Fragment should be the primary navigation Fragment")
- .that(fragmentManager.primaryNavigationFragment)
- .isSameAs(replacementFragment)
-
- // Push the same Fragment a second time, creating a stack of two
- // identical Fragments
- assertThat(fragmentNavigator.navigate(destination, null, null, null))
- .isEqualTo(destination)
- fragmentManager.executePendingTransactions()
- val fragmentToPop = fragmentManager.findFragmentById(R.id.container)
- assertWithMessage("Fragment to pop should be added")
- .that(fragmentToPop)
- .isNotNull()
- assertWithMessage("Fragment to pop should be the primary navigation Fragment")
- .that(fragmentManager.primaryNavigationFragment)
- .isSameAs(fragmentToPop)
-
- // Now pop the Fragment
- val popped = fragmentNavigator.popBackStack()
- fragmentManager.executePendingTransactions()
- assertWithMessage("FragmentNavigator should return true when popping a Fragment")
- .that(popped)
- .isTrue()
- assertWithMessage("Replacement Fragment should be the primary navigation Fragment " +
- "after pop")
- .that(fragmentManager.primaryNavigationFragment)
- .isSameAs(replacementFragment)
- }
-
- @UiThreadTest
- @Test
fun testPopWithChildFragmentBackStack() {
val fragmentNavigator = FragmentNavigator(emptyActivity, fragmentManager, R.id.container)
val destination = fragmentNavigator.createDestination()
diff --git a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/ImmediateNavigationTest.kt b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/ImmediateNavigationTest.kt
index c27d6c7..dcc8776 100644
--- a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/ImmediateNavigationTest.kt
+++ b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/ImmediateNavigationTest.kt
@@ -17,11 +17,11 @@
package androidx.navigation.fragment
import android.os.Bundle
+import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
-import androidx.fragment.app.Fragment
import androidx.navigation.fragment.test.R
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
diff --git a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/StartDestinationArgsTest.kt b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/StartDestinationArgsTest.kt
index b6a230d..5ea2d3a 100644
--- a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/StartDestinationArgsTest.kt
+++ b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/StartDestinationArgsTest.kt
@@ -18,15 +18,15 @@
import android.content.Context
import android.os.Bundle
+import android.support.v4.app.Fragment
+import android.support.v4.app.FragmentActivity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
-import androidx.fragment.app.Fragment
-import androidx.fragment.app.FragmentActivity
import androidx.navigation.fragment.test.R
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.MediumTest
+import androidx.test.filters.SmallTest
import androidx.test.rule.ActivityTestRule
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
@@ -37,7 +37,7 @@
private const val TEST_ARG = "test"
private const val TEST_ARG_VALUE = "value"
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4::class)
class StartDestinationArgsTest {
diff --git a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/XmlNavControllerTest.kt b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/XmlNavControllerTest.kt
index cac5b11..ccc8849 100644
--- a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/XmlNavControllerTest.kt
+++ b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/XmlNavControllerTest.kt
@@ -20,10 +20,10 @@
import androidx.navigation.NavController
import androidx.navigation.fragment.test.R
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import org.junit.runner.RunWith
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4::class)
class XmlNavControllerTest : BaseNavControllerTest<XmlNavigationActivity>(
XmlNavigationActivity::class.java)
diff --git a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/test/EmptyFragment.kt b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/test/EmptyFragment.kt
index 8ab7d3f..018ae30 100644
--- a/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/test/EmptyFragment.kt
+++ b/navigation/fragment/src/androidTest/java/androidx/navigation/fragment/test/EmptyFragment.kt
@@ -17,11 +17,11 @@
package androidx.navigation.fragment.test
import android.os.Bundle
+import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
-import androidx.fragment.app.Fragment
class EmptyFragment : Fragment() {
override fun onCreateView(
diff --git a/navigation/fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.java b/navigation/fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.java
index 573846a..7488da0 100644
--- a/navigation/fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.java
+++ b/navigation/fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.java
@@ -19,17 +19,17 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Bundle;
+import android.support.annotation.CallSuper;
+import android.support.annotation.IdRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentTransaction;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
-import androidx.annotation.CallSuper;
-import androidx.annotation.IdRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.fragment.app.Fragment;
-import androidx.fragment.app.FragmentManager;
-import androidx.fragment.app.FragmentTransaction;
import androidx.navigation.NavController;
import androidx.navigation.NavDestination;
import androidx.navigation.NavOptions;
@@ -46,14 +46,6 @@
* Navigator that navigates through {@link FragmentTransaction fragment transactions}. Every
* destination using this Navigator must set a valid Fragment class name with
* <code>android:name</code> or {@link Destination#setClassName(String)}.
- * <p>
- * The current Fragment from FragmentNavigator's perspective can be retrieved by calling
- * {@link FragmentManager#getPrimaryNavigationFragment()} with the FragmentManager
- * passed to this FragmentNavigator.
- * <p>
- * Note that the default implementation does Fragment transactions
- * asynchronously, so the current Fragment will not be available immediately
- * (i.e., in callbacks to {@link NavController.OnDestinationChangedListener}).
*/
@Navigator.Name("fragment")
public class FragmentNavigator extends Navigator<FragmentNavigator.Destination> {
@@ -127,18 +119,6 @@
mFragmentManager.removeOnBackStackChangedListener(mOnBackStackChangedListener);
}
- /**
- * {@inheritDoc}
- * <p>
- * This method must call
- * {@link FragmentTransaction#setPrimaryNavigationFragment(Fragment)}
- * if the pop succeeded so that the newly visible Fragment can be retrieved with
- * {@link FragmentManager#getPrimaryNavigationFragment()}.
- * <p>
- * Note that the default implementation pops the Fragment
- * asynchronously, so the newly visible Fragment from the back stack
- * is not instantly available after this call completes.
- */
@Override
public boolean popBackStack() {
if (mBackStack.isEmpty()) {
@@ -149,14 +129,15 @@
+ " saved its state");
return false;
}
+ boolean popped = false;
if (mFragmentManager.getBackStackEntryCount() > 0) {
- mFragmentManager.popBackStack(
- generateBackStackName(mBackStack.size(), mBackStack.peekLast()),
+ mFragmentManager.popBackStack(Integer.toString(mBackStack.peekLast()),
FragmentManager.POP_BACK_STACK_INCLUSIVE);
mIsPendingBackStackOperation = true;
- } // else, we're on the first Fragment, so there's nothing to pop from FragmentManager
+ popped = true;
+ }
mBackStack.removeLast();
- return true;
+ return popped;
}
@NonNull
@@ -184,18 +165,6 @@
return Fragment.instantiate(context, className, args);
}
- /**
- * {@inheritDoc}
- * <p>
- * This method should always call
- * {@link FragmentTransaction#setPrimaryNavigationFragment(Fragment)}
- * so that the Fragment associated with the new destination can be retrieved with
- * {@link FragmentManager#getPrimaryNavigationFragment()}.
- * <p>
- * Note that the default implementation commits the new Fragment
- * asynchronously, so the new Fragment is not instantly available
- * after this call completes.
- */
@Nullable
@Override
public NavDestination navigate(@NonNull Destination destination, @Nullable Bundle args,
@@ -246,15 +215,13 @@
// back stack, a simple replace() isn't enough so we
// remove it from the back stack and put our replacement
// on the back stack in its place
- mFragmentManager.popBackStack(
- generateBackStackName(mBackStack.size(), mBackStack.peekLast()),
- FragmentManager.POP_BACK_STACK_INCLUSIVE);
- ft.addToBackStack(generateBackStackName(mBackStack.size(), destId));
+ mFragmentManager.popBackStack();
+ ft.addToBackStack(Integer.toString(destId));
mIsPendingBackStackOperation = true;
}
isAdded = false;
} else {
- ft.addToBackStack(generateBackStackName(mBackStack.size() + 1, destId));
+ ft.addToBackStack(Integer.toString(destId));
mIsPendingBackStackOperation = true;
isAdded = true;
}
@@ -301,31 +268,6 @@
}
}
- @NonNull
- private String generateBackStackName(int backStackIndex, int destId) {
- return backStackIndex + "-" + destId;
- }
-
- private int getDestId(@Nullable String backStackName) {
- String[] split = backStackName != null ? backStackName.split("-") : new String[0];
- if (split.length != 2) {
- throw new IllegalStateException("Invalid back stack entry on the "
- + "NavHostFragment's back stack - use getChildFragmentManager() "
- + "if you need to do custom FragmentTransactions from within "
- + "Fragments created via your navigation graph.");
- }
- try {
- // Just make sure the backStackIndex is correctly formatted
- Integer.parseInt(split[0]);
- return Integer.parseInt(split[1]);
- } catch (NumberFormatException e) {
- throw new IllegalStateException("Invalid back stack entry on the "
- + "NavHostFragment's back stack - use getChildFragmentManager() "
- + "if you need to do custom FragmentTransactions from within "
- + "Fragments created via your navigation graph.");
- }
- }
-
/**
* Checks if this FragmentNavigator's back stack is equal to the FragmentManager's back stack.
*/
@@ -343,7 +285,7 @@
while (backStackIterator.hasNext() && fragmentBackStackIndex >= 0) {
int destId = backStackIterator.next();
try {
- int fragmentDestId = getDestId(mFragmentManager
+ int fragmentDestId = Integer.valueOf(mFragmentManager
.getBackStackEntryAt(fragmentBackStackIndex--)
.getName());
if (destId != fragmentDestId) {
diff --git a/navigation/fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.java b/navigation/fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.java
index 53294d1..1b233a8 100644
--- a/navigation/fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.java
+++ b/navigation/fragment/src/main/java/androidx/navigation/fragment/NavHostFragment.java
@@ -19,17 +19,17 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Bundle;
+import android.support.annotation.CallSuper;
+import android.support.annotation.NavigationRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
-import androidx.annotation.CallSuper;
-import androidx.annotation.NavigationRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.fragment.app.Fragment;
import androidx.navigation.NavController;
import androidx.navigation.NavGraph;
import androidx.navigation.NavHost;
diff --git a/navigation/integration-tests/safeargs-testapp/src/foo/res/navigation/nav_test.xml b/navigation/integration-tests/safeargs-testapp/src/foo/res/navigation/nav_test.xml
index 2f94841..70debb7 100644
--- a/navigation/integration-tests/safeargs-testapp/src/foo/res/navigation/nav_test.xml
+++ b/navigation/integration-tests/safeargs-testapp/src/foo/res/navigation/nav_test.xml
@@ -25,7 +25,7 @@
</action>
</fragment>
<fragment android:id="@+id/foo_fragment"
- android:name="androidx.navigation.FooFragment">
+ android:name="android.arch.navigation.FooFragment">
<argument android:name="myarg2" />
</fragment>
<fragment android:id="@+id/next_fragment"/>
diff --git a/navigation/integration-tests/safeargs-testapp/src/main/AndroidManifest.xml b/navigation/integration-tests/safeargs-testapp/src/main/AndroidManifest.xml
index ada1efa6..c97e190 100644
--- a/navigation/integration-tests/safeargs-testapp/src/main/AndroidManifest.xml
+++ b/navigation/integration-tests/safeargs-testapp/src/main/AndroidManifest.xml
@@ -13,7 +13,7 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
- package="androidx.navigation.safeargs.testapp">
+ package="android.arch.navigation.safeargs.testapp">
<application
android:allowBackup="true"
diff --git a/navigation/integration-tests/safeargs-testapp/src/main/java/android/arch/navigation/Foo.java b/navigation/integration-tests/safeargs-testapp/src/main/java/android/arch/navigation/Foo.java
new file mode 100644
index 0000000..a794771
--- /dev/null
+++ b/navigation/integration-tests/safeargs-testapp/src/main/java/android/arch/navigation/Foo.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2017 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 android.arch.navigation;
+
+/**
+ * Dummy file, because android gradle plugin requires not empty sources
+ */
+public class Foo {
+}
diff --git a/navigation/integration-tests/safeargs-testapp/src/main/java/androidx/navigation/Foo.java b/navigation/integration-tests/safeargs-testapp/src/main/java/androidx/navigation/Foo.java
deleted file mode 100644
index 14da1f3..0000000
--- a/navigation/integration-tests/safeargs-testapp/src/main/java/androidx/navigation/Foo.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2019 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.navigation;
-
-/**
- * Dummy file, because android gradle plugin requires not empty sources
- */
-public class Foo {
-}
diff --git a/navigation/integration-tests/safeargs-testapp/src/main/res/navigation/nav_test.xml b/navigation/integration-tests/safeargs-testapp/src/main/res/navigation/nav_test.xml
index c91a211..4d4be46 100644
--- a/navigation/integration-tests/safeargs-testapp/src/main/res/navigation/nav_test.xml
+++ b/navigation/integration-tests/safeargs-testapp/src/main/res/navigation/nav_test.xml
@@ -19,14 +19,14 @@
xmlns:tools="http://schemas.android.com/tools"
app:startDestination="@+id/first_screen">
<fragment android:id="@+id/first_screen"
- android:name="androidx.navigation.testapp.MainFragment">
+ android:name="android.arch.navigation.testapp.MainFragment">
<action android:id="@+id/next" app:destination="@+id/next_fragment">
<argument android:name="myarg2"/>
<argument android:name="randomArgument"/>
</action>
</fragment>
<fragment android:id="@+id/next_fragment"
- android:name="androidx.navigation.testapp.NextFragment">
+ android:name="android.arch.navigation.testapp.NextFragment">
<argument android:name="myarg2" />
</fragment>
</navigation>
\ No newline at end of file
diff --git a/navigation/integration-tests/safeargs-testapp/src/test/java/android/arch/navigation/integration/MainDestinationTest.java b/navigation/integration-tests/safeargs-testapp/src/test/java/android/arch/navigation/integration/MainDestinationTest.java
new file mode 100644
index 0000000..0d3bf09
--- /dev/null
+++ b/navigation/integration-tests/safeargs-testapp/src/test/java/android/arch/navigation/integration/MainDestinationTest.java
@@ -0,0 +1,38 @@
+/*
+ * 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 android.arch.navigation.integration;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import android.arch.navigation.safeargs.testapp.R;
+import android.arch.navigation.testapp.MainFragmentDirections;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class MainDestinationTest {
+
+ @Test
+ public void destinationsTest() {
+ // test that we correctly generated R class references, so it compiles
+ MainFragmentDirections.Next directions = MainFragmentDirections.next("foo", "some");
+ assertThat(directions.getDestinationId(), is(R.id.next_fragment));
+ }
+}
diff --git a/navigation/integration-tests/safeargs-testapp/src/test/java/androidx/navigation/integration/MainDestinationTest.java b/navigation/integration-tests/safeargs-testapp/src/test/java/androidx/navigation/integration/MainDestinationTest.java
deleted file mode 100644
index f5b427d..0000000
--- a/navigation/integration-tests/safeargs-testapp/src/test/java/androidx/navigation/integration/MainDestinationTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2019 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.navigation.integration;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import androidx.navigation.safeargs.testapp.R;
-import androidx.navigation.testapp.MainFragmentDirections;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-@RunWith(JUnit4.class)
-public class MainDestinationTest {
-
- @Test
- public void destinationsTest() {
- // test that we correctly generated R class references, so it compiles
- MainFragmentDirections.Next directions = MainFragmentDirections.next("foo", "some");
- assertThat(directions.getDestinationId(), is(R.id.next_fragment));
- }
-}
diff --git a/navigation/integration-tests/safeargs-testapp/src/testFoo/java/android/arch/navigation/integration/flavor/foo/FlavorDestinationTest.java b/navigation/integration-tests/safeargs-testapp/src/testFoo/java/android/arch/navigation/integration/flavor/foo/FlavorDestinationTest.java
new file mode 100644
index 0000000..3229c58
--- /dev/null
+++ b/navigation/integration-tests/safeargs-testapp/src/testFoo/java/android/arch/navigation/integration/flavor/foo/FlavorDestinationTest.java
@@ -0,0 +1,43 @@
+/*
+ * 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 android.arch.navigation.integration.flavor.foo;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import android.arch.navigation.safeargs.testapp.R;
+import android.arch.navigation.safeargs.testapp.foo.MainFragmentDirections;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+/**
+ * this is teeeeeeeeeest
+ */
+@RunWith(JUnit4.class)
+public class FlavorDestinationTest {
+
+ /**
+ * teeeest
+ */
+ @Test
+ public void destinationsTest() {
+ MainFragmentDirections.Foo directions = MainFragmentDirections.foo("foo", "some");
+ assertThat(directions.getDestinationId(), is(R.id.foo_fragment));
+ }
+}
diff --git a/navigation/integration-tests/safeargs-testapp/src/testFoo/java/androidx/navigation/integration/flavor/foo/FlavorDestinationTest.java b/navigation/integration-tests/safeargs-testapp/src/testFoo/java/androidx/navigation/integration/flavor/foo/FlavorDestinationTest.java
deleted file mode 100644
index d9b6704..0000000
--- a/navigation/integration-tests/safeargs-testapp/src/testFoo/java/androidx/navigation/integration/flavor/foo/FlavorDestinationTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2019 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.navigation.integration.flavor.foo;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import androidx.navigation.safeargs.testapp.R;
-import androidx.navigation.safeargs.testapp.foo.MainFragmentDirections;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/**
- * this is teeeeeeeeeest
- */
-@RunWith(JUnit4.class)
-public class FlavorDestinationTest {
-
- /**
- * teeeest
- */
- @Test
- public void destinationsTest() {
- MainFragmentDirections.Foo directions = MainFragmentDirections.foo("foo", "some");
- assertThat(directions.getDestinationId(), is(R.id.foo_fragment));
- }
-}
diff --git a/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/AndroidFragment.kt b/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/AndroidFragment.kt
index 3f7c8f1..beb9b06 100644
--- a/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/AndroidFragment.kt
+++ b/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/AndroidFragment.kt
@@ -21,14 +21,14 @@
import android.content.Context
import android.os.Build
import android.os.Bundle
+import android.support.v4.app.Fragment
+import android.support.v4.app.NotificationCompat
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.EditText
import android.widget.TextView
-import androidx.core.app.NotificationCompat
-import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
/**
diff --git a/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/HelpActivity.kt b/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/HelpActivity.kt
index 900d312..1a1decd 100644
--- a/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/HelpActivity.kt
+++ b/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/HelpActivity.kt
@@ -18,22 +18,22 @@
import android.os.Build
import android.os.Bundle
+import android.support.design.widget.BottomSheetDialogFragment
+import android.support.design.widget.NavigationView
+import android.support.v7.app.AppCompatActivity
+import android.support.v7.graphics.drawable.DrawerArrowDrawable
+import android.support.v7.widget.Toolbar
import android.transition.Fade
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
-import androidx.appcompat.app.AppCompatActivity
-import androidx.appcompat.graphics.drawable.DrawerArrowDrawable
-import androidx.appcompat.widget.Toolbar
import androidx.navigation.ActivityNavigator
import androidx.navigation.NavController
import androidx.navigation.createGraph
import androidx.navigation.testing.TestNavigator
import androidx.navigation.testing.test
import androidx.navigation.ui.setupWithNavController
-import com.google.android.material.bottomsheet.BottomSheetDialogFragment
-import com.google.android.material.navigation.NavigationView
/**
* Simple 'Help' activity that shows the data URI passed to it. In a real world app, it would
diff --git a/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/MainFragment.kt b/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/MainFragment.kt
index 7ccb7e9..639de2d 100644
--- a/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/MainFragment.kt
+++ b/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/MainFragment.kt
@@ -17,12 +17,13 @@
package androidx.navigation.testapp
import android.os.Bundle
+import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
-import androidx.fragment.app.Fragment
+
import androidx.navigation.fragment.FragmentNavigatorExtras
import androidx.navigation.fragment.findNavController
diff --git a/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/NavigationActivity.kt b/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/NavigationActivity.kt
index fc4036b..6a23e25 100644
--- a/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/NavigationActivity.kt
+++ b/navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/NavigationActivity.kt
@@ -18,19 +18,19 @@
import android.content.res.Resources
import android.os.Bundle
+import android.support.design.widget.BottomNavigationView
+import android.support.design.widget.NavigationView
+import android.support.v4.app.ActivityOptionsCompat
+import android.support.v4.widget.DrawerLayout
+import android.support.v7.app.AppCompatActivity
+import android.support.v7.widget.Toolbar
import android.util.Log
import android.widget.Toast
-import androidx.appcompat.app.AppCompatActivity
-import androidx.appcompat.widget.Toolbar
-import androidx.core.app.ActivityOptionsCompat
-import androidx.drawerlayout.widget.DrawerLayout
import androidx.navigation.ActivityNavigatorExtras
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.NavigationUI
import androidx.navigation.ui.setupWithNavController
-import com.google.android.material.bottomnavigation.BottomNavigationView
-import com.google.android.material.navigation.NavigationView
/**
* A simple activity demonstrating use of a NavHostFragment with a navigation drawer.
@@ -60,8 +60,7 @@
when (item.itemId) {
R.id.help_activity -> {
navController.navigate(R.id.help_activity, null, null,
- ActivityNavigatorExtras(
- ActivityOptionsCompat
+ ActivityNavigatorExtras(ActivityOptionsCompat
.makeSceneTransitionAnimation(this,
toolbar, "toolbar")))
true
diff --git a/navigation/integration-tests/testapp/src/main/res/layout-h470dp/navigation_activity.xml b/navigation/integration-tests/testapp/src/main/res/layout-h470dp/navigation_activity.xml
index dee6e20..53cf5eeb 100644
--- a/navigation/integration-tests/testapp/src/main/res/layout-h470dp/navigation_activity.xml
+++ b/navigation/integration-tests/testapp/src/main/res/layout-h470dp/navigation_activity.xml
@@ -21,7 +21,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
- <androidx.appcompat.widget.Toolbar
+ <android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -38,7 +38,7 @@
app:navGraph="@navigation/nav_main"
app:defaultNavHost="true"
/>
- <com.google.android.material.bottomnavigation.BottomNavigationView
+ <android.support.design.widget.BottomNavigationView
android:id="@+id/bottom_nav_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/navigation/integration-tests/testapp/src/main/res/layout-w960dp/navigation_activity.xml b/navigation/integration-tests/testapp/src/main/res/layout-w960dp/navigation_activity.xml
index 95390d1..8603b72 100644
--- a/navigation/integration-tests/testapp/src/main/res/layout-w960dp/navigation_activity.xml
+++ b/navigation/integration-tests/testapp/src/main/res/layout-w960dp/navigation_activity.xml
@@ -20,7 +20,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
- <com.google.android.material.navigation.NavigationView
+ <android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@@ -35,7 +35,7 @@
android:layout_toRightOf="@id/nav_view"
android:layout_toEndOf="@id/nav_view"
android:background="?android:attr/listDivider"/>
- <androidx.appcompat.widget.Toolbar
+ <android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/navigation/integration-tests/testapp/src/main/res/layout/activity_help.xml b/navigation/integration-tests/testapp/src/main/res/layout/activity_help.xml
index 4d39fdc..e97c1de 100644
--- a/navigation/integration-tests/testapp/src/main/res/layout/activity_help.xml
+++ b/navigation/integration-tests/testapp/src/main/res/layout/activity_help.xml
@@ -18,7 +18,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
- <androidx.appcompat.widget.Toolbar
+ <android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -38,7 +38,7 @@
android:layout_height="wrap_content"/>
</FrameLayout>
- <androidx.appcompat.widget.Toolbar
+ <android.support.v7.widget.Toolbar
android:id="@+id/bottom_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/navigation/integration-tests/testapp/src/main/res/layout/bottom_bar_menu.xml b/navigation/integration-tests/testapp/src/main/res/layout/bottom_bar_menu.xml
index b4d5edd..8ee2170 100644
--- a/navigation/integration-tests/testapp/src/main/res/layout/bottom_bar_menu.xml
+++ b/navigation/integration-tests/testapp/src/main/res/layout/bottom_bar_menu.xml
@@ -15,7 +15,7 @@
~ limitations under the License.
-->
-<com.google.android.material.navigation.NavigationView
+<android.support.design.widget.NavigationView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
diff --git a/navigation/integration-tests/testapp/src/main/res/layout/navigation_activity.xml b/navigation/integration-tests/testapp/src/main/res/layout/navigation_activity.xml
index 3d6fc1b..dfae8ac 100644
--- a/navigation/integration-tests/testapp/src/main/res/layout/navigation_activity.xml
+++ b/navigation/integration-tests/testapp/src/main/res/layout/navigation_activity.xml
@@ -11,7 +11,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<androidx.drawerlayout.widget.DrawerLayout
+<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
@@ -22,7 +22,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
- <androidx.appcompat.widget.Toolbar
+ <android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -39,10 +39,10 @@
app:defaultNavHost="true"
/>
</LinearLayout>
- <com.google.android.material.navigation.NavigationView
+ <android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:menu="@menu/menu_nav_drawer"/>
-</androidx.drawerlayout.widget.DrawerLayout>
+</android.support.v4.widget.DrawerLayout>
diff --git a/navigation/runtime/api/1.0.0-alpha08.txt b/navigation/runtime/api/1.0.0-alpha08.txt
index 1a22540..fc3d943 100644
--- a/navigation/runtime/api/1.0.0-alpha08.txt
+++ b/navigation/runtime/api/1.0.0-alpha08.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
@androidx.navigation.Navigator.Name("activity") public class ActivityNavigator extends androidx.navigation.Navigator<androidx.navigation.ActivityNavigator.Destination> {
diff --git a/navigation/runtime/api/1.0.0-alpha09.txt b/navigation/runtime/api/1.0.0-alpha09.txt
index 1a22540..fc3d943 100644
--- a/navigation/runtime/api/1.0.0-alpha09.txt
+++ b/navigation/runtime/api/1.0.0-alpha09.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
@androidx.navigation.Navigator.Name("activity") public class ActivityNavigator extends androidx.navigation.Navigator<androidx.navigation.ActivityNavigator.Destination> {
diff --git a/navigation/runtime/api/1.0.0-alpha10.txt b/navigation/runtime/api/1.0.0-alpha10.txt
index 0073e0d..84c6a22 100644
--- a/navigation/runtime/api/1.0.0-alpha10.txt
+++ b/navigation/runtime/api/1.0.0-alpha10.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
@androidx.navigation.Navigator.Name("activity") public class ActivityNavigator extends androidx.navigation.Navigator<androidx.navigation.ActivityNavigator.Destination> {
diff --git a/navigation/runtime/api/1.0.0-alpha11.txt b/navigation/runtime/api/1.0.0-alpha11.txt
index 0073e0d..84c6a22 100644
--- a/navigation/runtime/api/1.0.0-alpha11.txt
+++ b/navigation/runtime/api/1.0.0-alpha11.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
@androidx.navigation.Navigator.Name("activity") public class ActivityNavigator extends androidx.navigation.Navigator<androidx.navigation.ActivityNavigator.Destination> {
diff --git a/navigation/runtime/api/1.0.0-beta01.txt b/navigation/runtime/api/1.0.0-beta01.txt
deleted file mode 100644
index 0073e0d..0000000
--- a/navigation/runtime/api/1.0.0-beta01.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- @androidx.navigation.Navigator.Name("activity") public class ActivityNavigator extends androidx.navigation.Navigator<androidx.navigation.ActivityNavigator.Destination> {
- ctor public ActivityNavigator(android.content.Context);
- method public static void applyPopAnimationsToPendingTransition(android.app.Activity);
- method public androidx.navigation.ActivityNavigator.Destination createDestination();
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.ActivityNavigator.Destination, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- @androidx.navigation.NavDestination.ClassType(Activity.class) public static class ActivityNavigator.Destination extends androidx.navigation.NavDestination {
- ctor public ActivityNavigator.Destination(androidx.navigation.NavigatorProvider);
- ctor public ActivityNavigator.Destination(androidx.navigation.Navigator<? extends androidx.navigation.ActivityNavigator.Destination>);
- method public final String? getAction();
- method public final android.content.ComponentName? getComponent();
- method public final android.net.Uri? getData();
- method public final String? getDataPattern();
- method public final android.content.Intent? getIntent();
- method public final androidx.navigation.ActivityNavigator.Destination setAction(String?);
- method public final androidx.navigation.ActivityNavigator.Destination setComponentName(android.content.ComponentName?);
- method public final androidx.navigation.ActivityNavigator.Destination setData(android.net.Uri?);
- method public final androidx.navigation.ActivityNavigator.Destination setDataPattern(String?);
- method public final androidx.navigation.ActivityNavigator.Destination setIntent(android.content.Intent?);
- }
-
- public static final class ActivityNavigator.Extras implements androidx.navigation.Navigator.Extras {
- method public android.support.v4.app.ActivityOptionsCompat? getActivityOptions();
- method public int getFlags();
- }
-
- public static final class ActivityNavigator.Extras.Builder {
- ctor public ActivityNavigator.Extras.Builder();
- method public androidx.navigation.ActivityNavigator.Extras.Builder addFlags(int);
- method public androidx.navigation.ActivityNavigator.Extras build();
- method public androidx.navigation.ActivityNavigator.Extras.Builder setActivityOptions(android.support.v4.app.ActivityOptionsCompat);
- }
-
- public class NavController {
- ctor public NavController(android.content.Context);
- method public void addOnDestinationChangedListener(androidx.navigation.NavController.OnDestinationChangedListener);
- method public androidx.navigation.NavDeepLinkBuilder createDeepLink();
- method public androidx.navigation.NavDestination? getCurrentDestination();
- method public androidx.navigation.NavGraph getGraph();
- method public androidx.navigation.NavInflater getNavInflater();
- method public androidx.navigation.NavigatorProvider getNavigatorProvider();
- method public boolean handleDeepLink(android.content.Intent?);
- method public void navigate(@IdRes int);
- method public void navigate(@IdRes int, android.os.Bundle?);
- method public void navigate(@IdRes int, android.os.Bundle?, androidx.navigation.NavOptions?);
- method public void navigate(@IdRes int, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public void navigate(androidx.navigation.NavDirections);
- method public void navigate(androidx.navigation.NavDirections, androidx.navigation.NavOptions?);
- method public void navigate(androidx.navigation.NavDirections, androidx.navigation.Navigator.Extras);
- method public boolean navigateUp();
- method public boolean popBackStack();
- method public boolean popBackStack(@IdRes int, boolean);
- method public void removeOnDestinationChangedListener(androidx.navigation.NavController.OnDestinationChangedListener);
- method @CallSuper public void restoreState(android.os.Bundle?);
- method @CallSuper public android.os.Bundle? saveState();
- method @CallSuper public void setGraph(@NavigationRes int);
- method @CallSuper public void setGraph(@NavigationRes int, android.os.Bundle?);
- method @CallSuper public void setGraph(androidx.navigation.NavGraph);
- method @CallSuper public void setGraph(androidx.navigation.NavGraph, android.os.Bundle?);
- field public static final String KEY_DEEP_LINK_INTENT = "android-support-nav:controller:deepLinkIntent";
- }
-
- public static interface NavController.OnDestinationChangedListener {
- method public void onDestinationChanged(androidx.navigation.NavController, androidx.navigation.NavDestination, android.os.Bundle?);
- }
-
- public final class NavDeepLinkBuilder {
- ctor public NavDeepLinkBuilder(android.content.Context);
- method public android.app.PendingIntent createPendingIntent();
- method public android.support.v4.app.TaskStackBuilder createTaskStackBuilder();
- method public androidx.navigation.NavDeepLinkBuilder setArguments(android.os.Bundle?);
- method public androidx.navigation.NavDeepLinkBuilder setComponentName(Class<? extends android.app.Activity>);
- method public androidx.navigation.NavDeepLinkBuilder setComponentName(android.content.ComponentName);
- method public androidx.navigation.NavDeepLinkBuilder setDestination(@IdRes int);
- method public androidx.navigation.NavDeepLinkBuilder setGraph(@NavigationRes int);
- method public androidx.navigation.NavDeepLinkBuilder setGraph(androidx.navigation.NavGraph);
- }
-
- public interface NavHost {
- method public androidx.navigation.NavController getNavController();
- }
-
- public final class NavInflater {
- ctor public NavInflater(android.content.Context, androidx.navigation.NavigatorProvider);
- method public androidx.navigation.NavGraph inflate(@NavigationRes int);
- }
-
- public final class Navigation {
- method public static android.view.View.OnClickListener createNavigateOnClickListener(@IdRes int);
- method public static android.view.View.OnClickListener createNavigateOnClickListener(@IdRes int, android.os.Bundle?);
- method public static androidx.navigation.NavController findNavController(android.app.Activity, @IdRes int);
- method public static androidx.navigation.NavController findNavController(android.view.View);
- method public static void setViewNavController(android.view.View, androidx.navigation.NavController?);
- }
-
-}
-
diff --git a/navigation/runtime/api/1.0.0-beta02.txt b/navigation/runtime/api/1.0.0-beta02.txt
deleted file mode 100644
index 0073e0d..0000000
--- a/navigation/runtime/api/1.0.0-beta02.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- @androidx.navigation.Navigator.Name("activity") public class ActivityNavigator extends androidx.navigation.Navigator<androidx.navigation.ActivityNavigator.Destination> {
- ctor public ActivityNavigator(android.content.Context);
- method public static void applyPopAnimationsToPendingTransition(android.app.Activity);
- method public androidx.navigation.ActivityNavigator.Destination createDestination();
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.ActivityNavigator.Destination, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- @androidx.navigation.NavDestination.ClassType(Activity.class) public static class ActivityNavigator.Destination extends androidx.navigation.NavDestination {
- ctor public ActivityNavigator.Destination(androidx.navigation.NavigatorProvider);
- ctor public ActivityNavigator.Destination(androidx.navigation.Navigator<? extends androidx.navigation.ActivityNavigator.Destination>);
- method public final String? getAction();
- method public final android.content.ComponentName? getComponent();
- method public final android.net.Uri? getData();
- method public final String? getDataPattern();
- method public final android.content.Intent? getIntent();
- method public final androidx.navigation.ActivityNavigator.Destination setAction(String?);
- method public final androidx.navigation.ActivityNavigator.Destination setComponentName(android.content.ComponentName?);
- method public final androidx.navigation.ActivityNavigator.Destination setData(android.net.Uri?);
- method public final androidx.navigation.ActivityNavigator.Destination setDataPattern(String?);
- method public final androidx.navigation.ActivityNavigator.Destination setIntent(android.content.Intent?);
- }
-
- public static final class ActivityNavigator.Extras implements androidx.navigation.Navigator.Extras {
- method public android.support.v4.app.ActivityOptionsCompat? getActivityOptions();
- method public int getFlags();
- }
-
- public static final class ActivityNavigator.Extras.Builder {
- ctor public ActivityNavigator.Extras.Builder();
- method public androidx.navigation.ActivityNavigator.Extras.Builder addFlags(int);
- method public androidx.navigation.ActivityNavigator.Extras build();
- method public androidx.navigation.ActivityNavigator.Extras.Builder setActivityOptions(android.support.v4.app.ActivityOptionsCompat);
- }
-
- public class NavController {
- ctor public NavController(android.content.Context);
- method public void addOnDestinationChangedListener(androidx.navigation.NavController.OnDestinationChangedListener);
- method public androidx.navigation.NavDeepLinkBuilder createDeepLink();
- method public androidx.navigation.NavDestination? getCurrentDestination();
- method public androidx.navigation.NavGraph getGraph();
- method public androidx.navigation.NavInflater getNavInflater();
- method public androidx.navigation.NavigatorProvider getNavigatorProvider();
- method public boolean handleDeepLink(android.content.Intent?);
- method public void navigate(@IdRes int);
- method public void navigate(@IdRes int, android.os.Bundle?);
- method public void navigate(@IdRes int, android.os.Bundle?, androidx.navigation.NavOptions?);
- method public void navigate(@IdRes int, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public void navigate(androidx.navigation.NavDirections);
- method public void navigate(androidx.navigation.NavDirections, androidx.navigation.NavOptions?);
- method public void navigate(androidx.navigation.NavDirections, androidx.navigation.Navigator.Extras);
- method public boolean navigateUp();
- method public boolean popBackStack();
- method public boolean popBackStack(@IdRes int, boolean);
- method public void removeOnDestinationChangedListener(androidx.navigation.NavController.OnDestinationChangedListener);
- method @CallSuper public void restoreState(android.os.Bundle?);
- method @CallSuper public android.os.Bundle? saveState();
- method @CallSuper public void setGraph(@NavigationRes int);
- method @CallSuper public void setGraph(@NavigationRes int, android.os.Bundle?);
- method @CallSuper public void setGraph(androidx.navigation.NavGraph);
- method @CallSuper public void setGraph(androidx.navigation.NavGraph, android.os.Bundle?);
- field public static final String KEY_DEEP_LINK_INTENT = "android-support-nav:controller:deepLinkIntent";
- }
-
- public static interface NavController.OnDestinationChangedListener {
- method public void onDestinationChanged(androidx.navigation.NavController, androidx.navigation.NavDestination, android.os.Bundle?);
- }
-
- public final class NavDeepLinkBuilder {
- ctor public NavDeepLinkBuilder(android.content.Context);
- method public android.app.PendingIntent createPendingIntent();
- method public android.support.v4.app.TaskStackBuilder createTaskStackBuilder();
- method public androidx.navigation.NavDeepLinkBuilder setArguments(android.os.Bundle?);
- method public androidx.navigation.NavDeepLinkBuilder setComponentName(Class<? extends android.app.Activity>);
- method public androidx.navigation.NavDeepLinkBuilder setComponentName(android.content.ComponentName);
- method public androidx.navigation.NavDeepLinkBuilder setDestination(@IdRes int);
- method public androidx.navigation.NavDeepLinkBuilder setGraph(@NavigationRes int);
- method public androidx.navigation.NavDeepLinkBuilder setGraph(androidx.navigation.NavGraph);
- }
-
- public interface NavHost {
- method public androidx.navigation.NavController getNavController();
- }
-
- public final class NavInflater {
- ctor public NavInflater(android.content.Context, androidx.navigation.NavigatorProvider);
- method public androidx.navigation.NavGraph inflate(@NavigationRes int);
- }
-
- public final class Navigation {
- method public static android.view.View.OnClickListener createNavigateOnClickListener(@IdRes int);
- method public static android.view.View.OnClickListener createNavigateOnClickListener(@IdRes int, android.os.Bundle?);
- method public static androidx.navigation.NavController findNavController(android.app.Activity, @IdRes int);
- method public static androidx.navigation.NavController findNavController(android.view.View);
- method public static void setViewNavController(android.view.View, androidx.navigation.NavController?);
- }
-
-}
-
diff --git a/navigation/runtime/api/1.0.0-rc01.txt b/navigation/runtime/api/1.0.0-rc01.txt
deleted file mode 100644
index 0073e0d..0000000
--- a/navigation/runtime/api/1.0.0-rc01.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- @androidx.navigation.Navigator.Name("activity") public class ActivityNavigator extends androidx.navigation.Navigator<androidx.navigation.ActivityNavigator.Destination> {
- ctor public ActivityNavigator(android.content.Context);
- method public static void applyPopAnimationsToPendingTransition(android.app.Activity);
- method public androidx.navigation.ActivityNavigator.Destination createDestination();
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.ActivityNavigator.Destination, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- @androidx.navigation.NavDestination.ClassType(Activity.class) public static class ActivityNavigator.Destination extends androidx.navigation.NavDestination {
- ctor public ActivityNavigator.Destination(androidx.navigation.NavigatorProvider);
- ctor public ActivityNavigator.Destination(androidx.navigation.Navigator<? extends androidx.navigation.ActivityNavigator.Destination>);
- method public final String? getAction();
- method public final android.content.ComponentName? getComponent();
- method public final android.net.Uri? getData();
- method public final String? getDataPattern();
- method public final android.content.Intent? getIntent();
- method public final androidx.navigation.ActivityNavigator.Destination setAction(String?);
- method public final androidx.navigation.ActivityNavigator.Destination setComponentName(android.content.ComponentName?);
- method public final androidx.navigation.ActivityNavigator.Destination setData(android.net.Uri?);
- method public final androidx.navigation.ActivityNavigator.Destination setDataPattern(String?);
- method public final androidx.navigation.ActivityNavigator.Destination setIntent(android.content.Intent?);
- }
-
- public static final class ActivityNavigator.Extras implements androidx.navigation.Navigator.Extras {
- method public android.support.v4.app.ActivityOptionsCompat? getActivityOptions();
- method public int getFlags();
- }
-
- public static final class ActivityNavigator.Extras.Builder {
- ctor public ActivityNavigator.Extras.Builder();
- method public androidx.navigation.ActivityNavigator.Extras.Builder addFlags(int);
- method public androidx.navigation.ActivityNavigator.Extras build();
- method public androidx.navigation.ActivityNavigator.Extras.Builder setActivityOptions(android.support.v4.app.ActivityOptionsCompat);
- }
-
- public class NavController {
- ctor public NavController(android.content.Context);
- method public void addOnDestinationChangedListener(androidx.navigation.NavController.OnDestinationChangedListener);
- method public androidx.navigation.NavDeepLinkBuilder createDeepLink();
- method public androidx.navigation.NavDestination? getCurrentDestination();
- method public androidx.navigation.NavGraph getGraph();
- method public androidx.navigation.NavInflater getNavInflater();
- method public androidx.navigation.NavigatorProvider getNavigatorProvider();
- method public boolean handleDeepLink(android.content.Intent?);
- method public void navigate(@IdRes int);
- method public void navigate(@IdRes int, android.os.Bundle?);
- method public void navigate(@IdRes int, android.os.Bundle?, androidx.navigation.NavOptions?);
- method public void navigate(@IdRes int, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public void navigate(androidx.navigation.NavDirections);
- method public void navigate(androidx.navigation.NavDirections, androidx.navigation.NavOptions?);
- method public void navigate(androidx.navigation.NavDirections, androidx.navigation.Navigator.Extras);
- method public boolean navigateUp();
- method public boolean popBackStack();
- method public boolean popBackStack(@IdRes int, boolean);
- method public void removeOnDestinationChangedListener(androidx.navigation.NavController.OnDestinationChangedListener);
- method @CallSuper public void restoreState(android.os.Bundle?);
- method @CallSuper public android.os.Bundle? saveState();
- method @CallSuper public void setGraph(@NavigationRes int);
- method @CallSuper public void setGraph(@NavigationRes int, android.os.Bundle?);
- method @CallSuper public void setGraph(androidx.navigation.NavGraph);
- method @CallSuper public void setGraph(androidx.navigation.NavGraph, android.os.Bundle?);
- field public static final String KEY_DEEP_LINK_INTENT = "android-support-nav:controller:deepLinkIntent";
- }
-
- public static interface NavController.OnDestinationChangedListener {
- method public void onDestinationChanged(androidx.navigation.NavController, androidx.navigation.NavDestination, android.os.Bundle?);
- }
-
- public final class NavDeepLinkBuilder {
- ctor public NavDeepLinkBuilder(android.content.Context);
- method public android.app.PendingIntent createPendingIntent();
- method public android.support.v4.app.TaskStackBuilder createTaskStackBuilder();
- method public androidx.navigation.NavDeepLinkBuilder setArguments(android.os.Bundle?);
- method public androidx.navigation.NavDeepLinkBuilder setComponentName(Class<? extends android.app.Activity>);
- method public androidx.navigation.NavDeepLinkBuilder setComponentName(android.content.ComponentName);
- method public androidx.navigation.NavDeepLinkBuilder setDestination(@IdRes int);
- method public androidx.navigation.NavDeepLinkBuilder setGraph(@NavigationRes int);
- method public androidx.navigation.NavDeepLinkBuilder setGraph(androidx.navigation.NavGraph);
- }
-
- public interface NavHost {
- method public androidx.navigation.NavController getNavController();
- }
-
- public final class NavInflater {
- ctor public NavInflater(android.content.Context, androidx.navigation.NavigatorProvider);
- method public androidx.navigation.NavGraph inflate(@NavigationRes int);
- }
-
- public final class Navigation {
- method public static android.view.View.OnClickListener createNavigateOnClickListener(@IdRes int);
- method public static android.view.View.OnClickListener createNavigateOnClickListener(@IdRes int, android.os.Bundle?);
- method public static androidx.navigation.NavController findNavController(android.app.Activity, @IdRes int);
- method public static androidx.navigation.NavController findNavController(android.view.View);
- method public static void setViewNavController(android.view.View, androidx.navigation.NavController?);
- }
-
-}
-
diff --git a/navigation/runtime/api/1.0.0-rc02.txt b/navigation/runtime/api/1.0.0-rc02.txt
deleted file mode 100644
index 0073e0d..0000000
--- a/navigation/runtime/api/1.0.0-rc02.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- @androidx.navigation.Navigator.Name("activity") public class ActivityNavigator extends androidx.navigation.Navigator<androidx.navigation.ActivityNavigator.Destination> {
- ctor public ActivityNavigator(android.content.Context);
- method public static void applyPopAnimationsToPendingTransition(android.app.Activity);
- method public androidx.navigation.ActivityNavigator.Destination createDestination();
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.ActivityNavigator.Destination, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- @androidx.navigation.NavDestination.ClassType(Activity.class) public static class ActivityNavigator.Destination extends androidx.navigation.NavDestination {
- ctor public ActivityNavigator.Destination(androidx.navigation.NavigatorProvider);
- ctor public ActivityNavigator.Destination(androidx.navigation.Navigator<? extends androidx.navigation.ActivityNavigator.Destination>);
- method public final String? getAction();
- method public final android.content.ComponentName? getComponent();
- method public final android.net.Uri? getData();
- method public final String? getDataPattern();
- method public final android.content.Intent? getIntent();
- method public final androidx.navigation.ActivityNavigator.Destination setAction(String?);
- method public final androidx.navigation.ActivityNavigator.Destination setComponentName(android.content.ComponentName?);
- method public final androidx.navigation.ActivityNavigator.Destination setData(android.net.Uri?);
- method public final androidx.navigation.ActivityNavigator.Destination setDataPattern(String?);
- method public final androidx.navigation.ActivityNavigator.Destination setIntent(android.content.Intent?);
- }
-
- public static final class ActivityNavigator.Extras implements androidx.navigation.Navigator.Extras {
- method public android.support.v4.app.ActivityOptionsCompat? getActivityOptions();
- method public int getFlags();
- }
-
- public static final class ActivityNavigator.Extras.Builder {
- ctor public ActivityNavigator.Extras.Builder();
- method public androidx.navigation.ActivityNavigator.Extras.Builder addFlags(int);
- method public androidx.navigation.ActivityNavigator.Extras build();
- method public androidx.navigation.ActivityNavigator.Extras.Builder setActivityOptions(android.support.v4.app.ActivityOptionsCompat);
- }
-
- public class NavController {
- ctor public NavController(android.content.Context);
- method public void addOnDestinationChangedListener(androidx.navigation.NavController.OnDestinationChangedListener);
- method public androidx.navigation.NavDeepLinkBuilder createDeepLink();
- method public androidx.navigation.NavDestination? getCurrentDestination();
- method public androidx.navigation.NavGraph getGraph();
- method public androidx.navigation.NavInflater getNavInflater();
- method public androidx.navigation.NavigatorProvider getNavigatorProvider();
- method public boolean handleDeepLink(android.content.Intent?);
- method public void navigate(@IdRes int);
- method public void navigate(@IdRes int, android.os.Bundle?);
- method public void navigate(@IdRes int, android.os.Bundle?, androidx.navigation.NavOptions?);
- method public void navigate(@IdRes int, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public void navigate(androidx.navigation.NavDirections);
- method public void navigate(androidx.navigation.NavDirections, androidx.navigation.NavOptions?);
- method public void navigate(androidx.navigation.NavDirections, androidx.navigation.Navigator.Extras);
- method public boolean navigateUp();
- method public boolean popBackStack();
- method public boolean popBackStack(@IdRes int, boolean);
- method public void removeOnDestinationChangedListener(androidx.navigation.NavController.OnDestinationChangedListener);
- method @CallSuper public void restoreState(android.os.Bundle?);
- method @CallSuper public android.os.Bundle? saveState();
- method @CallSuper public void setGraph(@NavigationRes int);
- method @CallSuper public void setGraph(@NavigationRes int, android.os.Bundle?);
- method @CallSuper public void setGraph(androidx.navigation.NavGraph);
- method @CallSuper public void setGraph(androidx.navigation.NavGraph, android.os.Bundle?);
- field public static final String KEY_DEEP_LINK_INTENT = "android-support-nav:controller:deepLinkIntent";
- }
-
- public static interface NavController.OnDestinationChangedListener {
- method public void onDestinationChanged(androidx.navigation.NavController, androidx.navigation.NavDestination, android.os.Bundle?);
- }
-
- public final class NavDeepLinkBuilder {
- ctor public NavDeepLinkBuilder(android.content.Context);
- method public android.app.PendingIntent createPendingIntent();
- method public android.support.v4.app.TaskStackBuilder createTaskStackBuilder();
- method public androidx.navigation.NavDeepLinkBuilder setArguments(android.os.Bundle?);
- method public androidx.navigation.NavDeepLinkBuilder setComponentName(Class<? extends android.app.Activity>);
- method public androidx.navigation.NavDeepLinkBuilder setComponentName(android.content.ComponentName);
- method public androidx.navigation.NavDeepLinkBuilder setDestination(@IdRes int);
- method public androidx.navigation.NavDeepLinkBuilder setGraph(@NavigationRes int);
- method public androidx.navigation.NavDeepLinkBuilder setGraph(androidx.navigation.NavGraph);
- }
-
- public interface NavHost {
- method public androidx.navigation.NavController getNavController();
- }
-
- public final class NavInflater {
- ctor public NavInflater(android.content.Context, androidx.navigation.NavigatorProvider);
- method public androidx.navigation.NavGraph inflate(@NavigationRes int);
- }
-
- public final class Navigation {
- method public static android.view.View.OnClickListener createNavigateOnClickListener(@IdRes int);
- method public static android.view.View.OnClickListener createNavigateOnClickListener(@IdRes int, android.os.Bundle?);
- method public static androidx.navigation.NavController findNavController(android.app.Activity, @IdRes int);
- method public static androidx.navigation.NavController findNavController(android.view.View);
- method public static void setViewNavController(android.view.View, androidx.navigation.NavController?);
- }
-
-}
-
diff --git a/navigation/runtime/api/2.0.0-rc02.txt b/navigation/runtime/api/2.0.0-rc02.txt
deleted file mode 100644
index 32f2c7d..0000000
--- a/navigation/runtime/api/2.0.0-rc02.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- @androidx.navigation.Navigator.Name("activity") public class ActivityNavigator extends androidx.navigation.Navigator<androidx.navigation.ActivityNavigator.Destination> {
- ctor public ActivityNavigator(android.content.Context);
- method public static void applyPopAnimationsToPendingTransition(android.app.Activity);
- method public androidx.navigation.ActivityNavigator.Destination createDestination();
- method public androidx.navigation.NavDestination? navigate(androidx.navigation.ActivityNavigator.Destination, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public boolean popBackStack();
- }
-
- @androidx.navigation.NavDestination.ClassType(Activity.class) public static class ActivityNavigator.Destination extends androidx.navigation.NavDestination {
- ctor public ActivityNavigator.Destination(androidx.navigation.NavigatorProvider);
- ctor public ActivityNavigator.Destination(androidx.navigation.Navigator<? extends androidx.navigation.ActivityNavigator.Destination>);
- method public final String? getAction();
- method public final android.content.ComponentName? getComponent();
- method public final android.net.Uri? getData();
- method public final String? getDataPattern();
- method public final android.content.Intent? getIntent();
- method public final androidx.navigation.ActivityNavigator.Destination setAction(String?);
- method public final androidx.navigation.ActivityNavigator.Destination setComponentName(android.content.ComponentName?);
- method public final androidx.navigation.ActivityNavigator.Destination setData(android.net.Uri?);
- method public final androidx.navigation.ActivityNavigator.Destination setDataPattern(String?);
- method public final androidx.navigation.ActivityNavigator.Destination setIntent(android.content.Intent?);
- }
-
- public static final class ActivityNavigator.Extras implements androidx.navigation.Navigator.Extras {
- method public androidx.core.app.ActivityOptionsCompat? getActivityOptions();
- method public int getFlags();
- }
-
- public static final class ActivityNavigator.Extras.Builder {
- ctor public ActivityNavigator.Extras.Builder();
- method public androidx.navigation.ActivityNavigator.Extras.Builder addFlags(int);
- method public androidx.navigation.ActivityNavigator.Extras build();
- method public androidx.navigation.ActivityNavigator.Extras.Builder setActivityOptions(androidx.core.app.ActivityOptionsCompat);
- }
-
- public class NavController {
- ctor public NavController(android.content.Context);
- method public void addOnDestinationChangedListener(androidx.navigation.NavController.OnDestinationChangedListener);
- method public androidx.navigation.NavDeepLinkBuilder createDeepLink();
- method public androidx.navigation.NavDestination? getCurrentDestination();
- method public androidx.navigation.NavGraph getGraph();
- method public androidx.navigation.NavInflater getNavInflater();
- method public androidx.navigation.NavigatorProvider getNavigatorProvider();
- method public boolean handleDeepLink(android.content.Intent?);
- method public void navigate(@IdRes int);
- method public void navigate(@IdRes int, android.os.Bundle?);
- method public void navigate(@IdRes int, android.os.Bundle?, androidx.navigation.NavOptions?);
- method public void navigate(@IdRes int, android.os.Bundle?, androidx.navigation.NavOptions?, androidx.navigation.Navigator.Extras?);
- method public void navigate(androidx.navigation.NavDirections);
- method public void navigate(androidx.navigation.NavDirections, androidx.navigation.NavOptions?);
- method public void navigate(androidx.navigation.NavDirections, androidx.navigation.Navigator.Extras);
- method public boolean navigateUp();
- method public boolean popBackStack();
- method public boolean popBackStack(@IdRes int, boolean);
- method public void removeOnDestinationChangedListener(androidx.navigation.NavController.OnDestinationChangedListener);
- method @CallSuper public void restoreState(android.os.Bundle?);
- method @CallSuper public android.os.Bundle? saveState();
- method @CallSuper public void setGraph(@NavigationRes int);
- method @CallSuper public void setGraph(@NavigationRes int, android.os.Bundle?);
- method @CallSuper public void setGraph(androidx.navigation.NavGraph);
- method @CallSuper public void setGraph(androidx.navigation.NavGraph, android.os.Bundle?);
- field public static final String KEY_DEEP_LINK_INTENT = "android-support-nav:controller:deepLinkIntent";
- }
-
- public static interface NavController.OnDestinationChangedListener {
- method public void onDestinationChanged(androidx.navigation.NavController, androidx.navigation.NavDestination, android.os.Bundle?);
- }
-
- public final class NavDeepLinkBuilder {
- ctor public NavDeepLinkBuilder(android.content.Context);
- method public android.app.PendingIntent createPendingIntent();
- method public androidx.core.app.TaskStackBuilder createTaskStackBuilder();
- method public androidx.navigation.NavDeepLinkBuilder setArguments(android.os.Bundle?);
- method public androidx.navigation.NavDeepLinkBuilder setComponentName(Class<? extends android.app.Activity>);
- method public androidx.navigation.NavDeepLinkBuilder setComponentName(android.content.ComponentName);
- method public androidx.navigation.NavDeepLinkBuilder setDestination(@IdRes int);
- method public androidx.navigation.NavDeepLinkBuilder setGraph(@NavigationRes int);
- method public androidx.navigation.NavDeepLinkBuilder setGraph(androidx.navigation.NavGraph);
- }
-
- public interface NavHost {
- method public androidx.navigation.NavController getNavController();
- }
-
- public final class NavInflater {
- ctor public NavInflater(android.content.Context, androidx.navigation.NavigatorProvider);
- method public androidx.navigation.NavGraph inflate(@NavigationRes int);
- }
-
- public final class Navigation {
- method public static android.view.View.OnClickListener createNavigateOnClickListener(@IdRes int);
- method public static android.view.View.OnClickListener createNavigateOnClickListener(@IdRes int, android.os.Bundle?);
- method public static androidx.navigation.NavController findNavController(android.app.Activity, @IdRes int);
- method public static androidx.navigation.NavController findNavController(android.view.View);
- method public static void setViewNavController(android.view.View, androidx.navigation.NavController?);
- }
-
-}
-
diff --git a/navigation/runtime/api/current.txt b/navigation/runtime/api/current.txt
index 32f2c7d..84c6a22 100644
--- a/navigation/runtime/api/current.txt
+++ b/navigation/runtime/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
@androidx.navigation.Navigator.Name("activity") public class ActivityNavigator extends androidx.navigation.Navigator<androidx.navigation.ActivityNavigator.Destination> {
@@ -25,7 +25,7 @@
}
public static final class ActivityNavigator.Extras implements androidx.navigation.Navigator.Extras {
- method public androidx.core.app.ActivityOptionsCompat? getActivityOptions();
+ method public android.support.v4.app.ActivityOptionsCompat? getActivityOptions();
method public int getFlags();
}
@@ -33,7 +33,7 @@
ctor public ActivityNavigator.Extras.Builder();
method public androidx.navigation.ActivityNavigator.Extras.Builder addFlags(int);
method public androidx.navigation.ActivityNavigator.Extras build();
- method public androidx.navigation.ActivityNavigator.Extras.Builder setActivityOptions(androidx.core.app.ActivityOptionsCompat);
+ method public androidx.navigation.ActivityNavigator.Extras.Builder setActivityOptions(android.support.v4.app.ActivityOptionsCompat);
}
public class NavController {
@@ -72,7 +72,7 @@
public final class NavDeepLinkBuilder {
ctor public NavDeepLinkBuilder(android.content.Context);
method public android.app.PendingIntent createPendingIntent();
- method public androidx.core.app.TaskStackBuilder createTaskStackBuilder();
+ method public android.support.v4.app.TaskStackBuilder createTaskStackBuilder();
method public androidx.navigation.NavDeepLinkBuilder setArguments(android.os.Bundle?);
method public androidx.navigation.NavDeepLinkBuilder setComponentName(Class<? extends android.app.Activity>);
method public androidx.navigation.NavDeepLinkBuilder setComponentName(android.content.ComponentName);
diff --git a/navigation/runtime/api/res-1.0.0-beta01.txt b/navigation/runtime/api/res-1.0.0-beta01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/runtime/api/res-1.0.0-beta01.txt
+++ /dev/null
diff --git a/navigation/runtime/api/res-1.0.0-beta02.txt b/navigation/runtime/api/res-1.0.0-beta02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/runtime/api/res-1.0.0-beta02.txt
+++ /dev/null
diff --git a/navigation/runtime/api/res-1.0.0-rc01.txt b/navigation/runtime/api/res-1.0.0-rc01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/runtime/api/res-1.0.0-rc01.txt
+++ /dev/null
diff --git a/navigation/runtime/api/res-1.0.0-rc02.txt b/navigation/runtime/api/res-1.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/runtime/api/res-1.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/runtime/api/res-2.0.0-rc02.txt b/navigation/runtime/api/res-2.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/runtime/api/res-2.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/runtime/api/restricted_1.0.0-beta01.txt b/navigation/runtime/api/restricted_1.0.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/runtime/api/restricted_1.0.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/runtime/api/restricted_1.0.0-beta02.txt b/navigation/runtime/api/restricted_1.0.0-beta02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/runtime/api/restricted_1.0.0-beta02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/runtime/api/restricted_1.0.0-rc01.txt b/navigation/runtime/api/restricted_1.0.0-rc01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/runtime/api/restricted_1.0.0-rc01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/runtime/api/restricted_1.0.0-rc02.txt b/navigation/runtime/api/restricted_1.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/runtime/api/restricted_1.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/runtime/api/restricted_2.0.0-rc02.txt b/navigation/runtime/api/restricted_2.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/runtime/api/restricted_2.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/runtime/api/restricted_current.txt b/navigation/runtime/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/runtime/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/runtime/ktx/api/1.0.0-alpha08.txt b/navigation/runtime/ktx/api/1.0.0-alpha08.txt
index 2c46cef..1601006 100644
--- a/navigation/runtime/ktx/api/1.0.0-alpha08.txt
+++ b/navigation/runtime/ktx/api/1.0.0-alpha08.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
public final class ActivityKt {
diff --git a/navigation/runtime/ktx/api/1.0.0-alpha09.txt b/navigation/runtime/ktx/api/1.0.0-alpha09.txt
index 2c46cef..1601006 100644
--- a/navigation/runtime/ktx/api/1.0.0-alpha09.txt
+++ b/navigation/runtime/ktx/api/1.0.0-alpha09.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
public final class ActivityKt {
diff --git a/navigation/runtime/ktx/api/1.0.0-alpha10.txt b/navigation/runtime/ktx/api/1.0.0-alpha10.txt
index d099848..6f68765 100644
--- a/navigation/runtime/ktx/api/1.0.0-alpha10.txt
+++ b/navigation/runtime/ktx/api/1.0.0-alpha10.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
public final class ActivityKt {
diff --git a/navigation/runtime/ktx/api/1.0.0-alpha11.txt b/navigation/runtime/ktx/api/1.0.0-alpha11.txt
index d1e3b0e..6f68765 100644
--- a/navigation/runtime/ktx/api/1.0.0-alpha11.txt
+++ b/navigation/runtime/ktx/api/1.0.0-alpha11.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
public final class ActivityKt {
@@ -8,7 +8,6 @@
public final class ActivityNavArgsLazyKt {
ctor public ActivityNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
}
public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
@@ -30,7 +29,7 @@
public final class ActivityNavigatorDestinationBuilderKt {
ctor public ActivityNavigatorDestinationBuilderKt();
- method public static inline void activity(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.ActivityNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static void activity(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.ActivityNavigatorDestinationBuilder,kotlin.Unit> builder);
}
public final class ActivityNavigatorExtrasKt {
@@ -40,12 +39,12 @@
public final class NavControllerKt {
ctor public NavControllerKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavController, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
+ method public static androidx.navigation.NavGraph createGraph(androidx.navigation.NavController, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
}
public final class NavHostKt {
ctor public NavHostKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavHost, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
+ method public static androidx.navigation.NavGraph createGraph(androidx.navigation.NavHost, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
}
public final class ViewKt {
diff --git a/navigation/runtime/ktx/api/1.0.0-beta01.txt b/navigation/runtime/ktx/api/1.0.0-beta01.txt
deleted file mode 100644
index d1e3b0e..0000000
--- a/navigation/runtime/ktx/api/1.0.0-beta01.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public final class ActivityKt {
- ctor public ActivityKt();
- method public static androidx.navigation.NavController findNavController(android.app.Activity, @IdRes int viewId);
- }
-
- public final class ActivityNavArgsLazyKt {
- ctor public ActivityNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
- }
-
- public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
- ctor public ActivityNavigatorDestinationBuilder(androidx.navigation.ActivityNavigator navigator, @IdRes int id);
- method public androidx.navigation.ActivityNavigator.Destination build();
- method public String? getAction();
- method public kotlin.reflect.KClass<? extends android.app.Activity>? getActivityClass();
- method public android.net.Uri? getData();
- method public String? getDataPattern();
- method public void setAction(String? p);
- method public void setActivityClass(kotlin.reflect.KClass<? extends android.app.Activity>? p);
- method public void setData(android.net.Uri? p);
- method public void setDataPattern(String? p);
- property public final String? action;
- property public final kotlin.reflect.KClass<? extends android.app.Activity>? activityClass;
- property public final android.net.Uri? data;
- property public final String? dataPattern;
- }
-
- public final class ActivityNavigatorDestinationBuilderKt {
- ctor public ActivityNavigatorDestinationBuilderKt();
- method public static inline void activity(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.ActivityNavigatorDestinationBuilder,kotlin.Unit> builder);
- }
-
- public final class ActivityNavigatorExtrasKt {
- ctor public ActivityNavigatorExtrasKt();
- method public static androidx.navigation.ActivityNavigator.Extras ActivityNavigatorExtras(android.support.v4.app.ActivityOptionsCompat? activityOptions = null, int flags = 0);
- }
-
- public final class NavControllerKt {
- ctor public NavControllerKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavController, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class NavHostKt {
- ctor public NavHostKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavHost, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class ViewKt {
- ctor public ViewKt();
- method public static androidx.navigation.NavController findNavController(android.view.View);
- }
-
-}
-
diff --git a/navigation/runtime/ktx/api/1.0.0-beta02.txt b/navigation/runtime/ktx/api/1.0.0-beta02.txt
deleted file mode 100644
index d1e3b0e..0000000
--- a/navigation/runtime/ktx/api/1.0.0-beta02.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public final class ActivityKt {
- ctor public ActivityKt();
- method public static androidx.navigation.NavController findNavController(android.app.Activity, @IdRes int viewId);
- }
-
- public final class ActivityNavArgsLazyKt {
- ctor public ActivityNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
- }
-
- public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
- ctor public ActivityNavigatorDestinationBuilder(androidx.navigation.ActivityNavigator navigator, @IdRes int id);
- method public androidx.navigation.ActivityNavigator.Destination build();
- method public String? getAction();
- method public kotlin.reflect.KClass<? extends android.app.Activity>? getActivityClass();
- method public android.net.Uri? getData();
- method public String? getDataPattern();
- method public void setAction(String? p);
- method public void setActivityClass(kotlin.reflect.KClass<? extends android.app.Activity>? p);
- method public void setData(android.net.Uri? p);
- method public void setDataPattern(String? p);
- property public final String? action;
- property public final kotlin.reflect.KClass<? extends android.app.Activity>? activityClass;
- property public final android.net.Uri? data;
- property public final String? dataPattern;
- }
-
- public final class ActivityNavigatorDestinationBuilderKt {
- ctor public ActivityNavigatorDestinationBuilderKt();
- method public static inline void activity(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.ActivityNavigatorDestinationBuilder,kotlin.Unit> builder);
- }
-
- public final class ActivityNavigatorExtrasKt {
- ctor public ActivityNavigatorExtrasKt();
- method public static androidx.navigation.ActivityNavigator.Extras ActivityNavigatorExtras(android.support.v4.app.ActivityOptionsCompat? activityOptions = null, int flags = 0);
- }
-
- public final class NavControllerKt {
- ctor public NavControllerKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavController, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class NavHostKt {
- ctor public NavHostKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavHost, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class ViewKt {
- ctor public ViewKt();
- method public static androidx.navigation.NavController findNavController(android.view.View);
- }
-
-}
-
diff --git a/navigation/runtime/ktx/api/1.0.0-rc01.txt b/navigation/runtime/ktx/api/1.0.0-rc01.txt
deleted file mode 100644
index d1e3b0e..0000000
--- a/navigation/runtime/ktx/api/1.0.0-rc01.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public final class ActivityKt {
- ctor public ActivityKt();
- method public static androidx.navigation.NavController findNavController(android.app.Activity, @IdRes int viewId);
- }
-
- public final class ActivityNavArgsLazyKt {
- ctor public ActivityNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
- }
-
- public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
- ctor public ActivityNavigatorDestinationBuilder(androidx.navigation.ActivityNavigator navigator, @IdRes int id);
- method public androidx.navigation.ActivityNavigator.Destination build();
- method public String? getAction();
- method public kotlin.reflect.KClass<? extends android.app.Activity>? getActivityClass();
- method public android.net.Uri? getData();
- method public String? getDataPattern();
- method public void setAction(String? p);
- method public void setActivityClass(kotlin.reflect.KClass<? extends android.app.Activity>? p);
- method public void setData(android.net.Uri? p);
- method public void setDataPattern(String? p);
- property public final String? action;
- property public final kotlin.reflect.KClass<? extends android.app.Activity>? activityClass;
- property public final android.net.Uri? data;
- property public final String? dataPattern;
- }
-
- public final class ActivityNavigatorDestinationBuilderKt {
- ctor public ActivityNavigatorDestinationBuilderKt();
- method public static inline void activity(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.ActivityNavigatorDestinationBuilder,kotlin.Unit> builder);
- }
-
- public final class ActivityNavigatorExtrasKt {
- ctor public ActivityNavigatorExtrasKt();
- method public static androidx.navigation.ActivityNavigator.Extras ActivityNavigatorExtras(android.support.v4.app.ActivityOptionsCompat? activityOptions = null, int flags = 0);
- }
-
- public final class NavControllerKt {
- ctor public NavControllerKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavController, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class NavHostKt {
- ctor public NavHostKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavHost, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class ViewKt {
- ctor public ViewKt();
- method public static androidx.navigation.NavController findNavController(android.view.View);
- }
-
-}
-
diff --git a/navigation/runtime/ktx/api/1.0.0-rc02.txt b/navigation/runtime/ktx/api/1.0.0-rc02.txt
deleted file mode 100644
index d1e3b0e..0000000
--- a/navigation/runtime/ktx/api/1.0.0-rc02.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public final class ActivityKt {
- ctor public ActivityKt();
- method public static androidx.navigation.NavController findNavController(android.app.Activity, @IdRes int viewId);
- }
-
- public final class ActivityNavArgsLazyKt {
- ctor public ActivityNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
- }
-
- public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
- ctor public ActivityNavigatorDestinationBuilder(androidx.navigation.ActivityNavigator navigator, @IdRes int id);
- method public androidx.navigation.ActivityNavigator.Destination build();
- method public String? getAction();
- method public kotlin.reflect.KClass<? extends android.app.Activity>? getActivityClass();
- method public android.net.Uri? getData();
- method public String? getDataPattern();
- method public void setAction(String? p);
- method public void setActivityClass(kotlin.reflect.KClass<? extends android.app.Activity>? p);
- method public void setData(android.net.Uri? p);
- method public void setDataPattern(String? p);
- property public final String? action;
- property public final kotlin.reflect.KClass<? extends android.app.Activity>? activityClass;
- property public final android.net.Uri? data;
- property public final String? dataPattern;
- }
-
- public final class ActivityNavigatorDestinationBuilderKt {
- ctor public ActivityNavigatorDestinationBuilderKt();
- method public static inline void activity(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.ActivityNavigatorDestinationBuilder,kotlin.Unit> builder);
- }
-
- public final class ActivityNavigatorExtrasKt {
- ctor public ActivityNavigatorExtrasKt();
- method public static androidx.navigation.ActivityNavigator.Extras ActivityNavigatorExtras(android.support.v4.app.ActivityOptionsCompat? activityOptions = null, int flags = 0);
- }
-
- public final class NavControllerKt {
- ctor public NavControllerKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavController, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class NavHostKt {
- ctor public NavHostKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavHost, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class ViewKt {
- ctor public ViewKt();
- method public static androidx.navigation.NavController findNavController(android.view.View);
- }
-
-}
-
diff --git a/navigation/runtime/ktx/api/2.0.0-rc02.txt b/navigation/runtime/ktx/api/2.0.0-rc02.txt
deleted file mode 100644
index 2967c7a..0000000
--- a/navigation/runtime/ktx/api/2.0.0-rc02.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation {
-
- public final class ActivityKt {
- ctor public ActivityKt();
- method public static androidx.navigation.NavController findNavController(android.app.Activity, @IdRes int viewId);
- }
-
- public final class ActivityNavArgsLazyKt {
- ctor public ActivityNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
- }
-
- public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
- ctor public ActivityNavigatorDestinationBuilder(androidx.navigation.ActivityNavigator navigator, @IdRes int id);
- method public androidx.navigation.ActivityNavigator.Destination build();
- method public String? getAction();
- method public kotlin.reflect.KClass<? extends android.app.Activity>? getActivityClass();
- method public android.net.Uri? getData();
- method public String? getDataPattern();
- method public void setAction(String? p);
- method public void setActivityClass(kotlin.reflect.KClass<? extends android.app.Activity>? p);
- method public void setData(android.net.Uri? p);
- method public void setDataPattern(String? p);
- property public final String? action;
- property public final kotlin.reflect.KClass<? extends android.app.Activity>? activityClass;
- property public final android.net.Uri? data;
- property public final String? dataPattern;
- }
-
- public final class ActivityNavigatorDestinationBuilderKt {
- ctor public ActivityNavigatorDestinationBuilderKt();
- method public static inline void activity(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.ActivityNavigatorDestinationBuilder,kotlin.Unit> builder);
- }
-
- public final class ActivityNavigatorExtrasKt {
- ctor public ActivityNavigatorExtrasKt();
- method public static androidx.navigation.ActivityNavigator.Extras ActivityNavigatorExtras(androidx.core.app.ActivityOptionsCompat? activityOptions = null, int flags = 0);
- }
-
- public final class NavControllerKt {
- ctor public NavControllerKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavController, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class NavHostKt {
- ctor public NavHostKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavHost, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
- }
-
- public final class ViewKt {
- ctor public ViewKt();
- method public static androidx.navigation.NavController findNavController(android.view.View);
- }
-
-}
-
diff --git a/navigation/runtime/ktx/api/current.txt b/navigation/runtime/ktx/api/current.txt
index 2967c7a..6f68765 100644
--- a/navigation/runtime/ktx/api/current.txt
+++ b/navigation/runtime/ktx/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation {
public final class ActivityKt {
@@ -8,7 +8,6 @@
public final class ActivityNavArgsLazyKt {
ctor public ActivityNavArgsLazyKt();
- method @MainThread public static inline <reified Args extends androidx.navigation.NavArgs> androidx.navigation.NavArgsLazy<Args>! navArgs(android.app.Activity);
}
public final class ActivityNavigatorDestinationBuilder extends androidx.navigation.NavDestinationBuilder<androidx.navigation.ActivityNavigator.Destination> {
@@ -30,22 +29,22 @@
public final class ActivityNavigatorDestinationBuilderKt {
ctor public ActivityNavigatorDestinationBuilderKt();
- method public static inline void activity(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.ActivityNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static void activity(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.ActivityNavigatorDestinationBuilder,kotlin.Unit> builder);
}
public final class ActivityNavigatorExtrasKt {
ctor public ActivityNavigatorExtrasKt();
- method public static androidx.navigation.ActivityNavigator.Extras ActivityNavigatorExtras(androidx.core.app.ActivityOptionsCompat? activityOptions = null, int flags = 0);
+ method public static androidx.navigation.ActivityNavigator.Extras ActivityNavigatorExtras(android.support.v4.app.ActivityOptionsCompat? activityOptions = null, int flags = 0);
}
public final class NavControllerKt {
ctor public NavControllerKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavController, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
+ method public static androidx.navigation.NavGraph createGraph(androidx.navigation.NavController, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
}
public final class NavHostKt {
ctor public NavHostKt();
- method public static inline androidx.navigation.NavGraph createGraph(androidx.navigation.NavHost, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
+ method public static androidx.navigation.NavGraph createGraph(androidx.navigation.NavHost, @IdRes int id = 0, @IdRes int startDestination, kotlin.jvm.functions.Function1<? super androidx.navigation.NavGraphBuilder,kotlin.Unit> builder);
}
public final class ViewKt {
diff --git a/navigation/runtime/ktx/api/res-1.0.0-beta01.txt b/navigation/runtime/ktx/api/res-1.0.0-beta01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/runtime/ktx/api/res-1.0.0-beta01.txt
+++ /dev/null
diff --git a/navigation/runtime/ktx/api/res-1.0.0-beta02.txt b/navigation/runtime/ktx/api/res-1.0.0-beta02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/runtime/ktx/api/res-1.0.0-beta02.txt
+++ /dev/null
diff --git a/navigation/runtime/ktx/api/res-1.0.0-rc01.txt b/navigation/runtime/ktx/api/res-1.0.0-rc01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/runtime/ktx/api/res-1.0.0-rc01.txt
+++ /dev/null
diff --git a/navigation/runtime/ktx/api/res-1.0.0-rc02.txt b/navigation/runtime/ktx/api/res-1.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/runtime/ktx/api/res-1.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/runtime/ktx/api/res-2.0.0-rc02.txt b/navigation/runtime/ktx/api/res-2.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/runtime/ktx/api/res-2.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/runtime/ktx/api/restricted_1.0.0-beta01.txt b/navigation/runtime/ktx/api/restricted_1.0.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/runtime/ktx/api/restricted_1.0.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/runtime/ktx/api/restricted_1.0.0-beta02.txt b/navigation/runtime/ktx/api/restricted_1.0.0-beta02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/runtime/ktx/api/restricted_1.0.0-beta02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/runtime/ktx/api/restricted_1.0.0-rc01.txt b/navigation/runtime/ktx/api/restricted_1.0.0-rc01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/runtime/ktx/api/restricted_1.0.0-rc01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/runtime/ktx/api/restricted_1.0.0-rc02.txt b/navigation/runtime/ktx/api/restricted_1.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/runtime/ktx/api/restricted_1.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/runtime/ktx/api/restricted_2.0.0-rc02.txt b/navigation/runtime/ktx/api/restricted_2.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/runtime/ktx/api/restricted_2.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/runtime/ktx/api/restricted_current.txt b/navigation/runtime/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/runtime/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/runtime/ktx/src/androidTest/java/androidx/navigation/ActivityNavigatorExtrasTest.kt b/navigation/runtime/ktx/src/androidTest/java/androidx/navigation/ActivityNavigatorExtrasTest.kt
index 58be9c7..7a54d8e 100644
--- a/navigation/runtime/ktx/src/androidTest/java/androidx/navigation/ActivityNavigatorExtrasTest.kt
+++ b/navigation/runtime/ktx/src/androidTest/java/androidx/navigation/ActivityNavigatorExtrasTest.kt
@@ -17,7 +17,7 @@
package androidx.navigation
import android.content.Intent
-import androidx.core.app.ActivityOptionsCompat
+import android.support.v4.app.ActivityOptionsCompat
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
diff --git a/navigation/runtime/ktx/src/androidTest/java/androidx/navigation/ActivityTest.kt b/navigation/runtime/ktx/src/androidTest/java/androidx/navigation/ActivityTest.kt
index deb132e..3516e55 100644
--- a/navigation/runtime/ktx/src/androidTest/java/androidx/navigation/ActivityTest.kt
+++ b/navigation/runtime/ktx/src/androidTest/java/androidx/navigation/ActivityTest.kt
@@ -20,7 +20,7 @@
import android.content.Intent
import android.os.Bundle
import android.view.View
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import androidx.test.rule.ActivityTestRule
import com.google.common.truth.Truth.assertThat
import org.junit.Assert.assertTrue
@@ -28,7 +28,7 @@
import org.junit.Rule
import org.junit.Test
-@LargeTest
+@SmallTest
class ActivityTest {
@get:Rule val activityRule = ActivityTestRule<TestActivity>(TestActivity::class.java)
private val view get() = activityRule.activity.findViewById<View>(VIEW_ID)
diff --git a/navigation/runtime/ktx/src/main/java/androidx/navigation/Activity.kt b/navigation/runtime/ktx/src/main/java/androidx/navigation/Activity.kt
index a646663..e2b5ffe 100644
--- a/navigation/runtime/ktx/src/main/java/androidx/navigation/Activity.kt
+++ b/navigation/runtime/ktx/src/main/java/androidx/navigation/Activity.kt
@@ -17,7 +17,7 @@
package androidx.navigation
import android.app.Activity
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
/**
* Find a [NavController] given the id of a View and its containing
diff --git a/navigation/runtime/ktx/src/main/java/androidx/navigation/ActivityNavArgsLazy.kt b/navigation/runtime/ktx/src/main/java/androidx/navigation/ActivityNavArgsLazy.kt
index 9808668..8c83bab 100644
--- a/navigation/runtime/ktx/src/main/java/androidx/navigation/ActivityNavArgsLazy.kt
+++ b/navigation/runtime/ktx/src/main/java/androidx/navigation/ActivityNavArgsLazy.kt
@@ -17,7 +17,7 @@
package androidx.navigation
import android.app.Activity
-import androidx.annotation.MainThread
+import android.support.annotation.MainThread
/**
* Returns a [Lazy] delegate to access the Activity's extras as an [Args] instance.
diff --git a/navigation/runtime/ktx/src/main/java/androidx/navigation/ActivityNavigatorDestinationBuilder.kt b/navigation/runtime/ktx/src/main/java/androidx/navigation/ActivityNavigatorDestinationBuilder.kt
index bbc7f4c..c4e8529 100644
--- a/navigation/runtime/ktx/src/main/java/androidx/navigation/ActivityNavigatorDestinationBuilder.kt
+++ b/navigation/runtime/ktx/src/main/java/androidx/navigation/ActivityNavigatorDestinationBuilder.kt
@@ -21,7 +21,7 @@
import android.app.Activity
import android.content.ComponentName
import android.net.Uri
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
import kotlin.reflect.KClass
/**
diff --git a/navigation/runtime/ktx/src/main/java/androidx/navigation/ActivityNavigatorExtras.kt b/navigation/runtime/ktx/src/main/java/androidx/navigation/ActivityNavigatorExtras.kt
index 9bee919..fb35f0f 100644
--- a/navigation/runtime/ktx/src/main/java/androidx/navigation/ActivityNavigatorExtras.kt
+++ b/navigation/runtime/ktx/src/main/java/androidx/navigation/ActivityNavigatorExtras.kt
@@ -16,7 +16,7 @@
package androidx.navigation
-import androidx.core.app.ActivityOptionsCompat
+import android.support.v4.app.ActivityOptionsCompat
/**
* Create a new [ActivityNavigator.Extras] instance with a specific [ActivityOptionsCompat]
diff --git a/navigation/runtime/ktx/src/main/java/androidx/navigation/NavController.kt b/navigation/runtime/ktx/src/main/java/androidx/navigation/NavController.kt
index b3e1120..c2dbb54 100644
--- a/navigation/runtime/ktx/src/main/java/androidx/navigation/NavController.kt
+++ b/navigation/runtime/ktx/src/main/java/androidx/navigation/NavController.kt
@@ -16,7 +16,7 @@
package androidx.navigation
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
/**
* Construct a new [NavGraph]
diff --git a/navigation/runtime/ktx/src/main/java/androidx/navigation/NavHost.kt b/navigation/runtime/ktx/src/main/java/androidx/navigation/NavHost.kt
index c8ee041..bc709ff 100644
--- a/navigation/runtime/ktx/src/main/java/androidx/navigation/NavHost.kt
+++ b/navigation/runtime/ktx/src/main/java/androidx/navigation/NavHost.kt
@@ -16,7 +16,7 @@
package androidx.navigation
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
/**
* Construct a new [NavGraph]
diff --git a/navigation/runtime/src/androidTest/AndroidManifest.xml b/navigation/runtime/src/androidTest/AndroidManifest.xml
index 04affeb..bc0d9fb 100644
--- a/navigation/runtime/src/androidTest/AndroidManifest.xml
+++ b/navigation/runtime/src/androidTest/AndroidManifest.xml
@@ -22,6 +22,5 @@
<application>
<activity android:name="androidx.navigation.ActivityNavigatorActivity"/>
<activity android:name="androidx.navigation.TargetActivity"/>
- <activity android:name="androidx.navigation.NavControllerActivity"/>
</application>
</manifest>
diff --git a/navigation/runtime/src/androidTest/java/androidx/navigation/ActivityNavigatorTest.kt b/navigation/runtime/src/androidTest/java/androidx/navigation/ActivityNavigatorTest.kt
index f7029aa..c3a161e 100644
--- a/navigation/runtime/src/androidTest/java/androidx/navigation/ActivityNavigatorTest.kt
+++ b/navigation/runtime/src/androidTest/java/androidx/navigation/ActivityNavigatorTest.kt
@@ -23,11 +23,11 @@
import android.net.Uri
import android.os.Build
import android.os.Bundle
+import android.support.v4.app.ActivityOptionsCompat
import android.view.View
-import androidx.core.app.ActivityOptionsCompat
import androidx.test.annotation.UiThreadTest
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.MediumTest
import androidx.test.filters.SdkSuppress
import androidx.test.rule.ActivityTestRule
import org.junit.After
@@ -48,7 +48,7 @@
import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4::class)
class ActivityNavigatorTest {
companion object {
diff --git a/navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerActivityTest.kt b/navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerActivityTest.kt
deleted file mode 100644
index 97c98362..0000000
--- a/navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerActivityTest.kt
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2019 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.navigation
-
-import android.app.Activity
-import android.content.Intent
-import android.net.Uri
-import androidx.navigation.test.R
-import androidx.navigation.testing.TestNavigator
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
-import androidx.test.rule.ActivityTestRule
-import com.google.common.truth.Truth.assertThat
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.Mockito.spy
-
-@LargeTest
-@RunWith(AndroidJUnit4::class)
-class NavControllerActivityTest {
-
- @get:Rule
- val activityRule = ActivityTestRule(NavControllerActivity::class.java)
-
- private lateinit var navController: NavController
- private lateinit var navigator: TestNavigator
-
- @Before
- fun setup() {
- navController = NavController(activityRule.activity)
- navigator = TestNavigator()
- navController.navigatorProvider.addNavigator(navigator)
- TargetActivity.instances = spy(ArrayList())
- }
-
- @Test
- fun testNavigateUpPop() {
- navController.setGraph(R.navigation.nav_simple)
- navController.navigate(R.id.second_test)
- assertThat(navController.currentDestination?.id)
- .isEqualTo(R.id.second_test)
- assertThat(navigator.backStack.size)
- .isEqualTo(2)
-
- assertThat(navController.navigateUp())
- .isTrue()
- assertThat(navController.currentDestination?.id)
- .isEqualTo(R.id.start_test)
- assertThat(navigator.backStack.size)
- .isEqualTo(1)
- }
-
- @Test
- fun testNavigateUp() {
- val activity = activityRule.activity
- navController.setGraph(R.navigation.nav_simple)
- navController.handleDeepLink(Intent().apply {
- data = Uri.parse("android-app://androidx.navigation.test/test")
- })
- assertThat(navController.currentDestination?.id)
- .isEqualTo(R.id.second_test)
- assertThat(navigator.backStack.size)
- .isEqualTo(1)
-
- assertThat(activity.isFinishCalled)
- .isFalse()
- assertThat(navController.navigateUp())
- .isTrue()
- assertThat(activity.isFinishCalled)
- .isTrue()
- }
-}
-
-class NavControllerActivity : Activity() {
- var isFinishCalled = false
-
- override fun finish() {
- super.finish()
- isFinishCalled = true
- }
-}
diff --git a/navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt b/navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
index 59c6db9..d8ad40e 100644
--- a/navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
+++ b/navigation/runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
@@ -19,13 +19,12 @@
import android.content.Context
import android.os.Bundle
import android.os.Parcel
-import android.os.Parcelable
import androidx.navigation.test.R
import androidx.navigation.testing.TestNavigator
import androidx.navigation.testing.test
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.MediumTest
+import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
import org.junit.Assert.assertEquals
@@ -42,7 +41,7 @@
import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4::class)
class NavControllerTest {
@@ -209,7 +208,7 @@
val navigator = TestNavigator()
navController.navigatorProvider.addNavigator(navigator)
val graph = NavInflater(context, navController.navigatorProvider)
- .inflate(R.navigation.nav_simple)
+ .inflate(R.navigation.nav_simple)
navController.graph = graph
navController.navigate(R.id.second_test)
@@ -228,66 +227,6 @@
}
@Test
- fun testSaveRestoreStateBundleParceled() {
- val context = ApplicationProvider.getApplicationContext() as Context
- var navController = NavController(context)
- val navigator = SaveStateTestNavigator()
- navController.navigatorProvider.addNavigator(navigator)
- navController.setGraph(R.navigation.nav_simple)
-
- navigator.customParcel = CustomTestParcelable(TEST_ARG_VALUE)
-
- val savedState = navController.saveState()
-
- val parcel = Parcel.obtain()
- savedState?.writeToParcel(parcel, 0)
- parcel.setDataPosition(0)
-
- val restoredState = Bundle.CREATOR.createFromParcel(parcel)
-
- navController = NavController(context)
- navController.navigatorProvider.addNavigator(navigator)
-
- navController.restoreState(restoredState)
- navController.setGraph(R.navigation.nav_simple)
-
- // Ensure custom parcelable is present and can be read
- assertThat(navigator.customParcel?.name).isEqualTo(TEST_ARG_VALUE)
- }
-
- @Test
- fun testBackstackArgsBundleParceled() {
- val context = ApplicationProvider.getApplicationContext() as Context
- var navController = NavController(context)
- val navigator = SaveStateTestNavigator()
- navController.navigatorProvider.addNavigator(navigator)
-
- val backStackArg1 = Bundle()
- backStackArg1.putParcelable(TEST_ARG, CustomTestParcelable(TEST_ARG_VALUE))
- navController.setGraph(R.navigation.nav_arguments)
- navController.navigate(R.id.second_test, backStackArg1)
-
- val savedState = navController.saveState()
-
- val parcel = Parcel.obtain()
- savedState?.writeToParcel(parcel, 0)
- parcel.setDataPosition(0)
-
- val restoredState = Bundle.CREATOR.createFromParcel(parcel)
-
- navController = NavController(context)
- navController.navigatorProvider.addNavigator(navigator)
-
- navController.restoreState(restoredState)
- navController.setGraph(R.navigation.nav_arguments)
-
- navController.addOnDestinationChangedListener { _, _, arguments ->
- assertThat(arguments?.getParcelable<CustomTestParcelable>(TEST_ARG)?.name)
- .isEqualTo(TEST_ARG_VALUE)
- }
- }
-
- @Test
fun testNavigateWithNoDefaultValue() {
val returnedArgs = navigateWithArgs(null)
@@ -346,9 +285,9 @@
assertEquals(1, navigator.backStack.size)
val success = navController.popBackStack()
- assertWithMessage("NavController should return false when popping the root")
+ assertWithMessage("NavController should return true when popping the root")
.that(success)
- .isFalse()
+ .isTrue()
assertNull(navController.currentDestination)
assertEquals(0, navigator.backStack.size)
}
@@ -362,17 +301,14 @@
assertEquals(1, navigator.backStack.size)
val success = navController.popBackStack()
- assertWithMessage("NavController should return false when popping the root")
+ assertWithMessage("NavController should return true when popping the root")
.that(success)
- .isFalse()
+ .isTrue()
assertNull(navController.currentDestination)
assertEquals(0, navigator.backStack.size)
val popped = navController.popBackStack()
- assertWithMessage("popBackStack should return false when there's nothing on the " +
- "back stack")
- .that(popped)
- .isFalse()
+ assertFalse(popped)
}
@Test
@@ -387,10 +323,7 @@
assertEquals(R.id.second_test, navController.currentDestination?.id ?: 0)
assertEquals(2, navigator.backStack.size)
- val popped = navController.popBackStack()
- assertWithMessage("NavController should return true when popping a non-root destination")
- .that(popped)
- .isTrue()
+ navController.popBackStack()
assertEquals(R.id.start_test, navController.currentDestination?.id ?: 0)
assertEquals(1, navigator.backStack.size)
}
@@ -408,9 +341,7 @@
assertEquals(2, navigator.backStack.size)
val popped = navController.popBackStack(UNKNOWN_DESTINATION_ID, false)
- assertWithMessage("Popping to an invalid destination should return false")
- .that(popped)
- .isFalse()
+ assertFalse(popped)
assertEquals(R.id.second_test, navController.currentDestination?.id ?: 0)
assertEquals(2, navigator.backStack.size)
}
@@ -477,21 +408,6 @@
}
@Test
- fun testNavigateThenNavigateWithPopRoot() {
- val navController = createNavController()
- navController.setGraph(R.navigation.nav_simple)
- val navigator = navController.navigatorProvider.getNavigator(TestNavigator::class.java)
- assertEquals(R.id.start_test, navController.currentDestination?.id ?: 0)
- assertEquals(1, navigator.backStack.size)
-
- navController.navigate(R.id.second_test, null, navOptions {
- popUpTo(0) { inclusive = true }
- })
- assertEquals(R.id.second_test, navController.currentDestination?.id ?: 0)
- assertEquals(1, navigator.backStack.size)
- }
-
- @Test
fun testNavigateThenNavigateUp() {
val navController = createNavController()
navController.setGraph(R.navigation.nav_simple)
@@ -504,9 +420,7 @@
assertEquals(2, navigator.backStack.size)
// This should function identically to popBackStack()
- val success = navController.navigateUp()
- assertThat(success)
- .isTrue()
+ navController.navigateUp()
assertEquals(R.id.start_test, navController.currentDestination?.id ?: 0)
assertEquals(1, navigator.backStack.size)
}
@@ -734,41 +648,18 @@
companion object {
private const val STATE_SAVED_COUNT = "saved_count"
- private const val TEST_PARCEL = "test_parcel"
}
var saveStateCount = 0
- var customParcel: CustomTestParcelable? = null
override fun onSaveState(): Bundle? {
saveStateCount += 1
val state = Bundle()
state.putInt(STATE_SAVED_COUNT, saveStateCount)
- state.putParcelable(TEST_PARCEL, customParcel)
return state
}
override fun onRestoreState(savedState: Bundle) {
saveStateCount = savedState.getInt(STATE_SAVED_COUNT)
- customParcel = savedState.getParcelable(TEST_PARCEL)
}
}
-
-/**
- * [CustomTestParcelable] that helps testing bundled custom parcels
- */
-data class CustomTestParcelable(val name: String?) : Parcelable {
- constructor(parcel: Parcel) : this(parcel.readString())
-
- override fun writeToParcel(dest: Parcel?, flags: Int) {
- dest?.writeString(name)
- }
-
- override fun describeContents() = 0
-
- companion object CREATOR : Parcelable.Creator<CustomTestParcelable> {
- override fun createFromParcel(parcel: Parcel) = CustomTestParcelable(parcel)
-
- override fun newArray(size: Int): Array<CustomTestParcelable?> = arrayOfNulls(size)
- }
-}
\ No newline at end of file
diff --git a/navigation/runtime/src/androidTest/java/androidx/navigation/NavInflaterTest.kt b/navigation/runtime/src/androidTest/java/androidx/navigation/NavInflaterTest.kt
index b950630..770a81e 100644
--- a/navigation/runtime/src/androidTest/java/androidx/navigation/NavInflaterTest.kt
+++ b/navigation/runtime/src/androidTest/java/androidx/navigation/NavInflaterTest.kt
@@ -26,7 +26,9 @@
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import androidx.test.platform.app.InstrumentationRegistry
-import com.google.common.truth.Truth.assertThat
+import org.junit.Assert.assertEquals
+import org.junit.Assert.assertNotNull
+import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -47,23 +49,8 @@
val navInflater = NavInflater(context, TestNavigatorProvider())
val graph = navInflater.inflate(R.navigation.nav_simple)
- assertThat(graph).isNotNull()
- assertThat(graph.startDestination)
- .isEqualTo(R.id.start_test)
- }
-
- @Test(expected = RuntimeException::class)
- fun testInflateInvalidArgumentArgType() {
- val context = ApplicationProvider.getApplicationContext() as Context
- val navInflater = NavInflater(context, TestNavigatorProvider())
- navInflater.inflate(R.navigation.nav_invalid_argument_arg_type)
- }
-
- @Test(expected = RuntimeException::class)
- fun testInflateInvalidArgumentDefaultValue() {
- val context = ApplicationProvider.getApplicationContext() as Context
- val navInflater = NavInflater(context, TestNavigatorProvider())
- navInflater.inflate(R.navigation.nav_invalid_argument_default_value)
+ assertNotNull(graph)
+ assertEquals(R.id.start_test, graph.startDestination)
}
@Test
@@ -72,111 +59,139 @@
val navInflater = NavInflater(context, TestNavigatorProvider())
val graph = navInflater.inflate(R.navigation.nav_simple)
- assertThat(graph).isNotNull()
+ assertNotNull(graph)
val expectedUri = Uri.parse("android-app://" +
instrumentation.targetContext.packageName + "/test")
val result = graph.matchDeepLink(expectedUri)
- assertThat(result)
- .isNotNull()
- assertThat(result?.destination)
- .isNotNull()
- assertThat(result?.destination?.id).isEqualTo(R.id.second_test)
+ assertNotNull(result)
+ assertNotNull(result?.first)
+ assertEquals(R.id.second_test, result?.first?.id ?: 0)
}
@Test
fun testDefaultArgumentsInteger() {
val defaultArguments = inflateDefaultArgumentsFromGraph()
- assertThat(defaultArguments["test_int"]?.run { type to defaultValue })
- .isEqualTo(NavType.IntType to 12)
+ assertEquals(12, defaultArguments.get("test_int")?.defaultValue)
+ assertEquals(NavType.IntType, defaultArguments.get("test_int")?.type)
+ assertEquals(2, defaultArguments.get("test_int2")?.defaultValue)
+ assertEquals(NavType.IntType, defaultArguments.get("test_int2")?.type)
+ }
+
+ @Test
+ fun testDefaultArgumentsDimen() {
+ val defaultArguments = inflateDefaultArgumentsFromGraph()
+ val context = ApplicationProvider.getApplicationContext() as Context
+ val expectedValue = context.resources.getDimensionPixelSize(R.dimen.test_dimen_arg)
+
+ assertEquals(expectedValue, defaultArguments.get("test_dimen")?.defaultValue)
+ assertEquals(NavType.IntType, defaultArguments.get("test_dimen")?.type)
+ assertEquals(expectedValue, defaultArguments.get("test_dimen2")?.defaultValue)
+ assertEquals(NavType.IntType, defaultArguments.get("test_dimen2")?.type)
+ assertEquals(R.dimen.test_dimen_arg, defaultArguments.get("test_dimen3")?.defaultValue)
+ assertEquals(NavType.ReferenceType, defaultArguments.get("test_dimen3")?.type)
+ }
+
+ @Test
+ fun testDefaultArgumentsColor() {
+ val defaultArguments = inflateDefaultArgumentsFromGraph()
+ val context = ApplicationProvider.getApplicationContext() as Context
+ val expectedValue = context.resources.getColor(R.color.test_color_arg)
+
+ assertEquals(expectedValue, defaultArguments.get("test_color")?.defaultValue)
+ assertEquals(NavType.IntType, defaultArguments.get("test_color")?.type)
}
@Test
fun testDefaultArgumentsFloat() {
val defaultArguments = inflateDefaultArgumentsFromGraph()
- assertThat(defaultArguments["test_float"]?.run { type to defaultValue })
- .isEqualTo(NavType.FloatType to 3.14f)
+ assertEquals(3.14f, defaultArguments.get("test_float")?.defaultValue)
+ assertEquals(NavType.FloatType, defaultArguments.get("test_float")?.type)
}
@Test
fun testDefaultArgumentsBoolean() {
val defaultArguments = inflateDefaultArgumentsFromGraph()
- assertThat(defaultArguments["test_boolean"]?.run { type to defaultValue })
- .isEqualTo(NavType.BoolType to true)
- assertThat(defaultArguments["test_boolean_false"]?.run { type to defaultValue })
- .isEqualTo(NavType.BoolType to false)
- assertThat(defaultArguments["test_boolean_with_argType"]?.run { type to defaultValue })
- .isEqualTo(NavType.BoolType to true)
- assertThat(defaultArguments["test_boolean_with_argType_false"]?.run {
- type to defaultValue
- }).isEqualTo(NavType.BoolType to false)
+ assertEquals(true, defaultArguments.get("test_boolean")?.defaultValue)
+ assertEquals(false, defaultArguments.get("test_boolean2")?.defaultValue)
+ assertEquals(true, defaultArguments.get("test_boolean3")?.defaultValue)
+ assertEquals(false, defaultArguments.get("test_boolean4")?.defaultValue)
+ assertEquals(true, defaultArguments.get("test_boolean5")?.defaultValue)
+ assertEquals(NavType.BoolType, defaultArguments.get("test_boolean")?.type)
+ assertEquals(NavType.BoolType, defaultArguments.get("test_boolean2")?.type)
+ assertEquals(NavType.BoolType, defaultArguments.get("test_boolean3")?.type)
+ assertEquals(NavType.BoolType, defaultArguments.get("test_boolean4")?.type)
+ assertEquals(NavType.BoolType, defaultArguments.get("test_boolean5")?.type)
}
@Test
fun testDefaultArgumentsLong() {
val defaultArguments = inflateDefaultArgumentsFromGraph()
- assertThat(defaultArguments["test_long"]?.run { type to defaultValue })
- .isEqualTo(NavType.LongType to 456789013456L)
- assertThat(defaultArguments["test_long_with_argType"]?.run { type to defaultValue })
- .isEqualTo(NavType.LongType to 456789013456L)
- assertThat(defaultArguments["test_long_short"]?.run { type to defaultValue })
- .isEqualTo(NavType.LongType to 123L)
+ assertEquals(456789013456L, defaultArguments.get("test_long")?.defaultValue)
+ assertEquals(456789013456L, defaultArguments.get("test_long2")?.defaultValue)
+ assertEquals(123L, defaultArguments.get("test_long3")?.defaultValue)
+ assertEquals(NavType.LongType, defaultArguments.get("test_long")?.type)
+ assertEquals(NavType.LongType, defaultArguments.get("test_long2")?.type)
+ assertEquals(NavType.LongType, defaultArguments.get("test_long3")?.type)
}
@Test
fun testDefaultArgumentsEnum() {
val defaultArguments = inflateDefaultArgumentsFromGraph()
- assertThat(defaultArguments["test_enum"]?.run { type to defaultValue })
- .isEqualTo(NavType.EnumType(TestEnum::class.java) to TestEnum.VALUE_ONE)
+ assertEquals(TestEnum.VALUE_ONE, defaultArguments.get("test_enum")?.defaultValue)
+ assertEquals(NavType.EnumType(TestEnum::class.java),
+ defaultArguments.get("test_enum")?.type)
}
@Test
fun testDefaultArgumentsString() {
val defaultArguments = inflateDefaultArgumentsFromGraph()
- assertThat(defaultArguments["test_string"]?.run { type to defaultValue })
- .isEqualTo(NavType.StringType to "abc")
- assertThat(defaultArguments["test_string_bool"]?.run { type to defaultValue })
- .isEqualTo(NavType.StringType to "true")
- assertThat(defaultArguments["test_string_long"]?.run { type to defaultValue })
- .isEqualTo(NavType.StringType to "123L")
- assertThat(defaultArguments["test_string_integer"]?.run { type to defaultValue })
- .isEqualTo(NavType.StringType to "123")
+ assertEquals("abc", defaultArguments.get("test_string")?.defaultValue)
+ assertEquals("true", defaultArguments.get("test_string2")?.defaultValue)
+ assertEquals("123L", defaultArguments.get("test_string3")?.defaultValue)
+ assertEquals("123", defaultArguments.get("test_string4")?.defaultValue)
+ assertEquals("test string", defaultArguments.get("test_string5")?.defaultValue)
+ assertEquals("test string", defaultArguments.get("test_string6")?.defaultValue)
+ assertTrue(defaultArguments.containsKey("test_string_no_default"))
+ assertEquals(false, defaultArguments.get("test_string_no_default")?.isDefaultValuePresent)
- assertThat(defaultArguments["test_string_no_default"]?.run {
- type to isDefaultValuePresent
- }).isEqualTo(NavType.StringType to false)
+ assertEquals(NavType.StringType, defaultArguments.get("test_string")?.type)
+ assertEquals(NavType.StringType, defaultArguments.get("test_string2")?.type)
+ assertEquals(NavType.StringType, defaultArguments.get("test_string3")?.type)
+ assertEquals(NavType.StringType, defaultArguments.get("test_string4")?.type)
+ assertEquals(NavType.StringType, defaultArguments.get("test_string5")?.type)
+ assertEquals(NavType.StringType, defaultArguments.get("test_string6")?.type)
+ assertEquals(NavType.StringType, defaultArguments.get("test_string_no_default")?.type)
}
@Test
fun testDefaultArgumentsReference() {
val defaultArguments = inflateDefaultArgumentsFromGraph()
- assertThat(defaultArguments["test_reference"]?.run { type to defaultValue })
- .isEqualTo(NavType.ReferenceType to R.style.AppTheme)
- assertThat(defaultArguments["test_reference_dimen"]?.run { type to defaultValue })
- .isEqualTo(NavType.ReferenceType to R.dimen.test_dimen_arg)
- assertThat(defaultArguments["test_reference_integer"]?.run { type to defaultValue })
- .isEqualTo(NavType.ReferenceType to R.integer.test_integer_arg)
- assertThat(defaultArguments["test_reference_string"]?.run { type to defaultValue })
- .isEqualTo(NavType.ReferenceType to R.string.test_string_arg)
- assertThat(defaultArguments["test_reference_bool"]?.run { type to defaultValue })
- .isEqualTo(NavType.ReferenceType to R.bool.test_bool_arg)
- assertThat(defaultArguments["test_reference_color"]?.run { type to defaultValue })
- .isEqualTo(NavType.ReferenceType to R.color.test_color_arg)
- assertThat(defaultArguments["test_reference_zero_default"]?.run { type to defaultValue })
- .isEqualTo(NavType.ReferenceType to 0)
+ assertEquals(R.style.AppTheme, defaultArguments.get("test_reference")?.defaultValue)
+ assertEquals(NavType.IntType, defaultArguments.get("test_reference")?.type)
+ assertEquals(R.dimen.test_dimen_arg, defaultArguments.get("test_reference2")?.defaultValue)
+ assertEquals(NavType.ReferenceType, defaultArguments.get("test_reference2")?.type)
+ assertEquals(R.integer.test_integer_arg,
+ defaultArguments.get("test_reference3")?.defaultValue)
+ assertEquals(NavType.ReferenceType, defaultArguments.get("test_reference3")?.type)
+ assertEquals(R.string.test_string_arg,
+ defaultArguments.get("test_reference4")?.defaultValue)
+ assertEquals(NavType.ReferenceType, defaultArguments.get("test_reference4")?.type)
+ assertEquals(R.bool.test_bool_arg, defaultArguments.get("test_reference5")?.defaultValue)
+ assertEquals(NavType.ReferenceType, defaultArguments.get("test_reference5")?.type)
}
@Test
fun testRelativeClassName() {
val defaultArguments = inflateDefaultArgumentsFromGraph()
- assertThat(defaultArguments["test_relative_classname"]?.run { type to defaultValue })
- .isEqualTo(NavType.EnumType(TestEnum::class.java) to TestEnum.VALUE_TWO)
+ assertEquals(TestEnum.VALUE_TWO,
+ defaultArguments.get("test_relative_classname")?.defaultValue)
}
@Test
@@ -186,8 +201,7 @@
val graph = navInflater.inflate(R.navigation.nav_default_arguments)
val startDestination = graph.findNode(graph.startDestination)
val action = startDestination?.getAction(R.id.my_action)
- assertThat(action?.defaultArguments?.get("test_action_arg"))
- .isEqualTo(123L)
+ assertEquals(123L, action?.defaultArguments?.get("test_action_arg"))
}
private fun inflateDefaultArgumentsFromGraph(): Map<String, NavArgument> {
@@ -198,7 +212,7 @@
val startDestination = graph.findNode(graph.startDestination)
val defaultArguments = startDestination?.arguments
- assertThat(defaultArguments).isNotNull()
+ assertNotNull(defaultArguments)
return defaultArguments!!
}
}
diff --git a/navigation/runtime/src/androidTest/res/navigation/nav_default_arguments.xml b/navigation/runtime/src/androidTest/res/navigation/nav_default_arguments.xml
index 9799c0f..e416521 100644
--- a/navigation/runtime/src/androidTest/res/navigation/nav_default_arguments.xml
+++ b/navigation/runtime/src/androidTest/res/navigation/nav_default_arguments.xml
@@ -15,101 +15,60 @@
~ limitations under the License.
-->
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- app:startDestination="@+id/start_test">
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ app:startDestination="@+id/start_test">
<test android:id="@+id/start_test">
- <argument
- android:name="test_int"
- android:defaultValue="12" />
+ <argument android:name="test_int" android:defaultValue="12" />
+ <argument android:name="test_int2" app:argType="integer"
+ android:defaultValue="@integer/test_integer_arg" />
- <argument
- android:name="test_float"
- android:defaultValue="3.14" />
+ <argument android:name="test_dimen" android:defaultValue="@dimen/test_dimen_arg" />
+ <argument android:name="test_dimen2" app:argType="integer"
+ android:defaultValue="@dimen/test_dimen_arg" />
+ <argument android:name="test_dimen3" app:argType="reference"
+ android:defaultValue="@dimen/test_dimen_arg" />
- <argument
- android:name="test_reference"
- android:defaultValue="@style/AppTheme" />
- <argument
- android:name="test_reference_dimen"
- android:defaultValue="@dimen/test_dimen_arg" />
- <argument
- android:name="test_reference_integer"
- android:defaultValue="@integer/test_integer_arg" />
- <argument
- android:name="test_reference_string"
- android:defaultValue="@string/test_string_arg" />
- <argument
- android:name="test_reference_bool"
- android:defaultValue="@bool/test_bool_arg" />
- <argument
- android:name="test_reference_color"
- android:defaultValue="@color/test_color_arg" />
- <argument
- android:name="test_reference_zero_default"
- app:argType="reference"
- android:defaultValue="0" />
+ <argument android:name="test_color" android:defaultValue="@color/test_color_arg" />
- <argument
- android:name="test_boolean"
- android:defaultValue="true" />
- <argument
- android:name="test_boolean_false"
- android:defaultValue="false" />
- <argument
- android:name="test_boolean_with_argType"
- android:defaultValue="true"
- app:argType="boolean" />
- <argument
- android:name="test_boolean_with_argType_false"
- android:defaultValue="false"
- app:argType="boolean" />
+ <argument android:name="test_float" android:defaultValue="3.14" />
- <argument
- android:name="test_string"
- android:defaultValue="abc" />
- <argument
- android:name="test_string_bool"
- android:defaultValue="true"
- app:argType="string" />
- <argument
- android:name="test_string_long"
- android:defaultValue="123L"
- app:argType="string" />
- <argument
- android:name="test_string_integer"
- android:defaultValue="123"
- app:argType="string" />
- <argument
- android:name="test_string_no_default"
- app:argType="string" />
+ <argument android:name="test_reference" android:defaultValue="@style/AppTheme" />
+ <argument android:name="test_reference2" app:argType="reference"
+ android:defaultValue="@dimen/test_dimen_arg" />
+ <argument android:name="test_reference3" app:argType="reference"
+ android:defaultValue="@integer/test_integer_arg" />
+ <argument android:name="test_reference4" app:argType="reference"
+ android:defaultValue="@string/test_string_arg" />
+ <argument android:name="test_reference5" app:argType="reference"
+ android:defaultValue="@bool/test_bool_arg" />
- <argument
- android:name="test_long"
- android:defaultValue="456789013456L" />
- <argument
- android:name="test_long_with_argType"
- android:defaultValue="456789013456L"
- app:argType="long" />
- <argument
- android:name="test_long_short"
- android:defaultValue="123L" />
+ <argument android:name="test_boolean" android:defaultValue="true" />
+ <argument android:name="test_boolean2" android:defaultValue="false" />
+ <argument app:argType="boolean" android:name="test_boolean3" android:defaultValue="true" />
+ <argument app:argType="boolean" android:name="test_boolean4" android:defaultValue="false" />
+ <argument android:name="test_boolean5" android:defaultValue="@bool/test_bool_arg" />
- <argument
- android:name="test_enum"
- android:defaultValue="VALUE_ONE"
- app:argType="androidx.navigation.test.TestEnum" />
- <argument
- android:name="test_relative_classname"
- android:defaultValue="VALUE_TWO"
- app:argType=".TestEnum" />
+ <argument android:name="test_string" android:defaultValue="abc" />
+ <argument app:argType="string" android:name="test_string2" android:defaultValue="true" />
+ <argument app:argType="string" android:name="test_string3" android:defaultValue="123L" />
+ <argument app:argType="string" android:name="test_string4" android:defaultValue="123" />
+ <argument app:argType="string" android:name="test_string5"
+ android:defaultValue="@string/test_string_arg" />
+ <argument android:name="test_string6" android:defaultValue="@string/test_string_arg" />
+ <argument app:argType="string" android:name="test_string_no_default" />
- <action
- android:id="@+id/my_action"
- app:destination="@+id/start_test">
- <argument
- android:name="test_action_arg"
- android:defaultValue="123L" />
+ <argument app:argType="long" android:name="test_long" android:defaultValue="456789013456L" />
+ <argument android:name="test_long2" android:defaultValue="456789013456L" />
+ <argument android:name="test_long3" android:defaultValue="123L" />
+
+ <argument android:name="test_enum" app:argType="androidx.navigation.test.TestEnum"
+ android:defaultValue="VALUE_ONE"/>
+ <argument android:name="test_relative_classname" app:argType=".TestEnum"
+ android:defaultValue="VALUE_TWO"/>
+
+ <action android:id="@+id/my_action" app:destination="@+id/start_test">
+ <argument android:name="test_action_arg" android:defaultValue="123L" />
</action>
</test>
</navigation>
diff --git a/navigation/runtime/src/androidTest/res/navigation/nav_invalid_argument_arg_type.xml b/navigation/runtime/src/androidTest/res/navigation/nav_invalid_argument_arg_type.xml
deleted file mode 100644
index 895f511..0000000
--- a/navigation/runtime/src/androidTest/res/navigation/nav_invalid_argument_arg_type.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-<navigation xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- app:startDestination="@+id/start_test">
-
- <test android:id="@+id/start_test">
- <argument android:name="test_int" app:argType="reference"
- android:defaultValue="1" />
- </test>
-</navigation>
diff --git a/navigation/runtime/src/androidTest/res/navigation/nav_invalid_argument_default_value.xml b/navigation/runtime/src/androidTest/res/navigation/nav_invalid_argument_default_value.xml
deleted file mode 100644
index fb6599a..0000000
--- a/navigation/runtime/src/androidTest/res/navigation/nav_invalid_argument_default_value.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-<navigation xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- app:startDestination="@+id/start_test">
-
- <test android:id="@+id/start_test">
- <argument android:name="test_int" app:argType="integer"
- android:defaultValue="@integer/test_integer_arg" />
- </test>
-</navigation>
diff --git a/navigation/runtime/src/main/java/androidx/navigation/ActivityNavigator.java b/navigation/runtime/src/main/java/androidx/navigation/ActivityNavigator.java
index b3a9bee..81e0e2c5 100644
--- a/navigation/runtime/src/main/java/androidx/navigation/ActivityNavigator.java
+++ b/navigation/runtime/src/main/java/androidx/navigation/ActivityNavigator.java
@@ -24,15 +24,14 @@
import android.content.res.TypedArray;
import android.net.Uri;
import android.os.Bundle;
+import android.support.annotation.CallSuper;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.app.ActivityOptionsCompat;
import android.text.TextUtils;
import android.util.AttributeSet;
-import androidx.annotation.CallSuper;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.core.app.ActivityCompat;
-import androidx.core.app.ActivityOptionsCompat;
-
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -78,7 +77,7 @@
return;
}
int popEnterAnim = intent.getIntExtra(EXTRA_POP_ENTER_ANIM, -1);
- int popExitAnim = intent.getIntExtra(EXTRA_POP_EXIT_ANIM, -1);
+ int popExitAnim = intent.getIntExtra(EXTRA_POP_ENTER_ANIM, -1);
if (popEnterAnim != -1 || popExitAnim != -1) {
popEnterAnim = popEnterAnim != -1 ? popEnterAnim : 0;
popExitAnim = popExitAnim != -1 ? popExitAnim : 0;
diff --git a/navigation/runtime/src/main/java/androidx/navigation/NavController.java b/navigation/runtime/src/main/java/androidx/navigation/NavController.java
index 6833814..0134462 100644
--- a/navigation/runtime/src/main/java/androidx/navigation/NavController.java
+++ b/navigation/runtime/src/main/java/androidx/navigation/NavController.java
@@ -22,15 +22,15 @@
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
+import android.support.annotation.CallSuper;
+import android.support.annotation.IdRes;
+import android.support.annotation.NavigationRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.app.TaskStackBuilder;
+import android.support.v4.util.Pair;
import android.util.Log;
-import androidx.annotation.CallSuper;
-import androidx.annotation.IdRes;
-import androidx.annotation.NavigationRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.core.app.TaskStackBuilder;
-
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
@@ -237,8 +237,7 @@
* the system {@link android.view.KeyEvent#KEYCODE_BACK Back} button when the associated
* navigation host has focus.
*
- * @return true if the stack was popped and the user has been navigated to another
- * destination, false otherwise
+ * @return true if the stack was popped, false otherwise
*/
public boolean popBackStack() {
if (mBackStack.isEmpty()) {
@@ -255,14 +254,14 @@
* @param destinationId The topmost destination to retain
* @param inclusive Whether the given destination should also be popped.
*
- * @return true if the stack was popped at least once and the user has been navigated to
- * another destination, false otherwise
+ * @return true if the stack was popped at least once, false otherwise
*/
public boolean popBackStack(@IdRes int destinationId, boolean inclusive) {
boolean popped = popBackStackInternal(destinationId, inclusive);
- // Only return true if the pop succeeded and we've dispatched
- // the change to a new destination
- return popped && dispatchOnDestinationChanged();
+ if (popped) {
+ dispatchOnDestinationChanged();
+ }
+ return popped;
}
/**
@@ -303,13 +302,13 @@
+ " as it was not found on the current back stack");
return false;
}
- boolean popped = false;
+ boolean popped = true;
for (Navigator navigator : popOperations) {
if (navigator.popBackStack()) {
mBackStack.removeLast();
- popped = true;
} else {
// The pop did not complete successfully, so stop immediately
+ popped = false;
break;
}
}
@@ -331,7 +330,7 @@
* @return true if navigation was successful, false otherwise
*/
public boolean navigateUp() {
- if (getDestinationCountOnBackStack() == 1) {
+ if (mBackStack.size() == 1) {
// If there's only one entry, then we've deep linked into a specific destination
// on another task so we need to find the parent and start our task from there
NavDestination currentDestination = getCurrentDestination();
@@ -339,7 +338,7 @@
NavGraph parent = currentDestination.getParent();
while (parent != null) {
if (parent.getStartDestination() != destId) {
- TaskStackBuilder parentIntents = new NavDeepLinkBuilder(this)
+ TaskStackBuilder parentIntents = new NavDeepLinkBuilder(NavController.this)
.setDestination(parent.getId())
.createTaskStackBuilder();
parentIntents.startActivities();
@@ -358,28 +357,8 @@
}
}
- /**
- * Gets the number of non-NavGraph destinations on the back stack
- */
- private int getDestinationCountOnBackStack() {
- int count = 0;
- for (NavBackStackEntry entry : mBackStack) {
- if (!(entry.getDestination() instanceof NavGraph)) {
- count++;
- }
- }
- return count;
- }
-
- /**
- * Dispatch changes to all OnDestinationChangedListeners.
- * <p>
- * If the back stack is empty, no events get dispatched.
- *
- * @return If changes were dispatched.
- */
@SuppressWarnings("WeakerAccess") /* synthetic access */
- boolean dispatchOnDestinationChanged() {
+ void dispatchOnDestinationChanged() {
// We never want to leave NavGraphs on the top of the stack
//noinspection StatementWithEmptyBody
while (!mBackStack.isEmpty()
@@ -394,9 +373,7 @@
listener.onDestinationChanged(this, backStackEntry.getDestination(),
backStackEntry.getArguments());
}
- return true;
}
- return false;
}
/**
@@ -505,9 +482,6 @@
throw new IllegalStateException("unknown destination during restore: "
+ mContext.getResources().getResourceName(destinationId));
}
- if (args != null) {
- args.setClassLoader(mContext.getClassLoader());
- }
mBackStack.add(new NavBackStackEntry(node, args));
}
mBackStackIdsToRestore = null;
@@ -555,10 +529,10 @@
bundle.putAll(deepLinkExtras);
}
if ((deepLink == null || deepLink.length == 0) && intent.getData() != null) {
- NavDestination.DeepLinkMatch matchingDeepLink = mGraph.matchDeepLink(intent.getData());
+ Pair<NavDestination, Bundle> matchingDeepLink = mGraph.matchDeepLink(intent.getData());
if (matchingDeepLink != null) {
- deepLink = matchingDeepLink.getDestination().buildDeepLinkIds();
- bundle.putAll(matchingDeepLink.getMatchingArgs());
+ deepLink = matchingDeepLink.first.buildDeepLinkIds();
+ bundle.putAll(matchingDeepLink.second);
}
}
if (deepLink == null || deepLink.length == 0) {
@@ -786,14 +760,14 @@
combinedArgs.putAll(args);
}
- if (destId == 0 && navOptions != null && navOptions.getPopUpTo() != -1) {
+ if (destId == 0 && navOptions != null && navOptions.getPopUpTo() != 0) {
popBackStack(navOptions.getPopUpTo(), navOptions.isPopUpToInclusive());
return;
}
if (destId == 0) {
throw new IllegalArgumentException("Destination id == 0 can only be used"
- + " in conjunction with a valid navOptions.popUpTo");
+ + " in conjunction with navOptions.popUpTo != 0");
}
NavDestination node = findDestination(destId);
@@ -812,7 +786,7 @@
@Nullable NavOptions navOptions, @Nullable Navigator.Extras navigatorExtras) {
boolean popped = false;
if (navOptions != null) {
- if (navOptions.getPopUpTo() != -1) {
+ if (navOptions.getPopUpTo() != 0) {
popped = popBackStackInternal(navOptions.getPopUpTo(),
navOptions.isPopUpToInclusive());
}
@@ -955,8 +929,6 @@
return;
}
- navState.setClassLoader(mContext.getClassLoader());
-
mNavigatorStateToRestore = navState.getBundle(KEY_NAVIGATOR_STATE);
mBackStackIdsToRestore = navState.getIntArray(KEY_BACK_STACK_IDS);
mBackStackArgsToRestore = navState.getParcelableArray(KEY_BACK_STACK_ARGS);
diff --git a/navigation/runtime/src/main/java/androidx/navigation/NavDeepLinkBuilder.java b/navigation/runtime/src/main/java/androidx/navigation/NavDeepLinkBuilder.java
index 106011f..af8d650 100644
--- a/navigation/runtime/src/main/java/androidx/navigation/NavDeepLinkBuilder.java
+++ b/navigation/runtime/src/main/java/androidx/navigation/NavDeepLinkBuilder.java
@@ -22,12 +22,11 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
-
-import androidx.annotation.IdRes;
-import androidx.annotation.NavigationRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.core.app.TaskStackBuilder;
+import android.support.annotation.IdRes;
+import android.support.annotation.NavigationRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.app.TaskStackBuilder;
import java.util.ArrayDeque;
diff --git a/navigation/runtime/src/main/java/androidx/navigation/NavHost.java b/navigation/runtime/src/main/java/androidx/navigation/NavHost.java
index a6b59d5..ffa44db 100644
--- a/navigation/runtime/src/main/java/androidx/navigation/NavHost.java
+++ b/navigation/runtime/src/main/java/androidx/navigation/NavHost.java
@@ -17,10 +17,9 @@
package androidx.navigation;
import android.os.Bundle;
+import android.support.annotation.NonNull;
import android.view.View;
-import androidx.annotation.NonNull;
-
/**
* A host is a single context or container for navigation via a {@link NavController}.
* <p>
diff --git a/navigation/runtime/src/main/java/androidx/navigation/NavInflater.java b/navigation/runtime/src/main/java/androidx/navigation/NavInflater.java
index 2b108d4..b2b4d25 100644
--- a/navigation/runtime/src/main/java/androidx/navigation/NavInflater.java
+++ b/navigation/runtime/src/main/java/androidx/navigation/NavInflater.java
@@ -22,14 +22,13 @@
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.os.Bundle;
+import android.support.annotation.NavigationRes;
+import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.util.Xml;
-import androidx.annotation.NavigationRes;
-import androidx.annotation.NonNull;
-
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -183,31 +182,17 @@
}
if (a.getValue(R.styleable.NavArgument_android_defaultValue, value)) {
- if (navType == NavType.ReferenceType) {
+ if (navType == NavType.StringType) {
+ defaultValue = a.getString(R.styleable.NavArgument_android_defaultValue);
+ } else if (navType == NavType.ReferenceType) {
if (value.resourceId != 0) {
defaultValue = value.resourceId;
- } else if (value.type == TypedValue.TYPE_FIRST_INT && value.data == 0) {
- // Support "0" as a default value for reference types
- defaultValue = 0;
} else {
throw new XmlPullParserException(
"unsupported value '" + value.string
+ "' for " + navType.getName()
+ ". Must be a reference to a resource.");
}
- } else if (value.resourceId != 0) {
- if (navType == null) {
- navType = NavType.ReferenceType;
- defaultValue = value.resourceId;
- } else {
- throw new XmlPullParserException(
- "unsupported value '" + value.string
- + "' for " + navType.getName()
- + ". You must use a \"" + NavType.ReferenceType.getName()
- + "\" type to reference other resources.");
- }
- } else if (navType == NavType.StringType) {
- defaultValue = a.getString(R.styleable.NavArgument_android_defaultValue);
} else {
switch (value.type) {
case TypedValue.TYPE_STRING:
@@ -227,6 +212,11 @@
argType, "float");
defaultValue = value.getFloat();
break;
+ case TypedValue.TYPE_REFERENCE:
+ navType = checkNavType(value, navType, NavType.IntType,
+ argType, "reference");
+ defaultValue = value.data;
+ break;
case TypedValue.TYPE_INT_BOOLEAN:
navType = checkNavType(value, navType, NavType.BoolType,
argType, "boolean");
@@ -288,7 +278,7 @@
NavOptions.Builder builder = new NavOptions.Builder();
builder.setLaunchSingleTop(a.getBoolean(R.styleable.NavAction_launchSingleTop, false));
- builder.setPopUpTo(a.getResourceId(R.styleable.NavAction_popUpTo, -1),
+ builder.setPopUpTo(a.getResourceId(R.styleable.NavAction_popUpTo, 0),
a.getBoolean(R.styleable.NavAction_popUpToInclusive, false));
builder.setEnterAnim(a.getResourceId(R.styleable.NavAction_enterAnim, -1));
builder.setExitAnim(a.getResourceId(R.styleable.NavAction_exitAnim, -1));
diff --git a/navigation/runtime/src/main/java/androidx/navigation/Navigation.java b/navigation/runtime/src/main/java/androidx/navigation/Navigation.java
index 6f1d4e5..5ca1b22 100644
--- a/navigation/runtime/src/main/java/androidx/navigation/Navigation.java
+++ b/navigation/runtime/src/main/java/androidx/navigation/Navigation.java
@@ -18,14 +18,13 @@
import android.app.Activity;
import android.os.Bundle;
+import android.support.annotation.IdRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.app.ActivityCompat;
import android.view.View;
import android.view.ViewParent;
-import androidx.annotation.IdRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.core.app.ActivityCompat;
-
import java.lang.ref.WeakReference;
/**
diff --git a/navigation/safe-args-generator/build.gradle b/navigation/safe-args-generator/build.gradle
index 8ca2abc..de6f6e5 100644
--- a/navigation/safe-args-generator/build.gradle
+++ b/navigation/safe-args-generator/build.gradle
@@ -60,7 +60,6 @@
supportLibrary {
name = 'Android Navigation TypeSafe Arguments Generator'
publish = true
- toolingProject = true
mavenVersion = LibraryVersions.NAVIGATION
mavenGroup = LibraryGroups.NAVIGATION
inceptionYear = '2017'
diff --git a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParser.kt b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParser.kt
index d92260d..5c60ac1 100644
--- a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParser.kt
+++ b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParser.kt
@@ -163,18 +163,8 @@
LongType -> parseLongValue(defaultValue)
FloatType -> parseFloatValue(defaultValue)
BoolType -> parseBoolean(defaultValue)
- ReferenceType -> {
- when (defaultValue) {
- VALUE_NULL -> {
- context.logger.error(NavParserErrors.nullDefaultValueReference(name),
- xmlPosition)
- return context.createStubArg()
- }
- "0" -> IntValue("0")
- else -> parseReference(defaultValue, rFilePackage)?.let {
- ReferenceValue(it)
- }
- }
+ ReferenceType -> parseReference(defaultValue, rFilePackage)?.let {
+ ReferenceValue(it)
}
StringType -> {
if (defaultValue == VALUE_NULL) {
diff --git a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParserErrors.kt b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParserErrors.kt
index a800a42..37c2833 100644
--- a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParserErrors.kt
+++ b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParserErrors.kt
@@ -26,9 +26,6 @@
fun invalidDefaultValueReference(value: String) = "Failed to parse defaultValue " +
"'$value' as reference. Reference must be in format @[+][package:]res_type/resource_name"
- fun nullDefaultValueReference(name: String?) = "android:defaultValue is @null, but '$name' " +
- "is of type \"reference\". Use \"0\" to signify a empty reference id"
-
fun invalidDefaultValue(value: String, type: NavType) = "Failed to parse defaultValue " +
"'$value' as $type"
diff --git a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavSafeArgsGenerator.kt b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavSafeArgsGenerator.kt
index 2ca06db..7d84357 100644
--- a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavSafeArgsGenerator.kt
+++ b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavSafeArgsGenerator.kt
@@ -26,7 +26,7 @@
applicationId: String,
navigationXml: File,
outputDir: File,
- useAndroidX: Boolean = true,
+ useAndroidX: Boolean,
generateKotlin: Boolean
) = NavSafeArgsGenerator(
rFilePackage,
diff --git a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/ext/String_ext.kt b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/ext/String_ext.kt
index fbfb48a..e3c0387 100644
--- a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/ext/String_ext.kt
+++ b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/ext/String_ext.kt
@@ -28,22 +28,4 @@
if (split.size == 0) return ""
if (split.size == 1) return split[0]
return split.joinToCamelCaseAsVar()
-}
-
-// Gets class name parts (package name, simple name, inner names) out of a canonical name such
-// as a.b.OuterClass$InnerClass, useful for then building a javapoet or kotlinpoet ClassName.
-fun String.toClassNameParts(): Triple<String, String, Array<String>> {
- val packageName = substringBeforeLast('.', "")
- val (simpleName, innerNames) = substringAfterLast('.').let {
- val simpleName = it.substringBefore("$")
- val innerNames = it.substringAfter("$", "").let { innerName ->
- if (innerName.isNotEmpty()) {
- innerName.split("$")
- } else {
- emptyList()
- }
- }
- simpleName to innerNames
- }
- return Triple(packageName, simpleName, innerNames.toTypedArray())
}
\ No newline at end of file
diff --git a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
index 9c265fc..03776e9 100644
--- a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
+++ b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
@@ -36,6 +36,7 @@
import androidx.navigation.safe.args.generator.models.Action
import androidx.navigation.safe.args.generator.models.Argument
import androidx.navigation.safe.args.generator.models.Destination
+import androidx.navigation.safe.args.generator.models.accessor
import com.squareup.javapoet.AnnotationSpec
import com.squareup.javapoet.ClassName
import com.squareup.javapoet.CodeBlock
@@ -54,7 +55,7 @@
const val BEGIN_STMT = "\$["
const val END_STMT = "\$]"
-class JavaNavWriter(private val useAndroidX: Boolean = true) : NavWriter<JavaCodeFile> {
+class JavaNavWriter(private val useAndroidX: Boolean = false) : NavWriter<JavaCodeFile> {
override fun generateDirectionsCodeFile(
destination: Destination,
@@ -151,7 +152,7 @@
.addAnnotation(Override::class.java)
.addModifiers(Modifier.PUBLIC)
.returns(Int::class.java)
- .addStatement("return $L", action.id.accessor())
+ .addStatement("return $N", action.id.accessor())
.build()
val additionalEqualsBlock = CodeBlock.builder().apply {
diff --git a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaTypes.kt b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaTypes.kt
index a44c472..7d5bb30 100644
--- a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaTypes.kt
+++ b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaTypes.kt
@@ -41,8 +41,7 @@
import androidx.navigation.safe.args.generator.ReferenceValue
import androidx.navigation.safe.args.generator.StringValue
import androidx.navigation.safe.args.generator.WritableValue
-import androidx.navigation.safe.args.generator.ext.toClassNameParts
-import androidx.navigation.safe.args.generator.models.ResReference
+import androidx.navigation.safe.args.generator.models.accessor
import com.squareup.javapoet.ArrayTypeName
import com.squareup.javapoet.ClassName
import com.squareup.javapoet.CodeBlock
@@ -58,7 +57,6 @@
internal val BUNDLE_CLASSNAME: ClassName = ClassName.get("android.os", "Bundle")
internal val PARCELABLE_CLASSNAME = ClassName.get("android.os", "Parcelable")
internal val SERIALIZABLE_CLASSNAME = ClassName.get("java.io", "Serializable")
-internal val SYSTEM_CLASSNAME = ClassName.get("java.lang", "System")
internal abstract class Annotations {
abstract val NULLABLE_CLASSNAME: ClassName
@@ -109,22 +107,10 @@
)
}.endControlFlow()
}
- is ObjectArrayType -> builder.apply {
- val arrayName = "__array"
- val baseType = (arg.type.typeName() as ArrayTypeName).componentType
- addStatement("$T[] $N = $N.$N($S)",
- PARCELABLE_CLASSNAME, arrayName, bundle, bundleGetMethod(), arg.name)
- beginControlFlow("if ($N != null)", arrayName).apply {
- addStatement("$N = new $T[$N.length]", lValue, baseType, arrayName)
- addStatement("$T.arraycopy($N, 0, $N, 0, $N.length)",
- SYSTEM_CLASSNAME, arrayName, lValue, arrayName
- )
- }
- nextControlFlow("else").apply {
- addStatement("$N = null", lValue)
- }
- endControlFlow()
- }
+ is ObjectArrayType -> builder.addStatement(
+ "$N = ($T) $N.$N($S)",
+ lValue, typeName(), bundle, bundleGetMethod(), arg.name
+ )
else -> builder.addStatement(
"$N = $N.$N($S)",
lValue,
@@ -187,19 +173,26 @@
BoolArrayType -> ArrayTypeName.of(TypeName.BOOLEAN)
ReferenceType -> TypeName.INT
ReferenceArrayType -> ArrayTypeName.of(TypeName.INT)
- is ObjectType -> canonicalName.toClassNameParts().let { (packageName, simpleName, innerNames) ->
- ClassName.get(packageName, simpleName, *innerNames)
+ is ObjectType -> canonicalName.let {
+ ClassName.get(
+ it.substringBeforeLast('.', ""),
+ it.substringAfterLast('.')
+ )
}
- is ObjectArrayType -> ArrayTypeName.of(
- canonicalName.toClassNameParts().let { (packageName, simpleName, innerNames) ->
- ClassName.get(packageName, simpleName, *innerNames)
- })
+ is ObjectArrayType -> canonicalName.let {
+ ArrayTypeName.of(
+ ClassName.get(
+ it.substringBeforeLast('.', ""),
+ it.substringAfterLast('.')
+ )
+ )
+ }
else -> throw IllegalStateException("Unknown type: $this")
}
internal fun WritableValue.write(): CodeBlock {
return when (this) {
- is ReferenceValue -> resReference.accessor()
+ is ReferenceValue -> CodeBlock.of(resReference.accessor())
is StringValue -> CodeBlock.of(S, value)
is IntValue -> CodeBlock.of(value)
is LongValue -> CodeBlock.of(value)
@@ -209,8 +202,4 @@
is EnumValue -> CodeBlock.of("$T.$N", type.typeName(), value)
else -> throw IllegalStateException("Unknown value: $this")
}
-}
-
-internal fun ResReference?.accessor() = this?.let {
- CodeBlock.of("$T.$N", ClassName.get(packageName, "R", resType), javaIdentifier)
-} ?: CodeBlock.of("0")
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
index e5756bf..2208f8e6 100644
--- a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
+++ b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
@@ -23,6 +23,7 @@
import androidx.navigation.safe.args.generator.ext.toCamelCaseAsVar
import androidx.navigation.safe.args.generator.models.Action
import androidx.navigation.safe.args.generator.models.Destination
+import androidx.navigation.safe.args.generator.models.accessor
import com.squareup.kotlinpoet.AnnotationSpec
import com.squareup.kotlinpoet.ClassName
import com.squareup.kotlinpoet.FileSpec
@@ -33,7 +34,7 @@
import com.squareup.kotlinpoet.TypeSpec
import com.squareup.kotlinpoet.asTypeName
-class KotlinNavWriter(private val useAndroidX: Boolean = true) : NavWriter<KotlinCodeFile> {
+class KotlinNavWriter(private val useAndroidX: Boolean = false) : NavWriter<KotlinCodeFile> {
override fun generateDirectionsCodeFile(
destination: Destination,
@@ -128,7 +129,7 @@
val getActionIdFunSpec = FunSpec.builder("getActionId")
.addModifiers(KModifier.OVERRIDE)
.returns(Int::class)
- .addStatement("return %L", action.id.accessor())
+ .addStatement("return %N", action.id.accessor())
.build()
val getArgumentsFunSpec = FunSpec.builder("getArguments").apply {
diff --git a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinTypes.kt b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinTypes.kt
index 4a1782a..46a9377 100644
--- a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinTypes.kt
+++ b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinTypes.kt
@@ -40,9 +40,8 @@
import androidx.navigation.safe.args.generator.StringType
import androidx.navigation.safe.args.generator.StringValue
import androidx.navigation.safe.args.generator.WritableValue
-import androidx.navigation.safe.args.generator.ext.toClassNameParts
import androidx.navigation.safe.args.generator.models.Argument
-import androidx.navigation.safe.args.generator.models.ResReference
+import androidx.navigation.safe.args.generator.models.accessor
import com.squareup.kotlinpoet.ARRAY
import com.squareup.kotlinpoet.BOOLEAN
import com.squareup.kotlinpoet.ClassName
@@ -51,7 +50,6 @@
import com.squareup.kotlinpoet.FunSpec
import com.squareup.kotlinpoet.INT
import com.squareup.kotlinpoet.LONG
-import com.squareup.kotlinpoet.ParameterizedTypeName
import com.squareup.kotlinpoet.TypeName
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
import com.squareup.kotlinpoet.asTypeName
@@ -92,12 +90,10 @@
)
endControlFlow()
}
- is ObjectArrayType -> builder.apply {
- val baseType = (arg.type.typeName() as ParameterizedTypeName).typeArguments.first()
- addStatement(
- "%L = %L.%L(%S)?.map { it as %T }?.toTypedArray()",
- lValue, bundle, bundleGetMethod(), arg.name, baseType)
- }
+ is ObjectArrayType -> builder.addStatement(
+ "%L = %L.%L(%S) as %T",
+ lValue, bundle, bundleGetMethod(), arg.name, arg.type.typeName().copy(nullable = true)
+ )
else -> builder.addStatement(
"%L = %L.%L(%S)",
lValue,
@@ -165,20 +161,14 @@
BoolArrayType -> BooleanArray::class.asTypeName()
ReferenceType -> INT
ReferenceArrayType -> IntArray::class.asTypeName()
- is ObjectType -> canonicalName.toClassNameParts().let { (packageName, simpleName, innerNames) ->
- ClassName(packageName, simpleName, *innerNames)
- }
- is ObjectArrayType -> ARRAY.parameterizedBy(
- canonicalName.toClassNameParts().let { (packageName, simpleName, innerNames) ->
- ClassName(packageName, simpleName, *innerNames)
- }
- )
+ is ObjectType -> ClassName.bestGuess(canonicalName)
+ is ObjectArrayType -> ARRAY.parameterizedBy(ClassName.bestGuess(canonicalName))
else -> throw IllegalStateException("Unknown type: $this")
}
internal fun WritableValue.write(): CodeBlock {
return when (this) {
- is ReferenceValue -> resReference.accessor()
+ is ReferenceValue -> CodeBlock.of(resReference.accessor())
is StringValue -> CodeBlock.of("%S", value)
is IntValue -> CodeBlock.of(value)
is LongValue -> CodeBlock.of(value)
@@ -188,8 +178,4 @@
is EnumValue -> CodeBlock.of("%T.%N", type.typeName(), value)
else -> throw IllegalStateException("Unknown value: $this")
}
-}
-
-internal fun ResReference?.accessor() = this?.let {
- CodeBlock.of("%T.%N", ClassName(packageName, "R", resType), javaIdentifier)
-} ?: CodeBlock.of("0")
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/models/ResReference.kt b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/models/ResReference.kt
index 214a413..c03488b 100644
--- a/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/models/ResReference.kt
+++ b/navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/models/ResReference.kt
@@ -22,4 +22,6 @@
val javaIdentifier = name.replace("[.\\-]".toRegex(), "_")
fun isId() = resType == "id"
-}
\ No newline at end of file
+}
+
+fun ResReference?.accessor() = this?.let { "$packageName.R.$resType.$javaIdentifier" } ?: "0"
diff --git a/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/InvalidXmlTest.kt b/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/InvalidXmlTest.kt
index 45f5981..9e79db1 100644
--- a/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/InvalidXmlTest.kt
+++ b/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/InvalidXmlTest.kt
@@ -23,7 +23,6 @@
import androidx.navigation.safe.args.generator.NavParserErrors.invalidDefaultValueReference
import androidx.navigation.safe.args.generator.NavParserErrors.invalidId
import androidx.navigation.safe.args.generator.NavParserErrors.invalidNavReference
-import androidx.navigation.safe.args.generator.NavParserErrors.nullDefaultValueReference
import androidx.navigation.safe.args.generator.NavParserErrors.sameSanitizedNameActions
import androidx.navigation.safe.args.generator.NavParserErrors.sameSanitizedNameArguments
import androidx.navigation.safe.args.generator.NavParserErrors.typeIsNotNullable
@@ -45,8 +44,6 @@
ErrorMessage("unnamed_destination_with_action.xml", 25, 5, UNNAMED_DESTINATION),
ErrorMessage("invalid_default_value_reference.xml", 23, 9,
invalidDefaultValueReference("foo/")),
- ErrorMessage("null_default_value_reference.xml", 23, 9,
- nullDefaultValueReference("myarg1")),
ErrorMessage("invalid_default_value_int.xml", 24, 9,
invalidDefaultValue("101034f", IntType)),
ErrorMessage("invalid_id_action.xml", 22, 44, invalidId("@+fppid/finish")),
diff --git a/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/JavaNavWriterTest.kt b/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/JavaNavWriterTest.kt
index 7c43326..80abde5 100644
--- a/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/JavaNavWriterTest.kt
+++ b/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/JavaNavWriterTest.kt
@@ -67,10 +67,10 @@
private fun assertCompilesWithoutError(javaFileObject: JavaFileObject) {
JavaSourcesSubject.assertThat(
loadSourceFileObject("a.b.R", "a/b"),
- JavaFileObjects.forSourceString("androidx.annotation.NonNull",
- "package androidx.annotation; public @interface NonNull {}"),
- JavaFileObjects.forSourceString("androidx.annotation.Nullable",
- "package androidx.annotation; public @interface Nullable {}"),
+ JavaFileObjects.forSourceString("android.support.annotation.NonNull",
+ "package android.support.annotation; public @interface NonNull {}"),
+ JavaFileObjects.forSourceString("android.support.annotation.Nullable",
+ "package android.support.annotation; public @interface Nullable {}"),
javaFileObject
).compilesWithoutError()
}
@@ -80,10 +80,10 @@
private fun compileFiles(vararg javaFileObject: JavaFileObject) = javac()
.compile(loadSourceFileObject("a.b.R", "a/b"),
- JavaFileObjects.forSourceString("androidx.annotation.NonNull",
- "package androidx.annotation; public @interface NonNull {}"),
- JavaFileObjects.forSourceString("androidx.annotation.Nullable",
- "package androidx.annotation; public @interface Nullable {}"),
+ JavaFileObjects.forSourceString("android.support.annotation.NonNull",
+ "package android.support.annotation; public @interface NonNull {}"),
+ JavaFileObjects.forSourceString("android.support.annotation.Nullable",
+ "package android.support.annotation; public @interface Nullable {}"),
*javaFileObject)
@Test
@@ -103,11 +103,7 @@
Argument(
"parcelable",
ObjectType("android.content.pm.ActivityInfo")
- ),
- Argument(
- "innerData",
- ObjectType("android.content.pm.ActivityInfo\$WindowLayout")
- ))), true)
+ ))), false)
val actual = toJavaFileObject(actionSpec)
JavaSourcesSubject.assertThat(actual).parsesAs("a.b.Next")
// actions spec must be inner class to be compiled, because of static modifier on class
@@ -116,7 +112,7 @@
@Test
fun testDirectionNoIdClassGeneration() {
- val actionSpec = generateDirectionsTypeSpec(Action(id("finish"), null, emptyList()), true)
+ val actionSpec = generateDirectionsTypeSpec(Action(id("finish"), null, emptyList()), false)
val actual = toJavaFileObject(actionSpec)
JavaSourcesSubject.assertThat(actual).parsesAs("a.b.Finish")
// actions spec must be inner class to be compiled, because of static modifier on class
@@ -138,7 +134,7 @@
val dest = Destination(null, ClassName.get("a.b", "MainFragment"), "fragment", listOf(),
listOf(prevAction, nextAction))
- val actual = generateDirectionsCodeFile(dest, emptyList(), true).toJavaFileObject()
+ val actual = generateDirectionsCodeFile(dest, emptyList(), false).toJavaFileObject()
JavaSourcesSubject.assertThat(actual).parsesAs("a.b.MainFragmentDirections")
assertCompilesWithoutError(actual)
}
@@ -158,7 +154,7 @@
val dest = Destination(null, ClassName.get("a.b", "SanitizedMainFragment"),
"fragment", listOf(), listOf(prevAction, nextAction))
- val actual = generateDirectionsCodeFile(dest, emptyList(), true).toJavaFileObject()
+ val actual = generateDirectionsCodeFile(dest, emptyList(), false).toJavaFileObject()
JavaSourcesSubject.assertThat(actual).parsesAs("a.b.SanitizedMainFragmentDirections")
assertCompilesWithoutError(actual)
}
@@ -170,7 +166,6 @@
Argument("optional", IntType, IntValue("-1")),
Argument("reference", ReferenceType, ReferenceValue(ResReference("a.b", "drawable",
"background"))),
- Argument("referenceZeroDefaultValue", ReferenceType, IntValue("0")),
Argument("floatArg", FloatType, FloatValue("1")),
Argument("floatArrayArg", FloatArrayType),
Argument("objectArrayArg", ObjectArrayType(
@@ -190,7 +185,7 @@
)),
listOf())
- val actual = generateArgsCodeFile(dest, true).toJavaFileObject()
+ val actual = generateArgsCodeFile(dest, false).toJavaFileObject()
JavaSourcesSubject.assertThat(actual).parsesAs("a.b.MainFragmentArgs")
assertCompilesWithoutError(actual)
}
@@ -204,7 +199,7 @@
Argument("name with spaces", IntType)),
listOf())
- val actual = generateArgsCodeFile(dest, true).toJavaFileObject()
+ val actual = generateArgsCodeFile(dest, false).toJavaFileObject()
JavaSourcesSubject.assertThat(actual).parsesAs("a.b.SanitizedMainFragmentArgs")
assertCompilesWithoutError(actual)
}
@@ -216,7 +211,7 @@
Argument("mainArg", StringType)),
listOf())
- val actual = generateArgsCodeFile(dest, true).toJavaFileObject()
+ val actual = generateArgsCodeFile(dest, false).toJavaFileObject()
JavaSourcesSubject.assertThat(actual).parsesAs("a.b.MainFragment\$InnerFragmentArgs")
assertCompilesWithoutError(actual)
}
@@ -227,7 +222,7 @@
val dest = Destination(null, ClassName.get("a.b", "MainFragment"), "fragment", listOf(),
listOf(nextAction))
- val actual = generateDirectionsCodeFile(dest, emptyList(), true).toJavaFileObject()
+ val actual = generateDirectionsCodeFile(dest, emptyList(), false).toJavaFileObject()
val generatedFiles = compileFiles(actual).generatedFiles()
val loader = InMemoryGeneratedClassLoader(generatedFiles)
@@ -250,7 +245,7 @@
val dest = Destination(null, ClassName.get("a.b", "MainFragment"), "fragment", listOf(),
listOf(nextAction))
- val actual = generateDirectionsCodeFile(dest, emptyList(), true).toJavaFileObject()
+ val actual = generateDirectionsCodeFile(dest, emptyList(), false).toJavaFileObject()
val generatedFiles = compileFiles(actual).generatedFiles()
val loader = InMemoryGeneratedClassLoader(generatedFiles)
diff --git a/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt b/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt
index dfc2b93..ff29f76 100644
--- a/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt
+++ b/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.kt
@@ -79,10 +79,6 @@
Argument(
"parcelable",
ObjectType("android.content.pm.ActivityInfo")
- ),
- Argument(
- "innerData",
- ObjectType("android.content.pm.ActivityInfo\$WindowLayout")
)))
val actual = generateDirectionsTypeSpec(action, false)
assertThat(wrappedInnerClass(actual).toString()).parsesAs("a.b.Next")
@@ -106,25 +102,12 @@
}
@Test
- fun testDirectionsClassGeneration_withKeywordId() {
- val funAction = Action(ResReference("fun.is.in", "id", "next"), id("destA"),
- listOf())
-
- val dest = Destination(null, ClassName.get("a.b", "FunFragment"), "fragment", listOf(),
- listOf(funAction))
-
- val actual = generateDirectionsCodeFile(dest, emptyList(), false)
- assertThat(actual.toString()).parsesAs("a.b.FunFragmentDirections")
- }
-
- @Test
fun testArgumentsClassGeneration() {
val dest = Destination(null, ClassName.get("a.b", "MainFragment"), "fragment", listOf(
Argument("main", StringType),
Argument("optional", IntType, IntValue("-1")),
Argument("reference", ReferenceType, ReferenceValue(ResReference("a.b", "drawable",
"background"))),
- Argument("referenceZeroDefaultValue", ReferenceType, IntValue("0")),
Argument("floatArg", FloatType, FloatValue("1")),
Argument("floatArrayArg", FloatArrayType),
Argument("objectArrayArg", ObjectArrayType("android.content.pm.ActivityInfo")),
diff --git a/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavGeneratorTest.kt b/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavGeneratorTest.kt
index 401dbe6..18ada33 100644
--- a/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavGeneratorTest.kt
+++ b/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavGeneratorTest.kt
@@ -49,7 +49,7 @@
applicationId = applicationId,
navigationXml = navigationXml,
outputDir = outputDir,
- useAndroidX = true,
+ useAndroidX = false,
generateKotlin = generateKotlin
).generate()
diff --git a/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt b/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
index 4b189bd..47f2a68 100644
--- a/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
+++ b/navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
@@ -47,7 +47,6 @@
Argument("myarg2", StringType),
Argument("randomArgument", StringType),
Argument("intArgument", IntType, IntValue("261")),
- Argument("referenceZeroDefaultValue", ReferenceType, IntValue("0")),
Argument(
"activityInfo",
ObjectType("android.content.pm.ActivityInfo")
@@ -75,10 +74,6 @@
Argument(
"objectRelativeArg2",
ObjectType("a.b.ClassName")
- ),
- Argument(
- "objectRelativeArg3",
- ObjectType("a.b.OuterClass\$InnerClass")
)
))))
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Finish.java b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Finish.java
index 002857f..9d57602 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Finish.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Finish.java
@@ -17,7 +17,7 @@
package a.b;
import android.os.Bundle;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.NavDirections;
import java.lang.Object;
import java.lang.Override;
@@ -41,7 +41,7 @@
@Override
public int getActionId() {
- return R.id.finish;
+ return a.b.R.id.finish;
}
@Override
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragment$InnerFragmentArgs.java b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragment$InnerFragmentArgs.java
index 0cbb576..e0b0ffa 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragment$InnerFragmentArgs.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragment$InnerFragmentArgs.java
@@ -17,7 +17,7 @@
package a.b;
import android.os.Bundle;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.NavArgs;
import java.lang.IllegalArgumentException;
import java.lang.Object;
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentArgs.java b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
index 7b6879f..54d6a4d 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
@@ -19,8 +19,8 @@
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.os.Parcelable;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import androidx.navigation.NavArgs;
import java.io.Serializable;
import java.lang.IllegalArgumentException;
@@ -28,7 +28,6 @@
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
-import java.lang.System;
import java.nio.file.AccessMode;
import java.util.HashMap;
@@ -67,11 +66,6 @@
reference = bundle.getInt("reference");
__result.arguments.put("reference", reference);
}
- if (bundle.containsKey("referenceZeroDefaultValue")) {
- int referenceZeroDefaultValue;
- referenceZeroDefaultValue = bundle.getInt("referenceZeroDefaultValue");
- __result.arguments.put("referenceZeroDefaultValue", referenceZeroDefaultValue);
- }
if (bundle.containsKey("floatArg")) {
float floatArg;
floatArg = bundle.getFloat("floatArg");
@@ -89,13 +83,7 @@
}
if (bundle.containsKey("objectArrayArg")) {
ActivityInfo[] objectArrayArg;
- Parcelable[] __array = bundle.getParcelableArray("objectArrayArg");
- if (__array != null) {
- objectArrayArg = new ActivityInfo[__array.length];
- System.arraycopy(__array, 0, objectArrayArg, 0, __array.length);
- } else {
- objectArrayArg = null;
- }
+ objectArrayArg = (ActivityInfo[]) bundle.getParcelableArray("objectArrayArg");
if (objectArrayArg == null) {
throw new IllegalArgumentException("Argument \"objectArrayArg\" is marked as non-null but was passed a null value.");
}
@@ -149,11 +137,6 @@
}
@SuppressWarnings("unchecked")
- public int getReferenceZeroDefaultValue() {
- return (int) arguments.get("referenceZeroDefaultValue");
- }
-
- @SuppressWarnings("unchecked")
public float getFloatArg() {
return (float) arguments.get("floatArg");
}
@@ -203,10 +186,6 @@
int reference = (int) arguments.get("reference");
__result.putInt("reference", reference);
}
- if (arguments.containsKey("referenceZeroDefaultValue")) {
- int referenceZeroDefaultValue = (int) arguments.get("referenceZeroDefaultValue");
- __result.putInt("referenceZeroDefaultValue", referenceZeroDefaultValue);
- }
if (arguments.containsKey("floatArg")) {
float floatArg = (float) arguments.get("floatArg");
__result.putFloat("floatArg", floatArg);
@@ -273,12 +252,6 @@
if (getReference() != that.getReference()) {
return false;
}
- if (arguments.containsKey("referenceZeroDefaultValue") != that.arguments.containsKey("referenceZeroDefaultValue")) {
- return false;
- }
- if (getReferenceZeroDefaultValue() != that.getReferenceZeroDefaultValue()) {
- return false;
- }
if (arguments.containsKey("floatArg") != that.arguments.containsKey("floatArg")) {
return false;
}
@@ -324,7 +297,6 @@
result = 31 * result + (getMain() != null ? getMain().hashCode() : 0);
result = 31 * result + getOptional();
result = 31 * result + getReference();
- result = 31 * result + getReferenceZeroDefaultValue();
result = 31 * result + Float.floatToIntBits(getFloatArg());
result = 31 * result + java.util.Arrays.hashCode(getFloatArrayArg());
result = 31 * result + java.util.Arrays.hashCode(getObjectArrayArg());
@@ -340,7 +312,6 @@
+ "main=" + getMain()
+ ", optional=" + getOptional()
+ ", reference=" + getReference()
- + ", referenceZeroDefaultValue=" + getReferenceZeroDefaultValue()
+ ", floatArg=" + getFloatArg()
+ ", floatArrayArg=" + getFloatArrayArg()
+ ", objectArrayArg=" + getObjectArrayArg()
@@ -401,12 +372,6 @@
}
@NonNull
- public Builder setReferenceZeroDefaultValue(int referenceZeroDefaultValue) {
- this.arguments.put("referenceZeroDefaultValue", referenceZeroDefaultValue);
- return this;
- }
-
- @NonNull
public Builder setFloatArg(float floatArg) {
this.arguments.put("floatArg", floatArg);
return this;
@@ -468,11 +433,6 @@
}
@SuppressWarnings("unchecked")
- public int getReferenceZeroDefaultValue() {
- return (int) arguments.get("referenceZeroDefaultValue");
- }
-
- @SuppressWarnings("unchecked")
public float getFloatArg() {
return (float) arguments.get("floatArg");
}
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentDirections.java
index 22eb5ba..2458abd 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentDirections.java
@@ -17,7 +17,7 @@
package a.b;
import android.os.Bundle;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.NavDirections;
import java.lang.IllegalArgumentException;
import java.lang.Object;
@@ -90,7 +90,7 @@
@Override
public int getActionId() {
- return R.id.previous;
+ return a.b.R.id.previous;
}
@SuppressWarnings("unchecked")
@@ -196,7 +196,7 @@
@Override
public int getActionId() {
- return R.id.next;
+ return a.b.R.id.next;
}
@SuppressWarnings("unchecked")
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Next.java b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Next.java
index 9ae28b2..0dc2b36 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Next.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Next.java
@@ -19,8 +19,8 @@
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.os.Parcelable;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import androidx.navigation.NavDirections;
import java.io.Serializable;
import java.lang.IllegalArgumentException;
@@ -33,8 +33,7 @@
public static class Next implements NavDirections {
private final HashMap arguments = new HashMap();
- private Next(@NonNull String main, int mainInt, @NonNull ActivityInfo parcelable,
- @NonNull ActivityInfo.WindowLayout innerData) {
+ private Next(@NonNull String main, int mainInt, @NonNull ActivityInfo parcelable) {
if (main == null) {
throw new IllegalArgumentException("Argument \"main\" is marked as non-null but was passed a null value.");
}
@@ -44,10 +43,6 @@
throw new IllegalArgumentException("Argument \"parcelable\" is marked as non-null but was passed a null value.");
}
this.arguments.put("parcelable", parcelable);
- if (innerData == null) {
- throw new IllegalArgumentException("Argument \"innerData\" is marked as non-null but was passed a null value.");
- }
- this.arguments.put("innerData", innerData);
}
@NonNull
@@ -95,15 +90,6 @@
return this;
}
- @NonNull
- public Next setInnerData(@NonNull ActivityInfo.WindowLayout innerData) {
- if (innerData == null) {
- throw new IllegalArgumentException("Argument \"innerData\" is marked as non-null but was passed a null value.");
- }
- this.arguments.put("innerData", innerData);
- return this;
- }
-
@Override
@SuppressWarnings("unchecked")
@NonNull
@@ -145,22 +131,12 @@
throw new UnsupportedOperationException(ActivityInfo.class.getName() + " must implement Parcelable or Serializable or must be an Enum.");
}
}
- if (arguments.containsKey("innerData")) {
- ActivityInfo.WindowLayout innerData = (ActivityInfo.WindowLayout) arguments.get("innerData");
- if (Parcelable.class.isAssignableFrom(ActivityInfo.WindowLayout.class) || innerData == null) {
- __result.putParcelable("innerData", Parcelable.class.cast(innerData));
- } else if (Serializable.class.isAssignableFrom(ActivityInfo.WindowLayout.class)) {
- __result.putSerializable("innerData", Serializable.class.cast(innerData));
- } else {
- throw new UnsupportedOperationException(ActivityInfo.WindowLayout.class.getName() + " must implement Parcelable or Serializable or must be an Enum.");
- }
- }
return __result;
}
@Override
public int getActionId() {
- return R.id.next;
+ return a.b.R.id.next;
}
@SuppressWarnings("unchecked")
@@ -197,12 +173,6 @@
return (ActivityInfo) arguments.get("parcelable");
}
- @SuppressWarnings("unchecked")
- @NonNull
- public ActivityInfo.WindowLayout getInnerData() {
- return (ActivityInfo.WindowLayout) arguments.get("innerData");
- }
-
@Override
public boolean equals(Object object) {
if (this == object) {
@@ -248,12 +218,6 @@
if (getParcelable() != null ? !getParcelable().equals(that.getParcelable()) : that.getParcelable() != null) {
return false;
}
- if (arguments.containsKey("innerData") != that.arguments.containsKey("innerData")) {
- return false;
- }
- if (getInnerData() != null ? !getInnerData().equals(that.getInnerData()) : that.getInnerData() != null) {
- return false;
- }
if (getActionId() != that.getActionId()) {
return false;
}
@@ -269,7 +233,6 @@
result = 31 * result + getOptionalInt();
result = 31 * result + (getOptionalParcelable() != null ? getOptionalParcelable().hashCode() : 0);
result = 31 * result + (getParcelable() != null ? getParcelable().hashCode() : 0);
- result = 31 * result + (getInnerData() != null ? getInnerData().hashCode() : 0);
result = 31 * result + getActionId();
return result;
}
@@ -283,7 +246,6 @@
+ ", optionalInt=" + getOptionalInt()
+ ", optionalParcelable=" + getOptionalParcelable()
+ ", parcelable=" + getParcelable()
- + ", innerData=" + getInnerData()
+ "}";
}
}
\ No newline at end of file
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentArgs.java b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentArgs.java
index d1f5255..6ac1b9b 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentArgs.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentArgs.java
@@ -17,7 +17,7 @@
package a.b;
import android.os.Bundle;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.NavArgs;
import java.lang.IllegalArgumentException;
import java.lang.Object;
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentDirections.java
index 31e6442..c0d9eb0 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentDirections.java
@@ -17,7 +17,7 @@
package a.b;
import android.os.Bundle;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.NavDirections;
import java.lang.IllegalArgumentException;
import java.lang.Object;
@@ -90,7 +90,7 @@
@Override
public int getActionId() {
- return R.id.previous_action;
+ return a.b.R.id.previous_action;
}
@SuppressWarnings("unchecked")
@@ -196,7 +196,7 @@
@Override
public int getActionId() {
- return R.id.next_action;
+ return a.b.R.id.next_action;
}
@SuppressWarnings("unchecked")
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/FunFragmentDirections.kt b/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/FunFragmentDirections.kt
deleted file mode 100644
index 6e436de..0000000
--- a/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/FunFragmentDirections.kt
+++ /dev/null
@@ -1,11 +0,0 @@
-package a.b
-
-import androidx.navigation.ActionOnlyNavDirections
-import androidx.navigation.NavDirections
-import `fun`.`is`.`in`.R
-
-class FunFragmentDirections private constructor() {
- companion object {
- fun next(): NavDirections = ActionOnlyNavDirections(R.id.next)
- }
-}
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentArgs.kt b/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentArgs.kt
index bd64a06..f87f02b 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentArgs.kt
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentArgs.kt
@@ -20,8 +20,7 @@
data class MainFragmentArgs(
val main: String,
val optional: Int = -1,
- val reference: Int = R.drawable.background,
- val referenceZeroDefaultValue: Int = 0,
+ val reference: Int = a.b.R.drawable.background,
val floatArg: Float = 1F,
val floatArrayArg: FloatArray,
val objectArrayArg: Array<ActivityInfo>,
@@ -35,7 +34,6 @@
result.putString("main", this.main)
result.putInt("optional", this.optional)
result.putInt("reference", this.reference)
- result.putInt("referenceZeroDefaultValue", this.referenceZeroDefaultValue)
result.putFloat("floatArg", this.floatArg)
result.putFloatArray("floatArrayArg", this.floatArrayArg)
result.putParcelableArray("objectArrayArg", this.objectArrayArg)
@@ -77,13 +75,7 @@
if (bundle.containsKey("reference")) {
__reference = bundle.getInt("reference")
} else {
- __reference = R.drawable.background
- }
- val __referenceZeroDefaultValue : Int
- if (bundle.containsKey("referenceZeroDefaultValue")) {
- __referenceZeroDefaultValue = bundle.getInt("referenceZeroDefaultValue")
- } else {
- __referenceZeroDefaultValue = 0
+ __reference = a.b.R.drawable.background
}
val __floatArg : Float
if (bundle.containsKey("floatArg")) {
@@ -102,8 +94,8 @@
}
val __objectArrayArg : Array<ActivityInfo>?
if (bundle.containsKey("objectArrayArg")) {
- __objectArrayArg = bundle.getParcelableArray("objectArrayArg")?.map { it as
- ActivityInfo }?.toTypedArray()
+ __objectArrayArg = bundle.getParcelableArray("objectArrayArg") as
+ Array<ActivityInfo>?
if (__objectArrayArg == null) {
throw IllegalArgumentException("Argument \"objectArrayArg\" is marked as non-null but was passed a null value.")
}
@@ -143,9 +135,8 @@
} else {
__enumArg = AccessMode.READ
}
- return MainFragmentArgs(__main, __optional, __reference, __referenceZeroDefaultValue,
- __floatArg, __floatArrayArg, __objectArrayArg, __boolArg, __optionalParcelable,
- __enumArg)
+ return MainFragmentArgs(__main, __optional, __reference, __floatArg, __floatArrayArg,
+ __objectArrayArg, __boolArg, __optionalParcelable, __enumArg)
}
}
}
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentDirections.kt b/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentDirections.kt
index 8c145c70..fb4dc00 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentDirections.kt
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/MainFragmentDirections.kt
@@ -8,7 +8,7 @@
class MainFragmentDirections private constructor() {
private data class Next(val main: String, val optional: String = "bla") : NavDirections {
- override fun getActionId(): Int = R.id.next
+ override fun getActionId(): Int = a.b.R.id.next
override fun getArguments(): Bundle {
val result = Bundle()
@@ -19,7 +19,7 @@
}
companion object {
- fun previous(): NavDirections = ActionOnlyNavDirections(R.id.previous)
+ fun previous(): NavDirections = ActionOnlyNavDirections(a.b.R.id.previous)
fun next(main: String, optional: String = "bla"): NavDirections = Next(main, optional)
}
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/Next.kt b/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/Next.kt
index e34db4c..1bc3186 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/Next.kt
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/Next.kt
@@ -16,10 +16,9 @@
val optional: String = "bla",
val optionalInt: Int = 239,
val optionalParcelable: ActivityInfo? = null,
- val parcelable: ActivityInfo,
- val innerData: ActivityInfo.WindowLayout
+ val parcelable: ActivityInfo
) : NavDirections {
- override fun getActionId(): Int = R.id.next
+ override fun getActionId(): Int = a.b.R.id.next
@Suppress("CAST_NEVER_SUCCEEDS")
override fun getArguments(): Bundle {
@@ -41,15 +40,6 @@
throw UnsupportedOperationException(ActivityInfo::class.java.name +
" must implement Parcelable or Serializable or must be an Enum.")
}
- if (Parcelable::class.java.isAssignableFrom(ActivityInfo.WindowLayout::class.java)) {
- result.putParcelable("innerData", this.innerData as Parcelable)
- } else if (Serializable::class.java.isAssignableFrom(ActivityInfo.WindowLayout::class.java))
- {
- result.putSerializable("innerData", this.innerData as Serializable)
- } else {
- throw UnsupportedOperationException(ActivityInfo.WindowLayout::class.java.name +
- " must implement Parcelable or Serializable or must be an Enum.")
- }
return result
}
}
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginDirections.java
index b5e6405..34b0942 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginDirections.java
@@ -16,7 +16,7 @@
package foo;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.ActionOnlyNavDirections;
import androidx.navigation.NavDirections;
@@ -26,6 +26,6 @@
@NonNull
public static NavDirections actionDone() {
- return new ActionOnlyNavDirections(R.id.action_done);
+ return new ActionOnlyNavDirections(foo.R.id.action_done);
}
}
\ No newline at end of file
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginFragmentDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginFragmentDirections.java
index 1a00200..205821f 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginFragmentDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginFragmentDirections.java
@@ -16,11 +16,10 @@
package foo.flavor.account;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.ActionOnlyNavDirections;
import androidx.navigation.NavDirections;
import foo.LoginDirections;
-import foo.R;
public class LoginFragmentDirections {
private LoginFragmentDirections() {
@@ -28,7 +27,7 @@
@NonNull
public static NavDirections register() {
- return new ActionOnlyNavDirections(R.id.register);
+ return new ActionOnlyNavDirections(foo.R.id.register);
}
@NonNull
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/MainFragmentDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/MainFragmentDirections.java
index c837bd0..eb6e76c 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/MainFragmentDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/MainFragmentDirections.java
@@ -16,10 +16,10 @@
package foo.flavor;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
+
import androidx.navigation.ActionOnlyNavDirections;
import androidx.navigation.NavDirections;
-import foo.R;
public class MainFragmentDirections {
private MainFragmentDirections() {
@@ -27,6 +27,6 @@
@NonNull
public static NavDirections startLogin() {
- return new ActionOnlyNavDirections(R.id.start_login);
+ return new ActionOnlyNavDirections(foo.R.id.start_login);
}
}
\ No newline at end of file
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/RegisterFragmentDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/RegisterFragmentDirections.java
index 15d65c6..c891f73 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/RegisterFragmentDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/RegisterFragmentDirections.java
@@ -16,7 +16,7 @@
package foo.flavor.account;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.NavDirections;
import foo.LoginDirections;
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsDirections.java
index f01ad0e1..606e6a8 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsDirections.java
@@ -1,7 +1,7 @@
package foo;
import android.os.Bundle;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.NavDirections;
import java.lang.Object;
import java.lang.Override;
@@ -50,7 +50,7 @@
@Override
public int getActionId() {
- return R.id.exit;
+ return foo.R.id.exit;
}
@SuppressWarnings("unchecked")
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsFragmentDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsFragmentDirections.java
index 2d77d65..e0d99b6 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsFragmentDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsFragmentDirections.java
@@ -16,7 +16,7 @@
package foo.flavor;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import foo.InnerSettingsDirections;
import foo.SettingsDirections;
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/MainFragmentDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/MainFragmentDirections.java
index c837bd0..87381e5 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/MainFragmentDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/MainFragmentDirections.java
@@ -16,10 +16,9 @@
package foo.flavor;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.ActionOnlyNavDirections;
import androidx.navigation.NavDirections;
-import foo.R;
public class MainFragmentDirections {
private MainFragmentDirections() {
@@ -27,6 +26,6 @@
@NonNull
public static NavDirections startLogin() {
- return new ActionOnlyNavDirections(R.id.start_login);
+ return new ActionOnlyNavDirections(foo.R.id.start_login);
}
}
\ No newline at end of file
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsDirections.java
index d181b36..5cf1251 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsDirections.java
@@ -1,7 +1,7 @@
package foo;
import android.os.Bundle;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.NavDirections;
import java.lang.IllegalArgumentException;
import java.lang.Object;
@@ -53,7 +53,7 @@
@Override
public int getActionId() {
- return R.id.main;
+ return foo.R.id.main;
}
@SuppressWarnings("unchecked")
@@ -128,7 +128,7 @@
@Override
public int getActionId() {
- return R.id.exit;
+ return foo.R.id.exit;
}
@SuppressWarnings("unchecked")
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsFragmentDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsFragmentDirections.java
index ac7c9c8..fbeb0ed 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsFragmentDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsFragmentDirections.java
@@ -1,6 +1,6 @@
package foo.flavor;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import foo.SettingsDirections;
public class SettingsFragmentDirections {
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/MainFragmentDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/MainFragmentDirections.java
index c837bd0..87381e5 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/MainFragmentDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/MainFragmentDirections.java
@@ -16,10 +16,9 @@
package foo.flavor;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.ActionOnlyNavDirections;
import androidx.navigation.NavDirections;
-import foo.R;
public class MainFragmentDirections {
private MainFragmentDirections() {
@@ -27,6 +26,6 @@
@NonNull
public static NavDirections startLogin() {
- return new ActionOnlyNavDirections(R.id.start_login);
+ return new ActionOnlyNavDirections(foo.R.id.start_login);
}
}
\ No newline at end of file
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsDirections.java
index 9ee1224..2bad2e5 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsDirections.java
@@ -1,7 +1,7 @@
package foo;
import android.os.Bundle;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.NavDirections;
import java.lang.IllegalArgumentException;
import java.lang.Object;
@@ -48,7 +48,7 @@
@Override
public int getActionId() {
- return R.id.exit;
+ return foo.R.id.exit;
}
@SuppressWarnings("unchecked")
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsFragmentDirections.java b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsFragmentDirections.java
index 6a55a1e..d51ae43 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsFragmentDirections.java
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsFragmentDirections.java
@@ -1,9 +1,8 @@
package foo.flavor;
import android.os.Bundle;
-import androidx.annotation.NonNull;
+import android.support.annotation.NonNull;
import androidx.navigation.NavDirections;
-import foo.R;
import java.lang.IllegalArgumentException;
import java.lang.Object;
import java.lang.Override;
@@ -49,7 +48,7 @@
@Override
public int getActionId() {
- return R.id.exit;
+ return foo.R.id.exit;
}
@SuppressWarnings("unchecked")
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginDirections.kt b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginDirections.kt
index 1424713..7d81998 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginDirections.kt
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginDirections.kt
@@ -5,6 +5,6 @@
class LoginDirections private constructor() {
companion object {
- fun actionDone(): NavDirections = ActionOnlyNavDirections(R.id.action_done)
+ fun actionDone(): NavDirections = ActionOnlyNavDirections(foo.R.id.action_done)
}
}
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginFragmentDirections.kt b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginFragmentDirections.kt
index 1b2573f..e7f1807 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginFragmentDirections.kt
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginFragmentDirections.kt
@@ -3,11 +3,10 @@
import androidx.navigation.ActionOnlyNavDirections
import androidx.navigation.NavDirections
import foo.LoginDirections
-import foo.R
class LoginFragmentDirections private constructor() {
companion object {
- fun register(): NavDirections = ActionOnlyNavDirections(R.id.register)
+ fun register(): NavDirections = ActionOnlyNavDirections(foo.R.id.register)
fun actionDone(): NavDirections = LoginDirections.actionDone()
}
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/MainFragmentDirections.kt b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/MainFragmentDirections.kt
index 73b4521..61468f4 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/MainFragmentDirections.kt
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/MainFragmentDirections.kt
@@ -2,10 +2,9 @@
import androidx.navigation.ActionOnlyNavDirections
import androidx.navigation.NavDirections
-import foo.R
class MainFragmentDirections private constructor() {
companion object {
- fun startLogin(): NavDirections = ActionOnlyNavDirections(R.id.start_login)
+ fun startLogin(): NavDirections = ActionOnlyNavDirections(foo.R.id.start_login)
}
}
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsDirections.kt b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsDirections.kt
index bd9f40d..2120491 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsDirections.kt
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsDirections.kt
@@ -7,7 +7,7 @@
class InnerSettingsDirections private constructor() {
private data class Exit(val exitReason: Int) : NavDirections {
- override fun getActionId(): Int = R.id.exit
+ override fun getActionId(): Int = foo.R.id.exit
override fun getArguments(): Bundle {
val result = Bundle()
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/MainFragmentDirections.kt b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/MainFragmentDirections.kt
index 73b4521..61468f4 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/MainFragmentDirections.kt
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/MainFragmentDirections.kt
@@ -2,10 +2,9 @@
import androidx.navigation.ActionOnlyNavDirections
import androidx.navigation.NavDirections
-import foo.R
class MainFragmentDirections private constructor() {
companion object {
- fun startLogin(): NavDirections = ActionOnlyNavDirections(R.id.start_login)
+ fun startLogin(): NavDirections = ActionOnlyNavDirections(foo.R.id.start_login)
}
}
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsDirections.kt b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsDirections.kt
index de717df..89b1b44 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsDirections.kt
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsDirections.kt
@@ -7,7 +7,7 @@
class SettingsDirections private constructor() {
private data class Main(val enterReason: String = "DEFAULT") : NavDirections {
- override fun getActionId(): Int = R.id.main
+ override fun getActionId(): Int = foo.R.id.main
override fun getArguments(): Bundle {
val result = Bundle()
@@ -17,7 +17,7 @@
}
private data class Exit(val exitReason: String = "DEFAULT") : NavDirections {
- override fun getActionId(): Int = R.id.exit
+ override fun getActionId(): Int = foo.R.id.exit
override fun getArguments(): Bundle {
val result = Bundle()
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/MainFragmentDirections.kt b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/MainFragmentDirections.kt
index 73b4521..61468f4 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/MainFragmentDirections.kt
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/MainFragmentDirections.kt
@@ -2,10 +2,9 @@
import androidx.navigation.ActionOnlyNavDirections
import androidx.navigation.NavDirections
-import foo.R
class MainFragmentDirections private constructor() {
companion object {
- fun startLogin(): NavDirections = ActionOnlyNavDirections(R.id.start_login)
+ fun startLogin(): NavDirections = ActionOnlyNavDirections(foo.R.id.start_login)
}
}
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsDirections.kt b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsDirections.kt
index 4f467db..04d0053 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsDirections.kt
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsDirections.kt
@@ -7,7 +7,7 @@
class SettingsDirections private constructor() {
private data class Exit(val exitReason: String = "DEFAULT") : NavDirections {
- override fun getActionId(): Int = R.id.exit
+ override fun getActionId(): Int = foo.R.id.exit
override fun getArguments(): Bundle {
val result = Bundle()
diff --git a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsFragmentDirections.kt b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsFragmentDirections.kt
index b943ff1..daa4110 100644
--- a/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsFragmentDirections.kt
+++ b/navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_same_action/SettingsFragmentDirections.kt
@@ -2,13 +2,12 @@
import android.os.Bundle
import androidx.navigation.NavDirections
-import foo.R
import kotlin.Int
import kotlin.String
class SettingsFragmentDirections private constructor() {
private data class Exit(val exitReason: String = "DIFFERENT") : NavDirections {
- override fun getActionId(): Int = R.id.exit
+ override fun getActionId(): Int = foo.R.id.exit
override fun getArguments(): Bundle {
val result = Bundle()
diff --git a/navigation/safe-args-generator/src/tests/test-data/invalid_xmls/null_default_value_reference.xml b/navigation/safe-args-generator/src/tests/test-data/invalid_xmls/null_default_value_reference.xml
deleted file mode 100644
index f3c9597..0000000
--- a/navigation/safe-args-generator/src/tests/test-data/invalid_xmls/null_default_value_reference.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-<navigation xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/foo"
- app:startDestination="@+id/first_screen">
- <fragment android:name="a.FakeFragment">
- <argument android:name="myarg1" android:defaultValue="@null" app:argType="reference" />
- </fragment>
-</navigation>
\ No newline at end of file
diff --git a/navigation/safe-args-generator/src/tests/test-data/naive_test.xml b/navigation/safe-args-generator/src/tests/test-data/naive_test.xml
index b7d25438..34654d2 100644
--- a/navigation/safe-args-generator/src/tests/test-data/naive_test.xml
+++ b/navigation/safe-args-generator/src/tests/test-data/naive_test.xml
@@ -25,7 +25,6 @@
<argument android:name="myarg2" app:argType="string"/>
<argument android:name="randomArgument" app:argType="string"/>
<argument android:name="intArgument" app:argType="integer" android:defaultValue="261"/>
- <argument android:name="referenceZeroDefaultValue" app:argType="reference" android:defaultValue="0"/>
<argument android:name="activityInfo" app:argType="android.content.pm.ActivityInfo"/>
<argument android:name="activityInfoNull"
app:nullable="true"
@@ -39,7 +38,6 @@
android:defaultValue="READ"/>
<argument android:name="objectRelativeArg" app:argType=".pkg.ClassName"/>
<argument android:name="objectRelativeArg2" app:argType=".ClassName"/>
- <argument android:name="objectRelativeArg3" app:argType=".OuterClass$InnerClass"/>
</action>
</fragment>
<fragment android:id="@+id/next_fragment"
diff --git a/navigation/safe-args-gradle-plugin/build.gradle b/navigation/safe-args-gradle-plugin/build.gradle
index 67d3153..e916790 100644
--- a/navigation/safe-args-gradle-plugin/build.gradle
+++ b/navigation/safe-args-gradle-plugin/build.gradle
@@ -89,7 +89,6 @@
supportLibrary {
name = "Android Navigation TypeSafe Arguments Gradle Plugin"
publish = true
- toolingProject = true
mavenVersion = LibraryVersions.NAVIGATION
mavenGroup = LibraryGroups.NAVIGATION
inceptionYear = "2017"
diff --git a/navigation/safe-args-gradle-plugin/src/main/kotlin/androidx/navigation/safeargs/gradle/ArgumentsGenerationTask.kt b/navigation/safe-args-gradle-plugin/src/main/kotlin/androidx/navigation/safeargs/gradle/ArgumentsGenerationTask.kt
index 5c70bd0..2aae2bf 100644
--- a/navigation/safe-args-gradle-plugin/src/main/kotlin/androidx/navigation/safeargs/gradle/ArgumentsGenerationTask.kt
+++ b/navigation/safe-args-gradle-plugin/src/main/kotlin/androidx/navigation/safeargs/gradle/ArgumentsGenerationTask.kt
@@ -42,7 +42,7 @@
var applicationId: String? = null // null on AGP 3.3.0 and above
@get:Input
- var useAndroidX: Boolean = true
+ var useAndroidX: Boolean = false
@get:Input
var generateKotlin: Boolean = false
@@ -128,9 +128,7 @@
modified.flatMap { it.javaFiles }
.filter { name -> name !in newJavaFiles }
.forEach { javaName ->
- val fileExtension = if (generateKotlin) { ".kt" } else { ".java" }
- val fileName =
- "${javaName.replace('.', File.separatorChar)}$fileExtension"
+ val fileName = "${javaName.replace('.', File.separatorChar)}.java"
val file = File(outputDir, fileName)
if (file.exists()) {
file.delete()
diff --git a/navigation/safe-args-gradle-plugin/src/main/kotlin/androidx/navigation/safeargs/gradle/SafeArgsPlugin.kt b/navigation/safe-args-gradle-plugin/src/main/kotlin/androidx/navigation/safeargs/gradle/SafeArgsPlugin.kt
index 17587b9..5cc047c 100644
--- a/navigation/safe-args-gradle-plugin/src/main/kotlin/androidx/navigation/safeargs/gradle/SafeArgsPlugin.kt
+++ b/navigation/safe-args-gradle-plugin/src/main/kotlin/androidx/navigation/safeargs/gradle/SafeArgsPlugin.kt
@@ -26,9 +26,11 @@
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.provider.ProviderFactory
+import org.gradle.api.resources.TextResource
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import java.io.File
import javax.inject.Inject
+import kotlin.reflect.full.memberFunctions
private const val PLUGIN_DIRNAME = "navigation-args"
internal const val GENERATED_PATH = "generated/source/$PLUGIN_DIRNAME"
@@ -73,13 +75,7 @@
task.navigationFiles = navigationFiles(variant)
task.outputDir = File(project.buildDir, "$GENERATED_PATH/${variant.dirName}")
task.incrementalFolder = File(project.buildDir, "$INCREMENTAL_PATH/${task.name}")
- task.useAndroidX = (project.findProperty("android.useAndroidX") == "true").also {
- if (!it) {
- throw GradleException(
- "androidx.navigation.safeargs can only be used with an androidx project"
- )
- }
- }
+ task.useAndroidX = (project.findProperty("android.useAndroidX") == "true")
task.generateKotlin = generateKotlin
}
task.applicationIdResource?.let { task.dependsOn(it) }
@@ -89,13 +85,21 @@
/**
* Sets the android project application id into the task.
+ *
+ * Safe Args depends on AGP 3.2 which doesn't declare getApplicationIdTextResource.
+ * However, on 3.3+ getApplicationIdTextResource() is recommended and on 3.4 getApplicationId
+ * is completely deprecated and will throw. Thus the need for this method to get
+ * the app id resource via a reflection call.
*/
private fun setApplicationId(task: ArgumentsGenerationTask, variant: BaseVariant) {
- val appIdTextResource = variant.applicationIdTextResource
+ val appIdTextResource = variant::class.memberFunctions.firstOrNull {
+ it.name == "getApplicationIdTextResource"
+ }?.let {
+ it.call(variant) as TextResource
+ }
if (appIdTextResource != null) {
task.applicationIdResource = appIdTextResource
} else {
- // getApplicationIdTextResource() returned null, fallback to getApplicationId()
task.applicationId = variant.applicationId
}
}
diff --git a/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/BasePluginTest.kt b/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/BasePluginTest.kt
deleted file mode 100644
index 1fa1c19..0000000
--- a/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/BasePluginTest.kt
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright 2019 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.navigation.safeargs.gradle
-
-import org.gradle.testkit.runner.BuildResult
-import org.gradle.testkit.runner.GradleRunner
-import org.gradle.testkit.runner.TaskOutcome
-import org.hamcrest.CoreMatchers
-import org.hamcrest.MatcherAssert
-import org.hamcrest.MatcherAssert.assertThat
-import org.junit.Before
-import org.junit.Rule
-import org.junit.rules.TemporaryFolder
-import java.io.File
-import java.util.Properties
-
-internal const val MAIN_DIR = "androidx/navigation/testapp"
-
-internal const val NEXT_DIRECTIONS = "$MAIN_DIR/NextFragmentDirections"
-internal const val NEXT_ARGUMENTS = "$MAIN_DIR/NextFragmentArgs"
-internal const val MAIN_DIRECTIONS = "$MAIN_DIR/MainFragmentDirections"
-internal const val MODIFIED_NEXT_DIRECTIONS = "$MAIN_DIR/ModifiedNextFragmentDirections"
-internal const val ADDITIONAL_DIRECTIONS = "$MAIN_DIR/AdditionalFragmentDirections"
-internal const val FOO_DIRECTIONS = "$MAIN_DIR/foo/FooFragmentDirections"
-internal const val FEATURE_DIRECTIONS = "$MAIN_DIR/FeatureFragmentDirections"
-internal const val LIBRARY_DIRECTIONS = "$MAIN_DIR/LibraryFragmentDirections"
-internal const val FOO_DYNAMIC_DIRECTIONS =
- "safe/gradle/test/app/safe/app/foo/DynFooFeatureFragmentDirections"
-internal const val NOTFOO_DYNAMIC_DIRECTIONS = "$MAIN_DIR/DynFeatureFragmentDirections"
-
-internal const val NAV_RESOURCES = "src/main/res/navigation"
-internal const val SEC = 1000L
-
-abstract class BasePluginTest {
- @Suppress("MemberVisibilityCanBePrivate")
- @get:Rule
- val testProjectDir = TemporaryFolder()
-
- internal var buildFile: File = File("")
- internal var prebuiltsRepo = ""
- internal var compileSdkVersion = ""
- internal var buildToolsVersion = ""
- internal var minSdkVersion = ""
- internal var debugKeystore = ""
- internal var navigationCommon = ""
- internal var kotlinStblib = ""
-
- internal fun projectRoot(): File = testProjectDir.root
-
- internal fun assertGenerated(name: String, prefix: String? = null): File {
- return prefix?.let { assertExists(name, true, it) } ?: assertExists(name, true)
- }
-
- internal fun assertNotGenerated(name: String, prefix: String? = null): File {
- return prefix?.let { assertExists(name, false, it) } ?: assertExists(name, false)
- }
-
- internal fun assertExists(name: String, ex: Boolean, prefix: String = ""): File {
- val generatedFile = File(
- projectRoot(),
- "${prefix}build/$GENERATED_PATH/$name"
- )
- MatcherAssert.assertThat(
- generatedFile.exists(),
- CoreMatchers.`is`(ex)
- )
- return generatedFile
- }
-
- internal fun navResource(name: String) =
- File(projectRoot(), "$NAV_RESOURCES/$name")
-
- internal fun gradleBuilder(vararg args: String) = GradleRunner.create()
- .withProjectDir(projectRoot()).withPluginClasspath().withArguments(*args)
-
- internal fun runGradle(vararg args: String) = gradleBuilder(*args).build()
- internal fun runAndFailGradle(vararg args: String) = gradleBuilder(*args).buildAndFail()
-
- @Before
- fun setup() {
- projectRoot().mkdirs()
- buildFile = File(projectRoot(), "build.gradle")
- buildFile.createNewFile()
- // copy local.properties
- val appToolkitProperties = File("../../local.properties")
- if (appToolkitProperties.exists()) {
- appToolkitProperties.copyTo(
- File(projectRoot(), "local.properties"),
- overwrite = true
- )
- } else {
- File("../../local.properties").copyTo(
- File(projectRoot(), "local.properties"), overwrite = true
- )
- }
- val stream = BasePluginTest::class.java.classLoader.getResourceAsStream("sdk.prop")
- val properties = Properties()
- properties.load(stream)
- prebuiltsRepo = properties.getProperty("prebuiltsRepo")
- compileSdkVersion = properties.getProperty("compileSdkVersion")
- buildToolsVersion = properties.getProperty("buildToolsVersion")
- minSdkVersion = properties.getProperty("minSdkVersion")
- debugKeystore = properties.getProperty("debugKeystore")
- navigationCommon = properties.getProperty("navigationCommon")
- kotlinStblib = properties.getProperty("kotlinStdlib")
-
- val propertiesFile = File(projectRoot(), "gradle.properties")
- propertiesFile.writer().use {
- val props = Properties()
- props.setProperty("android.useAndroidX", "true")
- props.store(it, null)
- }
- }
-
- internal fun setupSimpleBuildGradle() {
- testData("app-project").copyRecursively(projectRoot())
- buildFile.writeText("""
- plugins {
- id('com.android.application')
- id('androidx.navigation.safeargs')
- }
-
- repositories {
- maven { url "$prebuiltsRepo/androidx/external" }
- maven { url "$prebuiltsRepo/androidx/internal" }
- }
-
- android {
- compileSdkVersion $compileSdkVersion
- buildToolsVersion "$buildToolsVersion"
-
- defaultConfig {
- minSdkVersion $minSdkVersion
- }
-
- signingConfigs {
- debug {
- storeFile file("$debugKeystore")
- }
- }
- }
-
- dependencies {
- implementation "$navigationCommon"
- }
- """.trimIndent()
- )
- }
-
- internal fun setupMultiModuleBuildGradle() {
- testData("multimodule-project").copyRecursively(projectRoot())
- buildFile.writeText("""
- buildscript {
- ext.compileSdk = $compileSdkVersion
- ext.buildTools = "$buildToolsVersion"
- ext.minSdk = $minSdkVersion
- ext.debugKeystoreFile = "$debugKeystore"
- ext.navigationCommonDep = "$navigationCommon"
- }
-
- allprojects {
- repositories {
- maven { url "$prebuiltsRepo/androidx/external" }
- maven { url "$prebuiltsRepo/androidx/internal" }
- }
- }
- """.trimIndent()
- )
- }
-
- internal fun setupSimpleKotlinBuildGradle() {
- testData("app-project-kotlin").copyRecursively(projectRoot())
- buildFile.writeText("""
- plugins {
- id('com.android.application')
- id('kotlin-android')
- id('androidx.navigation.safeargs.kotlin')
- }
-
- repositories {
- maven { url "$prebuiltsRepo/androidx/external" }
- maven { url "$prebuiltsRepo/androidx/internal" }
- }
-
- android {
- compileSdkVersion $compileSdkVersion
- buildToolsVersion "$buildToolsVersion"
-
- defaultConfig {
- minSdkVersion $minSdkVersion
- }
-
- signingConfigs {
- debug {
- storeFile file("$debugKeystore")
- }
- }
- }
-
- dependencies {
- implementation "$kotlinStblib"
- implementation "$navigationCommon"
- }
- """.trimIndent()
- )
- }
-}
-
-internal fun testData(name: String) = File("src/test/test-data", name)
-
-internal fun BuildResult.assertSuccessfulTask(name: String): BuildResult {
- assertThat(task(":$name")!!.outcome, CoreMatchers.`is`(TaskOutcome.SUCCESS))
- return this
-}
-
-internal fun BuildResult.assertFailingTask(name: String): BuildResult {
- assertThat(task(":$name")!!.outcome, CoreMatchers.`is`(TaskOutcome.FAILED))
- return this
-}
\ No newline at end of file
diff --git a/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/IncrementalPluginTest.kt b/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/IncrementalPluginTest.kt
deleted file mode 100644
index d557e1b..0000000
--- a/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/IncrementalPluginTest.kt
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright 2019 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.navigation.safeargs.gradle
-
-import org.hamcrest.CoreMatchers
-import org.hamcrest.MatcherAssert
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.Parameterized
-
-// Does not work in the Android Studio
-@RunWith(Parameterized::class)
-class IncrementalPluginTest(private val generateKotlin: Boolean) : BasePluginTest() {
-
- private val extension = if (generateKotlin) { ".kt" } else { ".java" }
-
- private fun setupBuildGradle() {
- if (generateKotlin) {
- setupSimpleKotlinBuildGradle()
- } else {
- setupSimpleBuildGradle()
- }
- }
-
- @Test
- fun incrementalAdd() {
- setupBuildGradle()
- runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
- val nextLastMod = assertGenerated("debug/$NEXT_DIRECTIONS$extension").lastModified()
-
- testData("incremental-test-data/add_nav.xml").copyTo(navResource("add_nav.xml"))
-
- // lastModified has one second precision on certain platforms and jdk versions
- // so sleep for a second
- Thread.sleep(SEC)
- runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
- assertGenerated("debug/$ADDITIONAL_DIRECTIONS$extension")
- val newNextLastMod = assertGenerated("debug/$NEXT_DIRECTIONS$extension").lastModified()
- MatcherAssert.assertThat(
- newNextLastMod,
- CoreMatchers.`is`(nextLastMod)
- )
- }
-
- @Test
- fun incrementalModify() {
- setupBuildGradle()
- testData("incremental-test-data/add_nav.xml").copyTo(navResource("add_nav.xml"))
-
- runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
- val mainLastMod = assertGenerated("debug/$MAIN_DIRECTIONS$extension").lastModified()
- val additionalLastMod = assertGenerated("debug/$ADDITIONAL_DIRECTIONS$extension")
- .lastModified()
- assertGenerated("debug/$NEXT_DIRECTIONS$extension")
-
- testData("incremental-test-data/modified_nav.xml").copyTo(
- navResource("nav_test.xml"),
- true
- )
-
- // lastModified has one second precision on certain platforms and jdk versions
- // so sleep for a second
- Thread.sleep(SEC)
- runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
- val newMainLastMod = assertGenerated("debug/$MAIN_DIRECTIONS$extension").lastModified()
- // main directions were regenerated
- MatcherAssert.assertThat(
- newMainLastMod,
- CoreMatchers.not(mainLastMod)
- )
-
- // but additional directions weren't touched
- val newAdditionalLastMod =
- assertGenerated("debug/$ADDITIONAL_DIRECTIONS$extension").lastModified()
- MatcherAssert.assertThat(
- newAdditionalLastMod,
- CoreMatchers.`is`(additionalLastMod)
- )
-
- assertGenerated("debug/$MODIFIED_NEXT_DIRECTIONS$extension")
- assertNotGenerated("debug/$NEXT_DIRECTIONS$extension")
- }
-
- @Test
- fun incrementalRemove() {
- setupBuildGradle()
- testData("incremental-test-data/add_nav.xml").copyTo(navResource("add_nav.xml"))
-
- runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
- val mainLastMod = assertGenerated("debug/$MAIN_DIRECTIONS$extension").lastModified()
- assertGenerated("debug/$ADDITIONAL_DIRECTIONS$extension")
-
- val wasRemoved = navResource("add_nav.xml").delete()
- MatcherAssert.assertThat(wasRemoved, CoreMatchers.`is`(true))
-
- // lastModified has one second precision on certain platforms and jdk versions
- // so sleep for a second
- Thread.sleep(SEC)
- runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
- val newMainLastMod = assertGenerated("debug/$MAIN_DIRECTIONS$extension").lastModified()
- // main directions weren't touched
- MatcherAssert.assertThat(
- newMainLastMod,
- CoreMatchers.`is`(mainLastMod)
- )
-
- // but additional directions are removed
- assertNotGenerated("debug/$ADDITIONAL_DIRECTIONS$extension")
- }
-
- @Test
- fun invalidModify() {
- setupBuildGradle()
- testData("incremental-test-data/add_nav.xml").copyTo(navResource("add_nav.xml"))
- runGradle("generateSafeArgsDebug").assertSuccessfulTask("generateSafeArgsDebug")
- val step1MainLastMod = assertGenerated("debug/$MAIN_DIRECTIONS$extension").lastModified()
- val step1AdditionalLastMod =
- assertGenerated("debug/$ADDITIONAL_DIRECTIONS$extension").lastModified()
- assertGenerated("debug/$NEXT_DIRECTIONS$extension")
-
- testData("invalid/failing_nav.xml")
- .copyTo(navResource("nav_test.xml"), true)
- Thread.sleep(SEC)
- runAndFailGradle("generateSafeArgsDebug").assertFailingTask("generateSafeArgsDebug")
- val step2MainLastMod = assertGenerated("debug/$MAIN_DIRECTIONS$extension").lastModified()
- // main directions were regenerated
- MatcherAssert.assertThat(
- step2MainLastMod,
- CoreMatchers.not(step1MainLastMod)
- )
-
- // but additional directions weren't touched
- val step2AdditionalLastMod =
- assertGenerated("debug/$ADDITIONAL_DIRECTIONS$extension").lastModified()
- MatcherAssert.assertThat(
- step2AdditionalLastMod,
- CoreMatchers.`is`(step1AdditionalLastMod)
- )
-
- val step2ModifiedTime =
- assertGenerated("debug/$MODIFIED_NEXT_DIRECTIONS$extension").lastModified()
- assertNotGenerated("debug/$NEXT_DIRECTIONS$extension")
-
- testData("incremental-test-data/modified_nav.xml").copyTo(
- navResource("nav_test.xml"),
- true
- )
- Thread.sleep(SEC)
- runGradle("generateSafeArgsDebug").assertSuccessfulTask("generateSafeArgsDebug")
-
- // additional directions are touched because once task failed,
- // gradle next time makes full run
- val step3AdditionalLastMod =
- assertGenerated("debug/$ADDITIONAL_DIRECTIONS$extension").lastModified()
- MatcherAssert.assertThat(
- step3AdditionalLastMod,
- CoreMatchers.not(step2AdditionalLastMod)
- )
-
- val step3ModifiedTime =
- assertGenerated("debug/$MODIFIED_NEXT_DIRECTIONS$extension").lastModified()
- MatcherAssert.assertThat(
- step2ModifiedTime,
- CoreMatchers.not(step3ModifiedTime)
- )
- }
-
- companion object {
- @JvmStatic
- @Parameterized.Parameters(name = "generateKotlin={0}")
- fun data() = listOf(false, true)
- }
-}
\ No newline at end of file
diff --git a/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/JavaPluginTest.kt b/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/JavaPluginTest.kt
deleted file mode 100644
index 0456492..0000000
--- a/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/JavaPluginTest.kt
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright 2019 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.navigation.safeargs.gradle
-
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
-// Does not work in the Android Studio
-@RunWith(JUnit4::class)
-class JavaPluginTest : BasePluginTest() {
-
- @Test
- fun runGenerateTask() {
- testData("app-project").copyRecursively(projectRoot())
- buildFile.writeText("""
- plugins {
- id('com.android.application')
- id('androidx.navigation.safeargs')
- }
-
- repositories {
- maven { url "$prebuiltsRepo/androidx/external" }
- maven { url "$prebuiltsRepo/androidx/internal" }
- }
-
- android {
- compileSdkVersion $compileSdkVersion
- buildToolsVersion "$buildToolsVersion"
- flavorDimensions "mode"
- productFlavors {
- foo {
- dimension "mode"
- applicationIdSuffix ".foo"
- }
- notfoo {
- dimension "mode"
- }
-
- }
-
- defaultConfig {
- minSdkVersion $minSdkVersion
- }
-
- signingConfigs {
- debug {
- storeFile file("$debugKeystore")
- }
- }
- }
-
- dependencies {
- implementation "$navigationCommon"
- }
- """.trimIndent()
- )
-
- runGradle("assembleNotfooDebug", "assembleFooDebug")
- .assertSuccessfulTask("assembleNotfooDebug")
- .assertSuccessfulTask("assembleFooDebug")
-
- assertGenerated("notfoo/debug/$NEXT_DIRECTIONS.java")
- assertGenerated("notfoo/debug/$NEXT_ARGUMENTS.java")
- assertNotGenerated("foo/debug/$NEXT_DIRECTIONS.java")
- assertGenerated("foo/debug/$FOO_DIRECTIONS.java")
- }
-
- @Test
- fun generateForFeature() {
- setupMultiModuleBuildGradle()
- runGradle(
- ":feature:assembleFooDebugFeature",
- ":feature:assembleNotfooDebugFeature"
- )
- .assertSuccessfulTask("feature:assembleNotfooDebugFeature")
- .assertSuccessfulTask("feature:assembleFooDebugFeature")
-
- assertGenerated("foo/debug/$FEATURE_DIRECTIONS.java", "feature/")
- assertGenerated("notfoo/debug/$FEATURE_DIRECTIONS.java", "feature/")
- }
-
- @Test
- fun generateForLibrary() {
- setupMultiModuleBuildGradle()
- runGradle(
- ":library:assembleFooDebug",
- ":library:assembleNotfooDebug"
- )
- .assertSuccessfulTask("library:assembleNotfooDebug")
- .assertSuccessfulTask("library:assembleFooDebug")
-
- assertGenerated("foo/debug/$LIBRARY_DIRECTIONS.java", "library/")
- assertGenerated("notfoo/debug/$LIBRARY_DIRECTIONS.java", "library/")
- }
-
- @Test
- fun generateForBaseFeature() {
- setupMultiModuleBuildGradle()
- runGradle(
- ":base:assembleFooDebugFeature",
- ":base:assembleNotfooDebugFeature"
- )
- .assertSuccessfulTask("base:assembleNotfooDebugFeature")
- .assertSuccessfulTask("base:assembleFooDebugFeature")
-
- assertGenerated("foo/debug/$MAIN_DIRECTIONS.java", "base/")
- assertGenerated("notfoo/debug/$MAIN_DIRECTIONS.java", "base/")
- assertGenerated("foo/debug/$NEXT_DIRECTIONS.java", "base/")
- assertGenerated("notfoo/debug/$NEXT_DIRECTIONS.java", "base/")
- }
-
- @Test
- fun generateForDynamicFeature() {
- setupMultiModuleBuildGradle()
- runGradle(
- ":dynamic_feature:assembleFooDebug",
- ":dynamic_feature:assembleNotfooDebug"
- )
- .assertSuccessfulTask("dynamic_feature:assembleNotfooDebug")
- .assertSuccessfulTask("dynamic_feature:assembleFooDebug")
-
- assertGenerated("notfoo/debug/$NOTFOO_DYNAMIC_DIRECTIONS.java", "dynamic_feature/")
- assertNotGenerated("foo/debug/$NOTFOO_DYNAMIC_DIRECTIONS.java", "dynamic_feature/")
- assertGenerated("foo/debug/$FOO_DYNAMIC_DIRECTIONS.java", "dynamic_feature/")
- assertNotGenerated("notfoo/debug/$FOO_DYNAMIC_DIRECTIONS.java", "dynamic_feature/")
- }
-}
\ No newline at end of file
diff --git a/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/KotlinPluginTest.kt b/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/KotlinPluginTest.kt
deleted file mode 100644
index 46c1429..0000000
--- a/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/KotlinPluginTest.kt
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2019 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.navigation.safeargs.gradle
-
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-
-// Does not work in the Android Studio
-@RunWith(JUnit4::class)
-class KotlinPluginTest : BasePluginTest() {
-
- @Test
- fun runGenerateTaskForKotlin() {
- setupSimpleKotlinBuildGradle()
- runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
-
- assertGenerated("debug/$NEXT_ARGUMENTS.kt")
- assertGenerated("debug/$NEXT_ARGUMENTS.kt")
- assertGenerated("debug/$MAIN_DIRECTIONS.kt")
- }
-}
\ No newline at end of file
diff --git a/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/PluginTest.kt b/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/PluginTest.kt
new file mode 100644
index 0000000..ab7c9c7
--- /dev/null
+++ b/navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/PluginTest.kt
@@ -0,0 +1,446 @@
+/*
+ * 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.navigation.safeargs.gradle
+
+import org.gradle.testkit.runner.BuildResult
+import org.gradle.testkit.runner.GradleRunner
+import org.gradle.testkit.runner.TaskOutcome
+import org.hamcrest.CoreMatchers.`is`
+import org.hamcrest.CoreMatchers.not
+import org.hamcrest.MatcherAssert.assertThat
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.rules.TemporaryFolder
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+import java.io.File
+import java.util.Properties
+
+private const val MAIN_DIR = "androidx/navigation/testapp"
+
+private const val NEXT_DIRECTIONS = "$MAIN_DIR/NextFragmentDirections.java"
+private const val NEXT_ARGUMENTS_KT = "$MAIN_DIR/NextFragmentArgs.kt"
+private const val MAIN_DIRECTIONS = "$MAIN_DIR/MainFragmentDirections.java"
+private const val MAIN_DIRECTIONS_KT = "$MAIN_DIR/MainFragmentDirections.kt"
+private const val MAIN_ARGUMENTS_KT = "$MAIN_DIR/MainFragmentArgs.kt"
+private const val MODIFIED_NEXT_DIRECTIONS = "$MAIN_DIR/ModifiedNextFragmentDirections.java"
+private const val ADDITIONAL_DIRECTIONS = "$MAIN_DIR/AdditionalFragmentDirections.java"
+private const val FOO_DIRECTIONS = "safe/gradle/test/app/foo/FooFragmentDirections.java"
+private const val FEATURE_DIRECTIONS = "$MAIN_DIR/FeatureFragmentDirections.java"
+private const val LIBRARY_DIRECTIONS = "$MAIN_DIR/LibraryFragmentDirections.java"
+private const val FOO_DYNAMIC_DIRECTIONS =
+ "safe/gradle/test/app/dynamic_feature/foo/DynFooFeatureFragmentDirections.java"
+private const val NOTFOO_DYNAMIC_DIRECTIONS = "$MAIN_DIR/DynFeatureFragmentDirections.java"
+
+private const val NAV_RESOURCES = "src/main/res/navigation"
+private const val SEC = 1000L
+
+// Does not work in the Android Studio
+@RunWith(JUnit4::class)
+class PluginTest {
+
+ @Suppress("MemberVisibilityCanBePrivate")
+ @get:Rule
+ val testProjectDir = TemporaryFolder()
+
+ private var buildFile: File = File("")
+ private var prebuiltsRepo = ""
+ private var compileSdkVersion = ""
+ private var buildToolsVersion = ""
+ private var minSdkVersion = ""
+ private var debugKeystore = ""
+ private var navigationCommon = ""
+ private var kotlinStblib = ""
+
+ private fun projectRoot(): File = testProjectDir.root
+
+ private fun assertGenerated(name: String, prefix: String? = null): File {
+ return prefix?.let { assertExists(name, true, it) } ?: assertExists(name, true)
+ }
+
+ private fun assertNotGenerated(name: String, prefix: String? = null): File {
+ return prefix?.let { assertExists(name, false, it) } ?: assertExists(name, false)
+ }
+
+ private fun assertExists(name: String, ex: Boolean, prefix: String = ""): File {
+ val generatedFile = File(projectRoot(), "${prefix}build/$GENERATED_PATH/$name")
+ assertThat(generatedFile.exists(), `is`(ex))
+ return generatedFile
+ }
+
+ private fun navResource(name: String) = File(projectRoot(), "$NAV_RESOURCES/$name")
+
+ private fun gradleBuilder(vararg args: String) = GradleRunner.create()
+ .withProjectDir(projectRoot()).withPluginClasspath().withArguments(*args)
+
+ private fun runGradle(vararg args: String) = gradleBuilder(*args).build()
+ private fun runAndFailGradle(vararg args: String) = gradleBuilder(*args).buildAndFail()
+
+ @Before
+ fun setup() {
+ projectRoot().mkdirs()
+ buildFile = File(projectRoot(), "build.gradle")
+ buildFile.createNewFile()
+ // copy local.properties
+ val appToolkitProperties = File("../../local.properties")
+ if (appToolkitProperties.exists()) {
+ appToolkitProperties.copyTo(File(projectRoot(), "local.properties"), overwrite = true)
+ } else {
+ File("../../local.properties").copyTo(
+ File(projectRoot(), "local.properties"), overwrite = true)
+ }
+ val stream = PluginTest::class.java.classLoader.getResourceAsStream("sdk.prop")
+ val properties = Properties()
+ properties.load(stream)
+ prebuiltsRepo = properties.getProperty("prebuiltsRepo")
+ compileSdkVersion = properties.getProperty("compileSdkVersion")
+ buildToolsVersion = properties.getProperty("buildToolsVersion")
+ minSdkVersion = properties.getProperty("minSdkVersion")
+ debugKeystore = properties.getProperty("debugKeystore")
+ navigationCommon = properties.getProperty("navigationCommon")
+ kotlinStblib = properties.getProperty("kotlinStdlib")
+ }
+
+ private fun setupSimpleBuildGradle() {
+ testData("app-project").copyRecursively(projectRoot())
+ buildFile.writeText("""
+ plugins {
+ id('com.android.application')
+ id('androidx.navigation.safeargs')
+ }
+
+ repositories {
+ maven { url "$prebuiltsRepo/androidx/external" }
+ maven { url "$prebuiltsRepo/androidx/internal" }
+ }
+
+ android {
+ compileSdkVersion $compileSdkVersion
+ buildToolsVersion "$buildToolsVersion"
+
+ defaultConfig {
+ minSdkVersion $minSdkVersion
+ }
+
+ signingConfigs {
+ debug {
+ storeFile file("$debugKeystore")
+ }
+ }
+ }
+
+ dependencies {
+ implementation "$navigationCommon"
+ }
+ """.trimIndent())
+ }
+
+ private fun setupMultiModuleBuildGradle() {
+ testData("multimodule-project").copyRecursively(projectRoot())
+ buildFile.writeText("""
+ buildscript {
+ ext.compileSdk = $compileSdkVersion
+ ext.buildTools = "$buildToolsVersion"
+ ext.minSdk = $minSdkVersion
+ ext.debugKeystoreFile = "$debugKeystore"
+ ext.navigationCommonDep = "$navigationCommon"
+ }
+
+ allprojects {
+ repositories {
+ maven { url "$prebuiltsRepo/androidx/external" }
+ maven { url "$prebuiltsRepo/androidx/internal" }
+ }
+ }
+ """.trimIndent())
+ }
+
+ @Test
+ fun runGenerateTask() {
+ testData("app-project").copyRecursively(projectRoot())
+ buildFile.writeText("""
+ plugins {
+ id('com.android.application')
+ id('androidx.navigation.safeargs')
+ }
+
+ repositories {
+ maven { url "$prebuiltsRepo/androidx/external" }
+ maven { url "$prebuiltsRepo/androidx/internal" }
+ }
+
+ android {
+ compileSdkVersion $compileSdkVersion
+ buildToolsVersion "$buildToolsVersion"
+ flavorDimensions "mode"
+ productFlavors {
+ foo {
+ dimension "mode"
+ applicationIdSuffix ".foo"
+ }
+ notfoo {
+ dimension "mode"
+ }
+
+ }
+
+ defaultConfig {
+ minSdkVersion $minSdkVersion
+ }
+
+ signingConfigs {
+ debug {
+ storeFile file("$debugKeystore")
+ }
+ }
+ }
+
+ dependencies {
+ implementation "$navigationCommon"
+ }
+ """.trimIndent())
+
+ runGradle("assembleNotfooDebug", "assembleFooDebug")
+ .assertSuccessfulTask("assembleNotfooDebug")
+ .assertSuccessfulTask("assembleFooDebug")
+
+ assertGenerated("notfoo/debug/$NEXT_DIRECTIONS")
+ assertNotGenerated("foo/debug/$NEXT_DIRECTIONS")
+ assertGenerated("foo/debug/$FOO_DIRECTIONS")
+ }
+
+ @Test
+ fun runGenerateTaskForKotlin() {
+ testData("app-project-kotlin").copyRecursively(projectRoot())
+ buildFile.writeText("""
+ plugins {
+ id('com.android.application')
+ id('kotlin-android')
+ id('androidx.navigation.safeargs.kotlin')
+ }
+
+ repositories {
+ maven { url "$prebuiltsRepo/androidx/external" }
+ maven { url "$prebuiltsRepo/androidx/internal" }
+ }
+
+ android {
+ compileSdkVersion $compileSdkVersion
+ buildToolsVersion "$buildToolsVersion"
+
+ defaultConfig {
+ minSdkVersion $minSdkVersion
+ }
+
+ signingConfigs {
+ debug {
+ storeFile file("$debugKeystore")
+ }
+ }
+ }
+
+ dependencies {
+ implementation "$kotlinStblib"
+ implementation "$navigationCommon"
+ }
+ """.trimIndent())
+
+ runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
+
+ assertGenerated("debug/$NEXT_ARGUMENTS_KT")
+ assertGenerated("debug/$MAIN_DIRECTIONS_KT")
+ assertGenerated("debug/$MAIN_ARGUMENTS_KT")
+ }
+
+ @Test
+ fun incrementalAdd() {
+ setupSimpleBuildGradle()
+ runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
+ val nextLastMod = assertGenerated("debug/$NEXT_DIRECTIONS").lastModified()
+
+ testData("incremental-test-data/add_nav.xml").copyTo(navResource("add_nav.xml"))
+
+ // lastModified has one second precision on certain platforms and jdk versions
+ // so sleep for a second
+ Thread.sleep(SEC)
+ runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
+ assertGenerated("debug/$ADDITIONAL_DIRECTIONS")
+ val newNextLastMod = assertGenerated("debug/$NEXT_DIRECTIONS").lastModified()
+ assertThat(newNextLastMod, `is`(nextLastMod))
+ }
+
+ @Test
+ fun incrementalModify() {
+ setupSimpleBuildGradle()
+ testData("incremental-test-data/add_nav.xml").copyTo(navResource("add_nav.xml"))
+
+ runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
+ val mainLastMod = assertGenerated("debug/$MAIN_DIRECTIONS").lastModified()
+ val additionalLastMod = assertGenerated("debug/$ADDITIONAL_DIRECTIONS").lastModified()
+ assertGenerated("debug/$NEXT_DIRECTIONS")
+
+ testData("incremental-test-data/modified_nav.xml").copyTo(navResource("nav_test.xml"), true)
+
+ // lastModified has one second precision on certain platforms and jdk versions
+ // so sleep for a second
+ Thread.sleep(SEC)
+ runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
+ val newMainLastMod = assertGenerated("debug/$MAIN_DIRECTIONS").lastModified()
+ // main directions were regenerated
+ assertThat(newMainLastMod, not(mainLastMod))
+
+ // but additional directions weren't touched
+ val newAdditionalLastMod = assertGenerated("debug/$ADDITIONAL_DIRECTIONS").lastModified()
+ assertThat(newAdditionalLastMod, `is`(additionalLastMod))
+
+ assertGenerated("debug/$MODIFIED_NEXT_DIRECTIONS")
+ assertNotGenerated("debug/$NEXT_DIRECTIONS")
+ }
+
+ @Test
+ fun incrementalRemove() {
+ setupSimpleBuildGradle()
+ testData("incremental-test-data/add_nav.xml").copyTo(navResource("add_nav.xml"))
+
+ runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
+ val mainLastMod = assertGenerated("debug/$MAIN_DIRECTIONS").lastModified()
+ assertGenerated("debug/$ADDITIONAL_DIRECTIONS")
+
+ val wasRemoved = navResource("add_nav.xml").delete()
+ assertThat(wasRemoved, `is`(true))
+
+ // lastModified has one second precision on certain platforms and jdk versions
+ // so sleep for a second
+ Thread.sleep(SEC)
+ runGradle("assembleDebug").assertSuccessfulTask("assembleDebug")
+ val newMainLastMod = assertGenerated("debug/$MAIN_DIRECTIONS").lastModified()
+ // main directions weren't touched
+ assertThat(newMainLastMod, `is`(mainLastMod))
+
+ // but additional directions are removed
+ assertNotGenerated("debug/$ADDITIONAL_DIRECTIONS")
+ }
+
+ @Test
+ fun invalidModify() {
+ setupSimpleBuildGradle()
+ testData("incremental-test-data/add_nav.xml").copyTo(navResource("add_nav.xml"))
+ runGradle("generateSafeArgsDebug").assertSuccessfulTask("generateSafeArgsDebug")
+ val step1MainLastMod = assertGenerated("debug/$MAIN_DIRECTIONS").lastModified()
+ val step1AdditionalLastMod = assertGenerated("debug/$ADDITIONAL_DIRECTIONS").lastModified()
+ assertGenerated("debug/$NEXT_DIRECTIONS")
+
+ testData("invalid/failing_nav.xml").copyTo(navResource("nav_test.xml"), true)
+ Thread.sleep(SEC)
+ runAndFailGradle("generateSafeArgsDebug").assertFailingTask("generateSafeArgsDebug")
+ val step2MainLastMod = assertGenerated("debug/$MAIN_DIRECTIONS").lastModified()
+ // main directions were regenerated
+ assertThat(step2MainLastMod, not(step1MainLastMod))
+
+ // but additional directions weren't touched
+ val step2AdditionalLastMod = assertGenerated("debug/$ADDITIONAL_DIRECTIONS").lastModified()
+ assertThat(step2AdditionalLastMod, `is`(step1AdditionalLastMod))
+
+ val step2ModifiedTime = assertGenerated("debug/$MODIFIED_NEXT_DIRECTIONS").lastModified()
+ assertNotGenerated("debug/$NEXT_DIRECTIONS")
+
+ testData("incremental-test-data/modified_nav.xml").copyTo(navResource("nav_test.xml"), true)
+ Thread.sleep(SEC)
+ runGradle("generateSafeArgsDebug").assertSuccessfulTask("generateSafeArgsDebug")
+
+ // additional directions are touched because once task failed,
+ // gradle next time makes full run
+ val step3AdditionalLastMod = assertGenerated("debug/$ADDITIONAL_DIRECTIONS").lastModified()
+ assertThat(step3AdditionalLastMod, not(step2AdditionalLastMod))
+
+ val step3ModifiedTime = assertGenerated("debug/$MODIFIED_NEXT_DIRECTIONS").lastModified()
+ assertThat(step2ModifiedTime, not(step3ModifiedTime))
+ }
+
+ @Test
+ fun generateForFeature() {
+ setupMultiModuleBuildGradle()
+ runGradle(
+ ":feature:assembleFooDebug",
+ ":feature:assembleNotfooDebug"
+ )
+ .assertSuccessfulTask("feature:assembleNotfooDebug")
+ .assertSuccessfulTask("feature:assembleFooDebug")
+
+ assertGenerated("foo/debug/$FEATURE_DIRECTIONS", "feature/")
+ assertGenerated("notfoo/debug/$FEATURE_DIRECTIONS", "feature/")
+ }
+
+ @Test
+ fun generateForLibrary() {
+ setupMultiModuleBuildGradle()
+ runGradle(
+ ":library:assembleFooDebug",
+ ":library:assembleNotfooDebug"
+ )
+ .assertSuccessfulTask("library:assembleNotfooDebug")
+ .assertSuccessfulTask("library:assembleFooDebug")
+
+ assertGenerated("foo/debug/$LIBRARY_DIRECTIONS", "library/")
+ assertGenerated("notfoo/debug/$LIBRARY_DIRECTIONS", "library/")
+ }
+
+ @Test
+ fun generateForBaseFeature() {
+ setupMultiModuleBuildGradle()
+ runGradle(
+ ":base:assembleFooDebug",
+ ":base:assembleNotfooDebug"
+ )
+ .assertSuccessfulTask("base:assembleNotfooDebug")
+ .assertSuccessfulTask("base:assembleFooDebug")
+
+ assertGenerated("foo/debug/$MAIN_DIRECTIONS", "base/")
+ assertGenerated("notfoo/debug/$MAIN_DIRECTIONS", "base/")
+ assertGenerated("foo/debug/$NEXT_DIRECTIONS", "base/")
+ assertGenerated("notfoo/debug/$NEXT_DIRECTIONS", "base/")
+ }
+
+ @Test
+ fun generateForDynamicFeature() {
+ setupMultiModuleBuildGradle()
+ runGradle(
+ ":dynamic_feature:assembleFooDebug",
+ ":dynamic_feature:assembleNotfooDebug"
+ )
+ .assertSuccessfulTask("dynamic_feature:assembleNotfooDebug")
+ .assertSuccessfulTask("dynamic_feature:assembleFooDebug")
+
+ assertGenerated("notfoo/debug/$NOTFOO_DYNAMIC_DIRECTIONS", "dynamic_feature/")
+ assertNotGenerated("foo/debug/$NOTFOO_DYNAMIC_DIRECTIONS", "dynamic_feature/")
+ assertGenerated("foo/debug/$FOO_DYNAMIC_DIRECTIONS", "dynamic_feature/")
+ assertNotGenerated("notfoo/debug/$FOO_DYNAMIC_DIRECTIONS", "dynamic_feature/")
+ }
+}
+
+private fun testData(name: String) = File("src/test/test-data", name)
+
+private fun BuildResult.assertSuccessfulTask(name: String): BuildResult {
+ assertThat(task(":$name")!!.outcome, `is`(TaskOutcome.SUCCESS))
+ return this
+}
+
+private fun BuildResult.assertFailingTask(name: String): BuildResult {
+ assertThat(task(":$name")!!.outcome, `is`(TaskOutcome.FAILED))
+ return this
+}
\ No newline at end of file
diff --git a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/java/androidx/navigation/testapp/MyClass.kt b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/java/androidx/navigation/testapp/MyClass.kt
index 658cd02..7270f23 100644
--- a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/java/androidx/navigation/testapp/MyClass.kt
+++ b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/java/androidx/navigation/testapp/MyClass.kt
@@ -18,7 +18,4 @@
import java.io.Serializable
-class MyClass : Serializable {
-
- class InnerClass : Serializable
-}
\ No newline at end of file
+class MyClass : Serializable
\ No newline at end of file
diff --git a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_test.xml b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_test.xml
index fa455bd..6d07623 100644
--- a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_test.xml
+++ b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_test.xml
@@ -19,7 +19,7 @@
xmlns:tools="http://schemas.android.com/tools"
app:startDestination="@+id/first_screen">
<fragment android:id="@+id/first_screen"
- android:name="androidx.navigation.testapp.Fragment">
+ android:name="androidx.navigation.testapp.MainFragment">
<argument android:name="myarg1" android:defaultValue="one" />
<action android:id="@+id/next" app:destination="@+id/next_fragment">
<argument android:name="myarg2" app:argType="string"/>
@@ -37,7 +37,6 @@
android:defaultValue="READ"/>
<argument android:name="objectRelativeArg" app:argType=".pkg.MyPkgClass"/>
<argument android:name="objectRelativeArg2" app:argType=".MyClass"/>
- <argument android:name="objectRelativeArg3" app:argType=".MyClass$InnerClass"/>
</action>
</fragment>
<fragment android:id="@+id/next_fragment"
@@ -45,7 +44,6 @@
<argument android:name="main"/>
<argument android:name="optional" android:defaultValue="-1"/>
<argument android:name="reference" android:defaultValue="@color/colorPrimary"/>
- <argument android:name="referenceZeroDefaultValue" app:argType="reference" android:defaultValue="0"/>
<argument android:name="floatArg" android:defaultValue="-1.0"/>
<argument android:name="floatArrayArg" app:argType="float[]"/>
<argument android:name="objectArrayArg" app:argType="android.content.pm.ActivityInfo[]"/>
@@ -55,7 +53,5 @@
app:nullable="true"/>
<argument android:name="enumArg" app:argType="java.nio.file.AccessMode"
android:defaultValue="READ"/>
- <action android:id="@+id/next" app:destination="@+id/first_screen"/>
- <action android:id="@+id/finish" app:popUpTo="@id/first_screen" />
</fragment>
</navigation>
\ No newline at end of file
diff --git a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/AndroidManifest.xml b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/AndroidManifest.xml
index a2a21c8..92b9c99 100644
--- a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/AndroidManifest.xml
+++ b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/AndroidManifest.xml
@@ -15,5 +15,9 @@
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="androidx.navigation.testapp">
+ package="safe.gradle.test.app">
+ <application
+ android:allowBackup="true"
+ android:supportsRtl="true">
+ </application>
</manifest>
diff --git a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/androidx/navigation/testapp/MyClass.java b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/androidx/navigation/testapp/MyClass.java
deleted file mode 100644
index d36082f..0000000
--- a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/androidx/navigation/testapp/MyClass.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2019 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.navigation.testapp;
-
-import java.io.Serializable;
-
-public class MyClass implements Serializable {
-
- public static class InnerClass implements Serializable {
-
- }
-}
\ No newline at end of file
diff --git a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/androidx/navigation/testapp/pkg/MyPkgClass.java b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/androidx/navigation/testapp/pkg/MyPkgClass.java
deleted file mode 100644
index b8e8a5e..0000000
--- a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/androidx/navigation/testapp/pkg/MyPkgClass.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2019 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.navigation.testapp.pkg;
-
-import android.os.Parcel;
-import android.os.Parcelable;
-
-public class MyPkgClass implements Parcelable {
-
- public MyPkgClass(Parcel parcel) {
-
- }
-
- @Override
- public void writeToParcel(Parcel parcel, int flahs) {
-
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- public static final Parcelable.Creator<MyPkgClass> CREATOR = new Parcelable.Creator<MyPkgClass>() {
- @Override
- public MyPkgClass createFromParcel(Parcel parcel) {
- return new MyPkgClass(parcel);
- }
-
- @Override
- public MyPkgClass[] newArray(int size) {
- return new MyPkgClass[size];
- }
- };
-}
\ No newline at end of file
diff --git a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/foo/Bar.java b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/foo/Bar.java
new file mode 100644
index 0000000..9410272
--- /dev/null
+++ b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/foo/Bar.java
@@ -0,0 +1,5 @@
+package foo;
+
+class Bar {
+
+}
\ No newline at end of file
diff --git a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/navigation/nav_test.xml b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/navigation/nav_test.xml
index 73188f1..1e38990 100644
--- a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/navigation/nav_test.xml
+++ b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/navigation/nav_test.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- ~ Copyright 2019 The Android Open Source Project
+ ~ 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.
@@ -15,46 +15,20 @@
~ limitations under the License.
-->
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- app:startDestination="@+id/first_screen">
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ app:startDestination="@+id/first_screen">
<fragment android:id="@+id/first_screen"
- android:name="androidx.navigation.testapp.Fragment">
+ android:name="androidx.navigation.testapp.MainFragment">
<argument android:name="myarg1" android:defaultValue="one" />
<action android:id="@+id/next" app:destination="@+id/next_fragment">
- <argument android:name="myarg2" app:argType="string"/>
- <argument android:name="randomArgument" app:argType="string"/>
- <argument android:name="intArgument" app:argType="integer" android:defaultValue="261"/>
- <argument android:name="activityInfo" app:argType="android.content.pm.ActivityInfo"/>
- <argument android:name="activityInfoNull"
- app:nullable="true"
- app:argType="android.content.pm.ActivityInfo"
- android:defaultValue="@null"/>
- <argument android:name="intArrayArg" app:argType="integer[]"/>
- <argument android:name="stringArrayArg" app:argType="string[]"/>
- <argument android:name="objectArrayArg" app:argType="android.content.pm.ActivityInfo[]"/>
- <argument android:name="enumArg" app:argType="java.nio.file.AccessMode"
- android:defaultValue="READ"/>
- <argument android:name="objectRelativeArg" app:argType=".pkg.MyPkgClass"/>
- <argument android:name="objectRelativeArg2" app:argType=".MyClass"/>
- <argument android:name="objectRelativeArg3" app:argType=".MyClass$InnerClass"/>
+ <argument android:name="myarg2"/>
+ <argument android:name="randomArgument"/>
</action>
</fragment>
<fragment android:id="@+id/next_fragment"
- android:name=".NextFragment">
- <argument android:name="main"/>
- <argument android:name="optional" android:defaultValue="-1"/>
- <argument android:name="reference" android:defaultValue="@color/colorPrimary"/>
- <argument android:name="referenceZeroDefaultValue" app:argType="reference" android:defaultValue="0"/>
- <argument android:name="floatArg" android:defaultValue="-1.0"/>
- <argument android:name="floatArrayArg" app:argType="float[]"/>
- <argument android:name="objectArrayArg" app:argType="android.content.pm.ActivityInfo[]"/>
- <argument android:name="boolArg" android:defaultValue="true"/>
- <argument android:name="optionalParcelable"
- app:argType="android.content.pm.ActivityInfo"
- app:nullable="true"/>
- <argument android:name="enumArg" app:argType="java.nio.file.AccessMode"
- android:defaultValue="READ"/>
+ android:name="androidx.navigation.testapp.NextFragment">
+ <argument android:name="myarg2" />
<action android:id="@+id/next" app:destination="@+id/first_screen"/>
<action android:id="@+id/finish" app:popUpTo="@id/first_screen" />
</fragment>
diff --git a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/values/colors.xml b/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/values/colors.xml
deleted file mode 100644
index 263a6cf..0000000
--- a/navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2019 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.
- -->
-
-<resources>
- <color name="colorPrimary">#008577</color>
-</resources>
diff --git a/navigation/testing/api/1.0.0-alpha08.txt b/navigation/testing/api/1.0.0-alpha08.txt
index 424f6bac6..7ad74f7 100644
--- a/navigation/testing/api/1.0.0-alpha08.txt
+++ b/navigation/testing/api/1.0.0-alpha08.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.testing {
@androidx.navigation.Navigator.Name("test") public class TestNavigator extends androidx.navigation.Navigator<androidx.navigation.testing.TestNavigator.Destination> {
@@ -21,8 +21,8 @@
public final class TestNavigatorDestinationBuilderKt {
ctor public TestNavigatorDestinationBuilderKt();
- method public static inline void test(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline void test(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.testing.TestNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static void test(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static void test(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.testing.TestNavigatorDestinationBuilder,kotlin.Unit> builder);
}
public final class TestNavigatorProvider extends androidx.navigation.NavigatorProvider {
diff --git a/navigation/testing/api/current.txt b/navigation/testing/api/current.txt
index 424f6bac6..7ad74f7 100644
--- a/navigation/testing/api/current.txt
+++ b/navigation/testing/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.testing {
@androidx.navigation.Navigator.Name("test") public class TestNavigator extends androidx.navigation.Navigator<androidx.navigation.testing.TestNavigator.Destination> {
@@ -21,8 +21,8 @@
public final class TestNavigatorDestinationBuilderKt {
ctor public TestNavigatorDestinationBuilderKt();
- method public static inline void test(androidx.navigation.NavGraphBuilder, @IdRes int id);
- method public static inline void test(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.testing.TestNavigatorDestinationBuilder,kotlin.Unit> builder);
+ method public static void test(androidx.navigation.NavGraphBuilder, @IdRes int id);
+ method public static void test(androidx.navigation.NavGraphBuilder, @IdRes int id, kotlin.jvm.functions.Function1<? super androidx.navigation.testing.TestNavigatorDestinationBuilder,kotlin.Unit> builder);
}
public final class TestNavigatorProvider extends androidx.navigation.NavigatorProvider {
diff --git a/navigation/testing/api/restricted_1.0.0-alpha08.txt b/navigation/testing/api/restricted_1.0.0-alpha08.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/testing/api/restricted_1.0.0-alpha08.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/testing/api/restricted_current.txt b/navigation/testing/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/testing/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/testing/src/androidTest/java/androidx/navigation/testing/TestNavigatorDestinationBuilderTest.kt b/navigation/testing/src/androidTest/java/androidx/navigation/testing/TestNavigatorDestinationBuilderTest.kt
index 07c2c3f..c08c708 100644
--- a/navigation/testing/src/androidTest/java/androidx/navigation/testing/TestNavigatorDestinationBuilderTest.kt
+++ b/navigation/testing/src/androidTest/java/androidx/navigation/testing/TestNavigatorDestinationBuilderTest.kt
@@ -20,13 +20,13 @@
import androidx.navigation.get
import androidx.navigation.navigation
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4::class)
class TestNavigatorDestinationBuilderTest {
private val provider = TestNavigatorProvider()
diff --git a/navigation/testing/src/main/java/androidx/navigation/testing/TestNavigatorDestinationBuilder.kt b/navigation/testing/src/main/java/androidx/navigation/testing/TestNavigatorDestinationBuilder.kt
index 892b39e..6cb493f 100644
--- a/navigation/testing/src/main/java/androidx/navigation/testing/TestNavigatorDestinationBuilder.kt
+++ b/navigation/testing/src/main/java/androidx/navigation/testing/TestNavigatorDestinationBuilder.kt
@@ -18,7 +18,7 @@
package androidx.navigation.testing
-import androidx.annotation.IdRes
+import android.support.annotation.IdRes
import androidx.navigation.NavDestinationBuilder
import androidx.navigation.NavDestinationDsl
import androidx.navigation.NavGraphBuilder
diff --git a/navigation/ui/api/1.0.0-alpha08.txt b/navigation/ui/api/1.0.0-alpha08.txt
index 99acd8ae..b9d5f97 100644
--- a/navigation/ui/api/1.0.0-alpha08.txt
+++ b/navigation/ui/api/1.0.0-alpha08.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.ui {
public final class AppBarConfiguration {
diff --git a/navigation/ui/api/1.0.0-alpha09.txt b/navigation/ui/api/1.0.0-alpha09.txt
index af2f1c1..8a6be3d 100644
--- a/navigation/ui/api/1.0.0-alpha09.txt
+++ b/navigation/ui/api/1.0.0-alpha09.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.ui {
public final class AppBarConfiguration {
diff --git a/navigation/ui/api/1.0.0-alpha10.txt b/navigation/ui/api/1.0.0-alpha10.txt
index af2f1c1..8a6be3d 100644
--- a/navigation/ui/api/1.0.0-alpha10.txt
+++ b/navigation/ui/api/1.0.0-alpha10.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.ui {
public final class AppBarConfiguration {
diff --git a/navigation/ui/api/1.0.0-alpha11.txt b/navigation/ui/api/1.0.0-alpha11.txt
index af2f1c1..8a6be3d 100644
--- a/navigation/ui/api/1.0.0-alpha11.txt
+++ b/navigation/ui/api/1.0.0-alpha11.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.ui {
public final class AppBarConfiguration {
diff --git a/navigation/ui/api/1.0.0-beta01.txt b/navigation/ui/api/1.0.0-beta01.txt
deleted file mode 100644
index af2f1c1..0000000
--- a/navigation/ui/api/1.0.0-beta01.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.ui {
-
- public final class AppBarConfiguration {
- method public android.support.v4.widget.DrawerLayout? getDrawerLayout();
- method public androidx.navigation.ui.AppBarConfiguration.OnNavigateUpListener? getFallbackOnNavigateUpListener();
- method public java.util.Set<java.lang.Integer> getTopLevelDestinations();
- }
-
- public static final class AppBarConfiguration.Builder {
- ctor public AppBarConfiguration.Builder(androidx.navigation.NavGraph);
- ctor public AppBarConfiguration.Builder(android.view.Menu);
- ctor public AppBarConfiguration.Builder(int...);
- ctor public AppBarConfiguration.Builder(java.util.Set<java.lang.Integer>);
- method public androidx.navigation.ui.AppBarConfiguration build();
- method public androidx.navigation.ui.AppBarConfiguration.Builder setDrawerLayout(android.support.v4.widget.DrawerLayout?);
- method public androidx.navigation.ui.AppBarConfiguration.Builder setFallbackOnNavigateUpListener(androidx.navigation.ui.AppBarConfiguration.OnNavigateUpListener?);
- }
-
- public static interface AppBarConfiguration.OnNavigateUpListener {
- method public boolean onNavigateUp();
- }
-
- public final class NavigationUI {
- method public static boolean navigateUp(androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static boolean onNavDestinationSelected(android.view.MenuItem, androidx.navigation.NavController);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(android.support.design.widget.NavigationView, androidx.navigation.NavController);
- method public static void setupWithNavController(android.support.design.widget.BottomNavigationView, androidx.navigation.NavController);
- }
-
-}
-
diff --git a/navigation/ui/api/1.0.0-beta02.txt b/navigation/ui/api/1.0.0-beta02.txt
deleted file mode 100644
index af2f1c1..0000000
--- a/navigation/ui/api/1.0.0-beta02.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.ui {
-
- public final class AppBarConfiguration {
- method public android.support.v4.widget.DrawerLayout? getDrawerLayout();
- method public androidx.navigation.ui.AppBarConfiguration.OnNavigateUpListener? getFallbackOnNavigateUpListener();
- method public java.util.Set<java.lang.Integer> getTopLevelDestinations();
- }
-
- public static final class AppBarConfiguration.Builder {
- ctor public AppBarConfiguration.Builder(androidx.navigation.NavGraph);
- ctor public AppBarConfiguration.Builder(android.view.Menu);
- ctor public AppBarConfiguration.Builder(int...);
- ctor public AppBarConfiguration.Builder(java.util.Set<java.lang.Integer>);
- method public androidx.navigation.ui.AppBarConfiguration build();
- method public androidx.navigation.ui.AppBarConfiguration.Builder setDrawerLayout(android.support.v4.widget.DrawerLayout?);
- method public androidx.navigation.ui.AppBarConfiguration.Builder setFallbackOnNavigateUpListener(androidx.navigation.ui.AppBarConfiguration.OnNavigateUpListener?);
- }
-
- public static interface AppBarConfiguration.OnNavigateUpListener {
- method public boolean onNavigateUp();
- }
-
- public final class NavigationUI {
- method public static boolean navigateUp(androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static boolean onNavDestinationSelected(android.view.MenuItem, androidx.navigation.NavController);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(android.support.design.widget.NavigationView, androidx.navigation.NavController);
- method public static void setupWithNavController(android.support.design.widget.BottomNavigationView, androidx.navigation.NavController);
- }
-
-}
-
diff --git a/navigation/ui/api/1.0.0-rc01.txt b/navigation/ui/api/1.0.0-rc01.txt
deleted file mode 100644
index af2f1c1..0000000
--- a/navigation/ui/api/1.0.0-rc01.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.ui {
-
- public final class AppBarConfiguration {
- method public android.support.v4.widget.DrawerLayout? getDrawerLayout();
- method public androidx.navigation.ui.AppBarConfiguration.OnNavigateUpListener? getFallbackOnNavigateUpListener();
- method public java.util.Set<java.lang.Integer> getTopLevelDestinations();
- }
-
- public static final class AppBarConfiguration.Builder {
- ctor public AppBarConfiguration.Builder(androidx.navigation.NavGraph);
- ctor public AppBarConfiguration.Builder(android.view.Menu);
- ctor public AppBarConfiguration.Builder(int...);
- ctor public AppBarConfiguration.Builder(java.util.Set<java.lang.Integer>);
- method public androidx.navigation.ui.AppBarConfiguration build();
- method public androidx.navigation.ui.AppBarConfiguration.Builder setDrawerLayout(android.support.v4.widget.DrawerLayout?);
- method public androidx.navigation.ui.AppBarConfiguration.Builder setFallbackOnNavigateUpListener(androidx.navigation.ui.AppBarConfiguration.OnNavigateUpListener?);
- }
-
- public static interface AppBarConfiguration.OnNavigateUpListener {
- method public boolean onNavigateUp();
- }
-
- public final class NavigationUI {
- method public static boolean navigateUp(androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static boolean onNavDestinationSelected(android.view.MenuItem, androidx.navigation.NavController);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(android.support.design.widget.NavigationView, androidx.navigation.NavController);
- method public static void setupWithNavController(android.support.design.widget.BottomNavigationView, androidx.navigation.NavController);
- }
-
-}
-
diff --git a/navigation/ui/api/1.0.0-rc02.txt b/navigation/ui/api/1.0.0-rc02.txt
deleted file mode 100644
index af2f1c1..0000000
--- a/navigation/ui/api/1.0.0-rc02.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.ui {
-
- public final class AppBarConfiguration {
- method public android.support.v4.widget.DrawerLayout? getDrawerLayout();
- method public androidx.navigation.ui.AppBarConfiguration.OnNavigateUpListener? getFallbackOnNavigateUpListener();
- method public java.util.Set<java.lang.Integer> getTopLevelDestinations();
- }
-
- public static final class AppBarConfiguration.Builder {
- ctor public AppBarConfiguration.Builder(androidx.navigation.NavGraph);
- ctor public AppBarConfiguration.Builder(android.view.Menu);
- ctor public AppBarConfiguration.Builder(int...);
- ctor public AppBarConfiguration.Builder(java.util.Set<java.lang.Integer>);
- method public androidx.navigation.ui.AppBarConfiguration build();
- method public androidx.navigation.ui.AppBarConfiguration.Builder setDrawerLayout(android.support.v4.widget.DrawerLayout?);
- method public androidx.navigation.ui.AppBarConfiguration.Builder setFallbackOnNavigateUpListener(androidx.navigation.ui.AppBarConfiguration.OnNavigateUpListener?);
- }
-
- public static interface AppBarConfiguration.OnNavigateUpListener {
- method public boolean onNavigateUp();
- }
-
- public final class NavigationUI {
- method public static boolean navigateUp(androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static boolean onNavDestinationSelected(android.view.MenuItem, androidx.navigation.NavController);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(android.support.design.widget.NavigationView, androidx.navigation.NavController);
- method public static void setupWithNavController(android.support.design.widget.BottomNavigationView, androidx.navigation.NavController);
- }
-
-}
-
diff --git a/navigation/ui/api/2.0.0-rc02.txt b/navigation/ui/api/2.0.0-rc02.txt
deleted file mode 100644
index 629226a..0000000
--- a/navigation/ui/api/2.0.0-rc02.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.ui {
-
- public final class AppBarConfiguration {
- method public androidx.drawerlayout.widget.DrawerLayout? getDrawerLayout();
- method public androidx.navigation.ui.AppBarConfiguration.OnNavigateUpListener? getFallbackOnNavigateUpListener();
- method public java.util.Set<java.lang.Integer> getTopLevelDestinations();
- }
-
- public static final class AppBarConfiguration.Builder {
- ctor public AppBarConfiguration.Builder(androidx.navigation.NavGraph);
- ctor public AppBarConfiguration.Builder(android.view.Menu);
- ctor public AppBarConfiguration.Builder(int...);
- ctor public AppBarConfiguration.Builder(java.util.Set<java.lang.Integer>);
- method public androidx.navigation.ui.AppBarConfiguration build();
- method public androidx.navigation.ui.AppBarConfiguration.Builder setDrawerLayout(androidx.drawerlayout.widget.DrawerLayout?);
- method public androidx.navigation.ui.AppBarConfiguration.Builder setFallbackOnNavigateUpListener(androidx.navigation.ui.AppBarConfiguration.OnNavigateUpListener?);
- }
-
- public static interface AppBarConfiguration.OnNavigateUpListener {
- method public boolean onNavigateUp();
- }
-
- public final class NavigationUI {
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.drawerlayout.widget.DrawerLayout?);
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static boolean onNavDestinationSelected(android.view.MenuItem, androidx.navigation.NavController);
- method public static void setupActionBarWithNavController(androidx.appcompat.app.AppCompatActivity, androidx.navigation.NavController);
- method public static void setupActionBarWithNavController(androidx.appcompat.app.AppCompatActivity, androidx.navigation.NavController, androidx.drawerlayout.widget.DrawerLayout?);
- method public static void setupActionBarWithNavController(androidx.appcompat.app.AppCompatActivity, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(androidx.appcompat.widget.Toolbar, androidx.navigation.NavController);
- method public static void setupWithNavController(androidx.appcompat.widget.Toolbar, androidx.navigation.NavController, androidx.drawerlayout.widget.DrawerLayout?);
- method public static void setupWithNavController(androidx.appcompat.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(com.google.android.material.appbar.CollapsingToolbarLayout, androidx.appcompat.widget.Toolbar, androidx.navigation.NavController);
- method public static void setupWithNavController(com.google.android.material.appbar.CollapsingToolbarLayout, androidx.appcompat.widget.Toolbar, androidx.navigation.NavController, androidx.drawerlayout.widget.DrawerLayout?);
- method public static void setupWithNavController(com.google.android.material.appbar.CollapsingToolbarLayout, androidx.appcompat.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(com.google.android.material.navigation.NavigationView, androidx.navigation.NavController);
- method public static void setupWithNavController(com.google.android.material.bottomnavigation.BottomNavigationView, androidx.navigation.NavController);
- }
-
-}
-
diff --git a/navigation/ui/api/current.txt b/navigation/ui/api/current.txt
index 629226a..8a6be3d 100644
--- a/navigation/ui/api/current.txt
+++ b/navigation/ui/api/current.txt
@@ -1,8 +1,8 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.ui {
public final class AppBarConfiguration {
- method public androidx.drawerlayout.widget.DrawerLayout? getDrawerLayout();
+ method public android.support.v4.widget.DrawerLayout? getDrawerLayout();
method public androidx.navigation.ui.AppBarConfiguration.OnNavigateUpListener? getFallbackOnNavigateUpListener();
method public java.util.Set<java.lang.Integer> getTopLevelDestinations();
}
@@ -13,7 +13,7 @@
ctor public AppBarConfiguration.Builder(int...);
ctor public AppBarConfiguration.Builder(java.util.Set<java.lang.Integer>);
method public androidx.navigation.ui.AppBarConfiguration build();
- method public androidx.navigation.ui.AppBarConfiguration.Builder setDrawerLayout(androidx.drawerlayout.widget.DrawerLayout?);
+ method public androidx.navigation.ui.AppBarConfiguration.Builder setDrawerLayout(android.support.v4.widget.DrawerLayout?);
method public androidx.navigation.ui.AppBarConfiguration.Builder setFallbackOnNavigateUpListener(androidx.navigation.ui.AppBarConfiguration.OnNavigateUpListener?);
}
@@ -22,20 +22,20 @@
}
public final class NavigationUI {
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.drawerlayout.widget.DrawerLayout?);
+ method public static boolean navigateUp(androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
method public static boolean navigateUp(androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
method public static boolean onNavDestinationSelected(android.view.MenuItem, androidx.navigation.NavController);
- method public static void setupActionBarWithNavController(androidx.appcompat.app.AppCompatActivity, androidx.navigation.NavController);
- method public static void setupActionBarWithNavController(androidx.appcompat.app.AppCompatActivity, androidx.navigation.NavController, androidx.drawerlayout.widget.DrawerLayout?);
- method public static void setupActionBarWithNavController(androidx.appcompat.app.AppCompatActivity, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(androidx.appcompat.widget.Toolbar, androidx.navigation.NavController);
- method public static void setupWithNavController(androidx.appcompat.widget.Toolbar, androidx.navigation.NavController, androidx.drawerlayout.widget.DrawerLayout?);
- method public static void setupWithNavController(androidx.appcompat.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(com.google.android.material.appbar.CollapsingToolbarLayout, androidx.appcompat.widget.Toolbar, androidx.navigation.NavController);
- method public static void setupWithNavController(com.google.android.material.appbar.CollapsingToolbarLayout, androidx.appcompat.widget.Toolbar, androidx.navigation.NavController, androidx.drawerlayout.widget.DrawerLayout?);
- method public static void setupWithNavController(com.google.android.material.appbar.CollapsingToolbarLayout, androidx.appcompat.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
- method public static void setupWithNavController(com.google.android.material.navigation.NavigationView, androidx.navigation.NavController);
- method public static void setupWithNavController(com.google.android.material.bottomnavigation.BottomNavigationView, androidx.navigation.NavController);
+ method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController);
+ method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
+ method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
+ method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController);
+ method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
+ method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
+ method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController);
+ method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController, android.support.v4.widget.DrawerLayout?);
+ method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar, androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration);
+ method public static void setupWithNavController(android.support.design.widget.NavigationView, androidx.navigation.NavController);
+ method public static void setupWithNavController(android.support.design.widget.BottomNavigationView, androidx.navigation.NavController);
}
}
diff --git a/navigation/ui/api/res-1.0.0-beta01.txt b/navigation/ui/api/res-1.0.0-beta01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/ui/api/res-1.0.0-beta01.txt
+++ /dev/null
diff --git a/navigation/ui/api/res-1.0.0-beta02.txt b/navigation/ui/api/res-1.0.0-beta02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/ui/api/res-1.0.0-beta02.txt
+++ /dev/null
diff --git a/navigation/ui/api/res-1.0.0-rc01.txt b/navigation/ui/api/res-1.0.0-rc01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/ui/api/res-1.0.0-rc01.txt
+++ /dev/null
diff --git a/navigation/ui/api/res-1.0.0-rc02.txt b/navigation/ui/api/res-1.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/ui/api/res-1.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/ui/api/res-2.0.0-rc02.txt b/navigation/ui/api/res-2.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/ui/api/res-2.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/ui/api/restricted_1.0.0-beta01.txt b/navigation/ui/api/restricted_1.0.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/ui/api/restricted_1.0.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/ui/api/restricted_1.0.0-beta02.txt b/navigation/ui/api/restricted_1.0.0-beta02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/ui/api/restricted_1.0.0-beta02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/ui/api/restricted_1.0.0-rc01.txt b/navigation/ui/api/restricted_1.0.0-rc01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/ui/api/restricted_1.0.0-rc01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/ui/api/restricted_1.0.0-rc02.txt b/navigation/ui/api/restricted_1.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/ui/api/restricted_1.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/ui/api/restricted_2.0.0-rc02.txt b/navigation/ui/api/restricted_2.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/ui/api/restricted_2.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/ui/api/restricted_current.txt b/navigation/ui/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/ui/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/ui/build.gradle b/navigation/ui/build.gradle
index 5773283..4f60eaa 100644
--- a/navigation/ui/build.gradle
+++ b/navigation/ui/build.gradle
@@ -28,10 +28,6 @@
lintOptions {
fatal("UnknownNullness")
}
-
- buildTypes.all {
- consumerProguardFiles 'proguard-rules.pro'
- }
}
dependencies {
@@ -51,6 +47,7 @@
androidTestImplementation(TEST_CORE)
androidTestImplementation(TEST_RUNNER)
androidTestImplementation(TRUTH)
+ androidTestImplementation(ESPRESSO_CORE, libs.exclude_for_espresso)
androidTestImplementation(MOCKITO_CORE, libs.exclude_bytebuddy) // DexMaker has it"s own MockMaker
androidTestImplementation(DEXMAKER_MOCKITO, libs.exclude_bytebuddy) // DexMaker has it"s own MockMaker
}
diff --git a/navigation/ui/ktx/api/1.0.0-alpha07.txt b/navigation/ui/ktx/api/1.0.0-alpha07.txt
index 6e989e6..cde4c49 100644
--- a/navigation/ui/ktx/api/1.0.0-alpha07.txt
+++ b/navigation/ui/ktx/api/1.0.0-alpha07.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.ui {
public final class ActivityKt {
diff --git a/navigation/ui/ktx/api/1.0.0-alpha08.txt b/navigation/ui/ktx/api/1.0.0-alpha08.txt
index 3d0c8fc..e2aa356 100644
--- a/navigation/ui/ktx/api/1.0.0-alpha08.txt
+++ b/navigation/ui/ktx/api/1.0.0-alpha08.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.ui {
public final class ActivityKt {
diff --git a/navigation/ui/ktx/api/1.0.0-alpha09.txt b/navigation/ui/ktx/api/1.0.0-alpha09.txt
index 393aadd..768c32b 100644
--- a/navigation/ui/ktx/api/1.0.0-alpha09.txt
+++ b/navigation/ui/ktx/api/1.0.0-alpha09.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.ui {
public final class ActivityKt {
diff --git a/navigation/ui/ktx/api/1.0.0-alpha10.txt b/navigation/ui/ktx/api/1.0.0-alpha10.txt
index 393aadd..768c32b 100644
--- a/navigation/ui/ktx/api/1.0.0-alpha10.txt
+++ b/navigation/ui/ktx/api/1.0.0-alpha10.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.ui {
public final class ActivityKt {
diff --git a/navigation/ui/ktx/api/1.0.0-alpha11.txt b/navigation/ui/ktx/api/1.0.0-alpha11.txt
index 578c40c..768c32b 100644
--- a/navigation/ui/ktx/api/1.0.0-alpha11.txt
+++ b/navigation/ui/ktx/api/1.0.0-alpha11.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.ui {
public final class ActivityKt {
@@ -9,9 +9,9 @@
public final class AppBarConfigurationKt {
ctor public AppBarConfigurationKt();
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
+ method public static androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
+ method public static androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
+ method public static androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
}
public final class BottomNavigationViewKt {
diff --git a/navigation/ui/ktx/api/1.0.0-beta01.txt b/navigation/ui/ktx/api/1.0.0-beta01.txt
deleted file mode 100644
index 578c40c..0000000
--- a/navigation/ui/ktx/api/1.0.0-beta01.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.ui {
-
- public final class ActivityKt {
- ctor public ActivityKt();
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
- public final class AppBarConfigurationKt {
- ctor public AppBarConfigurationKt();
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- }
-
- public final class BottomNavigationViewKt {
- ctor public BottomNavigationViewKt();
- method public static void setupWithNavController(android.support.design.widget.BottomNavigationView, androidx.navigation.NavController navController);
- }
-
- public final class CollapsingToolbarLayoutKt {
- ctor public CollapsingToolbarLayoutKt();
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar toolbar, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
- public final class MenuItemKt {
- ctor public MenuItemKt();
- method public static boolean onNavDestinationSelected(android.view.MenuItem, androidx.navigation.NavController navController);
- }
-
- public final class NavControllerKt {
- ctor public NavControllerKt();
- method public static boolean navigateUp(androidx.navigation.NavController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration appBarConfiguration);
- }
-
- public final class NavigationViewKt {
- ctor public NavigationViewKt();
- method public static void setupWithNavController(android.support.design.widget.NavigationView, androidx.navigation.NavController navController);
- }
-
- public final class ToolbarKt {
- ctor public ToolbarKt();
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
-}
-
diff --git a/navigation/ui/ktx/api/1.0.0-beta02.txt b/navigation/ui/ktx/api/1.0.0-beta02.txt
deleted file mode 100644
index 578c40c..0000000
--- a/navigation/ui/ktx/api/1.0.0-beta02.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.ui {
-
- public final class ActivityKt {
- ctor public ActivityKt();
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
- public final class AppBarConfigurationKt {
- ctor public AppBarConfigurationKt();
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- }
-
- public final class BottomNavigationViewKt {
- ctor public BottomNavigationViewKt();
- method public static void setupWithNavController(android.support.design.widget.BottomNavigationView, androidx.navigation.NavController navController);
- }
-
- public final class CollapsingToolbarLayoutKt {
- ctor public CollapsingToolbarLayoutKt();
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar toolbar, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
- public final class MenuItemKt {
- ctor public MenuItemKt();
- method public static boolean onNavDestinationSelected(android.view.MenuItem, androidx.navigation.NavController navController);
- }
-
- public final class NavControllerKt {
- ctor public NavControllerKt();
- method public static boolean navigateUp(androidx.navigation.NavController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration appBarConfiguration);
- }
-
- public final class NavigationViewKt {
- ctor public NavigationViewKt();
- method public static void setupWithNavController(android.support.design.widget.NavigationView, androidx.navigation.NavController navController);
- }
-
- public final class ToolbarKt {
- ctor public ToolbarKt();
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
-}
-
diff --git a/navigation/ui/ktx/api/1.0.0-rc01.txt b/navigation/ui/ktx/api/1.0.0-rc01.txt
deleted file mode 100644
index 578c40c..0000000
--- a/navigation/ui/ktx/api/1.0.0-rc01.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.ui {
-
- public final class ActivityKt {
- ctor public ActivityKt();
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
- public final class AppBarConfigurationKt {
- ctor public AppBarConfigurationKt();
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- }
-
- public final class BottomNavigationViewKt {
- ctor public BottomNavigationViewKt();
- method public static void setupWithNavController(android.support.design.widget.BottomNavigationView, androidx.navigation.NavController navController);
- }
-
- public final class CollapsingToolbarLayoutKt {
- ctor public CollapsingToolbarLayoutKt();
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar toolbar, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
- public final class MenuItemKt {
- ctor public MenuItemKt();
- method public static boolean onNavDestinationSelected(android.view.MenuItem, androidx.navigation.NavController navController);
- }
-
- public final class NavControllerKt {
- ctor public NavControllerKt();
- method public static boolean navigateUp(androidx.navigation.NavController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration appBarConfiguration);
- }
-
- public final class NavigationViewKt {
- ctor public NavigationViewKt();
- method public static void setupWithNavController(android.support.design.widget.NavigationView, androidx.navigation.NavController navController);
- }
-
- public final class ToolbarKt {
- ctor public ToolbarKt();
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
-}
-
diff --git a/navigation/ui/ktx/api/1.0.0-rc02.txt b/navigation/ui/ktx/api/1.0.0-rc02.txt
deleted file mode 100644
index 578c40c..0000000
--- a/navigation/ui/ktx/api/1.0.0-rc02.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.ui {
-
- public final class ActivityKt {
- ctor public ActivityKt();
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
- public final class AppBarConfigurationKt {
- ctor public AppBarConfigurationKt();
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- }
-
- public final class BottomNavigationViewKt {
- ctor public BottomNavigationViewKt();
- method public static void setupWithNavController(android.support.design.widget.BottomNavigationView, androidx.navigation.NavController navController);
- }
-
- public final class CollapsingToolbarLayoutKt {
- ctor public CollapsingToolbarLayoutKt();
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar toolbar, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
- public final class MenuItemKt {
- ctor public MenuItemKt();
- method public static boolean onNavDestinationSelected(android.view.MenuItem, androidx.navigation.NavController navController);
- }
-
- public final class NavControllerKt {
- ctor public NavControllerKt();
- method public static boolean navigateUp(androidx.navigation.NavController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration appBarConfiguration);
- }
-
- public final class NavigationViewKt {
- ctor public NavigationViewKt();
- method public static void setupWithNavController(android.support.design.widget.NavigationView, androidx.navigation.NavController navController);
- }
-
- public final class ToolbarKt {
- ctor public ToolbarKt();
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
- method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
-}
-
diff --git a/navigation/ui/ktx/api/2.0.0-rc02.txt b/navigation/ui/ktx/api/2.0.0-rc02.txt
deleted file mode 100644
index d20eb8f..0000000
--- a/navigation/ui/ktx/api/2.0.0-rc02.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-// Signature format: 3.0
-package androidx.navigation.ui {
-
- public final class ActivityKt {
- ctor public ActivityKt();
- method public static void setupActionBarWithNavController(androidx.appcompat.app.AppCompatActivity, androidx.navigation.NavController navController, androidx.drawerlayout.widget.DrawerLayout? drawerLayout);
- method public static void setupActionBarWithNavController(androidx.appcompat.app.AppCompatActivity, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
- public final class AppBarConfigurationKt {
- ctor public AppBarConfigurationKt();
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.drawerlayout.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, androidx.drawerlayout.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, androidx.drawerlayout.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- }
-
- public final class BottomNavigationViewKt {
- ctor public BottomNavigationViewKt();
- method public static void setupWithNavController(com.google.android.material.bottomnavigation.BottomNavigationView, androidx.navigation.NavController navController);
- }
-
- public final class CollapsingToolbarLayoutKt {
- ctor public CollapsingToolbarLayoutKt();
- method public static void setupWithNavController(com.google.android.material.appbar.CollapsingToolbarLayout, androidx.appcompat.widget.Toolbar toolbar, androidx.navigation.NavController navController, androidx.drawerlayout.widget.DrawerLayout? drawerLayout);
- method public static void setupWithNavController(com.google.android.material.appbar.CollapsingToolbarLayout, androidx.appcompat.widget.Toolbar toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
- public final class MenuItemKt {
- ctor public MenuItemKt();
- method public static boolean onNavDestinationSelected(android.view.MenuItem, androidx.navigation.NavController navController);
- }
-
- public final class NavControllerKt {
- ctor public NavControllerKt();
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.drawerlayout.widget.DrawerLayout? drawerLayout);
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration appBarConfiguration);
- }
-
- public final class NavigationViewKt {
- ctor public NavigationViewKt();
- method public static void setupWithNavController(com.google.android.material.navigation.NavigationView, androidx.navigation.NavController navController);
- }
-
- public final class ToolbarKt {
- ctor public ToolbarKt();
- method public static void setupWithNavController(androidx.appcompat.widget.Toolbar, androidx.navigation.NavController navController, androidx.drawerlayout.widget.DrawerLayout? drawerLayout);
- method public static void setupWithNavController(androidx.appcompat.widget.Toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
- }
-
-}
-
diff --git a/navigation/ui/ktx/api/current.txt b/navigation/ui/ktx/api/current.txt
index d20eb8f..768c32b 100644
--- a/navigation/ui/ktx/api/current.txt
+++ b/navigation/ui/ktx/api/current.txt
@@ -1,28 +1,28 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.navigation.ui {
public final class ActivityKt {
ctor public ActivityKt();
- method public static void setupActionBarWithNavController(androidx.appcompat.app.AppCompatActivity, androidx.navigation.NavController navController, androidx.drawerlayout.widget.DrawerLayout? drawerLayout);
- method public static void setupActionBarWithNavController(androidx.appcompat.app.AppCompatActivity, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
+ method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
+ method public static void setupActionBarWithNavController(android.support.v7.app.AppCompatActivity, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
}
public final class AppBarConfigurationKt {
ctor public AppBarConfigurationKt();
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, androidx.drawerlayout.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, androidx.drawerlayout.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
- method public static inline androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, androidx.drawerlayout.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
+ method public static androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(androidx.navigation.NavGraph navGraph, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
+ method public static androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(android.view.Menu topLevelMenu, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
+ method public static androidx.navigation.ui.AppBarConfiguration AppBarConfiguration(java.util.Set<java.lang.Integer> topLevelDestinationIds, android.support.v4.widget.DrawerLayout? drawerLayout = null, kotlin.jvm.functions.Function0<java.lang.Boolean> fallbackOnNavigateUpListener = { false });
}
public final class BottomNavigationViewKt {
ctor public BottomNavigationViewKt();
- method public static void setupWithNavController(com.google.android.material.bottomnavigation.BottomNavigationView, androidx.navigation.NavController navController);
+ method public static void setupWithNavController(android.support.design.widget.BottomNavigationView, androidx.navigation.NavController navController);
}
public final class CollapsingToolbarLayoutKt {
ctor public CollapsingToolbarLayoutKt();
- method public static void setupWithNavController(com.google.android.material.appbar.CollapsingToolbarLayout, androidx.appcompat.widget.Toolbar toolbar, androidx.navigation.NavController navController, androidx.drawerlayout.widget.DrawerLayout? drawerLayout);
- method public static void setupWithNavController(com.google.android.material.appbar.CollapsingToolbarLayout, androidx.appcompat.widget.Toolbar toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
+ method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar toolbar, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
+ method public static void setupWithNavController(android.support.design.widget.CollapsingToolbarLayout, android.support.v7.widget.Toolbar toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
}
public final class MenuItemKt {
@@ -32,19 +32,19 @@
public final class NavControllerKt {
ctor public NavControllerKt();
- method public static boolean navigateUp(androidx.navigation.NavController, androidx.drawerlayout.widget.DrawerLayout? drawerLayout);
+ method public static boolean navigateUp(androidx.navigation.NavController, android.support.v4.widget.DrawerLayout? drawerLayout);
method public static boolean navigateUp(androidx.navigation.NavController, androidx.navigation.ui.AppBarConfiguration appBarConfiguration);
}
public final class NavigationViewKt {
ctor public NavigationViewKt();
- method public static void setupWithNavController(com.google.android.material.navigation.NavigationView, androidx.navigation.NavController navController);
+ method public static void setupWithNavController(android.support.design.widget.NavigationView, androidx.navigation.NavController navController);
}
public final class ToolbarKt {
ctor public ToolbarKt();
- method public static void setupWithNavController(androidx.appcompat.widget.Toolbar, androidx.navigation.NavController navController, androidx.drawerlayout.widget.DrawerLayout? drawerLayout);
- method public static void setupWithNavController(androidx.appcompat.widget.Toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
+ method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController navController, android.support.v4.widget.DrawerLayout? drawerLayout);
+ method public static void setupWithNavController(android.support.v7.widget.Toolbar, androidx.navigation.NavController navController, androidx.navigation.ui.AppBarConfiguration configuration = AppBarConfiguration(navController.graph));
}
}
diff --git a/navigation/ui/ktx/api/res-1.0.0-beta01.txt b/navigation/ui/ktx/api/res-1.0.0-beta01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/ui/ktx/api/res-1.0.0-beta01.txt
+++ /dev/null
diff --git a/navigation/ui/ktx/api/res-1.0.0-beta02.txt b/navigation/ui/ktx/api/res-1.0.0-beta02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/ui/ktx/api/res-1.0.0-beta02.txt
+++ /dev/null
diff --git a/navigation/ui/ktx/api/res-1.0.0-rc01.txt b/navigation/ui/ktx/api/res-1.0.0-rc01.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/ui/ktx/api/res-1.0.0-rc01.txt
+++ /dev/null
diff --git a/navigation/ui/ktx/api/res-1.0.0-rc02.txt b/navigation/ui/ktx/api/res-1.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/ui/ktx/api/res-1.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/ui/ktx/api/res-2.0.0-rc02.txt b/navigation/ui/ktx/api/res-2.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/navigation/ui/ktx/api/res-2.0.0-rc02.txt
+++ /dev/null
diff --git a/navigation/ui/ktx/api/restricted_1.0.0-beta01.txt b/navigation/ui/ktx/api/restricted_1.0.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/ui/ktx/api/restricted_1.0.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/ui/ktx/api/restricted_1.0.0-beta02.txt b/navigation/ui/ktx/api/restricted_1.0.0-beta02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/ui/ktx/api/restricted_1.0.0-beta02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/ui/ktx/api/restricted_1.0.0-rc01.txt b/navigation/ui/ktx/api/restricted_1.0.0-rc01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/ui/ktx/api/restricted_1.0.0-rc01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/ui/ktx/api/restricted_1.0.0-rc02.txt b/navigation/ui/ktx/api/restricted_1.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/ui/ktx/api/restricted_1.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/ui/ktx/api/restricted_2.0.0-rc02.txt b/navigation/ui/ktx/api/restricted_2.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/ui/ktx/api/restricted_2.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/ui/ktx/api/restricted_current.txt b/navigation/ui/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/navigation/ui/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/Activity.kt b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/Activity.kt
index 93ce7be..311272e 100644
--- a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/Activity.kt
+++ b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/Activity.kt
@@ -16,8 +16,8 @@
package androidx.navigation.ui
-import androidx.appcompat.app.AppCompatActivity
-import androidx.drawerlayout.widget.DrawerLayout
+import android.support.v4.widget.DrawerLayout
+import android.support.v7.app.AppCompatActivity
import androidx.navigation.NavController
/**
diff --git a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/AppBarConfiguration.kt b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/AppBarConfiguration.kt
index 65e2dc5..5168e27 100644
--- a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/AppBarConfiguration.kt
+++ b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/AppBarConfiguration.kt
@@ -18,8 +18,8 @@
package androidx.navigation.ui
+import android.support.v4.widget.DrawerLayout
import android.view.Menu
-import androidx.drawerlayout.widget.DrawerLayout
import androidx.navigation.NavGraph
/**
diff --git a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/BottomNavigationView.kt b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/BottomNavigationView.kt
index 5787829..a23285b 100644
--- a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/BottomNavigationView.kt
+++ b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/BottomNavigationView.kt
@@ -16,8 +16,8 @@
package androidx.navigation.ui
+import android.support.design.widget.BottomNavigationView
import androidx.navigation.NavController
-import com.google.android.material.bottomnavigation.BottomNavigationView
/**
* Sets up a [BottomNavigationView] for use with a [NavController]. This will call
diff --git a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/CollapsingToolbarLayout.kt b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/CollapsingToolbarLayout.kt
index 89c3859..b18ceb7 100644
--- a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/CollapsingToolbarLayout.kt
+++ b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/CollapsingToolbarLayout.kt
@@ -16,10 +16,10 @@
package androidx.navigation.ui
-import androidx.appcompat.widget.Toolbar
-import androidx.drawerlayout.widget.DrawerLayout
+import android.support.design.widget.CollapsingToolbarLayout
+import android.support.v4.widget.DrawerLayout
+import android.support.v7.widget.Toolbar
import androidx.navigation.NavController
-import com.google.android.material.appbar.CollapsingToolbarLayout
/**
* Sets up a [CollapsingToolbarLayout] and [Toolbar] for use with a [NavController].
diff --git a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/NavController.kt b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/NavController.kt
index df21955..07004a8 100644
--- a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/NavController.kt
+++ b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/NavController.kt
@@ -16,7 +16,7 @@
package androidx.navigation.ui
-import androidx.drawerlayout.widget.DrawerLayout
+import android.support.v4.widget.DrawerLayout
import androidx.navigation.NavController
/**
diff --git a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/NavigationView.kt b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/NavigationView.kt
index dd1b4b3..71e1db5 100644
--- a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/NavigationView.kt
+++ b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/NavigationView.kt
@@ -16,8 +16,8 @@
package androidx.navigation.ui
+import android.support.design.widget.NavigationView
import androidx.navigation.NavController
-import com.google.android.material.navigation.NavigationView
/**
* Sets up a [NavigationView] for use with a [NavController]. This will call
diff --git a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/Toolbar.kt b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/Toolbar.kt
index af01cd1..9933610 100644
--- a/navigation/ui/ktx/src/main/java/androidx/navigation/ui/Toolbar.kt
+++ b/navigation/ui/ktx/src/main/java/androidx/navigation/ui/Toolbar.kt
@@ -16,8 +16,8 @@
package androidx.navigation.ui
-import androidx.appcompat.widget.Toolbar
-import androidx.drawerlayout.widget.DrawerLayout
+import android.support.v4.widget.DrawerLayout
+import android.support.v7.widget.Toolbar
import androidx.navigation.NavController
/**
diff --git a/navigation/ui/proguard-rules.pro b/navigation/ui/proguard-rules.pro
deleted file mode 100644
index b069ba1..0000000
--- a/navigation/ui/proguard-rules.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (C) 2019 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.
-
-# setProgress is called via an ObjectAnimator in AbstractAppBarOnDestinationChangedListener
--keepclassmembers class android.support.v7.graphics.drawable.DrawerArrowDrawable {
- void setProgress(float);
-}
diff --git a/navigation/ui/src/androidTest/java/androidx/navigation/ui/AppBarConfigurationTest.kt b/navigation/ui/src/androidTest/java/androidx/navigation/ui/AppBarConfigurationTest.kt
index 490e0e7e..4589745 100644
--- a/navigation/ui/src/androidTest/java/androidx/navigation/ui/AppBarConfigurationTest.kt
+++ b/navigation/ui/src/androidTest/java/androidx/navigation/ui/AppBarConfigurationTest.kt
@@ -17,20 +17,20 @@
package androidx.navigation.ui
import android.content.Context
-import androidx.drawerlayout.widget.DrawerLayout
+import android.support.v4.widget.DrawerLayout
import androidx.navigation.NavController
import androidx.navigation.createGraph
import androidx.navigation.plusAssign
import androidx.navigation.testing.TestNavigator
import androidx.navigation.testing.test
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
+import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.mock
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4::class)
class AppBarConfigurationTest {
diff --git a/navigation/ui/src/main/java/androidx/navigation/ui/AbstractAppBarOnDestinationChangedListener.java b/navigation/ui/src/main/java/androidx/navigation/ui/AbstractAppBarOnDestinationChangedListener.java
index 9a792b3..afc5bb9 100644
--- a/navigation/ui/src/main/java/androidx/navigation/ui/AbstractAppBarOnDestinationChangedListener.java
+++ b/navigation/ui/src/main/java/androidx/navigation/ui/AbstractAppBarOnDestinationChangedListener.java
@@ -21,14 +21,14 @@
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.annotation.RestrictTo;
+import android.support.annotation.StringRes;
+import android.support.v4.widget.DrawerLayout;
+import android.support.v7.graphics.drawable.DrawerArrowDrawable;
import android.text.TextUtils;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RestrictTo;
-import androidx.annotation.StringRes;
-import androidx.appcompat.graphics.drawable.DrawerArrowDrawable;
-import androidx.drawerlayout.widget.DrawerLayout;
import androidx.navigation.NavController;
import androidx.navigation.NavDestination;
diff --git a/navigation/ui/src/main/java/androidx/navigation/ui/ActionBarOnDestinationChangedListener.java b/navigation/ui/src/main/java/androidx/navigation/ui/ActionBarOnDestinationChangedListener.java
index 18fce74..6c86657 100644
--- a/navigation/ui/src/main/java/androidx/navigation/ui/ActionBarOnDestinationChangedListener.java
+++ b/navigation/ui/src/main/java/androidx/navigation/ui/ActionBarOnDestinationChangedListener.java
@@ -17,13 +17,12 @@
package androidx.navigation.ui;
import android.graphics.drawable.Drawable;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RestrictTo;
-import androidx.annotation.StringRes;
-import androidx.appcompat.app.ActionBar;
-import androidx.appcompat.app.ActionBarDrawerToggle;
-import androidx.appcompat.app.AppCompatActivity;
+import android.support.annotation.NonNull;
+import android.support.annotation.RestrictTo;
+import android.support.annotation.StringRes;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.ActionBarDrawerToggle;
+import android.support.v7.app.AppCompatActivity;
/**
* The OnDestinationChangedListener specifically for keeping the ActionBar updated.
diff --git a/navigation/ui/src/main/java/androidx/navigation/ui/AppBarConfiguration.java b/navigation/ui/src/main/java/androidx/navigation/ui/AppBarConfiguration.java
index 187cdba..3cd8c81 100644
--- a/navigation/ui/src/main/java/androidx/navigation/ui/AppBarConfiguration.java
+++ b/navigation/ui/src/main/java/androidx/navigation/ui/AppBarConfiguration.java
@@ -17,12 +17,12 @@
package androidx.navigation.ui;
import android.annotation.SuppressLint;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.widget.DrawerLayout;
import android.view.Menu;
import android.view.MenuItem;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.drawerlayout.widget.DrawerLayout;
import androidx.navigation.NavGraph;
import java.util.HashSet;
@@ -30,9 +30,9 @@
/**
* Configuration options for {@link NavigationUI} methods that interact with implementations of the
- * app bar pattern such as {@link androidx.appcompat.widget.Toolbar},
- * {@link com.google.android.material.appbar.CollapsingToolbarLayout}, and
- * {@link androidx.appcompat.app.ActionBar}.
+ * app bar pattern such as {@link android.support.v7.widget.Toolbar},
+ * {@link android.support.design.widget.CollapsingToolbarLayout}, and
+ * {@link android.support.v7.app.ActionBar}.
*/
public final class AppBarConfiguration {
/**
diff --git a/navigation/ui/src/main/java/androidx/navigation/ui/CollapsingToolbarOnDestinationChangedListener.java b/navigation/ui/src/main/java/androidx/navigation/ui/CollapsingToolbarOnDestinationChangedListener.java
index e0bee0c..af1becd 100644
--- a/navigation/ui/src/main/java/androidx/navigation/ui/CollapsingToolbarOnDestinationChangedListener.java
+++ b/navigation/ui/src/main/java/androidx/navigation/ui/CollapsingToolbarOnDestinationChangedListener.java
@@ -18,17 +18,16 @@
import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.annotation.RestrictTo;
+import android.support.annotation.StringRes;
+import android.support.design.widget.CollapsingToolbarLayout;
+import android.support.v7.widget.Toolbar;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RestrictTo;
-import androidx.annotation.StringRes;
-import androidx.appcompat.widget.Toolbar;
import androidx.navigation.NavController;
import androidx.navigation.NavDestination;
-import com.google.android.material.appbar.CollapsingToolbarLayout;
-
import java.lang.ref.WeakReference;
/**
diff --git a/navigation/ui/src/main/java/androidx/navigation/ui/NavigationUI.java b/navigation/ui/src/main/java/androidx/navigation/ui/NavigationUI.java
index c5645181..9debc64 100644
--- a/navigation/ui/src/main/java/androidx/navigation/ui/NavigationUI.java
+++ b/navigation/ui/src/main/java/androidx/navigation/ui/NavigationUI.java
@@ -17,30 +17,29 @@
package androidx.navigation.ui;
import android.os.Bundle;
+import android.support.annotation.IdRes;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.design.widget.BottomNavigationView;
+import android.support.design.widget.BottomSheetBehavior;
+import android.support.design.widget.CollapsingToolbarLayout;
+import android.support.design.widget.CoordinatorLayout;
+import android.support.design.widget.NavigationView;
+import android.support.v4.view.GravityCompat;
+import android.support.v4.widget.DrawerLayout;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
-import androidx.annotation.IdRes;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.appcompat.widget.Toolbar;
-import androidx.coordinatorlayout.widget.CoordinatorLayout;
-import androidx.core.view.GravityCompat;
-import androidx.drawerlayout.widget.DrawerLayout;
import androidx.navigation.NavController;
import androidx.navigation.NavDestination;
import androidx.navigation.NavGraph;
import androidx.navigation.NavOptions;
-import com.google.android.material.appbar.CollapsingToolbarLayout;
-import com.google.android.material.bottomnavigation.BottomNavigationView;
-import com.google.android.material.bottomsheet.BottomSheetBehavior;
-import com.google.android.material.navigation.NavigationView;
-
import java.lang.ref.WeakReference;
import java.util.Set;
@@ -406,7 +405,7 @@
* the drawer will be closed when a menu item is selected.
* <p>
* Similarly, if the {@link NavigationView} has a {@link BottomSheetBehavior} associated with
- * it (as is the case when using a {@link com.google.android.material.bottomsheet.BottomSheetDialog}),
+ * it (as is the case when using a {@link android.support.design.widget.BottomSheetDialog}),
* the bottom sheet will be hidden when a menu item is selected.
*
* @param navigationView The NavigationView that should be kept in sync with changes to the
diff --git a/navigation/ui/src/main/java/androidx/navigation/ui/ToolbarOnDestinationChangedListener.java b/navigation/ui/src/main/java/androidx/navigation/ui/ToolbarOnDestinationChangedListener.java
index a37cbf1..37ed06a 100644
--- a/navigation/ui/src/main/java/androidx/navigation/ui/ToolbarOnDestinationChangedListener.java
+++ b/navigation/ui/src/main/java/androidx/navigation/ui/ToolbarOnDestinationChangedListener.java
@@ -18,12 +18,12 @@
import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.annotation.RestrictTo;
+import android.support.annotation.StringRes;
+import android.support.v7.widget.Toolbar;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RestrictTo;
-import androidx.annotation.StringRes;
-import androidx.appcompat.widget.Toolbar;
import androidx.navigation.NavController;
import androidx.navigation.NavDestination;
diff --git a/navigation/ui/src/main/res/values-bs/strings.xml b/navigation/ui/src/main/res/values-bs/strings.xml
index f4b93f0..39602a7 100644
--- a/navigation/ui/src/main/res/values-bs/strings.xml
+++ b/navigation/ui/src/main/res/values-bs/strings.xml
@@ -17,6 +17,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="nav_app_bar_open_drawer_description" msgid="7456070600745802113">"Otvaranje ladice za navigaciju"</string>
+ <string name="nav_app_bar_open_drawer_description" msgid="7456070600745802113">"Otvaranje panela za navigaciju"</string>
<string name="nav_app_bar_navigate_up_description" msgid="6301633601645100427">"Idi gore"</string>
</resources>
diff --git a/navigation/ui/src/main/res/values-ca/strings.xml b/navigation/ui/src/main/res/values-ca/strings.xml
index 8930205..fc09c49 100644
--- a/navigation/ui/src/main/res/values-ca/strings.xml
+++ b/navigation/ui/src/main/res/values-ca/strings.xml
@@ -18,5 +18,5 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="nav_app_bar_open_drawer_description" msgid="7456070600745802113">"Obre el tauler de navegació"</string>
- <string name="nav_app_bar_navigate_up_description" msgid="6301633601645100427">"Navega cap amunt"</string>
+ <string name="nav_app_bar_navigate_up_description" msgid="6301633601645100427">"Desplaça\'t cap amunt"</string>
</resources>
diff --git a/paging/common/api/2.1.0-alpha01.txt b/paging/common/api/2.1.0-alpha01.txt
index 4bceb7e..c8e0be1 100644
--- a/paging/common/api/2.1.0-alpha01.txt
+++ b/paging/common/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public abstract class DataSource<Key, Value> {
diff --git a/paging/common/api/2.1.0-beta01.txt b/paging/common/api/2.1.0-beta01.txt
index 4bceb7e..c8e0be1 100644
--- a/paging/common/api/2.1.0-beta01.txt
+++ b/paging/common/api/2.1.0-beta01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public abstract class DataSource<Key, Value> {
diff --git a/paging/common/api/2.2.0-alpha01.txt b/paging/common/api/2.2.0-alpha01.txt
index cf13c47..e5a1266 100644
--- a/paging/common/api/2.2.0-alpha01.txt
+++ b/paging/common/api/2.2.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public abstract class DataSource<Key, Value> {
@@ -153,7 +153,7 @@
method public androidx.paging.PagedList.Config.Builder setPrefetchDistance(@IntRange(from=0) int);
}
- public enum PagedList.LoadState {
+ public static enum PagedList.LoadState {
enum_constant public static final androidx.paging.PagedList.LoadState DONE;
enum_constant public static final androidx.paging.PagedList.LoadState ERROR;
enum_constant public static final androidx.paging.PagedList.LoadState IDLE;
@@ -165,7 +165,7 @@
method public void onLoadStateChanged(androidx.paging.PagedList.LoadType, androidx.paging.PagedList.LoadState, Throwable?);
}
- public enum PagedList.LoadType {
+ public static enum PagedList.LoadType {
enum_constant public static final androidx.paging.PagedList.LoadType END;
enum_constant public static final androidx.paging.PagedList.LoadType REFRESH;
enum_constant public static final androidx.paging.PagedList.LoadType START;
diff --git a/paging/common/api/current.txt b/paging/common/api/current.txt
index cf13c47..e5a1266 100644
--- a/paging/common/api/current.txt
+++ b/paging/common/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public abstract class DataSource<Key, Value> {
@@ -153,7 +153,7 @@
method public androidx.paging.PagedList.Config.Builder setPrefetchDistance(@IntRange(from=0) int);
}
- public enum PagedList.LoadState {
+ public static enum PagedList.LoadState {
enum_constant public static final androidx.paging.PagedList.LoadState DONE;
enum_constant public static final androidx.paging.PagedList.LoadState ERROR;
enum_constant public static final androidx.paging.PagedList.LoadState IDLE;
@@ -165,7 +165,7 @@
method public void onLoadStateChanged(androidx.paging.PagedList.LoadType, androidx.paging.PagedList.LoadState, Throwable?);
}
- public enum PagedList.LoadType {
+ public static enum PagedList.LoadType {
enum_constant public static final androidx.paging.PagedList.LoadType END;
enum_constant public static final androidx.paging.PagedList.LoadType REFRESH;
enum_constant public static final androidx.paging.PagedList.LoadType START;
diff --git a/paging/common/api/restricted_2.1.0-beta01.txt b/paging/common/api/restricted_2.1.0-beta01.txt
deleted file mode 100644
index d25e19d..0000000
--- a/paging/common/api/restricted_2.1.0-beta01.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-// Signature format: 3.0
-package androidx.paging {
-
- @Deprecated @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class TiledDataSource<T> extends androidx.paging.PositionalDataSource<T> {
- ctor public TiledDataSource();
- method @WorkerThread public abstract int countItems();
- method public void loadInitial(androidx.paging.PositionalDataSource.LoadInitialParams, androidx.paging.PositionalDataSource.LoadInitialCallback<T>);
- method @WorkerThread public abstract java.util.List<T>? loadRange(int, int);
- method public void loadRange(androidx.paging.PositionalDataSource.LoadRangeParams, androidx.paging.PositionalDataSource.LoadRangeCallback<T>);
- }
-
-}
-
diff --git a/paging/common/api/restricted_2.2.0-alpha01.ignore b/paging/common/api/restricted_2.2.0-alpha01.ignore
deleted file mode 100644
index c564305..0000000
--- a/paging/common/api/restricted_2.2.0-alpha01.ignore
+++ /dev/null
@@ -1,5 +0,0 @@
-// Baseline format: 1.0
-RemovedMethod: androidx.paging.TiledDataSource#TiledDataSource():
- Removed constructor androidx.paging.TiledDataSource()
-
-
diff --git a/paging/common/api/restricted_2.2.0-alpha01.txt b/paging/common/api/restricted_2.2.0-alpha01.txt
deleted file mode 100644
index 48a4397..0000000
--- a/paging/common/api/restricted_2.2.0-alpha01.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-// Signature format: 3.0
-package androidx.paging {
-
- @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class TiledDataSource<T> extends androidx.paging.PositionalDataSource<T> {
- method @Deprecated @WorkerThread public abstract int countItems();
- method @Deprecated public void loadInitial(androidx.paging.PositionalDataSource.LoadInitialParams, androidx.paging.PositionalDataSource.LoadInitialCallback<T>);
- method @Deprecated @WorkerThread public abstract java.util.List<T>? loadRange(int, int);
- method @Deprecated public void loadRange(androidx.paging.PositionalDataSource.LoadRangeParams, androidx.paging.PositionalDataSource.LoadRangeCallback<T>);
- }
-
-}
-
-package androidx.paging.futures {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public class DirectExecutor implements java.util.concurrent.Executor {
- method public void execute(Runnable);
- field public static androidx.paging.futures.DirectExecutor INSTANCE;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public interface FutureCallback<V> {
- method public void onError(Throwable);
- method public void onSuccess(V!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public class Futures {
- method public static <I, O> com.google.common.util.concurrent.ListenableFuture<O> transform(com.google.common.util.concurrent.ListenableFuture<I>, androidx.arch.core.util.Function<? super I,? extends O>, java.util.concurrent.Executor);
- }
-
-}
-
diff --git a/paging/common/api/restricted_current.txt b/paging/common/api/restricted_current.txt
deleted file mode 100644
index 48a4397..0000000
--- a/paging/common/api/restricted_current.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-// Signature format: 3.0
-package androidx.paging {
-
- @Deprecated @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class TiledDataSource<T> extends androidx.paging.PositionalDataSource<T> {
- method @Deprecated @WorkerThread public abstract int countItems();
- method @Deprecated public void loadInitial(androidx.paging.PositionalDataSource.LoadInitialParams, androidx.paging.PositionalDataSource.LoadInitialCallback<T>);
- method @Deprecated @WorkerThread public abstract java.util.List<T>? loadRange(int, int);
- method @Deprecated public void loadRange(androidx.paging.PositionalDataSource.LoadRangeParams, androidx.paging.PositionalDataSource.LoadRangeCallback<T>);
- }
-
-}
-
-package androidx.paging.futures {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public class DirectExecutor implements java.util.concurrent.Executor {
- method public void execute(Runnable);
- field public static androidx.paging.futures.DirectExecutor INSTANCE;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public interface FutureCallback<V> {
- method public void onError(Throwable);
- method public void onSuccess(V!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public class Futures {
- method public static <I, O> com.google.common.util.concurrent.ListenableFuture<O> transform(com.google.common.util.concurrent.ListenableFuture<I>, androidx.arch.core.util.Function<? super I,? extends O>, java.util.concurrent.Executor);
- }
-
-}
-
diff --git a/paging/common/build.gradle b/paging/common/build.gradle
index c30b40e..b76372c 100644
--- a/paging/common/build.gradle
+++ b/paging/common/build.gradle
@@ -29,14 +29,12 @@
}
dependencies {
- compile(project(":annotation"))
+ compile(SUPPORT_ANNOTATIONS)
compile(ARCH_CORE_COMMON)
- compile("androidx.concurrent:concurrent-futures:1.0.0-alpha02")
testCompile(JUNIT)
testCompile(MOCKITO_CORE)
testCompile(KOTLIN_STDLIB)
- testCompile(GUAVA)
}
supportLibrary {
diff --git a/paging/common/ktx/api/2.1.0-alpha01.txt b/paging/common/ktx/api/2.1.0-alpha01.txt
index 6d9cc829..0f070c2 100644
--- a/paging/common/ktx/api/2.1.0-alpha01.txt
+++ b/paging/common/ktx/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class PagedListConfigKt {
diff --git a/paging/common/ktx/api/2.1.0-beta01.txt b/paging/common/ktx/api/2.1.0-beta01.txt
index 6d9cc829..0f070c2 100644
--- a/paging/common/ktx/api/2.1.0-beta01.txt
+++ b/paging/common/ktx/api/2.1.0-beta01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class PagedListConfigKt {
diff --git a/paging/common/ktx/api/2.2.0-alpha01.txt b/paging/common/ktx/api/2.2.0-alpha01.txt
index 6d9cc829..0f070c2 100644
--- a/paging/common/ktx/api/2.2.0-alpha01.txt
+++ b/paging/common/ktx/api/2.2.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class PagedListConfigKt {
diff --git a/paging/common/ktx/api/current.txt b/paging/common/ktx/api/current.txt
index 6d9cc829..0f070c2 100644
--- a/paging/common/ktx/api/current.txt
+++ b/paging/common/ktx/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class PagedListConfigKt {
diff --git a/paging/common/ktx/api/restricted_2.1.0-beta01.txt b/paging/common/ktx/api/restricted_2.1.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/common/ktx/api/restricted_2.1.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/common/ktx/api/restricted_2.2.0-alpha01.txt b/paging/common/ktx/api/restricted_2.2.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/common/ktx/api/restricted_2.2.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/common/ktx/api/restricted_current.txt b/paging/common/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/common/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/common/src/main/java/androidx/paging/PagedList.java b/paging/common/src/main/java/androidx/paging/PagedList.java
index be9079c..9070301 100644
--- a/paging/common/src/main/java/androidx/paging/PagedList.java
+++ b/paging/common/src/main/java/androidx/paging/PagedList.java
@@ -760,7 +760,7 @@
}
/** @hide */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
void offsetAccessIndices(int offset) {
// update last loadAround index
mLastLoad += offset;
diff --git a/paging/common/src/main/java/androidx/paging/PositionalDataSource.java b/paging/common/src/main/java/androidx/paging/PositionalDataSource.java
index 158c950..0be0a0a 100644
--- a/paging/common/src/main/java/androidx/paging/PositionalDataSource.java
+++ b/paging/common/src/main/java/androidx/paging/PositionalDataSource.java
@@ -585,22 +585,12 @@
void dispatchLoadInitial(@Nullable Integer position, int initialLoadSize, int pageSize,
boolean enablePlaceholders, @NonNull Executor mainThreadExecutor,
@NonNull PageResult.Receiver<Value> receiver) {
-
- if (position == null) {
- position = 0;
- } else {
- // snap load size to page multiple (minimum two)
- initialLoadSize = (Math.max(initialLoadSize / pageSize, 2)) * pageSize;
-
- // move start pos so that the load is centered around the key, not starting at it
- final int idealStart = position - initialLoadSize / 2;
- position = Math.max(0, idealStart / pageSize * pageSize);
- }
+ final int convertPosition = position == null ? 0 : position;
// Note enablePlaceholders will be false here, but we don't have a way to communicate
// this to PositionalDataSource. This is fine, because only the list and its position
// offset will be consumed by the LoadInitialCallback.
- mSource.dispatchLoadInitial(false, position, initialLoadSize,
+ mSource.dispatchLoadInitial(false, convertPosition, initialLoadSize,
pageSize, mainThreadExecutor, receiver);
}
diff --git a/paging/common/src/main/java/androidx/paging/TiledDataSource.java b/paging/common/src/main/java/androidx/paging/TiledDataSource.java
index 7c45879..5f86421 100644
--- a/paging/common/src/main/java/androidx/paging/TiledDataSource.java
+++ b/paging/common/src/main/java/androidx/paging/TiledDataSource.java
@@ -34,7 +34,7 @@
*/
@SuppressWarnings("DeprecatedIsStillUsed")
@Deprecated
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public abstract class TiledDataSource<T> extends PositionalDataSource<T> {
@WorkerThread
diff --git a/paging/common/src/main/java/androidx/paging/futures/DirectExecutor.java b/paging/common/src/main/java/androidx/paging/futures/DirectExecutor.java
deleted file mode 100644
index 46eeb29..0000000
--- a/paging/common/src/main/java/androidx/paging/futures/DirectExecutor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2019 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.paging.futures;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RestrictTo;
-
-import java.util.concurrent.Executor;
-
-/**
- * Executor that runs each task in the thread that invokes {@link Executor#execute execute}
- * @hide
- */
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-public class DirectExecutor implements Executor {
- /**
- * Returns an {@link Executor} that runs each task in the thread that invokes {@link
- * Executor#execute execute}.
- *
- * <p>This instance is equivalent to:
- *
- * <pre>{@code
- * final class DirectExecutor implements Executor {
- * public void execute(Runnable r) {
- * r.run();
- * }
- * }
- * }</pre>
- */
- @NonNull
- public static DirectExecutor INSTANCE = new DirectExecutor();
-
- private DirectExecutor() {}
- @Override
- public void execute(@NonNull Runnable runnable) {
- runnable.run();
- }
-}
diff --git a/paging/common/src/main/java/androidx/paging/futures/FutureCallback.java b/paging/common/src/main/java/androidx/paging/futures/FutureCallback.java
deleted file mode 100644
index 7d4aa0d..0000000
--- a/paging/common/src/main/java/androidx/paging/futures/FutureCallback.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2019 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.paging.futures;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RestrictTo;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-
-/**
- * A callback for accepting the results of a {@link Future} computation asynchronously.
- *
- * <p>To attach to a {@link ListenableFuture} use {@link Futures#addCallback}.
- * @param <V> Type of the Future result.
- * @hide
- */
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-public interface FutureCallback<V> {
- /** Invoked with the result of the {@code Future} computation when it is successful. */
- @SuppressWarnings("UnknownNullness")
- void onSuccess(V value);
-
- /**
- * Invoked when a {@code Future} computation fails or is canceled.
- *
- * <p>If the future's {@link Future#get() get} method throws an {@link ExecutionException}, then
- * the cause is passed to this method. Any other thrown object is passed unaltered.
- */
- void onError(@NonNull Throwable throwable);
-}
diff --git a/paging/common/src/main/java/androidx/paging/futures/Futures.java b/paging/common/src/main/java/androidx/paging/futures/Futures.java
deleted file mode 100644
index 272512b..0000000
--- a/paging/common/src/main/java/androidx/paging/futures/Futures.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright 2019 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.paging.futures;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RestrictTo;
-import androidx.arch.core.util.Function;
-import androidx.concurrent.futures.ResolvableFuture;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executor;
-
-/**
- * @hide
- */
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-public class Futures {
- private Futures() {}
-
- private static <V> void addCallback(@NonNull final ListenableFuture<V> future,
- @NonNull final FutureCallback<? super V> callback, @NonNull Executor executor) {
- future.addListener(new Runnable() {
- @Override
- public void run() {
- final V value;
- try {
- value = future.get();
- } catch (ExecutionException e) {
- callback.onError(e.getCause());
- return;
- } catch (Throwable e) {
- callback.onError(e);
- return;
- }
- callback.onSuccess(value);
- }
- }, executor);
- }
-
- /**
- * Returns a new {@code Future} whose result is derived from the result of the given {@code
- * Future}. If {@code input} fails, the returned {@code Future} fails with the same exception
- * (and the function is not invoked). Example usage:
- *
- * <pre>{@code
- * ListenableFuture<QueryResult> queryFuture = ...;
- * ListenableFuture<List<Row>> rowsFuture =
- * transform(queryFuture, QueryResult::getRows, executor);
- * }</pre>
- *
- * <p>When selecting an executor, note that {@code directExecutor} is dangerous in some cases.
- * See the discussion in the {@link ListenableFuture#addListener ListenableFuture.addListener}
- * documentation. All its warnings about heavyweight listeners are also applicable to
- * heavyweight functions passed to this method.
- *
- * <p>The returned {@code Future} attempts to keep its cancellation state in sync with that of
- * the input future. That is, if the returned {@code Future} is cancelled, it will attempt to
- * cancel the input, and if the input is cancelled, the returned {@code Future} will receive a
- * callback in which it will attempt to cancel itself.
- *
- * <p>An example use of this method is to convert a serializable object returned from an RPC
- * into a POJO.
- *
- * @param input The future to transform
- * @param function A Function to transform the results of the provided future to the results of
- * the returned future.
- * @param executor Executor to run the function in.
- * @return A future that holds result of the transformation.
- */
- @NonNull
- public static <I, O> ListenableFuture<O> transform(
- @NonNull final ListenableFuture<I> input,
- @NonNull final Function<? super I, ? extends O> function,
- @NonNull final Executor executor) {
- final ResolvableFuture<O> out = ResolvableFuture.create();
-
- // add success/error callback
- addCallback(input, new FutureCallback<I>() {
- @Override
- public void onSuccess(I value) {
- out.set(function.apply(value));
- }
-
- @Override
- public void onError(@NonNull Throwable throwable) {
- out.setException(throwable);
- }
- }, executor);
-
- // propagate output future's cancellation to input future
- addCallback(out, new FutureCallback<O>() {
- @Override
- public void onSuccess(O value) {}
-
- @Override
- public void onError(@NonNull Throwable throwable) {
- if (throwable instanceof CancellationException) {
- input.cancel(false);
- }
- }
- }, executor);
- return out;
- }
-}
diff --git a/paging/common/src/test/java/androidx/paging/PositionalDataSourceTest.kt b/paging/common/src/test/java/androidx/paging/PositionalDataSourceTest.kt
index 4993dbf..308d378 100644
--- a/paging/common/src/test/java/androidx/paging/PositionalDataSourceTest.kt
+++ b/paging/common/src/test/java/androidx/paging/PositionalDataSourceTest.kt
@@ -90,72 +90,30 @@
// verify that prepend / append work correctly with a PositionalDataSource, made contiguous
val config = PagedList.Config.Builder()
.setPageSize(10)
- .setInitialLoadSizeHint(20)
+ .setInitialLoadSizeHint(10)
.setEnablePlaceholders(true)
.build()
val dataSource: PositionalDataSource<Int> = ListDataSource((0..99).toList())
val testExecutor = TestExecutor()
val pagedList = ContiguousPagedList(dataSource.wrapAsContiguousWithoutPlaceholders(),
- testExecutor, testExecutor, null, config, 25,
+ testExecutor, testExecutor, null, config, 15,
ContiguousPagedList.LAST_LOAD_UNSPECIFIED)
- assertEquals((10..29).toList(), pagedList)
+ assertEquals((10..19).toList(), pagedList)
- // prepend works correctly
+ // prepend + append work correctly
pagedList.loadAround(5)
testExecutor.executeAll()
assertEquals((0..29).toList(), pagedList)
// and load the rest of the data to be sure further appends work
- for (i in (3..9)) {
+ for (i in (2..9)) {
pagedList.loadAround(i * 10 - 5)
testExecutor.executeAll()
assertEquals((0..i * 10 + 9).toList(), pagedList)
}
}
- private fun validatePositionOffset(enablePlaceholders: Boolean) {
- val config = PagedList.Config.Builder()
- .setPageSize(10)
- .setEnablePlaceholders(enablePlaceholders)
- .build()
- val success = mutableListOf(false)
- val dataSource = object : PositionalDataSource<String>() {
- override fun loadInitial(
- params: LoadInitialParams,
- callback: LoadInitialCallback<String>
- ) {
- if (enablePlaceholders) {
- // 36 - ((10 * 3) / 2) = 21, round down to 20
- assertEquals(20, params.requestedStartPosition)
- } else {
- }
- success[0] = true
- }
-
- override fun loadRange(params: LoadRangeParams, callback: LoadRangeCallback<String>) {
- fail("loadRange not expected")
- }
- }
-
- PagedList.Builder(dataSource, config)
- .setFetchExecutor { it.run() }
- .setNotifyExecutor { it.run() }
- .setInitialKey(36)
- .build()
- assertTrue(success[0])
- }
-
- @Test
- fun initialPositionOffset() {
- validatePositionOffset(true)
- }
-
- @Test
- fun initialPositionOffsetAsContiguous() {
- validatePositionOffset(false)
- }
-
private fun performLoadInitial(
enablePlaceholders: Boolean = true,
invalidateDataSource: Boolean = false,
diff --git a/paging/common/src/test/java/androidx/paging/TiledPagedListTest.kt b/paging/common/src/test/java/androidx/paging/TiledPagedListTest.kt
index 4b03112..465cf67 100644
--- a/paging/common/src/test/java/androidx/paging/TiledPagedListTest.kt
+++ b/paging/common/src/test/java/androidx/paging/TiledPagedListTest.kt
@@ -454,7 +454,7 @@
val config = PagedList.Config.Builder()
.setPageSize(PAGE_SIZE)
.setPrefetchDistance(PAGE_SIZE)
- .setInitialLoadSizeHint(2 * PAGE_SIZE)
+ .setInitialLoadSizeHint(PAGE_SIZE)
.setEnablePlaceholders(false)
.build()
val pagedList = PagedList.Builder<Int, Item>(ListDataSource(ITEMS), config)
@@ -468,7 +468,7 @@
@Suppress("UNCHECKED_CAST")
val contiguousPagedList = pagedList as ContiguousPagedList<Int, Item>
assertEquals(0, contiguousPagedList.mStorage.leadingNullCount)
- assertEquals(2 * PAGE_SIZE, contiguousPagedList.mStorage.storageCount)
+ assertEquals(PAGE_SIZE, contiguousPagedList.mStorage.storageCount)
assertEquals(0, contiguousPagedList.mStorage.trailingNullCount)
}
diff --git a/paging/common/src/test/java/androidx/paging/futures/FuturesTest.kt b/paging/common/src/test/java/androidx/paging/futures/FuturesTest.kt
deleted file mode 100644
index 9301bd0..0000000
--- a/paging/common/src/test/java/androidx/paging/futures/FuturesTest.kt
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 2019 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.paging.futures
-
-import androidx.concurrent.futures.ResolvableFuture
-import com.google.common.util.concurrent.Futures
-import com.google.common.util.concurrent.ListenableFuture
-import com.google.common.util.concurrent.SettableFuture
-import org.junit.Assert.assertEquals
-import org.junit.Assert.assertFalse
-import org.junit.Assert.assertTrue
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.Parameterized
-import java.util.concurrent.CancellationException
-import java.util.concurrent.ExecutionException
-
-@RunWith(Parameterized::class)
-class FuturesTest(private val type: String) {
- private fun testFutures(tester: (ListenableFuture<String>, ListenableFuture<String>) -> Unit) {
- if (type == guava) {
- val future = SettableFuture.create<String>()
-
- val wrapper = Futures.transform(
- future,
- com.google.common.base.Function<String, String> { it -> it },
- DirectExecutor.INSTANCE)
-
- tester(future, wrapper)
- } else {
- val future = ResolvableFuture.create<String>()
-
- val wrapper = androidx.paging.futures.Futures.transform(
- future,
- androidx.arch.core.util.Function<String, String> { it -> it },
- DirectExecutor.INSTANCE)
- tester(future, wrapper)
- }
- }
-
- private fun <T> ListenableFuture<T>.set(value: T) {
- if (type == guava) {
- (this as SettableFuture).set(value)
- } else {
- (this as ResolvableFuture).set(value)
- }
- }
-
- private fun <T> ListenableFuture<T>.setException(throwable: Throwable) {
- if (type == guava) {
- (this as SettableFuture).setException(throwable)
- } else {
- (this as ResolvableFuture).setException(throwable)
- }
- }
-
- private fun <T> ListenableFuture<T>.verifyException(verifier: (Throwable) -> Unit) {
- assertTrue(isDone)
- try {
- get()
- } catch (throwable: Throwable) {
- verifier(throwable)
- return
- }
- throw IllegalStateException("No exception found")
- }
-
- @Test
- fun set() = testFutures { original, wrapper ->
- assertFalse(original.isCancelled)
- assertFalse(wrapper.isCancelled)
-
- original.set("foo")
-
- assertEquals("foo", original.get())
- assertEquals("foo", wrapper.get())
- }
-
- @Test
- fun cancel() = testFutures { original, wrapper ->
- assertFalse(original.isCancelled)
- assertFalse(wrapper.isCancelled)
-
- wrapper.cancel(false)
-
- assertTrue(original.isCancelled)
- assertTrue(wrapper.isCancelled)
-
- val verification = { throwable: Throwable ->
- assertTrue(throwable is CancellationException)
- }
- original.verifyException(verification)
- wrapper.verifyException(verification)
- }
-
- @Test
- fun setException() = testFutures { original, wrapper ->
- val exception = Throwable()
-
- assertFalse(original.isDone)
- assertFalse(wrapper.isDone)
-
- original.setException(exception)
-
- val verification = { throwable: Throwable ->
- assertTrue(throwable is ExecutionException)
- assertEquals(throwable.cause, exception)
- }
- original.verifyException(verification)
- wrapper.verifyException(verification)
- }
-
- companion object {
- val guava = "GuavaFutures"
- val fake = "FakeFutures"
-
- @JvmStatic
- @Parameterized.Parameters(name = "{0}")
- fun parameters(): Array<Array<String>> {
- return arrayOf(arrayOf(guava), arrayOf(fake))
- }
- }
-}
diff --git a/paging/runtime/api/2.1.0-alpha01.txt b/paging/runtime/api/2.1.0-alpha01.txt
index b9bc73d..0f658dfd 100644
--- a/paging/runtime/api/2.1.0-alpha01.txt
+++ b/paging/runtime/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public class AsyncPagedListDiffer<T> {
diff --git a/paging/runtime/api/2.1.0-beta01.txt b/paging/runtime/api/2.1.0-beta01.txt
index b9bc73d..0f658dfd 100644
--- a/paging/runtime/api/2.1.0-beta01.txt
+++ b/paging/runtime/api/2.1.0-beta01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public class AsyncPagedListDiffer<T> {
diff --git a/paging/runtime/api/2.2.0-alpha01.txt b/paging/runtime/api/2.2.0-alpha01.txt
index f6bd0de..889c9bf 100644
--- a/paging/runtime/api/2.2.0-alpha01.txt
+++ b/paging/runtime/api/2.2.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public class AsyncPagedListDiffer<T> {
diff --git a/paging/runtime/api/current.txt b/paging/runtime/api/current.txt
index f6bd0de..889c9bf 100644
--- a/paging/runtime/api/current.txt
+++ b/paging/runtime/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public class AsyncPagedListDiffer<T> {
diff --git a/paging/runtime/api/restricted_2.1.0-beta01.txt b/paging/runtime/api/restricted_2.1.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/runtime/api/restricted_2.1.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/runtime/api/restricted_2.2.0-alpha01.txt b/paging/runtime/api/restricted_2.2.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/runtime/api/restricted_2.2.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/runtime/api/restricted_current.txt b/paging/runtime/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/runtime/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/runtime/build.gradle b/paging/runtime/build.gradle
index cd9287f..3b09dcf 100644
--- a/paging/runtime/build.gradle
+++ b/paging/runtime/build.gradle
@@ -33,9 +33,9 @@
dependencies {
api(project(":paging:paging-common"))
- api(project(":arch:core-runtime"))
+ api(ARCH_CORE_RUNTIME)
api(ARCH_LIFECYCLE_RUNTIME)
- api(project(":lifecycle:lifecycle-livedata"))
+ api(ARCH_LIFECYCLE_LIVEDATA)
api(ANDROIDX_RECYCLERVIEW, libs.support_exclude_config)
androidTestImplementation(JUNIT)
diff --git a/paging/runtime/ktx/api/2.1.0-alpha01.txt b/paging/runtime/ktx/api/2.1.0-alpha01.txt
index 9d5a1df..b7750be 100644
--- a/paging/runtime/ktx/api/2.1.0-alpha01.txt
+++ b/paging/runtime/ktx/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class LivePagedListKt {
diff --git a/paging/runtime/ktx/api/2.1.0-beta01.txt b/paging/runtime/ktx/api/2.1.0-beta01.txt
index 9d5a1df..b7750be 100644
--- a/paging/runtime/ktx/api/2.1.0-beta01.txt
+++ b/paging/runtime/ktx/api/2.1.0-beta01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class LivePagedListKt {
diff --git a/paging/runtime/ktx/api/2.2.0-alpha01.txt b/paging/runtime/ktx/api/2.2.0-alpha01.txt
index 9d5a1df..b7750be 100644
--- a/paging/runtime/ktx/api/2.2.0-alpha01.txt
+++ b/paging/runtime/ktx/api/2.2.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class LivePagedListKt {
diff --git a/paging/runtime/ktx/api/current.txt b/paging/runtime/ktx/api/current.txt
index 9d5a1df..b7750be 100644
--- a/paging/runtime/ktx/api/current.txt
+++ b/paging/runtime/ktx/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class LivePagedListKt {
diff --git a/paging/runtime/ktx/api/restricted_2.1.0-beta01.txt b/paging/runtime/ktx/api/restricted_2.1.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/runtime/ktx/api/restricted_2.1.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/runtime/ktx/api/restricted_2.2.0-alpha01.txt b/paging/runtime/ktx/api/restricted_2.2.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/runtime/ktx/api/restricted_2.2.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/runtime/ktx/api/restricted_current.txt b/paging/runtime/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/runtime/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/runtime/ktx/src/main/java/androidx/paging/LivePagedList.kt b/paging/runtime/ktx/src/main/java/androidx/paging/LivePagedList.kt
index 07e0bac..a08415d 100644
--- a/paging/runtime/ktx/src/main/java/androidx/paging/LivePagedList.kt
+++ b/paging/runtime/ktx/src/main/java/androidx/paging/LivePagedList.kt
@@ -16,6 +16,7 @@
package androidx.paging
+import android.annotation.SuppressLint
import androidx.arch.core.executor.ArchTaskExecutor
import androidx.lifecycle.LiveData
import java.util.concurrent.Executor
@@ -34,6 +35,7 @@
*
* @see LivePagedListBuilder
*/
+@SuppressLint("RestrictedApi")
fun <Key, Value> DataSource.Factory<Key, Value>.toLiveData(
config: PagedList.Config,
initialLoadKey: Key? = null,
@@ -61,6 +63,7 @@
*
* @see LivePagedListBuilder
*/
+@SuppressLint("RestrictedApi")
fun <Key, Value> DataSource.Factory<Key, Value>.toLiveData(
pageSize: Int,
initialLoadKey: Key? = null,
diff --git a/paging/runtime/src/androidTest/java/androidx/paging/PagedListAdapterTest.kt b/paging/runtime/src/androidTest/java/androidx/paging/PagedListAdapterTest.kt
index 72cd5dce..2b4e82e 100644
--- a/paging/runtime/src/androidTest/java/androidx/paging/PagedListAdapterTest.kt
+++ b/paging/runtime/src/androidTest/java/androidx/paging/PagedListAdapterTest.kt
@@ -20,7 +20,7 @@
import androidx.recyclerview.widget.AsyncDifferConfig
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.RecyclerView
-import androidx.test.filters.MediumTest
+import androidx.test.filters.SmallTest
import org.junit.Assert.assertEquals
import org.junit.Assert.assertSame
import org.junit.Test
@@ -33,7 +33,7 @@
import org.mockito.Mockito.verifyZeroInteractions
import java.lang.IllegalStateException
-@MediumTest
+@SmallTest
@RunWith(JUnit4::class)
class PagedListAdapterTest {
private val mainThread = TestExecutor()
diff --git a/paging/runtime/src/main/java/androidx/paging/AsyncPagedListDiffer.java b/paging/runtime/src/main/java/androidx/paging/AsyncPagedListDiffer.java
index 54dbe04..c456965 100644
--- a/paging/runtime/src/main/java/androidx/paging/AsyncPagedListDiffer.java
+++ b/paging/runtime/src/main/java/androidx/paging/AsyncPagedListDiffer.java
@@ -123,6 +123,7 @@
@SuppressWarnings("WeakerAccess") /* synthetic access */
final AsyncDifferConfig<T> mConfig;
+ @SuppressWarnings("RestrictedApi")
Executor mMainThreadExecutor = ArchTaskExecutor.getMainThreadExecutor();
/**
diff --git a/paging/runtime/src/main/java/androidx/paging/LivePagedListBuilder.java b/paging/runtime/src/main/java/androidx/paging/LivePagedListBuilder.java
index 44c8c926..481619d 100644
--- a/paging/runtime/src/main/java/androidx/paging/LivePagedListBuilder.java
+++ b/paging/runtime/src/main/java/androidx/paging/LivePagedListBuilder.java
@@ -16,6 +16,7 @@
package androidx.paging;
+import android.annotation.SuppressLint;
import androidx.annotation.AnyThread;
import androidx.annotation.NonNull;
@@ -42,6 +43,7 @@
private PagedList.Config mConfig;
private DataSource.Factory<Key, Value> mDataSourceFactory;
private PagedList.BoundaryCallback mBoundaryCallback;
+ @SuppressLint("RestrictedApi")
private Executor mFetchExecutor = ArchTaskExecutor.getIOThreadExecutor();
/**
@@ -150,6 +152,7 @@
* @return The LiveData of PagedLists
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public LiveData<PagedList<Value>> build() {
return create(mInitialLoadKey, mConfig, mBoundaryCallback, mDataSourceFactory,
ArchTaskExecutor.getMainThreadExecutor(), mFetchExecutor);
@@ -157,6 +160,7 @@
@AnyThread
@NonNull
+ @SuppressLint("RestrictedApi")
private static <Key, Value> LiveData<PagedList<Value>> create(
@Nullable final Key initialLoadKey,
@NonNull final PagedList.Config config,
diff --git a/paging/rxjava2/api/2.1.0-alpha01.txt b/paging/rxjava2/api/2.1.0-alpha01.txt
index 334f21d..067f422 100644
--- a/paging/rxjava2/api/2.1.0-alpha01.txt
+++ b/paging/rxjava2/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class RxPagedListBuilder<Key, Value> {
diff --git a/paging/rxjava2/api/2.1.0-beta01.txt b/paging/rxjava2/api/2.1.0-beta01.txt
index 334f21d..067f422 100644
--- a/paging/rxjava2/api/2.1.0-beta01.txt
+++ b/paging/rxjava2/api/2.1.0-beta01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class RxPagedListBuilder<Key, Value> {
diff --git a/paging/rxjava2/api/2.2.0-alpha01.txt b/paging/rxjava2/api/2.2.0-alpha01.txt
index 334f21d..067f422 100644
--- a/paging/rxjava2/api/2.2.0-alpha01.txt
+++ b/paging/rxjava2/api/2.2.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class RxPagedListBuilder<Key, Value> {
diff --git a/paging/rxjava2/api/current.txt b/paging/rxjava2/api/current.txt
index 334f21d..067f422 100644
--- a/paging/rxjava2/api/current.txt
+++ b/paging/rxjava2/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class RxPagedListBuilder<Key, Value> {
diff --git a/paging/rxjava2/api/restricted_2.1.0-beta01.txt b/paging/rxjava2/api/restricted_2.1.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/rxjava2/api/restricted_2.1.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/rxjava2/api/restricted_2.2.0-alpha01.txt b/paging/rxjava2/api/restricted_2.2.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/rxjava2/api/restricted_2.2.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/rxjava2/api/restricted_current.txt b/paging/rxjava2/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/rxjava2/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/rxjava2/build.gradle b/paging/rxjava2/build.gradle
index 64d5e83..ac29079 100644
--- a/paging/rxjava2/build.gradle
+++ b/paging/rxjava2/build.gradle
@@ -33,7 +33,7 @@
dependencies {
api(project(":paging:paging-common"))
- api(project(":arch:core-runtime"))
+ api(ARCH_CORE_RUNTIME)
api(RX_JAVA)
androidTestImplementation(JUNIT)
diff --git a/paging/rxjava2/ktx/api/2.1.0-alpha01.txt b/paging/rxjava2/ktx/api/2.1.0-alpha01.txt
index 5319bb1..6b573b4 100644
--- a/paging/rxjava2/ktx/api/2.1.0-alpha01.txt
+++ b/paging/rxjava2/ktx/api/2.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class RxPagedListKt {
diff --git a/paging/rxjava2/ktx/api/2.1.0-beta01.txt b/paging/rxjava2/ktx/api/2.1.0-beta01.txt
index 5319bb1..6b573b4 100644
--- a/paging/rxjava2/ktx/api/2.1.0-beta01.txt
+++ b/paging/rxjava2/ktx/api/2.1.0-beta01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class RxPagedListKt {
diff --git a/paging/rxjava2/ktx/api/2.2.0-alpha01.txt b/paging/rxjava2/ktx/api/2.2.0-alpha01.txt
index 5319bb1..6b573b4 100644
--- a/paging/rxjava2/ktx/api/2.2.0-alpha01.txt
+++ b/paging/rxjava2/ktx/api/2.2.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class RxPagedListKt {
diff --git a/paging/rxjava2/ktx/api/current.txt b/paging/rxjava2/ktx/api/current.txt
index 5319bb1..6b573b4 100644
--- a/paging/rxjava2/ktx/api/current.txt
+++ b/paging/rxjava2/ktx/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.paging {
public final class RxPagedListKt {
diff --git a/paging/rxjava2/ktx/api/restricted_2.1.0-beta01.txt b/paging/rxjava2/ktx/api/restricted_2.1.0-beta01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/rxjava2/ktx/api/restricted_2.1.0-beta01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/rxjava2/ktx/api/restricted_2.2.0-alpha01.txt b/paging/rxjava2/ktx/api/restricted_2.2.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/rxjava2/ktx/api/restricted_2.2.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/rxjava2/ktx/api/restricted_current.txt b/paging/rxjava2/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/paging/rxjava2/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/paging/rxjava2/src/main/java/androidx/paging/RxPagedListBuilder.java b/paging/rxjava2/src/main/java/androidx/paging/RxPagedListBuilder.java
index 20f124b..b364dc8 100644
--- a/paging/rxjava2/src/main/java/androidx/paging/RxPagedListBuilder.java
+++ b/paging/rxjava2/src/main/java/androidx/paging/RxPagedListBuilder.java
@@ -16,6 +16,7 @@
package androidx.paging;
+import android.annotation.SuppressLint;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -208,6 +209,7 @@
* @return The Observable of PagedLists
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public Observable<PagedList<Value>> buildObservable() {
if (mNotifyExecutor == null) {
mNotifyExecutor = ArchTaskExecutor.getMainThreadExecutor();
diff --git a/palette/api/1.0.0.txt b/palette/api/1.0.0.txt
index cbe84e9..33fbc68 100644
--- a/palette/api/1.0.0.txt
+++ b/palette/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.palette.graphics {
public final class Palette {
diff --git a/palette/api/1.1.0-alpha01.txt b/palette/api/1.1.0-alpha01.txt
index cbe84e9..33fbc68 100644
--- a/palette/api/1.1.0-alpha01.txt
+++ b/palette/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.palette.graphics {
public final class Palette {
diff --git a/palette/api/current.txt b/palette/api/current.txt
index cbe84e9..33fbc68 100644
--- a/palette/api/current.txt
+++ b/palette/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.palette.graphics {
public final class Palette {
diff --git a/palette/api/restricted_1.0.0.txt b/palette/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/palette/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/palette/api/restricted_1.1.0-alpha01.txt b/palette/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/palette/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/palette/api/restricted_current.txt b/palette/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/palette/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/palette/ktx/api/1.0.0.txt b/palette/ktx/api/1.0.0.txt
index cb4d27c..6c2d5b9 100644
--- a/palette/ktx/api/1.0.0.txt
+++ b/palette/ktx/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.palette.graphics {
public final class PaletteKt {
diff --git a/palette/ktx/api/1.1.0-alpha01.txt b/palette/ktx/api/1.1.0-alpha01.txt
index 4976ef2..6c2d5b9 100644
--- a/palette/ktx/api/1.1.0-alpha01.txt
+++ b/palette/ktx/api/1.1.0-alpha01.txt
@@ -1,9 +1,9 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.palette.graphics {
public final class PaletteKt {
ctor public PaletteKt();
- method public static inline operator androidx.palette.graphics.Palette.Swatch? get(androidx.palette.graphics.Palette, androidx.palette.graphics.Target target);
+ method public static operator androidx.palette.graphics.Palette.Swatch? get(androidx.palette.graphics.Palette, androidx.palette.graphics.Target target);
}
}
diff --git a/palette/ktx/api/current.txt b/palette/ktx/api/current.txt
index 4976ef2..6c2d5b9 100644
--- a/palette/ktx/api/current.txt
+++ b/palette/ktx/api/current.txt
@@ -1,9 +1,9 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.palette.graphics {
public final class PaletteKt {
ctor public PaletteKt();
- method public static inline operator androidx.palette.graphics.Palette.Swatch? get(androidx.palette.graphics.Palette, androidx.palette.graphics.Target target);
+ method public static operator androidx.palette.graphics.Palette.Swatch? get(androidx.palette.graphics.Palette, androidx.palette.graphics.Target target);
}
}
diff --git a/palette/ktx/api/restricted_1.0.0.txt b/palette/ktx/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/palette/ktx/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/palette/ktx/api/restricted_1.1.0-alpha01.txt b/palette/ktx/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/palette/ktx/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/palette/ktx/api/restricted_current.txt b/palette/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/palette/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/palette/src/androidTest/java/androidx/palette/graphics/ConsistencyTest.java b/palette/src/androidTest/java/androidx/palette/graphics/ConsistencyTest.java
index e11e706..01d3d4b 100644
--- a/palette/src/androidTest/java/androidx/palette/graphics/ConsistencyTest.java
+++ b/palette/src/androidTest/java/androidx/palette/graphics/ConsistencyTest.java
@@ -21,7 +21,7 @@
import android.graphics.Bitmap;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +32,7 @@
private static final int NUMBER_TRIALS = 10;
@Test
- @SmallTest
+ @MediumTest
public void testConsistency() {
Palette lastPalette = null;
final Bitmap bitmap = TestUtils.loadSampleBitmap();
diff --git a/percent/api/1.0.0.txt b/percent/api/1.0.0.txt
index 13744ae..0a80f73 100644
--- a/percent/api/1.0.0.txt
+++ b/percent/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.percentlayout.widget {
@Deprecated public class PercentFrameLayout extends android.widget.FrameLayout {
@@ -7,6 +7,8 @@
ctor @Deprecated public PercentFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
method @Deprecated protected androidx.percentlayout.widget.PercentFrameLayout.LayoutParams! generateDefaultLayoutParams();
method @Deprecated public androidx.percentlayout.widget.PercentFrameLayout.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
+ method @Deprecated protected void onLayout(boolean, int, int, int, int);
+ method @Deprecated protected void onMeasure(int, int);
}
@Deprecated public static class PercentFrameLayout.LayoutParams extends android.widget.FrameLayout.LayoutParams implements androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutParams {
@@ -18,6 +20,7 @@
ctor @Deprecated public PercentFrameLayout.LayoutParams(android.widget.FrameLayout.LayoutParams!);
ctor @Deprecated @RequiresApi(19) public PercentFrameLayout.LayoutParams(androidx.percentlayout.widget.PercentFrameLayout.LayoutParams!);
method @Deprecated public androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutInfo! getPercentLayoutInfo();
+ method @Deprecated protected void setBaseAttributes(android.content.res.TypedArray!, int, int);
}
@Deprecated public class PercentLayoutHelper {
@@ -36,6 +39,7 @@
method @Deprecated public void fillMarginLayoutParams(android.view.View!, android.view.ViewGroup.MarginLayoutParams!, int, int);
method @Deprecated public void restoreLayoutParams(android.view.ViewGroup.LayoutParams!);
method @Deprecated public void restoreMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams!);
+ method @Deprecated public String toString();
field @Deprecated public float aspectRatio;
field @Deprecated public float bottomMarginPercent;
field @Deprecated public float endMarginPercent;
@@ -57,6 +61,8 @@
ctor @Deprecated public PercentRelativeLayout(android.content.Context!, android.util.AttributeSet!, int);
method @Deprecated protected androidx.percentlayout.widget.PercentRelativeLayout.LayoutParams! generateDefaultLayoutParams();
method @Deprecated public androidx.percentlayout.widget.PercentRelativeLayout.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
+ method @Deprecated protected void onLayout(boolean, int, int, int, int);
+ method @Deprecated protected void onMeasure(int, int);
}
@Deprecated public static class PercentRelativeLayout.LayoutParams extends android.widget.RelativeLayout.LayoutParams implements androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutParams {
@@ -65,6 +71,7 @@
ctor @Deprecated public PercentRelativeLayout.LayoutParams(android.view.ViewGroup.LayoutParams!);
ctor @Deprecated public PercentRelativeLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams!);
method @Deprecated public androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutInfo! getPercentLayoutInfo();
+ method @Deprecated protected void setBaseAttributes(android.content.res.TypedArray!, int, int);
}
}
diff --git a/percent/api/1.1.0-alpha01.txt b/percent/api/1.1.0-alpha01.txt
deleted file mode 100644
index 13744ae..0000000
--- a/percent/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-// Signature format: 3.0
-package androidx.percentlayout.widget {
-
- @Deprecated public class PercentFrameLayout extends android.widget.FrameLayout {
- ctor @Deprecated public PercentFrameLayout(android.content.Context!);
- ctor @Deprecated public PercentFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor @Deprecated public PercentFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- method @Deprecated protected androidx.percentlayout.widget.PercentFrameLayout.LayoutParams! generateDefaultLayoutParams();
- method @Deprecated public androidx.percentlayout.widget.PercentFrameLayout.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
- }
-
- @Deprecated public static class PercentFrameLayout.LayoutParams extends android.widget.FrameLayout.LayoutParams implements androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutParams {
- ctor @Deprecated public PercentFrameLayout.LayoutParams(android.content.Context!, android.util.AttributeSet!);
- ctor @Deprecated public PercentFrameLayout.LayoutParams(int, int);
- ctor @Deprecated public PercentFrameLayout.LayoutParams(int, int, int);
- ctor @Deprecated public PercentFrameLayout.LayoutParams(android.view.ViewGroup.LayoutParams!);
- ctor @Deprecated public PercentFrameLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams!);
- ctor @Deprecated public PercentFrameLayout.LayoutParams(android.widget.FrameLayout.LayoutParams!);
- ctor @Deprecated @RequiresApi(19) public PercentFrameLayout.LayoutParams(androidx.percentlayout.widget.PercentFrameLayout.LayoutParams!);
- method @Deprecated public androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutInfo! getPercentLayoutInfo();
- }
-
- @Deprecated public class PercentLayoutHelper {
- ctor @Deprecated public PercentLayoutHelper(android.view.ViewGroup);
- method @Deprecated public void adjustChildren(int, int);
- method @Deprecated public static void fetchWidthAndHeight(android.view.ViewGroup.LayoutParams!, android.content.res.TypedArray!, int, int);
- method @Deprecated public static androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutInfo! getPercentLayoutInfo(android.content.Context!, android.util.AttributeSet!);
- method @Deprecated public boolean handleMeasuredStateTooSmall();
- method @Deprecated public void restoreOriginalParams();
- }
-
- @Deprecated public static class PercentLayoutHelper.PercentLayoutInfo {
- ctor @Deprecated public PercentLayoutHelper.PercentLayoutInfo();
- method @Deprecated public void fillLayoutParams(android.view.ViewGroup.LayoutParams!, int, int);
- method @Deprecated public void fillMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams!, int, int);
- method @Deprecated public void fillMarginLayoutParams(android.view.View!, android.view.ViewGroup.MarginLayoutParams!, int, int);
- method @Deprecated public void restoreLayoutParams(android.view.ViewGroup.LayoutParams!);
- method @Deprecated public void restoreMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams!);
- field @Deprecated public float aspectRatio;
- field @Deprecated public float bottomMarginPercent;
- field @Deprecated public float endMarginPercent;
- field @Deprecated public float heightPercent;
- field @Deprecated public float leftMarginPercent;
- field @Deprecated public float rightMarginPercent;
- field @Deprecated public float startMarginPercent;
- field @Deprecated public float topMarginPercent;
- field @Deprecated public float widthPercent;
- }
-
- @Deprecated public static interface PercentLayoutHelper.PercentLayoutParams {
- method @Deprecated public androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutInfo! getPercentLayoutInfo();
- }
-
- @Deprecated public class PercentRelativeLayout extends android.widget.RelativeLayout {
- ctor @Deprecated public PercentRelativeLayout(android.content.Context!);
- ctor @Deprecated public PercentRelativeLayout(android.content.Context!, android.util.AttributeSet!);
- ctor @Deprecated public PercentRelativeLayout(android.content.Context!, android.util.AttributeSet!, int);
- method @Deprecated protected androidx.percentlayout.widget.PercentRelativeLayout.LayoutParams! generateDefaultLayoutParams();
- method @Deprecated public androidx.percentlayout.widget.PercentRelativeLayout.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
- }
-
- @Deprecated public static class PercentRelativeLayout.LayoutParams extends android.widget.RelativeLayout.LayoutParams implements androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutParams {
- ctor @Deprecated public PercentRelativeLayout.LayoutParams(android.content.Context!, android.util.AttributeSet!);
- ctor @Deprecated public PercentRelativeLayout.LayoutParams(int, int);
- ctor @Deprecated public PercentRelativeLayout.LayoutParams(android.view.ViewGroup.LayoutParams!);
- ctor @Deprecated public PercentRelativeLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams!);
- method @Deprecated public androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutInfo! getPercentLayoutInfo();
- }
-
-}
-
diff --git a/percent/api/current.txt b/percent/api/current.txt
index 13744ae..0a80f73 100644
--- a/percent/api/current.txt
+++ b/percent/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.percentlayout.widget {
@Deprecated public class PercentFrameLayout extends android.widget.FrameLayout {
@@ -7,6 +7,8 @@
ctor @Deprecated public PercentFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
method @Deprecated protected androidx.percentlayout.widget.PercentFrameLayout.LayoutParams! generateDefaultLayoutParams();
method @Deprecated public androidx.percentlayout.widget.PercentFrameLayout.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
+ method @Deprecated protected void onLayout(boolean, int, int, int, int);
+ method @Deprecated protected void onMeasure(int, int);
}
@Deprecated public static class PercentFrameLayout.LayoutParams extends android.widget.FrameLayout.LayoutParams implements androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutParams {
@@ -18,6 +20,7 @@
ctor @Deprecated public PercentFrameLayout.LayoutParams(android.widget.FrameLayout.LayoutParams!);
ctor @Deprecated @RequiresApi(19) public PercentFrameLayout.LayoutParams(androidx.percentlayout.widget.PercentFrameLayout.LayoutParams!);
method @Deprecated public androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutInfo! getPercentLayoutInfo();
+ method @Deprecated protected void setBaseAttributes(android.content.res.TypedArray!, int, int);
}
@Deprecated public class PercentLayoutHelper {
@@ -36,6 +39,7 @@
method @Deprecated public void fillMarginLayoutParams(android.view.View!, android.view.ViewGroup.MarginLayoutParams!, int, int);
method @Deprecated public void restoreLayoutParams(android.view.ViewGroup.LayoutParams!);
method @Deprecated public void restoreMarginLayoutParams(android.view.ViewGroup.MarginLayoutParams!);
+ method @Deprecated public String toString();
field @Deprecated public float aspectRatio;
field @Deprecated public float bottomMarginPercent;
field @Deprecated public float endMarginPercent;
@@ -57,6 +61,8 @@
ctor @Deprecated public PercentRelativeLayout(android.content.Context!, android.util.AttributeSet!, int);
method @Deprecated protected androidx.percentlayout.widget.PercentRelativeLayout.LayoutParams! generateDefaultLayoutParams();
method @Deprecated public androidx.percentlayout.widget.PercentRelativeLayout.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
+ method @Deprecated protected void onLayout(boolean, int, int, int, int);
+ method @Deprecated protected void onMeasure(int, int);
}
@Deprecated public static class PercentRelativeLayout.LayoutParams extends android.widget.RelativeLayout.LayoutParams implements androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutParams {
@@ -65,6 +71,7 @@
ctor @Deprecated public PercentRelativeLayout.LayoutParams(android.view.ViewGroup.LayoutParams!);
ctor @Deprecated public PercentRelativeLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams!);
method @Deprecated public androidx.percentlayout.widget.PercentLayoutHelper.PercentLayoutInfo! getPercentLayoutInfo();
+ method @Deprecated protected void setBaseAttributes(android.content.res.TypedArray!, int, int);
}
}
diff --git a/percent/api/res-1.1.0-alpha01.txt b/percent/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/percent/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/percent/api/restricted_1.0.0.txt b/percent/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/percent/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/percent/api/restricted_1.1.0-alpha01.txt b/percent/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/percent/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/percent/api/restricted_current.txt b/percent/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/percent/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/percent/src/androidTest/java/androidx/percentlayout/widget/PercentDynamicLayoutTest.java b/percent/src/androidTest/java/androidx/percentlayout/widget/PercentDynamicLayoutTest.java
index ca4efd3..0389306 100755
--- a/percent/src/androidTest/java/androidx/percentlayout/widget/PercentDynamicLayoutTest.java
+++ b/percent/src/androidTest/java/androidx/percentlayout/widget/PercentDynamicLayoutTest.java
@@ -22,15 +22,15 @@
import static org.hamcrest.CoreMatchers.allOf;
+import androidx.test.annotation.UiThreadTest;
+import androidx.test.espresso.UiController;
+import androidx.test.espresso.ViewAction;
+import androidx.test.filters.SmallTest;
import android.view.View;
import android.view.ViewStub;
import androidx.annotation.LayoutRes;
import androidx.percentlayout.test.R;
-import androidx.test.annotation.UiThreadTest;
-import androidx.test.espresso.UiController;
-import androidx.test.espresso.ViewAction;
-import androidx.test.filters.LargeTest;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
@@ -41,7 +41,7 @@
/**
* Test cases to verify that percent layouts properly account for their own paddings.
*/
-@LargeTest
+@SmallTest
public class PercentDynamicLayoutTest
extends BaseInstrumentationTestCase<PercentDynamicLayoutActivity> {
public PercentDynamicLayoutTest() {
diff --git a/percent/src/androidTest/java/androidx/percentlayout/widget/PercentFrameTest.java b/percent/src/androidTest/java/androidx/percentlayout/widget/PercentFrameTest.java
index c88e063..5590b45 100644
--- a/percent/src/androidTest/java/androidx/percentlayout/widget/PercentFrameTest.java
+++ b/percent/src/androidTest/java/androidx/percentlayout/widget/PercentFrameTest.java
@@ -19,16 +19,16 @@
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import android.os.Build;
+import androidx.test.filters.SmallTest;
import android.view.View;
import androidx.core.view.ViewCompat;
import androidx.percentlayout.test.R;
-import androidx.test.filters.LargeTest;
import org.junit.Before;
import org.junit.Test;
-@LargeTest
+@SmallTest
public class PercentFrameTest extends BaseInstrumentationTestCase<TestFrameActivity> {
private PercentFrameLayout mPercentFrameLayout;
private int mContainerWidth;
diff --git a/percent/src/androidTest/java/androidx/percentlayout/widget/PercentRelativeRtlTest.java b/percent/src/androidTest/java/androidx/percentlayout/widget/PercentRelativeRtlTest.java
index bc51a0c..86fb5df 100644
--- a/percent/src/androidTest/java/androidx/percentlayout/widget/PercentRelativeRtlTest.java
+++ b/percent/src/androidTest/java/androidx/percentlayout/widget/PercentRelativeRtlTest.java
@@ -19,11 +19,11 @@
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import android.os.Build;
+import androidx.test.filters.SmallTest;
import android.view.View;
import androidx.core.view.ViewCompat;
import androidx.percentlayout.test.R;
-import androidx.test.filters.LargeTest;
import org.junit.Before;
import org.junit.Test;
@@ -94,7 +94,7 @@
* the core classes, but rather just provide a translation layer between percentage-based values
* and pixel-based ones.
*/
-@LargeTest
+@SmallTest
public class PercentRelativeRtlTest extends BaseInstrumentationTestCase<TestRelativeRtlActivity> {
private PercentRelativeLayout mPercentRelativeLayout;
private int mContainerWidth;
diff --git a/percent/src/androidTest/java/androidx/percentlayout/widget/PercentRelativeTest.java b/percent/src/androidTest/java/androidx/percentlayout/widget/PercentRelativeTest.java
index b821678..51165e2 100644
--- a/percent/src/androidTest/java/androidx/percentlayout/widget/PercentRelativeTest.java
+++ b/percent/src/androidTest/java/androidx/percentlayout/widget/PercentRelativeTest.java
@@ -15,10 +15,10 @@
*/
package androidx.percentlayout.widget;
+import androidx.test.filters.SmallTest;
import android.view.View;
import androidx.percentlayout.test.R;
-import androidx.test.filters.LargeTest;
import org.junit.Before;
import org.junit.Test;
@@ -55,7 +55,7 @@
* <li>Center child (marked with C) - margin (all sides) from the other four children.</li>
* </ul>
*/
-@LargeTest
+@SmallTest
public class PercentRelativeTest extends BaseInstrumentationTestCase<TestRelativeActivity> {
private PercentRelativeLayout mPercentRelativeLayout;
private int mContainerWidth;
diff --git a/persistence/db-framework/api/2.0.0.txt b/persistence/db-framework/api/2.0.0.txt
index 9c05b84..19c73cc 100644
--- a/persistence/db-framework/api/2.0.0.txt
+++ b/persistence/db-framework/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.sqlite.db.framework {
public final class FrameworkSQLiteOpenHelperFactory implements androidx.sqlite.db.SupportSQLiteOpenHelper.Factory {
diff --git a/persistence/db-framework/api/current.txt b/persistence/db-framework/api/current.txt
index 9c05b84..19c73cc 100644
--- a/persistence/db-framework/api/current.txt
+++ b/persistence/db-framework/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.sqlite.db.framework {
public final class FrameworkSQLiteOpenHelperFactory implements androidx.sqlite.db.SupportSQLiteOpenHelper.Factory {
diff --git a/persistence/db-framework/api/res-2.0.1.txt b/persistence/db-framework/api/res-2.0.1.txt
deleted file mode 100644
index e69de29..0000000
--- a/persistence/db-framework/api/res-2.0.1.txt
+++ /dev/null
diff --git a/persistence/db-framework/api/restricted_2.0.0.txt b/persistence/db-framework/api/restricted_2.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/persistence/db-framework/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/persistence/db-framework/api/restricted_current.txt b/persistence/db-framework/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/persistence/db-framework/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/persistence/db/api/2.0.0.txt b/persistence/db/api/2.0.0.txt
index a7ae53f..3a28736 100644
--- a/persistence/db/api/2.0.0.txt
+++ b/persistence/db/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.sqlite.db {
public final class SimpleSQLiteQuery implements androidx.sqlite.db.SupportSQLiteQuery {
diff --git a/persistence/db/api/current.txt b/persistence/db/api/current.txt
index a7ae53f..3a28736 100644
--- a/persistence/db/api/current.txt
+++ b/persistence/db/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.sqlite.db {
public final class SimpleSQLiteQuery implements androidx.sqlite.db.SupportSQLiteQuery {
diff --git a/persistence/db/api/res-2.0.1.txt b/persistence/db/api/res-2.0.1.txt
deleted file mode 100644
index e69de29..0000000
--- a/persistence/db/api/res-2.0.1.txt
+++ /dev/null
diff --git a/persistence/db/api/restricted_2.0.0.txt b/persistence/db/api/restricted_2.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/persistence/db/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/persistence/db/api/restricted_current.txt b/persistence/db/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/persistence/db/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/persistence/db/build.gradle b/persistence/db/build.gradle
index d459f63..299502b 100644
--- a/persistence/db/build.gradle
+++ b/persistence/db/build.gradle
@@ -34,8 +34,8 @@
def name = variant.name
def suffix = name.capitalize()
def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
- dependsOn variant.javaCompileProvider.get()
- from variant.javaCompileProvider.get().destinationDir
+ dependsOn variant.javaCompile
+ from variant.javaCompile.destinationDir
destinationDir new File(project.buildDir, "libJar")
}
}
diff --git a/persistence/db/ktx/api/2.0.0.txt b/persistence/db/ktx/api/2.0.0.txt
index 750b634..7b43b5d 100644
--- a/persistence/db/ktx/api/2.0.0.txt
+++ b/persistence/db/ktx/api/2.0.0.txt
@@ -1,9 +1,9 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.sqlite.db {
public final class SupportSQLiteDatabaseKt {
ctor public SupportSQLiteDatabaseKt();
- method public static inline <T> T! transaction(androidx.sqlite.db.SupportSQLiteDatabase, boolean exclusive = true, kotlin.jvm.functions.Function1<? super androidx.sqlite.db.SupportSQLiteDatabase,? extends T> body);
+ method public static <T> T! transaction(androidx.sqlite.db.SupportSQLiteDatabase, boolean exclusive = true, kotlin.jvm.functions.Function1<? super androidx.sqlite.db.SupportSQLiteDatabase,? extends T> body);
}
}
diff --git a/persistence/db/ktx/api/current.txt b/persistence/db/ktx/api/current.txt
index 750b634..7b43b5d 100644
--- a/persistence/db/ktx/api/current.txt
+++ b/persistence/db/ktx/api/current.txt
@@ -1,9 +1,9 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.sqlite.db {
public final class SupportSQLiteDatabaseKt {
ctor public SupportSQLiteDatabaseKt();
- method public static inline <T> T! transaction(androidx.sqlite.db.SupportSQLiteDatabase, boolean exclusive = true, kotlin.jvm.functions.Function1<? super androidx.sqlite.db.SupportSQLiteDatabase,? extends T> body);
+ method public static <T> T! transaction(androidx.sqlite.db.SupportSQLiteDatabase, boolean exclusive = true, kotlin.jvm.functions.Function1<? super androidx.sqlite.db.SupportSQLiteDatabase,? extends T> body);
}
}
diff --git a/persistence/db/ktx/api/res-2.0.1.txt b/persistence/db/ktx/api/res-2.0.1.txt
deleted file mode 100644
index e69de29..0000000
--- a/persistence/db/ktx/api/res-2.0.1.txt
+++ /dev/null
diff --git a/persistence/db/ktx/api/restricted_2.0.0.txt b/persistence/db/ktx/api/restricted_2.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/persistence/db/ktx/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/persistence/db/ktx/api/restricted_current.txt b/persistence/db/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/persistence/db/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/preference/api/1.0.0.txt b/preference/api/1.0.0.txt
index f6a2438..206daae 100644
--- a/preference/api/1.0.0.txt
+++ b/preference/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.preference {
public class CheckBoxPreference extends androidx.preference.TwoStatePreference {
diff --git a/preference/api/1.1.0-alpha01.txt b/preference/api/1.1.0-alpha01.txt
index 40588a8..97a04bb 100644
--- a/preference/api/1.1.0-alpha01.txt
+++ b/preference/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.preference {
public class CheckBoxPreference extends androidx.preference.TwoStatePreference {
diff --git a/preference/api/1.1.0-alpha02.txt b/preference/api/1.1.0-alpha02.txt
index bcfbe6b..0671bee 100644
--- a/preference/api/1.1.0-alpha02.txt
+++ b/preference/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.preference {
public class CheckBoxPreference extends androidx.preference.TwoStatePreference {
diff --git a/preference/api/1.1.0-alpha03.txt b/preference/api/1.1.0-alpha03.txt
index d3b0755..0671bee 100644
--- a/preference/api/1.1.0-alpha03.txt
+++ b/preference/api/1.1.0-alpha03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.preference {
public class CheckBoxPreference extends androidx.preference.TwoStatePreference {
@@ -33,7 +33,7 @@
}
public static interface DialogPreference.TargetFragment {
- method public <T extends androidx.preference.Preference> T? findPreference(CharSequence);
+ method public <T extends androidx.preference.Preference> T! findPreference(CharSequence!);
}
public class DropDownPreference extends androidx.preference.ListPreference {
@@ -150,7 +150,7 @@
ctor public Preference(android.content.Context!);
method public boolean callChangeListener(Object!);
method public int compareTo(androidx.preference.Preference);
- method protected <T extends androidx.preference.Preference> T? findPreferenceInHierarchy(String);
+ method protected <T extends androidx.preference.Preference> T! findPreferenceInHierarchy(String!);
method public android.content.Context! getContext();
method public String! getDependency();
method public android.os.Bundle! getExtras();
@@ -290,9 +290,13 @@
method @Deprecated public androidx.preference.DialogPreference! getPreference();
method @Deprecated protected void onBindDialogView(android.view.View!);
method @Deprecated public void onClick(android.content.DialogInterface!, int);
+ method @Deprecated public void onCreate(android.os.Bundle!);
+ method @Deprecated public android.app.Dialog onCreateDialog(android.os.Bundle!);
method @Deprecated protected android.view.View! onCreateDialogView(android.content.Context!);
method @Deprecated public abstract void onDialogClosed(boolean);
+ method @Deprecated public void onDismiss(android.content.DialogInterface!);
method @Deprecated protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder!);
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle);
field @Deprecated protected static final String ARG_KEY = "key";
}
@@ -314,13 +318,20 @@
method @Deprecated public final androidx.recyclerview.widget.RecyclerView! getListView();
method @Deprecated public androidx.preference.PreferenceManager! getPreferenceManager();
method @Deprecated public androidx.preference.PreferenceScreen! getPreferenceScreen();
+ method @Deprecated public void onCreate(android.os.Bundle!);
method @Deprecated protected androidx.recyclerview.widget.RecyclerView.Adapter! onCreateAdapter(androidx.preference.PreferenceScreen!);
method @Deprecated public androidx.recyclerview.widget.RecyclerView.LayoutManager! onCreateLayoutManager();
method @Deprecated public abstract void onCreatePreferences(android.os.Bundle!, String!);
method @Deprecated public androidx.recyclerview.widget.RecyclerView! onCreateRecyclerView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroyView();
method @Deprecated public void onDisplayPreferenceDialog(androidx.preference.Preference!);
method @Deprecated public void onNavigateToScreen(androidx.preference.PreferenceScreen!);
method @Deprecated public boolean onPreferenceTreeClick(androidx.preference.Preference!);
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
+ method @Deprecated public void onStart();
+ method @Deprecated public void onStop();
+ method @Deprecated public void onViewCreated(android.view.View!, android.os.Bundle!);
method @Deprecated public void scrollToPreference(String!);
method @Deprecated public void scrollToPreference(androidx.preference.Preference!);
method @Deprecated public void setDivider(android.graphics.drawable.Drawable!);
@@ -345,7 +356,7 @@
public abstract class PreferenceFragmentCompat extends androidx.fragment.app.Fragment implements androidx.preference.DialogPreference.TargetFragment androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener androidx.preference.PreferenceManager.OnNavigateToScreenListener androidx.preference.PreferenceManager.OnPreferenceTreeClickListener {
ctor public PreferenceFragmentCompat();
method public void addPreferencesFromResource(@XmlRes int);
- method public <T extends androidx.preference.Preference> T? findPreference(CharSequence);
+ method public <T extends androidx.preference.Preference> T! findPreference(CharSequence!);
method public final androidx.recyclerview.widget.RecyclerView! getListView();
method public androidx.preference.PreferenceManager! getPreferenceManager();
method public androidx.preference.PreferenceScreen! getPreferenceScreen();
@@ -385,7 +396,7 @@
method public boolean addPreference(androidx.preference.Preference!);
method protected void dispatchRestoreInstanceState(android.os.Bundle!);
method protected void dispatchSaveInstanceState(android.os.Bundle!);
- method public <T extends androidx.preference.Preference> T? findPreference(CharSequence);
+ method public <T extends androidx.preference.Preference> T! findPreference(CharSequence!);
method public int getInitialExpandedChildrenCount();
method public androidx.preference.Preference! getPreference(int);
method public int getPreferenceCount();
@@ -406,7 +417,7 @@
public class PreferenceManager {
method public androidx.preference.PreferenceScreen! createPreferenceScreen(android.content.Context!);
- method public <T extends androidx.preference.Preference> T? findPreference(CharSequence);
+ method public <T extends androidx.preference.Preference> T! findPreference(CharSequence!);
method public android.content.Context! getContext();
method public static android.content.SharedPreferences! getDefaultSharedPreferences(android.content.Context!);
method public androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener! getOnDisplayPreferenceDialogListener();
diff --git a/preference/api/1.1.0-alpha04.txt b/preference/api/1.1.0-alpha04.txt
deleted file mode 100644
index 0edd4f7b..0000000
--- a/preference/api/1.1.0-alpha04.txt
+++ /dev/null
@@ -1,543 +0,0 @@
-// Signature format: 3.0
-package androidx.preference {
-
- public class CheckBoxPreference extends androidx.preference.TwoStatePreference {
- ctor public CheckBoxPreference(android.content.Context!, android.util.AttributeSet!, int);
- ctor public CheckBoxPreference(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public CheckBoxPreference(android.content.Context!, android.util.AttributeSet!);
- ctor public CheckBoxPreference(android.content.Context!);
- }
-
- public abstract class DialogPreference extends androidx.preference.Preference {
- ctor public DialogPreference(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public DialogPreference(android.content.Context!, android.util.AttributeSet!, int);
- ctor public DialogPreference(android.content.Context!, android.util.AttributeSet!);
- ctor public DialogPreference(android.content.Context!);
- method public android.graphics.drawable.Drawable! getDialogIcon();
- method public int getDialogLayoutResource();
- method public CharSequence! getDialogMessage();
- method public CharSequence! getDialogTitle();
- method public CharSequence! getNegativeButtonText();
- method public CharSequence! getPositiveButtonText();
- method public void setDialogIcon(android.graphics.drawable.Drawable!);
- method public void setDialogIcon(int);
- method public void setDialogLayoutResource(int);
- method public void setDialogMessage(CharSequence!);
- method public void setDialogMessage(int);
- method public void setDialogTitle(CharSequence!);
- method public void setDialogTitle(int);
- method public void setNegativeButtonText(CharSequence!);
- method public void setNegativeButtonText(int);
- method public void setPositiveButtonText(CharSequence!);
- method public void setPositiveButtonText(int);
- }
-
- public static interface DialogPreference.TargetFragment {
- method public <T extends androidx.preference.Preference> T? findPreference(CharSequence);
- }
-
- public class DropDownPreference extends androidx.preference.ListPreference {
- ctor public DropDownPreference(android.content.Context!);
- ctor public DropDownPreference(android.content.Context!, android.util.AttributeSet!);
- ctor public DropDownPreference(android.content.Context!, android.util.AttributeSet!, int);
- ctor public DropDownPreference(android.content.Context!, android.util.AttributeSet!, int, int);
- method protected android.widget.ArrayAdapter! createAdapter();
- }
-
- public class EditTextPreference extends androidx.preference.DialogPreference {
- ctor public EditTextPreference(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public EditTextPreference(android.content.Context!, android.util.AttributeSet!, int);
- ctor public EditTextPreference(android.content.Context!, android.util.AttributeSet!);
- ctor public EditTextPreference(android.content.Context!);
- method public androidx.preference.EditTextPreference.OnBindEditTextListener? getOnBindEditTextListener();
- method public String! getText();
- method public void setOnBindEditTextListener(androidx.preference.EditTextPreference.OnBindEditTextListener?);
- method public void setText(String!);
- }
-
- public static interface EditTextPreference.OnBindEditTextListener {
- method public void onBindEditText(android.widget.EditText);
- }
-
- public static final class EditTextPreference.SimpleSummaryProvider implements androidx.preference.Preference.SummaryProvider<androidx.preference.EditTextPreference> {
- method public static androidx.preference.EditTextPreference.SimpleSummaryProvider! getInstance();
- method public CharSequence! provideSummary(androidx.preference.EditTextPreference!);
- }
-
- @Deprecated public class EditTextPreferenceDialogFragment extends androidx.preference.PreferenceDialogFragment {
- ctor @Deprecated public EditTextPreferenceDialogFragment();
- method @Deprecated public static androidx.preference.EditTextPreferenceDialogFragment! newInstance(String!);
- method @Deprecated protected void onBindDialogView(android.view.View!);
- method @Deprecated public void onDialogClosed(boolean);
- }
-
- public class EditTextPreferenceDialogFragmentCompat extends androidx.preference.PreferenceDialogFragmentCompat {
- ctor public EditTextPreferenceDialogFragmentCompat();
- method public static androidx.preference.EditTextPreferenceDialogFragmentCompat! newInstance(String!);
- method public void onDialogClosed(boolean);
- }
-
- public class ListPreference extends androidx.preference.DialogPreference {
- ctor public ListPreference(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public ListPreference(android.content.Context!, android.util.AttributeSet!, int);
- ctor public ListPreference(android.content.Context!, android.util.AttributeSet!);
- ctor public ListPreference(android.content.Context!);
- method public int findIndexOfValue(String!);
- method public CharSequence[]! getEntries();
- method public CharSequence! getEntry();
- method public CharSequence[]! getEntryValues();
- method public String! getValue();
- method public void setEntries(CharSequence[]!);
- method public void setEntries(@ArrayRes int);
- method public void setEntryValues(CharSequence[]!);
- method public void setEntryValues(@ArrayRes int);
- method public void setValue(String!);
- method public void setValueIndex(int);
- }
-
- public static final class ListPreference.SimpleSummaryProvider implements androidx.preference.Preference.SummaryProvider<androidx.preference.ListPreference> {
- method public static androidx.preference.ListPreference.SimpleSummaryProvider! getInstance();
- method public CharSequence! provideSummary(androidx.preference.ListPreference!);
- }
-
- @Deprecated public class ListPreferenceDialogFragment extends androidx.preference.PreferenceDialogFragment {
- ctor @Deprecated public ListPreferenceDialogFragment();
- method @Deprecated public static androidx.preference.ListPreferenceDialogFragment! newInstance(String!);
- method @Deprecated public void onDialogClosed(boolean);
- method @Deprecated protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder!);
- }
-
- public class ListPreferenceDialogFragmentCompat extends androidx.preference.PreferenceDialogFragmentCompat {
- ctor public ListPreferenceDialogFragmentCompat();
- method public static androidx.preference.ListPreferenceDialogFragmentCompat! newInstance(String!);
- method public void onDialogClosed(boolean);
- }
-
- public class MultiSelectListPreference extends androidx.preference.DialogPreference {
- ctor public MultiSelectListPreference(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public MultiSelectListPreference(android.content.Context!, android.util.AttributeSet!, int);
- ctor public MultiSelectListPreference(android.content.Context!, android.util.AttributeSet!);
- ctor public MultiSelectListPreference(android.content.Context!);
- method public int findIndexOfValue(String!);
- method public CharSequence[]! getEntries();
- method public CharSequence[]! getEntryValues();
- method protected boolean[]! getSelectedItems();
- method public java.util.Set<java.lang.String>! getValues();
- method public void setEntries(CharSequence[]!);
- method public void setEntries(@ArrayRes int);
- method public void setEntryValues(CharSequence[]!);
- method public void setEntryValues(@ArrayRes int);
- method public void setValues(java.util.Set<java.lang.String>!);
- }
-
- @Deprecated public class MultiSelectListPreferenceDialogFragment extends androidx.preference.PreferenceDialogFragment {
- ctor @Deprecated public MultiSelectListPreferenceDialogFragment();
- method @Deprecated public static androidx.preference.MultiSelectListPreferenceDialogFragment! newInstance(String!);
- method @Deprecated public void onDialogClosed(boolean);
- method @Deprecated protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder!);
- }
-
- public class MultiSelectListPreferenceDialogFragmentCompat extends androidx.preference.PreferenceDialogFragmentCompat {
- ctor public MultiSelectListPreferenceDialogFragmentCompat();
- method public static androidx.preference.MultiSelectListPreferenceDialogFragmentCompat! newInstance(String!);
- method public void onDialogClosed(boolean);
- }
-
- public class Preference implements java.lang.Comparable<androidx.preference.Preference> {
- ctor public Preference(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public Preference(android.content.Context!, android.util.AttributeSet!, int);
- ctor public Preference(android.content.Context!, android.util.AttributeSet!);
- ctor public Preference(android.content.Context!);
- method public boolean callChangeListener(Object!);
- method public int compareTo(androidx.preference.Preference);
- method protected <T extends androidx.preference.Preference> T? findPreferenceInHierarchy(String);
- method public android.content.Context! getContext();
- method public String! getDependency();
- method public android.os.Bundle! getExtras();
- method public String! getFragment();
- method public android.graphics.drawable.Drawable! getIcon();
- method public android.content.Intent! getIntent();
- method public String! getKey();
- method public final int getLayoutResource();
- method public androidx.preference.Preference.OnPreferenceChangeListener! getOnPreferenceChangeListener();
- method public androidx.preference.Preference.OnPreferenceClickListener! getOnPreferenceClickListener();
- method public int getOrder();
- method public androidx.preference.PreferenceGroup? getParent();
- method protected boolean getPersistedBoolean(boolean);
- method protected float getPersistedFloat(float);
- method protected int getPersistedInt(int);
- method protected long getPersistedLong(long);
- method protected String! getPersistedString(String!);
- method public java.util.Set<java.lang.String>! getPersistedStringSet(java.util.Set<java.lang.String>!);
- method public androidx.preference.PreferenceDataStore? getPreferenceDataStore();
- method public androidx.preference.PreferenceManager! getPreferenceManager();
- method public android.content.SharedPreferences! getSharedPreferences();
- method public boolean getShouldDisableView();
- method public CharSequence! getSummary();
- method public final androidx.preference.Preference.SummaryProvider? getSummaryProvider();
- method public CharSequence! getTitle();
- method public final int getWidgetLayoutResource();
- method public boolean hasKey();
- method public boolean isCopyingEnabled();
- method public boolean isEnabled();
- method public boolean isIconSpaceReserved();
- method public boolean isPersistent();
- method public boolean isSelectable();
- method public final boolean isShown();
- method public boolean isSingleLineTitle();
- method public final boolean isVisible();
- method protected void notifyChanged();
- method public void notifyDependencyChange(boolean);
- method protected void notifyHierarchyChanged();
- method public void onAttached();
- method protected void onAttachedToHierarchy(androidx.preference.PreferenceManager!);
- method public void onBindViewHolder(androidx.preference.PreferenceViewHolder!);
- method protected void onClick();
- method public void onDependencyChanged(androidx.preference.Preference!, boolean);
- method public void onDetached();
- method protected Object! onGetDefaultValue(android.content.res.TypedArray!, int);
- method @CallSuper public void onInitializeAccessibilityNodeInfo(androidx.core.view.accessibility.AccessibilityNodeInfoCompat!);
- method public void onParentChanged(androidx.preference.Preference!, boolean);
- method protected void onPrepareForRemoval();
- method protected void onRestoreInstanceState(android.os.Parcelable!);
- method protected android.os.Parcelable! onSaveInstanceState();
- method @Deprecated protected void onSetInitialValue(boolean, Object!);
- method protected void onSetInitialValue(Object?);
- method public android.os.Bundle! peekExtras();
- method protected boolean persistBoolean(boolean);
- method protected boolean persistFloat(float);
- method protected boolean persistInt(int);
- method protected boolean persistLong(long);
- method protected boolean persistString(String!);
- method public boolean persistStringSet(java.util.Set<java.lang.String>!);
- method public void restoreHierarchyState(android.os.Bundle!);
- method public void saveHierarchyState(android.os.Bundle!);
- method public void setCopyingEnabled(boolean);
- method public void setDefaultValue(Object!);
- method public void setDependency(String!);
- method public void setEnabled(boolean);
- method public void setFragment(String!);
- method public void setIcon(android.graphics.drawable.Drawable!);
- method public void setIcon(int);
- method public void setIconSpaceReserved(boolean);
- method public void setIntent(android.content.Intent!);
- method public void setKey(String!);
- method public void setLayoutResource(int);
- method public void setOnPreferenceChangeListener(androidx.preference.Preference.OnPreferenceChangeListener!);
- method public void setOnPreferenceClickListener(androidx.preference.Preference.OnPreferenceClickListener!);
- method public void setOrder(int);
- method public void setPersistent(boolean);
- method public void setPreferenceDataStore(androidx.preference.PreferenceDataStore!);
- method public void setSelectable(boolean);
- method public void setShouldDisableView(boolean);
- method public void setSingleLineTitle(boolean);
- method public void setSummary(CharSequence!);
- method public void setSummary(int);
- method public final void setSummaryProvider(androidx.preference.Preference.SummaryProvider?);
- method public void setTitle(CharSequence!);
- method public void setTitle(int);
- method public void setViewId(int);
- method public final void setVisible(boolean);
- method public void setWidgetLayoutResource(int);
- method public boolean shouldDisableDependents();
- method protected boolean shouldPersist();
- field public static final int DEFAULT_ORDER = 2147483647; // 0x7fffffff
- }
-
- public static class Preference.BaseSavedState extends android.view.AbsSavedState {
- ctor public Preference.BaseSavedState(android.os.Parcel!);
- ctor public Preference.BaseSavedState(android.os.Parcelable!);
- field public static final android.os.Parcelable.Creator<androidx.preference.Preference.BaseSavedState>! CREATOR;
- }
-
- public static interface Preference.OnPreferenceChangeListener {
- method public boolean onPreferenceChange(androidx.preference.Preference!, Object!);
- }
-
- public static interface Preference.OnPreferenceClickListener {
- method public boolean onPreferenceClick(androidx.preference.Preference!);
- }
-
- public static interface Preference.SummaryProvider<T extends androidx.preference.Preference> {
- method public CharSequence! provideSummary(T!);
- }
-
- public class PreferenceCategory extends androidx.preference.PreferenceGroup {
- ctor public PreferenceCategory(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public PreferenceCategory(android.content.Context!, android.util.AttributeSet!, int);
- ctor public PreferenceCategory(android.content.Context!, android.util.AttributeSet!);
- ctor public PreferenceCategory(android.content.Context!);
- }
-
- public abstract class PreferenceDataStore {
- ctor public PreferenceDataStore();
- method public boolean getBoolean(String!, boolean);
- method public float getFloat(String!, float);
- method public int getInt(String!, int);
- method public long getLong(String!, long);
- method public String? getString(String!, String?);
- method public java.util.Set<java.lang.String>? getStringSet(String!, java.util.Set<java.lang.String>?);
- method public void putBoolean(String!, boolean);
- method public void putFloat(String!, float);
- method public void putInt(String!, int);
- method public void putLong(String!, long);
- method public void putString(String!, String?);
- method public void putStringSet(String!, java.util.Set<java.lang.String>?);
- }
-
- @Deprecated public abstract class PreferenceDialogFragment extends android.app.DialogFragment implements android.content.DialogInterface.OnClickListener {
- ctor @Deprecated public PreferenceDialogFragment();
- method @Deprecated public androidx.preference.DialogPreference! getPreference();
- method @Deprecated protected void onBindDialogView(android.view.View!);
- method @Deprecated public void onClick(android.content.DialogInterface!, int);
- method @Deprecated protected android.view.View! onCreateDialogView(android.content.Context!);
- method @Deprecated public abstract void onDialogClosed(boolean);
- method @Deprecated protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder!);
- field @Deprecated protected static final String ARG_KEY = "key";
- }
-
- public abstract class PreferenceDialogFragmentCompat extends androidx.fragment.app.DialogFragment implements android.content.DialogInterface.OnClickListener {
- ctor public PreferenceDialogFragmentCompat();
- method public androidx.preference.DialogPreference! getPreference();
- method protected void onBindDialogView(android.view.View!);
- method public void onClick(android.content.DialogInterface!, int);
- method protected android.view.View! onCreateDialogView(android.content.Context!);
- method public abstract void onDialogClosed(boolean);
- method protected void onPrepareDialogBuilder(androidx.appcompat.app.AlertDialog.Builder!);
- field protected static final String ARG_KEY = "key";
- }
-
- @Deprecated public abstract class PreferenceFragment extends android.app.Fragment implements androidx.preference.DialogPreference.TargetFragment androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener androidx.preference.PreferenceManager.OnNavigateToScreenListener androidx.preference.PreferenceManager.OnPreferenceTreeClickListener {
- ctor @Deprecated public PreferenceFragment();
- method @Deprecated public void addPreferencesFromResource(@XmlRes int);
- method @Deprecated public <T extends androidx.preference.Preference> T! findPreference(CharSequence!);
- method @Deprecated public final androidx.recyclerview.widget.RecyclerView! getListView();
- method @Deprecated public androidx.preference.PreferenceManager! getPreferenceManager();
- method @Deprecated public androidx.preference.PreferenceScreen! getPreferenceScreen();
- method @Deprecated protected androidx.recyclerview.widget.RecyclerView.Adapter! onCreateAdapter(androidx.preference.PreferenceScreen!);
- method @Deprecated public androidx.recyclerview.widget.RecyclerView.LayoutManager! onCreateLayoutManager();
- method @Deprecated public abstract void onCreatePreferences(android.os.Bundle!, String!);
- method @Deprecated public androidx.recyclerview.widget.RecyclerView! onCreateRecyclerView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method @Deprecated public void onDisplayPreferenceDialog(androidx.preference.Preference!);
- method @Deprecated public void onNavigateToScreen(androidx.preference.PreferenceScreen!);
- method @Deprecated public boolean onPreferenceTreeClick(androidx.preference.Preference!);
- method @Deprecated public void scrollToPreference(String!);
- method @Deprecated public void scrollToPreference(androidx.preference.Preference!);
- method @Deprecated public void setDivider(android.graphics.drawable.Drawable!);
- method @Deprecated public void setDividerHeight(int);
- method @Deprecated public void setPreferenceScreen(androidx.preference.PreferenceScreen!);
- method @Deprecated public void setPreferencesFromResource(@XmlRes int, String?);
- field @Deprecated public static final String ARG_PREFERENCE_ROOT = "androidx.preference.PreferenceFragmentCompat.PREFERENCE_ROOT";
- }
-
- @Deprecated public static interface PreferenceFragment.OnPreferenceDisplayDialogCallback {
- method @Deprecated public boolean onPreferenceDisplayDialog(androidx.preference.PreferenceFragment, androidx.preference.Preference!);
- }
-
- @Deprecated public static interface PreferenceFragment.OnPreferenceStartFragmentCallback {
- method @Deprecated public boolean onPreferenceStartFragment(androidx.preference.PreferenceFragment!, androidx.preference.Preference!);
- }
-
- @Deprecated public static interface PreferenceFragment.OnPreferenceStartScreenCallback {
- method @Deprecated public boolean onPreferenceStartScreen(androidx.preference.PreferenceFragment!, androidx.preference.PreferenceScreen!);
- }
-
- public abstract class PreferenceFragmentCompat extends androidx.fragment.app.Fragment implements androidx.preference.DialogPreference.TargetFragment androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener androidx.preference.PreferenceManager.OnNavigateToScreenListener androidx.preference.PreferenceManager.OnPreferenceTreeClickListener {
- ctor public PreferenceFragmentCompat();
- method public void addPreferencesFromResource(@XmlRes int);
- method public <T extends androidx.preference.Preference> T? findPreference(CharSequence);
- method public final androidx.recyclerview.widget.RecyclerView! getListView();
- method public androidx.preference.PreferenceManager! getPreferenceManager();
- method public androidx.preference.PreferenceScreen! getPreferenceScreen();
- method protected androidx.recyclerview.widget.RecyclerView.Adapter! onCreateAdapter(androidx.preference.PreferenceScreen!);
- method public androidx.recyclerview.widget.RecyclerView.LayoutManager! onCreateLayoutManager();
- method public abstract void onCreatePreferences(android.os.Bundle!, String!);
- method public androidx.recyclerview.widget.RecyclerView! onCreateRecyclerView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
- method public void onDisplayPreferenceDialog(androidx.preference.Preference!);
- method public void onNavigateToScreen(androidx.preference.PreferenceScreen!);
- method public boolean onPreferenceTreeClick(androidx.preference.Preference!);
- method public void scrollToPreference(String!);
- method public void scrollToPreference(androidx.preference.Preference!);
- method public void setDivider(android.graphics.drawable.Drawable!);
- method public void setDividerHeight(int);
- method public void setPreferenceScreen(androidx.preference.PreferenceScreen!);
- method public void setPreferencesFromResource(@XmlRes int, String?);
- field public static final String ARG_PREFERENCE_ROOT = "androidx.preference.PreferenceFragmentCompat.PREFERENCE_ROOT";
- }
-
- public static interface PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback {
- method public boolean onPreferenceDisplayDialog(androidx.preference.PreferenceFragmentCompat, androidx.preference.Preference!);
- }
-
- public static interface PreferenceFragmentCompat.OnPreferenceStartFragmentCallback {
- method public boolean onPreferenceStartFragment(androidx.preference.PreferenceFragmentCompat!, androidx.preference.Preference!);
- }
-
- public static interface PreferenceFragmentCompat.OnPreferenceStartScreenCallback {
- method public boolean onPreferenceStartScreen(androidx.preference.PreferenceFragmentCompat!, androidx.preference.PreferenceScreen!);
- }
-
- public abstract class PreferenceGroup extends androidx.preference.Preference {
- ctor public PreferenceGroup(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public PreferenceGroup(android.content.Context!, android.util.AttributeSet!, int);
- ctor public PreferenceGroup(android.content.Context!, android.util.AttributeSet!);
- method public void addItemFromInflater(androidx.preference.Preference!);
- method public boolean addPreference(androidx.preference.Preference!);
- method protected void dispatchRestoreInstanceState(android.os.Bundle!);
- method protected void dispatchSaveInstanceState(android.os.Bundle!);
- method public <T extends androidx.preference.Preference> T? findPreference(CharSequence);
- method public int getInitialExpandedChildrenCount();
- method public androidx.preference.Preference! getPreference(int);
- method public int getPreferenceCount();
- method protected boolean isOnSameScreenAsChildren();
- method public boolean isOrderingAsAdded();
- method protected boolean onPrepareAddPreference(androidx.preference.Preference!);
- method public void removeAll();
- method public boolean removePreference(androidx.preference.Preference!);
- method public boolean removePreferenceRecursively(CharSequence);
- method public void setInitialExpandedChildrenCount(int);
- method public void setOrderingAsAdded(boolean);
- }
-
- public static interface PreferenceGroup.PreferencePositionCallback {
- method public int getPreferenceAdapterPosition(String!);
- method public int getPreferenceAdapterPosition(androidx.preference.Preference!);
- }
-
- public class PreferenceManager {
- method public androidx.preference.PreferenceScreen! createPreferenceScreen(android.content.Context!);
- method public <T extends androidx.preference.Preference> T? findPreference(CharSequence);
- method public android.content.Context! getContext();
- method public static android.content.SharedPreferences! getDefaultSharedPreferences(android.content.Context!);
- method public androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener! getOnDisplayPreferenceDialogListener();
- method public androidx.preference.PreferenceManager.OnNavigateToScreenListener! getOnNavigateToScreenListener();
- method public androidx.preference.PreferenceManager.OnPreferenceTreeClickListener! getOnPreferenceTreeClickListener();
- method public androidx.preference.PreferenceManager.PreferenceComparisonCallback! getPreferenceComparisonCallback();
- method public androidx.preference.PreferenceDataStore? getPreferenceDataStore();
- method public androidx.preference.PreferenceScreen! getPreferenceScreen();
- method public android.content.SharedPreferences! getSharedPreferences();
- method public int getSharedPreferencesMode();
- method public String! getSharedPreferencesName();
- method public boolean isStorageDefault();
- method public boolean isStorageDeviceProtected();
- method public static void setDefaultValues(android.content.Context!, int, boolean);
- method public static void setDefaultValues(android.content.Context!, String!, int, int, boolean);
- method public void setOnDisplayPreferenceDialogListener(androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener!);
- method public void setOnNavigateToScreenListener(androidx.preference.PreferenceManager.OnNavigateToScreenListener!);
- method public void setOnPreferenceTreeClickListener(androidx.preference.PreferenceManager.OnPreferenceTreeClickListener!);
- method public void setPreferenceComparisonCallback(androidx.preference.PreferenceManager.PreferenceComparisonCallback!);
- method public void setPreferenceDataStore(androidx.preference.PreferenceDataStore!);
- method public boolean setPreferences(androidx.preference.PreferenceScreen!);
- method public void setSharedPreferencesMode(int);
- method public void setSharedPreferencesName(String!);
- method public void setStorageDefault();
- method public void setStorageDeviceProtected();
- method public void showDialog(androidx.preference.Preference!);
- field public static final String KEY_HAS_SET_DEFAULT_VALUES = "_has_set_default_values";
- }
-
- public static interface PreferenceManager.OnDisplayPreferenceDialogListener {
- method public void onDisplayPreferenceDialog(androidx.preference.Preference!);
- }
-
- public static interface PreferenceManager.OnNavigateToScreenListener {
- method public void onNavigateToScreen(androidx.preference.PreferenceScreen!);
- }
-
- public static interface PreferenceManager.OnPreferenceTreeClickListener {
- method public boolean onPreferenceTreeClick(androidx.preference.Preference!);
- }
-
- public abstract static class PreferenceManager.PreferenceComparisonCallback {
- ctor public PreferenceManager.PreferenceComparisonCallback();
- method public abstract boolean arePreferenceContentsTheSame(androidx.preference.Preference!, androidx.preference.Preference!);
- method public abstract boolean arePreferenceItemsTheSame(androidx.preference.Preference!, androidx.preference.Preference!);
- }
-
- public static class PreferenceManager.SimplePreferenceComparisonCallback extends androidx.preference.PreferenceManager.PreferenceComparisonCallback {
- ctor public PreferenceManager.SimplePreferenceComparisonCallback();
- method public boolean arePreferenceContentsTheSame(androidx.preference.Preference!, androidx.preference.Preference!);
- method public boolean arePreferenceItemsTheSame(androidx.preference.Preference!, androidx.preference.Preference!);
- }
-
- public final class PreferenceScreen extends androidx.preference.PreferenceGroup {
- method public void setShouldUseGeneratedIds(boolean);
- method public boolean shouldUseGeneratedIds();
- }
-
- public class PreferenceViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder {
- method public android.view.View! findViewById(@IdRes int);
- method public boolean isDividerAllowedAbove();
- method public boolean isDividerAllowedBelow();
- method public void setDividerAllowedAbove(boolean);
- method public void setDividerAllowedBelow(boolean);
- }
-
- public class SeekBarPreference extends androidx.preference.Preference {
- ctor public SeekBarPreference(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public SeekBarPreference(android.content.Context!, android.util.AttributeSet!, int);
- ctor public SeekBarPreference(android.content.Context!, android.util.AttributeSet!);
- ctor public SeekBarPreference(android.content.Context!);
- method public int getMax();
- method public int getMin();
- method public final int getSeekBarIncrement();
- method public boolean getShowSeekBarValue();
- method public boolean getUpdatesContinuously();
- method public int getValue();
- method public boolean isAdjustable();
- method public void setAdjustable(boolean);
- method public final void setMax(int);
- method public void setMin(int);
- method public final void setSeekBarIncrement(int);
- method public void setShowSeekBarValue(boolean);
- method public void setUpdatesContinuously(boolean);
- method public void setValue(int);
- }
-
- public class SwitchPreference extends androidx.preference.TwoStatePreference {
- ctor public SwitchPreference(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public SwitchPreference(android.content.Context!, android.util.AttributeSet!, int);
- ctor public SwitchPreference(android.content.Context!, android.util.AttributeSet!);
- ctor public SwitchPreference(android.content.Context!);
- method public CharSequence! getSwitchTextOff();
- method public CharSequence! getSwitchTextOn();
- method public void setSwitchTextOff(CharSequence!);
- method public void setSwitchTextOff(int);
- method public void setSwitchTextOn(CharSequence!);
- method public void setSwitchTextOn(int);
- }
-
- public class SwitchPreferenceCompat extends androidx.preference.TwoStatePreference {
- ctor public SwitchPreferenceCompat(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public SwitchPreferenceCompat(android.content.Context!, android.util.AttributeSet!, int);
- ctor public SwitchPreferenceCompat(android.content.Context!, android.util.AttributeSet!);
- ctor public SwitchPreferenceCompat(android.content.Context!);
- method public CharSequence! getSwitchTextOff();
- method public CharSequence! getSwitchTextOn();
- method public void setSwitchTextOff(CharSequence!);
- method public void setSwitchTextOff(int);
- method public void setSwitchTextOn(CharSequence!);
- method public void setSwitchTextOn(int);
- }
-
- public abstract class TwoStatePreference extends androidx.preference.Preference {
- ctor public TwoStatePreference(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public TwoStatePreference(android.content.Context!, android.util.AttributeSet!, int);
- ctor public TwoStatePreference(android.content.Context!, android.util.AttributeSet!);
- ctor public TwoStatePreference(android.content.Context!);
- method public boolean getDisableDependentsState();
- method public CharSequence! getSummaryOff();
- method public CharSequence! getSummaryOn();
- method public boolean isChecked();
- method public void setChecked(boolean);
- method public void setDisableDependentsState(boolean);
- method public void setSummaryOff(CharSequence!);
- method public void setSummaryOff(int);
- method public void setSummaryOn(CharSequence!);
- method public void setSummaryOn(int);
- method protected void syncSummaryView(androidx.preference.PreferenceViewHolder!);
- field protected boolean mChecked;
- }
-
-}
-
diff --git a/preference/api/current.txt b/preference/api/current.txt
index 0edd4f7b..0671bee 100644
--- a/preference/api/current.txt
+++ b/preference/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.preference {
public class CheckBoxPreference extends androidx.preference.TwoStatePreference {
@@ -33,7 +33,7 @@
}
public static interface DialogPreference.TargetFragment {
- method public <T extends androidx.preference.Preference> T? findPreference(CharSequence);
+ method public <T extends androidx.preference.Preference> T! findPreference(CharSequence!);
}
public class DropDownPreference extends androidx.preference.ListPreference {
@@ -150,7 +150,7 @@
ctor public Preference(android.content.Context!);
method public boolean callChangeListener(Object!);
method public int compareTo(androidx.preference.Preference);
- method protected <T extends androidx.preference.Preference> T? findPreferenceInHierarchy(String);
+ method protected <T extends androidx.preference.Preference> T! findPreferenceInHierarchy(String!);
method public android.content.Context! getContext();
method public String! getDependency();
method public android.os.Bundle! getExtras();
@@ -290,9 +290,13 @@
method @Deprecated public androidx.preference.DialogPreference! getPreference();
method @Deprecated protected void onBindDialogView(android.view.View!);
method @Deprecated public void onClick(android.content.DialogInterface!, int);
+ method @Deprecated public void onCreate(android.os.Bundle!);
+ method @Deprecated public android.app.Dialog onCreateDialog(android.os.Bundle!);
method @Deprecated protected android.view.View! onCreateDialogView(android.content.Context!);
method @Deprecated public abstract void onDialogClosed(boolean);
+ method @Deprecated public void onDismiss(android.content.DialogInterface!);
method @Deprecated protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder!);
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle);
field @Deprecated protected static final String ARG_KEY = "key";
}
@@ -314,13 +318,20 @@
method @Deprecated public final androidx.recyclerview.widget.RecyclerView! getListView();
method @Deprecated public androidx.preference.PreferenceManager! getPreferenceManager();
method @Deprecated public androidx.preference.PreferenceScreen! getPreferenceScreen();
+ method @Deprecated public void onCreate(android.os.Bundle!);
method @Deprecated protected androidx.recyclerview.widget.RecyclerView.Adapter! onCreateAdapter(androidx.preference.PreferenceScreen!);
method @Deprecated public androidx.recyclerview.widget.RecyclerView.LayoutManager! onCreateLayoutManager();
method @Deprecated public abstract void onCreatePreferences(android.os.Bundle!, String!);
method @Deprecated public androidx.recyclerview.widget.RecyclerView! onCreateRecyclerView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public android.view.View! onCreateView(android.view.LayoutInflater!, android.view.ViewGroup!, android.os.Bundle!);
+ method @Deprecated public void onDestroyView();
method @Deprecated public void onDisplayPreferenceDialog(androidx.preference.Preference!);
method @Deprecated public void onNavigateToScreen(androidx.preference.PreferenceScreen!);
method @Deprecated public boolean onPreferenceTreeClick(androidx.preference.Preference!);
+ method @Deprecated public void onSaveInstanceState(android.os.Bundle!);
+ method @Deprecated public void onStart();
+ method @Deprecated public void onStop();
+ method @Deprecated public void onViewCreated(android.view.View!, android.os.Bundle!);
method @Deprecated public void scrollToPreference(String!);
method @Deprecated public void scrollToPreference(androidx.preference.Preference!);
method @Deprecated public void setDivider(android.graphics.drawable.Drawable!);
@@ -345,7 +356,7 @@
public abstract class PreferenceFragmentCompat extends androidx.fragment.app.Fragment implements androidx.preference.DialogPreference.TargetFragment androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener androidx.preference.PreferenceManager.OnNavigateToScreenListener androidx.preference.PreferenceManager.OnPreferenceTreeClickListener {
ctor public PreferenceFragmentCompat();
method public void addPreferencesFromResource(@XmlRes int);
- method public <T extends androidx.preference.Preference> T? findPreference(CharSequence);
+ method public <T extends androidx.preference.Preference> T! findPreference(CharSequence!);
method public final androidx.recyclerview.widget.RecyclerView! getListView();
method public androidx.preference.PreferenceManager! getPreferenceManager();
method public androidx.preference.PreferenceScreen! getPreferenceScreen();
@@ -385,7 +396,7 @@
method public boolean addPreference(androidx.preference.Preference!);
method protected void dispatchRestoreInstanceState(android.os.Bundle!);
method protected void dispatchSaveInstanceState(android.os.Bundle!);
- method public <T extends androidx.preference.Preference> T? findPreference(CharSequence);
+ method public <T extends androidx.preference.Preference> T! findPreference(CharSequence!);
method public int getInitialExpandedChildrenCount();
method public androidx.preference.Preference! getPreference(int);
method public int getPreferenceCount();
@@ -406,7 +417,7 @@
public class PreferenceManager {
method public androidx.preference.PreferenceScreen! createPreferenceScreen(android.content.Context!);
- method public <T extends androidx.preference.Preference> T? findPreference(CharSequence);
+ method public <T extends androidx.preference.Preference> T! findPreference(CharSequence!);
method public android.content.Context! getContext();
method public static android.content.SharedPreferences! getDefaultSharedPreferences(android.content.Context!);
method public androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener! getOnDisplayPreferenceDialogListener();
@@ -481,16 +492,12 @@
method public int getMax();
method public int getMin();
method public final int getSeekBarIncrement();
- method public boolean getShowSeekBarValue();
- method public boolean getUpdatesContinuously();
method public int getValue();
method public boolean isAdjustable();
method public void setAdjustable(boolean);
method public final void setMax(int);
method public void setMin(int);
method public final void setSeekBarIncrement(int);
- method public void setShowSeekBarValue(boolean);
- method public void setUpdatesContinuously(boolean);
method public void setValue(int);
}
diff --git a/preference/api/res-1.1.0-alpha04.txt b/preference/api/res-1.1.0-alpha04.txt
deleted file mode 100644
index 3afd07c..0000000
--- a/preference/api/res-1.1.0-alpha04.txt
+++ /dev/null
@@ -1,69 +0,0 @@
-style Preference
-style Preference_Category
-style Preference_CheckBoxPreference
-style Preference_DialogPreference
-style Preference_DialogPreference_EditTextPreference
-style Preference_DropDown
-style Preference_Information
-style Preference_PreferenceScreen
-style Preference_SeekBarPreference
-style Preference_SwitchPreferenceCompat
-style PreferenceFragment
-style PreferenceFragmentList
-style PreferenceThemeOverlay
-attr adjustable
-attr allowDividerAbove
-attr allowDividerAfterLastItem
-attr allowDividerBelow
-attr checkBoxPreferenceStyle
-attr defaultValue
-attr dependency
-attr dialogIcon
-attr dialogLayout
-attr dialogMessage
-attr dialogPreferenceStyle
-attr dialogTitle
-attr disableDependentsState
-attr dropdownPreferenceStyle
-attr editTextPreferenceStyle
-attr enabled
-attr entries
-attr entryValues
-attr fragment
-attr icon
-attr iconSpaceReserved
-attr key
-attr layout
-attr maxHeight
-attr maxWidth
-attr min
-attr negativeButtonText
-attr order
-attr orderingFromXml
-attr persistent
-attr positiveButtonText
-attr preferenceCategoryStyle
-attr preferenceCategoryTitleTextAppearance
-attr preferenceFragmentCompatStyle
-attr preferenceFragmentListStyle
-attr preferenceFragmentStyle
-attr preferenceInformationStyle
-attr preferenceScreenStyle
-attr preferenceStyle
-attr preferenceTheme
-attr seekBarIncrement
-attr seekBarPreferenceStyle
-attr selectable
-attr selectableItemBackground
-attr shouldDisableView
-attr showSeekBarValue
-attr singleLineTitle
-attr summary
-attr summaryOff
-attr summaryOn
-attr switchPreferenceCompatStyle
-attr switchPreferenceStyle
-attr switchTextOff
-attr switchTextOn
-attr title
-attr widgetLayout
diff --git a/preference/api/restricted_1.0.0.txt b/preference/api/restricted_1.0.0.txt
deleted file mode 100644
index 3b3a194..0000000
--- a/preference/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,131 +0,0 @@
-// Signature format: 3.0
-package androidx.preference {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class AndroidResources {
- field public static final int ANDROID_R_EDITTEXT_PREFERENCE_STYLE = 16842898; // 0x1010092
- field public static final int ANDROID_R_ICON_FRAME = 16908350; // 0x102003e
- field public static final int ANDROID_R_LIST_CONTAINER = 16908351; // 0x102003f
- field public static final int ANDROID_R_PREFERENCE_FRAGMENT_STYLE = 16844038; // 0x1010506
- field public static final int ANDROID_R_SWITCH_WIDGET = 16908352; // 0x1020040
- }
-
- public class DropDownPreference extends androidx.preference.ListPreference {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int findSpinnerIndexOfValue(String!);
- }
-
- public class MultiSelectListPreference extends androidx.preference.internal.AbstractMultiSelectListPreference {
- method public CharSequence[]! getEntries();
- method public CharSequence[]! getEntryValues();
- method public java.util.Set<java.lang.String>! getValues();
- method public void setValues(java.util.Set<java.lang.String>!);
- }
-
- public class Preference {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final void clearWasDetached();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void onAttachedToHierarchy(androidx.preference.PreferenceManager!, long);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void performClick(android.view.View!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void performClick();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final boolean wasDetached();
- }
-
- public abstract class PreferenceDialogFragment {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected boolean needInputMethod();
- }
-
- public abstract class PreferenceDialogFragmentCompat {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected boolean needInputMethod();
- }
-
- public abstract class PreferenceFragment implements androidx.preference.DialogPreference.TargetFragment androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener androidx.preference.PreferenceManager.OnNavigateToScreenListener androidx.preference.PreferenceManager.OnPreferenceTreeClickListener {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.app.Fragment! getCallbackFragment();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void onBindPreferences();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void onUnbindPreferences();
- }
-
- public abstract class PreferenceFragmentCompat implements androidx.preference.DialogPreference.TargetFragment androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener androidx.preference.PreferenceManager.OnNavigateToScreenListener androidx.preference.PreferenceManager.OnPreferenceTreeClickListener {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.fragment.app.Fragment! getCallbackFragment();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void onBindPreferences();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void onUnbindPreferences();
- }
-
- public abstract class PreferenceGroup extends androidx.preference.Preference {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.preference.PreferenceGroup.OnExpandButtonClickListener? getOnExpandButtonClickListener();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean isAttached();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setOnExpandButtonClickListener(androidx.preference.PreferenceGroup.OnExpandButtonClickListener?);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static interface PreferenceGroup.OnExpandButtonClickListener {
- method public void onExpandButtonClick();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class PreferenceGroupAdapter implements androidx.preference.PreferenceGroup.PreferencePositionCallback {
- ctor public PreferenceGroupAdapter(androidx.preference.PreferenceGroup!);
- method public androidx.preference.Preference! getItem(int);
- method public int getItemCount();
- method public long getItemId(int);
- method public int getItemViewType(int);
- method public int getPreferenceAdapterPosition(String!);
- method public int getPreferenceAdapterPosition(androidx.preference.Preference!);
- method public void onBindViewHolder(androidx.preference.PreferenceViewHolder!, int);
- method public androidx.preference.PreferenceViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
- method public void onPreferenceChange(androidx.preference.Preference!);
- method public void onPreferenceHierarchyChange(androidx.preference.Preference!);
- method public void onPreferenceVisibilityChange(androidx.preference.Preference!);
- }
-
- public class PreferenceManager {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public PreferenceManager(android.content.Context!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.preference.PreferenceScreen! inflateFromResource(android.content.Context!, int, androidx.preference.PreferenceScreen!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class PreferenceRecyclerViewAccessibilityDelegate {
- ctor public PreferenceRecyclerViewAccessibilityDelegate(androidx.recyclerview.widget.RecyclerView!);
- method public androidx.core.view.AccessibilityDelegateCompat! getItemDelegate();
- }
-
- public final class PreferenceScreen extends androidx.preference.PreferenceGroup {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public PreferenceScreen(android.content.Context!, android.util.AttributeSet!);
- }
-
- public class PreferenceViewHolder {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.TESTS}) public static androidx.preference.PreferenceViewHolder! createInstanceForTests(android.view.View!);
- }
-
- public abstract class TwoStatePreference extends androidx.preference.Preference {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void syncSummaryView(android.view.View!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class UnPressableLinearLayout {
- ctor public UnPressableLinearLayout(android.content.Context!);
- ctor public UnPressableLinearLayout(android.content.Context!, android.util.AttributeSet!);
- method protected void dispatchSetPressed(boolean);
- }
-
-}
-
-package @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) androidx.preference.internal {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class AbstractMultiSelectListPreference extends androidx.preference.DialogPreference {
- ctor public AbstractMultiSelectListPreference(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public AbstractMultiSelectListPreference(android.content.Context!, android.util.AttributeSet!, int);
- ctor public AbstractMultiSelectListPreference(android.content.Context!, android.util.AttributeSet!);
- ctor public AbstractMultiSelectListPreference(android.content.Context!);
- method public abstract CharSequence[]! getEntries();
- method public abstract CharSequence[]! getEntryValues();
- method public abstract java.util.Set<java.lang.String>! getValues();
- method public abstract void setValues(java.util.Set<java.lang.String>!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class PreferenceImageView {
- ctor public PreferenceImageView(android.content.Context!);
- ctor public PreferenceImageView(android.content.Context!, android.util.AttributeSet!);
- ctor public PreferenceImageView(android.content.Context!, android.util.AttributeSet!, int);
- method public int getMaxHeight();
- method public int getMaxWidth();
- method protected void onMeasure(int, int);
- method public void setMaxHeight(int);
- method public void setMaxWidth(int);
- }
-
-}
-
diff --git a/preference/api/restricted_1.1.0-alpha04.ignore b/preference/api/restricted_1.1.0-alpha04.ignore
deleted file mode 100644
index 9a6d5b8..0000000
--- a/preference/api/restricted_1.1.0-alpha04.ignore
+++ /dev/null
@@ -1,23 +0,0 @@
-// Baseline format: 1.0
-// See tools/metalava/API-LINT.md for how to update this file.
-
-RemovedClass: androidx.preference.internal.AbstractMultiSelectListPreference:
- Removed class androidx.preference.internal.AbstractMultiSelectListPreference
-
-
-RemovedField: androidx.preference.AndroidResources#ANDROID_R_EDITTEXT_PREFERENCE_STYLE:
- Removed field androidx.preference.AndroidResources.ANDROID_R_EDITTEXT_PREFERENCE_STYLE
-RemovedField: androidx.preference.AndroidResources#ANDROID_R_LIST_CONTAINER:
- Removed field androidx.preference.AndroidResources.ANDROID_R_LIST_CONTAINER
-RemovedField: androidx.preference.AndroidResources#ANDROID_R_PREFERENCE_FRAGMENT_STYLE:
- Removed field androidx.preference.AndroidResources.ANDROID_R_PREFERENCE_FRAGMENT_STYLE
-RemovedField: androidx.preference.AndroidResources#ANDROID_R_SWITCH_WIDGET:
- Removed field androidx.preference.AndroidResources.ANDROID_R_SWITCH_WIDGET
-
-
-RemovedMethod: androidx.preference.Preference#clearWasDetached():
- Removed method androidx.preference.Preference.clearWasDetached()
-RemovedMethod: androidx.preference.Preference#wasDetached():
- Removed method androidx.preference.Preference.wasDetached()
-
-
diff --git a/preference/api/restricted_1.1.0-alpha04.txt b/preference/api/restricted_1.1.0-alpha04.txt
deleted file mode 100644
index d8a2d7c..0000000
--- a/preference/api/restricted_1.1.0-alpha04.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-// Signature format: 3.0
-package androidx.preference {
-
-
- public class Preference implements java.lang.Comparable<androidx.preference.Preference> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void onAttachedToHierarchy(androidx.preference.PreferenceManager!, long);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void performClick(android.view.View!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void performClick();
- }
-
- @Deprecated public abstract class PreferenceDialogFragment extends android.app.DialogFragment implements android.content.DialogInterface.OnClickListener {
- }
-
- public abstract class PreferenceDialogFragmentCompat extends androidx.fragment.app.DialogFragment implements android.content.DialogInterface.OnClickListener {
- }
-
- @Deprecated public abstract class PreferenceFragment extends android.app.Fragment implements androidx.preference.DialogPreference.TargetFragment androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener androidx.preference.PreferenceManager.OnNavigateToScreenListener androidx.preference.PreferenceManager.OnPreferenceTreeClickListener {
- }
-
- public abstract class PreferenceFragmentCompat extends androidx.fragment.app.Fragment implements androidx.preference.DialogPreference.TargetFragment androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener androidx.preference.PreferenceManager.OnNavigateToScreenListener androidx.preference.PreferenceManager.OnPreferenceTreeClickListener {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.fragment.app.Fragment! getCallbackFragment();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void onBindPreferences();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void onUnbindPreferences();
- }
-
- public abstract class PreferenceGroup extends androidx.preference.Preference {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.preference.PreferenceGroup.OnExpandButtonClickListener? getOnExpandButtonClickListener();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setOnExpandButtonClickListener(androidx.preference.PreferenceGroup.OnExpandButtonClickListener?);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface PreferenceGroup.OnExpandButtonClickListener {
- method public void onExpandButtonClick();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PreferenceGroupAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.preference.PreferenceViewHolder> implements androidx.preference.PreferenceGroup.PreferencePositionCallback {
- ctor public PreferenceGroupAdapter(androidx.preference.PreferenceGroup!);
- method public androidx.preference.Preference! getItem(int);
- method public int getItemCount();
- method public int getPreferenceAdapterPosition(String!);
- method public int getPreferenceAdapterPosition(androidx.preference.Preference!);
- method public void onBindViewHolder(androidx.preference.PreferenceViewHolder, int);
- method public androidx.preference.PreferenceViewHolder onCreateViewHolder(android.view.ViewGroup, int);
- method public void onPreferenceChange(androidx.preference.Preference!);
- method public void onPreferenceHierarchyChange(androidx.preference.Preference!);
- method public void onPreferenceVisibilityChange(androidx.preference.Preference!);
- }
-
- public class PreferenceManager {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public PreferenceManager(android.content.Context!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.preference.PreferenceScreen! inflateFromResource(android.content.Context!, int, androidx.preference.PreferenceScreen!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PreferenceRecyclerViewAccessibilityDelegate extends androidx.recyclerview.widget.RecyclerViewAccessibilityDelegate {
- ctor public PreferenceRecyclerViewAccessibilityDelegate(androidx.recyclerview.widget.RecyclerView!);
- }
-
- public final class PreferenceScreen extends androidx.preference.PreferenceGroup {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public PreferenceScreen(android.content.Context!, android.util.AttributeSet!);
- }
-
- public class PreferenceViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.TESTS) public static androidx.preference.PreferenceViewHolder! createInstanceForTests(android.view.View!);
- }
-
- public abstract class TwoStatePreference extends androidx.preference.Preference {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class UnPressableLinearLayout extends android.widget.LinearLayout {
- ctor public UnPressableLinearLayout(android.content.Context!);
- ctor public UnPressableLinearLayout(android.content.Context!, android.util.AttributeSet!);
- }
-
-}
-
-
diff --git a/preference/api/restricted_current.txt b/preference/api/restricted_current.txt
deleted file mode 100644
index d8a2d7c..0000000
--- a/preference/api/restricted_current.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-// Signature format: 3.0
-package androidx.preference {
-
-
- public class Preference implements java.lang.Comparable<androidx.preference.Preference> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void onAttachedToHierarchy(androidx.preference.PreferenceManager!, long);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void performClick(android.view.View!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void performClick();
- }
-
- @Deprecated public abstract class PreferenceDialogFragment extends android.app.DialogFragment implements android.content.DialogInterface.OnClickListener {
- }
-
- public abstract class PreferenceDialogFragmentCompat extends androidx.fragment.app.DialogFragment implements android.content.DialogInterface.OnClickListener {
- }
-
- @Deprecated public abstract class PreferenceFragment extends android.app.Fragment implements androidx.preference.DialogPreference.TargetFragment androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener androidx.preference.PreferenceManager.OnNavigateToScreenListener androidx.preference.PreferenceManager.OnPreferenceTreeClickListener {
- }
-
- public abstract class PreferenceFragmentCompat extends androidx.fragment.app.Fragment implements androidx.preference.DialogPreference.TargetFragment androidx.preference.PreferenceManager.OnDisplayPreferenceDialogListener androidx.preference.PreferenceManager.OnNavigateToScreenListener androidx.preference.PreferenceManager.OnPreferenceTreeClickListener {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.fragment.app.Fragment! getCallbackFragment();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void onBindPreferences();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void onUnbindPreferences();
- }
-
- public abstract class PreferenceGroup extends androidx.preference.Preference {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.preference.PreferenceGroup.OnExpandButtonClickListener? getOnExpandButtonClickListener();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void setOnExpandButtonClickListener(androidx.preference.PreferenceGroup.OnExpandButtonClickListener?);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface PreferenceGroup.OnExpandButtonClickListener {
- method public void onExpandButtonClick();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PreferenceGroupAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.preference.PreferenceViewHolder> implements androidx.preference.PreferenceGroup.PreferencePositionCallback {
- ctor public PreferenceGroupAdapter(androidx.preference.PreferenceGroup!);
- method public androidx.preference.Preference! getItem(int);
- method public int getItemCount();
- method public int getPreferenceAdapterPosition(String!);
- method public int getPreferenceAdapterPosition(androidx.preference.Preference!);
- method public void onBindViewHolder(androidx.preference.PreferenceViewHolder, int);
- method public androidx.preference.PreferenceViewHolder onCreateViewHolder(android.view.ViewGroup, int);
- method public void onPreferenceChange(androidx.preference.Preference!);
- method public void onPreferenceHierarchyChange(androidx.preference.Preference!);
- method public void onPreferenceVisibilityChange(androidx.preference.Preference!);
- }
-
- public class PreferenceManager {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public PreferenceManager(android.content.Context!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.preference.PreferenceScreen! inflateFromResource(android.content.Context!, int, androidx.preference.PreferenceScreen!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class PreferenceRecyclerViewAccessibilityDelegate extends androidx.recyclerview.widget.RecyclerViewAccessibilityDelegate {
- ctor public PreferenceRecyclerViewAccessibilityDelegate(androidx.recyclerview.widget.RecyclerView!);
- }
-
- public final class PreferenceScreen extends androidx.preference.PreferenceGroup {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public PreferenceScreen(android.content.Context!, android.util.AttributeSet!);
- }
-
- public class PreferenceViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.TESTS) public static androidx.preference.PreferenceViewHolder! createInstanceForTests(android.view.View!);
- }
-
- public abstract class TwoStatePreference extends androidx.preference.Preference {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class UnPressableLinearLayout extends android.widget.LinearLayout {
- ctor public UnPressableLinearLayout(android.content.Context!);
- ctor public UnPressableLinearLayout(android.content.Context!, android.util.AttributeSet!);
- }
-
-}
-
-
diff --git a/preference/build.gradle b/preference/build.gradle
index 902a866..87f4968 100644
--- a/preference/build.gradle
+++ b/preference/build.gradle
@@ -20,17 +20,15 @@
plugins {
id("SupportAndroidLibraryPlugin")
- id("kotlin-android")
}
dependencies {
- // TODO: change to alpha02 after release
- implementation(project(":annotation"))
- api("androidx.appcompat:appcompat:1.1.0-alpha02")
- // TODO: change to alpha05 after release
- api(project(":core"))
+ // TODO: change to 1.1.0-alpha02 after release
+ api(project(":appcompat"))
+ api("androidx.core:core:1.1.0-alpha01")
implementation("androidx.collection:collection:1.0.0")
- api("androidx.fragment:fragment:1.1.0-alpha04")
+ // TODO: change to 1.1.0-alpha04 after release
+ api(project(":fragment"))
api("androidx.recyclerview:recyclerview:1.0.0")
androidTestImplementation(TEST_EXT_JUNIT)
@@ -40,7 +38,6 @@
androidTestImplementation(ESPRESSO_CORE, libs.exclude_for_espresso)
androidTestImplementation(MOCKITO_CORE, libs.exclude_bytebuddy) // DexMaker has it"s own MockMaker
androidTestImplementation(DEXMAKER_MOCKITO, libs.exclude_bytebuddy) // DexMaker has it"s own MockMaker
- androidTestImplementation(KOTLIN_STDLIB)
}
android {
@@ -63,6 +60,6 @@
mavenGroup = LibraryGroups.PREFERENCE
inceptionYear = "2015"
description = "AndroidX Preference"
- // TODO: remove when PreferenceFragment / PreferenceDialogFragment are removed
+ failOnUncheckedWarnings = false
failOnDeprecationWarnings = false
}
diff --git a/preference/ktx/api/1.0.0.txt b/preference/ktx/api/1.0.0.txt
index a6b5351..e9174e1 100644
--- a/preference/ktx/api/1.0.0.txt
+++ b/preference/ktx/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.preference {
public final class PreferenceGroupKt {
@@ -6,7 +6,7 @@
method public static operator boolean contains(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
method public static void forEach(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function1<? super androidx.preference.Preference,kotlin.Unit> action);
method public static void forEachIndexed(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super androidx.preference.Preference,kotlin.Unit> action);
- method public static operator <T extends androidx.preference.Preference> T? get(androidx.preference.PreferenceGroup, CharSequence key);
+ method public static operator androidx.preference.Preference get(androidx.preference.PreferenceGroup, CharSequence key);
method public static operator androidx.preference.Preference get(androidx.preference.PreferenceGroup, int index);
method public static kotlin.sequences.Sequence<androidx.preference.Preference> getChildren(androidx.preference.PreferenceGroup);
method public static int getSize(androidx.preference.PreferenceGroup);
diff --git a/preference/ktx/api/1.1.0-alpha02.txt b/preference/ktx/api/1.1.0-alpha02.txt
index a6b5351..e09222b8 100644
--- a/preference/ktx/api/1.1.0-alpha02.txt
+++ b/preference/ktx/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.preference {
public final class PreferenceGroupKt {
@@ -6,7 +6,7 @@
method public static operator boolean contains(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
method public static void forEach(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function1<? super androidx.preference.Preference,kotlin.Unit> action);
method public static void forEachIndexed(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super androidx.preference.Preference,kotlin.Unit> action);
- method public static operator <T extends androidx.preference.Preference> T? get(androidx.preference.PreferenceGroup, CharSequence key);
+ method public static operator <T extends androidx.preference.Preference> T get(androidx.preference.PreferenceGroup, CharSequence key);
method public static operator androidx.preference.Preference get(androidx.preference.PreferenceGroup, int index);
method public static kotlin.sequences.Sequence<androidx.preference.Preference> getChildren(androidx.preference.PreferenceGroup);
method public static int getSize(androidx.preference.PreferenceGroup);
diff --git a/preference/ktx/api/1.1.0-alpha03.txt b/preference/ktx/api/1.1.0-alpha03.txt
index 236569e..e09222b8 100644
--- a/preference/ktx/api/1.1.0-alpha03.txt
+++ b/preference/ktx/api/1.1.0-alpha03.txt
@@ -1,20 +1,20 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.preference {
public final class PreferenceGroupKt {
ctor public PreferenceGroupKt();
method public static operator boolean contains(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
- method public static inline void forEach(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function1<? super androidx.preference.Preference,kotlin.Unit> action);
- method public static inline void forEachIndexed(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super androidx.preference.Preference,kotlin.Unit> action);
- method public static inline operator <T extends androidx.preference.Preference> T? get(androidx.preference.PreferenceGroup, CharSequence key);
+ method public static void forEach(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function1<? super androidx.preference.Preference,kotlin.Unit> action);
+ method public static void forEachIndexed(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super androidx.preference.Preference,kotlin.Unit> action);
+ method public static operator <T extends androidx.preference.Preference> T get(androidx.preference.PreferenceGroup, CharSequence key);
method public static operator androidx.preference.Preference get(androidx.preference.PreferenceGroup, int index);
method public static kotlin.sequences.Sequence<androidx.preference.Preference> getChildren(androidx.preference.PreferenceGroup);
- method public static inline int getSize(androidx.preference.PreferenceGroup);
- method public static inline boolean isEmpty(androidx.preference.PreferenceGroup);
- method public static inline boolean isNotEmpty(androidx.preference.PreferenceGroup);
+ method public static int getSize(androidx.preference.PreferenceGroup);
+ method public static boolean isEmpty(androidx.preference.PreferenceGroup);
+ method public static boolean isNotEmpty(androidx.preference.PreferenceGroup);
method public static operator java.util.Iterator<androidx.preference.Preference> iterator(androidx.preference.PreferenceGroup);
- method public static inline operator void minusAssign(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
- method public static inline operator void plusAssign(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
+ method public static operator void minusAssign(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
+ method public static operator void plusAssign(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
}
}
diff --git a/preference/ktx/api/1.1.0-alpha04.txt b/preference/ktx/api/1.1.0-alpha04.txt
deleted file mode 100644
index 236569e..0000000
--- a/preference/ktx/api/1.1.0-alpha04.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-// Signature format: 3.0
-package androidx.preference {
-
- public final class PreferenceGroupKt {
- ctor public PreferenceGroupKt();
- method public static operator boolean contains(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
- method public static inline void forEach(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function1<? super androidx.preference.Preference,kotlin.Unit> action);
- method public static inline void forEachIndexed(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super androidx.preference.Preference,kotlin.Unit> action);
- method public static inline operator <T extends androidx.preference.Preference> T? get(androidx.preference.PreferenceGroup, CharSequence key);
- method public static operator androidx.preference.Preference get(androidx.preference.PreferenceGroup, int index);
- method public static kotlin.sequences.Sequence<androidx.preference.Preference> getChildren(androidx.preference.PreferenceGroup);
- method public static inline int getSize(androidx.preference.PreferenceGroup);
- method public static inline boolean isEmpty(androidx.preference.PreferenceGroup);
- method public static inline boolean isNotEmpty(androidx.preference.PreferenceGroup);
- method public static operator java.util.Iterator<androidx.preference.Preference> iterator(androidx.preference.PreferenceGroup);
- method public static inline operator void minusAssign(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
- method public static inline operator void plusAssign(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
- }
-
-}
-
diff --git a/preference/ktx/api/current.txt b/preference/ktx/api/current.txt
index 236569e..e09222b8 100644
--- a/preference/ktx/api/current.txt
+++ b/preference/ktx/api/current.txt
@@ -1,20 +1,20 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.preference {
public final class PreferenceGroupKt {
ctor public PreferenceGroupKt();
method public static operator boolean contains(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
- method public static inline void forEach(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function1<? super androidx.preference.Preference,kotlin.Unit> action);
- method public static inline void forEachIndexed(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super androidx.preference.Preference,kotlin.Unit> action);
- method public static inline operator <T extends androidx.preference.Preference> T? get(androidx.preference.PreferenceGroup, CharSequence key);
+ method public static void forEach(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function1<? super androidx.preference.Preference,kotlin.Unit> action);
+ method public static void forEachIndexed(androidx.preference.PreferenceGroup, kotlin.jvm.functions.Function2<? super java.lang.Integer,? super androidx.preference.Preference,kotlin.Unit> action);
+ method public static operator <T extends androidx.preference.Preference> T get(androidx.preference.PreferenceGroup, CharSequence key);
method public static operator androidx.preference.Preference get(androidx.preference.PreferenceGroup, int index);
method public static kotlin.sequences.Sequence<androidx.preference.Preference> getChildren(androidx.preference.PreferenceGroup);
- method public static inline int getSize(androidx.preference.PreferenceGroup);
- method public static inline boolean isEmpty(androidx.preference.PreferenceGroup);
- method public static inline boolean isNotEmpty(androidx.preference.PreferenceGroup);
+ method public static int getSize(androidx.preference.PreferenceGroup);
+ method public static boolean isEmpty(androidx.preference.PreferenceGroup);
+ method public static boolean isNotEmpty(androidx.preference.PreferenceGroup);
method public static operator java.util.Iterator<androidx.preference.Preference> iterator(androidx.preference.PreferenceGroup);
- method public static inline operator void minusAssign(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
- method public static inline operator void plusAssign(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
+ method public static operator void minusAssign(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
+ method public static operator void plusAssign(androidx.preference.PreferenceGroup, androidx.preference.Preference preference);
}
}
diff --git a/preference/ktx/api/res-1.1.0-alpha04.txt b/preference/ktx/api/res-1.1.0-alpha04.txt
deleted file mode 100644
index e69de29..0000000
--- a/preference/ktx/api/res-1.1.0-alpha04.txt
+++ /dev/null
diff --git a/preference/ktx/api/restricted_1.0.0.txt b/preference/ktx/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/preference/ktx/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/preference/ktx/api/restricted_1.1.0-alpha04.txt b/preference/ktx/api/restricted_1.1.0-alpha04.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/preference/ktx/api/restricted_1.1.0-alpha04.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/preference/ktx/api/restricted_current.txt b/preference/ktx/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/preference/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/preference/ktx/src/androidTest/AndroidManifest.xml b/preference/ktx/src/androidTest/AndroidManifest.xml
index 8cbbccf9..fa8fd40 100644
--- a/preference/ktx/src/androidTest/AndroidManifest.xml
+++ b/preference/ktx/src/androidTest/AndroidManifest.xml
@@ -18,8 +18,6 @@
package="androidx.preference.ktx.test">
<uses-sdk android:targetSdkVersion="${target-sdk-version}"/>
<application>
- <activity
- android:name="androidx.preference.PreferenceTestHelperActivity"
- android:theme="@style/Theme.AppCompat.NoActionBar"/>
+ <activity android:name="androidx.preference.TestPreferenceActivity"/>
</application>
</manifest>
diff --git a/preference/ktx/src/androidTest/java/androidx/preference/PreferenceGroupTest.kt b/preference/ktx/src/androidTest/java/androidx/preference/PreferenceGroupTest.kt
index 2246db6..90413c74 100644
--- a/preference/ktx/src/androidTest/java/androidx/preference/PreferenceGroupTest.kt
+++ b/preference/ktx/src/androidTest/java/androidx/preference/PreferenceGroupTest.kt
@@ -16,8 +16,6 @@
package androidx.preference
-import androidx.preference.ktx.test.R
-import androidx.test.annotation.UiThreadTest
import androidx.test.core.app.ApplicationProvider
import androidx.test.filters.LargeTest
import androidx.test.rule.ActivityTestRule
@@ -37,20 +35,19 @@
@JvmField
@Rule
- val rule = ActivityTestRule(PreferenceTestHelperActivity::class.java)
+ val rule = ActivityTestRule(TestPreferenceActivity::class.java)
private val context = ApplicationProvider.getApplicationContext() as android.content.Context
private lateinit var preferenceGroup: PreferenceGroup
- @Before
- @UiThreadTest
- fun setup() {
- preferenceGroup =
- rule.activity.setupPreferenceHierarchy(R.xml.test_preferencegroup).preferenceScreen
+ @Before fun setup() {
+ preferenceGroup = (rule
+ .activity
+ .supportFragmentManager
+ .findFragmentByTag(
+ TestPreferenceActivity.TAG) as PreferenceFragmentCompat).preferenceScreen
}
- @UiThreadTest
- @Test
- fun get() {
+ @Test fun get() {
val key = "key"
val preference = Preference(context)
preference.key = key
@@ -59,9 +56,7 @@
assertSame(preference, preferenceGroup[0])
}
- @UiThreadTest
- @Test
- fun contains() {
+ @Test fun contains() {
val preference = Preference(context)
assertFalse(preference in preferenceGroup)
assertTrue(preference !in preferenceGroup)
@@ -73,9 +68,7 @@
assertTrue(preference !in preferenceGroup)
}
- @UiThreadTest
- @Test
- fun plusAssign() {
+ @Test fun plusAssign() {
assertEquals(0, preferenceGroup.preferenceCount)
val preference1 = Preference(context)
@@ -89,9 +82,7 @@
assertSame(preference2, preferenceGroup.getPreference(1))
}
- @UiThreadTest
- @Test
- fun minusAssign() {
+ @Test fun minusAssign() {
val preference1 = Preference(context)
preferenceGroup.addPreference(preference1)
val preference2 = Preference(context)
@@ -107,9 +98,7 @@
assertEquals(0, preferenceGroup.preferenceCount)
}
- @UiThreadTest
- @Test
- fun size() {
+ @Test fun size() {
assertEquals(0, preferenceGroup.size)
val preference = Preference(context)
@@ -120,24 +109,20 @@
assertEquals(0, preferenceGroup.size)
}
- @UiThreadTest
- @Test
- fun isEmpty() {
+ @Test fun isEmpty() {
assertTrue(preferenceGroup.isEmpty())
preferenceGroup.addPreference(Preference(context))
assertFalse(preferenceGroup.isEmpty())
}
- @UiThreadTest
- @Test
- fun isNotEmpty() {
+ @Test fun isNotEmpty() {
assertFalse(preferenceGroup.isNotEmpty())
preferenceGroup.addPreference(Preference(context))
assertTrue(preferenceGroup.isNotEmpty())
}
- @UiThreadTest
- @Test
+ // Temporarily disabled due to b/113042342
+ // @Test
fun forEach() {
preferenceGroup.forEach {
fail("Empty preference group should not invoke lambda")
@@ -155,9 +140,7 @@
assertThat(preferences).containsExactly(preference1, preference2)
}
- @UiThreadTest
- @Test
- fun forEachIndexed() {
+ @Test fun forEachIndexed() {
preferenceGroup.forEach {
fail("Empty preference group should not invoke lambda")
}
@@ -175,9 +158,7 @@
assertThat(preferences).containsExactly(preference1, preference2)
}
- @UiThreadTest
- @Test
- fun iterator() {
+ @Test fun iterator() {
val preference1 = Preference(context)
preferenceGroup.addPreference(preference1)
val preference2 = Preference(context)
@@ -194,9 +175,7 @@
}
}
- @UiThreadTest
- @Test
- fun children() {
+ @Test fun children() {
val preferences = listOf(Preference(context), Preference(context), Preference(context))
preferences.forEach { preferenceGroup.addPreference(it) }
diff --git a/preference/ktx/src/androidTest/java/androidx/preference/PreferenceTestHelperActivity.kt b/preference/ktx/src/androidTest/java/androidx/preference/PreferenceTestHelperActivity.kt
deleted file mode 100644
index e0cadd0..0000000
--- a/preference/ktx/src/androidTest/java/androidx/preference/PreferenceTestHelperActivity.kt
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 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.preference
-
-import android.os.Bundle
-import androidx.annotation.LayoutRes
-import androidx.appcompat.app.AppCompatActivity
-
-/**
- * Helper activity that inflates a preference hierarchy defined in a given XML resource with a
- * [PreferenceFragmentCompat] to aid testing.
- */
-class PreferenceTestHelperActivity : AppCompatActivity() {
-
- /**
- * Inflates the given XML resource and returns the created PreferenceFragmentCompat.
- *
- * @param preferenceLayoutId The XML resource ID to inflate
- * @return The PreferenceFragmentCompat that contains the inflated hierarchy
- */
- fun setupPreferenceHierarchy(@LayoutRes preferenceLayoutId: Int): PreferenceFragmentCompat {
- val fragment = TestFragment(preferenceLayoutId)
- supportFragmentManager
- .beginTransaction()
- .replace(android.R.id.content, fragment)
- .commitNow()
- return fragment
- }
-
- class TestFragment internal constructor(private val mPreferenceLayoutId: Int) :
- PreferenceFragmentCompat() {
- override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
- setPreferencesFromResource(mPreferenceLayoutId, rootKey)
- }
- }
-}
diff --git a/preference/ktx/src/androidTest/java/androidx/preference/TestPreferenceActivity.kt b/preference/ktx/src/androidTest/java/androidx/preference/TestPreferenceActivity.kt
new file mode 100644
index 0000000..e58a16b
--- /dev/null
+++ b/preference/ktx/src/androidTest/java/androidx/preference/TestPreferenceActivity.kt
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 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.preference
+
+import android.os.Bundle
+import androidx.fragment.app.FragmentActivity
+import androidx.preference.ktx.test.R
+
+class TestPreferenceActivity : FragmentActivity() {
+
+ companion object {
+ const val TAG = "TestPreferenceActivity"
+ }
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ supportFragmentManager.beginTransaction()
+ .add(android.R.id.content, TestPreferenceFragment(), TAG)
+ .commitNow()
+ }
+
+ class TestPreferenceFragment : PreferenceFragmentCompat() {
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+ addPreferencesFromResource(R.xml.preferences)
+ }
+ }
+}
diff --git a/preference/ktx/src/androidTest/res/xml/test_preferencegroup.xml b/preference/ktx/src/androidTest/res/xml/preferences.xml
similarity index 100%
rename from preference/ktx/src/androidTest/res/xml/test_preferencegroup.xml
rename to preference/ktx/src/androidTest/res/xml/preferences.xml
diff --git a/preference/ktx/src/main/java/androidx/preference/PreferenceGroup.kt b/preference/ktx/src/main/java/androidx/preference/PreferenceGroup.kt
index 4544c35..2d7377a 100644
--- a/preference/ktx/src/main/java/androidx/preference/PreferenceGroup.kt
+++ b/preference/ktx/src/main/java/androidx/preference/PreferenceGroup.kt
@@ -19,10 +19,11 @@
package androidx.preference
/**
- * Returns the preference with `key`, or `null` if no preference with `key` is found.
+ * Returns the preference with `key`.
+ *
+ * @throws NullPointerException if no preference is found with that key.
*/
-inline operator fun <T : Preference> PreferenceGroup.get(key: CharSequence): T? =
- findPreference(key)
+inline operator fun <T : Preference> PreferenceGroup.get(key: CharSequence): T = findPreference(key)
/**
* Returns the preference at `index`.
@@ -30,7 +31,7 @@
* @throws IndexOutOfBoundsException if index is less than 0 or greater than or equal to the count.
*/
operator fun PreferenceGroup.get(index: Int): Preference = getPreference(index)
- ?: throw IndexOutOfBoundsException("Index: $index, Size: $preferenceCount")
+ ?: throw IndexOutOfBoundsException("Index: $index, Size: $preferenceCount")
/** Returns `true` if `preference` is found in this preference group. */
operator fun PreferenceGroup.contains(preference: Preference): Boolean {
diff --git a/preference/res-public/values/public_attrs.xml b/preference/res-public/values/public_attrs.xml
index ed1d2f9..c765d7e 100644
--- a/preference/res-public/values/public_attrs.xml
+++ b/preference/res-public/values/public_attrs.xml
@@ -47,15 +47,21 @@
<public type="attr" name="orderingFromXml" />
<public type="attr" name="persistent" />
<public type="attr" name="positiveButtonText" />
+ <public type="attr" name="preferenceActivityStyle" />
<public type="attr" name="preferenceCategoryStyle" />
- <public type="attr" name="preferenceCategoryTitleTextAppearance" />
<public type="attr" name="preferenceFragmentCompatStyle" />
<public type="attr" name="preferenceFragmentListStyle" />
+ <public type="attr" name="preferenceFragmentPaddingSide" />
<public type="attr" name="preferenceFragmentStyle" />
+ <public type="attr" name="preferenceHeaderPanelStyle" />
<public type="attr" name="preferenceInformationStyle" />
+ <public type="attr" name="preferenceLayoutChild" />
+ <public type="attr" name="preferenceListStyle" />
+ <public type="attr" name="preferencePanelStyle" />
<public type="attr" name="preferenceScreenStyle" />
<public type="attr" name="preferenceStyle" />
<public type="attr" name="preferenceTheme" />
+ <public type="attr" name="ringtonePreferenceStyle" />
<public type="attr" name="seekBarIncrement" />
<public type="attr" name="seekBarPreferenceStyle" />
<public type="attr" name="selectable" />
@@ -72,4 +78,5 @@
<public type="attr" name="switchTextOn" />
<public type="attr" name="title" />
<public type="attr" name="widgetLayout" />
+ <public type="attr" name="yesNoPreferenceStyle" />
</resources>
diff --git a/preference/res/layout/expand_button.xml b/preference/res/layout/expand_button.xml
index 6bf02a2..b517e99 100644
--- a/preference/res/layout/expand_button.xml
+++ b/preference/res/layout/expand_button.xml
@@ -20,15 +20,12 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeightSmall"
+ android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
- android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
- android:paddingRight="?android:attr/listPreferredItemPaddingRight"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:background="?android:attr/selectableItemBackground"
android:clipToPadding="false"
- android:focusable="true"
android:baselineAligned="false">
<include layout="@layout/image_frame"/>
@@ -44,7 +41,6 @@
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary"
android:ellipsize="marquee"/>
@@ -54,12 +50,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
- android:layout_alignLeft="@android:id/title"
android:layout_alignStart="@android:id/title"
+ android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"
android:ellipsize="marquee"
- android:singleLine="true"
- style="@style/PreferenceSummaryTextStyle"/>
+ android:singleLine="true"/>
</RelativeLayout>
</LinearLayout>
diff --git a/preference/res/layout/preference_widget_seekbar.xml b/preference/res/layout/preference_widget_seekbar.xml
index 6cc98be..e9430a2 100644
--- a/preference/res/layout/preference_widget_seekbar.xml
+++ b/preference/res/layout/preference_widget_seekbar.xml
@@ -75,14 +75,14 @@
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
- android:paddingStart="@dimen/preference_seekbar_padding_horizontal"
- android:paddingEnd="22dp"
+ android:paddingStart="@dimen/preference_seekbar_padding_start"
+ android:paddingEnd="@dimen/preference_seekbar_padding_end"
android:focusable="false"
android:clickable="false"
android:background="@null" />
<TextView android:id="@+id/seekbar_value"
- android:layout_width="@dimen/preference_seekbar_value_minWidth"
+ android:layout_width="@dimen/preference_seekbar_value_width"
android:layout_height="match_parent"
android:gravity="right|center_vertical"
android:fontFamily="sans-serif-condensed"
diff --git a/preference/res/layout/preference_widget_seekbar_material.xml b/preference/res/layout/preference_widget_seekbar_material.xml
index 25872c1..dfd7db7 100644
--- a/preference/res/layout/preference_widget_seekbar_material.xml
+++ b/preference/res/layout/preference_widget_seekbar_material.xml
@@ -20,7 +20,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeightSmall"
+ android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:paddingRight="?android:attr/listPreferredItemPaddingRight"
@@ -33,41 +33,34 @@
<include layout="@layout/image_frame"/>
- <LinearLayout
- android:layout_width="match_parent"
+ <RelativeLayout
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:orientation="vertical"
- android:layout_marginTop="8dp"
- android:layout_marginBottom="8dp"
+ android:layout_marginEnd="8dip"
+ android:layout_marginTop="6dip"
+ android:layout_marginBottom="6dip"
+ android:layout_weight="1"
android:clipChildren="false"
android:clipToPadding="false">
- <RelativeLayout
+ <TextView
+ android:id="@android:id/title"
android:layout_width="wrap_content"
- android:layout_height="0dp"
- android:layout_weight="1">
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceListItem"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"/>
- <TextView
- android:id="@android:id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textAppearance="?android:attr/textAppearanceListItem"
- android:ellipsize="marquee"/>
-
- <TextView
- android:id="@android:id/summary"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@android:id/title"
- android:layout_alignLeft="@android:id/title"
- android:layout_alignStart="@android:id/title"
- android:textAlignment="viewStart"
- android:textColor="?android:attr/textColorSecondary"
- android:maxLines="4"
- style="@style/PreferenceSummaryTextStyle"/>
-
- </RelativeLayout>
+ <TextView
+ android:id="@android:id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@android:id/title"
+ android:layout_alignStart="@android:id/title"
+ android:textColor="?android:attr/textColorSecondary"
+ android:maxLines="4"
+ style="@style/PreferenceSummaryTextStyle"/>
<!-- Using UnPressableLinearLayout as a workaround to disable the pressed state propagation
to the children of this container layout. Otherwise, the animated pressed state will also
@@ -76,44 +69,30 @@
<androidx.preference.UnPressableLinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:paddingRight="16dp"
- android:paddingEnd="16dp"
+ android:layout_below="@android:id/summary"
+ android:layout_alignStart="@android:id/title"
android:clipChildren="false"
android:clipToPadding="false">
- <!-- The total height of the Seekbar widget's area should be 48dp - this allows for an
- increased touch area so you do not need to exactly tap the thumb to move it. However,
- setting the Seekbar height directly causes the thumb and seekbar to be misaligned on
- API 22 and 23 - so instead we just set 15dp padding above and below, to account for the
- 18dp default height of the Seekbar thumb for a total of 48dp.
- Note: we set 0dp padding at the start and end of this seekbar to allow it to properly
- fit into the layout, but this means that there's no leeway on either side for touch
- input - this might be something we should reconsider down the line. -->
<SeekBar
android:id="@+id/seekbar"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
- android:paddingLeft="@dimen/preference_seekbar_padding_horizontal"
- android:paddingRight="@dimen/preference_seekbar_padding_horizontal"
- android:paddingStart="@dimen/preference_seekbar_padding_horizontal"
- android:paddingEnd="@dimen/preference_seekbar_padding_horizontal"
- android:paddingTop="@dimen/preference_seekbar_padding_vertical"
- android:paddingBottom="@dimen/preference_seekbar_padding_vertical"
+ android:paddingLeft="@dimen/preference_seekbar_padding_start"
+ android:paddingRight="@dimen/preference_seekbar_padding_end"
+ android:paddingStart="@dimen/preference_seekbar_padding_start"
+ android:paddingEnd="@dimen/preference_seekbar_padding_end"
+ android:focusable="false"
+ android:clickable="false"
android:background="@null"/>
- <!-- If the value is shown, we reserve a minimum width of 36dp to allow for consistent
- seekbar width for smaller values. If the value is ~4 or more digits, it will expand
- into the seekbar width. -->
<TextView
android:id="@+id/seekbar_value"
- android:minWidth="@dimen/preference_seekbar_value_minWidth"
- android:paddingLeft="8dp"
- android:paddingStart="8dp"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="right"
+ android:layout_width="@dimen/preference_seekbar_value_width"
+ android:layout_height="match_parent"
+ android:gravity="right|center_vertical"
+ android:fontFamily="sans-serif-condensed"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceListItem"
android:ellipsize="marquee"
@@ -121,5 +100,5 @@
android:scrollbars="none"/>
</androidx.preference.UnPressableLinearLayout>
- </LinearLayout>
+ </RelativeLayout>
</LinearLayout>
diff --git a/preference/res/values-zh-rTW/strings.xml b/preference/res/values-zh-rTW/strings.xml
index 4628cf0..7787479 100644
--- a/preference/res/values-zh-rTW/strings.xml
+++ b/preference/res/values-zh-rTW/strings.xml
@@ -4,7 +4,7 @@
<string name="v7_preference_on" msgid="27351710992731591">"開啟"</string>
<string name="v7_preference_off" msgid="5138405918326871307">"關閉"</string>
<string name="expand_button_title" msgid="1234962710353108940">"進階"</string>
- <string name="summary_collapsed_preference_list" msgid="5190123168583152844">"<xliff:g id="CURRENT_ITEMS">%1$s</xliff:g>、<xliff:g id="ADDED_ITEMS">%2$s</xliff:g>"</string>
+ <string name="summary_collapsed_preference_list" msgid="5190123168583152844">"<xliff:g id="CURRENT_ITEMS">%1$s</xliff:g>,<xliff:g id="ADDED_ITEMS">%2$s</xliff:g>"</string>
<string name="copy" msgid="3209159573327985035">"複製"</string>
<string name="preference_copied" msgid="7961817945132860002">"已將「<xliff:g id="SUMMARY">%1$s</xliff:g>」複製到剪貼簿。"</string>
<string name="not_set" msgid="478774118347071097">"未設定"</string>
diff --git a/preference/res/values/attrs.xml b/preference/res/values/attrs.xml
index 63540d5..d9f8806 100644
--- a/preference/res/values/attrs.xml
+++ b/preference/res/values/attrs.xml
@@ -33,6 +33,8 @@
<!-- Default style for PreferenceScreen. -->
<attr name="preferenceScreenStyle" format="reference" />
+ <!-- Default style for the PreferenceActivity. -->
+ <attr name="preferenceActivityStyle" format="reference" />
<!-- Default style for Headers pane in PreferenceActivity. -->
<attr name="preferenceFragmentStyle" format="reference" />
<!-- Default style for Headers pane in PreferenceActivity. -->
@@ -45,14 +47,28 @@
<attr name="preferenceInformationStyle" format="reference" />
<!-- Default style for CheckBoxPreference. -->
<attr name="checkBoxPreferenceStyle" format="reference" />
+ <!-- Default style for YesNoPreference. -->
+ <attr name="yesNoPreferenceStyle" format="reference" />
<!-- Default style for DialogPreference. -->
<attr name="dialogPreferenceStyle" format="reference" />
<!-- Default style for EditTextPreference. -->
<attr name="editTextPreferenceStyle" format="reference" />
+ <!-- Default style for RingtonePreference. -->
+ <attr name="ringtonePreferenceStyle" format="reference" />
<!-- Default style for DropDownPreference. -->
<attr name="dropdownPreferenceStyle" format="reference" />
+ <!-- The preference layout that has the child/tabbed effect. -->
+ <attr name="preferenceLayoutChild" format="reference" />
+ <!-- Preference panel style -->
+ <attr name="preferencePanelStyle" format="reference" />
+ <!-- Preference headers panel style -->
+ <attr name="preferenceHeaderPanelStyle" format="reference" />
+ <!-- Preference list style -->
+ <attr name="preferenceListStyle" format="reference" />
<!-- Preference fragment list style -->
<attr name="preferenceFragmentListStyle" format="reference" />
+ <!-- Preference fragment padding side -->
+ <attr name="preferenceFragmentPaddingSide" format="dimension" />
<!-- Default style for switch preferences. -->
<attr name="switchPreferenceStyle" format="reference" />
<!-- Default style for switch compat preferences. -->
@@ -306,13 +322,8 @@
<attr name="adjustable" format="boolean" />
<!-- Flag indicating whether the TextView next to the seekbar that shows the current seekbar
value will be displayed. If true, the view is VISIBLE; if false, the view will be GONE.
- By default, this view is GONE. -->
+ By default, this view is VISIBLE. -->
<attr name="showSeekBarValue" format="boolean" />
- <!-- Flag indicating whether the SeekBarPreference should continuously save the Seekbar
- value while the Seekbar is being dragged. If true, the SeekBarPreference should continuously
- save the Seekbar value while it is being dragged. If false, the Seekbar value is only saved
- when released. By default, this boolean is false. -->
- <attr name="updatesContinuously" format="boolean" />
</declare-styleable>
<declare-styleable name="SwitchPreference">
diff --git a/preference/res/values/dimens.xml b/preference/res/values/dimens.xml
index 403523e..8ffc4f0 100644
--- a/preference/res/values/dimens.xml
+++ b/preference/res/values/dimens.xml
@@ -4,12 +4,12 @@
This helps in aligning titles when some items have icons and some don't. When space is
at a premium, we don't pre-allocate any space. -->
<dimen name="preference_icon_minWidth">0dp</dimen>
- <!-- The padding at the start and end of the Seekbar within a SeekBarPreference -->
- <dimen name="preference_seekbar_padding_horizontal">0dp</dimen>
- <!-- The padding at the top and bottom of the Seekbar within a SeekBarPreference -->
- <dimen name="preference_seekbar_padding_vertical">15dp</dimen>
- <!-- The minimum width of the TextView indicating the current value of the SeekBarPreference -->
- <dimen name="preference_seekbar_value_minWidth">36dp</dimen>
+ <!-- The padding at the start of the seekbar view within a SeekBarPreference -->
+ <dimen name="preference_seekbar_padding_start">0dp</dimen>
+ <!-- The padding at the end of the seekbar view within a SeekBarPreference -->
+ <dimen name="preference_seekbar_padding_end">22dp</dimen>
+ <!-- The width of the TextView indicating the current value of the SeekBarPreference -->
+ <dimen name="preference_seekbar_value_width">36dp</dimen>
<!-- The padding at the start of the dropdown menu within a DropDownPreference
TODO: Pending UX discussion in b/110975540 - keeping old behaviour for now.-->
<dimen name="preference_dropdown_padding_start">0dp</dimen>
diff --git a/preference/res/values/styles.xml b/preference/res/values/styles.xml
index 001e097..8dfe8d1 100644
--- a/preference/res/values/styles.xml
+++ b/preference/res/values/styles.xml
@@ -55,7 +55,6 @@
<item name="android:layout">@layout/preference_widget_seekbar</item>
<item name="adjustable">true</item>
<item name="showSeekBarValue">true</item>
- <item name="updatesContinuously">false</item>
</style>
<style name="Preference.PreferenceScreen">
@@ -133,7 +132,7 @@
<style name="Preference.SeekBarPreference.Material">
<item name="android:layout">@layout/preference_widget_seekbar_material</item>
<item name="adjustable">true</item>
- <item name="showSeekBarValue">false</item>
+ <item name="showSeekBarValue">true</item>
<item name="allowDividerAbove">false</item>
<item name="allowDividerBelow">true</item>
<item name="iconSpaceReserved">@bool/config_materialPreferenceIconSpaceReserved</item>
diff --git a/preference/src/androidTest/java/androidx/preference/tests/EditTextPreferenceTest.java b/preference/src/androidTest/java/androidx/preference/tests/EditTextPreferenceTest.java
index af6ef57..62b8456 100644
--- a/preference/src/androidTest/java/androidx/preference/tests/EditTextPreferenceTest.java
+++ b/preference/src/androidTest/java/androidx/preference/tests/EditTextPreferenceTest.java
@@ -23,7 +23,7 @@
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
-import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import android.text.InputFilter;
@@ -95,6 +95,6 @@
.findFragmentByTag(
"androidx.preference.PreferenceFragment.DIALOG")).getDialog()
.findViewById(android.R.id.edit);
- assertArrayEquals(filters, editText.getFilters());
+ assertEquals(filters, editText.getFilters());
}
}
diff --git a/preference/src/androidTest/java/androidx/preference/tests/PreferenceGroupFindPreferenceTest.java b/preference/src/androidTest/java/androidx/preference/tests/PreferenceGroupFindPreferenceTest.java
deleted file mode 100644
index 9fb8049..0000000
--- a/preference/src/androidTest/java/androidx/preference/tests/PreferenceGroupFindPreferenceTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2019 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.preference.tests;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import android.content.Context;
-
-import androidx.preference.Preference;
-import androidx.preference.PreferenceGroup;
-import androidx.preference.PreferenceManager;
-import androidx.preference.PreferenceScreen;
-import androidx.test.annotation.UiThreadTest;
-import androidx.test.core.app.ApplicationProvider;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-/**
- * Test for {@link PreferenceGroup#findPreference(CharSequence)}
- */
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public class PreferenceGroupFindPreferenceTest {
-
- private static final String KEY = "test_key";
-
- private Preference mPreference;
- private PreferenceScreen mScreen;
-
- @Before
- @UiThreadTest
- public void setup() {
- Context context = ApplicationProvider.getApplicationContext();
- PreferenceManager manager = new PreferenceManager(context);
- mPreference = new Preference(context);
- mPreference.setKey(KEY);
- mScreen = manager.createPreferenceScreen(context);
- }
-
- /**
- * Tests that the {@link Preference} with the given key is correctly returned.
- */
- @Test
- @UiThreadTest
- public void preferenceInGroup_findPreferenceReturnsPreference() {
- mScreen.addPreference(mPreference);
- assertEquals(mPreference, mScreen.findPreference(KEY));
- }
-
- /**
- * Tests that {@code null} is returned if no {@link Preference} exists with the given key.
- */
- @Test
- @UiThreadTest
- public void preferenceNotInGroup_findPreferenceReturnsNull() {
- // Preference not added to the group
- assertNull(mScreen.findPreference(KEY));
- }
-
- /**
- * Tests that an exception is thrown if the key is null.
- */
- @Test(expected = IllegalArgumentException.class)
- @UiThreadTest
- public void findPreferenceWithNullKey_exceptionThrown() {
- mScreen.findPreference(null);
- }
-}
diff --git a/preference/src/androidTest/java/androidx/preference/tests/PreferenceSingleLineTitleTest.java b/preference/src/androidTest/java/androidx/preference/tests/PreferenceSingleLineTitleTest.java
index d474fc9..f30580f 100644
--- a/preference/src/androidTest/java/androidx/preference/tests/PreferenceSingleLineTitleTest.java
+++ b/preference/src/androidTest/java/androidx/preference/tests/PreferenceSingleLineTitleTest.java
@@ -30,7 +30,7 @@
import androidx.test.annotation.UiThreadTest;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -39,7 +39,7 @@
/**
* Test for single line titles in {@link Preference}.
*/
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class PreferenceSingleLineTitleTest {
diff --git a/preference/src/androidTest/java/androidx/preference/tests/PreferenceVisibilityTest.java b/preference/src/androidTest/java/androidx/preference/tests/PreferenceVisibilityTest.java
index f96d68c..fc43eec 100644
--- a/preference/src/androidTest/java/androidx/preference/tests/PreferenceVisibilityTest.java
+++ b/preference/src/androidTest/java/androidx/preference/tests/PreferenceVisibilityTest.java
@@ -222,7 +222,7 @@
}
/**
- * A {@link OnHierarchyChangeListener} that will count down a provided {@link CountDownLatch}
+ * A {@link OnHierarchyChangeListener that will count down a provided {@link CountDownLatch}
* to allow tests to wait for the view hierarchy to be updated, and fail the test if the
* hierarchy is updated when it shouldn't be.
*/
diff --git a/preference/src/androidTest/java/androidx/preference/tests/SeekBarPreferenceTest.kt b/preference/src/androidTest/java/androidx/preference/tests/SeekBarPreferenceTest.kt
deleted file mode 100644
index 5d1f1e6..0000000
--- a/preference/src/androidTest/java/androidx/preference/tests/SeekBarPreferenceTest.kt
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Copyright 2019 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.preference.tests
-
-import android.os.Build
-import android.util.DisplayMetrics
-import android.view.View
-import android.widget.SeekBar
-import androidx.preference.SeekBarPreference
-import androidx.preference.test.R
-import androidx.preference.tests.helpers.PreferenceTestHelperActivity
-import androidx.test.annotation.UiThreadTest
-import androidx.test.espresso.Espresso.onView
-import androidx.test.espresso.ViewAction
-import androidx.test.espresso.action.CoordinatesProvider
-import androidx.test.espresso.action.GeneralSwipeAction
-import androidx.test.espresso.action.Press
-import androidx.test.espresso.action.Swipe
-import androidx.test.espresso.assertion.ViewAssertions.matches
-import androidx.test.espresso.matcher.BoundedMatcher
-import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
-import androidx.test.espresso.matcher.ViewMatchers.withId
-import androidx.test.espresso.matcher.ViewMatchers.withText
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
-import androidx.test.filters.SdkSuppress
-import androidx.test.rule.ActivityTestRule
-import org.hamcrest.Description
-import org.hamcrest.Matchers.allOf
-import org.hamcrest.Matchers.not
-import org.junit.Assert.assertEquals
-import org.junit.Before
-import org.junit.Rule
-import org.junit.Test
-import org.junit.runner.RunWith
-
-/**
- * Test for [androidx.preference.SeekBarPreference].
- */
-@RunWith(AndroidJUnit4::class)
-@LargeTest
-class SeekBarPreferenceTest {
-
- @get:Rule
- val activityRule = ActivityTestRule(PreferenceTestHelperActivity::class.java)
-
- private lateinit var seekBarPreference: SeekBarPreference
-
- @Before
- @UiThreadTest
- fun setUp() {
- val fragment = activityRule.activity.setupPreferenceHierarchy(
- R.xml.test_seekbar
- )
- seekBarPreference = fragment.preferenceScreen.getPreference(0) as SeekBarPreference
- seekBarPreference.min = 0
- seekBarPreference.max = 5
- }
-
- @Test
- fun testSetValue() {
- activityRule.runOnUiThread {
- // When a value of 3 is set
- seekBarPreference.value = 3
- // The internal value should be set to 3
- assertEquals(3, seekBarPreference.value)
- }
- // The seekbar's progress should be set to 3
- onView(withId(R.id.seekbar)).check(matches(withSeekBarProgress(3)))
- }
-
- @Test
- fun testSetValue_belowMinValue() {
- activityRule.runOnUiThread {
- // Given a non-zero min value
- seekBarPreference.min = 3
- // When a value lower than the min value is set
- seekBarPreference.value = 0
- // The actual value set should be equal to the min value
- assertEquals(3, seekBarPreference.value)
- }
- // The seekbar's progress should be 0, as we are currently at the min value
- onView(withId(R.id.seekbar)).check(matches(withSeekBarProgress(0)))
- }
-
- @Test
- fun testSetValue_aboveMaxValue() {
- activityRule.runOnUiThread {
- // Given a max value
- seekBarPreference.max = 7
- // When a value higher than the max value is set
- seekBarPreference.value = 10
- // The actual value set should be equal to the max value
- assertEquals(7, seekBarPreference.value)
- }
- // The seekbar's progress should be equal to the max value
- onView(withId(R.id.seekbar)).check(matches(withSeekBarProgress(7)))
- }
-
- @Test
- fun testSeekBarLabel_updatesWhenValueIsChanged() {
- // By default only the seekbar, not the label should be visible
- onView(withId(R.id.seekbar)).check(matches(isDisplayed()))
- onView(withId(R.id.seekbar_value)).check(matches(not(isDisplayed())))
-
- // When we enable showing the value
- activityRule.runOnUiThread { seekBarPreference.showSeekBarValue = true }
-
- // Both the seekbar and the label should be visible
- onView(withId(R.id.seekbar)).check(matches(isDisplayed()))
- onView(allOf(withId(R.id.seekbar_value), withText("0"))).check(matches(isDisplayed()))
-
- // When we change the value
- activityRule.runOnUiThread { seekBarPreference.value = 5 }
-
- // The label should update to show the new value
- onView(allOf(withId(R.id.seekbar_value), withText("5"))).check(matches(isDisplayed()))
- }
-
- @Test
- fun testSeekBarLabel_updatesWhenSeekbarProgressChanges() {
- activityRule.runOnUiThread { seekBarPreference.showSeekBarValue = true }
- onView(allOf(withId(R.id.seekbar_value), withText("0"))).check(matches(isDisplayed()))
-
- // When the seekbar's progress changes
- activityRule.activity.findViewById<SeekBar>(R.id.seekbar).progress = 5
-
- // The label should update to show the new value
- onView(allOf(withId(R.id.seekbar_value), withText("5"))).check(matches(isDisplayed()))
- }
-
- @Test
- fun testSeekBarLabel_shouldCorrectlyHandlesMinValue() {
- activityRule.runOnUiThread {
- // Set the minimum and the saved value to 3
- seekBarPreference.min = 3
- seekBarPreference.value = 3
- seekBarPreference.showSeekBarValue = true
- }
-
- // The label should display the saved value
- onView(allOf(withId(R.id.seekbar_value), withText("3"))).check(matches(isDisplayed()))
-
- // Since the value is also the minimum, the seekbar should have no progress
- onView(withId(R.id.seekbar)).check(matches(withSeekBarProgress(0)))
-
- // Change the value to 5
- activityRule.runOnUiThread { seekBarPreference.value = 5 }
-
- // The label should display the saved value
- onView(allOf(withId(R.id.seekbar_value), withText("5"))).check(matches(isDisplayed()))
-
- // However since the minimum is 3, the seekbar's progress should be offset by 3, and should
- // only have progressed to 2 (the current value - the minimum)
- onView(withId(R.id.seekbar)).check(matches(withSeekBarProgress(2)))
- }
-
- @Test
- // Seems that these tests are flaky on certain devices with large screens due to the swipe not
- // fully dragging from one end to another. Should be safer to only run them on newer devices
- // where they are stable.
- @SdkSuppress(minSdkVersion = Build.VERSION_CODES.N)
- fun testSeekBarPreferenceChangeListener() {
- // How many times the change listener has been called
- var updateCount = 0
- activityRule.runOnUiThread {
- seekBarPreference.value = 0
- seekBarPreference.showSeekBarValue = true
- seekBarPreference.updatesContinuously = false
- seekBarPreference.setOnPreferenceChangeListener { _, _ ->
- updateCount++
- true
- }
- }
-
- onView(allOf(withId(R.id.seekbar_value), withText("0"))).check(matches(isDisplayed()))
- onView(withId(R.id.seekbar)).check(matches(withSeekBarProgress(0)))
-
- // Fully drag the seekbar from left to right
- onView(withId(R.id.seekbar)).perform(dragSeekBar())
-
- // The current value should be 5
- onView(allOf(withId(R.id.seekbar_value), withText("5"))).check(matches(isDisplayed()))
- onView(withId(R.id.seekbar)).check(matches(withSeekBarProgress(5)))
-
- activityRule.runOnUiThread {
- // SeekBarPreference should only attempt to update once, when the drag has stopped
- assertEquals(1, updateCount)
- assertEquals(5, seekBarPreference.value)
- }
- }
-
- @Test
- // Seems that these tests are flaky on certain devices with large screens due to the swipe not
- // fully dragging from one end to another. Should be safer to only run them on newer devices
- // where they are stable.
- @SdkSuppress(minSdkVersion = Build.VERSION_CODES.N)
- fun testSeekBarPreferenceChangeListenerWithContinuousUpdates() {
- // How many times the change listener has been called
- var updateCount = 0
- activityRule.runOnUiThread {
- seekBarPreference.value = 0
- seekBarPreference.max = 5
- seekBarPreference.showSeekBarValue = true
- seekBarPreference.updatesContinuously = true
- seekBarPreference.setOnPreferenceChangeListener { _, _ ->
- updateCount++
- true
- }
- }
-
- onView(allOf(withId(R.id.seekbar_value), withText("0"))).check(matches(isDisplayed()))
- onView(withId(R.id.seekbar)).check(matches(withSeekBarProgress(0)))
-
- // Fully drag the seekbar from left to right
- onView(withId(R.id.seekbar)).perform(dragSeekBar())
-
- // The current value should be 5
- onView(allOf(withId(R.id.seekbar_value), withText("5"))).check(matches(isDisplayed()))
- onView(withId(R.id.seekbar)).check(matches(withSeekBarProgress(5)))
-
- activityRule.runOnUiThread {
- // SeekBarPreference should attempt to update every time the seekbar's progress changed.
- // From 0-5, it should update 5 times.
- assertEquals(5, updateCount)
- assertEquals(5, seekBarPreference.value)
- }
- }
-
- /**
- * A [ViewAction] that drags a [SeekBar] from its left edge to the right edge of the screen
- */
- private fun dragSeekBar(): ViewAction {
- return GeneralSwipeAction(Swipe.FAST,
- CoordinatesProvider { view ->
- val location = IntArray(2)
- view.getLocationOnScreen(location)
- val posX = location[0]
- val posY = location[1]
- // Start at the beginning of the seekbar
- floatArrayOf(posX.toFloat(), posY.toFloat())
- }, CoordinatesProvider { view ->
- val location = IntArray(2)
- view.getLocationOnScreen(location)
- // We want to swipe all the way to the right edge of the screen to avoid
- // flakiness due to sometimes not reaching the end of the seekbar
- val metrics = DisplayMetrics()
- activityRule.activity.windowManager.defaultDisplay.getMetrics(metrics)
- val posX = metrics.widthPixels
- val posY = location[1]
- floatArrayOf(posX.toFloat(), posY.toFloat())
- }, Press.PINPOINT
- )
- }
-
- /**
- * A matcher to assert the current progress of a [SeekBar]
- *
- * @param progress The expected progress of the [SeekBar]
- */
- private fun withSeekBarProgress(progress: Int): BoundedMatcher<View, SeekBar> {
- return object : BoundedMatcher<View, SeekBar>(SeekBar::class.java) {
- override fun matchesSafely(item: SeekBar?): Boolean {
- return item!!.progress == progress
- }
-
- override fun describeTo(description: Description?) {
- description?.appendText("with SeekBar progress:")
- ?.appendValue(progress)
- }
- }
- }
-}
diff --git a/preference/src/androidTest/res/xml/test_seekbar.xml b/preference/src/androidTest/res/xml/test_seekbar.xml
deleted file mode 100644
index 9fa7050..0000000
--- a/preference/src/androidTest/res/xml/test_seekbar.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
- <SeekBarPreference app:title="SeekBarPreference"/>
-</PreferenceScreen>
diff --git a/preference/src/main/java/androidx/preference/AndroidResources.java b/preference/src/main/java/androidx/preference/AndroidResources.java
index 18f3003..ea04144 100644
--- a/preference/src/main/java/androidx/preference/AndroidResources.java
+++ b/preference/src/main/java/androidx/preference/AndroidResources.java
@@ -16,24 +16,23 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-
-import android.annotation.SuppressLint;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
/**
- * Utility class for attributes unavailable on older APIs
* @hide
*/
-@RestrictTo(LIBRARY)
-@SuppressLint("InlinedApi")
+@RestrictTo(LIBRARY_GROUP)
public class AndroidResources {
public static final int ANDROID_R_ICON_FRAME = android.R.id.icon_frame;
- static final int ANDROID_R_LIST_CONTAINER = android.R.id.list_container;
- static final int ANDROID_R_SWITCH_WIDGET = android.R.id.switch_widget;
- static final int ANDROID_R_PREFERENCE_FRAGMENT_STYLE = android.R.attr.preferenceFragmentStyle;
+ public static final int ANDROID_R_LIST_CONTAINER = android.R.id.list_container;
+ public static final int ANDROID_R_SWITCH_WIDGET = android.R.id.switch_widget;
+ public static final int ANDROID_R_PREFERENCE_FRAGMENT_STYLE
+ = android.R.attr.preferenceFragmentStyle;
+ public static final int ANDROID_R_EDITTEXT_PREFERENCE_STYLE
+ = android.R.attr.editTextPreferenceStyle;
private AndroidResources() {}
}
diff --git a/preference/src/main/java/androidx/preference/CheckBoxPreference.java b/preference/src/main/java/androidx/preference/CheckBoxPreference.java
index 11168ec..b6314d3 100644
--- a/preference/src/main/java/androidx/preference/CheckBoxPreference.java
+++ b/preference/src/main/java/androidx/preference/CheckBoxPreference.java
@@ -16,8 +16,9 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
@@ -44,6 +45,7 @@
public CheckBoxPreference(Context context, AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
+ @SuppressLint("RestrictedApi")
public CheckBoxPreference(
Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
@@ -63,6 +65,7 @@
a.recycle();
}
+ @SuppressLint("RestrictedApi")
public CheckBoxPreference(Context context, AttributeSet attrs) {
this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.checkBoxPreferenceStyle,
android.R.attr.checkBoxPreferenceStyle));
@@ -84,7 +87,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
@Override
protected void performClick(View view) {
super.performClick(view);
diff --git a/preference/src/main/java/androidx/preference/DialogPreference.java b/preference/src/main/java/androidx/preference/DialogPreference.java
index 057bc81..b39a17b 100644
--- a/preference/src/main/java/androidx/preference/DialogPreference.java
+++ b/preference/src/main/java/androidx/preference/DialogPreference.java
@@ -16,14 +16,13 @@
package androidx.preference;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.content.res.TypedArrayUtils;
@@ -47,6 +46,7 @@
private CharSequence mNegativeButtonText;
private int mDialogLayoutResId;
+ @SuppressLint("RestrictedApi")
public DialogPreference(
Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
@@ -87,6 +87,7 @@
this(context, attrs, defStyleAttr, 0);
}
+ @SuppressLint("RestrictedApi")
public DialogPreference(Context context, AttributeSet attrs) {
this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.dialogPreferenceStyle,
android.R.attr.dialogPreferenceStyle));
@@ -263,15 +264,13 @@
*/
public interface TargetFragment {
/**
- * Finds a {@link Preference} with the given key. Returns {@code null} if no
- * {@link Preference} could be found with the given key.
+ * Finds a {@link Preference} based on its key.
*
- * @param key The key of the {@link Preference} to retrieve
+ * @param key The key of the preference to retrieve
* @return The {@link Preference} with the key, or {@code null}
* @see PreferenceGroup#findPreference(CharSequence)
*/
@SuppressWarnings("TypeParameterUnusedInFormals")
- @Nullable
- <T extends Preference> T findPreference(@NonNull CharSequence key);
+ <T extends Preference> T findPreference(CharSequence key);
}
}
diff --git a/preference/src/main/java/androidx/preference/DropDownPreference.java b/preference/src/main/java/androidx/preference/DropDownPreference.java
index 45d0357..9f3bf62 100644
--- a/preference/src/main/java/androidx/preference/DropDownPreference.java
+++ b/preference/src/main/java/androidx/preference/DropDownPreference.java
@@ -16,6 +16,8 @@
package androidx.preference;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
@@ -25,6 +27,7 @@
import android.widget.Spinner;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
/**
* A {@link ListPreference} that presents the options in a drop down menu rather than a dialog.
@@ -98,7 +101,6 @@
return new ArrayAdapter<>(mContext, android.R.layout.simple_spinner_dropdown_item);
}
- @SuppressWarnings("unchecked")
private void updateEntries() {
mAdapter.clear();
if (getEntries() != null) {
@@ -113,6 +115,22 @@
setValue(getEntryValues()[index].toString());
}
+ /**
+ * @hide
+ */
+ @RestrictTo(LIBRARY_GROUP)
+ public int findSpinnerIndexOfValue(String value) {
+ CharSequence[] entryValues = getEntryValues();
+ if (value != null && entryValues != null) {
+ for (int i = entryValues.length - 1; i >= 0; i--) {
+ if (entryValues[i].equals(value)) {
+ return i;
+ }
+ }
+ }
+ return Spinner.INVALID_POSITION;
+ }
+
@Override
protected void notifyChanged() {
super.notifyChanged();
@@ -131,17 +149,5 @@
mSpinner.setSelection(findSpinnerIndexOfValue(getValue()));
super.onBindViewHolder(view);
}
-
- private int findSpinnerIndexOfValue(String value) {
- CharSequence[] entryValues = getEntryValues();
- if (value != null && entryValues != null) {
- for (int i = entryValues.length - 1; i >= 0; i--) {
- if (entryValues[i].equals(value)) {
- return i;
- }
- }
- }
- return Spinner.INVALID_POSITION;
- }
}
diff --git a/preference/src/main/java/androidx/preference/EditTextPreference.java b/preference/src/main/java/androidx/preference/EditTextPreference.java
index b597f0c..98f9cfb 100644
--- a/preference/src/main/java/androidx/preference/EditTextPreference.java
+++ b/preference/src/main/java/androidx/preference/EditTextPreference.java
@@ -16,6 +16,7 @@
package androidx.preference;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Parcel;
@@ -39,6 +40,7 @@
@Nullable
private OnBindEditTextListener mOnBindEditTextListener;
+ @SuppressLint("RestrictedApi")
public EditTextPreference(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
@@ -58,9 +60,10 @@
this(context, attrs, defStyleAttr, 0);
}
+ @SuppressLint("RestrictedApi")
public EditTextPreference(Context context, AttributeSet attrs) {
this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.editTextPreferenceStyle,
- android.R.attr.editTextPreferenceStyle));
+ AndroidResources.ANDROID_R_EDITTEXT_PREFERENCE_STYLE));
}
public EditTextPreference(Context context) {
diff --git a/preference/src/main/java/androidx/preference/EditTextPreferenceDialogFragment.java b/preference/src/main/java/androidx/preference/EditTextPreferenceDialogFragment.java
index 016e361..b9f5089 100644
--- a/preference/src/main/java/androidx/preference/EditTextPreferenceDialogFragment.java
+++ b/preference/src/main/java/androidx/preference/EditTextPreferenceDialogFragment.java
@@ -16,7 +16,7 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
import android.view.View;
@@ -94,7 +94,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
@Override
protected boolean needInputMethod() {
// We want the input method to show, if possible, when dialog is displayed
diff --git a/preference/src/main/java/androidx/preference/EditTextPreferenceDialogFragmentCompat.java b/preference/src/main/java/androidx/preference/EditTextPreferenceDialogFragmentCompat.java
index b926000..7236e43 100644
--- a/preference/src/main/java/androidx/preference/EditTextPreferenceDialogFragmentCompat.java
+++ b/preference/src/main/java/androidx/preference/EditTextPreferenceDialogFragmentCompat.java
@@ -16,7 +16,7 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
import android.view.View;
@@ -83,7 +83,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
@Override
protected boolean needInputMethod() {
// We want the input method to show, if possible, when dialog is displayed
diff --git a/preference/src/main/java/androidx/preference/ExpandButton.java b/preference/src/main/java/androidx/preference/ExpandButton.java
index b2a6b57..1e185a7 100644
--- a/preference/src/main/java/androidx/preference/ExpandButton.java
+++ b/preference/src/main/java/androidx/preference/ExpandButton.java
@@ -16,9 +16,13 @@
package androidx.preference;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+
import android.content.Context;
import android.text.TextUtils;
+import androidx.annotation.RestrictTo;
+
import java.util.ArrayList;
import java.util.List;
@@ -28,6 +32,7 @@
*
* @hide
*/
+@RestrictTo(LIBRARY)
final class ExpandButton extends Preference {
private long mId;
diff --git a/preference/src/main/java/androidx/preference/ListPreference.java b/preference/src/main/java/androidx/preference/ListPreference.java
index 5b67a8b..2cab574 100644
--- a/preference/src/main/java/androidx/preference/ListPreference.java
+++ b/preference/src/main/java/androidx/preference/ListPreference.java
@@ -16,6 +16,7 @@
package androidx.preference;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Parcel;
@@ -45,6 +46,7 @@
private String mSummary;
private boolean mValueSet;
+ @SuppressLint("RestrictedApi")
public ListPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
@@ -78,6 +80,7 @@
this(context, attrs, defStyleAttr, 0);
}
+ @SuppressLint("RestrictedApi")
public ListPreference(Context context, AttributeSet attrs) {
this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.dialogPreferenceStyle,
android.R.attr.dialogPreferenceStyle));
@@ -155,7 +158,6 @@
}
}
- @SuppressWarnings("unchecked")
@Override
public CharSequence getSummary() {
if (getSummaryProvider() != null) {
@@ -167,7 +169,7 @@
return summary;
}
String formattedString = String.format(mSummary, entry == null ? "" : entry);
- if (TextUtils.equals(formattedString, summary)) {
+ if (formattedString.contentEquals(summary)) {
return summary;
}
Log.w(TAG,
diff --git a/preference/src/main/java/androidx/preference/MultiSelectListPreference.java b/preference/src/main/java/androidx/preference/MultiSelectListPreference.java
index 931c9b9..817e22f 100644
--- a/preference/src/main/java/androidx/preference/MultiSelectListPreference.java
+++ b/preference/src/main/java/androidx/preference/MultiSelectListPreference.java
@@ -16,6 +16,7 @@
package androidx.preference;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Parcel;
@@ -44,6 +45,7 @@
private CharSequence[] mEntryValues;
private Set<String> mValues = new HashSet<>();
+ @SuppressLint("RestrictedApi")
public MultiSelectListPreference(
Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
@@ -67,6 +69,7 @@
this(context, attrs, defStyleAttr, 0);
}
+ @SuppressLint("RestrictedApi")
public MultiSelectListPreference(Context context, AttributeSet attrs) {
this(context, attrs, TypedArrayUtils.getAttr(context,
R.attr.dialogPreferenceStyle,
diff --git a/preference/src/main/java/androidx/preference/Preference.java b/preference/src/main/java/androidx/preference/Preference.java
index 9530747..31ef4ec 100644
--- a/preference/src/main/java/androidx/preference/Preference.java
+++ b/preference/src/main/java/androidx/preference/Preference.java
@@ -16,8 +16,10 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
@@ -200,6 +202,7 @@
* theme. Can be 0 to not look for defaults.
* @see #Preference(Context, android.util.AttributeSet)
*/
+ @SuppressLint("RestrictedApi")
public Preference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
mContext = context;
@@ -307,6 +310,7 @@
* @param attrs The attributes of the XML tag that is inflating the preference
* @see #Preference(Context, AttributeSet, int)
*/
+ @SuppressLint("RestrictedApi")
public Preference(Context context, AttributeSet attrs) {
this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.preferenceStyle,
android.R.attr.preferenceStyle));
@@ -568,10 +572,12 @@
holder.setDividerAllowedAbove(mAllowDividerAbove);
holder.setDividerAllowedBelow(mAllowDividerBelow);
- if (isCopyingEnabled() && mOnCopyListener == null) {
- mOnCopyListener = new OnPreferenceCopyListener(this);
+ if (isCopyingEnabled()) {
+ if (mOnCopyListener == null) {
+ mOnCopyListener = new OnPreferenceCopyListener(this);
+ }
+ holder.itemView.setOnCreateContextMenuListener(mOnCopyListener);
}
- holder.itemView.setOnCreateContextMenuListener(isCopyingEnabled() ? mOnCopyListener : null);
}
/**
@@ -709,7 +715,6 @@
* @see #setSummary(CharSequence)
* @see #setSummaryProvider(SummaryProvider)
*/
- @SuppressWarnings("unchecked")
public CharSequence getSummary() {
if (getSummaryProvider() != null) {
return getSummaryProvider().provideSummary(this);
@@ -1140,10 +1145,9 @@
}
/**
- * Used by Settings.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected void performClick(View view) {
performClick();
}
@@ -1151,10 +1155,9 @@
/**
* Called when a click should be performed.
*
- * Used by Settings.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void performClick() {
if (!isEnabled()) {
@@ -1296,11 +1299,9 @@
/**
* Called from {@link PreferenceGroup} to pass in an ID for reuse.
*
- * Used by Settings.
- *
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected void onAttachedToHierarchy(PreferenceManager preferenceManager, long id) {
mId = id;
mHasId = true;
@@ -1352,15 +1353,21 @@
/**
* Returns true if {@link #onDetached()} was called. Used for handling the case when a
* preference was removed, modified, and re-added to a {@link PreferenceGroup}.
+ *
+ * @hide
*/
- final boolean wasDetached() {
+ @RestrictTo(LIBRARY)
+ public final boolean wasDetached() {
return mWasDetached;
}
/**
* Clears the {@link #wasDetached()} status.
+ *
+ * @hide
*/
- final void clearWasDetached() {
+ @RestrictTo(LIBRARY)
+ public final void clearWasDetached() {
mWasDetached = false;
}
@@ -1387,19 +1394,17 @@
}
/**
- * Finds a preference in the entire hierarchy (above or below this preference) with the given
- * key. Returns {@code null} if no preference could be found with the given key.
+ * Finds a preference in this hierarchy (the whole thing, even above/below your
+ * {@link PreferenceScreen} screen break) with the given key.
*
- * <p>This only works after this preference has been attached to a hierarchy.
+ * <p>This only functions after we have been attached to a hierarchy.
*
- * @param key The key of the preference to retrieve
- * @return The preference with the key, or {@code null}
- * @see PreferenceGroup#findPreference(CharSequence)
+ * @param key The key of the preference to find
+ * @return The preference that uses the given key
*/
@SuppressWarnings("TypeParameterUnusedInFormals")
- @Nullable
- protected <T extends Preference> T findPreferenceInHierarchy(@NonNull String key) {
- if (mPreferenceManager == null) {
+ protected <T extends Preference> T findPreferenceInHierarchy(String key) {
+ if (TextUtils.isEmpty(key) || mPreferenceManager == null) {
return null;
}
diff --git a/preference/src/main/java/androidx/preference/PreferenceCategory.java b/preference/src/main/java/androidx/preference/PreferenceCategory.java
index 258edae..6b94470 100644
--- a/preference/src/main/java/androidx/preference/PreferenceCategory.java
+++ b/preference/src/main/java/androidx/preference/PreferenceCategory.java
@@ -16,6 +16,7 @@
package androidx.preference;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build;
import android.os.Build.VERSION_CODES;
@@ -49,6 +50,7 @@
this(context, attrs, defStyleAttr, 0);
}
+ @SuppressLint("RestrictedApi")
public PreferenceCategory(Context context, AttributeSet attrs) {
this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.preferenceCategoryStyle,
android.R.attr.preferenceCategoryStyle));
diff --git a/preference/src/main/java/androidx/preference/PreferenceDialogFragment.java b/preference/src/main/java/androidx/preference/PreferenceDialogFragment.java
index d5ce88f..57ba35d 100644
--- a/preference/src/main/java/androidx/preference/PreferenceDialogFragment.java
+++ b/preference/src/main/java/androidx/preference/PreferenceDialogFragment.java
@@ -16,7 +16,7 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.AlertDialog;
import android.app.Dialog;
@@ -217,7 +217,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
protected boolean needInputMethod() {
return false;
}
diff --git a/preference/src/main/java/androidx/preference/PreferenceDialogFragmentCompat.java b/preference/src/main/java/androidx/preference/PreferenceDialogFragmentCompat.java
index 8877f1b..f58d1a5 100644
--- a/preference/src/main/java/androidx/preference/PreferenceDialogFragmentCompat.java
+++ b/preference/src/main/java/androidx/preference/PreferenceDialogFragmentCompat.java
@@ -16,7 +16,7 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Dialog;
import android.content.Context;
@@ -198,7 +198,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
protected boolean needInputMethod() {
return false;
}
diff --git a/preference/src/main/java/androidx/preference/PreferenceFragment.java b/preference/src/main/java/androidx/preference/PreferenceFragment.java
index 50ab41d..4efe0d5 100644
--- a/preference/src/main/java/androidx/preference/PreferenceFragment.java
+++ b/preference/src/main/java/androidx/preference/PreferenceFragment.java
@@ -16,8 +16,9 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+import android.annotation.SuppressLint;
import android.app.DialogFragment;
import android.app.Fragment;
import android.content.Context;
@@ -91,7 +92,6 @@
*
* @deprecated Use {@link PreferenceFragmentCompat} instead
*/
-@SuppressWarnings("deprecation")
@Deprecated
public abstract class PreferenceFragment extends Fragment implements
PreferenceManager.OnPreferenceTreeClickListener,
@@ -183,6 +183,7 @@
public abstract void onCreatePreferences(Bundle savedInstanceState, String rootKey);
@Override
+ @SuppressLint("RestrictedApi")
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
@@ -514,11 +515,11 @@
}
/** @hide */
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
protected void onBindPreferences() {}
/** @hide */
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
protected void onUnbindPreferences() {}
/**
@@ -645,7 +646,7 @@
* @return The {@link Fragment} to possibly use as a callback
* @hide
*/
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
public Fragment getCallbackFragment() {
return null;
}
diff --git a/preference/src/main/java/androidx/preference/PreferenceFragmentCompat.java b/preference/src/main/java/androidx/preference/PreferenceFragmentCompat.java
index f490c55..9a22723 100644
--- a/preference/src/main/java/androidx/preference/PreferenceFragmentCompat.java
+++ b/preference/src/main/java/androidx/preference/PreferenceFragmentCompat.java
@@ -16,7 +16,7 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -199,7 +199,7 @@
final View rawListContainer = view.findViewById(AndroidResources.ANDROID_R_LIST_CONTAINER);
if (!(rawListContainer instanceof ViewGroup)) {
- throw new IllegalStateException("Content has view with id attribute "
+ throw new RuntimeException("Content has view with id attribute "
+ "'android.R.id.list_container' that is not a ViewGroup class");
}
@@ -457,8 +457,7 @@
@Override
@SuppressWarnings("TypeParameterUnusedInFormals")
- @Nullable
- public <T extends Preference> T findPreference(@NonNull CharSequence key) {
+ public <T extends Preference> T findPreference(CharSequence key) {
if (mPreferenceManager == null) {
return null;
}
@@ -495,18 +494,12 @@
onUnbindPreferences();
}
- /**
- * Used by Settings.
- * @hide
- */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ /** @hide */
+ @RestrictTo(LIBRARY_GROUP)
protected void onBindPreferences() {}
- /**
- * Used by Settings.
- * @hide
- */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ /** @hide */
+ @RestrictTo(LIBRARY_GROUP)
protected void onUnbindPreferences() {}
public final RecyclerView getListView() {
@@ -617,7 +610,7 @@
* @return The {@link Fragment} to possibly use as a callback
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Fragment getCallbackFragment() {
return null;
}
diff --git a/preference/src/main/java/androidx/preference/PreferenceGroup.java b/preference/src/main/java/androidx/preference/PreferenceGroup.java
index 90850b5..6afd79e 100644
--- a/preference/src/main/java/androidx/preference/PreferenceGroup.java
+++ b/preference/src/main/java/androidx/preference/PreferenceGroup.java
@@ -16,9 +16,9 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Bundle;
@@ -78,6 +78,7 @@
}
};
+ @SuppressLint("RestrictedApi")
public PreferenceGroup(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
@@ -353,20 +354,18 @@
/**
* Finds a {@link Preference} based on its key. If two {@link Preference}s share the same key
- * (not recommended), the first to appear will be returned.
+ * (not recommended), the first to appear will be returned (to retrieve the other preference
+ * with the same key, call this method on the first preference). If this preference has the
+ * key, it will not be returned.
*
- * <p>This will recursively search for the {@link Preference} in any children that are also
+ * <p>This will recursively search for the preference into children that are also
* {@link PreferenceGroup}s.
*
- * @param key The key of the {@link Preference} to retrieve
- * @return The {@link Preference} with the key, or {@code null}
+ * @param key The key of the preference to retrieve
+ * @return The {@link Preference} with the key, or null
*/
- @SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"})
- @Nullable
- public <T extends Preference> T findPreference(@NonNull CharSequence key) {
- if (key == null) {
- throw new IllegalArgumentException("Key cannot be null");
- }
+ @SuppressWarnings("TypeParameterUnusedInFormals")
+ public <T extends Preference> T findPreference(CharSequence key) {
if (TextUtils.equals(getKey(), key)) {
return (T) this;
}
@@ -375,7 +374,7 @@
final Preference preference = getPreference(i);
final String curKey = preference.getKey();
- if (TextUtils.equals(curKey, key)) {
+ if (curKey != null && curKey.contentEquals(key)) {
return (T) preference;
}
@@ -386,6 +385,7 @@
}
}
}
+
return null;
}
@@ -405,7 +405,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isAttached() {
return mAttachedToHierarchy;
}
@@ -413,13 +413,11 @@
/**
* Sets the callback to be invoked when the expand button is clicked.
*
- * Used by Settings.
- *
* @param onExpandButtonClickListener The callback to be invoked
* @see #setInitialExpandedChildrenCount(int)
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void setOnExpandButtonClickListener(
@Nullable OnExpandButtonClickListener onExpandButtonClickListener) {
mOnExpandButtonClickListener = onExpandButtonClickListener;
@@ -428,12 +426,10 @@
/**
* Returns the callback to be invoked when the expand button is clicked.
*
- * Used by Settings.
- *
* @return The callback to be invoked when the expand button is clicked.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Nullable
public OnExpandButtonClickListener getOnExpandButtonClickListener() {
return mOnExpandButtonClickListener;
@@ -555,13 +551,10 @@
/**
* Definition for a callback to be invoked when the expand button is clicked.
- *
- * Used by Settings.
- *
* @see #setInitialExpandedChildrenCount(int)
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public interface OnExpandButtonClickListener {
/**
* Called when the expand button is clicked.
diff --git a/preference/src/main/java/androidx/preference/PreferenceGroupAdapter.java b/preference/src/main/java/androidx/preference/PreferenceGroupAdapter.java
index 9509103..931281a 100644
--- a/preference/src/main/java/androidx/preference/PreferenceGroupAdapter.java
+++ b/preference/src/main/java/androidx/preference/PreferenceGroupAdapter.java
@@ -16,7 +16,7 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
@@ -40,11 +40,9 @@
* An adapter that connects a {@link RecyclerView} to the {@link Preference}s contained in
* an associated {@link PreferenceGroup}.
*
- * Used by Settings.
- *
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class PreferenceGroupAdapter extends RecyclerView.Adapter<PreferenceViewHolder>
implements Preference.OnPreferenceChangeInternalListener,
PreferenceGroup.PreferencePositionCallback {
diff --git a/preference/src/main/java/androidx/preference/PreferenceManager.java b/preference/src/main/java/androidx/preference/PreferenceManager.java
index 23205d7a..622d345 100644
--- a/preference/src/main/java/androidx/preference/PreferenceManager.java
+++ b/preference/src/main/java/androidx/preference/PreferenceManager.java
@@ -16,7 +16,7 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.SharedPreferences;
@@ -25,7 +25,6 @@
import android.os.Build.VERSION_CODES;
import android.text.TextUtils;
-import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.core.content.ContextCompat;
@@ -96,11 +95,9 @@
private OnNavigateToScreenListener mOnNavigateToScreenListener;
/**
- * Used by Settings.
- *
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public PreferenceManager(Context context) {
mContext = context;
@@ -197,8 +194,6 @@
* Inflates a preference hierarchy from XML. If a preference hierarchy is given, the new
* preference hierarchies will be merged in.
*
- * Used by Settings.
- *
* @param context The context of the resource
* @param resId The resource ID of the XML to inflate
* @param rootPreferences Optional existing hierarchy to merge the new
@@ -206,7 +201,7 @@
* @return The root hierarchy (if one was not provided, the new hierarchy's root)
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public PreferenceScreen inflateFromResource(Context context, int resId,
PreferenceScreen rootPreferences) {
// Block commits
@@ -438,16 +433,14 @@
}
/**
- * Finds a {@link Preference} with the given key. Returns {@code null} if no
- * {@link Preference} could be found with the given key.
+ * Finds a {@link Preference} based on its key.
*
- * @param key The key of the {@link Preference} to retrieve
+ * @param key The key of the preference to retrieve
* @return The {@link Preference} with the key, or {@code null}
* @see PreferenceGroup#findPreference(CharSequence)
*/
@SuppressWarnings("TypeParameterUnusedInFormals")
- @Nullable
- public <T extends Preference> T findPreference(@NonNull CharSequence key) {
+ public <T extends Preference> T findPreference(CharSequence key) {
if (mPreferenceScreen == null) {
return null;
}
diff --git a/preference/src/main/java/androidx/preference/PreferenceRecyclerViewAccessibilityDelegate.java b/preference/src/main/java/androidx/preference/PreferenceRecyclerViewAccessibilityDelegate.java
index d5847c3..f11c0c9 100644
--- a/preference/src/main/java/androidx/preference/PreferenceRecyclerViewAccessibilityDelegate.java
+++ b/preference/src/main/java/androidx/preference/PreferenceRecyclerViewAccessibilityDelegate.java
@@ -16,12 +16,11 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
import android.view.View;
-import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.core.view.AccessibilityDelegateCompat;
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
@@ -32,16 +31,12 @@
* The accessibility delegate used by the {@link RecyclerView} that displays views for
* {@link Preference}s.
*
- * Used by Leanback.
- *
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class PreferenceRecyclerViewAccessibilityDelegate
extends RecyclerViewAccessibilityDelegate {
- @SuppressWarnings("WeakerAccess") /* synthetic access */
final RecyclerView mRecyclerView;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
final AccessibilityDelegateCompat mDefaultItemDelegate = super.getItemDelegate();
public PreferenceRecyclerViewAccessibilityDelegate(RecyclerView recyclerView) {
@@ -49,12 +44,11 @@
mRecyclerView = recyclerView;
}
- @NonNull
@Override
public AccessibilityDelegateCompat getItemDelegate() {
return mItemDelegate;
}
- @SuppressWarnings("WeakerAccess") /* synthetic access */
+
final AccessibilityDelegateCompat mItemDelegate = new AccessibilityDelegateCompat() {
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
diff --git a/preference/src/main/java/androidx/preference/PreferenceScreen.java b/preference/src/main/java/androidx/preference/PreferenceScreen.java
index ba01728..b034ed1 100644
--- a/preference/src/main/java/androidx/preference/PreferenceScreen.java
+++ b/preference/src/main/java/androidx/preference/PreferenceScreen.java
@@ -16,8 +16,9 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
@@ -44,11 +45,10 @@
/**
* Do NOT use this constructor, use {@link PreferenceManager#createPreferenceScreen(Context)}.
*
- * Used by Settings :)
- *
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
+ @SuppressLint("RestrictedApi")
public PreferenceScreen(Context context, AttributeSet attrs) {
super(context, attrs, TypedArrayUtils.getAttr(context, R.attr.preferenceScreenStyle,
android.R.attr.preferenceScreenStyle));
diff --git a/preference/src/main/java/androidx/preference/SeekBarPreference.java b/preference/src/main/java/androidx/preference/SeekBarPreference.java
index 1e1471a..1619d37 100644
--- a/preference/src/main/java/androidx/preference/SeekBarPreference.java
+++ b/preference/src/main/java/androidx/preference/SeekBarPreference.java
@@ -64,21 +64,14 @@
boolean mAdjustable;
// Whether to show the SeekBar value TextView next to the bar
private boolean mShowSeekBarValue;
- // Whether the SeekBarPreference should continuously save the Seekbar value while it is being
- // dragged.
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- boolean mUpdatesContinuously;
/**
* Listener reacting to the {@link SeekBar} changing value by the user
*/
private OnSeekBarChangeListener mSeekBarChangeListener = new OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- if (fromUser && (mUpdatesContinuously || !mTrackingTouch)) {
+ if (fromUser && !mTrackingTouch) {
syncValueInternal(seekBar);
- } else {
- // We always want to update the text while the seekbar is being dragged
- updateLabelValue(progress + mMin);
}
}
@@ -142,9 +135,7 @@
setMax(a.getInt(R.styleable.SeekBarPreference_android_max, 100));
setSeekBarIncrement(a.getInt(R.styleable.SeekBarPreference_seekBarIncrement, 0));
mAdjustable = a.getBoolean(R.styleable.SeekBarPreference_adjustable, true);
- mShowSeekBarValue = a.getBoolean(R.styleable.SeekBarPreference_showSeekBarValue, false);
- mUpdatesContinuously = a.getBoolean(R.styleable.SeekBarPreference_updatesContinuously,
- false);
+ mShowSeekBarValue = a.getBoolean(R.styleable.SeekBarPreference_showSeekBarValue, true);
a.recycle();
}
@@ -190,7 +181,9 @@
}
mSeekBar.setProgress(mSeekBarValue - mMin);
- updateLabelValue(mSeekBarValue);
+ if (mSeekBarValueTextView != null) {
+ mSeekBarValueTextView.setText(String.valueOf(mSeekBarValue));
+ }
mSeekBar.setEnabled(isEnabled());
}
@@ -298,52 +291,6 @@
mAdjustable = adjustable;
}
- /**
- * Gets whether the {@link SeekBarPreference} should continuously save the {@link SeekBar} value
- * while it is being dragged. Note that when the value is true,
- * {@link Preference.OnPreferenceChangeListener} will be called continuously as well.
- *
- * @return Whether the {@link SeekBarPreference} should continuously save the {@link SeekBar}
- * value while it is being dragged
- * @see #setUpdatesContinuously(boolean)
- */
- public boolean getUpdatesContinuously() {
- return mUpdatesContinuously;
- }
-
- /**
- * Sets whether the {@link SeekBarPreference} should continuously save the {@link SeekBar} value
- * while it is being dragged.
- *
- * @param updatesContinuously Whether the {@link SeekBarPreference} should continuously save
- * the {@link SeekBar} value while it is being dragged
- * @see #getUpdatesContinuously()
- */
- public void setUpdatesContinuously(boolean updatesContinuously) {
- mUpdatesContinuously = updatesContinuously;
- }
-
- /**
- * Gets whether the current {@link SeekBar} value is displayed to the user.
- *
- * @return Whether the current {@link SeekBar} value is displayed to the user
- * @see #setShowSeekBarValue(boolean)
- */
- public boolean getShowSeekBarValue() {
- return mShowSeekBarValue;
- }
-
- /**
- * Sets whether the current {@link SeekBar} value is displayed to the user.
- *
- * @param showSeekBarValue Whether the current {@link SeekBar} value is displayed to the user
- * @see #getShowSeekBarValue()
- */
- public void setShowSeekBarValue(boolean showSeekBarValue) {
- mShowSeekBarValue = showSeekBarValue;
- notifyChanged();
- }
-
private void setValueInternal(int seekBarValue, boolean notifyChanged) {
if (seekBarValue < mMin) {
seekBarValue = mMin;
@@ -354,7 +301,9 @@
if (seekBarValue != mSeekBarValue) {
mSeekBarValue = seekBarValue;
- updateLabelValue(mSeekBarValue);
+ if (mSeekBarValueTextView != null) {
+ mSeekBarValueTextView.setText(String.valueOf(mSeekBarValue));
+ }
persistInt(seekBarValue);
if (notifyChanged) {
notifyChanged();
@@ -392,23 +341,10 @@
setValueInternal(seekBarValue, false);
} else {
seekBar.setProgress(mSeekBarValue - mMin);
- updateLabelValue(mSeekBarValue);
}
}
}
- /**
- * Attempts to update the TextView label that displays the current value.
- *
- * @param value the value to display next to the {@link SeekBar}
- */
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- void updateLabelValue(int value) {
- if (mSeekBarValueTextView != null) {
- mSeekBarValueTextView.setText(String.valueOf(value));
- }
- }
-
@Override
protected Parcelable onSaveInstanceState() {
final Parcelable superState = super.onSaveInstanceState();
diff --git a/preference/src/main/java/androidx/preference/SwitchPreference.java b/preference/src/main/java/androidx/preference/SwitchPreference.java
index 0c94255..b084965 100644
--- a/preference/src/main/java/androidx/preference/SwitchPreference.java
+++ b/preference/src/main/java/androidx/preference/SwitchPreference.java
@@ -16,8 +16,9 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
@@ -60,6 +61,7 @@
* for the view, used only if defStyleAttr is 0 or can not be found in the
* theme. Can be 0 to not look for defaults.
*/
+ @SuppressLint("RestrictedApi")
public SwitchPreference(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
@@ -107,6 +109,7 @@
* @param context The {@link Context} that will style this preference
* @param attrs Style attributes that differ from the default
*/
+ @SuppressLint("RestrictedApi")
public SwitchPreference(Context context, AttributeSet attrs) {
this(context, attrs, TypedArrayUtils.getAttr(context,
androidx.preference.R.attr.switchPreferenceStyle,
@@ -189,7 +192,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
@Override
protected void performClick(View view) {
super.performClick(view);
diff --git a/preference/src/main/java/androidx/preference/SwitchPreferenceCompat.java b/preference/src/main/java/androidx/preference/SwitchPreferenceCompat.java
index 11318dd..b2c156d 100644
--- a/preference/src/main/java/androidx/preference/SwitchPreferenceCompat.java
+++ b/preference/src/main/java/androidx/preference/SwitchPreferenceCompat.java
@@ -16,8 +16,9 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
@@ -60,6 +61,7 @@
* for the view, used only if defStyleAttr is 0 or can not be found in the
* theme. Can be 0 to not look for defaults.
*/
+ @SuppressLint("RestrictedApi")
public SwitchPreferenceCompat(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
@@ -187,7 +189,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
@Override
protected void performClick(View view) {
super.performClick(view);
diff --git a/preference/src/main/java/androidx/preference/TwoStatePreference.java b/preference/src/main/java/androidx/preference/TwoStatePreference.java
index f1e4a59..d745daa 100644
--- a/preference/src/main/java/androidx/preference/TwoStatePreference.java
+++ b/preference/src/main/java/androidx/preference/TwoStatePreference.java
@@ -16,7 +16,7 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.TypedArray;
@@ -215,7 +215,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY)
+ @RestrictTo(LIBRARY_GROUP)
protected void syncSummaryView(View view) {
if (!(view instanceof TextView)) {
return;
diff --git a/preference/src/main/java/androidx/preference/UnPressableLinearLayout.java b/preference/src/main/java/androidx/preference/UnPressableLinearLayout.java
index 75eba63..6570a4e 100644
--- a/preference/src/main/java/androidx/preference/UnPressableLinearLayout.java
+++ b/preference/src/main/java/androidx/preference/UnPressableLinearLayout.java
@@ -16,7 +16,7 @@
package androidx.preference;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.util.AttributeSet;
@@ -29,11 +29,9 @@
* By default, the pressed state is propagated to all the children that are not clickable
* or long-clickable.
*
- * Used by Leanback and Car.
- *
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class UnPressableLinearLayout extends LinearLayout {
public UnPressableLinearLayout(Context context) {
this(context, null);
diff --git a/preference/src/main/java/androidx/preference/internal/PreferenceImageView.java b/preference/src/main/java/androidx/preference/internal/PreferenceImageView.java
index 12c5758..9f6c1c9 100644
--- a/preference/src/main/java/androidx/preference/internal/PreferenceImageView.java
+++ b/preference/src/main/java/androidx/preference/internal/PreferenceImageView.java
@@ -16,7 +16,7 @@
package androidx.preference.internal;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -30,11 +30,9 @@
/**
* Extension of {@link ImageView} that correctly applies maxWidth and maxHeight.
*
- * Used by Car.
- *
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@SuppressLint("AppCompatCustomView")
public class PreferenceImageView extends ImageView {
diff --git a/preference/src/main/java/androidx/preference/internal/package-info.java b/preference/src/main/java/androidx/preference/internal/package-info.java
index 9b46f97..ebf333b 100644
--- a/preference/src/main/java/androidx/preference/internal/package-info.java
+++ b/preference/src/main/java/androidx/preference/internal/package-info.java
@@ -17,9 +17,9 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY)
+@RestrictTo(LIBRARY_GROUP)
package androidx.preference.internal;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
\ No newline at end of file
diff --git a/print/api/1.0.0.txt b/print/api/1.0.0.txt
index a780aa9..1ba4459 100644
--- a/print/api/1.0.0.txt
+++ b/print/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.print {
public final class PrintHelper {
diff --git a/print/api/1.1.0-alpha01.txt b/print/api/1.1.0-alpha01.txt
deleted file mode 100644
index a780aa9..0000000
--- a/print/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-// Signature format: 3.0
-package androidx.print {
-
- public final class PrintHelper {
- ctor public PrintHelper(android.content.Context);
- method public int getColorMode();
- method public int getOrientation();
- method public int getScaleMode();
- method public void printBitmap(String, android.graphics.Bitmap);
- method public void printBitmap(String, android.graphics.Bitmap, androidx.print.PrintHelper.OnPrintFinishCallback?);
- method public void printBitmap(String, android.net.Uri) throws java.io.FileNotFoundException;
- method public void printBitmap(String, android.net.Uri, androidx.print.PrintHelper.OnPrintFinishCallback?) throws java.io.FileNotFoundException;
- method public void setColorMode(int);
- method public void setOrientation(int);
- method public void setScaleMode(int);
- method public static boolean systemSupportsPrint();
- field public static final int COLOR_MODE_COLOR = 2; // 0x2
- field public static final int COLOR_MODE_MONOCHROME = 1; // 0x1
- field public static final int ORIENTATION_LANDSCAPE = 1; // 0x1
- field public static final int ORIENTATION_PORTRAIT = 2; // 0x2
- field public static final int SCALE_MODE_FILL = 2; // 0x2
- field public static final int SCALE_MODE_FIT = 1; // 0x1
- }
-
- public static interface PrintHelper.OnPrintFinishCallback {
- method public void onFinish();
- }
-
-}
-
diff --git a/print/api/current.txt b/print/api/current.txt
index a780aa9..1ba4459 100644
--- a/print/api/current.txt
+++ b/print/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.print {
public final class PrintHelper {
diff --git a/print/api/res-1.1.0-alpha01.txt b/print/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/print/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/print/api/restricted_1.0.0.txt b/print/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/print/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/print/api/restricted_1.1.0-alpha01.txt b/print/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/print/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/print/api/restricted_current.txt b/print/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/print/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/recommendation/api/1.0.0.txt b/recommendation/api/1.0.0.txt
index f5c1149..d729b7c 100644
--- a/recommendation/api/1.0.0.txt
+++ b/recommendation/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.recommendation.app {
public final class ContentRecommendation {
diff --git a/recommendation/api/1.1.0-alpha01.txt b/recommendation/api/1.1.0-alpha01.txt
deleted file mode 100644
index f5c1149..0000000
--- a/recommendation/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,133 +0,0 @@
-// Signature format: 3.0
-package androidx.recommendation.app {
-
- public final class ContentRecommendation {
- method public String! getBackgroundImageUri();
- method public int getBadgeImageResourceId();
- method public int getColor();
- method public android.graphics.Bitmap! getContentImage();
- method public androidx.recommendation.app.ContentRecommendation.IntentData! getContentIntent();
- method public String[]! getContentTypes();
- method public androidx.recommendation.app.ContentRecommendation.IntentData! getDismissIntent();
- method public String[]! getGenres();
- method public String! getGroup();
- method public String! getIdTag();
- method public String! getMaturityRating();
- method public android.app.Notification! getNotificationObject(android.content.Context!);
- method public String! getPricingType();
- method public String! getPricingValue();
- method public String! getPrimaryContentType();
- method public int getProgressMax();
- method public int getProgressValue();
- method public long getRunningTime();
- method public String! getSortKey();
- method public String! getSourceName();
- method public int getStatus();
- method public String! getText();
- method public String! getTitle();
- method public boolean hasProgressInfo();
- method public boolean isAutoDismiss();
- method public void setAutoDismiss(boolean);
- method public void setGroup(String!);
- method public void setProgress(int, int);
- method public void setSortKey(String!);
- method public void setStatus(@androidx.recommendation.app.ContentRecommendation.ContentStatus int);
- field public static final String CONTENT_MATURITY_ALL = "android.contentMaturity.all";
- field public static final String CONTENT_MATURITY_HIGH = "android.contentMaturity.high";
- field public static final String CONTENT_MATURITY_LOW = "android.contentMaturity.low";
- field public static final String CONTENT_MATURITY_MEDIUM = "android.contentMaturity.medium";
- field public static final String CONTENT_PRICING_FREE = "android.contentPrice.free";
- field public static final String CONTENT_PRICING_PREORDER = "android.contentPrice.preorder";
- field public static final String CONTENT_PRICING_PURCHASE = "android.contentPrice.purchase";
- field public static final String CONTENT_PRICING_RENTAL = "android.contentPrice.rental";
- field public static final String CONTENT_PRICING_SUBSCRIPTION = "android.contentPrice.subscription";
- field public static final int CONTENT_STATUS_AVAILABLE = 2; // 0x2
- field public static final int CONTENT_STATUS_PENDING = 1; // 0x1
- field public static final int CONTENT_STATUS_READY = 0; // 0x0
- field public static final int CONTENT_STATUS_UNAVAILABLE = 3; // 0x3
- field public static final String CONTENT_TYPE_APP = "android.contentType.app";
- field public static final String CONTENT_TYPE_BOOK = "android.contentType.book";
- field public static final String CONTENT_TYPE_COMIC = "android.contentType.comic";
- field public static final String CONTENT_TYPE_GAME = "android.contentType.game";
- field public static final String CONTENT_TYPE_MAGAZINE = "android.contentType.magazine";
- field public static final String CONTENT_TYPE_MOVIE = "android.contentType.movie";
- field public static final String CONTENT_TYPE_MUSIC = "android.contentType.music";
- field public static final String CONTENT_TYPE_NEWS = "android.contentType.news";
- field public static final String CONTENT_TYPE_PODCAST = "android.contentType.podcast";
- field public static final String CONTENT_TYPE_RADIO = "android.contentType.radio";
- field public static final String CONTENT_TYPE_SERIAL = "android.contentType.serial";
- field public static final String CONTENT_TYPE_SPORTS = "android.contentType.sports";
- field public static final String CONTENT_TYPE_TRAILER = "android.contentType.trailer";
- field public static final String CONTENT_TYPE_VIDEO = "android.contentType.video";
- field public static final String CONTENT_TYPE_WEBSITE = "android.contentType.website";
- field public static final int INTENT_TYPE_ACTIVITY = 1; // 0x1
- field public static final int INTENT_TYPE_BROADCAST = 2; // 0x2
- field public static final int INTENT_TYPE_SERVICE = 3; // 0x3
- }
-
- public static final class ContentRecommendation.Builder {
- ctor public ContentRecommendation.Builder();
- method public androidx.recommendation.app.ContentRecommendation! build();
- method public androidx.recommendation.app.ContentRecommendation.Builder! setAutoDismiss(boolean);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setBackgroundImageUri(String?);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setBadgeIcon(@DrawableRes int);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setColor(@ColorInt int);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setContentImage(android.graphics.Bitmap!);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setContentIntentData(@androidx.recommendation.app.ContentRecommendation.IntentType int, android.content.Intent!, int, android.os.Bundle?);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setContentTypes(String[]!);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setDismissIntentData(@androidx.recommendation.app.ContentRecommendation.IntentType int, android.content.Intent?, int, android.os.Bundle?);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setGenres(String[]!);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setGroup(String?);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setIdTag(String!);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setMaturityRating(@androidx.recommendation.app.ContentRecommendation.ContentMaturity String!);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setPricingInformation(@androidx.recommendation.app.ContentRecommendation.ContentPricing String!, String?);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setProgress(int, int);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setRunningTime(long);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setSortKey(String?);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setSourceName(String?);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setStatus(@androidx.recommendation.app.ContentRecommendation.ContentStatus int);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setText(String?);
- method public androidx.recommendation.app.ContentRecommendation.Builder! setTitle(String!);
- }
-
- @StringDef({androidx.recommendation.app.ContentRecommendation.CONTENT_MATURITY_ALL, androidx.recommendation.app.ContentRecommendation.CONTENT_MATURITY_LOW, androidx.recommendation.app.ContentRecommendation.CONTENT_MATURITY_MEDIUM, androidx.recommendation.app.ContentRecommendation.CONTENT_MATURITY_HIGH}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ContentRecommendation.ContentMaturity {
- }
-
- @StringDef({androidx.recommendation.app.ContentRecommendation.CONTENT_PRICING_FREE, androidx.recommendation.app.ContentRecommendation.CONTENT_PRICING_RENTAL, androidx.recommendation.app.ContentRecommendation.CONTENT_PRICING_PURCHASE, androidx.recommendation.app.ContentRecommendation.CONTENT_PRICING_PREORDER, androidx.recommendation.app.ContentRecommendation.CONTENT_PRICING_SUBSCRIPTION}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ContentRecommendation.ContentPricing {
- }
-
- @IntDef({androidx.recommendation.app.ContentRecommendation.CONTENT_STATUS_READY, androidx.recommendation.app.ContentRecommendation.CONTENT_STATUS_PENDING, androidx.recommendation.app.ContentRecommendation.CONTENT_STATUS_AVAILABLE, androidx.recommendation.app.ContentRecommendation.CONTENT_STATUS_UNAVAILABLE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ContentRecommendation.ContentStatus {
- }
-
- @StringDef({androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_VIDEO, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_MOVIE, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_TRAILER, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_SERIAL, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_MUSIC, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_RADIO, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_PODCAST, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_NEWS, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_SPORTS, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_APP, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_GAME, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_BOOK, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_COMIC, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_MAGAZINE, androidx.recommendation.app.ContentRecommendation.CONTENT_TYPE_WEBSITE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ContentRecommendation.ContentType {
- }
-
- public static class ContentRecommendation.IntentData {
- ctor public ContentRecommendation.IntentData();
- }
-
- @IntDef({androidx.recommendation.app.ContentRecommendation.INTENT_TYPE_ACTIVITY, androidx.recommendation.app.ContentRecommendation.INTENT_TYPE_BROADCAST, androidx.recommendation.app.ContentRecommendation.INTENT_TYPE_SERVICE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ContentRecommendation.IntentType {
- }
-
- public final class RecommendationExtender implements android.app.Notification.Extender {
- ctor public RecommendationExtender();
- ctor public RecommendationExtender(android.app.Notification!);
- method public android.app.Notification.Builder! extend(android.app.Notification.Builder!);
- method public String[]! getContentTypes();
- method public String[]! getGenres();
- method public String! getMaturityRating();
- method public String! getPricingType();
- method public String! getPricingValue();
- method public String! getPrimaryContentType();
- method public long getRunningTime();
- method public int getStatus();
- method public androidx.recommendation.app.RecommendationExtender! setContentTypes(String[]!);
- method public androidx.recommendation.app.RecommendationExtender! setGenres(String[]!);
- method public androidx.recommendation.app.RecommendationExtender! setMaturityRating(@androidx.recommendation.app.ContentRecommendation.ContentMaturity String!);
- method public androidx.recommendation.app.RecommendationExtender! setPricingInformation(@androidx.recommendation.app.ContentRecommendation.ContentPricing String!, String!);
- method public androidx.recommendation.app.RecommendationExtender! setRunningTime(long);
- method public androidx.recommendation.app.RecommendationExtender! setStatus(@androidx.recommendation.app.ContentRecommendation.ContentStatus int);
- }
-
-}
-
diff --git a/recommendation/api/current.txt b/recommendation/api/current.txt
index f5c1149..d729b7c 100644
--- a/recommendation/api/current.txt
+++ b/recommendation/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.recommendation.app {
public final class ContentRecommendation {
diff --git a/recommendation/api/res-1.1.0-alpha01.txt b/recommendation/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/recommendation/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/recommendation/api/restricted_1.0.0.txt b/recommendation/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/recommendation/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/recommendation/api/restricted_1.1.0-alpha01.txt b/recommendation/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/recommendation/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/recommendation/api/restricted_current.txt b/recommendation/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/recommendation/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/recyclerview/recyclerview/api/1.0.0.txt b/recyclerview/recyclerview/api/1.0.0.txt
index 3f765e3..5358a73 100644
--- a/recyclerview/recyclerview/api/1.0.0.txt
+++ b/recyclerview/recyclerview/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.recyclerview.widget {
public final class AdapterListUpdateCallback implements androidx.recyclerview.widget.ListUpdateCallback {
diff --git a/recyclerview/recyclerview/api/1.1.0-alpha01.txt b/recyclerview/recyclerview/api/1.1.0-alpha01.txt
index 77ecc46..2102a29 100644
--- a/recyclerview/recyclerview/api/1.1.0-alpha01.txt
+++ b/recyclerview/recyclerview/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.recyclerview.widget {
public final class AdapterListUpdateCallback implements androidx.recyclerview.widget.ListUpdateCallback {
diff --git a/recyclerview/recyclerview/api/1.1.0-alpha02.txt b/recyclerview/recyclerview/api/1.1.0-alpha02.txt
index 77ecc46..2102a29 100644
--- a/recyclerview/recyclerview/api/1.1.0-alpha02.txt
+++ b/recyclerview/recyclerview/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.recyclerview.widget {
public final class AdapterListUpdateCallback implements androidx.recyclerview.widget.ListUpdateCallback {
diff --git a/recyclerview/recyclerview/api/1.1.0-alpha03.txt b/recyclerview/recyclerview/api/1.1.0-alpha03.txt
deleted file mode 100644
index 5d61aaf..0000000
--- a/recyclerview/recyclerview/api/1.1.0-alpha03.txt
+++ /dev/null
@@ -1,1033 +0,0 @@
-// Signature format: 3.0
-package androidx.recyclerview.widget {
-
- public final class AdapterListUpdateCallback implements androidx.recyclerview.widget.ListUpdateCallback {
- ctor public AdapterListUpdateCallback(androidx.recyclerview.widget.RecyclerView.Adapter);
- method public void onChanged(int, int, Object!);
- method public void onInserted(int, int);
- method public void onMoved(int, int);
- method public void onRemoved(int, int);
- }
-
- public final class AsyncDifferConfig<T> {
- method public java.util.concurrent.Executor getBackgroundThreadExecutor();
- method public androidx.recyclerview.widget.DiffUtil.ItemCallback<T> getDiffCallback();
- }
-
- public static final class AsyncDifferConfig.Builder<T> {
- ctor public AsyncDifferConfig.Builder(androidx.recyclerview.widget.DiffUtil.ItemCallback<T>);
- method public androidx.recyclerview.widget.AsyncDifferConfig<T> build();
- method public androidx.recyclerview.widget.AsyncDifferConfig.Builder<T> setBackgroundThreadExecutor(java.util.concurrent.Executor!);
- }
-
- public class AsyncListDiffer<T> {
- ctor public AsyncListDiffer(androidx.recyclerview.widget.RecyclerView.Adapter, androidx.recyclerview.widget.DiffUtil.ItemCallback<T>);
- ctor public AsyncListDiffer(androidx.recyclerview.widget.ListUpdateCallback, androidx.recyclerview.widget.AsyncDifferConfig<T>);
- method public void addListListener(androidx.recyclerview.widget.AsyncListDiffer.ListListener<T>);
- method public java.util.List<T> getCurrentList();
- method public void removeListListener(androidx.recyclerview.widget.AsyncListDiffer.ListListener<T>);
- method public void submitList(java.util.List<T>?);
- method public void submitList(java.util.List<T>?, Runnable?);
- }
-
- public static interface AsyncListDiffer.ListListener<T> {
- method public void onCurrentListChanged(java.util.List<T>, java.util.List<T>);
- }
-
- public class AsyncListUtil<T> {
- ctor public AsyncListUtil(Class<T>, int, androidx.recyclerview.widget.AsyncListUtil.DataCallback<T>, androidx.recyclerview.widget.AsyncListUtil.ViewCallback);
- method public T? getItem(int);
- method public int getItemCount();
- method public void onRangeChanged();
- method public void refresh();
- }
-
- public abstract static class AsyncListUtil.DataCallback<T> {
- ctor public AsyncListUtil.DataCallback();
- method @WorkerThread public abstract void fillData(T[], int, int);
- method @WorkerThread public int getMaxCachedTiles();
- method @WorkerThread public void recycleData(T[], int);
- method @WorkerThread public abstract int refreshData();
- }
-
- public abstract static class AsyncListUtil.ViewCallback {
- ctor public AsyncListUtil.ViewCallback();
- method @UiThread public void extendRangeInto(int[], int[], int);
- method @UiThread public abstract void getItemRangeInto(int[]);
- method @UiThread public abstract void onDataRefresh();
- method @UiThread public abstract void onItemLoaded(int);
- field public static final int HINT_SCROLL_ASC = 2; // 0x2
- field public static final int HINT_SCROLL_DESC = 1; // 0x1
- field public static final int HINT_SCROLL_NONE = 0; // 0x0
- }
-
- public class BatchingListUpdateCallback implements androidx.recyclerview.widget.ListUpdateCallback {
- ctor public BatchingListUpdateCallback(androidx.recyclerview.widget.ListUpdateCallback);
- method public void dispatchLastEvent();
- method public void onChanged(int, int, Object!);
- method public void onInserted(int, int);
- method public void onMoved(int, int);
- method public void onRemoved(int, int);
- }
-
- public class DefaultItemAnimator extends androidx.recyclerview.widget.SimpleItemAnimator {
- ctor public DefaultItemAnimator();
- method public boolean animateAdd(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public boolean animateChange(androidx.recyclerview.widget.RecyclerView.ViewHolder!, androidx.recyclerview.widget.RecyclerView.ViewHolder!, int, int, int, int);
- method public boolean animateMove(androidx.recyclerview.widget.RecyclerView.ViewHolder!, int, int, int, int);
- method public boolean animateRemove(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public void endAnimation(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public void endAnimations();
- method public boolean isRunning();
- method public void runPendingAnimations();
- }
-
- public class DiffUtil {
- method public static androidx.recyclerview.widget.DiffUtil.DiffResult calculateDiff(androidx.recyclerview.widget.DiffUtil.Callback);
- method public static androidx.recyclerview.widget.DiffUtil.DiffResult calculateDiff(androidx.recyclerview.widget.DiffUtil.Callback, boolean);
- }
-
- public abstract static class DiffUtil.Callback {
- ctor public DiffUtil.Callback();
- method public abstract boolean areContentsTheSame(int, int);
- method public abstract boolean areItemsTheSame(int, int);
- method public Object? getChangePayload(int, int);
- method public abstract int getNewListSize();
- method public abstract int getOldListSize();
- }
-
- public static class DiffUtil.DiffResult {
- method public int convertNewPositionToOld(@IntRange(from=0) int);
- method public int convertOldPositionToNew(@IntRange(from=0) int);
- method public void dispatchUpdatesTo(androidx.recyclerview.widget.RecyclerView.Adapter);
- method public void dispatchUpdatesTo(androidx.recyclerview.widget.ListUpdateCallback);
- field public static final int NO_POSITION = -1; // 0xffffffff
- }
-
- public abstract static class DiffUtil.ItemCallback<T> {
- ctor public DiffUtil.ItemCallback();
- method public abstract boolean areContentsTheSame(T, T);
- method public abstract boolean areItemsTheSame(T, T);
- method public Object? getChangePayload(T, T);
- }
-
- public class DividerItemDecoration extends androidx.recyclerview.widget.RecyclerView.ItemDecoration {
- ctor public DividerItemDecoration(android.content.Context!, int);
- method public void setDrawable(android.graphics.drawable.Drawable);
- method public void setOrientation(int);
- field public static final int HORIZONTAL = 0; // 0x0
- field public static final int VERTICAL = 1; // 0x1
- }
-
- public class GridLayoutManager extends androidx.recyclerview.widget.LinearLayoutManager {
- ctor public GridLayoutManager(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public GridLayoutManager(android.content.Context!, int);
- ctor public GridLayoutManager(android.content.Context!, int, int, boolean);
- method public int getSpanCount();
- method public androidx.recyclerview.widget.GridLayoutManager.SpanSizeLookup! getSpanSizeLookup();
- method public boolean isUsingSpansToEstimateScrollbarDimensions();
- method public void setSpanCount(int);
- method public void setSpanSizeLookup(androidx.recyclerview.widget.GridLayoutManager.SpanSizeLookup!);
- method public void setUsingSpansToEstimateScrollbarDimensions(boolean);
- field public static final int DEFAULT_SPAN_COUNT = -1; // 0xffffffff
- }
-
- public static final class GridLayoutManager.DefaultSpanSizeLookup extends androidx.recyclerview.widget.GridLayoutManager.SpanSizeLookup {
- ctor public GridLayoutManager.DefaultSpanSizeLookup();
- method public int getSpanSize(int);
- }
-
- public static class GridLayoutManager.LayoutParams extends androidx.recyclerview.widget.RecyclerView.LayoutParams {
- ctor public GridLayoutManager.LayoutParams(android.content.Context!, android.util.AttributeSet!);
- ctor public GridLayoutManager.LayoutParams(int, int);
- ctor public GridLayoutManager.LayoutParams(android.view.ViewGroup.MarginLayoutParams!);
- ctor public GridLayoutManager.LayoutParams(android.view.ViewGroup.LayoutParams!);
- ctor public GridLayoutManager.LayoutParams(androidx.recyclerview.widget.RecyclerView.LayoutParams!);
- method public int getSpanIndex();
- method public int getSpanSize();
- field public static final int INVALID_SPAN_ID = -1; // 0xffffffff
- }
-
- public abstract static class GridLayoutManager.SpanSizeLookup {
- ctor public GridLayoutManager.SpanSizeLookup();
- method public int getSpanGroupIndex(int, int);
- method public int getSpanIndex(int, int);
- method public abstract int getSpanSize(int);
- method public void invalidateSpanGroupIndexCache();
- method public void invalidateSpanIndexCache();
- method public boolean isSpanGroupIndexCacheEnabled();
- method public boolean isSpanIndexCacheEnabled();
- method public void setSpanGroupIndexCacheEnabled(boolean);
- method public void setSpanIndexCacheEnabled(boolean);
- }
-
- public class ItemTouchHelper extends androidx.recyclerview.widget.RecyclerView.ItemDecoration implements androidx.recyclerview.widget.RecyclerView.OnChildAttachStateChangeListener {
- ctor public ItemTouchHelper(androidx.recyclerview.widget.ItemTouchHelper.Callback);
- method public void attachToRecyclerView(androidx.recyclerview.widget.RecyclerView?);
- method public void onChildViewAttachedToWindow(android.view.View);
- method public void onChildViewDetachedFromWindow(android.view.View);
- method public void startDrag(androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public void startSwipe(androidx.recyclerview.widget.RecyclerView.ViewHolder);
- field public static final int ACTION_STATE_DRAG = 2; // 0x2
- field public static final int ACTION_STATE_IDLE = 0; // 0x0
- field public static final int ACTION_STATE_SWIPE = 1; // 0x1
- field public static final int ANIMATION_TYPE_DRAG = 8; // 0x8
- field public static final int ANIMATION_TYPE_SWIPE_CANCEL = 4; // 0x4
- field public static final int ANIMATION_TYPE_SWIPE_SUCCESS = 2; // 0x2
- field public static final int DOWN = 2; // 0x2
- field public static final int END = 32; // 0x20
- field public static final int LEFT = 4; // 0x4
- field public static final int RIGHT = 8; // 0x8
- field public static final int START = 16; // 0x10
- field public static final int UP = 1; // 0x1
- }
-
- public abstract static class ItemTouchHelper.Callback {
- ctor public ItemTouchHelper.Callback();
- method public boolean canDropOver(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.ViewHolder, androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public androidx.recyclerview.widget.RecyclerView.ViewHolder! chooseDropTarget(androidx.recyclerview.widget.RecyclerView.ViewHolder, java.util.List<androidx.recyclerview.widget.RecyclerView.ViewHolder>, int, int);
- method public void clearView(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public int convertToAbsoluteDirection(int, int);
- method public static int convertToRelativeDirection(int, int);
- method public long getAnimationDuration(androidx.recyclerview.widget.RecyclerView, int, float, float);
- method public int getBoundingBoxMargin();
- method public static androidx.recyclerview.widget.ItemTouchUIUtil getDefaultUIUtil();
- method public float getMoveThreshold(androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public abstract int getMovementFlags(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public float getSwipeEscapeVelocity(float);
- method public float getSwipeThreshold(androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public float getSwipeVelocityThreshold(float);
- method public int interpolateOutOfBoundsScroll(androidx.recyclerview.widget.RecyclerView, int, int, int, long);
- method public boolean isItemViewSwipeEnabled();
- method public boolean isLongPressDragEnabled();
- method public static int makeFlag(int, int);
- method public static int makeMovementFlags(int, int);
- method public void onChildDraw(android.graphics.Canvas, androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.ViewHolder, float, float, int, boolean);
- method public void onChildDrawOver(android.graphics.Canvas, androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.ViewHolder!, float, float, int, boolean);
- method public abstract boolean onMove(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.ViewHolder, androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public void onMoved(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.ViewHolder, int, androidx.recyclerview.widget.RecyclerView.ViewHolder, int, int, int);
- method public void onSelectedChanged(androidx.recyclerview.widget.RecyclerView.ViewHolder?, int);
- method public abstract void onSwiped(androidx.recyclerview.widget.RecyclerView.ViewHolder, int);
- field public static final int DEFAULT_DRAG_ANIMATION_DURATION = 200; // 0xc8
- field public static final int DEFAULT_SWIPE_ANIMATION_DURATION = 250; // 0xfa
- }
-
- public abstract static class ItemTouchHelper.SimpleCallback extends androidx.recyclerview.widget.ItemTouchHelper.Callback {
- ctor public ItemTouchHelper.SimpleCallback(int, int);
- method public int getDragDirs(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public int getMovementFlags(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public int getSwipeDirs(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public void setDefaultDragDirs(int);
- method public void setDefaultSwipeDirs(int);
- }
-
- public static interface ItemTouchHelper.ViewDropHandler {
- method public void prepareForDrop(android.view.View, android.view.View, int, int);
- }
-
- public interface ItemTouchUIUtil {
- method public void clearView(android.view.View!);
- method public void onDraw(android.graphics.Canvas!, androidx.recyclerview.widget.RecyclerView!, android.view.View!, float, float, int, boolean);
- method public void onDrawOver(android.graphics.Canvas!, androidx.recyclerview.widget.RecyclerView!, android.view.View!, float, float, int, boolean);
- method public void onSelected(android.view.View!);
- }
-
- public class LinearLayoutManager extends androidx.recyclerview.widget.RecyclerView.LayoutManager implements androidx.recyclerview.widget.ItemTouchHelper.ViewDropHandler androidx.recyclerview.widget.RecyclerView.SmoothScroller.ScrollVectorProvider {
- ctor public LinearLayoutManager(android.content.Context!);
- ctor public LinearLayoutManager(android.content.Context!, int, boolean);
- ctor public LinearLayoutManager(android.content.Context!, android.util.AttributeSet!, int, int);
- method public android.graphics.PointF! computeScrollVectorForPosition(int);
- method public int findFirstCompletelyVisibleItemPosition();
- method public int findFirstVisibleItemPosition();
- method public int findLastCompletelyVisibleItemPosition();
- method public int findLastVisibleItemPosition();
- method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateDefaultLayoutParams();
- method protected int getExtraLayoutSpace(androidx.recyclerview.widget.RecyclerView.State!);
- method public int getInitialPrefetchItemCount();
- method public int getOrientation();
- method public boolean getRecycleChildrenOnDetach();
- method public boolean getReverseLayout();
- method public boolean getStackFromEnd();
- method protected boolean isLayoutRTL();
- method public boolean isSmoothScrollbarEnabled();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void prepareForDrop(android.view.View, android.view.View, int, int);
- method public void scrollToPositionWithOffset(int, int);
- method public void setInitialPrefetchItemCount(int);
- method public void setOrientation(int);
- method public void setRecycleChildrenOnDetach(boolean);
- method public void setReverseLayout(boolean);
- method public void setSmoothScrollbarEnabled(boolean);
- method public void setStackFromEnd(boolean);
- field public static final int HORIZONTAL = 0; // 0x0
- field public static final int INVALID_OFFSET = -2147483648; // 0x80000000
- field public static final int VERTICAL = 1; // 0x1
- }
-
- protected static class LinearLayoutManager.LayoutChunkResult {
- ctor protected LinearLayoutManager.LayoutChunkResult();
- field public int mConsumed;
- field public boolean mFinished;
- field public boolean mFocusable;
- field public boolean mIgnoreConsumed;
- }
-
- public class LinearSmoothScroller extends androidx.recyclerview.widget.RecyclerView.SmoothScroller {
- ctor public LinearSmoothScroller(android.content.Context!);
- method public int calculateDtToFit(int, int, int, int, int);
- method public int calculateDxToMakeVisible(android.view.View!, int);
- method public int calculateDyToMakeVisible(android.view.View!, int);
- method protected float calculateSpeedPerPixel(android.util.DisplayMetrics!);
- method protected int calculateTimeForDeceleration(int);
- method protected int calculateTimeForScrolling(int);
- method protected int getHorizontalSnapPreference();
- method protected int getVerticalSnapPreference();
- method protected void onSeekTargetStep(int, int, androidx.recyclerview.widget.RecyclerView.State!, androidx.recyclerview.widget.RecyclerView.SmoothScroller.Action!);
- method protected void onStart();
- method protected void onStop();
- method protected void onTargetFound(android.view.View!, androidx.recyclerview.widget.RecyclerView.State!, androidx.recyclerview.widget.RecyclerView.SmoothScroller.Action!);
- method protected void updateActionForInterimTarget(androidx.recyclerview.widget.RecyclerView.SmoothScroller.Action!);
- field public static final int SNAP_TO_ANY = 0; // 0x0
- field public static final int SNAP_TO_END = 1; // 0x1
- field public static final int SNAP_TO_START = -1; // 0xffffffff
- field protected final android.view.animation.DecelerateInterpolator! mDecelerateInterpolator;
- field protected int mInterimTargetDx;
- field protected int mInterimTargetDy;
- field protected final android.view.animation.LinearInterpolator! mLinearInterpolator;
- field protected android.graphics.PointF! mTargetVector;
- }
-
- public class LinearSnapHelper extends androidx.recyclerview.widget.SnapHelper {
- ctor public LinearSnapHelper();
- method public int[]! calculateDistanceToFinalSnap(androidx.recyclerview.widget.RecyclerView.LayoutManager, android.view.View);
- method public android.view.View! findSnapView(androidx.recyclerview.widget.RecyclerView.LayoutManager!);
- method public int findTargetSnapPosition(androidx.recyclerview.widget.RecyclerView.LayoutManager!, int, int);
- }
-
- public abstract class ListAdapter<T, VH extends androidx.recyclerview.widget.RecyclerView.ViewHolder> extends androidx.recyclerview.widget.RecyclerView.Adapter<VH> {
- ctor protected ListAdapter(androidx.recyclerview.widget.DiffUtil.ItemCallback<T>);
- ctor protected ListAdapter(androidx.recyclerview.widget.AsyncDifferConfig<T>);
- method public java.util.List<T> getCurrentList();
- method protected T! getItem(int);
- method public int getItemCount();
- method public void onCurrentListChanged(java.util.List<T>, java.util.List<T>);
- method public void submitList(java.util.List<T>?);
- method public void submitList(java.util.List<T>?, Runnable?);
- }
-
- public interface ListUpdateCallback {
- method public void onChanged(int, int, Object?);
- method public void onInserted(int, int);
- method public void onMoved(int, int);
- method public void onRemoved(int, int);
- }
-
- public abstract class OrientationHelper {
- method public static androidx.recyclerview.widget.OrientationHelper! createHorizontalHelper(androidx.recyclerview.widget.RecyclerView.LayoutManager!);
- method public static androidx.recyclerview.widget.OrientationHelper! createOrientationHelper(androidx.recyclerview.widget.RecyclerView.LayoutManager!, int);
- method public static androidx.recyclerview.widget.OrientationHelper! createVerticalHelper(androidx.recyclerview.widget.RecyclerView.LayoutManager!);
- method public abstract int getDecoratedEnd(android.view.View!);
- method public abstract int getDecoratedMeasurement(android.view.View!);
- method public abstract int getDecoratedMeasurementInOther(android.view.View!);
- method public abstract int getDecoratedStart(android.view.View!);
- method public abstract int getEnd();
- method public abstract int getEndAfterPadding();
- method public abstract int getEndPadding();
- method public androidx.recyclerview.widget.RecyclerView.LayoutManager! getLayoutManager();
- method public abstract int getMode();
- method public abstract int getModeInOther();
- method public abstract int getStartAfterPadding();
- method public abstract int getTotalSpace();
- method public int getTotalSpaceChange();
- method public abstract int getTransformedEndWithDecoration(android.view.View!);
- method public abstract int getTransformedStartWithDecoration(android.view.View!);
- method public abstract void offsetChild(android.view.View!, int);
- method public abstract void offsetChildren(int);
- method public void onLayoutComplete();
- field public static final int HORIZONTAL = 0; // 0x0
- field public static final int VERTICAL = 1; // 0x1
- field protected final androidx.recyclerview.widget.RecyclerView.LayoutManager! mLayoutManager;
- }
-
- public class PagerSnapHelper extends androidx.recyclerview.widget.SnapHelper {
- ctor public PagerSnapHelper();
- method public int[]? calculateDistanceToFinalSnap(androidx.recyclerview.widget.RecyclerView.LayoutManager, android.view.View);
- method protected androidx.recyclerview.widget.LinearSmoothScroller! createSnapScroller(androidx.recyclerview.widget.RecyclerView.LayoutManager!);
- method public android.view.View? findSnapView(androidx.recyclerview.widget.RecyclerView.LayoutManager!);
- method public int findTargetSnapPosition(androidx.recyclerview.widget.RecyclerView.LayoutManager!, int, int);
- }
-
- public class RecyclerView extends android.view.ViewGroup implements androidx.core.view.NestedScrollingChild2 androidx.core.view.NestedScrollingChild3 androidx.core.view.ScrollingView {
- ctor public RecyclerView(android.content.Context);
- ctor public RecyclerView(android.content.Context, android.util.AttributeSet?);
- ctor public RecyclerView(android.content.Context, android.util.AttributeSet?, int);
- method public void addItemDecoration(androidx.recyclerview.widget.RecyclerView.ItemDecoration, int);
- method public void addItemDecoration(androidx.recyclerview.widget.RecyclerView.ItemDecoration);
- method public void addOnChildAttachStateChangeListener(androidx.recyclerview.widget.RecyclerView.OnChildAttachStateChangeListener);
- method public void addOnItemTouchListener(androidx.recyclerview.widget.RecyclerView.OnItemTouchListener);
- method public void addOnScrollListener(androidx.recyclerview.widget.RecyclerView.OnScrollListener);
- method public void clearOnChildAttachStateChangeListeners();
- method public void clearOnScrollListeners();
- method public int computeHorizontalScrollExtent();
- method public int computeHorizontalScrollOffset();
- method public int computeHorizontalScrollRange();
- method public int computeVerticalScrollExtent();
- method public int computeVerticalScrollOffset();
- method public int computeVerticalScrollRange();
- method public boolean dispatchNestedPreScroll(int, int, int[]!, int[]!, int);
- method public boolean dispatchNestedScroll(int, int, int, int, int[]!, int);
- method public final void dispatchNestedScroll(int, int, int, int, int[]!, int, int[]!);
- method public boolean drawChild(android.graphics.Canvas!, android.view.View!, long);
- method public android.view.View? findChildViewUnder(float, float);
- method public android.view.View? findContainingItemView(android.view.View);
- method public androidx.recyclerview.widget.RecyclerView.ViewHolder? findContainingViewHolder(android.view.View);
- method public androidx.recyclerview.widget.RecyclerView.ViewHolder? findViewHolderForAdapterPosition(int);
- method public androidx.recyclerview.widget.RecyclerView.ViewHolder! findViewHolderForItemId(long);
- method public androidx.recyclerview.widget.RecyclerView.ViewHolder? findViewHolderForLayoutPosition(int);
- method @Deprecated public androidx.recyclerview.widget.RecyclerView.ViewHolder? findViewHolderForPosition(int);
- method public boolean fling(int, int);
- method public androidx.recyclerview.widget.RecyclerView.Adapter? getAdapter();
- method public int getChildAdapterPosition(android.view.View);
- method public long getChildItemId(android.view.View);
- method public int getChildLayoutPosition(android.view.View);
- method @Deprecated public int getChildPosition(android.view.View);
- method public androidx.recyclerview.widget.RecyclerView.ViewHolder! getChildViewHolder(android.view.View);
- method public androidx.recyclerview.widget.RecyclerViewAccessibilityDelegate? getCompatAccessibilityDelegate();
- method public void getDecoratedBoundsWithMargins(android.view.View, android.graphics.Rect);
- method public androidx.recyclerview.widget.RecyclerView.EdgeEffectFactory getEdgeEffectFactory();
- method public androidx.recyclerview.widget.RecyclerView.ItemAnimator? getItemAnimator();
- method public androidx.recyclerview.widget.RecyclerView.ItemDecoration getItemDecorationAt(int);
- method public int getItemDecorationCount();
- method public androidx.recyclerview.widget.RecyclerView.LayoutManager? getLayoutManager();
- method public int getMaxFlingVelocity();
- method public int getMinFlingVelocity();
- method public androidx.recyclerview.widget.RecyclerView.OnFlingListener? getOnFlingListener();
- method public boolean getPreserveFocusAfterLayout();
- method public androidx.recyclerview.widget.RecyclerView.RecycledViewPool getRecycledViewPool();
- method public int getScrollState();
- method public boolean hasFixedSize();
- method public boolean hasNestedScrollingParent(int);
- method public boolean hasPendingAdapterUpdates();
- method public void invalidateItemDecorations();
- method public boolean isAnimating();
- method public boolean isComputingLayout();
- method @Deprecated public boolean isLayoutFrozen();
- method public final boolean isLayoutSuppressed();
- method public void offsetChildrenHorizontal(@Px int);
- method public void offsetChildrenVertical(@Px int);
- method public void onChildAttachedToWindow(android.view.View);
- method public void onChildDetachedFromWindow(android.view.View);
- method public void onDraw(android.graphics.Canvas!);
- method public void onScrollStateChanged(int);
- method public void onScrolled(@Px int, @Px int);
- method public void removeItemDecoration(androidx.recyclerview.widget.RecyclerView.ItemDecoration);
- method public void removeItemDecorationAt(int);
- method public void removeOnChildAttachStateChangeListener(androidx.recyclerview.widget.RecyclerView.OnChildAttachStateChangeListener);
- method public void removeOnItemTouchListener(androidx.recyclerview.widget.RecyclerView.OnItemTouchListener);
- method public void removeOnScrollListener(androidx.recyclerview.widget.RecyclerView.OnScrollListener);
- method public void scrollToPosition(int);
- method public void setAccessibilityDelegateCompat(androidx.recyclerview.widget.RecyclerViewAccessibilityDelegate?);
- method public void setAdapter(androidx.recyclerview.widget.RecyclerView.Adapter?);
- method public void setChildDrawingOrderCallback(androidx.recyclerview.widget.RecyclerView.ChildDrawingOrderCallback?);
- method public void setEdgeEffectFactory(androidx.recyclerview.widget.RecyclerView.EdgeEffectFactory);
- method public void setHasFixedSize(boolean);
- method public void setItemAnimator(androidx.recyclerview.widget.RecyclerView.ItemAnimator?);
- method public void setItemViewCacheSize(int);
- method @Deprecated public void setLayoutFrozen(boolean);
- method public void setLayoutManager(androidx.recyclerview.widget.RecyclerView.LayoutManager?);
- method @Deprecated public void setLayoutTransition(android.animation.LayoutTransition!);
- method public void setOnFlingListener(androidx.recyclerview.widget.RecyclerView.OnFlingListener?);
- method @Deprecated public void setOnScrollListener(androidx.recyclerview.widget.RecyclerView.OnScrollListener?);
- method public void setPreserveFocusAfterLayout(boolean);
- method public void setRecycledViewPool(androidx.recyclerview.widget.RecyclerView.RecycledViewPool?);
- method public void setRecyclerListener(androidx.recyclerview.widget.RecyclerView.RecyclerListener?);
- method public void setScrollingTouchSlop(int);
- method public void setViewCacheExtension(androidx.recyclerview.widget.RecyclerView.ViewCacheExtension?);
- method public void smoothScrollBy(@Px int, @Px int);
- method public void smoothScrollBy(@Px int, @Px int, android.view.animation.Interpolator?);
- method public void smoothScrollToPosition(int);
- method public boolean startNestedScroll(int, int);
- method public void stopNestedScroll(int);
- method public void stopScroll();
- method public final void suppressLayout(boolean);
- method public void swapAdapter(androidx.recyclerview.widget.RecyclerView.Adapter?, boolean);
- field public static final int HORIZONTAL = 0; // 0x0
- field public static final int INVALID_TYPE = -1; // 0xffffffff
- field public static final long NO_ID = -1L; // 0xffffffffffffffffL
- field public static final int NO_POSITION = -1; // 0xffffffff
- field public static final int SCROLL_STATE_DRAGGING = 1; // 0x1
- field public static final int SCROLL_STATE_IDLE = 0; // 0x0
- field public static final int SCROLL_STATE_SETTLING = 2; // 0x2
- field public static final int TOUCH_SLOP_DEFAULT = 0; // 0x0
- field public static final int TOUCH_SLOP_PAGING = 1; // 0x1
- field public static final int VERTICAL = 1; // 0x1
- }
-
- public abstract static class RecyclerView.Adapter<VH extends androidx.recyclerview.widget.RecyclerView.ViewHolder> {
- ctor public RecyclerView.Adapter();
- method public final void bindViewHolder(VH, int);
- method public final VH createViewHolder(android.view.ViewGroup, int);
- method public abstract int getItemCount();
- method public long getItemId(int);
- method public int getItemViewType(int);
- method public final boolean hasObservers();
- method public final boolean hasStableIds();
- method public final void notifyDataSetChanged();
- method public final void notifyItemChanged(int);
- method public final void notifyItemChanged(int, Object?);
- method public final void notifyItemInserted(int);
- method public final void notifyItemMoved(int, int);
- method public final void notifyItemRangeChanged(int, int);
- method public final void notifyItemRangeChanged(int, int, Object?);
- method public final void notifyItemRangeInserted(int, int);
- method public final void notifyItemRangeRemoved(int, int);
- method public final void notifyItemRemoved(int);
- method public void onAttachedToRecyclerView(androidx.recyclerview.widget.RecyclerView);
- method public abstract void onBindViewHolder(VH, int);
- method public void onBindViewHolder(VH, int, java.util.List<java.lang.Object>);
- method public abstract VH onCreateViewHolder(android.view.ViewGroup, int);
- method public void onDetachedFromRecyclerView(androidx.recyclerview.widget.RecyclerView);
- method public boolean onFailedToRecycleView(VH);
- method public void onViewAttachedToWindow(VH);
- method public void onViewDetachedFromWindow(VH);
- method public void onViewRecycled(VH);
- method public void registerAdapterDataObserver(androidx.recyclerview.widget.RecyclerView.AdapterDataObserver);
- method public void setHasStableIds(boolean);
- method public void unregisterAdapterDataObserver(androidx.recyclerview.widget.RecyclerView.AdapterDataObserver);
- }
-
- public abstract static class RecyclerView.AdapterDataObserver {
- ctor public RecyclerView.AdapterDataObserver();
- method public void onChanged();
- method public void onItemRangeChanged(int, int);
- method public void onItemRangeChanged(int, int, Object?);
- method public void onItemRangeInserted(int, int);
- method public void onItemRangeMoved(int, int, int);
- method public void onItemRangeRemoved(int, int);
- }
-
- public static interface RecyclerView.ChildDrawingOrderCallback {
- method public int onGetChildDrawingOrder(int, int);
- }
-
- public static class RecyclerView.EdgeEffectFactory {
- ctor public RecyclerView.EdgeEffectFactory();
- method protected android.widget.EdgeEffect createEdgeEffect(androidx.recyclerview.widget.RecyclerView, @androidx.recyclerview.widget.RecyclerView.EdgeEffectFactory.EdgeDirection int);
- field public static final int DIRECTION_BOTTOM = 3; // 0x3
- field public static final int DIRECTION_LEFT = 0; // 0x0
- field public static final int DIRECTION_RIGHT = 2; // 0x2
- field public static final int DIRECTION_TOP = 1; // 0x1
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({androidx.recyclerview.widget.RecyclerView.EdgeEffectFactory.DIRECTION_LEFT, androidx.recyclerview.widget.RecyclerView.EdgeEffectFactory.DIRECTION_TOP, androidx.recyclerview.widget.RecyclerView.EdgeEffectFactory.DIRECTION_RIGHT, androidx.recyclerview.widget.RecyclerView.EdgeEffectFactory.DIRECTION_BOTTOM}) public static @interface RecyclerView.EdgeEffectFactory.EdgeDirection {
- }
-
- public abstract static class RecyclerView.ItemAnimator {
- ctor public RecyclerView.ItemAnimator();
- method public abstract boolean animateAppearance(androidx.recyclerview.widget.RecyclerView.ViewHolder, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo?, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo);
- method public abstract boolean animateChange(androidx.recyclerview.widget.RecyclerView.ViewHolder, androidx.recyclerview.widget.RecyclerView.ViewHolder, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo);
- method public abstract boolean animateDisappearance(androidx.recyclerview.widget.RecyclerView.ViewHolder, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo?);
- method public abstract boolean animatePersistence(androidx.recyclerview.widget.RecyclerView.ViewHolder, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo);
- method public boolean canReuseUpdatedViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public boolean canReuseUpdatedViewHolder(androidx.recyclerview.widget.RecyclerView.ViewHolder, java.util.List<java.lang.Object>);
- method public final void dispatchAnimationFinished(androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public final void dispatchAnimationStarted(androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public final void dispatchAnimationsFinished();
- method public abstract void endAnimation(androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public abstract void endAnimations();
- method public long getAddDuration();
- method public long getChangeDuration();
- method public long getMoveDuration();
- method public long getRemoveDuration();
- method public abstract boolean isRunning();
- method public final boolean isRunning(androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemAnimatorFinishedListener?);
- method public androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo obtainHolderInfo();
- method public void onAnimationFinished(androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public void onAnimationStarted(androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo recordPostLayoutInformation(androidx.recyclerview.widget.RecyclerView.State, androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo recordPreLayoutInformation(androidx.recyclerview.widget.RecyclerView.State, androidx.recyclerview.widget.RecyclerView.ViewHolder, @androidx.recyclerview.widget.RecyclerView.ItemAnimator.AdapterChanges int, java.util.List<java.lang.Object>);
- method public abstract void runPendingAnimations();
- method public void setAddDuration(long);
- method public void setChangeDuration(long);
- method public void setMoveDuration(long);
- method public void setRemoveDuration(long);
- field public static final int FLAG_APPEARED_IN_PRE_LAYOUT = 4096; // 0x1000
- field public static final int FLAG_CHANGED = 2; // 0x2
- field public static final int FLAG_INVALIDATED = 4; // 0x4
- field public static final int FLAG_MOVED = 2048; // 0x800
- field public static final int FLAG_REMOVED = 8; // 0x8
- }
-
- @IntDef(flag=true, value={androidx.recyclerview.widget.RecyclerView.ItemAnimator.FLAG_CHANGED, androidx.recyclerview.widget.RecyclerView.ItemAnimator.FLAG_REMOVED, androidx.recyclerview.widget.RecyclerView.ItemAnimator.FLAG_MOVED, androidx.recyclerview.widget.RecyclerView.ItemAnimator.FLAG_INVALIDATED, androidx.recyclerview.widget.RecyclerView.ItemAnimator.FLAG_APPEARED_IN_PRE_LAYOUT}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface RecyclerView.ItemAnimator.AdapterChanges {
- }
-
- public static interface RecyclerView.ItemAnimator.ItemAnimatorFinishedListener {
- method public void onAnimationsFinished();
- }
-
- public static class RecyclerView.ItemAnimator.ItemHolderInfo {
- ctor public RecyclerView.ItemAnimator.ItemHolderInfo();
- method public androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo setFrom(androidx.recyclerview.widget.RecyclerView.ViewHolder);
- method public androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo setFrom(androidx.recyclerview.widget.RecyclerView.ViewHolder, @androidx.recyclerview.widget.RecyclerView.ItemAnimator.AdapterChanges int);
- field public int bottom;
- field @androidx.recyclerview.widget.RecyclerView.ItemAnimator.AdapterChanges public int changeFlags;
- field public int left;
- field public int right;
- field public int top;
- }
-
- public abstract static class RecyclerView.ItemDecoration {
- ctor public RecyclerView.ItemDecoration();
- method @Deprecated public void getItemOffsets(android.graphics.Rect, int, androidx.recyclerview.widget.RecyclerView);
- method public void getItemOffsets(android.graphics.Rect, android.view.View, androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.State);
- method public void onDraw(android.graphics.Canvas, androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.State);
- method @Deprecated public void onDraw(android.graphics.Canvas, androidx.recyclerview.widget.RecyclerView);
- method public void onDrawOver(android.graphics.Canvas, androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.State);
- method @Deprecated public void onDrawOver(android.graphics.Canvas, androidx.recyclerview.widget.RecyclerView);
- }
-
- public abstract static class RecyclerView.LayoutManager {
- ctor public RecyclerView.LayoutManager();
- method public void addDisappearingView(android.view.View!);
- method public void addDisappearingView(android.view.View!, int);
- method public void addView(android.view.View!);
- method public void addView(android.view.View!, int);
- method public void assertInLayoutOrScroll(String!);
- method public void assertNotInLayoutOrScroll(String!);
- method public void attachView(android.view.View, int, androidx.recyclerview.widget.RecyclerView.LayoutParams!);
- method public void attachView(android.view.View, int);
- method public void attachView(android.view.View);
- method public void calculateItemDecorationsForChild(android.view.View, android.graphics.Rect);
- method public boolean canScrollHorizontally();
- method public boolean canScrollVertically();
- method public boolean checkLayoutParams(androidx.recyclerview.widget.RecyclerView.LayoutParams!);
- method public static int chooseSize(int, int, int);
- method public void collectAdjacentPrefetchPositions(int, int, androidx.recyclerview.widget.RecyclerView.State!, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry!);
- method public void collectInitialPrefetchPositions(int, androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry!);
- method public int computeHorizontalScrollExtent(androidx.recyclerview.widget.RecyclerView.State);
- method public int computeHorizontalScrollOffset(androidx.recyclerview.widget.RecyclerView.State);
- method public int computeHorizontalScrollRange(androidx.recyclerview.widget.RecyclerView.State);
- method public int computeVerticalScrollExtent(androidx.recyclerview.widget.RecyclerView.State);
- method public int computeVerticalScrollOffset(androidx.recyclerview.widget.RecyclerView.State);
- method public int computeVerticalScrollRange(androidx.recyclerview.widget.RecyclerView.State);
- method public void detachAndScrapAttachedViews(androidx.recyclerview.widget.RecyclerView.Recycler);
- method public void detachAndScrapView(android.view.View, androidx.recyclerview.widget.RecyclerView.Recycler);
- method public void detachAndScrapViewAt(int, androidx.recyclerview.widget.RecyclerView.Recycler);
- method public void detachView(android.view.View);
- method public void detachViewAt(int);
- method public void endAnimation(android.view.View!);
- method public android.view.View? findContainingItemView(android.view.View);
- method public android.view.View? findViewByPosition(int);
- method public abstract androidx.recyclerview.widget.RecyclerView.LayoutParams! generateDefaultLayoutParams();
- method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateLayoutParams(android.view.ViewGroup.LayoutParams!);
- method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateLayoutParams(android.content.Context!, android.util.AttributeSet!);
- method public int getBaseline();
- method public int getBottomDecorationHeight(android.view.View);
- method public android.view.View? getChildAt(int);
- method public int getChildCount();
- method @Deprecated public static int getChildMeasureSpec(int, int, int, boolean);
- method public static int getChildMeasureSpec(int, int, int, int, boolean);
- method public boolean getClipToPadding();
- method public int getColumnCountForAccessibility(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
- method public int getDecoratedBottom(android.view.View);
- method public void getDecoratedBoundsWithMargins(android.view.View, android.graphics.Rect);
- method public int getDecoratedLeft(android.view.View);
- method public int getDecoratedMeasuredHeight(android.view.View);
- method public int getDecoratedMeasuredWidth(android.view.View);
- method public int getDecoratedRight(android.view.View);
- method public int getDecoratedTop(android.view.View);
- method public android.view.View? getFocusedChild();
- method @Px public int getHeight();
- method public int getHeightMode();
- method public int getItemCount();
- method public int getItemViewType(android.view.View);
- method public int getLayoutDirection();
- method public int getLeftDecorationWidth(android.view.View);
- method @Px public int getMinimumHeight();
- method @Px public int getMinimumWidth();
- method @Px public int getPaddingBottom();
- method @Px public int getPaddingEnd();
- method @Px public int getPaddingLeft();
- method @Px public int getPaddingRight();
- method @Px public int getPaddingStart();
- method @Px public int getPaddingTop();
- method public int getPosition(android.view.View);
- method public static androidx.recyclerview.widget.RecyclerView.LayoutManager.Properties! getProperties(android.content.Context, android.util.AttributeSet?, int, int);
- method public int getRightDecorationWidth(android.view.View);
- method public int getRowCountForAccessibility(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
- method public int getSelectionModeForAccessibility(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
- method public int getTopDecorationHeight(android.view.View);
- method public void getTransformedBoundingBox(android.view.View, boolean, android.graphics.Rect);
- method @Px public int getWidth();
- method public int getWidthMode();
- method public boolean hasFocus();
- method public void ignoreView(android.view.View);
- method public boolean isAttachedToWindow();
- method public boolean isAutoMeasureEnabled();
- method public boolean isFocused();
- method public final boolean isItemPrefetchEnabled();
- method public boolean isLayoutHierarchical(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
- method public boolean isMeasurementCacheEnabled();
- method public boolean isSmoothScrolling();
- method public boolean isViewPartiallyVisible(android.view.View, boolean, boolean);
- method public void layoutDecorated(android.view.View, int, int, int, int);
- method public void layoutDecoratedWithMargins(android.view.View, int, int, int, int);
- method public void measureChild(android.view.View, int, int);
- method public void measureChildWithMargins(android.view.View, int, int);
- method public void moveView(int, int);
- method public void offsetChildrenHorizontal(@Px int);
- method public void offsetChildrenVertical(@Px int);
- method public void onAdapterChanged(androidx.recyclerview.widget.RecyclerView.Adapter?, androidx.recyclerview.widget.RecyclerView.Adapter?);
- method public boolean onAddFocusables(androidx.recyclerview.widget.RecyclerView, java.util.ArrayList<android.view.View>, int, int);
- method @CallSuper public void onAttachedToWindow(androidx.recyclerview.widget.RecyclerView!);
- method @Deprecated public void onDetachedFromWindow(androidx.recyclerview.widget.RecyclerView!);
- method @CallSuper public void onDetachedFromWindow(androidx.recyclerview.widget.RecyclerView!, androidx.recyclerview.widget.RecyclerView.Recycler!);
- method public android.view.View? onFocusSearchFailed(android.view.View, int, androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State);
- method public void onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
- method public void onInitializeAccessibilityEvent(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, android.view.accessibility.AccessibilityEvent);
- method public void onInitializeAccessibilityNodeInfo(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, androidx.core.view.accessibility.AccessibilityNodeInfoCompat);
- method public void onInitializeAccessibilityNodeInfoForItem(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, android.view.View, androidx.core.view.accessibility.AccessibilityNodeInfoCompat);
- method public android.view.View? onInterceptFocusSearch(android.view.View, int);
- method public void onItemsAdded(androidx.recyclerview.widget.RecyclerView, int, int);
- method public void onItemsChanged(androidx.recyclerview.widget.RecyclerView);
- method public void onItemsMoved(androidx.recyclerview.widget.RecyclerView, int, int, int);
- method public void onItemsRemoved(androidx.recyclerview.widget.RecyclerView, int, int);
- method public void onItemsUpdated(androidx.recyclerview.widget.RecyclerView, int, int);
- method public void onItemsUpdated(androidx.recyclerview.widget.RecyclerView, int, int, Object?);
- method public void onLayoutChildren(androidx.recyclerview.widget.RecyclerView.Recycler!, androidx.recyclerview.widget.RecyclerView.State!);
- method public void onLayoutCompleted(androidx.recyclerview.widget.RecyclerView.State!);
- method public void onMeasure(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, int, int);
- method @Deprecated public boolean onRequestChildFocus(androidx.recyclerview.widget.RecyclerView, android.view.View, android.view.View?);
- method public boolean onRequestChildFocus(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.widget.RecyclerView.State, android.view.View, android.view.View?);
- method public void onRestoreInstanceState(android.os.Parcelable!);
- method public android.os.Parcelable? onSaveInstanceState();
- method public void onScrollStateChanged(int);
- method public boolean performAccessibilityAction(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, int, android.os.Bundle?);
- method public boolean performAccessibilityActionForItem(androidx.recyclerview.widget.RecyclerView.Recycler, androidx.recyclerview.widget.RecyclerView.State, android.view.View, int, android.os.Bundle?);
- method public void postOnAnimation(Runnable!);
- method public void removeAllViews();
- method public void removeAndRecycleAllViews(androidx.recyclerview.widget.RecyclerView.Recycler);
- method public void removeAndRecycleView(android.view.View, androidx.recyclerview.widget.RecyclerView.Recycler);
- method public void removeAndRecycleViewAt(int, androidx.recyclerview.widget.RecyclerView.Recycler);
- method public boolean removeCallbacks(Runnable!);
- method public void removeDetachedView(android.view.View);
- method public void removeView(android.view.View!);
- method public void removeViewAt(int);
- method public boolean requestChildRectangleOnScreen(androidx.recyclerview.widget.RecyclerView, android.view.View, android.graphics.Rect, boolean);
- method public boolean requestChildRectangleOnScreen(androidx.recyclerview.widget.RecyclerView, android.view.View, android.graphics.Rect, boolean, boolean);
- method public void requestLayout();
- method public void requestSimpleAnimationsInNextLayout();
- method public int scrollHorizontallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler!, androidx.recyclerview.widget.RecyclerView.State!);
- method public void scrollToPosition(int);
- method public int scrollVerticallyBy(int, androidx.recyclerview.widget.RecyclerView.Recycler!, androidx.recyclerview.widget.RecyclerView.State!);
- method @Deprecated public void setAutoMeasureEnabled(boolean);
- method public final void setItemPrefetchEnabled(boolean);
- method public void setMeasuredDimension(android.graphics.Rect!, int, int);
- method public void setMeasuredDimension(int, int);
- method public void setMeasurementCacheEnabled(boolean);
- method public void smoothScrollToPosition(androidx.recyclerview.widget.RecyclerView!, androidx.recyclerview.widget.RecyclerView.State!, int);
- method public void startSmoothScroll(androidx.recyclerview.widget.RecyclerView.SmoothScroller!);
- method public void stopIgnoringView(android.view.View);
- method public boolean supportsPredictiveItemAnimations();
- }
-
- public static interface RecyclerView.LayoutManager.LayoutPrefetchRegistry {
- method public void addPosition(int, int);
- }
-
- public static class RecyclerView.LayoutManager.Properties {
- ctor public RecyclerView.LayoutManager.Properties();
- field public int orientation;
- field public boolean reverseLayout;
- field public int spanCount;
- field public boolean stackFromEnd;
- }
-
- public static class RecyclerView.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
- ctor public RecyclerView.LayoutParams(android.content.Context!, android.util.AttributeSet!);
- ctor public RecyclerView.LayoutParams(int, int);
- ctor public RecyclerView.LayoutParams(android.view.ViewGroup.MarginLayoutParams!);
- ctor public RecyclerView.LayoutParams(android.view.ViewGroup.LayoutParams!);
- ctor public RecyclerView.LayoutParams(androidx.recyclerview.widget.RecyclerView.LayoutParams!);
- method public int getViewAdapterPosition();
- method public int getViewLayoutPosition();
- method @Deprecated public int getViewPosition();
- method public boolean isItemChanged();
- method public boolean isItemRemoved();
- method public boolean isViewInvalid();
- method public boolean viewNeedsUpdate();
- }
-
- public static interface RecyclerView.OnChildAttachStateChangeListener {
- method public void onChildViewAttachedToWindow(android.view.View);
- method public void onChildViewDetachedFromWindow(android.view.View);
- }
-
- public abstract static class RecyclerView.OnFlingListener {
- ctor public RecyclerView.OnFlingListener();
- method public abstract boolean onFling(int, int);
- }
-
- public static interface RecyclerView.OnItemTouchListener {
- method public boolean onInterceptTouchEvent(androidx.recyclerview.widget.RecyclerView, android.view.MotionEvent);
- method public void onRequestDisallowInterceptTouchEvent(boolean);
- method public void onTouchEvent(androidx.recyclerview.widget.RecyclerView, android.view.MotionEvent);
- }
-
- public abstract static class RecyclerView.OnScrollListener {
- ctor public RecyclerView.OnScrollListener();
- method public void onScrollStateChanged(androidx.recyclerview.widget.RecyclerView, int);
- method public void onScrolled(androidx.recyclerview.widget.RecyclerView, int, int);
- }
-
- public static class RecyclerView.RecycledViewPool {
- ctor public RecyclerView.RecycledViewPool();
- method public void clear();
- method public androidx.recyclerview.widget.RecyclerView.ViewHolder? getRecycledView(int);
- method public int getRecycledViewCount(int);
- method public void putRecycledView(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public void setMaxRecycledViews(int, int);
- }
-
- public final class RecyclerView.Recycler {
- ctor public RecyclerView.Recycler();
- method public void bindViewToPosition(android.view.View, int);
- method public void clear();
- method public int convertPreLayoutPositionToPostLayout(int);
- method public java.util.List<androidx.recyclerview.widget.RecyclerView.ViewHolder> getScrapList();
- method public android.view.View getViewForPosition(int);
- method public void recycleView(android.view.View);
- method public void setViewCacheSize(int);
- }
-
- public static interface RecyclerView.RecyclerListener {
- method public void onViewRecycled(androidx.recyclerview.widget.RecyclerView.ViewHolder);
- }
-
- public static class RecyclerView.SimpleOnItemTouchListener implements androidx.recyclerview.widget.RecyclerView.OnItemTouchListener {
- ctor public RecyclerView.SimpleOnItemTouchListener();
- method public boolean onInterceptTouchEvent(androidx.recyclerview.widget.RecyclerView, android.view.MotionEvent);
- method public void onRequestDisallowInterceptTouchEvent(boolean);
- method public void onTouchEvent(androidx.recyclerview.widget.RecyclerView, android.view.MotionEvent);
- }
-
- public abstract static class RecyclerView.SmoothScroller {
- ctor public RecyclerView.SmoothScroller();
- method public android.graphics.PointF? computeScrollVectorForPosition(int);
- method public android.view.View! findViewByPosition(int);
- method public int getChildCount();
- method public int getChildPosition(android.view.View!);
- method public androidx.recyclerview.widget.RecyclerView.LayoutManager? getLayoutManager();
- method public int getTargetPosition();
- method @Deprecated public void instantScrollToPosition(int);
- method public boolean isPendingInitialRun();
- method public boolean isRunning();
- method protected void normalize(android.graphics.PointF);
- method protected void onChildAttachedToWindow(android.view.View!);
- method protected abstract void onSeekTargetStep(@Px int, @Px int, androidx.recyclerview.widget.RecyclerView.State, androidx.recyclerview.widget.RecyclerView.SmoothScroller.Action);
- method protected abstract void onStart();
- method protected abstract void onStop();
- method protected abstract void onTargetFound(android.view.View, androidx.recyclerview.widget.RecyclerView.State, androidx.recyclerview.widget.RecyclerView.SmoothScroller.Action);
- method public void setTargetPosition(int);
- method protected final void stop();
- }
-
- public static class RecyclerView.SmoothScroller.Action {
- ctor public RecyclerView.SmoothScroller.Action(@Px int, @Px int);
- ctor public RecyclerView.SmoothScroller.Action(@Px int, @Px int, int);
- ctor public RecyclerView.SmoothScroller.Action(@Px int, @Px int, int, android.view.animation.Interpolator?);
- method public int getDuration();
- method @Px public int getDx();
- method @Px public int getDy();
- method public android.view.animation.Interpolator? getInterpolator();
- method public void jumpTo(int);
- method public void setDuration(int);
- method public void setDx(@Px int);
- method public void setDy(@Px int);
- method public void setInterpolator(android.view.animation.Interpolator?);
- method public void update(@Px int, @Px int, int, android.view.animation.Interpolator?);
- field public static final int UNDEFINED_DURATION = -2147483648; // 0x80000000
- }
-
- public static interface RecyclerView.SmoothScroller.ScrollVectorProvider {
- method public android.graphics.PointF? computeScrollVectorForPosition(int);
- }
-
- public static class RecyclerView.State {
- ctor public RecyclerView.State();
- method public boolean didStructureChange();
- method public <T> T! get(int);
- method public int getItemCount();
- method public int getRemainingScrollHorizontal();
- method public int getRemainingScrollVertical();
- method public int getTargetScrollPosition();
- method public boolean hasTargetScrollPosition();
- method public boolean isMeasuring();
- method public boolean isPreLayout();
- method public void put(int, Object!);
- method public void remove(int);
- method public boolean willRunPredictiveAnimations();
- method public boolean willRunSimpleAnimations();
- }
-
- public abstract static class RecyclerView.ViewCacheExtension {
- ctor public RecyclerView.ViewCacheExtension();
- method public abstract android.view.View? getViewForPositionAndType(androidx.recyclerview.widget.RecyclerView.Recycler, int, int);
- }
-
- public abstract static class RecyclerView.ViewHolder {
- ctor public RecyclerView.ViewHolder(android.view.View);
- method public final int getAdapterPosition();
- method public final long getItemId();
- method public final int getItemViewType();
- method public final int getLayoutPosition();
- method public final int getOldPosition();
- method @Deprecated public final int getPosition();
- method public final boolean isRecyclable();
- method public final void setIsRecyclable(boolean);
- field public final android.view.View itemView;
- }
-
- public class RecyclerViewAccessibilityDelegate extends androidx.core.view.AccessibilityDelegateCompat {
- ctor public RecyclerViewAccessibilityDelegate(androidx.recyclerview.widget.RecyclerView);
- method public androidx.core.view.AccessibilityDelegateCompat getItemDelegate();
- }
-
- public static class RecyclerViewAccessibilityDelegate.ItemDelegate extends androidx.core.view.AccessibilityDelegateCompat {
- ctor public RecyclerViewAccessibilityDelegate.ItemDelegate(androidx.recyclerview.widget.RecyclerViewAccessibilityDelegate);
- }
-
- public abstract class SimpleItemAnimator extends androidx.recyclerview.widget.RecyclerView.ItemAnimator {
- ctor public SimpleItemAnimator();
- method public abstract boolean animateAdd(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public boolean animateAppearance(androidx.recyclerview.widget.RecyclerView.ViewHolder, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo?, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo);
- method public boolean animateChange(androidx.recyclerview.widget.RecyclerView.ViewHolder, androidx.recyclerview.widget.RecyclerView.ViewHolder, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo);
- method public abstract boolean animateChange(androidx.recyclerview.widget.RecyclerView.ViewHolder!, androidx.recyclerview.widget.RecyclerView.ViewHolder!, int, int, int, int);
- method public boolean animateDisappearance(androidx.recyclerview.widget.RecyclerView.ViewHolder, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo?);
- method public abstract boolean animateMove(androidx.recyclerview.widget.RecyclerView.ViewHolder!, int, int, int, int);
- method public boolean animatePersistence(androidx.recyclerview.widget.RecyclerView.ViewHolder, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo, androidx.recyclerview.widget.RecyclerView.ItemAnimator.ItemHolderInfo);
- method public abstract boolean animateRemove(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public final void dispatchAddFinished(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public final void dispatchAddStarting(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public final void dispatchChangeFinished(androidx.recyclerview.widget.RecyclerView.ViewHolder!, boolean);
- method public final void dispatchChangeStarting(androidx.recyclerview.widget.RecyclerView.ViewHolder!, boolean);
- method public final void dispatchMoveFinished(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public final void dispatchMoveStarting(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public final void dispatchRemoveFinished(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public final void dispatchRemoveStarting(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public boolean getSupportsChangeAnimations();
- method public void onAddFinished(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public void onAddStarting(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public void onChangeFinished(androidx.recyclerview.widget.RecyclerView.ViewHolder!, boolean);
- method public void onChangeStarting(androidx.recyclerview.widget.RecyclerView.ViewHolder!, boolean);
- method public void onMoveFinished(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public void onMoveStarting(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public void onRemoveFinished(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public void onRemoveStarting(androidx.recyclerview.widget.RecyclerView.ViewHolder!);
- method public void setSupportsChangeAnimations(boolean);
- }
-
- public abstract class SnapHelper extends androidx.recyclerview.widget.RecyclerView.OnFlingListener {
- ctor public SnapHelper();
- method public void attachToRecyclerView(androidx.recyclerview.widget.RecyclerView?) throws java.lang.IllegalStateException;
- method public abstract int[]? calculateDistanceToFinalSnap(androidx.recyclerview.widget.RecyclerView.LayoutManager, android.view.View);
- method public int[]! calculateScrollDistance(int, int);
- method protected androidx.recyclerview.widget.RecyclerView.SmoothScroller? createScroller(androidx.recyclerview.widget.RecyclerView.LayoutManager!);
- method @Deprecated protected androidx.recyclerview.widget.LinearSmoothScroller? createSnapScroller(androidx.recyclerview.widget.RecyclerView.LayoutManager!);
- method public abstract android.view.View? findSnapView(androidx.recyclerview.widget.RecyclerView.LayoutManager!);
- method public abstract int findTargetSnapPosition(androidx.recyclerview.widget.RecyclerView.LayoutManager!, int, int);
- method public boolean onFling(int, int);
- }
-
- public class SortedList<T> {
- ctor public SortedList(Class<T>, androidx.recyclerview.widget.SortedList.Callback<T>);
- ctor public SortedList(Class<T>, androidx.recyclerview.widget.SortedList.Callback<T>, int);
- method public int add(T!);
- method public void addAll(T[], boolean);
- method public void addAll(T...);
- method public void addAll(java.util.Collection<T>);
- method public void beginBatchedUpdates();
- method public void clear();
- method public void endBatchedUpdates();
- method public T! get(int) throws java.lang.IndexOutOfBoundsException;
- method public int indexOf(T!);
- method public void recalculatePositionOfItemAt(int);
- method public boolean remove(T!);
- method public T! removeItemAt(int);
- method public void replaceAll(T[], boolean);
- method public void replaceAll(T...);
- method public void replaceAll(java.util.Collection<T>);
- method public int size();
- method public void updateItemAt(int, T!);
- field public static final int INVALID_POSITION = -1; // 0xffffffff
- }
-
- public static class SortedList.BatchedCallback<T2> extends androidx.recyclerview.widget.SortedList.Callback<T2> {
- ctor public SortedList.BatchedCallback(androidx.recyclerview.widget.SortedList.Callback<T2>!);
- method public boolean areContentsTheSame(T2!, T2!);
- method public boolean areItemsTheSame(T2!, T2!);
- method public int compare(T2!, T2!);
- method public void dispatchLastEvent();
- method public void onChanged(int, int);
- method public void onInserted(int, int);
- method public void onMoved(int, int);
- method public void onRemoved(int, int);
- }
-
- public abstract static class SortedList.Callback<T2> implements java.util.Comparator<T2> androidx.recyclerview.widget.ListUpdateCallback {
- ctor public SortedList.Callback();
- method public abstract boolean areContentsTheSame(T2!, T2!);
- method public abstract boolean areItemsTheSame(T2!, T2!);
- method public abstract int compare(T2!, T2!);
- method public Object? getChangePayload(T2!, T2!);
- method public abstract void onChanged(int, int);
- method public void onChanged(int, int, Object!);
- }
-
- public abstract class SortedListAdapterCallback<T2> extends androidx.recyclerview.widget.SortedList.Callback<T2> {
- ctor public SortedListAdapterCallback(androidx.recyclerview.widget.RecyclerView.Adapter!);
- method public void onChanged(int, int);
- method public void onInserted(int, int);
- method public void onMoved(int, int);
- method public void onRemoved(int, int);
- }
-
- public class StaggeredGridLayoutManager extends androidx.recyclerview.widget.RecyclerView.LayoutManager implements androidx.recyclerview.widget.RecyclerView.SmoothScroller.ScrollVectorProvider {
- ctor public StaggeredGridLayoutManager(android.content.Context!, android.util.AttributeSet!, int, int);
- ctor public StaggeredGridLayoutManager(int, int);
- method public android.graphics.PointF! computeScrollVectorForPosition(int);
- method public int[]! findFirstCompletelyVisibleItemPositions(int[]!);
- method public int[]! findFirstVisibleItemPositions(int[]!);
- method public int[]! findLastCompletelyVisibleItemPositions(int[]!);
- method public int[]! findLastVisibleItemPositions(int[]!);
- method public androidx.recyclerview.widget.RecyclerView.LayoutParams! generateDefaultLayoutParams();
- method public int getGapStrategy();
- method public int getOrientation();
- method public boolean getReverseLayout();
- method public int getSpanCount();
- method public void invalidateSpanAssignments();
- method public void scrollToPositionWithOffset(int, int);
- method public void setGapStrategy(int);
- method public void setOrientation(int);
- method public void setReverseLayout(boolean);
- method public void setSpanCount(int);
- field @Deprecated public static final int GAP_HANDLING_LAZY = 1; // 0x1
- field public static final int GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS = 2; // 0x2
- field public static final int GAP_HANDLING_NONE = 0; // 0x0
- field public static final int HORIZONTAL = 0; // 0x0
- field public static final int VERTICAL = 1; // 0x1
- }
-
- public static class StaggeredGridLayoutManager.LayoutParams extends androidx.recyclerview.widget.RecyclerView.LayoutParams {
- ctor public StaggeredGridLayoutManager.LayoutParams(android.content.Context!, android.util.AttributeSet!);
- ctor public StaggeredGridLayoutManager.LayoutParams(int, int);
- ctor public StaggeredGridLayoutManager.LayoutParams(android.view.ViewGroup.MarginLayoutParams!);
- ctor public StaggeredGridLayoutManager.LayoutParams(android.view.ViewGroup.LayoutParams!);
- ctor public StaggeredGridLayoutManager.LayoutParams(androidx.recyclerview.widget.RecyclerView.LayoutParams!);
- method public final int getSpanIndex();
- method public boolean isFullSpan();
- method public void setFullSpan(boolean);
- field public static final int INVALID_SPAN_ID = -1; // 0xffffffff
- }
-
-}
-
diff --git a/recyclerview/recyclerview/api/current.txt b/recyclerview/recyclerview/api/current.txt
index 5d61aaf..2102a29 100644
--- a/recyclerview/recyclerview/api/current.txt
+++ b/recyclerview/recyclerview/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.recyclerview.widget {
public final class AdapterListUpdateCallback implements androidx.recyclerview.widget.ListUpdateCallback {
@@ -250,7 +250,7 @@
method public boolean getStackFromEnd();
method protected boolean isLayoutRTL();
method public boolean isSmoothScrollbarEnabled();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void prepareForDrop(android.view.View, android.view.View, int, int);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void prepareForDrop(android.view.View, android.view.View, int, int);
method public void scrollToPositionWithOffset(int, int);
method public void setInitialPrefetchItemCount(int);
method public void setOrientation(int);
diff --git a/recyclerview/recyclerview/api/res-1.1.0-alpha03.txt b/recyclerview/recyclerview/api/res-1.1.0-alpha03.txt
deleted file mode 100644
index 475bfc43..0000000
--- a/recyclerview/recyclerview/api/res-1.1.0-alpha03.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-attr fastScrollEnabled
-attr fastScrollHorizontalThumbDrawable
-attr fastScrollHorizontalTrackDrawable
-attr fastScrollVerticalThumbDrawable
-attr fastScrollVerticalTrackDrawable
-attr layoutManager
-attr reverseLayout
-attr spanCount
-attr stackFromEnd
diff --git a/recyclerview/recyclerview/api/restricted_1.0.0.txt b/recyclerview/recyclerview/api/restricted_1.0.0.txt
deleted file mode 100644
index eeda96c..0000000
--- a/recyclerview/recyclerview/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-// Signature format: 3.0
-package androidx.recyclerview.widget {
-
- public final class AsyncDifferConfig<T> {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public java.util.concurrent.Executor getMainThreadExecutor();
- }
-
- public static final class AsyncDifferConfig.Builder<T> {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.recyclerview.widget.AsyncDifferConfig.Builder<T> setMainThreadExecutor(java.util.concurrent.Executor!);
- }
-
- public class LinearLayoutManager extends androidx.recyclerview.widget.RecyclerView.LayoutManager implements androidx.recyclerview.widget.ItemTouchHelper.ViewDropHandler androidx.recyclerview.widget.RecyclerView.SmoothScroller.ScrollVectorProvider {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void prepareForDrop(android.view.View, android.view.View, int, int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class LinearLayoutManager.SavedState {
- ctor public LinearLayoutManager.SavedState();
- ctor public LinearLayoutManager.SavedState(androidx.recyclerview.widget.LinearLayoutManager.SavedState!);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<androidx.recyclerview.widget.LinearLayoutManager.SavedState>! CREATOR;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface RecyclerView.Orientation {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class RecyclerView.SavedState {
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<androidx.recyclerview.widget.RecyclerView.SavedState>! CREATOR;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class StaggeredGridLayoutManager.SavedState {
- ctor public StaggeredGridLayoutManager.SavedState();
- ctor public StaggeredGridLayoutManager.SavedState(androidx.recyclerview.widget.StaggeredGridLayoutManager.SavedState!);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<androidx.recyclerview.widget.StaggeredGridLayoutManager.SavedState>! CREATOR;
- }
-
-}
-
diff --git a/recyclerview/recyclerview/api/restricted_1.1.0-alpha03.ignore b/recyclerview/recyclerview/api/restricted_1.1.0-alpha03.ignore
deleted file mode 100644
index 7be19d9..0000000
--- a/recyclerview/recyclerview/api/restricted_1.1.0-alpha03.ignore
+++ /dev/null
@@ -1,5 +0,0 @@
-// Baseline format: 1.0
-InvalidNullConversion: androidx.recyclerview.widget.AsyncDifferConfig#getMainThreadExecutor():
- Attempted to change method return from @NonNull to @Nullable: incompatible change for method androidx.recyclerview.widget.AsyncDifferConfig.getMainThreadExecutor()
-
-
diff --git a/recyclerview/recyclerview/api/restricted_1.1.0-alpha03.txt b/recyclerview/recyclerview/api/restricted_1.1.0-alpha03.txt
deleted file mode 100644
index c379bc1..0000000
--- a/recyclerview/recyclerview/api/restricted_1.1.0-alpha03.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-// Signature format: 3.0
-package androidx.recyclerview.widget {
-
- public final class AsyncDifferConfig<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public java.util.concurrent.Executor? getMainThreadExecutor();
- }
-
- public static final class AsyncDifferConfig.Builder<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.recyclerview.widget.AsyncDifferConfig.Builder<T> setMainThreadExecutor(java.util.concurrent.Executor!);
- }
-
- public class LinearLayoutManager extends androidx.recyclerview.widget.RecyclerView.LayoutManager implements androidx.recyclerview.widget.ItemTouchHelper.ViewDropHandler androidx.recyclerview.widget.RecyclerView.SmoothScroller.ScrollVectorProvider {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void prepareForDrop(android.view.View, android.view.View, int, int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class LinearLayoutManager.SavedState implements android.os.Parcelable {
- ctor public LinearLayoutManager.SavedState();
- ctor public LinearLayoutManager.SavedState(androidx.recyclerview.widget.LinearLayoutManager.SavedState!);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<androidx.recyclerview.widget.LinearLayoutManager.SavedState>! CREATOR;
- }
-
- @IntDef({androidx.recyclerview.widget.RecyclerView.HORIZONTAL, androidx.recyclerview.widget.RecyclerView.VERTICAL}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface RecyclerView.Orientation {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class RecyclerView.SavedState extends androidx.customview.view.AbsSavedState {
- field public static final android.os.Parcelable.Creator<androidx.recyclerview.widget.RecyclerView.SavedState>! CREATOR;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class StaggeredGridLayoutManager.SavedState implements android.os.Parcelable {
- ctor public StaggeredGridLayoutManager.SavedState();
- ctor public StaggeredGridLayoutManager.SavedState(androidx.recyclerview.widget.StaggeredGridLayoutManager.SavedState!);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<androidx.recyclerview.widget.StaggeredGridLayoutManager.SavedState>! CREATOR;
- }
-
-}
-
diff --git a/recyclerview/recyclerview/api/restricted_current.txt b/recyclerview/recyclerview/api/restricted_current.txt
deleted file mode 100644
index c379bc1..0000000
--- a/recyclerview/recyclerview/api/restricted_current.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-// Signature format: 3.0
-package androidx.recyclerview.widget {
-
- public final class AsyncDifferConfig<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public java.util.concurrent.Executor? getMainThreadExecutor();
- }
-
- public static final class AsyncDifferConfig.Builder<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.recyclerview.widget.AsyncDifferConfig.Builder<T> setMainThreadExecutor(java.util.concurrent.Executor!);
- }
-
- public class LinearLayoutManager extends androidx.recyclerview.widget.RecyclerView.LayoutManager implements androidx.recyclerview.widget.ItemTouchHelper.ViewDropHandler androidx.recyclerview.widget.RecyclerView.SmoothScroller.ScrollVectorProvider {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void prepareForDrop(android.view.View, android.view.View, int, int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class LinearLayoutManager.SavedState implements android.os.Parcelable {
- ctor public LinearLayoutManager.SavedState();
- ctor public LinearLayoutManager.SavedState(androidx.recyclerview.widget.LinearLayoutManager.SavedState!);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<androidx.recyclerview.widget.LinearLayoutManager.SavedState>! CREATOR;
- }
-
- @IntDef({androidx.recyclerview.widget.RecyclerView.HORIZONTAL, androidx.recyclerview.widget.RecyclerView.VERTICAL}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface RecyclerView.Orientation {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class RecyclerView.SavedState extends androidx.customview.view.AbsSavedState {
- field public static final android.os.Parcelable.Creator<androidx.recyclerview.widget.RecyclerView.SavedState>! CREATOR;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class StaggeredGridLayoutManager.SavedState implements android.os.Parcelable {
- ctor public StaggeredGridLayoutManager.SavedState();
- ctor public StaggeredGridLayoutManager.SavedState(androidx.recyclerview.widget.StaggeredGridLayoutManager.SavedState!);
- method public int describeContents();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<androidx.recyclerview.widget.StaggeredGridLayoutManager.SavedState>! CREATOR;
- }
-
-}
-
diff --git a/recyclerview/recyclerview/build.gradle b/recyclerview/recyclerview/build.gradle
index 7747ae8..d05c856 100644
--- a/recyclerview/recyclerview/build.gradle
+++ b/recyclerview/recyclerview/build.gradle
@@ -8,9 +8,8 @@
}
dependencies {
- api(project(":annotation"))
+ api("androidx.annotation:annotation:1.0.0")
api(project(":core"))
- implementation("androidx.collection:collection:1.0.0")
api("androidx.customview:customview:1.0.0")
androidTestImplementation(TEST_EXT_JUNIT)
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/test/RecyclerViewTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/test/RecyclerViewTest.java
index 511b8d2..3c4f715 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/test/RecyclerViewTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/test/RecyclerViewTest.java
@@ -32,7 +32,7 @@
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
@@ -40,7 +40,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class RecyclerViewTest {
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerBaseConfigSetTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerBaseConfigSetTest.java
index c94445f..38c1bec 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerBaseConfigSetTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerBaseConfigSetTest.java
@@ -23,7 +23,7 @@
import android.util.Log;
import android.view.View;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,7 +33,7 @@
import java.util.BitSet;
import java.util.List;
-@SmallTest
+@MediumTest
@RunWith(Parameterized.class)
public class GridLayoutManagerBaseConfigSetTest extends BaseGridLayoutManagerTest {
@Parameterized.Parameters(name = "{0}")
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerCachedBordersTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerCachedBordersTest.java
index 4955f9e..2b99138 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerCachedBordersTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerCachedBordersTest.java
@@ -23,7 +23,7 @@
import android.view.View;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +32,7 @@
import java.util.ArrayList;
import java.util.List;
-@SmallTest
+@MediumTest
@RunWith(Parameterized.class)
public class GridLayoutManagerCachedBordersTest extends BaseGridLayoutManagerTest {
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerCustomSizeInScrollDirectionTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerCustomSizeInScrollDirectionTest.java
index 309f2a5..0f9078c 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerCustomSizeInScrollDirectionTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerCustomSizeInScrollDirectionTest.java
@@ -26,7 +26,7 @@
import android.view.ViewGroup;
import androidx.annotation.NonNull;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -35,7 +35,7 @@
import java.util.ArrayList;
import java.util.List;
-@SmallTest
+@MediumTest
@RunWith(Parameterized.class)
public class GridLayoutManagerCustomSizeInScrollDirectionTest extends BaseGridLayoutManagerTest {
@Parameterized.Parameters(name = "addDecorOffsets:{1},addMargins:{2},config:{0}")
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerNoOpUpdateTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerNoOpUpdateTest.java
index ec016da..235bd8e 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerNoOpUpdateTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerNoOpUpdateTest.java
@@ -22,7 +22,7 @@
import android.graphics.Rect;
import android.view.View;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -36,7 +36,7 @@
/**
* Tests dispatching no-op updates to the GLM and ensures it re-lays out items in the same location
*/
-@SmallTest
+@MediumTest
@RunWith(Parameterized.class)
public class GridLayoutManagerNoOpUpdateTest extends BaseGridLayoutManagerTest {
@Parameterized.Parameters(name = "conf:{0},rtl={1}")
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerRtlTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerRtlTest.java
index 04f6a4f..dd44a55 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerRtlTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerRtlTest.java
@@ -27,7 +27,7 @@
import android.view.ViewGroup;
import androidx.annotation.NonNull;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -36,7 +36,7 @@
import java.util.ArrayList;
import java.util.List;
-@SmallTest
+@MediumTest
@RunWith(Parameterized.class)
public class GridLayoutManagerRtlTest extends BaseGridLayoutManagerTest {
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerWrapContentTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerWrapContentTest.java
index e7bb9db..9fa1acc 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerWrapContentTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/GridLayoutManagerWrapContentTest.java
@@ -27,8 +27,8 @@
import android.view.Gravity;
import android.view.View;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
-import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -37,7 +37,7 @@
import java.util.Arrays;
import java.util.List;
-@SmallTest
+@MediumTest
@RunWith(Parameterized.class)
public class GridLayoutManagerWrapContentTest extends BaseWrapContentTest {
private boolean mHorizontal = false;
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/ItemAnimatorV2ApiTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/ItemAnimatorV2ApiTest.java
index 5c165c7..aa4fc36 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/ItemAnimatorV2ApiTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/ItemAnimatorV2ApiTest.java
@@ -32,7 +32,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.hamcrest.CoreMatchers;
import org.junit.Test;
@@ -47,7 +47,7 @@
/**
* Includes tests for the new RecyclerView animations API (v2).
*/
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class ItemAnimatorV2ApiTest extends BaseRecyclerViewAnimationsTest {
@Override
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearLayoutManagerCacheTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearLayoutManagerCacheTest.java
index d402b5d..f725157 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearLayoutManagerCacheTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearLayoutManagerCacheTest.java
@@ -23,8 +23,8 @@
import android.os.Build;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
-import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -66,7 +66,7 @@
return mRecyclerView.mRecycler.mCachedViews;
}
- @SmallTest
+ @MediumTest
@Test
public void cacheAndPrefetch() throws Throwable {
final Config config = (Config) mConfig.clone();
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearLayoutManagerResizeTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearLayoutManagerResizeTest.java
index 2f7f56b..e8dd49c 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearLayoutManagerResizeTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearLayoutManagerResizeTest.java
@@ -22,7 +22,7 @@
import android.widget.FrameLayout;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -50,7 +50,7 @@
return configs;
}
- @SmallTest
+ @MediumTest
@Test
public void resize() throws Throwable {
final Config config = (Config) mConfig.clone();
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearLayoutManagerWrapContentWithAspectRatioTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearLayoutManagerWrapContentWithAspectRatioTest.java
index 1ed7602..39a488b 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearLayoutManagerWrapContentWithAspectRatioTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearLayoutManagerWrapContentWithAspectRatioTest.java
@@ -28,7 +28,7 @@
import android.view.View;
import android.view.ViewGroup;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.hamcrest.CoreMatchers;
import org.junit.Test;
@@ -39,7 +39,7 @@
import java.util.List;
@RunWith(Parameterized.class)
-@SmallTest
+@MediumTest
public class LinearLayoutManagerWrapContentWithAspectRatioTest
extends BaseWrapContentWithAspectRatioTest {
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearSmoothScrollerTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearSmoothScrollerTest.java
deleted file mode 100644
index a7a70a3..0000000
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/LinearSmoothScrollerTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2019 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.recyclerview.widget;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import android.util.DisplayMetrics;
-
-import androidx.test.core.app.ApplicationProvider;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class LinearSmoothScrollerTest {
-
- @Test
- public void constructor_doesNotInvokeCalculateSpeedPerPixel() {
- // As this method can be overridden by users of LinearSmoothScroller, it should
- // not be invoked and cached in the constructor. Otherwise it might be called when
- // the object is in a semi-initialized state.
- final AtomicBoolean methodCalled = new AtomicBoolean(false);
-
- LinearSmoothScroller scroller = new LinearSmoothScroller(
- ApplicationProvider.getApplicationContext()) {
-
- @Override
- protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {
- methodCalled.set(true);
- return super.calculateSpeedPerPixel(displayMetrics);
- }
- };
-
- assertThat(methodCalled.get(), is(false));
- }
-
- @Test
- public void calculateTimeForScrolling_cachesResultOfCalculateSpeedPerPixel() {
- final AtomicInteger methodCalls = new AtomicInteger(0);
- LinearSmoothScroller scroller = new LinearSmoothScroller(
- ApplicationProvider.getApplicationContext()) {
-
- @Override
- protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {
- methodCalls.getAndIncrement();
- return super.calculateSpeedPerPixel(displayMetrics);
- }
-
- // This method is protected by default. Make it public for test purposes.
- @Override
- public int calculateTimeForScrolling(int dx) {
- return super.calculateTimeForScrolling(dx);
- }
- };
-
- scroller.calculateTimeForScrolling(/*dx=*/ 10);
- scroller.calculateTimeForScrolling(/*dx=*/ 100);
- scroller.calculateTimeForScrolling(/*dx=*/ 1000);
-
- assertThat(methodCalls.get(), is(1));
- }
-}
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewAccessibilityTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewAccessibilityTest.java
index c8fa6d4..706b3b2 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewAccessibilityTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewAccessibilityTest.java
@@ -27,7 +27,7 @@
import androidx.core.view.AccessibilityDelegateCompat;
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -37,7 +37,7 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
-@SmallTest
+@MediumTest
@RunWith(Parameterized.class)
public class RecyclerViewAccessibilityTest extends BaseRecyclerViewInstrumentationTest {
private static final boolean SUPPORTS_COLLECTION_INFO =
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewCacheTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewCacheTest.java
index 29280e0..bd103c4 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewCacheTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewCacheTest.java
@@ -46,8 +46,8 @@
import androidx.annotation.NonNull;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -61,7 +61,7 @@
import java.util.List;
import java.util.concurrent.TimeUnit;
-@MediumTest
+@SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP)
@RunWith(AndroidJUnit4.class)
public class RecyclerViewCacheTest {
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewNestedScrollingChildTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewNestedScrollingChildTest.java
index dc0b6e4..8df709e 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewNestedScrollingChildTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewNestedScrollingChildTest.java
@@ -43,7 +43,7 @@
import androidx.core.view.ViewCompat;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.testutils.Direction;
import androidx.testutils.FlingData;
import androidx.testutils.MotionEventData;
@@ -63,7 +63,7 @@
* version of the nested scroll parents correctly.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class RecyclerViewNestedScrollingChildTest {
private NestedScrollingSpyView mParentSpy;
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewOnItemTouchListenerTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewOnItemTouchListenerTest.java
index fd8c464..c4edbf5 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewOnItemTouchListenerTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewOnItemTouchListenerTest.java
@@ -31,7 +31,7 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -39,7 +39,7 @@
import org.mockito.InOrder;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class RecyclerViewOnItemTouchListenerTest {
private FrameLayout mParent;
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewPrefetchTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewPrefetchTest.java
index bfea3484..cb8fc0ff 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewPrefetchTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewPrefetchTest.java
@@ -22,8 +22,8 @@
import android.os.Build;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,7 +32,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-@LargeTest
+@SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP)
@RunWith(AndroidJUnit4.class)
public class RecyclerViewPrefetchTest extends BaseRecyclerViewInstrumentationTest {
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewSmoothScrollerTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewSmoothScrollerTest.java
index aa5dc6c..ea6a3cb 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewSmoothScrollerTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/RecyclerViewSmoothScrollerTest.java
@@ -27,13 +27,13 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class RecyclerViewSmoothScrollerTest {
@Test
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/ScrollToPositionWithAutoMeasure.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/ScrollToPositionWithAutoMeasure.java
index 8558167..0953f24 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/ScrollToPositionWithAutoMeasure.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/ScrollToPositionWithAutoMeasure.java
@@ -28,7 +28,7 @@
import android.view.View;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -37,7 +37,7 @@
* Tests scroll to position with wrap content to make sure that LayoutManagers can keep track of
* the position if layout is called multiple times.
*/
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class ScrollToPositionWithAutoMeasure extends BaseRecyclerViewInstrumentationTest {
@Test
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/StaggeredGridLayoutManagerWrapContentTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/StaggeredGridLayoutManagerWrapContentTest.java
index 80b3fff..fae39e9 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/StaggeredGridLayoutManagerWrapContentTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/StaggeredGridLayoutManagerWrapContentTest.java
@@ -26,8 +26,8 @@
import android.view.Gravity;
import android.view.View;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
-import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -36,7 +36,7 @@
import java.util.Arrays;
import java.util.List;
-@SmallTest
+@MediumTest
@RunWith(Parameterized.class)
public class StaggeredGridLayoutManagerWrapContentTest extends BaseWrapContentTest {
int mOrientation = StaggeredGridLayoutManager.VERTICAL;
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/TestResizingRelayoutWithAutoMeasure.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/TestResizingRelayoutWithAutoMeasure.java
index 61ef122..6256698 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/TestResizingRelayoutWithAutoMeasure.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/TestResizingRelayoutWithAutoMeasure.java
@@ -30,7 +30,7 @@
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -45,7 +45,7 @@
* Tests whether the layout manager can keep its children positions properly after it is re-laid
* out with larger/smaller intermediate size but the same final size.
*/
-@SmallTest
+@MediumTest
@RunWith(Parameterized.class)
public class TestResizingRelayoutWithAutoMeasure extends BaseRecyclerViewInstrumentationTest {
private final int mRvWidth;
diff --git a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/WrapContentBasicTest.java b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/WrapContentBasicTest.java
index 580ebf0..332a3dd 100644
--- a/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/WrapContentBasicTest.java
+++ b/recyclerview/recyclerview/src/androidTest/java/androidx/recyclerview/widget/WrapContentBasicTest.java
@@ -28,13 +28,13 @@
import androidx.annotation.NonNull;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class WrapContentBasicTest {
private Context mContext;
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/AsyncDifferConfig.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/AsyncDifferConfig.java
index 86956e2..dbd9ee6 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/AsyncDifferConfig.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/AsyncDifferConfig.java
@@ -52,7 +52,7 @@
/** @hide */
@SuppressWarnings("WeakerAccess")
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Nullable
public Executor getMainThreadExecutor() {
return mMainThreadExecutor;
@@ -96,7 +96,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@NonNull
public Builder<T> setMainThreadExecutor(Executor executor) {
mMainThreadExecutor = executor;
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearLayoutManager.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearLayoutManager.java
index 0e5bda8..b76c636 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearLayoutManager.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearLayoutManager.java
@@ -16,7 +16,7 @@
package androidx.recyclerview.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -2085,7 +2085,7 @@
/**
* @hide This method should be called by ItemTouchHelper only.
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void prepareForDrop(@NonNull View view, @NonNull View target, int x, int y) {
assertNotInLayoutOrScroll("Cannot drop a view during a scroll or layout calculation");
@@ -2304,7 +2304,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@SuppressLint("BanParcelableUsage")
public static class SavedState implements Parcelable {
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearSmoothScroller.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearSmoothScroller.java
index 37bb647..095098a 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearSmoothScroller.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/LinearSmoothScroller.java
@@ -82,16 +82,14 @@
protected PointF mTargetVector;
- private final DisplayMetrics mDisplayMetrics;
- private boolean mHasCalculatedMillisPerPixel = false;
- private float mMillisPerPixel;
+ private final float MILLISECONDS_PER_PX;
// Temporary variables to keep track of the interim scroll target. These values do not
// point to a real item position, rather point to an estimated location pixels.
protected int mInterimTargetDx = 0, mInterimTargetDy = 0;
public LinearSmoothScroller(Context context) {
- mDisplayMetrics = context.getResources().getDisplayMetrics();
+ MILLISECONDS_PER_PX = calculateSpeedPerPixel(context.getResources().getDisplayMetrics());
}
/**
@@ -155,9 +153,6 @@
/**
* Calculates the scroll speed.
*
- * <p>By default, LinearSmoothScroller assumes this method always returns the same value and
- * caches the result of calling it.
- *
* @param displayMetrics DisplayMetrics to be used for real dimension calculations
* @return The time (in ms) it should take for each pixel. For instance, if returned value is
* 2 ms, it means scrolling 1000 pixels with LinearInterpolation should take 2 seconds.
@@ -166,14 +161,6 @@
return MILLISECONDS_PER_INCH / displayMetrics.densityDpi;
}
- private float getSpeedPerPixel() {
- if (!mHasCalculatedMillisPerPixel) {
- mMillisPerPixel = calculateSpeedPerPixel(mDisplayMetrics);
- mHasCalculatedMillisPerPixel = true;
- }
- return mMillisPerPixel;
- }
-
/**
* <p>Calculates the time for deceleration so that transition from LinearInterpolator to
* DecelerateInterpolator looks smooth.</p>
@@ -202,7 +189,7 @@
// In a case where dx is very small, rounding may return 0 although dx > 0.
// To avoid that issue, ceil the result so that if dx > 0, we'll always return positive
// time.
- return (int) Math.ceil(Math.abs(dx) * getSpeedPerPixel());
+ return (int) Math.ceil(Math.abs(dx) * MILLISECONDS_PER_PX);
}
/**
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java
index 1ff33d9..2cb14f1 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/RecyclerView.java
@@ -17,7 +17,7 @@
package androidx.recyclerview.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.core.view.ViewCompat.TYPE_NON_TOUCH;
import static androidx.core.view.ViewCompat.TYPE_TOUCH;
@@ -67,7 +67,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.core.os.TraceCompat;
import androidx.core.util.Preconditions;
-import androidx.core.view.AccessibilityDelegateCompat;
import androidx.core.view.InputDeviceCompat;
import androidx.core.view.MotionEventCompat;
import androidx.core.view.NestedScrollingChild2;
@@ -263,7 +262,7 @@
static final boolean DISPATCH_TEMP_DETACH = false;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({HORIZONTAL, VERTICAL})
@Retention(RetentionPolicy.SOURCE)
public @interface Orientation {}
@@ -290,8 +289,6 @@
*/
public static final int TOUCH_SLOP_PAGING = 1;
- static final int UNDEFINED_DURATION = Integer.MIN_VALUE;
-
static final int MAX_SCROLL_DURATION = 2000;
/**
@@ -2331,7 +2328,7 @@
dy = 0;
}
if (dx != 0 || dy != 0) {
- mViewFlinger.smoothScrollBy(dx, dy, UNDEFINED_DURATION, interpolator);
+ mViewFlinger.smoothScrollBy(dx, dy, interpolator);
}
}
@@ -5322,39 +5319,12 @@
postOnAnimation();
}
- public void smoothScrollBy(int dx, int dy, int duration,
- @Nullable Interpolator interpolator) {
+ public void smoothScrollBy(int dx, int dy) {
+ smoothScrollBy(dx, dy, 0, 0);
+ }
- // Handle cases where parameter values aren't defined.
- if (duration == UNDEFINED_DURATION) {
- duration = computeScrollDuration(dx, dy, 0, 0);
- }
- if (interpolator == null) {
- interpolator = sQuinticInterpolator;
- }
-
- // If the Interpolator has changed, create a new OverScroller with the new
- // interpolator.
- if (mInterpolator != interpolator) {
- mInterpolator = interpolator;
- mOverScroller = new OverScroller(getContext(), interpolator);
- }
-
- // Reset the last fling information.
- mLastFlingX = mLastFlingY = 0;
-
- // Set to settling state and start scrolling.
- setScrollState(SCROLL_STATE_SETTLING);
- mOverScroller.startScroll(0, 0, dx, dy, duration);
-
- if (Build.VERSION.SDK_INT < 23) {
- // b/64931938 before API 23, startScroll() does not reset getCurX()/getCurY()
- // to start values, which causes fillRemainingScrollValues() put in obsolete values
- // for LayoutManager.onLayoutChildren().
- mOverScroller.computeScrollOffset();
- }
-
- postOnAnimation();
+ public void smoothScrollBy(int dx, int dy, int vx, int vy) {
+ smoothScrollBy(dx, dy, computeScrollDuration(dx, dy, vx, vy));
}
private float distanceInfluenceForSnapDuration(float f) {
@@ -5385,6 +5355,32 @@
return Math.min(duration, MAX_SCROLL_DURATION);
}
+ public void smoothScrollBy(int dx, int dy, int duration) {
+ smoothScrollBy(dx, dy, duration, sQuinticInterpolator);
+ }
+
+ public void smoothScrollBy(int dx, int dy, Interpolator interpolator) {
+ smoothScrollBy(dx, dy, computeScrollDuration(dx, dy, 0, 0),
+ interpolator == null ? sQuinticInterpolator : interpolator);
+ }
+
+ public void smoothScrollBy(int dx, int dy, int duration, Interpolator interpolator) {
+ if (mInterpolator != interpolator) {
+ mInterpolator = interpolator;
+ mOverScroller = new OverScroller(getContext(), interpolator);
+ }
+ setScrollState(SCROLL_STATE_SETTLING);
+ mLastFlingX = mLastFlingY = 0;
+ mOverScroller.startScroll(0, 0, dx, dy, duration);
+ if (Build.VERSION.SDK_INT < 23) {
+ // b/64931938 before API 23, startScroll() does not reset getCurX()/getCurY()
+ // to start values, which causes fillRemainingScrollValues() put in obsolete values
+ // for LayoutManager.onLayoutChildren().
+ mOverScroller.computeScrollOffset();
+ }
+ postOnAnimation();
+ }
+
public void stop() {
removeCallbacks(this);
mOverScroller.abortAnimation();
@@ -6186,10 +6182,7 @@
ViewCompat.setImportantForAccessibility(itemView,
ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);
}
- AccessibilityDelegateCompat delegate =
- ViewCompat.getAccessibilityDelegate(itemView);
- if (delegate == null
- || delegate.getClass().equals(AccessibilityDelegateCompat.class)) {
+ if (!ViewCompat.hasAccessibilityDelegate(itemView)) {
holder.addFlags(ViewHolder.FLAG_SET_A11Y_ITEM_DELEGATE);
ViewCompat.setAccessibilityDelegate(itemView,
mAccessibilityDelegate.getItemDelegate());
@@ -11916,7 +11909,7 @@
*/
public static class Action {
- public static final int UNDEFINED_DURATION = RecyclerView.UNDEFINED_DURATION;
+ public static final int UNDEFINED_DURATION = Integer.MIN_VALUE;
private int mDx;
@@ -11999,7 +11992,16 @@
}
if (mChanged) {
validate();
- recyclerView.mViewFlinger.smoothScrollBy(mDx, mDy, mDuration, mInterpolator);
+ if (mInterpolator == null) {
+ if (mDuration == UNDEFINED_DURATION) {
+ recyclerView.mViewFlinger.smoothScrollBy(mDx, mDy);
+ } else {
+ recyclerView.mViewFlinger.smoothScrollBy(mDx, mDy, mDuration);
+ }
+ } else {
+ recyclerView.mViewFlinger.smoothScrollBy(
+ mDx, mDy, mDuration, mInterpolator);
+ }
mConsecutiveUpdates++;
if (mConsecutiveUpdates > 10) {
// A new action is being set in every animation step. This looks like a bad
@@ -12172,7 +12174,7 @@
* This is public so that the CREATOR can be accessed on cold launch.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class SavedState extends AbsSavedState {
Parcelable mLayoutState;
diff --git a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/StaggeredGridLayoutManager.java b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/StaggeredGridLayoutManager.java
index de9f022..17e4293 100644
--- a/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/StaggeredGridLayoutManager.java
+++ b/recyclerview/recyclerview/src/main/java/androidx/recyclerview/widget/StaggeredGridLayoutManager.java
@@ -17,7 +17,7 @@
package androidx.recyclerview.widget;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -3147,7 +3147,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@SuppressLint("BanParcelableUsage")
public static class SavedState implements Parcelable {
diff --git a/recyclerview/selection/api/1.0.0.txt b/recyclerview/selection/api/1.0.0.txt
index 1b682ce..37ddfcb 100644
--- a/recyclerview/selection/api/1.0.0.txt
+++ b/recyclerview/selection/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.recyclerview.selection {
public abstract class BandPredicate {
diff --git a/recyclerview/selection/api/1.1.0-alpha01.txt b/recyclerview/selection/api/1.1.0-alpha01.txt
index 1b682ce..37ddfcb 100644
--- a/recyclerview/selection/api/1.1.0-alpha01.txt
+++ b/recyclerview/selection/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.recyclerview.selection {
public abstract class BandPredicate {
diff --git a/recyclerview/selection/api/1.1.0-alpha02.txt b/recyclerview/selection/api/1.1.0-alpha02.txt
index 1b682ce..37ddfcb 100644
--- a/recyclerview/selection/api/1.1.0-alpha02.txt
+++ b/recyclerview/selection/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.recyclerview.selection {
public abstract class BandPredicate {
diff --git a/recyclerview/selection/api/1.1.0-alpha03.txt b/recyclerview/selection/api/1.1.0-alpha03.txt
deleted file mode 100644
index 1b682ce..0000000
--- a/recyclerview/selection/api/1.1.0-alpha03.txt
+++ /dev/null
@@ -1,158 +0,0 @@
-// Signature format: 3.0
-package androidx.recyclerview.selection {
-
- public abstract class BandPredicate {
- ctor public BandPredicate();
- method public abstract boolean canInitiate(android.view.MotionEvent!);
- }
-
- public static final class BandPredicate.EmptyArea extends androidx.recyclerview.selection.BandPredicate {
- ctor public BandPredicate.EmptyArea(androidx.recyclerview.widget.RecyclerView);
- method public boolean canInitiate(android.view.MotionEvent);
- }
-
- public static final class BandPredicate.NonDraggableArea extends androidx.recyclerview.selection.BandPredicate {
- ctor public BandPredicate.NonDraggableArea(androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.selection.ItemDetailsLookup);
- method public boolean canInitiate(android.view.MotionEvent);
- }
-
- public abstract class FocusDelegate<K> {
- ctor public FocusDelegate();
- method public abstract void clearFocus();
- method public abstract void focusItem(androidx.recyclerview.selection.ItemDetailsLookup.ItemDetails<K>);
- method public abstract int getFocusedPosition();
- method public abstract boolean hasFocusedItem();
- }
-
- public abstract class ItemDetailsLookup<K> {
- ctor public ItemDetailsLookup();
- method public abstract androidx.recyclerview.selection.ItemDetailsLookup.ItemDetails<K>? getItemDetails(android.view.MotionEvent);
- }
-
- public abstract static class ItemDetailsLookup.ItemDetails<K> {
- ctor public ItemDetailsLookup.ItemDetails();
- method public abstract int getPosition();
- method public abstract K? getSelectionKey();
- method public boolean hasSelectionKey();
- method public boolean inDragRegion(android.view.MotionEvent);
- method public boolean inSelectionHotspot(android.view.MotionEvent);
- }
-
- public abstract class ItemKeyProvider<K> {
- ctor protected ItemKeyProvider(@androidx.recyclerview.selection.ItemKeyProvider.Scope int);
- method public abstract K? getKey(int);
- method public abstract int getPosition(K);
- field public static final int SCOPE_CACHED = 1; // 0x1
- field public static final int SCOPE_MAPPED = 0; // 0x0
- }
-
- @IntDef({androidx.recyclerview.selection.ItemKeyProvider.SCOPE_MAPPED, androidx.recyclerview.selection.ItemKeyProvider.SCOPE_CACHED}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ItemKeyProvider.Scope {
- }
-
- public final class MutableSelection<K> extends androidx.recyclerview.selection.Selection<K> {
- ctor public MutableSelection();
- method public boolean add(K);
- method public void clear();
- method public void copyFrom(androidx.recyclerview.selection.Selection<K>);
- method public boolean remove(K);
- }
-
- public interface OnContextClickListener {
- method public boolean onContextClick(android.view.MotionEvent);
- }
-
- public interface OnDragInitiatedListener {
- method public boolean onDragInitiated(android.view.MotionEvent);
- }
-
- public interface OnItemActivatedListener<K> {
- method public boolean onItemActivated(androidx.recyclerview.selection.ItemDetailsLookup.ItemDetails<K>, android.view.MotionEvent);
- }
-
- public final class OperationMonitor {
- ctor public OperationMonitor();
- method public void addListener(androidx.recyclerview.selection.OperationMonitor.OnChangeListener);
- method public boolean isStarted();
- method public void removeListener(androidx.recyclerview.selection.OperationMonitor.OnChangeListener);
- }
-
- public static interface OperationMonitor.OnChangeListener {
- method public void onChanged();
- }
-
- public class Selection<K> implements java.lang.Iterable<K> {
- method public boolean contains(K?);
- method public boolean isEmpty();
- method public java.util.Iterator<K>! iterator();
- method public int size();
- }
-
- public final class SelectionPredicates {
- method public static <K> androidx.recyclerview.selection.SelectionTracker.SelectionPredicate<K>! createSelectAnything();
- method public static <K> androidx.recyclerview.selection.SelectionTracker.SelectionPredicate<K>! createSelectSingleAnything();
- }
-
- public abstract class SelectionTracker<K> {
- ctor public SelectionTracker();
- method public abstract void addObserver(androidx.recyclerview.selection.SelectionTracker.SelectionObserver!);
- method public abstract boolean clearSelection();
- method public abstract void copySelection(androidx.recyclerview.selection.MutableSelection<K>);
- method public abstract boolean deselect(K);
- method public abstract androidx.recyclerview.selection.Selection<K>! getSelection();
- method public abstract boolean hasSelection();
- method public abstract boolean isSelected(K?);
- method public abstract void onRestoreInstanceState(android.os.Bundle?);
- method public abstract void onSaveInstanceState(android.os.Bundle);
- method protected abstract void restoreSelection(androidx.recyclerview.selection.Selection<K>);
- method public abstract boolean select(K);
- method public abstract boolean setItemsSelected(Iterable<K>, boolean);
- field public static final String SELECTION_CHANGED_MARKER = "Selection-Changed";
- }
-
- public static final class SelectionTracker.Builder<K> {
- ctor public SelectionTracker.Builder(String, androidx.recyclerview.widget.RecyclerView, androidx.recyclerview.selection.ItemKeyProvider<K>, androidx.recyclerview.selection.ItemDetailsLookup<K>, androidx.recyclerview.selection.StorageStrategy<K>);
- method public androidx.recyclerview.selection.SelectionTracker<K>! build();
- method public androidx.recyclerview.selection.SelectionTracker.Builder<K>! withBandOverlay(@DrawableRes int);
- method public androidx.recyclerview.selection.SelectionTracker.Builder<K>! withBandPredicate(androidx.recyclerview.selection.BandPredicate);
- method public androidx.recyclerview.selection.SelectionTracker.Builder<K>! withFocusDelegate(androidx.recyclerview.selection.FocusDelegate<K>);
- method public androidx.recyclerview.selection.SelectionTracker.Builder<K>! withGestureTooltypes(int...!);
- method public androidx.recyclerview.selection.SelectionTracker.Builder<K>! withOnContextClickListener(androidx.recyclerview.selection.OnContextClickListener);
- method public androidx.recyclerview.selection.SelectionTracker.Builder<K>! withOnDragInitiatedListener(androidx.recyclerview.selection.OnDragInitiatedListener);
- method public androidx.recyclerview.selection.SelectionTracker.Builder<K>! withOnItemActivatedListener(androidx.recyclerview.selection.OnItemActivatedListener<K>);
- method public androidx.recyclerview.selection.SelectionTracker.Builder<K>! withOperationMonitor(androidx.recyclerview.selection.OperationMonitor);
- method public androidx.recyclerview.selection.SelectionTracker.Builder<K>! withPointerTooltypes(int...!);
- method public androidx.recyclerview.selection.SelectionTracker.Builder<K>! withSelectionPredicate(androidx.recyclerview.selection.SelectionTracker.SelectionPredicate<K>);
- }
-
- public abstract static class SelectionTracker.SelectionObserver<K> {
- ctor public SelectionTracker.SelectionObserver();
- method public void onItemStateChanged(K, boolean);
- method public void onSelectionChanged();
- method public void onSelectionRefresh();
- method public void onSelectionRestored();
- }
-
- public abstract static class SelectionTracker.SelectionPredicate<K> {
- ctor public SelectionTracker.SelectionPredicate();
- method public abstract boolean canSelectMultiple();
- method public abstract boolean canSetStateAtPosition(int, boolean);
- method public abstract boolean canSetStateForKey(K, boolean);
- }
-
- public final class StableIdKeyProvider extends androidx.recyclerview.selection.ItemKeyProvider<java.lang.Long> {
- ctor public StableIdKeyProvider(androidx.recyclerview.widget.RecyclerView);
- method public Long? getKey(int);
- method public int getPosition(Long);
- }
-
- public abstract class StorageStrategy<K> {
- ctor public StorageStrategy(Class<K>);
- method public abstract android.os.Bundle asBundle(androidx.recyclerview.selection.Selection<K>);
- method public abstract androidx.recyclerview.selection.Selection<K>? asSelection(android.os.Bundle);
- method public static androidx.recyclerview.selection.StorageStrategy<java.lang.Long>! createLongStorage();
- method public static <K extends android.os.Parcelable> androidx.recyclerview.selection.StorageStrategy<K>! createParcelableStorage(Class<K>!);
- method public static androidx.recyclerview.selection.StorageStrategy<java.lang.String>! createStringStorage();
- }
-
-}
-
diff --git a/recyclerview/selection/api/current.txt b/recyclerview/selection/api/current.txt
index 1b682ce..37ddfcb 100644
--- a/recyclerview/selection/api/current.txt
+++ b/recyclerview/selection/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.recyclerview.selection {
public abstract class BandPredicate {
diff --git a/recyclerview/selection/api/res-1.1.0-alpha03.txt b/recyclerview/selection/api/res-1.1.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/recyclerview/selection/api/res-1.1.0-alpha03.txt
+++ /dev/null
diff --git a/recyclerview/selection/api/restricted_1.0.0.txt b/recyclerview/selection/api/restricted_1.0.0.txt
deleted file mode 100644
index e068243..0000000
--- a/recyclerview/selection/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-// Signature format: 3.0
-package androidx.recyclerview.selection {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class AutoScroller {
- ctor public AutoScroller();
- method public abstract void reset();
- method public abstract void scroll(android.graphics.Point);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class DefaultSelectionTracker<K> extends androidx.recyclerview.selection.SelectionTracker<K> {
- ctor public DefaultSelectionTracker(String, androidx.recyclerview.selection.ItemKeyProvider, androidx.recyclerview.selection.SelectionTracker.SelectionPredicate, androidx.recyclerview.selection.StorageStrategy<K>);
- method public void addObserver(androidx.recyclerview.selection.SelectionTracker.SelectionObserver);
- method public void anchorRange(int);
- method public void clearProvisionalSelection();
- method public boolean clearSelection();
- method public void copySelection(androidx.recyclerview.selection.MutableSelection);
- method public boolean deselect(K);
- method public void endRange();
- method public void extendProvisionalRange(int);
- method public void extendRange(int);
- method public androidx.recyclerview.selection.Selection! getSelection();
- method public boolean hasSelection();
- method public boolean isRangeActive();
- method public boolean isSelected(K?);
- method public void mergeProvisionalSelection();
- method public final void onRestoreInstanceState(android.os.Bundle?);
- method public final void onSaveInstanceState(android.os.Bundle);
- method protected void restoreSelection(androidx.recyclerview.selection.Selection);
- method public boolean select(K);
- method public boolean setItemsSelected(Iterable<K>, boolean);
- method public void setProvisionalSelection(java.util.Set<K>);
- method public void startRange(int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @VisibleForTesting(otherwise=3) public class EventBridge {
- method public static <K> void install(androidx.recyclerview.widget.RecyclerView.Adapter<?>, androidx.recyclerview.selection.SelectionTracker<K>, androidx.recyclerview.selection.ItemKeyProvider<K>);
- }
-
-}
-
diff --git a/recyclerview/selection/api/restricted_1.1.0-alpha03.ignore b/recyclerview/selection/api/restricted_1.1.0-alpha03.ignore
deleted file mode 100644
index d242801..0000000
--- a/recyclerview/selection/api/restricted_1.1.0-alpha03.ignore
+++ /dev/null
@@ -1,5 +0,0 @@
-// Baseline format: 1.0
-RemovedClass: androidx.recyclerview.selection.EventBridge:
- Removed class androidx.recyclerview.selection.EventBridge
-
-
diff --git a/recyclerview/selection/api/restricted_1.1.0-alpha03.txt b/recyclerview/selection/api/restricted_1.1.0-alpha03.txt
deleted file mode 100644
index 3b7463f..0000000
--- a/recyclerview/selection/api/restricted_1.1.0-alpha03.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-// Signature format: 3.0
-package androidx.recyclerview.selection {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class AutoScroller {
- ctor public AutoScroller();
- method public abstract void reset();
- method public abstract void scroll(android.graphics.Point);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DefaultSelectionTracker<K> extends androidx.recyclerview.selection.SelectionTracker<K> {
- ctor public DefaultSelectionTracker(String, androidx.recyclerview.selection.ItemKeyProvider, androidx.recyclerview.selection.SelectionTracker.SelectionPredicate, androidx.recyclerview.selection.StorageStrategy<K>);
- method public void addObserver(androidx.recyclerview.selection.SelectionTracker.SelectionObserver);
- method public void anchorRange(int);
- method public void clearProvisionalSelection();
- method public boolean clearSelection();
- method public void copySelection(androidx.recyclerview.selection.MutableSelection);
- method public boolean deselect(K);
- method public void endRange();
- method public void extendProvisionalRange(int);
- method public void extendRange(int);
- method protected androidx.recyclerview.widget.RecyclerView.AdapterDataObserver! getAdapterDataObserver();
- method public androidx.recyclerview.selection.Selection! getSelection();
- method public boolean hasSelection();
- method public boolean isRangeActive();
- method public boolean isSelected(K?);
- method public void mergeProvisionalSelection();
- method public final void onRestoreInstanceState(android.os.Bundle?);
- method public final void onSaveInstanceState(android.os.Bundle);
- method protected void restoreSelection(androidx.recyclerview.selection.Selection);
- method public boolean select(K);
- method public boolean setItemsSelected(Iterable<K>, boolean);
- method public void setProvisionalSelection(java.util.Set<K>);
- method public void startRange(int);
- }
-
- public abstract class ItemDetailsLookup<K> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected boolean overItemWithSelectionKey(android.view.MotionEvent);
- }
-
- public abstract class SelectionTracker<K> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract void anchorRange(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected abstract void clearProvisionalSelection();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract void endRange();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected abstract void extendProvisionalRange(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract void extendRange(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected abstract androidx.recyclerview.widget.RecyclerView.AdapterDataObserver! getAdapterDataObserver();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract boolean isRangeActive();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected abstract void mergeProvisionalSelection();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected abstract void setProvisionalSelection(java.util.Set<K>);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract void startRange(int);
- }
-
-}
-
diff --git a/recyclerview/selection/api/restricted_current.txt b/recyclerview/selection/api/restricted_current.txt
deleted file mode 100644
index 3b7463f..0000000
--- a/recyclerview/selection/api/restricted_current.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-// Signature format: 3.0
-package androidx.recyclerview.selection {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class AutoScroller {
- ctor public AutoScroller();
- method public abstract void reset();
- method public abstract void scroll(android.graphics.Point);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DefaultSelectionTracker<K> extends androidx.recyclerview.selection.SelectionTracker<K> {
- ctor public DefaultSelectionTracker(String, androidx.recyclerview.selection.ItemKeyProvider, androidx.recyclerview.selection.SelectionTracker.SelectionPredicate, androidx.recyclerview.selection.StorageStrategy<K>);
- method public void addObserver(androidx.recyclerview.selection.SelectionTracker.SelectionObserver);
- method public void anchorRange(int);
- method public void clearProvisionalSelection();
- method public boolean clearSelection();
- method public void copySelection(androidx.recyclerview.selection.MutableSelection);
- method public boolean deselect(K);
- method public void endRange();
- method public void extendProvisionalRange(int);
- method public void extendRange(int);
- method protected androidx.recyclerview.widget.RecyclerView.AdapterDataObserver! getAdapterDataObserver();
- method public androidx.recyclerview.selection.Selection! getSelection();
- method public boolean hasSelection();
- method public boolean isRangeActive();
- method public boolean isSelected(K?);
- method public void mergeProvisionalSelection();
- method public final void onRestoreInstanceState(android.os.Bundle?);
- method public final void onSaveInstanceState(android.os.Bundle);
- method protected void restoreSelection(androidx.recyclerview.selection.Selection);
- method public boolean select(K);
- method public boolean setItemsSelected(Iterable<K>, boolean);
- method public void setProvisionalSelection(java.util.Set<K>);
- method public void startRange(int);
- }
-
- public abstract class ItemDetailsLookup<K> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected boolean overItemWithSelectionKey(android.view.MotionEvent);
- }
-
- public abstract class SelectionTracker<K> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract void anchorRange(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected abstract void clearProvisionalSelection();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract void endRange();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected abstract void extendProvisionalRange(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract void extendRange(int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected abstract androidx.recyclerview.widget.RecyclerView.AdapterDataObserver! getAdapterDataObserver();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract boolean isRangeActive();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected abstract void mergeProvisionalSelection();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected abstract void setProvisionalSelection(java.util.Set<K>);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract void startRange(int);
- }
-
-}
-
diff --git a/recyclerview/selection/build.gradle b/recyclerview/selection/build.gradle
index 0745937..4bcaed2 100644
--- a/recyclerview/selection/build.gradle
+++ b/recyclerview/selection/build.gradle
@@ -26,7 +26,6 @@
api(project(":recyclerview"))
api(project(":annotation"))
api(project(":core"))
- implementation(project(":collection"))
androidTestImplementation(TEST_EXT_JUNIT)
androidTestImplementation(TEST_CORE)
diff --git a/recyclerview/selection/src/androidTest/java/androidx/recyclerview/selection/GestureSelectionHelper_RecyclerViewDelegateTest.java b/recyclerview/selection/src/androidTest/java/androidx/recyclerview/selection/GestureSelectionHelper_RecyclerViewDelegateTest.java
index 12d312a..2f5e3337 100644
--- a/recyclerview/selection/src/androidTest/java/androidx/recyclerview/selection/GestureSelectionHelper_RecyclerViewDelegateTest.java
+++ b/recyclerview/selection/src/androidTest/java/androidx/recyclerview/selection/GestureSelectionHelper_RecyclerViewDelegateTest.java
@@ -25,13 +25,13 @@
import androidx.recyclerview.selection.GestureSelectionHelper.RecyclerViewDelegate;
import androidx.recyclerview.selection.testing.TestEvents;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class GestureSelectionHelper_RecyclerViewDelegateTest {
// Simulate a (20, 20) box locating at (20, 20)
diff --git a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/AutoScroller.java b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/AutoScroller.java
index e55f630..c3112c4 100644
--- a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/AutoScroller.java
+++ b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/AutoScroller.java
@@ -16,7 +16,7 @@
package androidx.recyclerview.selection;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Point;
@@ -28,7 +28,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public abstract class AutoScroller {
/**
diff --git a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
index 007c982..0635f91 100644
--- a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
+++ b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/DefaultSelectionTracker.java
@@ -16,7 +16,7 @@
package androidx.recyclerview.selection;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.core.util.Preconditions.checkArgument;
import static androidx.core.util.Preconditions.checkState;
import static androidx.recyclerview.selection.Shared.DEBUG;
@@ -49,7 +49,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class DefaultSelectionTracker<K> extends SelectionTracker<K> {
private static final String TAG = "DefaultSelectionTracker";
diff --git a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/EventBridge.java b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/EventBridge.java
index b06868fd..6c43f7e 100644
--- a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/EventBridge.java
+++ b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/EventBridge.java
@@ -16,7 +16,7 @@
package androidx.recyclerview.selection;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.annotation.VisibleForTesting.PACKAGE_PRIVATE;
import static androidx.core.util.Preconditions.checkArgument;
import static androidx.recyclerview.selection.Shared.VERBOSE;
@@ -38,7 +38,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@VisibleForTesting(otherwise = PACKAGE_PRIVATE)
public class EventBridge {
diff --git a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/ItemDetailsLookup.java b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/ItemDetailsLookup.java
index a5187b4..d032e2b 100644
--- a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/ItemDetailsLookup.java
+++ b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/ItemDetailsLookup.java
@@ -16,7 +16,7 @@
package androidx.recyclerview.selection;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.view.MotionEvent;
@@ -72,7 +72,7 @@
* @return true if there is an item w/ a stable ID at the event coordinates.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected boolean overItemWithSelectionKey(@NonNull MotionEvent e) {
return overItem(e) && hasSelectionKey(getItemDetails(e));
}
diff --git a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/SelectionTracker.java b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/SelectionTracker.java
index bd63fd6..56d4328 100644
--- a/recyclerview/selection/src/main/java/androidx/recyclerview/selection/SelectionTracker.java
+++ b/recyclerview/selection/src/main/java/androidx/recyclerview/selection/SelectionTracker.java
@@ -16,7 +16,7 @@
package androidx.recyclerview.selection;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.core.util.Preconditions.checkArgument;
import android.content.Context;
@@ -180,7 +180,7 @@
public abstract boolean deselect(@NonNull K key);
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected abstract AdapterDataObserver getAdapterDataObserver();
/**
@@ -192,7 +192,7 @@
* work with the established anchor point to define selection ranges.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public abstract void startRange(int position);
/**
@@ -208,7 +208,7 @@
* must have been started by a call to {@link #startRange(int)}.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public abstract void extendRange(int position);
/**
@@ -217,14 +217,14 @@
* {@link #mergeProvisionalSelection()} is called first.)
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public abstract void endRange();
/**
* @return Whether or not there is a current range selection active.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public abstract boolean isRangeActive();
/**
@@ -237,7 +237,7 @@
* @param position the anchor position. Must already be selected.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public abstract void anchorRange(int position);
/**
@@ -246,7 +246,7 @@
* @param position the end point.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected abstract void extendProvisionalRange(int position);
/**
@@ -254,14 +254,14 @@
* @param newSelection
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected abstract void setProvisionalSelection(@NonNull Set<K> newSelection);
/**
* Clears any existing provisional selection
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected abstract void clearProvisionalSelection();
/**
@@ -269,7 +269,7 @@
* provisional selection.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected abstract void mergeProvisionalSelection();
/**
diff --git a/remotecallback/api/1.0.0-alpha01.txt b/remotecallback/api/1.0.0-alpha01.txt
index 213daae..ce29789 100644
--- a/remotecallback/api/1.0.0-alpha01.txt
+++ b/remotecallback/api/1.0.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.remotecallback {
public class AppWidgetProviderWithCallbacks<T extends androidx.remotecallback.CallbackReceiver> extends android.appwidget.AppWidgetProvider implements androidx.remotecallback.CallbackReceiver<T> {
diff --git a/remotecallback/api/1.0.0-alpha02.txt b/remotecallback/api/1.0.0-alpha02.txt
index 213daae..ce29789 100644
--- a/remotecallback/api/1.0.0-alpha02.txt
+++ b/remotecallback/api/1.0.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.remotecallback {
public class AppWidgetProviderWithCallbacks<T extends androidx.remotecallback.CallbackReceiver> extends android.appwidget.AppWidgetProvider implements androidx.remotecallback.CallbackReceiver<T> {
diff --git a/remotecallback/api/current.txt b/remotecallback/api/current.txt
index 213daae..ce29789 100644
--- a/remotecallback/api/current.txt
+++ b/remotecallback/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.remotecallback {
public class AppWidgetProviderWithCallbacks<T extends androidx.remotecallback.CallbackReceiver> extends android.appwidget.AppWidgetProvider implements androidx.remotecallback.CallbackReceiver<T> {
diff --git a/remotecallback/api/restricted_1.0.0-alpha02.txt b/remotecallback/api/restricted_1.0.0-alpha02.txt
deleted file mode 100644
index 89c7414..0000000
--- a/remotecallback/api/restricted_1.0.0-alpha02.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-// Signature format: 3.0
-package androidx.remotecallback {
-
- public class AppWidgetProviderWithCallbacks<T extends androidx.remotecallback.CallbackReceiver> extends android.appwidget.AppWidgetProvider implements androidx.remotecallback.CallbackBase<T> androidx.remotecallback.CallbackReceiver<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
- }
-
- public abstract class BroadcastReceiverWithCallbacks<T extends androidx.remotecallback.CallbackReceiver> extends android.content.BroadcastReceiver implements androidx.remotecallback.CallbackBase<T> androidx.remotecallback.CallbackReceiver<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface CallbackBase<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
- }
-
- public class CallbackHandlerRegistry {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public <T extends androidx.remotecallback.CallbackReceiver> T! getAndResetStub(Class<? extends androidx.remotecallback.CallbackReceiver>!, android.content.Context!, String!);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final androidx.remotecallback.CallbackHandlerRegistry! sInstance;
- }
-
- public abstract class ContentProviderWithCallbacks<T extends androidx.remotecallback.ContentProviderWithCallbacks> extends android.content.ContentProvider implements androidx.remotecallback.CallbackBase<T> androidx.remotecallback.CallbackReceiver<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ProviderRelayReceiver extends android.content.BroadcastReceiver {
- ctor public ProviderRelayReceiver();
- method public void onReceive(android.content.Context!, android.content.Intent!);
- field public static final String ACTION_PROVIDER_RELAY = "androidx.remotecallback.action.PROVIDER_RELAY";
- field public static final String EXTRA_AUTHORITY = "androidx.remotecallback.extra.AUTHORITY";
- field public static final String METHOD_PROVIDER_CALLBACK = "androidx.remotecallback.method.PROVIDER_CALLBACK";
- }
-
- public class RemoteCallback {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public RemoteCallback(android.content.Context, @androidx.remotecallback.RemoteCallback.RemoteCallbackType int, android.content.Intent, String, android.os.Bundle);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String EXTRA_METHOD = "remotecallback.method";
- }
-
-
-}
-
diff --git a/remotecallback/api/restricted_current.txt b/remotecallback/api/restricted_current.txt
deleted file mode 100644
index 89c7414..0000000
--- a/remotecallback/api/restricted_current.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-// Signature format: 3.0
-package androidx.remotecallback {
-
- public class AppWidgetProviderWithCallbacks<T extends androidx.remotecallback.CallbackReceiver> extends android.appwidget.AppWidgetProvider implements androidx.remotecallback.CallbackBase<T> androidx.remotecallback.CallbackReceiver<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
- }
-
- public abstract class BroadcastReceiverWithCallbacks<T extends androidx.remotecallback.CallbackReceiver> extends android.content.BroadcastReceiver implements androidx.remotecallback.CallbackBase<T> androidx.remotecallback.CallbackReceiver<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public interface CallbackBase<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
- }
-
- public class CallbackHandlerRegistry {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public <T extends androidx.remotecallback.CallbackReceiver> T! getAndResetStub(Class<? extends androidx.remotecallback.CallbackReceiver>!, android.content.Context!, String!);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final androidx.remotecallback.CallbackHandlerRegistry! sInstance;
- }
-
- public abstract class ContentProviderWithCallbacks<T extends androidx.remotecallback.ContentProviderWithCallbacks> extends android.content.ContentProvider implements androidx.remotecallback.CallbackBase<T> androidx.remotecallback.CallbackReceiver<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ProviderRelayReceiver extends android.content.BroadcastReceiver {
- ctor public ProviderRelayReceiver();
- method public void onReceive(android.content.Context!, android.content.Intent!);
- field public static final String ACTION_PROVIDER_RELAY = "androidx.remotecallback.action.PROVIDER_RELAY";
- field public static final String EXTRA_AUTHORITY = "androidx.remotecallback.extra.AUTHORITY";
- field public static final String METHOD_PROVIDER_CALLBACK = "androidx.remotecallback.method.PROVIDER_CALLBACK";
- }
-
- public class RemoteCallback {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public RemoteCallback(android.content.Context, @androidx.remotecallback.RemoteCallback.RemoteCallbackType int, android.content.Intent, String, android.os.Bundle);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String EXTRA_METHOD = "remotecallback.method";
- }
-
-
-}
-
diff --git a/remotecallback/build.gradle b/remotecallback/build.gradle
index 4f9ffe3..f3eb6e9 100644
--- a/remotecallback/build.gradle
+++ b/remotecallback/build.gradle
@@ -24,7 +24,7 @@
}
dependencies {
- implementation project(":annotation")
+ implementation "androidx.annotation:annotation:1.0.0"
implementation project(path: ':collection')
androidTestImplementation(TEST_EXT_JUNIT)
diff --git a/remotecallback/src/androidTest/java/androidx/remotecallback/ArrayParamTypesTest.java b/remotecallback/src/androidTest/java/androidx/remotecallback/ArrayParamTypesTest.java
index d9c35af..a7c937d 100644
--- a/remotecallback/src/androidTest/java/androidx/remotecallback/ArrayParamTypesTest.java
+++ b/remotecallback/src/androidTest/java/androidx/remotecallback/ArrayParamTypesTest.java
@@ -27,7 +27,7 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -36,7 +36,7 @@
import java.util.concurrent.TimeUnit;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class ArrayParamTypesTest {
private final Context mContext = ApplicationProvider.getApplicationContext();
diff --git a/remotecallback/src/androidTest/java/androidx/remotecallback/ParamTypesTest.java b/remotecallback/src/androidTest/java/androidx/remotecallback/ParamTypesTest.java
index d7f93c4..d3b9af6 100644
--- a/remotecallback/src/androidTest/java/androidx/remotecallback/ParamTypesTest.java
+++ b/remotecallback/src/androidTest/java/androidx/remotecallback/ParamTypesTest.java
@@ -26,7 +26,7 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -35,7 +35,7 @@
import java.util.concurrent.TimeUnit;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class ParamTypesTest {
private final Context mContext = ApplicationProvider.getApplicationContext();
diff --git a/remotecallback/src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java b/remotecallback/src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java
index 48f1db9..a1c1d92 100644
--- a/remotecallback/src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java
+++ b/remotecallback/src/main/java/androidx/remotecallback/AppWidgetProviderWithCallbacks.java
@@ -53,7 +53,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Override
public RemoteCallback toRemoteCallback(Class<T> cls, Context context, String authority,
Bundle args, String method) {
diff --git a/remotecallback/src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java b/remotecallback/src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java
index 8ef1a1e..87e0f56 100644
--- a/remotecallback/src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java
+++ b/remotecallback/src/main/java/androidx/remotecallback/BroadcastReceiverWithCallbacks.java
@@ -59,7 +59,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Override
public RemoteCallback toRemoteCallback(Class<T> cls, Context context, String authority,
Bundle args, String method) {
diff --git a/remotecallback/src/main/java/androidx/remotecallback/CallbackBase.java b/remotecallback/src/main/java/androidx/remotecallback/CallbackBase.java
index c12453e..9d2aa7e 100644
--- a/remotecallback/src/main/java/androidx/remotecallback/CallbackBase.java
+++ b/remotecallback/src/main/java/androidx/remotecallback/CallbackBase.java
@@ -30,7 +30,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public interface CallbackBase<T> {
/**
@@ -38,7 +38,7 @@
* be used in the context on {@link CallbackReceiver#createRemoteCallback}.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
RemoteCallback toRemoteCallback(Class<T> cls, Context context, String authority, Bundle args,
String method);
}
diff --git a/remotecallback/src/main/java/androidx/remotecallback/CallbackHandlerRegistry.java b/remotecallback/src/main/java/androidx/remotecallback/CallbackHandlerRegistry.java
index 4dc9b72..67ca076 100644
--- a/remotecallback/src/main/java/androidx/remotecallback/CallbackHandlerRegistry.java
+++ b/remotecallback/src/main/java/androidx/remotecallback/CallbackHandlerRegistry.java
@@ -41,7 +41,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static final CallbackHandlerRegistry sInstance = new CallbackHandlerRegistry();
private static final String TAG = "CallbackHandlerRegistry";
@@ -52,7 +52,7 @@
* @hide
*/
@SuppressWarnings("TypeParameterUnusedInFormals")
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public <T extends CallbackReceiver> T getAndResetStub(Class<? extends CallbackReceiver> cls,
Context context, String authority) {
ensureInitialized(cls);
diff --git a/remotecallback/src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java b/remotecallback/src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java
index 5b862ed..e728f80 100644
--- a/remotecallback/src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java
+++ b/remotecallback/src/main/java/androidx/remotecallback/ContentProviderWithCallbacks.java
@@ -66,7 +66,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Override
public RemoteCallback toRemoteCallback(Class<T> cls, Context context, String authority,
Bundle args, String method) {
diff --git a/remotecallback/src/main/java/androidx/remotecallback/ProviderRelayReceiver.java b/remotecallback/src/main/java/androidx/remotecallback/ProviderRelayReceiver.java
index a289e2a..2bf7a41 100644
--- a/remotecallback/src/main/java/androidx/remotecallback/ProviderRelayReceiver.java
+++ b/remotecallback/src/main/java/androidx/remotecallback/ProviderRelayReceiver.java
@@ -29,7 +29,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class ProviderRelayReceiver extends BroadcastReceiver {
public static final String ACTION_PROVIDER_RELAY =
diff --git a/remotecallback/src/main/java/androidx/remotecallback/RemoteCallback.java b/remotecallback/src/main/java/androidx/remotecallback/RemoteCallback.java
index e2e8c4b..1e4387e 100644
--- a/remotecallback/src/main/java/androidx/remotecallback/RemoteCallback.java
+++ b/remotecallback/src/main/java/androidx/remotecallback/RemoteCallback.java
@@ -39,7 +39,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static final String EXTRA_METHOD = "remotecallback.method";
/**
@@ -70,7 +70,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public RemoteCallback(@NonNull Context context,
@RemoteCallbackType int type,
@NonNull Intent intent,
diff --git a/room/common/api/2.1.0-alpha02.txt b/room/common/api/2.1.0-alpha02.txt
index 6f0e5eb..905849e 100644
--- a/room/common/api/2.1.0-alpha02.txt
+++ b/room/common/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room {
@java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ColumnInfo {
diff --git a/room/common/api/2.1.0-alpha04.txt b/room/common/api/2.1.0-alpha04.txt
index 67cc6c6..127708c 100644
--- a/room/common/api/2.1.0-alpha04.txt
+++ b/room/common/api/2.1.0-alpha04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room {
@java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ColumnInfo {
@@ -74,12 +74,12 @@
@IntDef({androidx.room.ForeignKey.NO_ACTION, androidx.room.ForeignKey.RESTRICT, androidx.room.ForeignKey.SET_NULL, androidx.room.ForeignKey.SET_DEFAULT, androidx.room.ForeignKey.CASCADE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ForeignKey.Action {
}
- @RequiresApi(16) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) public @interface Fts3 {
+ @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @RequiresApi(16) public @interface Fts3 {
method public abstract String tokenizer() default androidx.room.FtsOptions.TOKENIZER_SIMPLE;
method public abstract String[] tokenizerArgs() default {};
}
- @RequiresApi(16) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) public @interface Fts4 {
+ @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @RequiresApi(16) public @interface Fts4 {
method public abstract Class contentEntity() default java.lang.Object.class;
method public abstract String languageId() default "";
method public abstract androidx.room.FtsOptions.MatchInfo matchInfo() default androidx.room.FtsOptions.MatchInfo.FTS4;
@@ -97,12 +97,12 @@
field @RequiresApi(21) public static final String TOKENIZER_UNICODE61 = "unicode61";
}
- public enum FtsOptions.MatchInfo {
+ public static enum FtsOptions.MatchInfo {
enum_constant public static final androidx.room.FtsOptions.MatchInfo FTS3;
enum_constant public static final androidx.room.FtsOptions.MatchInfo FTS4;
}
- public enum FtsOptions.Order {
+ public static enum FtsOptions.Order {
enum_constant public static final androidx.room.FtsOptions.Order ASC;
enum_constant public static final androidx.room.FtsOptions.Order DESC;
}
diff --git a/room/common/api/2.1.0-alpha05.txt b/room/common/api/2.1.0-alpha05.txt
deleted file mode 100644
index 67cc6c6..0000000
--- a/room/common/api/2.1.0-alpha05.txt
+++ /dev/null
@@ -1,185 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ColumnInfo {
- method @androidx.room.ColumnInfo.Collate public abstract int collate() default androidx.room.ColumnInfo.UNSPECIFIED;
- method public abstract boolean index() default false;
- method public abstract String name() default androidx.room.ColumnInfo.INHERIT_FIELD_NAME;
- method @androidx.room.ColumnInfo.SQLiteTypeAffinity public abstract int typeAffinity() default androidx.room.ColumnInfo.UNDEFINED;
- field public static final int BINARY = 2; // 0x2
- field public static final int BLOB = 5; // 0x5
- field public static final String INHERIT_FIELD_NAME = "[field-name]";
- field public static final int INTEGER = 3; // 0x3
- field @RequiresApi(21) public static final int LOCALIZED = 5; // 0x5
- field public static final int NOCASE = 3; // 0x3
- field public static final int REAL = 4; // 0x4
- field public static final int RTRIM = 4; // 0x4
- field public static final int TEXT = 2; // 0x2
- field public static final int UNDEFINED = 1; // 0x1
- field @RequiresApi(21) public static final int UNICODE = 6; // 0x6
- field public static final int UNSPECIFIED = 1; // 0x1
- }
-
- @IntDef({androidx.room.ColumnInfo.UNSPECIFIED, androidx.room.ColumnInfo.BINARY, androidx.room.ColumnInfo.NOCASE, androidx.room.ColumnInfo.RTRIM, androidx.room.ColumnInfo.LOCALIZED, androidx.room.ColumnInfo.UNICODE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public static @interface ColumnInfo.Collate {
- }
-
- @IntDef({androidx.room.ColumnInfo.UNDEFINED, androidx.room.ColumnInfo.TEXT, androidx.room.ColumnInfo.INTEGER, androidx.room.ColumnInfo.REAL, androidx.room.ColumnInfo.BLOB}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public static @interface ColumnInfo.SQLiteTypeAffinity {
- }
-
- @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Dao {
- }
-
- @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Database {
- method public abstract Class[] entities();
- method public abstract boolean exportSchema() default true;
- method public abstract int version();
- method public abstract Class[] views() default {};
- }
-
- @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface DatabaseView {
- method public abstract String value() default "";
- method public abstract String viewName() default "";
- }
-
- @java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Delete {
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Embedded {
- method public abstract String prefix() default "";
- }
-
- @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Entity {
- method public abstract androidx.room.ForeignKey[] foreignKeys() default {};
- method public abstract String[] ignoredColumns() default {};
- method public abstract androidx.room.Index[] indices() default {};
- method public abstract boolean inheritSuperIndices() default false;
- method public abstract String[] primaryKeys() default {};
- method public abstract String tableName() default "";
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ForeignKey {
- method public abstract String[] childColumns();
- method public abstract boolean deferred() default false;
- method public abstract Class entity();
- method @androidx.room.ForeignKey.Action public abstract int onDelete() default androidx.room.ForeignKey.NO_ACTION;
- method @androidx.room.ForeignKey.Action public abstract int onUpdate() default androidx.room.ForeignKey.NO_ACTION;
- method public abstract String[] parentColumns();
- field public static final int CASCADE = 5; // 0x5
- field public static final int NO_ACTION = 1; // 0x1
- field public static final int RESTRICT = 2; // 0x2
- field public static final int SET_DEFAULT = 4; // 0x4
- field public static final int SET_NULL = 3; // 0x3
- }
-
- @IntDef({androidx.room.ForeignKey.NO_ACTION, androidx.room.ForeignKey.RESTRICT, androidx.room.ForeignKey.SET_NULL, androidx.room.ForeignKey.SET_DEFAULT, androidx.room.ForeignKey.CASCADE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ForeignKey.Action {
- }
-
- @RequiresApi(16) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) public @interface Fts3 {
- method public abstract String tokenizer() default androidx.room.FtsOptions.TOKENIZER_SIMPLE;
- method public abstract String[] tokenizerArgs() default {};
- }
-
- @RequiresApi(16) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) public @interface Fts4 {
- method public abstract Class contentEntity() default java.lang.Object.class;
- method public abstract String languageId() default "";
- method public abstract androidx.room.FtsOptions.MatchInfo matchInfo() default androidx.room.FtsOptions.MatchInfo.FTS4;
- method public abstract String[] notIndexed() default {};
- method public abstract androidx.room.FtsOptions.Order order() default androidx.room.FtsOptions.Order.ASC;
- method public abstract int[] prefix() default {};
- method public abstract String tokenizer() default androidx.room.FtsOptions.TOKENIZER_SIMPLE;
- method public abstract String[] tokenizerArgs() default {};
- }
-
- public class FtsOptions {
- field public static final String TOKENIZER_ICU = "icu";
- field public static final String TOKENIZER_PORTER = "porter";
- field public static final String TOKENIZER_SIMPLE = "simple";
- field @RequiresApi(21) public static final String TOKENIZER_UNICODE61 = "unicode61";
- }
-
- public enum FtsOptions.MatchInfo {
- enum_constant public static final androidx.room.FtsOptions.MatchInfo FTS3;
- enum_constant public static final androidx.room.FtsOptions.MatchInfo FTS4;
- }
-
- public enum FtsOptions.Order {
- enum_constant public static final androidx.room.FtsOptions.Order ASC;
- enum_constant public static final androidx.room.FtsOptions.Order DESC;
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.CONSTRUCTOR}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Ignore {
- }
-
- @java.lang.annotation.Target({}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Index {
- method public abstract String name() default "";
- method public abstract boolean unique() default false;
- method public abstract String[] value();
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Insert {
- method @androidx.room.OnConflictStrategy public abstract int onConflict() default androidx.room.OnConflictStrategy.ABORT;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({androidx.room.OnConflictStrategy.REPLACE, androidx.room.OnConflictStrategy.ROLLBACK, androidx.room.OnConflictStrategy.ABORT, androidx.room.OnConflictStrategy.FAIL, androidx.room.OnConflictStrategy.IGNORE}) public @interface OnConflictStrategy {
- field public static final int ABORT = 3; // 0x3
- field @Deprecated public static final int FAIL = 4; // 0x4
- field public static final int IGNORE = 5; // 0x5
- field public static final int REPLACE = 1; // 0x1
- field @Deprecated public static final int ROLLBACK = 2; // 0x2
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface PrimaryKey {
- method public abstract boolean autoGenerate() default false;
- }
-
- @java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Query {
- method public abstract String value();
- }
-
- @java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface RawQuery {
- method public abstract Class[] observedEntities() default {};
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Relation {
- method public abstract Class entity() default java.lang.Object.class;
- method public abstract String entityColumn();
- method public abstract String parentColumn();
- method public abstract String[] projection() default {};
- }
-
- public class RoomWarnings {
- ctor @Deprecated public RoomWarnings();
- field public static final String CANNOT_CREATE_VERIFICATION_DATABASE = "ROOM_CANNOT_CREATE_VERIFICATION_DATABASE";
- field public static final String CURSOR_MISMATCH = "ROOM_CURSOR_MISMATCH";
- field public static final String DEFAULT_CONSTRUCTOR = "ROOM_DEFAULT_CONSTRUCTOR";
- field public static final String INDEX_FROM_EMBEDDED_ENTITY_IS_DROPPED = "ROOM_EMBEDDED_ENTITY_INDEX_IS_DROPPED";
- field public static final String INDEX_FROM_EMBEDDED_FIELD_IS_DROPPED = "ROOM_EMBEDDED_INDEX_IS_DROPPED";
- field public static final String INDEX_FROM_PARENT_FIELD_IS_DROPPED = "ROOM_PARENT_FIELD_INDEX_IS_DROPPED";
- field public static final String INDEX_FROM_PARENT_IS_DROPPED = "ROOM_PARENT_INDEX_IS_DROPPED";
- field public static final String MISSING_INDEX_ON_FOREIGN_KEY_CHILD = "ROOM_MISSING_FOREIGN_KEY_CHILD_INDEX";
- field public static final String MISSING_JAVA_TMP_DIR = "ROOM_MISSING_JAVA_TMP_DIR";
- field public static final String MISSING_SCHEMA_LOCATION = "ROOM_MISSING_SCHEMA_LOCATION";
- field public static final String PRIMARY_KEY_FROM_EMBEDDED_IS_DROPPED = "ROOM_EMBEDDED_PRIMARY_KEY_IS_DROPPED";
- field public static final String RELATION_QUERY_WITHOUT_TRANSACTION = "ROOM_RELATION_QUERY_WITHOUT_TRANSACTION";
- field public static final String RELATION_TYPE_MISMATCH = "ROOM_RELATION_TYPE_MISMATCH";
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface SkipQueryVerification {
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Transaction {
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface TypeConverter {
- }
-
- @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface TypeConverters {
- method public abstract Class<?>[] value();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface Update {
- method @androidx.room.OnConflictStrategy public abstract int onConflict() default androidx.room.OnConflictStrategy.ABORT;
- }
-
-}
-
diff --git a/room/common/api/current.txt b/room/common/api/current.txt
index 67cc6c6..127708c 100644
--- a/room/common/api/current.txt
+++ b/room/common/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room {
@java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ColumnInfo {
@@ -74,12 +74,12 @@
@IntDef({androidx.room.ForeignKey.NO_ACTION, androidx.room.ForeignKey.RESTRICT, androidx.room.ForeignKey.SET_NULL, androidx.room.ForeignKey.SET_DEFAULT, androidx.room.ForeignKey.CASCADE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface ForeignKey.Action {
}
- @RequiresApi(16) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) public @interface Fts3 {
+ @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @RequiresApi(16) public @interface Fts3 {
method public abstract String tokenizer() default androidx.room.FtsOptions.TOKENIZER_SIMPLE;
method public abstract String[] tokenizerArgs() default {};
}
- @RequiresApi(16) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) public @interface Fts4 {
+ @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @RequiresApi(16) public @interface Fts4 {
method public abstract Class contentEntity() default java.lang.Object.class;
method public abstract String languageId() default "";
method public abstract androidx.room.FtsOptions.MatchInfo matchInfo() default androidx.room.FtsOptions.MatchInfo.FTS4;
@@ -97,12 +97,12 @@
field @RequiresApi(21) public static final String TOKENIZER_UNICODE61 = "unicode61";
}
- public enum FtsOptions.MatchInfo {
+ public static enum FtsOptions.MatchInfo {
enum_constant public static final androidx.room.FtsOptions.MatchInfo FTS3;
enum_constant public static final androidx.room.FtsOptions.MatchInfo FTS4;
}
- public enum FtsOptions.Order {
+ public static enum FtsOptions.Order {
enum_constant public static final androidx.room.FtsOptions.Order ASC;
enum_constant public static final androidx.room.FtsOptions.Order DESC;
}
diff --git a/room/common/api/restricted_2.0.0.txt b/room/common/api/restricted_2.0.0.txt
deleted file mode 100644
index 38c85f7..0000000
--- a/room/common/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class RoomMasterTable {
- method public static String! createInsertQuery(String!);
- field public static final String CREATE_QUERY = "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)";
- field public static final String DEFAULT_ID = "42";
- field public static final String NAME = "room_master_table";
- field public static final String READ_QUERY = "SELECT identity_hash FROM room_master_table WHERE id = 42 LIMIT 1";
- field public static final String TABLE_NAME = "room_master_table";
- }
-
-}
-
diff --git a/room/common/api/restricted_2.1.0-alpha05.txt b/room/common/api/restricted_2.1.0-alpha05.txt
deleted file mode 100644
index 648a72e..0000000
--- a/room/common/api/restricted_2.1.0-alpha05.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class RoomMasterTable {
- method public static String! createInsertQuery(String!);
- field public static final String CREATE_QUERY = "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)";
- field public static final String DEFAULT_ID = "42";
- field public static final String NAME = "room_master_table";
- field public static final String READ_QUERY = "SELECT identity_hash FROM room_master_table WHERE id = 42 LIMIT 1";
- field public static final String TABLE_NAME = "room_master_table";
- }
-
-}
-
diff --git a/room/common/api/restricted_current.txt b/room/common/api/restricted_current.txt
deleted file mode 100644
index 648a72e..0000000
--- a/room/common/api/restricted_current.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class RoomMasterTable {
- method public static String! createInsertQuery(String!);
- field public static final String CREATE_QUERY = "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)";
- field public static final String DEFAULT_ID = "42";
- field public static final String NAME = "room_master_table";
- field public static final String READ_QUERY = "SELECT identity_hash FROM room_master_table WHERE id = 42 LIMIT 1";
- field public static final String TABLE_NAME = "room_master_table";
- }
-
-}
-
diff --git a/room/common/build.gradle b/room/common/build.gradle
index 7a2b07f..1bf6652 100644
--- a/room/common/build.gradle
+++ b/room/common/build.gradle
@@ -24,7 +24,7 @@
}
dependencies {
- compile(ANDROIDX_ANNOTATION)
+ compile(SUPPORT_ANNOTATIONS)
testCompile(JUNIT)
testCompile(MOCKITO_CORE)
}
diff --git a/room/common/src/main/java/androidx/room/RoomMasterTable.java b/room/common/src/main/java/androidx/room/RoomMasterTable.java
index f116366..c1ab82a 100644
--- a/room/common/src/main/java/androidx/room/RoomMasterTable.java
+++ b/room/common/src/main/java/androidx/room/RoomMasterTable.java
@@ -24,7 +24,7 @@
* @hide
*/
@SuppressWarnings("WeakerAccess")
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class RoomMasterTable {
/**
* The master table where room keeps its metadata information.
diff --git a/room/compiler/build.gradle b/room/compiler/build.gradle
index 4c74d26..4d15cf6 100644
--- a/room/compiler/build.gradle
+++ b/room/compiler/build.gradle
@@ -51,7 +51,7 @@
compile(JAVAPOET)
compile(ANTLR)
compile(XERIAL)
- compile(KOTLIN_METADATA_JVM)
+ compile(KOTLIN_METADATA)
compile(APACHE_COMMONS_CODEC)
testCompile(GOOGLE_COMPILE_TESTING)
testCompile project(":paging:paging-common")
diff --git a/room/compiler/src/main/kotlin/androidx/room/ext/KotlinMetadataElement.kt b/room/compiler/src/main/kotlin/androidx/room/ext/KotlinMetadataElement.kt
new file mode 100644
index 0000000..8eae79d
--- /dev/null
+++ b/room/compiler/src/main/kotlin/androidx/room/ext/KotlinMetadataElement.kt
@@ -0,0 +1,122 @@
+/*
+ * 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.room.ext
+
+import androidx.room.processor.Context
+import me.eugeniomarletti.kotlin.metadata.KotlinClassMetadata
+import me.eugeniomarletti.kotlin.metadata.KotlinMetadataUtils
+import me.eugeniomarletti.kotlin.metadata.isPrimary
+import me.eugeniomarletti.kotlin.metadata.isSuspend
+import me.eugeniomarletti.kotlin.metadata.jvm.getJvmConstructorSignature
+import me.eugeniomarletti.kotlin.metadata.kotlinMetadata
+import me.eugeniomarletti.kotlin.metadata.shadow.metadata.ProtoBuf
+import me.eugeniomarletti.kotlin.metadata.shadow.serialization.deserialization.getName
+import javax.annotation.processing.ProcessingEnvironment
+import javax.lang.model.element.Element
+import javax.lang.model.element.ExecutableElement
+
+/**
+ * Utility class for processors that wants to run kotlin specific code.
+ */
+class KotlinMetadataElement private constructor(
+ val context: Context,
+ val element: Element,
+ private val classMetadata: KotlinClassMetadata
+) : KotlinMetadataUtils {
+
+ override val processingEnv: ProcessingEnvironment
+ get() = context.processingEnv
+
+ /**
+ * Returns the parameter names of the function or constructor if all have names embedded in the
+ * metadata.
+ */
+ fun getParameterNames(method: ExecutableElement): List<String>? {
+ val valueParameterList = classMetadata.data.getFunctionOrNull(method)?.valueParameterList
+ ?: findConstructor(method)?.valueParameterList
+ ?: return null
+ return if (valueParameterList.all { it.hasName() }) {
+ valueParameterList.map {
+ classMetadata.data.nameResolver.getName(it.name)
+ .asString()
+ .replace("`", "")
+ .removeSuffix("?")
+ .trim()
+ }
+ } else {
+ null
+ }
+ }
+
+ /**
+ * Finds the kotlin metadata for a constructor.
+ */
+ private fun findConstructor(
+ executableElement: ExecutableElement
+ ): ProtoBuf.Constructor? = classMetadata?.let { metadata ->
+ val (nameResolver, classProto) = metadata.data
+ val jvmSignature = executableElement.jvmMethodSignature
+ // find constructor
+ return classProto.constructorList.singleOrNull {
+ it.getJvmConstructorSignature(nameResolver, classProto.typeTable) == jvmSignature
+ }
+ }
+
+ /**
+ * Finds the primary constructor signature of the class.
+ */
+ fun findPrimaryConstructorSignature() = classMetadata.data.let { data ->
+ data.classProto
+ .constructorList.first { it.isPrimary }
+ .getJvmConstructorSignature(
+ data.nameResolver,
+ data.classProto.typeTable
+ )
+ }
+
+ fun getMethodSignature(executableElement: ExecutableElement) =
+ executableElement.jvmMethodSignature
+
+ /**
+ * Checks if a method is a suspend function.
+ */
+ fun isSuspendFunction(method: ExecutableElement) =
+ classMetadata.data.getFunctionOrNull(method)?.isSuspend == true
+
+ companion object {
+
+ /**
+ * Creates a [KotlinMetadataElement] for the given element if it contains Kotlin metadata,
+ * otherwise this method returns null.
+ *
+ * Usually the [element] passed must represent a class. For example, if kotlin metadata is
+ * desired for a method, then the containing method should be used as parameter.
+ */
+ fun createFor(context: Context, element: Element): KotlinMetadataElement? {
+ val metadata = try {
+ element.kotlinMetadata
+ } catch (throwable: Throwable) {
+ context.logger.d(element, "failed to read get kotlin metadata from %s", element)
+ } as? KotlinClassMetadata
+ return if (metadata != null) {
+ KotlinMetadataElement(context, element, metadata)
+ } else {
+ null
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/room/compiler/src/main/kotlin/androidx/room/ext/element_ext.kt b/room/compiler/src/main/kotlin/androidx/room/ext/element_ext.kt
index f7809d5..05cbde9 100644
--- a/room/compiler/src/main/kotlin/androidx/room/ext/element_ext.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/ext/element_ext.kt
@@ -22,6 +22,7 @@
import com.google.auto.common.AnnotationMirrors
import com.google.auto.common.MoreElements
import com.google.auto.common.MoreTypes
+import me.eugeniomarletti.kotlin.metadata.shadow.load.java.JvmAbi
import java.lang.reflect.Proxy
import javax.annotation.processing.ProcessingEnvironment
import javax.lang.model.element.AnnotationMirror
@@ -341,11 +342,6 @@
}
/**
- * Suffix of the Kotlin synthetic class created interface method implementations.
- */
-const val DEFAULT_IMPLS_CLASS_NAME = "DefaultImpls"
-
-/**
* Finds the default implementation method corresponding to this Kotlin interface method.
*/
fun Element.findKotlinDefaultImpl(typeUtils: Types): Element? {
@@ -364,7 +360,7 @@
val parent = this.enclosingElement as TypeElement
val innerClass = parent.enclosedElements.find {
- it.kind == ElementKind.CLASS && it.simpleName.contentEquals(DEFAULT_IMPLS_CLASS_NAME)
+ it.kind == ElementKind.CLASS && it.simpleName.contentEquals(JvmAbi.DEFAULT_IMPLS_CLASS_NAME)
} ?: return null
return innerClass.enclosedElements.find {
it.kind == ElementKind.METHOD && it.simpleName == this.simpleName &&
diff --git a/room/compiler/src/main/kotlin/androidx/room/ext/javapoet_ext.kt b/room/compiler/src/main/kotlin/androidx/room/ext/javapoet_ext.kt
index e9809ad..efb9573 100644
--- a/room/compiler/src/main/kotlin/androidx/room/ext/javapoet_ext.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/ext/javapoet_ext.kt
@@ -53,7 +53,6 @@
object RoomTypeNames {
val STRING_UTIL: ClassName = ClassName.get("androidx.room.util", "StringUtil")
val ROOM_DB: ClassName = ClassName.get("androidx.room", "RoomDatabase")
- val ROOM_DB_KT: ClassName = ClassName.get("androidx.room", "RoomDatabaseKt")
val ROOM_DB_CONFIG: ClassName = ClassName.get("androidx.room",
"DatabaseConfiguration")
val INSERTION_ADAPTER: ClassName =
@@ -161,7 +160,6 @@
object KotlinTypeNames {
val UNIT = ClassName.get("kotlin", "Unit")
val CONTINUATION = ClassName.get("kotlin.coroutines", "Continuation")
- val COROUTINE_SCOPE = ClassName.get("kotlinx.coroutines", "CoroutineScope")
}
fun TypeName.defaultValue(): String {
@@ -187,29 +185,3 @@
callBody()
}.build())
}
-
-fun Function2TypeSpecBuilder(
- parameter1: Pair<TypeName, String>,
- parameter2: Pair<TypeName, String>,
- returnTypeName: TypeName,
- callBody: MethodSpec.Builder.() -> Unit
-) = TypeSpec.anonymousClassBuilder("").apply {
- val (param1TypeName, param1Name) = parameter1
- val (param2TypeName, param2Name) = parameter2
- superclass(
- ParameterizedTypeName.get(
- Function2::class.typeName(),
- param1TypeName,
- param2TypeName,
- returnTypeName
- )
- )
- addMethod(MethodSpec.methodBuilder("invoke").apply {
- addParameter(param1TypeName, param1Name)
- addParameter(param2TypeName, param2Name)
- returns(returnTypeName)
- addModifiers(Modifier.PUBLIC)
- addAnnotation(Override::class.java)
- callBody()
- }.build())
-}
diff --git a/room/compiler/src/main/kotlin/androidx/room/kotlin/JvmDescriptorUtils.kt b/room/compiler/src/main/kotlin/androidx/room/kotlin/JvmDescriptorUtils.kt
deleted file mode 100644
index 8e043d1..0000000
--- a/room/compiler/src/main/kotlin/androidx/room/kotlin/JvmDescriptorUtils.kt
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright 2019 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.room.kotlin
-
-import com.google.auto.common.MoreElements
-import javax.lang.model.element.ExecutableElement
-import javax.lang.model.element.NestingKind
-import javax.lang.model.element.TypeElement
-import javax.lang.model.type.ArrayType
-import javax.lang.model.type.DeclaredType
-import javax.lang.model.type.ErrorType
-import javax.lang.model.type.ExecutableType
-import javax.lang.model.type.NoType
-import javax.lang.model.type.NullType
-import javax.lang.model.type.PrimitiveType
-import javax.lang.model.type.TypeKind
-import javax.lang.model.type.TypeMirror
-import javax.lang.model.type.TypeVariable
-import javax.lang.model.type.WildcardType
-import javax.lang.model.util.AbstractTypeVisitor6
-import javax.lang.model.util.Types
-
-/**
- * Returns the method descriptor of this [ExecutableElement].
- *
- * For reference, see the [JVM specification, section 4.3.3](https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.3)
- */
-fun ExecutableElement.descriptor(typeUtils: Types) =
- "$simpleName${asType().descriptor(typeUtils)}"
-
-/**
- * Returns the name of this [TypeElement] in its "internal form".
- *
- * For reference, see the [JVM specification, section 4.2](https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.2).
- */
-internal val TypeElement.internalName: String
- get() = when (nestingKind) {
- NestingKind.TOP_LEVEL ->
- qualifiedName.toString().replace('.', '/')
- NestingKind.MEMBER ->
- MoreElements.asType(enclosingElement).internalName + "$" + simpleName
- NestingKind.LOCAL, NestingKind.ANONYMOUS ->
- error("Unsupported nesting $nestingKind")
- }
-
-internal val NoType.descriptor: String
- get() = "V"
-
-internal val DeclaredType.descriptor: String
- get() = "L" + MoreElements.asType(asElement()).internalName + ";"
-
-internal val PrimitiveType.descriptor: String
- get() = when (this.kind) {
- TypeKind.BYTE -> "B"
- TypeKind.CHAR -> "C"
- TypeKind.DOUBLE -> "D"
- TypeKind.FLOAT -> "F"
- TypeKind.INT -> "I"
- TypeKind.LONG -> "J"
- TypeKind.SHORT -> "S"
- TypeKind.BOOLEAN -> "Z"
- else -> error("Unknown primitive type $this")
- }
-
-fun TypeMirror.descriptor(typeUtils: Types): String =
- accept(JvmDescriptorTypeVisitor, typeUtils)
-
-internal fun WildcardType.descriptor(typeUtils: Types): String =
- typeUtils.erasure(this).descriptor(typeUtils)
-
-internal fun TypeVariable.descriptor(typeUtils: Types): String =
- typeUtils.erasure(this).descriptor(typeUtils)
-
-internal fun ArrayType.descriptor(typeUtils: Types): String =
- "[" + componentType.descriptor(typeUtils)
-
-internal fun ExecutableType.descriptor(typeUtils: Types): String {
- val parameterDescriptors =
- parameterTypes.joinToString(separator = "") { it.descriptor(typeUtils) }
- val returnDescriptor = returnType.descriptor(typeUtils)
- return "($parameterDescriptors)$returnDescriptor"
-}
-
-/**
- * When applied over a type, it returns either:
- * + a "field descriptor", for example: `Ljava/lang/Object;`
- * + a "method descriptor", for example: `(Ljava/lang/Object;)Z`
- *
- * The easiest way to use this is through [TypeMirror.descriptor][JvmDescriptorUtils.descriptor] in [JvmDescriptorUtils].
- *
- * For reference, see the [JVM specification, section 4.3](http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3).
- */
-internal object JvmDescriptorTypeVisitor : AbstractTypeVisitor6<String, Types>() {
- override fun visitNoType(t: NoType, typeUtils: Types): String = t.descriptor
-
- override fun visitDeclared(t: DeclaredType, typeUtils: Types): String = t.descriptor
-
- override fun visitPrimitive(t: PrimitiveType, typeUtils: Types): String = t.descriptor
-
- override fun visitArray(t: ArrayType, typeUtils: Types): String = t.descriptor(typeUtils)
-
- override fun visitWildcard(t: WildcardType, typeUtils: Types): String = t.descriptor(typeUtils)
-
- override fun visitExecutable(t: ExecutableType, typeUtils: Types): String =
- t.descriptor(typeUtils)
-
- override fun visitTypeVariable(t: TypeVariable, typeUtils: Types): String =
- t.descriptor(typeUtils)
-
- override fun visitNull(t: NullType, typeUtils: Types): String =
- visitUnknown(t, typeUtils)
-
- override fun visitError(t: ErrorType, typeUtils: Types): String =
- visitUnknown(t, typeUtils)
-
- override fun visitUnknown(t: TypeMirror, typeUtils: Types): String =
- error("Unsupported type $t")
-}
\ No newline at end of file
diff --git a/room/compiler/src/main/kotlin/androidx/room/kotlin/KotlinClassMetadataUtils.kt b/room/compiler/src/main/kotlin/androidx/room/kotlin/KotlinClassMetadataUtils.kt
deleted file mode 100644
index 9a7effe..0000000
--- a/room/compiler/src/main/kotlin/androidx/room/kotlin/KotlinClassMetadataUtils.kt
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright 2019 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.room.kotlin
-
-import kotlinx.metadata.Flag
-import kotlinx.metadata.Flags
-import kotlinx.metadata.KmClassVisitor
-import kotlinx.metadata.KmConstructorExtensionVisitor
-import kotlinx.metadata.KmConstructorVisitor
-import kotlinx.metadata.KmExtensionType
-import kotlinx.metadata.KmFunctionExtensionVisitor
-import kotlinx.metadata.KmFunctionVisitor
-import kotlinx.metadata.KmValueParameterVisitor
-import kotlinx.metadata.jvm.JvmConstructorExtensionVisitor
-import kotlinx.metadata.jvm.JvmFunctionExtensionVisitor
-import kotlinx.metadata.jvm.JvmMethodSignature
-import kotlinx.metadata.jvm.KotlinClassMetadata
-
-/**
- * Represents the kotlin metadata of a function
- */
-data class KmFunction(
- val descriptor: String,
- private val flags: Flags,
- val parameters: List<KmValueParameter>
-) {
- fun isSuspend() = Flag.Function.IS_SUSPEND(flags)
-}
-
-/**
- * Represents the kotlin metadata of a constructor
- */
-data class KmConstructor(
- val descriptor: String,
- private val flags: Flags,
- val parameters: List<KmValueParameter>
-) {
- fun isPrimary() = Flag.Constructor.IS_PRIMARY(flags)
-}
-
-/**
- * Represents the kotlin metadata of a parameter
- */
-data class KmValueParameter(val name: String, private val flags: Flags)
-
-internal fun KotlinClassMetadata.Class.readFunctions(): List<KmFunction> =
- mutableListOf<KmFunction>().apply { accept(FunctionReader(this)) }
-
-private class FunctionReader(val result: MutableList<KmFunction>) : KmClassVisitor() {
- override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? {
- return object : KmFunctionVisitor() {
-
- lateinit var descriptor: String
- val parameters = mutableListOf<KmValueParameter>()
-
- override fun visitValueParameter(
- flags: Flags,
- name: String
- ): KmValueParameterVisitor? {
- parameters.add(KmValueParameter(name, flags))
- return super.visitValueParameter(flags, name)
- }
-
- override fun visitExtensions(type: KmExtensionType): KmFunctionExtensionVisitor? {
- if (type != JvmFunctionExtensionVisitor.TYPE) {
- error("Unsupported extension type: $type")
- }
- return object : JvmFunctionExtensionVisitor() {
- override fun visit(desc: JvmMethodSignature?) {
- descriptor = desc!!.asString()
- }
- }
- }
-
- override fun visitEnd() {
- result.add(KmFunction(descriptor, flags, parameters))
- }
- }
- }
-}
-
-internal fun KotlinClassMetadata.Class.readConstructors(): List<KmConstructor> =
- mutableListOf<KmConstructor>().apply { accept(ConstructorReader(this)) }
-
-private class ConstructorReader(val result: MutableList<KmConstructor>) : KmClassVisitor() {
- override fun visitConstructor(flags: Flags): KmConstructorVisitor? {
- return object : KmConstructorVisitor() {
-
- lateinit var descriptor: String
- val parameters = mutableListOf<KmValueParameter>()
-
- override fun visitValueParameter(
- flags: Flags,
- name: String
- ): KmValueParameterVisitor? {
- parameters.add(KmValueParameter(name, flags))
- return super.visitValueParameter(flags, name)
- }
-
- override fun visitExtensions(type: KmExtensionType): KmConstructorExtensionVisitor? {
- if (type != JvmConstructorExtensionVisitor.TYPE) {
- error("Unsupported extension type: $type")
- }
- return object : JvmConstructorExtensionVisitor() {
- override fun visit(desc: JvmMethodSignature?) {
- descriptor = desc!!.asString()
- }
- }
- }
-
- override fun visitEnd() {
- result.add(KmConstructor(descriptor, flags, parameters))
- }
- }
- }
-}
\ No newline at end of file
diff --git a/room/compiler/src/main/kotlin/androidx/room/kotlin/KotlinMetadataElement.kt b/room/compiler/src/main/kotlin/androidx/room/kotlin/KotlinMetadataElement.kt
deleted file mode 100644
index 1db7d37..0000000
--- a/room/compiler/src/main/kotlin/androidx/room/kotlin/KotlinMetadataElement.kt
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright 2019 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.room.kotlin
-
-import androidx.room.processor.Context
-import kotlinx.metadata.jvm.KotlinClassHeader
-import kotlinx.metadata.jvm.KotlinClassMetadata
-import javax.lang.model.element.Element
-import javax.lang.model.element.ExecutableElement
-
-/**
- * Utility class for processors that wants to run kotlin specific code.
- */
-class KotlinMetadataElement(
- val context: Context,
- val element: Element,
- private val classMetadata: KotlinClassMetadata.Class
-) {
-
- private val functionList: List<KmFunction> by lazy { classMetadata.readFunctions() }
- private val constructorList: List<KmConstructor> by lazy { classMetadata.readConstructors() }
-
- private val ExecutableElement.descriptor: String
- get() = descriptor(context.processingEnv.typeUtils)
-
- /**
- * Returns the parameter names of the function or constructor if all have names embedded in the
- * metadata.
- */
- fun getParameterNames(method: ExecutableElement): List<String>? {
- val methodSignature = method.descriptor
- val paramList =
- functionList.firstOrNull { it.descriptor == methodSignature }?.parameters
- ?: constructorList.firstOrNull { it.descriptor == methodSignature }?.parameters
- return paramList?.map { it.name }
- }
-
- /**
- * Finds the primary constructor descriptor of the class.
- */
- fun findPrimaryConstructorSignature() = constructorList.first { it.isPrimary() }.descriptor
-
- /**
- * Checks if a method is a suspend function.
- */
- fun isSuspendFunction(method: ExecutableElement) = functionList.firstOrNull {
- it.descriptor == method.descriptor
- }?.isSuspend() ?: false
-
- companion object {
-
- /**
- * Creates a [KotlinMetadataElement] for the given element if it contains Kotlin metadata,
- * otherwise this method returns null.
- *
- * Usually the [element] passed must represent a class. For example, if kotlin metadata is
- * desired for a method, then the containing method should be used as parameter.
- */
- fun createFor(context: Context, element: Element): KotlinMetadataElement? {
- val metadata = getMetadataAnnotation(element)?.run {
- KotlinClassHeader(
- kind = kind,
- metadataVersion = metadataVersion,
- bytecodeVersion = bytecodeVersion,
- data1 = data1,
- data2 = data2,
- extraString = extraString,
- packageName = packageName,
- extraInt = extraInt
- ).let {
- // TODO: Support more metadata kind (file facade, synthetic class, etc...)
- KotlinClassMetadata.read(it) as? KotlinClassMetadata.Class
- }
- }
- return if (metadata != null) {
- KotlinMetadataElement(context, element, metadata)
- } else {
- context.logger.d(
- element, "Failed to read get kotlin metadata for %s", element)
- null
- }
- }
-
- /**
- * Search for Kotlin's Metadata annotation across the element's hierarchy.
- */
- private fun getMetadataAnnotation(element: Element?): Metadata? =
- if (element != null) {
- element.getAnnotation(Metadata::class.java)
- ?: getMetadataAnnotation(element.enclosingElement)
- } else {
- null
- }
- }
-}
\ No newline at end of file
diff --git a/room/compiler/src/main/kotlin/androidx/room/processor/MethodProcessorDelegate.kt b/room/compiler/src/main/kotlin/androidx/room/processor/MethodProcessorDelegate.kt
index 8dc5742..cbadf55 100644
--- a/room/compiler/src/main/kotlin/androidx/room/processor/MethodProcessorDelegate.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/processor/MethodProcessorDelegate.kt
@@ -16,13 +16,13 @@
package androidx.room.processor
+import androidx.room.ext.KotlinMetadataElement
import androidx.room.ext.KotlinTypeNames
import androidx.room.ext.L
import androidx.room.ext.N
import androidx.room.ext.RoomCoroutinesTypeNames
import androidx.room.ext.T
import androidx.room.ext.getSuspendFunctionReturnType
-import androidx.room.kotlin.KotlinMetadataElement
import androidx.room.parser.ParsedQuery
import androidx.room.solver.prepared.binder.CallablePreparedQueryResultBinder.Companion.createPreparedBinder
import androidx.room.solver.prepared.binder.PreparedQueryResultBinder
@@ -32,13 +32,8 @@
import androidx.room.solver.shortcut.binder.CallableInsertMethodBinder.Companion.createInsertBinder
import androidx.room.solver.shortcut.binder.DeleteOrUpdateMethodBinder
import androidx.room.solver.shortcut.binder.InsertMethodBinder
-import androidx.room.solver.transaction.binder.InstantTransactionMethodBinder
-import androidx.room.solver.transaction.binder.CoroutineTransactionMethodBinder
-import androidx.room.solver.transaction.binder.TransactionMethodBinder
-import androidx.room.solver.transaction.result.TransactionMethodAdapter
import androidx.room.vo.QueryParameter
import androidx.room.vo.ShortcutQueryParameter
-import androidx.room.vo.TransactionMethod
import com.google.auto.common.MoreTypes
import javax.lang.model.element.ExecutableElement
import javax.lang.model.element.VariableElement
@@ -85,10 +80,6 @@
abstract fun findDeleteOrUpdateMethodBinder(returnType: TypeMirror): DeleteOrUpdateMethodBinder
- abstract fun findTransactionMethodBinder(
- callType: TransactionMethod.CallType
- ): TransactionMethodBinder
-
companion object {
fun createFor(
context: Context,
@@ -153,10 +144,6 @@
override fun findDeleteOrUpdateMethodBinder(returnType: TypeMirror) =
context.typeAdapterStore.findDeleteOrUpdateMethodBinder(returnType)
-
- override fun findTransactionMethodBinder(callType: TransactionMethod.CallType) =
- InstantTransactionMethodBinder(
- TransactionMethodAdapter(executableElement.simpleName.toString(), callType))
}
/**
@@ -238,10 +225,4 @@
continuationParam.simpleName.toString()
)
}
-
- override fun findTransactionMethodBinder(callType: TransactionMethod.CallType) =
- CoroutineTransactionMethodBinder(
- adapter = TransactionMethodAdapter(executableElement.simpleName.toString(), callType),
- continuationParamName = continuationParam.simpleName.toString()
- )
}
\ No newline at end of file
diff --git a/room/compiler/src/main/kotlin/androidx/room/processor/PojoProcessor.kt b/room/compiler/src/main/kotlin/androidx/room/processor/PojoProcessor.kt
index 3f4fea9..45ebe64 100644
--- a/room/compiler/src/main/kotlin/androidx/room/processor/PojoProcessor.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/processor/PojoProcessor.kt
@@ -20,6 +20,7 @@
import androidx.room.Embedded
import androidx.room.Ignore
import androidx.room.Relation
+import androidx.room.ext.KotlinMetadataElement
import androidx.room.ext.extendsBoundOrSelf
import androidx.room.ext.getAllFieldsIncludingPrivateSupers
import androidx.room.ext.hasAnnotation
@@ -28,8 +29,6 @@
import androidx.room.ext.isCollection
import androidx.room.ext.toAnnotationBox
import androidx.room.ext.typeName
-import androidx.room.kotlin.KotlinMetadataElement
-import androidx.room.kotlin.descriptor
import androidx.room.processor.ProcessorErrors.CANNOT_FIND_GETTER_FOR_FIELD
import androidx.room.processor.ProcessorErrors.CANNOT_FIND_SETTER_FOR_FIELD
import androidx.room.processor.ProcessorErrors.CANNOT_FIND_TYPE
@@ -376,7 +375,7 @@
val primaryConstructor =
kotlinMetadata?.findPrimaryConstructorSignature()?.let { signature ->
goodConstructors.firstOrNull {
- it.element.descriptor(context.processingEnv.typeUtils) == signature
+ kotlinMetadata.getMethodSignature(it.element) == signature
}
}
if (primaryConstructor != null) {
diff --git a/room/compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt b/room/compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
index f2eb6cd..98fe63a 100644
--- a/room/compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
@@ -513,8 +513,8 @@
val MISSING_ROOM_RXJAVA2_ARTIFACT = "To use RxJava2 features, you must add `rxjava2`" +
" artifact from Room as a dependency. androidx.room:room-rxjava2:<version>"
- val MISSING_ROOM_COROUTINE_ARTIFACT = "To use Coroutine features, you must add `ktx`" +
- " artifact from Room as a dependency. androidx.room:room-ktx:<version>"
+ val MISSING_ROOM_COROUTINE_ARTIFACT = "To use Coroutine features, you must add `coroutine`" +
+ " artifact from Room as a dependency. androidx.room:room-coroutines:<version>"
fun ambigiousConstructor(
pojo: String,
diff --git a/room/compiler/src/main/kotlin/androidx/room/processor/TransactionMethodProcessor.kt b/room/compiler/src/main/kotlin/androidx/room/processor/TransactionMethodProcessor.kt
index 7467f5b..5716a15 100644
--- a/room/compiler/src/main/kotlin/androidx/room/processor/TransactionMethodProcessor.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/processor/TransactionMethodProcessor.kt
@@ -38,7 +38,6 @@
val context = baseContext.fork(executableElement)
fun process(): TransactionMethod {
- val delegate = MethodProcessorDelegate.createFor(context, containing, executableElement)
val kotlinDefaultImpl =
executableElement.findKotlinDefaultImpl(context.processingEnv.typeUtils)
context.checker.check(
@@ -46,12 +45,11 @@
(!executableElement.hasAnyOf(ABSTRACT) || kotlinDefaultImpl != null),
executableElement, ProcessorErrors.TRANSACTION_METHOD_MODIFIERS)
- val returnType = delegate.extractReturnType()
- val erasureReturnType = context.processingEnv.typeUtils.erasure(returnType)
+ val returnType = context.processingEnv.typeUtils.erasure(executableElement.returnType)
DEFERRED_TYPES.firstOrNull { className ->
context.processingEnv.elementUtils.getTypeElement(className.toString())?.asType()?.let {
- context.processingEnv.typeUtils.isAssignable(it, erasureReturnType)
+ context.processingEnv.typeUtils.isAssignable(it, returnType)
} ?: false
}?.let { returnTypeName ->
context.logger.e(
@@ -71,10 +69,8 @@
return TransactionMethod(
element = executableElement,
- returnType = returnType,
- parameterNames = delegate.extractParams().map { it.simpleName.toString() },
- callType = callType,
- methodBinder = delegate.findTransactionMethodBinder(callType))
+ name = executableElement.simpleName.toString(),
+ callType = callType)
}
companion object {
diff --git a/room/compiler/src/main/kotlin/androidx/room/solver/CodeGenScope.kt b/room/compiler/src/main/kotlin/androidx/room/solver/CodeGenScope.kt
index ff8021f..ca6a11d 100644
--- a/room/compiler/src/main/kotlin/androidx/room/solver/CodeGenScope.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/solver/CodeGenScope.kt
@@ -58,7 +58,7 @@
return result
}
- fun generate(): CodeBlock = builder().build()
+ fun generate() = builder().build().toString()
/**
* copies all variable indices but excludes generated code.
diff --git a/room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/CallablePreparedQueryResultBinder.kt b/room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/CallablePreparedQueryResultBinder.kt
index 74b084f..962caa5 100644
--- a/room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/CallablePreparedQueryResultBinder.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/CallablePreparedQueryResultBinder.kt
@@ -47,7 +47,7 @@
}
override fun executeAndReturn(
- prepareQueryStmtBlock: CodeGenScope.() -> String,
+ stmtQueryVal: String,
preparedStmtField: String?,
dbField: FieldSpec,
scope: CodeGenScope
@@ -55,7 +55,7 @@
val binderScope = scope.fork()
val callableImpl = CallableTypeSpecBuilder(returnType.typeName()) {
adapter?.executeAndReturn(
- binderScope.prepareQueryStmtBlock(),
+ stmtQueryVal,
preparedStmtField,
dbField,
binderScope)
diff --git a/room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/InstantPreparedQueryResultBinder.kt b/room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/InstantPreparedQueryResultBinder.kt
index 7a35230..3e2b6ad 100644
--- a/room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/InstantPreparedQueryResultBinder.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/InstantPreparedQueryResultBinder.kt
@@ -16,10 +16,8 @@
package androidx.room.solver.prepared.binder
-import androidx.room.ext.N
import androidx.room.solver.CodeGenScope
import androidx.room.solver.prepared.result.PreparedQueryResultAdapter
-import androidx.room.writer.DaoWriter
import com.squareup.javapoet.FieldSpec
/**
@@ -29,16 +27,13 @@
: PreparedQueryResultBinder(adapter) {
override fun executeAndReturn(
- prepareQueryStmtBlock: CodeGenScope.() -> String,
+ stmtQueryVal: String,
preparedStmtField: String?,
dbField: FieldSpec,
scope: CodeGenScope
) {
- scope.builder().apply {
- addStatement("$N.assertNotSuspendingTransaction()", DaoWriter.dbField)
- }
adapter?.executeAndReturn(
- stmtQueryVal = scope.prepareQueryStmtBlock(),
+ stmtQueryVal = stmtQueryVal,
preparedStmtField = preparedStmtField,
dbField = dbField,
scope = scope)
diff --git a/room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/PreparedQueryResultBinder.kt b/room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/PreparedQueryResultBinder.kt
index 4abb792..1128c58 100644
--- a/room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/PreparedQueryResultBinder.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/solver/prepared/binder/PreparedQueryResultBinder.kt
@@ -29,11 +29,10 @@
*/
abstract class PreparedQueryResultBinder(val adapter: PreparedQueryResultAdapter?) {
/**
- * Receives a function that will prepare the query in a given scope to then generate the code
- * that runs the query and returns the result.
+ * Receives a prepared query to generate the code to run the query and return the result
*/
abstract fun executeAndReturn(
- prepareQueryStmtBlock: CodeGenScope.() -> String,
+ stmtQueryVal: String,
preparedStmtField: String?, // null when the query is not shared
dbField: FieldSpec,
scope: CodeGenScope
diff --git a/room/compiler/src/main/kotlin/androidx/room/solver/query/result/InstantQueryResultBinder.kt b/room/compiler/src/main/kotlin/androidx/room/solver/query/result/InstantQueryResultBinder.kt
index 156117c..65b2be9 100644
--- a/room/compiler/src/main/kotlin/androidx/room/solver/query/result/InstantQueryResultBinder.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/solver/query/result/InstantQueryResultBinder.kt
@@ -21,7 +21,6 @@
import androidx.room.ext.RoomTypeNames
import androidx.room.ext.T
import androidx.room.solver.CodeGenScope
-import androidx.room.writer.DaoWriter
import com.squareup.javapoet.FieldSpec
/**
@@ -35,9 +34,6 @@
inTransaction: Boolean,
scope: CodeGenScope
) {
- scope.builder().apply {
- addStatement("$N.assertNotSuspendingTransaction()", DaoWriter.dbField)
- }
val transactionWrapper = if (inTransaction) {
scope.builder().transactionWrapper(dbField)
} else {
diff --git a/room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantDeleteOrUpdateMethodBinder.kt b/room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantDeleteOrUpdateMethodBinder.kt
index 2db1aa3..f48e0fd 100644
--- a/room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantDeleteOrUpdateMethodBinder.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantDeleteOrUpdateMethodBinder.kt
@@ -16,11 +16,9 @@
package androidx.room.solver.shortcut.binder
-import androidx.room.ext.N
import androidx.room.solver.CodeGenScope
import androidx.room.vo.ShortcutQueryParameter
import androidx.room.solver.shortcut.result.DeleteOrUpdateMethodAdapter
-import androidx.room.writer.DaoWriter
import com.squareup.javapoet.FieldSpec
import com.squareup.javapoet.TypeSpec
@@ -37,9 +35,6 @@
dbField: FieldSpec,
scope: CodeGenScope
) {
- scope.builder().apply {
- addStatement("$N.assertNotSuspendingTransaction()", DaoWriter.dbField)
- }
adapter?.createDeleteOrUpdateMethodBody(
parameters = parameters,
adapters = adapters,
diff --git a/room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantInsertMethodBinder.kt b/room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantInsertMethodBinder.kt
index 7d8d2c1..00490ef0 100644
--- a/room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantInsertMethodBinder.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/solver/shortcut/binder/InstantInsertMethodBinder.kt
@@ -16,11 +16,9 @@
package androidx.room.solver.shortcut.binder
-import androidx.room.ext.N
import androidx.room.solver.CodeGenScope
import androidx.room.vo.ShortcutQueryParameter
import androidx.room.solver.shortcut.result.InsertMethodAdapter
-import androidx.room.writer.DaoWriter
import com.squareup.javapoet.FieldSpec
import com.squareup.javapoet.TypeSpec
@@ -35,9 +33,6 @@
dbField: FieldSpec,
scope: CodeGenScope
) {
- scope.builder().apply {
- addStatement("$N.assertNotSuspendingTransaction()", DaoWriter.dbField)
- }
adapter?.createInsertionMethodBody(
parameters = parameters,
insertionAdapters = insertionAdapters,
diff --git a/room/compiler/src/main/kotlin/androidx/room/solver/transaction/binder/CoroutineTransactionMethodBinder.kt b/room/compiler/src/main/kotlin/androidx/room/solver/transaction/binder/CoroutineTransactionMethodBinder.kt
deleted file mode 100644
index 7e32350..0000000
--- a/room/compiler/src/main/kotlin/androidx/room/solver/transaction/binder/CoroutineTransactionMethodBinder.kt
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2019 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.room.solver.transaction.binder
-
-import androidx.room.ext.Function2TypeSpecBuilder
-import androidx.room.ext.KotlinTypeNames.CONTINUATION
-import androidx.room.ext.KotlinTypeNames.COROUTINE_SCOPE
-import androidx.room.ext.L
-import androidx.room.ext.N
-import androidx.room.ext.RoomTypeNames.ROOM_DB_KT
-import androidx.room.ext.T
-import androidx.room.ext.typeName
-import androidx.room.solver.CodeGenScope
-import androidx.room.solver.transaction.result.TransactionMethodAdapter
-import com.squareup.javapoet.ClassName
-import com.squareup.javapoet.FieldSpec
-import com.squareup.javapoet.ParameterizedTypeName
-import com.squareup.javapoet.WildcardTypeName
-import javax.lang.model.type.TypeMirror
-
-/**
- * Binder that knows how to write suspending transaction wrapper methods.
- */
-class CoroutineTransactionMethodBinder(
- adapter: TransactionMethodAdapter,
- private val continuationParamName: String
-) : TransactionMethodBinder(adapter) {
- override fun executeAndReturn(
- returnType: TypeMirror,
- parameterNames: List<String>,
- daoName: ClassName,
- daoImplName: ClassName,
- dbField: FieldSpec,
- scope: CodeGenScope
- ) {
- val scopeParamName = "__scope"
- val innerContinuationParamName = "__cont"
- val functionImpl = Function2TypeSpecBuilder(
- parameter1 = COROUTINE_SCOPE to scopeParamName,
- parameter2 = ParameterizedTypeName.get(
- CONTINUATION,
- WildcardTypeName.supertypeOf(returnType.typeName())
- ) to innerContinuationParamName,
- returnTypeName = ClassName.OBJECT
- ) {
- val adapterScope = scope.fork()
- adapter.createDelegateToSuperStatement(
- returnType = returnType,
- parameterNames = parameterNames + innerContinuationParamName,
- daoName = daoName,
- daoImplName = daoImplName,
- returnStmt = true,
- scope = adapterScope
- )
- addCode(adapterScope.generate())
- }.build()
-
- scope.builder().apply {
- addStatement(
- "return $T.withTransaction($N, $L, $N)",
- ROOM_DB_KT, dbField, functionImpl, continuationParamName
- )
- }
- }
-}
\ No newline at end of file
diff --git a/room/compiler/src/main/kotlin/androidx/room/solver/transaction/binder/InstantTransactionMethodBinder.kt b/room/compiler/src/main/kotlin/androidx/room/solver/transaction/binder/InstantTransactionMethodBinder.kt
deleted file mode 100644
index b11bb37..0000000
--- a/room/compiler/src/main/kotlin/androidx/room/solver/transaction/binder/InstantTransactionMethodBinder.kt
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2019 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.room.solver.transaction.binder
-
-import androidx.room.ext.N
-import androidx.room.solver.CodeGenScope
-import androidx.room.solver.transaction.result.TransactionMethodAdapter
-import com.squareup.javapoet.ClassName
-import com.squareup.javapoet.FieldSpec
-import javax.lang.model.type.TypeKind
-import javax.lang.model.type.TypeMirror
-
-/**
- * Binder that knows how to write instant (blocking) transaction wrapper methods.
- */
-class InstantTransactionMethodBinder(
- adapter: TransactionMethodAdapter
-) : TransactionMethodBinder(adapter) {
- override fun executeAndReturn(
- returnType: TypeMirror,
- parameterNames: List<String>,
- daoName: ClassName,
- daoImplName: ClassName,
- dbField: FieldSpec,
- scope: CodeGenScope
- ) {
- scope.builder().apply {
- addStatement("$N.beginTransaction()", dbField)
- beginControlFlow("try").apply {
- val returnsValue = returnType.kind != TypeKind.VOID
- val resultVar = if (returnsValue) {
- scope.getTmpVar("_result")
- } else {
- null
- }
-
- val adapterScope = scope.fork()
- adapter.createDelegateToSuperStatement(
- returnType = returnType,
- parameterNames = parameterNames,
- daoName = daoName,
- daoImplName = daoImplName,
- resultVar = resultVar,
- scope = adapterScope
- )
- add(adapterScope.generate())
-
- addStatement("$N.setTransactionSuccessful()", dbField)
- if (returnsValue) {
- addStatement("return $N", resultVar)
- }
- }
- nextControlFlow("finally").apply {
- addStatement("$N.endTransaction()", dbField)
- }
- endControlFlow()
- }
- }
-}
\ No newline at end of file
diff --git a/room/compiler/src/main/kotlin/androidx/room/solver/transaction/binder/TransactionMethodBinder.kt b/room/compiler/src/main/kotlin/androidx/room/solver/transaction/binder/TransactionMethodBinder.kt
deleted file mode 100644
index a9b6d7c..0000000
--- a/room/compiler/src/main/kotlin/androidx/room/solver/transaction/binder/TransactionMethodBinder.kt
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2019 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.room.solver.transaction.binder
-
-import androidx.room.solver.CodeGenScope
-import androidx.room.solver.transaction.result.TransactionMethodAdapter
-import com.squareup.javapoet.ClassName
-import com.squareup.javapoet.FieldSpec
-import javax.lang.model.type.TypeMirror
-
-/**
- * Connects a transaction method, database and a [TransactionMethodAdapter].
- *
- * The default implementation is [InstantTransactionMethodBinder] that executes the transaction
- * synchronously. Other deferred transactions are unsupported expect for coroutines, for such
- * binding then [CoroutineTransactionMethodBinder] is used.
- */
-abstract class TransactionMethodBinder(val adapter: TransactionMethodAdapter) {
-
- /**
- * Receives the method's return type, parameters along with the Dao class names to generate the
- * transaction wrapper body that delegates to the non-abstract or default dao method.
- */
- abstract fun executeAndReturn(
- returnType: TypeMirror,
- parameterNames: List<String>,
- daoName: ClassName,
- daoImplName: ClassName,
- dbField: FieldSpec,
- scope: CodeGenScope
- )
-}
\ No newline at end of file
diff --git a/room/compiler/src/main/kotlin/androidx/room/solver/transaction/result/TransactionMethodAdapter.kt b/room/compiler/src/main/kotlin/androidx/room/solver/transaction/result/TransactionMethodAdapter.kt
deleted file mode 100644
index 0df5ca1..0000000
--- a/room/compiler/src/main/kotlin/androidx/room/solver/transaction/result/TransactionMethodAdapter.kt
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2019 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.room.solver.transaction.result
-
-import androidx.room.ext.DEFAULT_IMPLS_CLASS_NAME
-import androidx.room.ext.L
-import androidx.room.ext.N
-import androidx.room.ext.T
-import androidx.room.solver.CodeGenScope
-import androidx.room.vo.TransactionMethod
-import com.squareup.javapoet.ClassName
-import java.lang.IllegalStateException
-import javax.lang.model.type.TypeMirror
-
-/**
- * Class that knows how to generate the transaction method delegate statement.
- */
-class TransactionMethodAdapter(
- private val methodName: String,
- private val callType: TransactionMethod.CallType
-) {
- fun createDelegateToSuperStatement(
- returnType: TypeMirror,
- parameterNames: List<String>,
- daoName: ClassName,
- daoImplName: ClassName,
- resultVar: String? = null, // name of result var to assign to, null if none
- returnStmt: Boolean = false, // true or false to prepend statement with 'return'
- scope: CodeGenScope
- ) {
- scope.builder().apply {
- val params: MutableList<Any> = mutableListOf()
- val format = buildString {
- if (resultVar != null && returnStmt) {
- throw IllegalStateException(
- "Can't assign to var and return in the same statement.")
- } else if (resultVar != null) {
- append("$T $L = ")
- params.add(returnType)
- params.add(resultVar)
- } else if (returnStmt) {
- append("return ")
- }
- when (callType) {
- TransactionMethod.CallType.CONCRETE -> {
- append("$T.super.$N(")
- params.add(daoImplName)
- params.add(methodName)
- }
- TransactionMethod.CallType.DEFAULT_JAVA8 -> {
- append("$T.super.$N(")
- params.add(daoName)
- params.add(methodName)
- }
- TransactionMethod.CallType.DEFAULT_KOTLIN -> {
- append("$T.$N.$N($T.this")
- params.add(daoName)
- params.add(DEFAULT_IMPLS_CLASS_NAME)
- params.add(methodName)
- params.add(daoImplName)
- }
- }
- var first = callType != TransactionMethod.CallType.DEFAULT_KOTLIN
- parameterNames.forEach {
- if (first) {
- first = false
- } else {
- append(", ")
- }
- append(L)
- params.add(it)
- }
- append(")")
- }
- addStatement(format, *params.toTypedArray())
- }
- }
-}
\ No newline at end of file
diff --git a/room/compiler/src/main/kotlin/androidx/room/vo/FtsOptions.kt b/room/compiler/src/main/kotlin/androidx/room/vo/FtsOptions.kt
index c886887..f3ec081 100644
--- a/room/compiler/src/main/kotlin/androidx/room/vo/FtsOptions.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/vo/FtsOptions.kt
@@ -46,8 +46,7 @@
fun databaseDefinition(includeTokenizer: Boolean = true): List<String> {
return mutableListOf<String>().apply {
- if (includeTokenizer && (tokenizer != androidx.room.FtsOptions.TOKENIZER_SIMPLE ||
- tokenizerArgs.isNotEmpty())) {
+ if (includeTokenizer && tokenizer != androidx.room.FtsOptions.TOKENIZER_SIMPLE) {
val tokenizeAndArgs = listOf("tokenize=$tokenizer") +
tokenizerArgs.map { "`$it`" }
add(tokenizeAndArgs.joinToString(separator = " "))
diff --git a/room/compiler/src/main/kotlin/androidx/room/vo/TransactionMethod.kt b/room/compiler/src/main/kotlin/androidx/room/vo/TransactionMethod.kt
index ff9af62..9457f43 100644
--- a/room/compiler/src/main/kotlin/androidx/room/vo/TransactionMethod.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/vo/TransactionMethod.kt
@@ -16,17 +16,9 @@
package androidx.room.vo
-import androidx.room.solver.transaction.binder.TransactionMethodBinder
import javax.lang.model.element.ExecutableElement
-import javax.lang.model.type.TypeMirror
-class TransactionMethod(
- val element: ExecutableElement,
- val returnType: TypeMirror,
- val parameterNames: List<String>,
- val callType: CallType,
- val methodBinder: TransactionMethodBinder
-) {
+class TransactionMethod(val element: ExecutableElement, val name: String, val callType: CallType) {
enum class CallType {
CONCRETE, DEFAULT_JAVA8, DEFAULT_KOTLIN
}
diff --git a/room/compiler/src/main/kotlin/androidx/room/writer/ClassWriter.kt b/room/compiler/src/main/kotlin/androidx/room/writer/ClassWriter.kt
index 5d02780..c9076ae 100644
--- a/room/compiler/src/main/kotlin/androidx/room/writer/ClassWriter.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/writer/ClassWriter.kt
@@ -45,26 +45,23 @@
sharedFieldSpecs.values.forEach { builder.addField(it) }
sharedMethodSpecs.values.forEach { builder.addMethod(it) }
addGeneratedAnnotationIfAvailable(builder, processingEnv)
- addSuppressWarnings(builder)
+ addSuppressUnchecked(builder)
JavaFile.builder(className.packageName(), builder.build())
- .build()
- .writeTo(processingEnv.filer)
+ .build()
+ .writeTo(processingEnv.filer)
}
- private fun addSuppressWarnings(builder: TypeSpec.Builder) {
- val suppressSpec = AnnotationSpec.builder(SuppressWarnings::class.typeName())
- .addMember(
+ private fun addSuppressUnchecked(builder: TypeSpec.Builder) {
+ val suppressSpec = AnnotationSpec.builder(SuppressWarnings::class.typeName()).addMember(
"value",
- "{$S, $S}",
- "unchecked", "deprecation"
- ).build()
+ S,
+ "unchecked"
+ ).build()
builder.addAnnotation(suppressSpec)
}
- private fun addGeneratedAnnotationIfAvailable(
- adapterTypeSpecBuilder: TypeSpec.Builder,
- processingEnv: ProcessingEnvironment
- ) {
+ private fun addGeneratedAnnotationIfAvailable(adapterTypeSpecBuilder: TypeSpec.Builder,
+ processingEnv: ProcessingEnvironment) {
val generatedAnnotationAvailable = processingEnv
.elementUtils
.getTypeElement("$GENERATED_PACKAGE.$GENERATED_NAME") != null
diff --git a/room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt b/room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
index d493f22..7fd416b 100644
--- a/room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
+++ b/room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
@@ -24,14 +24,14 @@
import androidx.room.processor.OnConflictProcessor
import androidx.room.solver.CodeGenScope
import androidx.room.vo.Dao
+import androidx.room.vo.ReadQueryMethod
import androidx.room.vo.Entity
import androidx.room.vo.InsertionMethod
+import androidx.room.vo.WriteQueryMethod
import androidx.room.vo.QueryMethod
import androidx.room.vo.RawQueryMethod
-import androidx.room.vo.ReadQueryMethod
import androidx.room.vo.ShortcutMethod
import androidx.room.vo.TransactionMethod
-import androidx.room.vo.WriteQueryMethod
import com.google.auto.common.MoreTypes
import com.squareup.javapoet.ClassName
import com.squareup.javapoet.CodeBlock
@@ -40,6 +40,7 @@
import com.squareup.javapoet.ParameterSpec
import com.squareup.javapoet.TypeName
import com.squareup.javapoet.TypeSpec
+import me.eugeniomarletti.kotlin.metadata.shadow.load.java.JvmAbi
import stripNonJava
import javax.annotation.processing.ProcessingEnvironment
import javax.lang.model.element.ElementKind
@@ -48,6 +49,7 @@
import javax.lang.model.element.Modifier.PRIVATE
import javax.lang.model.element.Modifier.PUBLIC
import javax.lang.model.type.DeclaredType
+import javax.lang.model.type.TypeKind
/**
* Creates the implementation for a class annotated with Dao.
@@ -141,22 +143,23 @@
queryWriter: QueryWriter
): MethodSpec {
val scope = CodeGenScope(this)
- method.preparedQueryResultBinder.executeAndReturn(
- prepareQueryStmtBlock = {
- val stmtName = getTmpVar("_stmt")
- builder().apply {
- addStatement("final $T $L = $N.acquire()",
- SupportDbTypeNames.SQLITE_STMT, stmtName, preparedStmtField)
- }
- queryWriter.bindArgs(stmtName, emptyList(), this)
- stmtName
- },
- preparedStmtField = preparedStmtField.name,
- dbField = dbField,
- scope = scope)
- return overrideWithoutAnnotations(method.element, declaredDao)
- .addCode(scope.generate())
- .build()
+ val methodBuilder = overrideWithoutAnnotations(method.element, declaredDao).apply {
+ val stmtName = scope.getTmpVar("_stmt")
+ addStatement("final $T $L = $N.acquire()",
+ SupportDbTypeNames.SQLITE_STMT, stmtName, preparedStmtField)
+ val bindScope = scope.fork()
+ queryWriter.bindArgs(stmtName, emptyList(), bindScope)
+ addCode(bindScope.builder().build())
+
+ val binderScope = scope.fork()
+ method.preparedQueryResultBinder.executeAndReturn(
+ stmtQueryVal = stmtName,
+ preparedStmtField = preparedStmtField.name,
+ dbField = dbField,
+ scope = binderScope)
+ addCode(binderScope.builder().build())
+ }
+ return methodBuilder.build()
}
private fun createTransactionMethods(): List<PreparedStmtQuery> {
@@ -167,16 +170,71 @@
private fun createTransactionMethodBody(method: TransactionMethod): MethodSpec {
val scope = CodeGenScope(this)
- method.methodBinder.executeAndReturn(
- returnType = method.returnType,
- parameterNames = method.parameterNames,
- daoName = dao.typeName,
- daoImplName = dao.implTypeName,
- dbField = dbField,
- scope = scope)
- return overrideWithoutAnnotations(method.element, declaredDao)
- .addCode(scope.generate())
- .build()
+ val methodBuilder = overrideWithoutAnnotations(method.element, declaredDao).apply {
+ addStatement("$N.beginTransaction()", dbField)
+ beginControlFlow("try").apply {
+ val returnsValue = method.element.returnType.kind != TypeKind.VOID
+ val resultVar = if (returnsValue) {
+ scope.getTmpVar("_result")
+ } else {
+ null
+ }
+ addDelegateToSuperStatement(method.element, method.callType, resultVar)
+ addStatement("$N.setTransactionSuccessful()", dbField)
+ if (returnsValue) {
+ addStatement("return $N", resultVar)
+ }
+ }
+ nextControlFlow("finally").apply {
+ addStatement("$N.endTransaction()", dbField)
+ }
+ endControlFlow()
+ }
+ return methodBuilder.build()
+ }
+
+ private fun MethodSpec.Builder.addDelegateToSuperStatement(
+ element: ExecutableElement,
+ callType: TransactionMethod.CallType,
+ result: String?
+ ) {
+ val params: MutableList<Any> = mutableListOf()
+ val format = buildString {
+ if (result != null) {
+ append("$T $L = ")
+ params.add(element.returnType)
+ params.add(result)
+ }
+ when (callType) {
+ TransactionMethod.CallType.CONCRETE -> {
+ append("super.$N(")
+ params.add(element.simpleName)
+ }
+ TransactionMethod.CallType.DEFAULT_JAVA8 -> {
+ append("$N.super.$N(")
+ params.add(element.enclosingElement.simpleName)
+ params.add(element.simpleName)
+ }
+ TransactionMethod.CallType.DEFAULT_KOTLIN -> {
+ append("$N.$N.$N(this")
+ params.add(element.enclosingElement.simpleName)
+ params.add(JvmAbi.DEFAULT_IMPLS_CLASS_NAME)
+ params.add(element.simpleName)
+ }
+ }
+ var first = callType != TransactionMethod.CallType.DEFAULT_KOTLIN
+ element.parameters.forEach {
+ if (first) {
+ first = false
+ } else {
+ append(", ")
+ }
+ append(L)
+ params.add(it.simpleName)
+ }
+ append(")")
+ }
+ addStatement(format, *params.toTypedArray())
}
private fun createConstructor(
@@ -376,26 +434,25 @@
}
private fun createPreparedQueryMethodBody(method: WriteQueryMethod): CodeBlock {
+ val queryWriter = QueryWriter(method)
val scope = CodeGenScope(this)
- method.preparedQueryResultBinder.executeAndReturn(
- prepareQueryStmtBlock = {
- val queryWriter = QueryWriter(method)
- val sqlVar = getTmpVar("_sql")
- val stmtVar = getTmpVar("_stmt")
- val listSizeArgs = queryWriter.prepareQuery(sqlVar, this)
- builder().apply {
- addStatement(
- "final $T $L = $N.compileStatement($L)",
- SupportDbTypeNames.SQLITE_STMT, stmtVar, dbField, sqlVar
- )
- }
- queryWriter.bindArgs(stmtVar, listSizeArgs, this)
- stmtVar
- },
- preparedStmtField = null,
- dbField = dbField,
- scope = scope)
- return scope.generate()
+ val sqlVar = scope.getTmpVar("_sql")
+ val stmtVar = scope.getTmpVar("_stmt")
+ val listSizeArgs = queryWriter.prepareQuery(sqlVar, scope)
+ scope.builder().apply {
+ addStatement("$T $L = $N.compileStatement($L)",
+ SupportDbTypeNames.SQLITE_STMT, stmtVar, dbField, sqlVar)
+ queryWriter.bindArgs(stmtVar, listSizeArgs, scope)
+
+ val binderScope = scope.fork()
+ method.preparedQueryResultBinder.executeAndReturn(
+ stmtQueryVal = stmtVar,
+ preparedStmtField = null,
+ dbField = dbField,
+ scope = binderScope)
+ add(binderScope.builder().build())
+ }
+ return scope.builder().build()
}
private fun createQueryMethodBody(method: ReadQueryMethod): CodeBlock {
diff --git a/room/compiler/src/test/data/daoWriter/output/ComplexDao.java b/room/compiler/src/test/data/daoWriter/output/ComplexDao.java
index bb945a3..bd515b20 100644
--- a/room/compiler/src/test/data/daoWriter/output/ComplexDao.java
+++ b/room/compiler/src/test/data/daoWriter/output/ComplexDao.java
@@ -19,7 +19,7 @@
import javax.annotation.Generated;
@Generated("androidx.room.RoomProcessor")
-@SuppressWarnings({"unchecked", "deprecation"})
+@SuppressWarnings("unchecked")
public final class ComplexDao_Impl extends ComplexDao {
private final RoomDatabase __db;
@@ -32,7 +32,7 @@
public boolean transactionMethod(final int i, final String s, final long l) {
__db.beginTransaction();
try {
- boolean _result = ComplexDao_Impl.super.transactionMethod(i, s, l);
+ boolean _result = super.transactionMethod(i, s, l);
__db.setTransactionSuccessful();
return _result;
} finally {
@@ -46,7 +46,6 @@
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
int _argIndex = 1;
_statement.bindLong(_argIndex, id);
- __db.assertNotSuspendingTransaction();
final Cursor _cursor = DBUtil.query(__db, _statement, false);
try {
final int _cursorIndexOfFullName = CursorUtil.getColumnIndexOrThrow(_cursor, "fullName");
@@ -72,7 +71,6 @@
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
int _argIndex = 1;
_statement.bindLong(_argIndex, id);
- __db.assertNotSuspendingTransaction();
final Cursor _cursor = DBUtil.query(__db, _statement, false);
try {
final int _cursorIndexOfUid = CursorUtil.getColumnIndexOrThrow(_cursor, "uid");
@@ -114,7 +112,6 @@
} else {
_statement.bindString(_argIndex, lastName);
}
- __db.assertNotSuspendingTransaction();
final Cursor _cursor = DBUtil.query(__db, _statement, false);
try {
final int _cursorIndexOfUid = CursorUtil.getColumnIndexOrThrow(_cursor, "uid");
@@ -155,7 +152,6 @@
_statement.bindLong(_argIndex, _item);
_argIndex ++;
}
- __db.assertNotSuspendingTransaction();
final Cursor _cursor = DBUtil.query(__db, _statement, false);
try {
final int _cursorIndexOfUid = CursorUtil.getColumnIndexOrThrow(_cursor, "uid");
@@ -187,7 +183,6 @@
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 1);
int _argIndex = 1;
_statement.bindLong(_argIndex, id);
- __db.assertNotSuspendingTransaction();
final Cursor _cursor = DBUtil.query(__db, _statement, false);
try {
final int _result;
@@ -218,7 +213,6 @@
_statement.bindLong(_argIndex, _item);
_argIndex ++;
}
- __db.assertNotSuspendingTransaction();
final Cursor _cursor = DBUtil.query(__db, _statement, false);
try {
final int[] _result = new int[_cursor.getCount()];
@@ -255,7 +249,6 @@
}
_argIndex ++;
}
- __db.assertNotSuspendingTransaction();
final Cursor _cursor = DBUtil.query(__db, _statement, false);
try {
final List<Integer> _result = new ArrayList<Integer>(_cursor.getCount());
@@ -400,7 +393,6 @@
_statement.bindLong(_argIndex, _item_2);
_argIndex ++;
}
- __db.assertNotSuspendingTransaction();
final Cursor _cursor = DBUtil.query(__db, _statement, false);
try {
final List<Integer> _result = new ArrayList<Integer>(_cursor.getCount());
@@ -424,7 +416,6 @@
public List<Child1> getChild1List() {
final String _sql = "SELECT * FROM Child1";
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 0);
- __db.assertNotSuspendingTransaction();
final Cursor _cursor = DBUtil.query(__db, _statement, false);
try {
final int _cursorIndexOfId = CursorUtil.getColumnIndexOrThrow(_cursor, "id");
@@ -460,7 +451,6 @@
public List<Child2> getChild2List() {
final String _sql = "SELECT * FROM Child2";
final RoomSQLiteQuery _statement = RoomSQLiteQuery.acquire(_sql, 0);
- __db.assertNotSuspendingTransaction();
final Cursor _cursor = DBUtil.query(__db, _statement, false);
try {
final int _cursorIndexOfId = CursorUtil.getColumnIndexOrThrow(_cursor, "id");
diff --git a/room/compiler/src/test/data/daoWriter/output/DeletionDao.java b/room/compiler/src/test/data/daoWriter/output/DeletionDao.java
index 33bf92e..daeb73e 100644
--- a/room/compiler/src/test/data/daoWriter/output/DeletionDao.java
+++ b/room/compiler/src/test/data/daoWriter/output/DeletionDao.java
@@ -20,7 +20,7 @@
import javax.annotation.Generated;
@Generated("androidx.room.RoomProcessor")
-@SuppressWarnings({"unchecked", "deprecation"})
+@SuppressWarnings("unchecked")
public final class DeletionDao_Impl implements DeletionDao {
private final RoomDatabase __db;
@@ -96,7 +96,6 @@
@Override
public void deleteUser(final User user) {
- __db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
__deletionAdapterOfUser.handle(user);
@@ -108,7 +107,6 @@
@Override
public void deleteUsers(final User user1, final List<User> others) {
- __db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
__deletionAdapterOfUser.handle(user1);
@@ -121,7 +119,6 @@
@Override
public void deleteArrayOfUsers(final User[] users) {
- __db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
__deletionAdapterOfUser.handleMultiple(users);
@@ -133,7 +130,6 @@
@Override
public Integer deleteUserAndReturnCountObject(final User user) {
- __db.assertNotSuspendingTransaction();
int _total = 0;
__db.beginTransaction();
try {
@@ -147,7 +143,6 @@
@Override
public int deleteUserAndReturnCount(final User user) {
- __db.assertNotSuspendingTransaction();
int _total = 0;
__db.beginTransaction();
try {
@@ -161,7 +156,6 @@
@Override
public int deleteUserAndReturnCount(final User user1, final List<User> others) {
- __db.assertNotSuspendingTransaction();
int _total = 0;
__db.beginTransaction();
try {
@@ -176,7 +170,6 @@
@Override
public int deleteUserAndReturnCount(final User[] users) {
- __db.assertNotSuspendingTransaction();
int _total = 0;
__db.beginTransaction();
try {
@@ -243,7 +236,6 @@
@Override
public int multiPKey(final MultiPKeyEntity entity) {
- __db.assertNotSuspendingTransaction();
int _total = 0;
__db.beginTransaction();
try {
@@ -257,7 +249,6 @@
@Override
public void deleteUserAndBook(final User user, final Book book) {
- __db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
__deletionAdapterOfUser.handle(user);
@@ -270,7 +261,6 @@
@Override
public int deleteByUid(final int uid) {
- __db.assertNotSuspendingTransaction();
final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteByUid.acquire();
int _argIndex = 1;
_stmt.bindLong(_argIndex, uid);
@@ -287,12 +277,12 @@
@Override
public Completable deleteByUidCompletable(final int uid) {
+ final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteByUid.acquire();
+ int _argIndex = 1;
+ _stmt.bindLong(_argIndex, uid);
return Completable.fromCallable(new Callable<Void>() {
@Override
public Void call() throws Exception {
- final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteByUid.acquire();
- int _argIndex = 1;
- _stmt.bindLong(_argIndex, uid);
__db.beginTransaction();
try {
_stmt.executeUpdateDelete();
@@ -308,12 +298,12 @@
@Override
public Single<Integer> deleteByUidSingle(final int uid) {
+ final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteByUid.acquire();
+ int _argIndex = 1;
+ _stmt.bindLong(_argIndex, uid);
return Single.fromCallable(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
- final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteByUid.acquire();
- int _argIndex = 1;
- _stmt.bindLong(_argIndex, uid);
__db.beginTransaction();
try {
final java.lang.Integer _result = _stmt.executeUpdateDelete();
@@ -329,12 +319,12 @@
@Override
public Maybe<Integer> deleteByUidMaybe(final int uid) {
+ final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteByUid.acquire();
+ int _argIndex = 1;
+ _stmt.bindLong(_argIndex, uid);
return Maybe.fromCallable(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
- final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteByUid.acquire();
- int _argIndex = 1;
- _stmt.bindLong(_argIndex, uid);
__db.beginTransaction();
try {
final java.lang.Integer _result = _stmt.executeUpdateDelete();
@@ -350,7 +340,6 @@
@Override
public int deleteEverything() {
- __db.assertNotSuspendingTransaction();
final SupportSQLiteStatement _stmt = __preparedStmtOfDeleteEverything.acquire();
__db.beginTransaction();
try {
@@ -365,14 +354,13 @@
@Override
public int deleteByUidList(final int... uid) {
- __db.assertNotSuspendingTransaction();
StringBuilder _stringBuilder = StringUtil.newStringBuilder();
_stringBuilder.append("DELETE FROM user where uid IN(");
final int _inputSize = uid.length;
StringUtil.appendPlaceholders(_stringBuilder, _inputSize);
_stringBuilder.append(")");
final String _sql = _stringBuilder.toString();
- final SupportSQLiteStatement _stmt = __db.compileStatement(_sql);
+ SupportSQLiteStatement _stmt = __db.compileStatement(_sql);
int _argIndex = 1;
for (int _item : uid) {
_stmt.bindLong(_argIndex, _item);
diff --git a/room/compiler/src/test/data/daoWriter/output/UpdateDao.java b/room/compiler/src/test/data/daoWriter/output/UpdateDao.java
index 8c8cfa4..de385b8 100644
--- a/room/compiler/src/test/data/daoWriter/output/UpdateDao.java
+++ b/room/compiler/src/test/data/daoWriter/output/UpdateDao.java
@@ -18,7 +18,7 @@
import javax.annotation.Generated;
@Generated("androidx.room.RoomProcessor")
-@SuppressWarnings({"unchecked", "deprecation"})
+@SuppressWarnings("unchecked")
public final class UpdateDao_Impl implements UpdateDao {
private final RoomDatabase __db;
@@ -118,7 +118,6 @@
@Override
public void updateUser(final User user) {
- __db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
__updateAdapterOfUser.handle(user);
@@ -130,7 +129,6 @@
@Override
public void updateUsers(final User user1, final List<User> others) {
- __db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
__updateAdapterOfUser.handle(user1);
@@ -143,7 +141,6 @@
@Override
public void updateArrayOfUsers(final User[] users) {
- __db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
__updateAdapterOfUser.handleMultiple(users);
@@ -155,7 +152,6 @@
@Override
public int updateUserAndReturnCount(final User user) {
- __db.assertNotSuspendingTransaction();
int _total = 0;
__db.beginTransaction();
try {
@@ -169,7 +165,6 @@
@Override
public int updateUserAndReturnCount(final User user1, final List<User> others) {
- __db.assertNotSuspendingTransaction();
int _total = 0;
__db.beginTransaction();
try {
@@ -184,7 +179,6 @@
@Override
public int updateUserAndReturnCount(final User[] users) {
- __db.assertNotSuspendingTransaction();
int _total = 0;
__db.beginTransaction();
try {
@@ -198,7 +192,6 @@
@Override
public Integer updateUserAndReturnCountObject(final User user) {
- __db.assertNotSuspendingTransaction();
int _total = 0;
__db.beginTransaction();
try {
@@ -265,7 +258,6 @@
@Override
public int multiPKey(final MultiPKeyEntity entity) {
- __db.assertNotSuspendingTransaction();
int _total = 0;
__db.beginTransaction();
try {
@@ -279,7 +271,6 @@
@Override
public void updateUserAndBook(final User user, final Book book) {
- __db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
__updateAdapterOfUser.handle(user);
@@ -303,7 +294,6 @@
@Override
public void ageUserByUid(final String uid) {
- __db.assertNotSuspendingTransaction();
final SupportSQLiteStatement _stmt = __preparedStmtOfAgeUserByUid.acquire();
int _argIndex = 1;
if (uid == null) {
@@ -323,7 +313,6 @@
@Override
public void ageUserAll() {
- __db.assertNotSuspendingTransaction();
final SupportSQLiteStatement _stmt = __preparedStmtOfAgeUserAll.acquire();
__db.beginTransaction();
try {
@@ -337,10 +326,10 @@
@Override
public Completable ageUserAllCompletable() {
+ final SupportSQLiteStatement _stmt = __preparedStmtOfAgeUserAll.acquire();
return Completable.fromCallable(new Callable<Void>() {
@Override
public Void call() throws Exception {
- final SupportSQLiteStatement _stmt = __preparedStmtOfAgeUserAll.acquire();
__db.beginTransaction();
try {
_stmt.executeUpdateDelete();
@@ -356,10 +345,10 @@
@Override
public Single<Integer> ageUserAllSingle() {
+ final SupportSQLiteStatement _stmt = __preparedStmtOfAgeUserAll.acquire();
return Single.fromCallable(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
- final SupportSQLiteStatement _stmt = __preparedStmtOfAgeUserAll.acquire();
__db.beginTransaction();
try {
final java.lang.Integer _result = _stmt.executeUpdateDelete();
@@ -375,10 +364,10 @@
@Override
public Maybe<Integer> ageUserAllMaybe() {
+ final SupportSQLiteStatement _stmt = __preparedStmtOfAgeUserAll.acquire();
return Maybe.fromCallable(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
- final SupportSQLiteStatement _stmt = __preparedStmtOfAgeUserAll.acquire();
__db.beginTransaction();
try {
final java.lang.Integer _result = _stmt.executeUpdateDelete();
diff --git a/room/compiler/src/test/data/daoWriter/output/WriterDao.java b/room/compiler/src/test/data/daoWriter/output/WriterDao.java
index ded9519..0e4a986 100644
--- a/room/compiler/src/test/data/daoWriter/output/WriterDao.java
+++ b/room/compiler/src/test/data/daoWriter/output/WriterDao.java
@@ -19,6 +19,7 @@
import androidx.room.EntityInsertionAdapter;
import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteStatement;
+
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
@@ -26,7 +27,7 @@
import javax.annotation.Generated;
@Generated("androidx.room.RoomProcessor")
-@SuppressWarnings({"unchecked", "deprecation"})
+@SuppressWarnings("unchecked")
public final class WriterDao_Impl implements WriterDao {
private final RoomDatabase __db;
@@ -100,7 +101,6 @@
@Override
public void insertUser(final User user) {
- __db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
__insertionAdapterOfUser.insert(user);
@@ -112,7 +112,6 @@
@Override
public void insertUsers(final User user1, final List<User> others) {
- __db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
__insertionAdapterOfUser.insert(user1);
@@ -125,7 +124,6 @@
@Override
public void insertUsers(final User[] users) {
- __db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
__insertionAdapterOfUser_1.insert(users);
@@ -137,7 +135,6 @@
@Override
public void insertUserAndBook(final User user, final Book book) {
- __db.assertNotSuspendingTransaction();
__db.beginTransaction();
try {
__insertionAdapterOfUser.insert(user);
diff --git a/room/compiler/src/test/data/databasewriter/output/ComplexDatabase.java b/room/compiler/src/test/data/databasewriter/output/ComplexDatabase.java
index cb774c6..605891a 100644
--- a/room/compiler/src/test/data/databasewriter/output/ComplexDatabase.java
+++ b/room/compiler/src/test/data/databasewriter/output/ComplexDatabase.java
@@ -24,7 +24,7 @@
import javax.annotation.Generated;
@Generated("androidx.room.RoomProcessor")
-@SuppressWarnings({"unchecked", "deprecation"})
+@SuppressWarnings("unchecked")
public final class ComplexDatabase_Impl extends ComplexDatabase {
private volatile ComplexDao _complexDao;
diff --git a/room/compiler/src/test/kotlin/androidx/room/kotlin/JvmDescriptorUtilsTest.kt b/room/compiler/src/test/kotlin/androidx/room/kotlin/JvmDescriptorUtilsTest.kt
deleted file mode 100644
index f5f1052..0000000
--- a/room/compiler/src/test/kotlin/androidx/room/kotlin/JvmDescriptorUtilsTest.kt
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright 2019 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.room.kotlin
-
-import androidx.room.testing.TestProcessor
-import com.google.auto.common.MoreElements
-import com.google.common.truth.Truth
-import com.google.common.truth.Truth.assertThat
-import com.google.testing.compile.CompileTester
-import com.google.testing.compile.JavaSourcesSubjectFactory
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-import toJFO
-import javax.tools.JavaFileObject
-
-@RunWith(JUnit4::class)
-class JvmDescriptorUtilsTest {
-
- private val describeAnnotation =
- """
- package androidx.room.test;
-
- import java.lang.annotation.ElementType;
- import java.lang.annotation.Target;
-
- @Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
- public @interface Describe { }
- """.toJFO("androidx.room.test.Describe")
-
- @Test
- fun descriptor_method_simple() {
- singleRun(
- """
- package androidx.room.test;
-
- public class DummyClass {
- @Describe
- public void emptyMethod() {
- }
- }
- """.toJFO("androidx.room.test.DummyClass")
- ) { descriptors ->
- assertThat(descriptors.first())
- .isEqualTo("emptyMethod()V")
- }.compilesWithoutError()
- }
-
- @Test
- fun descriptor_method_primitiveParams() {
- singleRun(
- """
- package androidx.room.test;
-
- class DummyClass {
- @Describe
- void method1(boolean yesOrNo, int number) { }
-
- @Describe
- byte method2(char letter) { return 0; }
-
- @Describe
- void method3(double realNumber1, float realNummber2) { }
-
- @Describe
- void method4(long bigNumber, short littlerNumber) { }
- }
- """.toJFO("androidx.room.test.DummyClass")
- ) { descriptors ->
- assertThat(descriptors)
- .isEqualTo(setOf("method1(ZI)V", "method2(C)B", "method3(DF)V", "method4(JS)V"))
- }.compilesWithoutError()
- }
-
- @Test
- fun descriptor_method_classParam_javaTypes() {
- singleRun(
- """
- package androidx.room.test;
-
- import java.util.ArrayList;
- import java.util.List;
-
- class DummyClass {
- @Describe
- void method1(Object something) { }
-
- @Describe
- Object method2() { return null; }
-
- @Describe
- List<String> method3(ArrayList<Integer> list) { return null; }
- }
- """.toJFO("androidx.room.test.DummyClass")
- ) { descriptors ->
- assertThat(descriptors).isEqualTo(
- setOf(
- "method1(Ljava/lang/Object;)V",
- "method2()Ljava/lang/Object;",
- "method3(Ljava/util/ArrayList;)Ljava/util/List;"
- )
- )
- }.compilesWithoutError()
- }
-
- @Test
- fun descriptor_method_classParam_testClass() {
- val extraJfo =
- """
- package androidx.room.test;
-
- class DataClass { }
- """.toJFO("androidx.room.test.DataClass")
-
- singleRun(
- """
- package androidx.room.test;
-
- class DummyClass {
- @Describe
- void method1(DataClass data) { }
-
- @Describe
- DataClass method2() { return null; }
- }
- """.toJFO("androidx.room.test.DummyClass"), extraJfo
- ) { descriptors ->
- assertThat(descriptors).isEqualTo(
- setOf(
- "method1(Landroidx/room/test/DataClass;)V",
- "method2()Landroidx/room/test/DataClass;"
- )
- )
- }.compilesWithoutError()
- }
-
- @Test
- fun descriptor_method_classParam_innerTestClass() {
- val extraJfo =
- """
- package androidx.room.test;
-
- class DataClass {
-
- class MemberInnerData { }
-
- static class StaticInnerData { }
-
- enum EnumData {
- VALUE1, VALUE2
- }
- }
- """.toJFO("androidx.room.test.DataClass")
-
- singleRun(
- """
- package androidx.room.test;
-
- class DummyClass {
- @Describe
- void method1(DataClass.MemberInnerData data) { }
-
- @Describe
- void method2(DataClass.StaticInnerData data) { }
-
- @Describe
- void method3(DataClass.EnumData enumData) { }
-
- @Describe
- DataClass.StaticInnerData method4() { return null; }
- }
- """.toJFO("androidx.room.test.DummyClass"), extraJfo
- ) { descriptors ->
- assertThat(descriptors).isEqualTo(
- setOf(
- "method1(Landroidx/room/test/DataClass\$MemberInnerData;)V",
- "method2(Landroidx/room/test/DataClass\$StaticInnerData;)V",
- "method3(Landroidx/room/test/DataClass\$EnumData;)V",
- "method4()Landroidx/room/test/DataClass\$StaticInnerData;"
- )
- )
- }.compilesWithoutError()
- }
-
- @Test
- fun descriptor_method_arrayParams() {
- val extraJfo =
- """
- package androidx.room.test;
-
- class DataClass { }
- """.toJFO("androidx.room.test.DataClass")
-
- singleRun(
- """
- package androidx.room.test;
-
- class DummyClass {
- @Describe
- void method1(DataClass[] data) { }
-
- @Describe
- DataClass[] method2() { return null; }
-
- @Describe
- void method3(int[] array) { }
-
- @Describe
- void method4(int... array) { }
- }
- """.toJFO("androidx.room.test.DummyClass"), extraJfo
- ) { descriptors ->
- assertThat(descriptors).isEqualTo(
- setOf(
- "method1([Landroidx/room/test/DataClass;)V",
- "method2()[Landroidx/room/test/DataClass;",
- "method3([I)V",
- "method4([I)V"
- )
- )
- }.compilesWithoutError()
- }
-
- private fun singleRun(
- vararg jfo: JavaFileObject,
- handler: (Set<String>) -> Unit
- ): CompileTester = Truth.assertAbout(JavaSourcesSubjectFactory.javaSources())
- .that(listOf(describeAnnotation) + jfo)
- .processedWith(TestProcessor.builder()
- .nextRunHandler {
- it.roundEnv.getElementsAnnotatedWith(it.annotations.first()).map { element ->
- MoreElements.asExecutable(element).descriptor(it.processingEnv.typeUtils)
- }.toSet().let(handler)
- true
- }
- .forAnnotations("androidx.room.test.Describe")
- .build())
-}
\ No newline at end of file
diff --git a/room/compiler/src/test/kotlin/androidx/room/kotlin/KotlinMetadataElementTest.kt b/room/compiler/src/test/kotlin/androidx/room/kotlin/KotlinMetadataElementTest.kt
deleted file mode 100644
index a10de87..0000000
--- a/room/compiler/src/test/kotlin/androidx/room/kotlin/KotlinMetadataElementTest.kt
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2019 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.room.kotlin
-
-import androidx.room.processor.Context
-import androidx.room.testing.TestInvocation
-import com.google.auto.common.MoreElements
-import com.google.common.truth.Truth.assertThat
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-import simpleRun
-import javax.lang.model.util.ElementFilter
-
-@RunWith(JUnit4::class)
-class KotlinMetadataElementTest {
-
- @Test
- fun getParameterNames() {
- simpleRun { invocation ->
- val (testClassElement, metadataElement) = getMetadataElement(invocation)
- assertThat(ElementFilter.methodsIn(testClassElement.enclosedElements)
- .first { it.simpleName.toString() == "functionWithParams" }
- .let { metadataElement.getParameterNames(MoreElements.asExecutable(it)) }
- ).isEqualTo(
- listOf("param1", "yesOrNo", "number")
- )
- }
- }
-
- @Test
- fun findPrimaryConstructorSignature() {
- simpleRun { invocation ->
- val (testClassElement, metadataElement) = getMetadataElement(invocation)
- assertThat(
- ElementFilter.constructorsIn(testClassElement.enclosedElements).map {
- val desc = MoreElements.asExecutable(it).descriptor(invocation.typeUtils)
- desc to (desc == metadataElement.findPrimaryConstructorSignature())
- }.toSet()
- ).isEqualTo(
- setOf(
- "TestData(Ljava/lang/String;)Landroidx/room/kotlin/" +
- "KotlinMetadataElementTest\$TestData" to true,
- "TestData(Landroidx/room/kotlin/KotlinMetadataElementTest\$TestData" to false
- )
- )
- }
- }
-
- @Test
- fun isSuspendFunction() {
- simpleRun { invocation ->
- val (testClassElement, metadataElement) = getMetadataElement(invocation)
- assertThat(ElementFilter.constructorsIn(testClassElement.enclosedElements).map {
- val executableElement = MoreElements.asExecutable(it)
- executableElement.simpleName.toString() to metadataElement.isSuspendFunction(
- executableElement
- )
- }.toSet()).isEqualTo(
- setOf(
- "emptyFunction" to false,
- "suspendFunction" to true,
- "functionWithParams" to false
- )
- )
- }
- }
-
- private fun getMetadataElement(invocation: TestInvocation) =
- invocation.typeElement(TestData::class.java.canonicalName).let {
- it to KotlinMetadataElement.createFor(Context(invocation.processingEnv), it)!!
- }
-
- private class TestData(val constructorParam: String) {
-
- constructor() : this("anything")
-
- fun emptyFunction() {}
-
- suspend fun suspendFunction() {}
-
- fun functionWithParams(param1: String, yesOrNo: Boolean, number: Int) {}
- }
-}
\ No newline at end of file
diff --git a/room/compiler/src/test/kotlin/androidx/room/processor/TransactionMethodProcessorTest.kt b/room/compiler/src/test/kotlin/androidx/room/processor/TransactionMethodProcessorTest.kt
index c42a7cc..def7f4d 100644
--- a/room/compiler/src/test/kotlin/androidx/room/processor/TransactionMethodProcessorTest.kt
+++ b/room/compiler/src/test/kotlin/androidx/room/processor/TransactionMethodProcessorTest.kt
@@ -164,9 +164,6 @@
)
}
- private val TransactionMethod.name: String
- get() = element.simpleName.toString()
-
private fun singleTransactionMethod(
vararg input: String,
handler: (TransactionMethod, TestInvocation) -> Unit
diff --git a/room/compiler/src/test/kotlin/androidx/room/solver/BasicColumnTypeAdaptersTest.kt b/room/compiler/src/test/kotlin/androidx/room/solver/BasicColumnTypeAdaptersTest.kt
index 4a14c7b..4d2f940 100644
--- a/room/compiler/src/test/kotlin/androidx/room/solver/BasicColumnTypeAdaptersTest.kt
+++ b/room/compiler/src/test/kotlin/androidx/room/solver/BasicColumnTypeAdaptersTest.kt
@@ -37,11 +37,8 @@
import javax.lang.model.type.TypeMirror
@RunWith(Parameterized::class)
-class BasicColumnTypeAdaptersTest(
- val input: Input,
- val bindCode: String,
- val cursorCode: String
-) {
+class BasicColumnTypeAdaptersTest(val input: Input, val bindCode: String,
+ val cursorCode: String) {
val scope = testCodeGenScope()
companion object {
@@ -92,7 +89,7 @@
val adapter = TypeAdapterStore.create(Context(invocation.processingEnv))
.findColumnTypeAdapter(input.getTypeMirror(invocation.processingEnv), null)!!
adapter.bindToStmt("st", "6", "inp", scope)
- assertThat(scope.generate().toString().trim(), `is`(bindCode))
+ assertThat(scope.generate().trim(), `is`(bindCode))
generateCode(invocation, false)
}.compilesWithoutError()
}
@@ -107,7 +104,7 @@
.findColumnTypeAdapter(
input.getBoxedTypeMirror(invocation.processingEnv), null)!!
adapter.bindToStmt("st", "6", "inp", scope)
- assertThat(scope.generate().toString().trim(), `is`(
+ assertThat(scope.generate().trim(), `is`(
"""
if (inp == null) {
st.bindNull(6);
@@ -143,7 +140,7 @@
val adapter = TypeAdapterStore.create(Context(invocation.processingEnv))
.findColumnTypeAdapter(input.getTypeMirror(invocation.processingEnv), null)!!
adapter.readFromCursor("out", "crs", "9", scope)
- assertThat(scope.generate().toString().trim(), `is`(cursorCode))
+ assertThat(scope.generate().trim(), `is`(cursorCode))
generateCode(invocation, false)
}.compilesWithoutError()
}
@@ -158,7 +155,7 @@
.findColumnTypeAdapter(
input.getBoxedTypeMirror(invocation.processingEnv), null)!!
adapter.readFromCursor("out", "crs", "9", scope)
- assertThat(scope.generate().toString().trim(), `is`(
+ assertThat(scope.generate().trim(), `is`(
"""
if (crs.isNull(9)) {
out = null;
diff --git a/room/compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt b/room/compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
index cea78ba..5487d38 100644
--- a/room/compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
+++ b/room/compiler/src/test/kotlin/androidx/room/solver/TypeAdapterStoreTest.kt
@@ -116,7 +116,7 @@
assertThat(adapter, instanceOf(CompositeAdapter::class.java))
val bindScope = testCodeGenScope()
adapter!!.bindToStmt("stmt", "41", "fooVar", bindScope)
- assertThat(bindScope.generate().toString().trim(), `is`("""
+ assertThat(bindScope.generate().trim(), `is`("""
final int ${tmp(0)};
${tmp(0)} = fooVar ? 1 : 0;
stmt.bindLong(41, ${tmp(0)});
@@ -124,7 +124,7 @@
val cursorScope = testCodeGenScope()
adapter.readFromCursor("res", "curs", "7", cursorScope)
- assertThat(cursorScope.generate().toString().trim(), `is`("""
+ assertThat(cursorScope.generate().trim(), `is`("""
final int ${tmp(0)};
${tmp(0)} = curs.getInt(7);
res = ${tmp(0)} != 0;
@@ -145,7 +145,7 @@
val bindScope = testCodeGenScope()
adapter!!.bindToStmt("stmt", "41", "fooVar", bindScope)
- assertThat(bindScope.generate().toString().trim(), `is`("""
+ assertThat(bindScope.generate().trim(), `is`("""
final int ${tmp(0)};
final boolean ${tmp(1)};
${tmp(1)} = foo.bar.Point.toBoolean(fooVar);
@@ -155,7 +155,7 @@
val cursorScope = testCodeGenScope()
adapter.readFromCursor("res", "curs", "11", cursorScope).toString()
- assertThat(cursorScope.generate().toString().trim(), `is`("""
+ assertThat(cursorScope.generate().trim(), `is`("""
final int ${tmp(0)};
${tmp(0)} = curs.getInt(11);
final boolean ${tmp(1)};
@@ -176,7 +176,7 @@
assertThat(adapter?.typeMirror(), `is`(tDate))
val bindScope = testCodeGenScope()
adapter!!.readFromCursor("outDate", "curs", "0", bindScope)
- assertThat(bindScope.generate().toString().trim(), `is`("""
+ assertThat(bindScope.generate().trim(), `is`("""
final java.lang.Long _tmp;
if (curs.isNull(0)) {
_tmp = null;
@@ -200,7 +200,7 @@
val bindScope = testCodeGenScope()
adapter!!.bindToStmt("stmt", "41", "fooVar", bindScope)
- assertThat(bindScope.generate().toString().trim(), `is`("""
+ assertThat(bindScope.generate().trim(), `is`("""
final java.lang.String ${tmp(0)};
${tmp(0)} = androidx.room.util.StringUtil.joinIntoString(fooVar);
if (${tmp(0)} == null) {
diff --git a/room/compiler/src/test/kotlin/androidx/room/solver/query/QueryWriterTest.kt b/room/compiler/src/test/kotlin/androidx/room/solver/query/QueryWriterTest.kt
index 23bfcca..64c5653 100644
--- a/room/compiler/src/test/kotlin/androidx/room/solver/query/QueryWriterTest.kt
+++ b/room/compiler/src/test/kotlin/androidx/room/solver/query/QueryWriterTest.kt
@@ -58,7 +58,7 @@
""") { writer ->
val scope = testCodeGenScope()
writer.prepareReadAndBind("_sql", "_stmt", scope)
- assertThat(scope.generate().toString().trim(), `is`("""
+ assertThat(scope.generate().trim(), `is`("""
final java.lang.String _sql = "SELECT id FROM users";
final $QUERY _stmt = $QUERY.acquire(_sql, 0);
""".trimIndent()))
@@ -73,7 +73,7 @@
""") { writer ->
val scope = testCodeGenScope()
writer.prepareReadAndBind("_sql", "_stmt", scope)
- assertThat(scope.generate().toString().trim(), `is`(
+ assertThat(scope.generate().trim(), `is`(
"""
final java.lang.String _sql = "SELECT id FROM users WHERE name LIKE ?";
final $QUERY _stmt = $QUERY.acquire(_sql, 1);
@@ -95,7 +95,7 @@
""") { writer ->
val scope = testCodeGenScope()
writer.prepareReadAndBind("_sql", "_stmt", scope)
- assertThat(scope.generate().toString().trim(), `is`(
+ assertThat(scope.generate().trim(), `is`(
"""
final java.lang.String _sql = "SELECT id FROM users WHERE id IN(?,?)";
final $QUERY _stmt = $QUERY.acquire(_sql, 2);
@@ -115,7 +115,7 @@
""") { writer ->
val scope = testCodeGenScope()
writer.prepareReadAndBind("_sql", "_stmt", scope)
- assertThat(scope.generate().toString().trim(), `is`(
+ assertThat(scope.generate().trim(), `is`(
"""
java.lang.StringBuilder _stringBuilder = $STRING_UTIL.newStringBuilder();
_stringBuilder.append("SELECT id FROM users WHERE id IN(");
@@ -168,7 +168,7 @@
""") { writer ->
val scope = testCodeGenScope()
writer.prepareReadAndBind("_sql", "_stmt", scope)
- assertThat(scope.generate().toString().trim(), `is`(collectionOut))
+ assertThat(scope.generate().trim(), `is`(collectionOut))
}.compilesWithoutError()
}
@@ -180,7 +180,7 @@
""") { writer ->
val scope = testCodeGenScope()
writer.prepareReadAndBind("_sql", "_stmt", scope)
- assertThat(scope.generate().toString().trim(), `is`(collectionOut))
+ assertThat(scope.generate().trim(), `is`(collectionOut))
}.compilesWithoutError()
}
@@ -192,7 +192,7 @@
""") { writer ->
val scope = testCodeGenScope()
writer.prepareReadAndBind("_sql", "_stmt", scope)
- assertThat(scope.generate().toString().trim(), `is`("""
+ assertThat(scope.generate().trim(), `is`("""
final java.lang.String _sql = "SELECT id FROM users WHERE age > ? OR bage > ?";
final $QUERY _stmt = $QUERY.acquire(_sql, 2);
int _argIndex = 1;
@@ -211,7 +211,7 @@
""") { writer ->
val scope = testCodeGenScope()
writer.prepareReadAndBind("_sql", "_stmt", scope)
- assertThat(scope.generate().toString().trim(), `is`("""
+ assertThat(scope.generate().trim(), `is`("""
java.lang.StringBuilder _stringBuilder = $STRING_UTIL.newStringBuilder();
_stringBuilder.append("SELECT id FROM users WHERE age > ");
_stringBuilder.append("?");
@@ -245,7 +245,7 @@
""") { writer ->
val scope = testCodeGenScope()
writer.prepareReadAndBind("_sql", "_stmt", scope)
- assertThat(scope.generate().toString().trim(), `is`("""
+ assertThat(scope.generate().trim(), `is`("""
java.lang.StringBuilder _stringBuilder = $STRING_UTIL.newStringBuilder();
_stringBuilder.append("SELECT id FROM users WHERE age IN (");
final int _inputSize = ages.length;
@@ -275,10 +275,8 @@
}.compilesWithoutError()
}
- fun singleQueryMethod(
- vararg input: String,
- handler: (QueryWriter) -> Unit
- ):
+ fun singleQueryMethod(vararg input: String,
+ handler: (QueryWriter) -> Unit):
CompileTester {
return Truth.assertAbout(JavaSourceSubjectFactory.javaSource())
.that(JavaFileObjects.forSourceString("foo.bar.MyClass",
diff --git a/room/compiler/src/test/kotlin/androidx/room/vo/FtsEntityTest.kt b/room/compiler/src/test/kotlin/androidx/room/vo/FtsEntityTest.kt
index ca7c58d..c983b2f 100644
--- a/room/compiler/src/test/kotlin/androidx/room/vo/FtsEntityTest.kt
+++ b/room/compiler/src/test/kotlin/androidx/room/vo/FtsEntityTest.kt
@@ -79,149 +79,6 @@
)
}
- @Test
- fun createStatement_simpleTokenizer_withTokenizerArgs() {
- val primaryKeyField = createField("rowid")
- val bodyField = createField("body")
- val entity = FtsEntity(
- element = mock(TypeElement::class.java),
- tableName = "Mail",
- type = mock(DeclaredType::class.java),
- fields = listOf(primaryKeyField, bodyField),
- embeddedFields = emptyList(),
- primaryKey = PrimaryKey(
- declaredIn = mock(Element::class.java),
- fields = Fields(primaryKeyField),
- autoGenerateId = true),
- constructor = null,
- shadowTableName = "Mail_context",
- ftsVersion = FtsVersion.FTS4,
- ftsOptions = FtsOptions(
- tokenizer = androidx.room.FtsOptions.TOKENIZER_SIMPLE,
- tokenizerArgs = listOf("tokenchars=.=", "separators=X"),
- contentEntity = null,
- languageIdColumnName = "",
- matchInfo = androidx.room.FtsOptions.MatchInfo.FTS4,
- notIndexedColumns = emptyList(),
- prefixSizes = emptyList(),
- preferredOrder = androidx.room.FtsOptions.Order.ASC))
-
- assertThat(entity.createTableQuery,
- `is`("CREATE VIRTUAL TABLE IF NOT EXISTS `Mail` USING FTS4(" +
- "`body` TEXT, " +
- "tokenize=simple `tokenchars=.=` `separators=X`" +
- ")"
- )
- )
- }
-
- @Test
- fun createStatement_simpleTokenizer_noTokenizerArgs() {
- val primaryKeyField = createField("rowid")
- val bodyField = createField("body")
- val entity = FtsEntity(
- element = mock(TypeElement::class.java),
- tableName = "Mail",
- type = mock(DeclaredType::class.java),
- fields = listOf(primaryKeyField, bodyField),
- embeddedFields = emptyList(),
- primaryKey = PrimaryKey(
- declaredIn = mock(Element::class.java),
- fields = Fields(primaryKeyField),
- autoGenerateId = true),
- constructor = null,
- shadowTableName = "Mail_context",
- ftsVersion = FtsVersion.FTS4,
- ftsOptions = FtsOptions(
- tokenizer = androidx.room.FtsOptions.TOKENIZER_SIMPLE,
- tokenizerArgs = emptyList(),
- contentEntity = null,
- languageIdColumnName = "",
- matchInfo = androidx.room.FtsOptions.MatchInfo.FTS4,
- notIndexedColumns = emptyList(),
- prefixSizes = emptyList(),
- preferredOrder = androidx.room.FtsOptions.Order.ASC))
-
- assertThat(entity.createTableQuery,
- `is`("CREATE VIRTUAL TABLE IF NOT EXISTS `Mail` USING FTS4(" +
- "`body` TEXT" +
- ")"
- )
- )
- }
-
- @Test
- fun createStatement_nonSimpleTokenizer_withTokenizerArgs() {
- val primaryKeyField = createField("rowid")
- val bodyField = createField("body")
- val entity = FtsEntity(
- element = mock(TypeElement::class.java),
- tableName = "Mail",
- type = mock(DeclaredType::class.java),
- fields = listOf(primaryKeyField, bodyField),
- embeddedFields = emptyList(),
- primaryKey = PrimaryKey(
- declaredIn = mock(Element::class.java),
- fields = Fields(primaryKeyField),
- autoGenerateId = true),
- constructor = null,
- shadowTableName = "Mail_context",
- ftsVersion = FtsVersion.FTS4,
- ftsOptions = FtsOptions(
- tokenizer = androidx.room.FtsOptions.TOKENIZER_PORTER,
- tokenizerArgs = listOf("tokenchars=.=", "separators=X"),
- contentEntity = null,
- languageIdColumnName = "",
- matchInfo = androidx.room.FtsOptions.MatchInfo.FTS4,
- notIndexedColumns = emptyList(),
- prefixSizes = emptyList(),
- preferredOrder = androidx.room.FtsOptions.Order.ASC))
-
- assertThat(entity.createTableQuery,
- `is`("CREATE VIRTUAL TABLE IF NOT EXISTS `Mail` USING FTS4(" +
- "`body` TEXT, " +
- "tokenize=porter `tokenchars=.=` `separators=X`" +
- ")"
- )
- )
- }
-
- @Test
- fun createStatement_nonSimpleTokenizer_noTokenizerArgs() {
- val primaryKeyField = createField("rowid")
- val bodyField = createField("body")
- val entity = FtsEntity(
- element = mock(TypeElement::class.java),
- tableName = "Mail",
- type = mock(DeclaredType::class.java),
- fields = listOf(primaryKeyField, bodyField),
- embeddedFields = emptyList(),
- primaryKey = PrimaryKey(
- declaredIn = mock(Element::class.java),
- fields = Fields(primaryKeyField),
- autoGenerateId = true),
- constructor = null,
- shadowTableName = "Mail_context",
- ftsVersion = FtsVersion.FTS4,
- ftsOptions = FtsOptions(
- tokenizer = androidx.room.FtsOptions.TOKENIZER_PORTER,
- tokenizerArgs = emptyList(),
- contentEntity = null,
- languageIdColumnName = "",
- matchInfo = androidx.room.FtsOptions.MatchInfo.FTS4,
- notIndexedColumns = emptyList(),
- prefixSizes = emptyList(),
- preferredOrder = androidx.room.FtsOptions.Order.ASC))
-
- assertThat(entity.createTableQuery,
- `is`("CREATE VIRTUAL TABLE IF NOT EXISTS `Mail` USING FTS4(" +
- "`body` TEXT, " +
- "tokenize=porter" +
- ")"
- )
- )
- }
-
fun createField(name: String): Field {
val (element, type) = mockElementAndType()
return Field(
diff --git a/room/compiler/src/test/kotlin/androidx/room/writer/EntityCursorConverterWriterTest.kt b/room/compiler/src/test/kotlin/androidx/room/writer/EntityCursorConverterWriterTest.kt
index d02dc49..525cfe3 100644
--- a/room/compiler/src/test/kotlin/androidx/room/writer/EntityCursorConverterWriterTest.kt
+++ b/room/compiler/src/test/kotlin/androidx/room/writer/EntityCursorConverterWriterTest.kt
@@ -35,7 +35,7 @@
import java.lang.SuppressWarnings;
import javax.annotation.Generated;
@Generated("androidx.room.RoomProcessor")
- @SuppressWarnings({"unchecked", "deprecation"})
+ @SuppressWarnings("unchecked")
public class MyContainerClass {
""".trimIndent()
const val OUT_SUFFIX = "}"
@@ -80,11 +80,8 @@
""".trimIndent())
}
- fun generateAndMatch(
- input: String,
- output: String,
- attributes: Map<String, String> = mapOf()
- ) {
+ fun generateAndMatch(input: String, output: String,
+ attributes: Map<String, String> = mapOf()) {
generate(input, attributes)
.compilesWithoutError()
.and()
diff --git a/room/coroutines/build.gradle b/room/coroutines/build.gradle
new file mode 100644
index 0000000..bb734c9
--- /dev/null
+++ b/room/coroutines/build.gradle
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 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.
+ */
+
+import static androidx.build.dependencies.DependenciesKt.*
+import androidx.build.LibraryGroups
+import androidx.build.LibraryVersions
+import androidx.build.SupportLibraryExtension
+
+plugins {
+ id("SupportAndroidLibraryPlugin")
+ id("org.jetbrains.kotlin.android")
+}
+
+dependencies {
+ api(project(":room:room-common"))
+ api(project(":room:room-runtime"))
+ api(KOTLIN_STDLIB)
+ api(KOTLIN_COROUTINES)
+ testImplementation(JUNIT)
+ testImplementation(MOCKITO_CORE)
+}
+
+supportLibrary {
+ name = "Android Room Coroutines Adapter"
+ publish = true
+ mavenVersion = LibraryVersions.ROOM
+ mavenGroup = LibraryGroups.ROOM
+ inceptionYear = "2018"
+ description = "Android Room Coroutines Adapter"
+ url = SupportLibraryExtension.ARCHITECTURE_URL
+}
+repositories {
+ mavenCentral()
+}
\ No newline at end of file
diff --git a/room/coroutines/src/main/AndroidManifest.xml b/room/coroutines/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..364afdb
--- /dev/null
+++ b/room/coroutines/src/main/AndroidManifest.xml
@@ -0,0 +1,19 @@
+<!--
+ ~ Copyright (C) 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.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="androidx.room.coroutines">
+</manifest>
diff --git a/room/coroutines/src/main/java/androidx/room/CoroutinesRoom.kt b/room/coroutines/src/main/java/androidx/room/CoroutinesRoom.kt
new file mode 100644
index 0000000..5e166ab
--- /dev/null
+++ b/room/coroutines/src/main/java/androidx/room/CoroutinesRoom.kt
@@ -0,0 +1,43 @@
+/*
+ * 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.room
+
+import androidx.annotation.RestrictTo
+import kotlinx.coroutines.asCoroutineDispatcher
+import kotlinx.coroutines.withContext
+import java.util.concurrent.Callable
+
+/**
+ * A helper class for supporting Kotlin Coroutines in Room.
+ *
+ * @hide
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+class CoroutinesRoom {
+
+ companion object {
+ @JvmStatic
+ suspend fun <R> execute(db: RoomDatabase, callable: Callable<R>): R {
+ if (db.isOpen && db.inTransaction()) {
+ return callable.call()
+ }
+ return withContext(db.queryExecutor.asCoroutineDispatcher()) {
+ callable.call()
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/room/guava/build.gradle b/room/guava/build.gradle
index 6d8d92d..92c6e15 100644
--- a/room/guava/build.gradle
+++ b/room/guava/build.gradle
@@ -32,7 +32,6 @@
api(SUPPORT_ANNOTATIONS, libs.support_exclude_config)
api(GUAVA_ANDROID)
- api(GUAVA_LISTENABLE_FUTURE)
}
supportLibrary {
diff --git a/room/guava/src/main/java/androidx/room/guava/GuavaRoom.java b/room/guava/src/main/java/androidx/room/guava/GuavaRoom.java
index d4f6c2f..60a073f 100644
--- a/room/guava/src/main/java/androidx/room/guava/GuavaRoom.java
+++ b/room/guava/src/main/java/androidx/room/guava/GuavaRoom.java
@@ -37,7 +37,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@SuppressWarnings("unused") // Used in GuavaListenableFutureQueryResultBinder code generation.
@SuppressLint("RestrictedAPI") // ArchTaskExecutor can only be called from androidx.arch.core
public class GuavaRoom {
diff --git a/room/integration-tests/autovaluetestapp/build.gradle b/room/integration-tests/autovaluetestapp/build.gradle
index e55b5dc..97a93be 100644
--- a/room/integration-tests/autovaluetestapp/build.gradle
+++ b/room/integration-tests/autovaluetestapp/build.gradle
@@ -26,7 +26,7 @@
implementation(project(":sqlite:sqlite"))
implementation(project(":sqlite:sqlite-framework"))
implementation(project(":room:room-runtime"))
- implementation(project(":arch:core-runtime"))
+ implementation(ARCH_CORE_RUNTIME)
implementation(ARCH_LIFECYCLE_EXTENSIONS)
androidTestAnnotationProcessor project(":room:room-compiler")
diff --git a/room/integration-tests/kotlintestapp/build.gradle b/room/integration-tests/kotlintestapp/build.gradle
index 8e76446..9aedad7 100644
--- a/room/integration-tests/kotlintestapp/build.gradle
+++ b/room/integration-tests/kotlintestapp/build.gradle
@@ -44,8 +44,8 @@
implementation(project(":sqlite:sqlite"))
implementation(project(":sqlite:sqlite-framework"))
implementation(project(":room:room-runtime"))
- implementation(project(":arch:core-runtime"))
- implementation(project(":lifecycle:lifecycle-extensions"))
+ implementation(ARCH_CORE_RUNTIME)
+ implementation(ARCH_LIFECYCLE_EXTENSIONS)
implementation(KOTLIN_STDLIB)
implementation(KOTLIN_COROUTINES)
kaptAndroidTest project(":room:room-compiler")
@@ -60,14 +60,13 @@
exclude group: 'com.android.support', module: 'support-annotations'
exclude module: "hamcrest-core"
})
- androidTestImplementation(TRUTH)
// IJ's gradle integration just cannot figure this out ...
androidTestImplementation(ARCH_LIFECYCLE_EXTENSIONS)
androidTestImplementation(ARCH_CORE_RUNTIME)
androidTestImplementation project(':room:room-guava')
androidTestImplementation project(':room:room-testing')
androidTestImplementation project(':room:room-rxjava2')
- androidTestImplementation(project(":room:room-ktx"))
+ androidTestImplementation(project(":room:room-coroutines"))
androidTestImplementation(ARCH_CORE_TESTING)
androidTestImplementation(GUAVA_ANDROID)
androidTestImplementation(RX_JAVA)
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/TestDatabase.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/TestDatabase.kt
index df906b2..fa43ad2 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/TestDatabase.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/TestDatabase.kt
@@ -18,7 +18,6 @@
import androidx.room.Database
import androidx.room.RoomDatabase
-import androidx.room.integration.kotlintestapp.dao.AbstractDao
import androidx.room.integration.kotlintestapp.dao.BooksDao
import androidx.room.integration.kotlintestapp.dao.DependencyDao
import androidx.room.integration.kotlintestapp.dao.DerivedDao
@@ -45,6 +44,4 @@
abstract fun derivedDao(): DerivedDao
abstract fun dependencyDao(): DependencyDao
-
- abstract fun abstractDao(): AbstractDao
}
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/AbstractDao.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/AbstractDao.kt
deleted file mode 100644
index 37b9011..0000000
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/AbstractDao.kt
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2019 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.room.integration.kotlintestapp.dao
-
-import androidx.room.Dao
-import androidx.room.Insert
-import androidx.room.Query
-import androidx.room.Transaction
-import androidx.room.integration.kotlintestapp.vo.Author
-import androidx.room.integration.kotlintestapp.vo.Book
-
-@Dao
-abstract class AbstractDao {
- // For verifying b/123466702
- @Query("DELETE FROM book")
- internal abstract suspend fun deleteAllBooksSuspend()
-
- @Insert
- abstract fun addBooks(vararg books: Book)
-
- @Insert
- abstract fun addAuthors(vararg authors: Author)
-
- @Transaction
- open suspend fun insertBookAndAuthorSuspend(book: Book, author: Author) {
- addBooks(book)
- addAuthors(author)
- }
-}
\ No newline at end of file
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
index 4db7053..51f4184 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/dao/BooksDao.kt
@@ -25,7 +25,6 @@
import androidx.room.Transaction
import androidx.room.TypeConverters
import androidx.room.Update
-import androidx.room.integration.kotlintestapp.vo.AnswerConverter
import androidx.room.integration.kotlintestapp.vo.Author
import androidx.room.integration.kotlintestapp.vo.Book
import androidx.room.integration.kotlintestapp.vo.BookAuthor
@@ -46,7 +45,7 @@
import java.util.Date
@Dao
-@TypeConverters(DateConverter::class, AnswerConverter::class)
+@TypeConverters(DateConverter::class)
interface BooksDao {
@Insert
@@ -70,9 +69,6 @@
@Insert
fun addPublisherMaybe(publisher: Publisher): Maybe<Long>
- @Insert
- fun addPublisherSuspend(publisher: Publisher)
-
@Delete
fun deletePublishers(vararg publishers: Publisher)
@@ -106,9 +102,6 @@
@Insert
fun addAuthors(vararg authors: Author)
- @Insert
- suspend fun addAuthorsSuspend(vararg authors: Author)
-
@Query("SELECT * FROM author WHERE authorId = :authorId")
fun getAuthor(authorId: String): Author
@@ -337,37 +330,4 @@
@Query("SELECT dateOfBirth FROM author WHERE authorId = :authorId")
suspend fun getAuthorDateOfBirths(authorId: String): Date
-
- // see: b/123767877, suspend function with inner class as parameter issues.
- @Query("SELECT 0 FROM book WHERE bookId = :param")
- suspend fun getZero(param: AnswerConverter.Answer): Int
-
- // see: b/123767877, suspend function with inner class as parameter issues.
- @Query("SELECT 'YES' FROM book")
- suspend fun getAnswer(): AnswerConverter.Answer
-
- @Transaction
- suspend fun insertBookAndAuthorSuspend(book: Book, author: Author) {
- addBooks(book)
- addAuthors(author)
- }
-
- @Query("SELECT * FROM book WHERE salesCnt = :count")
- suspend fun getBooksSalesCountSuspend(count: Int): List<Book>
-
- @Transaction
- suspend fun deleteBooksWithZeroSales(): List<Book> {
- val books = getBooksSalesCountSuspend(0)
- deleteBookWithIds(*books.map { it.bookId }.toTypedArray())
- return books
- }
-
- @Transaction
- suspend fun addAuthorPublisherBooks(author: Author, publisher: Publisher, vararg books: Book) {
- addAuthorsSuspend(author)
- addPublisherSuspend(publisher)
- for (book in books) {
- insertBookSuspend(book)
- }
- }
}
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt
index 8826051..ebd6c68 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt
@@ -22,7 +22,6 @@
import androidx.room.util.TableInfo
import androidx.sqlite.db.SupportSQLiteDatabase
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory
-import androidx.test.filters.MediumTest
import androidx.test.platform.app.InstrumentationRegistry
import org.hamcrest.CoreMatchers.`is`
import org.hamcrest.CoreMatchers.containsString
@@ -34,7 +33,6 @@
import java.io.FileNotFoundException
import java.io.IOException
-@MediumTest
class MigrationKotlinTest {
@get:Rule
@@ -98,7 +96,6 @@
assertThat(entity2s.size, `is`(2))
}
- @Suppress("DEPRECATION")
private fun getLatestDb(): MigrationDbKotlin {
val db = Room.databaseBuilder(
InstrumentationRegistry.getInstrumentation().targetContext,
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/BooksDaoTest.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/BooksDaoTest.kt
index 6228828..1fe88e6 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/BooksDaoTest.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/BooksDaoTest.kt
@@ -23,13 +23,12 @@
import androidx.room.integration.kotlintestapp.vo.BookWithPublisher
import androidx.room.integration.kotlintestapp.vo.Lang
import androidx.room.integration.kotlintestapp.vo.Publisher
-import androidx.test.filters.MediumTest
import androidx.test.filters.SdkSuppress
+import androidx.test.filters.SmallTest
import com.google.common.base.Optional
import io.reactivex.Flowable
import io.reactivex.schedulers.Schedulers
import io.reactivex.subscribers.TestSubscriber
-import kotlinx.coroutines.runBlocking
import org.hamcrest.CoreMatchers
import org.hamcrest.CoreMatchers.`is`
import org.hamcrest.CoreMatchers.equalTo
@@ -37,11 +36,10 @@
import org.hamcrest.CoreMatchers.notNullValue
import org.hamcrest.MatcherAssert.assertThat
import org.junit.Assert.assertNotNull
-import org.junit.Assert.fail
import org.junit.Test
import java.util.Date
-@MediumTest
+@SmallTest
class BooksDaoTest : TestDatabaseTest() {
@Test
@@ -325,37 +323,4 @@
assertThat(this.first(), `is`(equalTo(TestUtil.PUBLISHER)))
}
}
-
- @Test
- fun deleteBooksWithZeroSales() {
- val books = listOf(
- TestUtil.BOOK_1.copy(salesCnt = 0),
- TestUtil.BOOK_2.copy(salesCnt = 0)
- )
- booksDao.addPublishers(TestUtil.PUBLISHER)
- booksDao.addBooks(*books.toTypedArray())
-
- runBlocking {
- assertThat(booksDao.deleteBooksWithZeroSales(), `is`(equalTo(books)))
- assertThat(booksDao.getBooksSuspend(), `is`(equalTo(emptyList())))
- }
- }
-
- @Test
- fun addAuthorPublisherBooks_failure() {
- runBlocking {
- try {
- booksDao.addAuthorPublisherBooks(
- author = TestUtil.AUTHOR_1,
- publisher = TestUtil.PUBLISHER,
- books = *arrayOf(TestUtil.BOOK_1, TestUtil.BOOK_1)
- )
- fail("addAuthorPublisherBooks should have failed")
- } catch (ex: SQLiteConstraintException) {
- // ignored on purpose
- }
-
- assertThat(booksDao.getBooksSuspend().isEmpty(), `is`(true))
- }
- }
}
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/DependencyDaoTest.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/DependencyDaoTest.kt
index 1ec69ed..bf1a56e 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/DependencyDaoTest.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/DependencyDaoTest.kt
@@ -22,7 +22,6 @@
import androidx.room.integration.kotlintestapp.vo.PojoFromDependency
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SdkSuppress
-import androidx.test.filters.SmallTest
import org.hamcrest.CoreMatchers.`is`
import org.hamcrest.CoreMatchers.notNullValue
import org.hamcrest.CoreMatchers.nullValue
@@ -32,7 +31,6 @@
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
-@SmallTest
class DependencyDaoTest : TestDatabaseTest() {
lateinit var dao: DependencyDao
@Before
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/ItemWithNullableConstructor.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/ItemWithNullableConstructor.kt
index c0223fe..d54e0d7 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/ItemWithNullableConstructor.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/ItemWithNullableConstructor.kt
@@ -26,7 +26,6 @@
import androidx.room.RoomWarnings
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
import org.hamcrest.CoreMatchers.`is`
import org.hamcrest.MatcherAssert.assertThat
import org.junit.After
@@ -35,7 +34,6 @@
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
-@SmallTest
class ItemWithNullableConstructor {
lateinit var db: Db
@Before
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/LiveDataQueryTest.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/LiveDataQueryTest.kt
index fecb9ef..b1b30c0 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/LiveDataQueryTest.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/LiveDataQueryTest.kt
@@ -19,12 +19,12 @@
import androidx.room.integration.kotlintestapp.vo.Book
import androidx.room.integration.kotlintestapp.vo.BookWithPublisher
import androidx.room.integration.kotlintestapp.vo.Publisher
-import androidx.test.filters.MediumTest
+import androidx.test.filters.SmallTest
import org.hamcrest.CoreMatchers.`is`
import org.hamcrest.MatcherAssert.assertThat
import org.junit.Test
-@MediumTest
+@SmallTest
class LiveDataQueryTest : TestDatabaseTest() {
@Test
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/RxJava2QueryTest.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/RxJava2QueryTest.kt
index 4f7db1b..f55b616 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/RxJava2QueryTest.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/RxJava2QueryTest.kt
@@ -19,8 +19,6 @@
import androidx.room.EmptyResultSetException
import androidx.room.integration.kotlintestapp.vo.BookWithPublisher
import androidx.test.filters.SmallTest
-import androidx.test.platform.app.InstrumentationRegistry
-import io.reactivex.schedulers.Schedulers
import org.junit.Test
@SmallTest
@@ -114,22 +112,4 @@
it.books?.get(1) == TestUtil.BOOK_2
}
}
-
- @Test
- fun mainThreadSubscribe_sharedPreparedQuery() {
- InstrumentationRegistry.getInstrumentation().runOnMainSync {
- booksDao.insertPublisherCompletable("a1", "author1")
- .subscribeOn(Schedulers.io())
- .blockingAwait()
- }
- }
-
- @Test
- fun mainThreadSubscribe_preparedQuery() {
- InstrumentationRegistry.getInstrumentation().runOnMainSync {
- booksDao.deleteBookWithIdsSingle("b1", "b2")
- .subscribeOn(Schedulers.io())
- .blockingGet()
- }
- }
}
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendingQueryTest.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendingQueryTest.kt
index 390c481..83f052e 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendingQueryTest.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/SuspendingQueryTest.kt
@@ -16,50 +16,19 @@
package androidx.room.integration.kotlintestapp.test
-import android.os.Build
-import androidx.room.Room
-import androidx.room.RoomDatabase
import androidx.room.integration.kotlintestapp.NewThreadDispatcher
-import androidx.room.integration.kotlintestapp.TestDatabase
import androidx.room.integration.kotlintestapp.vo.Book
-import androidx.room.withTransaction
-import androidx.sqlite.db.SupportSQLiteDatabase
-import androidx.sqlite.db.SupportSQLiteOpenHelper
-import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory
-import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
-import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.CancellationException
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.async
-import kotlinx.coroutines.cancelAndJoin
-import kotlinx.coroutines.delay
-import kotlinx.coroutines.launch
-import kotlinx.coroutines.newSingleThreadContext
+import androidx.test.filters.SmallTest
import kotlinx.coroutines.runBlocking
-import kotlinx.coroutines.withContext
-import kotlinx.coroutines.yield
-import org.junit.After
-import org.junit.Assert.fail
+import org.hamcrest.CoreMatchers.`is`
+import org.hamcrest.MatcherAssert.assertThat
import org.junit.Test
import org.junit.runner.RunWith
-import java.io.IOException
-import java.util.concurrent.CountDownLatch
-import java.util.concurrent.Executors
-import java.util.concurrent.TimeUnit
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4::class)
class SuspendingQueryTest : TestDatabaseTest() {
-
- @After
- fun teardown() {
- // At the end of all tests, query executor should be idle (transaction thread released).
- countingTaskExecutorRule.drainTasks(500, TimeUnit.MILLISECONDS)
- assertThat(countingTaskExecutorRule.isIdle).isTrue()
- }
-
@Test
fun bookByIdSuspend() {
runBlocking {
@@ -67,8 +36,10 @@
booksDao.addPublishers(TestUtil.PUBLISHER)
booksDao.addBooks(TestUtil.BOOK_1)
- assertThat(booksDao.getBookSuspend(TestUtil.BOOK_1.bookId))
- .isEqualTo(TestUtil.BOOK_1)
+ assertThat(
+ booksDao.getBookSuspend(TestUtil.BOOK_1.bookId),
+ `is`<Book>(TestUtil.BOOK_1)
+ )
}
}
@@ -81,71 +52,22 @@
val books = booksDao.getBooksSuspend()
- assertThat(books.size).isEqualTo((2))
- assertThat(books[0]).isEqualTo(TestUtil.BOOK_1)
- assertThat(books[1]).isEqualTo(TestUtil.BOOK_2)
+ assertThat(books.size, `is`(2))
+ assertThat(books[0], `is`<Book>(TestUtil.BOOK_1))
+ assertThat(books[1], `is`<Book>(TestUtil.BOOK_2))
}
}
@Test
- @Suppress("DEPRECATION")
- fun suspendingBlock_beginEndTransaction() {
- runBlocking {
- try {
- database.beginTransaction()
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- booksDao.insertBookSuspend(TestUtil.BOOK_1.copy(salesCnt = 0))
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
-
- booksDao.deleteUnsoldBooks()
- database.setTransactionSuccessful()
- } finally {
- database.endTransaction()
- }
- }
- runBlocking {
- assertThat(booksDao.getBooksSuspend()).isEqualTo(listOf(TestUtil.BOOK_2))
- }
- }
-
- @Test
- @Suppress("DEPRECATION")
- fun suspendingBlock_beginEndTransaction_blockingDaoMethods() {
- runBlocking {
- try {
- database.beginTransaction()
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
-
- booksDao.addBooks(TestUtil.BOOK_1.copy(salesCnt = 0), TestUtil.BOOK_2)
-
- booksDao.deleteUnsoldBooks()
- database.setTransactionSuccessful()
- } finally {
- database.endTransaction()
- }
- }
- runBlocking {
- assertThat(booksDao.getBooksSuspend()).isEqualTo(listOf(TestUtil.BOOK_2))
- }
- }
-
- @Test
- @Suppress("DEPRECATION")
- fun suspendingBlock_beginEndTransaction_newThreadDispatcher() {
+ fun suspendingTransaction() {
runBlocking(NewThreadDispatcher()) {
try {
database.beginTransaction()
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- booksDao.insertBookSuspend(TestUtil.BOOK_1.copy(salesCnt = 0))
+ booksDao.insertPublisherSuspend(TestUtil.PUBLISHER.publisherId,
+ TestUtil.PUBLISHER.name)
+ booksDao.insertBookSuspend(TestUtil.BOOK_1.copy(
+ salesCnt = 0
+ ))
booksDao.insertBookSuspend(TestUtil.BOOK_2)
booksDao.deleteUnsoldBooks()
@@ -155,730 +77,7 @@
}
}
runBlocking(NewThreadDispatcher()) {
- assertThat(booksDao.getBooksSuspend()).isEqualTo(listOf(TestUtil.BOOK_2))
- }
- }
-
- @Test
- fun suspendingBlock_blockingDaoMethods() {
- runBlocking {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
-
- booksDao.addBooks(TestUtil.BOOK_1)
-
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(listOf(TestUtil.BOOK_1))
- }
- }
-
- @Test
- fun runSuspendingTransaction() {
- runBlocking {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- booksDao.insertBookSuspend(TestUtil.BOOK_1.copy(salesCnt = 0))
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- booksDao.deleteUnsoldBooks()
- }
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(listOf(TestUtil.BOOK_2))
- }
- }
-
- @Test
- fun withTransaction_newThreadDispatcher() {
- runBlocking(NewThreadDispatcher()) {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- booksDao.insertBookSuspend(TestUtil.BOOK_1.copy(salesCnt = 0))
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- booksDao.deleteUnsoldBooks()
- }
- }
- runBlocking(NewThreadDispatcher()) {
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(listOf(TestUtil.BOOK_2))
- }
- }
-
- @Test
- fun withTransaction_ioDispatcher() {
- runBlocking(Dispatchers.IO) {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- booksDao.insertBookSuspend(TestUtil.BOOK_1.copy(salesCnt = 0))
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- booksDao.deleteUnsoldBooks()
- }
- }
- runBlocking(NewThreadDispatcher()) {
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(listOf(TestUtil.BOOK_2))
- }
- }
-
- @Test
- fun withTransaction_contextSwitch() {
- runBlocking {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- withContext(Dispatchers.IO) {
- booksDao.insertBookSuspend(TestUtil.BOOK_1.copy(salesCnt = 0))
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- }
- booksDao.deleteUnsoldBooks()
- }
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(listOf(TestUtil.BOOK_2))
- }
- }
-
- @Test
- fun withTransaction_exception() {
- runBlocking {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- booksDao.insertBookSuspend(TestUtil.BOOK_1)
- }
-
- try {
- database.withTransaction {
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- throw IOException("Boom!")
- }
- fail("An exception should have been thrown.")
- } catch (ex: IOException) {
- assertThat(ex).hasMessageThat()
- .contains("Boom")
- }
-
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(listOf(TestUtil.BOOK_1))
- }
- }
-
- @Test
- fun withTransaction_nested() {
- runBlocking {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- database.withTransaction {
- booksDao.insertBookSuspend(TestUtil.BOOK_1.copy(salesCnt = 0))
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- }
- booksDao.deleteUnsoldBooks()
- }
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(listOf(TestUtil.BOOK_2))
- }
- }
-
- @Test
- fun withTransaction_nested_exception() {
- runBlocking {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
-
- try {
- database.withTransaction {
- booksDao.insertBookSuspend(TestUtil.BOOK_1.copy(salesCnt = 0))
- throw IOException("Boom!")
- }
- fail("An exception should have been thrown.")
- } catch (ex: IOException) {
- assertThat(ex).hasMessageThat()
- .contains("Boom")
- }
- }
-
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(emptyList<Book>())
- }
- }
-
- @Test
- fun withTransaction_nested_finally() {
- runBlocking {
- var finallyBlocksExecuted = 0
- try {
- database.withTransaction {
- try {
- database.withTransaction {
- throw IOException("Boom!")
- }
- fail("An exception should have been thrown.")
- } catch (ex: IOException) {
- assertThat(ex).hasMessageThat()
- .contains("Boom")
- } finally {
- finallyBlocksExecuted++
- }
- }
- } finally {
- finallyBlocksExecuted++
- }
-
- assertThat(finallyBlocksExecuted).isEqualTo(2)
- }
- }
-
- @Test
- fun withTransaction_nested_contextSwitch() {
- runBlocking {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- withContext(Dispatchers.IO) {
- database.withTransaction {
- booksDao.insertBookSuspend(TestUtil.BOOK_1.copy(salesCnt = 0))
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- }
- }
- booksDao.deleteUnsoldBooks()
- }
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(listOf(TestUtil.BOOK_2))
- }
- }
-
- @Test
- fun withTransaction_childCoroutine_defaultDispatcher() {
- runBlocking {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- launch {
- booksDao.insertBookSuspend(TestUtil.BOOK_1)
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- }
- }
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(listOf(TestUtil.BOOK_1, TestUtil.BOOK_2))
- }
- }
-
- @Test
- fun withTransaction_childCoroutine_ioDispatcher() {
- runBlocking {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- launch(Dispatchers.IO) {
- booksDao.insertBookSuspend(TestUtil.BOOK_1)
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- }
- }
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(listOf(TestUtil.BOOK_1, TestUtil.BOOK_2))
- }
- }
-
- @Test
- fun withTransaction_cancelCoroutine() {
- runBlocking {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- booksDao.insertBookSuspend(TestUtil.BOOK_1)
-
- val startedRunning = CountDownLatch(1)
- var insertAttempted = false
- val job = launch(Dispatchers.IO) {
- database.withTransaction {
- // insert before delaying, to then assert transaction is not committed
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- insertAttempted = true
- startedRunning.countDown()
- // delay so we can cancel
- delay(Long.MAX_VALUE)
- }
- }
-
- assertThat(startedRunning.await(1, TimeUnit.SECONDS)).isTrue()
- job.cancelAndJoin()
-
- booksDao.insertBookSuspend(TestUtil.BOOK_3)
-
- assertThat(insertAttempted).isTrue() // make sure we attempted to insert
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(listOf(TestUtil.BOOK_1, TestUtil.BOOK_3))
- }
- }
-
- @Test
- fun withTransaction_cancelCoroutine_beforeThreadAcquire() {
- runBlocking {
- val job = launch {
- database.withTransaction {
- fail("This coroutine should never run.")
- }
- }
-
- yield()
- job.cancelAndJoin()
- }
- }
-
- @Test
- fun withTransaction_blockingDaoMethods() {
- runBlocking {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
- booksDao.addBooks(TestUtil.BOOK_1.copy(salesCnt = 0))
- booksDao.addBooks(TestUtil.BOOK_2)
-
- booksDao.deleteUnsoldBooks()
- }
- assertThat(booksDao.getBooksSuspend())
- .isEqualTo(listOf(TestUtil.BOOK_2))
- }
- }
-
- @Test
- fun withTransaction_blockingDaoMethods_contextSwitch() {
- runBlocking {
- database.withTransaction {
- // normal query
- try {
- withContext(Dispatchers.IO) {
- booksDao.getBook("b1")
- }
- fail("An exception should have been thrown")
- } catch (ex: IllegalStateException) {
- assertThat(ex).hasMessageThat()
- .contains("Cannot access database on a different coroutine context")
- }
-
- // delete or update shortcut
- try {
- withContext(Dispatchers.IO) {
- booksDao.deleteUnsoldBooks()
- }
- fail("An exception should have been thrown")
- } catch (ex: IllegalStateException) {
- assertThat(ex).hasMessageThat()
- .contains("Cannot access database on a different coroutine context")
- }
-
- // insert shortcut
- try {
- withContext(Dispatchers.IO) {
- booksDao.insertPublisherVoid("p1", "publisher1")
- }
- fail("An exception should have been thrown")
- } catch (ex: IllegalStateException) {
- assertThat(ex).hasMessageThat()
- .contains("Cannot access database on a different coroutine context")
- }
-
- // shared prepared query
- try {
- withContext(Dispatchers.IO) {
- booksDao.addPublishers(TestUtil.PUBLISHER)
- }
- fail("An exception should have been thrown")
- } catch (ex: IllegalStateException) {
- assertThat(ex).hasMessageThat()
- .contains("Cannot access database on a different coroutine context")
- }
-
- // prepared query
- try {
- withContext(Dispatchers.IO) {
- booksDao.deleteBookWithIds("b1", "b2")
- }
- fail("An exception should have been thrown")
- } catch (ex: IllegalStateException) {
- assertThat(ex).hasMessageThat()
- .contains("Cannot access database on a different coroutine context")
- }
- }
- }
- }
-
- @Test
- @Suppress("DeferredResultUnused")
- fun withTransaction_async() {
- runBlocking {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
-
- async {
- booksDao.insertBookSuspend(TestUtil.BOOK_1)
- }
- async(Dispatchers.Default) {
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- }
- async(Dispatchers.IO) {
- booksDao.insertBookSuspend(TestUtil.BOOK_3)
- }
- }
-
- // as Set since insertion order is undefined
- assertThat(booksDao.getBooksSuspend().toSet())
- .isEqualTo(setOf(TestUtil.BOOK_1, TestUtil.BOOK_2, TestUtil.BOOK_3))
- }
- }
-
- @Test
- @Suppress("DeferredResultUnused")
- fun withTransaction_async_ioDispatcher() {
- runBlocking {
- database.withTransaction {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
-
- withContext(Dispatchers.IO) {
- async {
- booksDao.insertBookSuspend(TestUtil.BOOK_1)
- }
- async {
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- }
- async {
- booksDao.insertBookSuspend(TestUtil.BOOK_3)
- }
- }
- }
-
- // as Set since insertion order is undefined
- assertThat(booksDao.getBooksSuspend().toSet())
- .isEqualTo(setOf(TestUtil.BOOK_1, TestUtil.BOOK_2, TestUtil.BOOK_3))
- }
- }
-
- @Test
- @Suppress("DeferredResultUnused")
- fun withTransaction_multipleTransactions() {
- runBlocking {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
-
- async {
- database.withTransaction {
- booksDao.insertBookSuspend(TestUtil.BOOK_1)
- }
- }
-
- async {
- database.withTransaction {
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- }
- }
- }
-
- runBlocking {
- // as Set since insertion order is undefined
- assertThat(booksDao.getBooksSuspend().toSet())
- .isEqualTo(setOf(TestUtil.BOOK_1, TestUtil.BOOK_2))
- }
- }
-
- @Test
- @Suppress("DeferredResultUnused")
- fun withTransaction_multipleTransactions_multipleThreads() {
- runBlocking {
- booksDao.insertPublisherSuspend(
- TestUtil.PUBLISHER.publisherId,
- TestUtil.PUBLISHER.name
- )
-
- async(newSingleThreadContext("asyncThread1")) {
- database.withTransaction {
- delay(100)
- booksDao.insertBookSuspend(TestUtil.BOOK_1)
- }
- }
-
- async(newSingleThreadContext("asyncThread2")) {
- database.withTransaction {
- delay(100)
- booksDao.insertBookSuspend(TestUtil.BOOK_2)
- }
- }
- }
-
- runBlocking {
- // as Set since insertion order is undefined
- assertThat(booksDao.getBooksSuspend().toSet())
- .isEqualTo(setOf(TestUtil.BOOK_1, TestUtil.BOOK_2))
- }
- }
-
- @Test
- @Suppress("DeferredResultUnused")
- fun withTransaction_leakTransactionContext_async() {
- runBlocking {
- val leakedContext = database.withTransaction {
- coroutineContext
- }
-
- async(leakedContext) {
- fail("This coroutine should never run.")
- }
- }
- }
-
- @Test
- fun withTransaction_leakTransactionContext_launch() {
- runBlocking {
- val leakedContext = database.withTransaction {
- coroutineContext
- }
-
- launch(leakedContext) {
- fail("This coroutine should never run.")
- }
- }
- }
-
- @Test
- fun withTransaction_leakTransactionContext_withContext() {
- runBlocking {
- val leakedContext = database.withTransaction {
- coroutineContext
- }
-
- try {
- withContext(leakedContext) {
- fail("This coroutine should never run.")
- }
- fail("An exception should have been thrown by withContext")
- } catch (ex: CancellationException) {
- // Ignored on-purpose
- }
- }
- }
-
- @Test
- fun withTransaction_leakTransactionContext_runBlocking() {
- runBlocking {
- val leakedContext = database.withTransaction {
- coroutineContext
- }
-
- try {
- runBlocking(leakedContext) {
- fail("This coroutine should never run.")
- }
- fail("An exception should have been thrown by runBlocking")
- } catch (ex: CancellationException) {
- // Ignored on-purpose
- }
- }
- }
-
- @Test
- fun withTransaction_busyExecutor() {
- runBlocking {
- val executorService = Executors.newSingleThreadExecutor()
- val localDatabase = Room.inMemoryDatabaseBuilder(
- ApplicationProvider.getApplicationContext(), TestDatabase::class.java)
- .setQueryExecutor(executorService)
- .build()
-
- // Simulate a busy executor, no thread to acquire for transaction.
- val busyLatch = CountDownLatch(1)
- executorService.execute {
- busyLatch.await()
- }
-
- var asyncExecuted = false
- val transactionLatch = CountDownLatch(1)
- val job = async(Dispatchers.IO) {
- asyncExecuted = true
- localDatabase.withTransaction {
- transactionLatch.countDown()
- }
- }
-
- assertThat(transactionLatch.await(1000, TimeUnit.MILLISECONDS)).isFalse()
- job.cancelAndJoin()
-
- assertThat(asyncExecuted).isTrue()
-
- // free busy thread
- busyLatch.countDown()
- executorService.awaitTermination(1, TimeUnit.SECONDS)
- }
- }
-
- @Test
- fun withTransaction_shutdownExecutor() {
- runBlocking {
- val executorService = Executors.newCachedThreadPool()
- val localDatabase = Room.inMemoryDatabaseBuilder(
- ApplicationProvider.getApplicationContext(), TestDatabase::class.java)
- .setQueryExecutor(executorService)
- .build()
-
- executorService.shutdownNow()
-
- try {
- localDatabase.withTransaction {
- fail("This coroutine should never run.")
- }
- fail("An exception should have been thrown by withTransaction")
- } catch (ex: IllegalStateException) {
- assertThat(ex).hasMessageThat()
- .contains("Unable to acquire a thread to perform the database transaction")
- }
- }
- }
-
- @Test
- fun withTransaction_databaseOpenError() {
- runBlocking {
- val localDatabase = Room.inMemoryDatabaseBuilder(
- ApplicationProvider.getApplicationContext(), TestDatabase::class.java)
- .addCallback(object : RoomDatabase.Callback() {
- override fun onOpen(db: SupportSQLiteDatabase) {
- // this causes all transaction methods to throw, this can happen IRL
- throw RuntimeException("Error opening Database.")
- }
- })
- .build()
-
- try {
- localDatabase.withTransaction {
- fail("This coroutine should never run.")
- }
- } catch (ex: RuntimeException) {
- assertThat(ex).hasMessageThat()
- .contains("Error opening Database.")
- }
- }
- }
-
- @Test
- fun withTransaction_beginTransaction_error() {
- runBlocking {
- // delegate and delegate just so that we can throw in beginTransaction()
- val localDatabase = Room.inMemoryDatabaseBuilder(
- ApplicationProvider.getApplicationContext(), TestDatabase::class.java)
- .openHelperFactory(
- object : SupportSQLiteOpenHelper.Factory {
- val factoryDelegate = FrameworkSQLiteOpenHelperFactory()
- override fun create(
- configuration: SupportSQLiteOpenHelper.Configuration?
- ): SupportSQLiteOpenHelper {
- val helperDelegate = factoryDelegate.create(configuration)
- return object : SupportSQLiteOpenHelper by helperDelegate {
- override fun getWritableDatabase(): SupportSQLiteDatabase {
- val databaseDelegate = helperDelegate.writableDatabase
- return object : SupportSQLiteDatabase by databaseDelegate {
- override fun beginTransaction() {
- throw RuntimeException("Error beginning transaction.")
- }
- }
- }
- }
- }
- }
- )
- .build()
-
- try {
- localDatabase.withTransaction {
- fail("This coroutine should never run.")
- }
- } catch (ex: RuntimeException) {
- assertThat(ex).hasMessageThat()
- .contains("Error beginning transaction")
- }
- }
- }
-
- @Test
- @Suppress("DEPRECATION")
- fun withTransaction_setTransactionSuccessful_error() {
- runBlocking {
- try {
- database.withTransaction {
- // ending transaction prematurely so that setTransactionSuccessful() invoked by
- // withTransaction throws.
- database.endTransaction()
- }
- } catch (ex: IllegalStateException) {
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
- assertThat(ex).hasMessageThat()
- .contains(
- "Cannot perform this operation because there is no current " +
- "transaction"
- )
- } else {
- assertThat(ex).hasMessageThat()
- .contains("Don't have database lock")
- }
- }
- }
- }
-
- @Test
- @Suppress("DEPRECATION")
- fun withTransaction_endTransaction_error() {
- runBlocking {
- try {
- database.withTransaction {
- // ending transaction prematurely and quickly throwing so that endTransaction()
- // invoked by withTransaction throws.
- database.endTransaction()
- // this exception will get swallowed by the exception thrown in endTransaction()
- throw RuntimeException()
- }
- } catch (ex: IllegalStateException) {
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
- assertThat(ex).hasMessageThat()
- .contains(
- "Cannot perform this operation because there is no current " +
- "transaction"
- )
- } else {
- assertThat(ex).hasMessageThat()
- .contains("Don't have database lock")
- }
- }
+ assertThat(booksDao.getBooksSuspend(), `is`(listOf(TestUtil.BOOK_2)))
}
}
}
\ No newline at end of file
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/vo/AnswerConverter.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/vo/AnswerConverter.kt
deleted file mode 100644
index 2fd788d..0000000
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/vo/AnswerConverter.kt
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2019 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.room.integration.kotlintestapp.vo
-
-import androidx.room.TypeConverter
-
-class AnswerConverter {
-
- enum class Answer {
- YES,
- NO
- }
-
- @TypeConverter
- fun toAnswer(value: String?) = value?.let { Answer.valueOf(it) }
-
- @TypeConverter
- fun fromAnswer(value: Answer?) = value?.name
-}
\ No newline at end of file
diff --git a/room/integration-tests/testapp/build.gradle b/room/integration-tests/testapp/build.gradle
index 67bfa91..93a77c8 100644
--- a/room/integration-tests/testapp/build.gradle
+++ b/room/integration-tests/testapp/build.gradle
@@ -40,8 +40,8 @@
implementation(project(":room:room-runtime"))
implementation(project(":sqlite:sqlite"))
implementation(project(":sqlite:sqlite-framework"))
- implementation(project(":arch:core-runtime"))
- implementation(project(":lifecycle:lifecycle-extensions"))
+ implementation(ARCH_CORE_RUNTIME)
+ implementation(ARCH_LIFECYCLE_EXTENSIONS)
// FINDBUGS dependency resolves an app/testapp version conflict.
implementation(FINDBUGS)
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/FtsMigrationTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/FtsMigrationTest.java
index 9abf50d..7d2f1c0 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/FtsMigrationTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/FtsMigrationTest.java
@@ -40,8 +40,8 @@
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Rule;
@@ -51,7 +51,7 @@
import java.util.List;
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.JELLY_BEAN)
public class FtsMigrationTest {
private static final String TEST_DB = "migration-test";
@@ -170,7 +170,6 @@
assertThat(addresses.get(0).line1, is("Ruth Ave"));
}
- @SuppressWarnings("deprecation")
private FtsMigrationDb getLatestDb() {
FtsMigrationDb db = Room.databaseBuilder(
InstrumentationRegistry.getInstrumentation().getTargetContext(),
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/JournalDbPostMigrationTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/JournalDbPostMigrationTest.java
index 6cc574e..2008cf3 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/JournalDbPostMigrationTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/JournalDbPostMigrationTest.java
@@ -42,8 +42,8 @@
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.After;
@@ -68,7 +68,7 @@
*/
@SdkSuppress(minSdkVersion = 24)
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
public class JournalDbPostMigrationTest {
@Rule
public CountingTaskExecutorRule executorRule = new CountingTaskExecutorRule();
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/MigrationTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/MigrationTest.java
index a9372c9..32790b6 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/MigrationTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/MigrationTest.java
@@ -39,7 +39,7 @@
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.hamcrest.MatcherAssert;
@@ -56,7 +56,7 @@
* Test custom database migrations.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class MigrationTest {
private static final String TEST_DB = "migration-test";
@Rule
@@ -116,7 +116,6 @@
assertThat(entity2s.size(), is(2));
}
- @SuppressWarnings("deprecation")
private MigrationDb getLatestDb() {
MigrationDb db = Room.databaseBuilder(
InstrumentationRegistry.getInstrumentation().getTargetContext(),
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/paging/DataSourceFactoryTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/paging/DataSourceFactoryTest.java
index d95338c..3504ec1 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/paging/DataSourceFactoryTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/paging/DataSourceFactoryTest.java
@@ -90,7 +90,6 @@
.build());
}
- @SuppressWarnings("deprecation")
private void validateUsersAsPagedList(
LivePagedListFactory factory)
throws InterruptedException, ExecutionException, TimeoutException {
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/paging/LimitOffsetDataSourceTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
index cf95bce..d59619b 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/paging/LimitOffsetDataSourceTest.java
@@ -27,7 +27,7 @@
import androidx.room.integration.testapp.vo.User;
import androidx.room.paging.LimitOffsetDataSource;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Test;
@@ -36,7 +36,7 @@
import java.util.ArrayList;
import java.util.List;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class LimitOffsetDataSourceTest extends TestDatabaseTest {
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/ForeignKeyTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/ForeignKeyTest.java
index f9f025a..8805044 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/ForeignKeyTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/ForeignKeyTest.java
@@ -240,7 +240,6 @@
@Test
public void immediateForeignKeyFailure() {
Throwable t = catchException(new ThrowingRunnable() {
- @SuppressWarnings("deprecation")
@Override
public void run() throws Exception {
try {
@@ -256,7 +255,6 @@
assertThat(t, instanceOf(SQLiteException.class));
}
- @SuppressWarnings("deprecation")
@Test
public void deferredForeignKeySuccess() {
try {
@@ -392,7 +390,7 @@
.or(both(containsString("CODE 19")).and(containsString("CONSTRAINT FAILED")));
}
- @SuppressWarnings({"Duplicates", "deprecation"})
+ @SuppressWarnings("Duplicates")
private void deleteInTransaction(A a, B b) {
mDb.beginTransaction();
try {
@@ -404,7 +402,7 @@
}
}
- @SuppressWarnings({"Duplicates", "deprecation"})
+ @SuppressWarnings("Duplicates")
private void deleteInTransaction(A a, C c) {
mDb.beginTransaction();
try {
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/IdentityDetectionTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/IdentityDetectionTest.java
index 4e665b2..0cab234 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/IdentityDetectionTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/IdentityDetectionTest.java
@@ -29,7 +29,7 @@
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -39,7 +39,7 @@
import java.io.File;
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
public class IdentityDetectionTest {
static final String TAG = "IdentityDetectionTest";
static final String DB_FILE_NAME = "identity_test_db";
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/InvalidationTrackerTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/InvalidationTrackerTest.java
index d49779a..977932a 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/InvalidationTrackerTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/InvalidationTrackerTest.java
@@ -44,7 +44,7 @@
import androidx.room.RoomDatabase;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Before;
@@ -64,7 +64,7 @@
import io.reactivex.Observable;
import io.reactivex.disposables.CompositeDisposable;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class InvalidationTrackerTest {
@Rule
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/LiveDataQueryTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/LiveDataQueryTest.java
index 1329938..3f9d5cb 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/LiveDataQueryTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/LiveDataQueryTest.java
@@ -45,6 +45,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Rule;
@@ -65,7 +66,7 @@
/**
* Tests invalidation tracking.
*/
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class LiveDataQueryTest extends TestDatabaseTest {
@Rule
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/MultiInstanceInvalidationTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/MultiInstanceInvalidationTest.java
index be78eb4..59d0809 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/MultiInstanceInvalidationTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/MultiInstanceInvalidationTest.java
@@ -314,7 +314,6 @@
}
- @SuppressWarnings("deprecation")
private long measure(boolean multiInstanceInvalidation, boolean bulk,
List<Customer> customers) {
final Context context = ApplicationProvider.getApplicationContext();
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/PojoWithRelationTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/PojoWithRelationTest.java
index fd303aa..b22d735 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/PojoWithRelationTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/PojoWithRelationTest.java
@@ -32,7 +32,7 @@
import androidx.room.integration.testapp.vo.UserIdAndPetNames;
import androidx.room.integration.testapp.vo.UserWithPetsAndToys;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -44,7 +44,7 @@
import java.util.List;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class PojoWithRelationTest extends TestDatabaseTest {
@Test
public void fetchAll() {
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/QueryTransactionTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/QueryTransactionTest.java
index 79539f2..f88066a 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/QueryTransactionTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/QueryTransactionTest.java
@@ -194,72 +194,36 @@
@Test
public void pagedList() {
- PagedList.Config config = new PagedList.Config.Builder()
- .setPageSize(1)
- .setInitialLoadSizeHint(3)
- .setPrefetchDistance(2)
- .setEnablePlaceholders(false)
- .build();
LiveData<PagedList<Entity1>> pagedList =
- new LivePagedListBuilder<>(mDao.pagedList(), config).build();
+ new LivePagedListBuilder<>(mDao.pagedList(), 10).build();
observeForever(pagedList);
drain();
- assertThat(sStartedTransactionCount.get(), is(1));
+ assertThat(sStartedTransactionCount.get(), is(mUseTransactionDao ? 0 : 0));
mDao.insert(new Entity1(1, "foo"));
drain();
//noinspection ConstantConditions
assertThat(pagedList.getValue().size(), is(1));
- assertTransactionCount(pagedList.getValue(), 3);
+ assertTransactionCount(pagedList.getValue(), mUseTransactionDao ? 2 : 1);
- mDao.insert(
- new Entity1(2, "bar"),
- new Entity1(3, "baz"),
- new Entity1(4, "bup"));
+ mDao.insert(new Entity1(2, "bar"));
drain();
- assertThat(pagedList.getValue().size(), is(3));
- assertTransactionCount(pagedList.getValue(), 5);
-
- // only loadRange is affected by transaction dao, since initial load requires transaction
- pagedList.getValue().loadAround(2);
- drain();
- assertThat(pagedList.getValue().size(), is(4));
- // note: we don't use assertTransactionCount here, since last item loaded separately
- assertThat(sStartedTransactionCount.get(), is(mUseTransactionDao ? 6 : 5));
+ assertThat(pagedList.getValue().size(), is(2));
+ assertTransactionCount(pagedList.getValue(), mUseTransactionDao ? 4 : 2);
}
@Test
- public void dataSourceRange() {
+ public void dataSource() {
mDao.insert(new Entity1(2, "bar"));
drain();
resetTransactionCount();
+ @SuppressWarnings("deprecation")
LimitOffsetDataSource<Entity1> dataSource =
(LimitOffsetDataSource<Entity1>) mDao.dataSource();
dataSource.loadRange(0, 10);
assertThat(sStartedTransactionCount.get(), is(mUseTransactionDao ? 1 : 0));
}
- @Test
- public void dataSourceInitial() {
- mDao.insert(new Entity1(2, "bar"));
- drain();
- resetTransactionCount();
- LimitOffsetDataSource<Entity1> dataSource =
- (LimitOffsetDataSource<Entity1>) mDao.dataSource();
- dataSource.loadInitial(
- new PositionalDataSource.LoadInitialParams(0, 30, 10, true),
- new PositionalDataSource.LoadInitialCallback<Entity1>() {
- @Override
- public void onResult(@NonNull List<Entity1> data, int position,
- int totalCount) {}
-
- @Override
- public void onResult(@NonNull List<Entity1> data, int position) {}
- });
- // always use a transaction, since we're loading count + initial data
- assertThat(sStartedTransactionCount.get(), is(1));
- }
-
private void assertTransactionCount(List<Entity1> allEntities, int expectedTransactionCount) {
assertThat(sStartedTransactionCount.get(), is(expectedTransactionCount));
assertThat(allEntities.isEmpty(), is(false));
@@ -398,9 +362,6 @@
void insert(Entity1 entity1);
@Insert
- void insert(Entity1... entities);
-
- @Insert
void insert(Child entity1);
}
@@ -484,7 +445,6 @@
}
@Database(version = 1, entities = {Entity1.class, Child.class}, exportSchema = false)
- @SuppressWarnings("deprecation")
abstract static class TransactionDb extends RoomDatabase {
abstract EntityDao dao();
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/RxJava2Test.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/RxJava2Test.java
index f7a0b47..8eeb0ad 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/RxJava2Test.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/RxJava2Test.java
@@ -530,7 +530,6 @@
});
}
- @SuppressWarnings("deprecation")
@Test
public void updateInTransaction_Flowable() throws InterruptedException {
// When subscribing to the emissions of the user
@@ -554,7 +553,6 @@
userTestSubscriber.assertValueCount(1);
}
- @SuppressWarnings("deprecation")
@Test
public void updateInTransaction_Observable() throws InterruptedException {
// When subscribing to the emissions of the user
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/RxJava2WithInstantTaskExecutorTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/RxJava2WithInstantTaskExecutorTest.java
index 34422834..97e6476 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/RxJava2WithInstantTaskExecutorTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/RxJava2WithInstantTaskExecutorTest.java
@@ -50,7 +50,6 @@
.build();
}
- @SuppressWarnings("deprecation")
@Test
public void testFlowableInTransaction() {
// When subscribing to the emissions of the user
diff --git a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/WriteAheadLoggingTest.java b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/WriteAheadLoggingTest.java
index 6d9f4b5..3d8e607 100644
--- a/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/WriteAheadLoggingTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/WriteAheadLoggingTest.java
@@ -169,7 +169,6 @@
stopObserver(usersList, observer);
}
- @SuppressWarnings("deprecation")
@Test
public void readInBackground() throws InterruptedException, ExecutionException {
final UserDao dao = mDatabase.getUserDao();
@@ -189,7 +188,6 @@
assertThat(dao.count(), is(0));
}
- @SuppressWarnings("deprecation")
@Test
@LargeTest
public void observeInvalidationInBackground() throws InterruptedException, ExecutionException {
diff --git a/room/ktx/api/2.1.0-alpha05.txt b/room/ktx/api/2.1.0-alpha05.txt
deleted file mode 100644
index f5dcd16..0000000
--- a/room/ktx/api/2.1.0-alpha05.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- public final class RoomDatabaseKt {
- ctor public RoomDatabaseKt();
- method public static suspend Object? acquireTransactionThread(java.util.concurrent.Executor, kotlinx.coroutines.Job controlJob, kotlin.coroutines.experimental.Continuation<? super kotlin.coroutines.ContinuationInterceptor> p);
- method public static suspend Object? createTransactionContext(androidx.room.RoomDatabase, kotlin.coroutines.experimental.Continuation<? super kotlin.coroutines.CoroutineContext> p);
- method public static suspend <R> Object? withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.experimental.Continuation<? super R>,?> block, kotlin.coroutines.experimental.Continuation<? super R> p);
- }
-
-}
-
diff --git a/room/ktx/api/current.txt b/room/ktx/api/current.txt
deleted file mode 100644
index f5dcd16..0000000
--- a/room/ktx/api/current.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- public final class RoomDatabaseKt {
- ctor public RoomDatabaseKt();
- method public static suspend Object? acquireTransactionThread(java.util.concurrent.Executor, kotlinx.coroutines.Job controlJob, kotlin.coroutines.experimental.Continuation<? super kotlin.coroutines.ContinuationInterceptor> p);
- method public static suspend Object? createTransactionContext(androidx.room.RoomDatabase, kotlin.coroutines.experimental.Continuation<? super kotlin.coroutines.CoroutineContext> p);
- method public static suspend <R> Object? withTransaction(androidx.room.RoomDatabase, kotlin.jvm.functions.Function2<? super kotlinx.coroutines.CoroutineScope,? super kotlin.coroutines.experimental.Continuation<? super R>,?> block, kotlin.coroutines.experimental.Continuation<? super R> p);
- }
-
-}
-
diff --git a/room/ktx/api/res-2.1.0-alpha05.txt b/room/ktx/api/res-2.1.0-alpha05.txt
deleted file mode 100644
index e69de29..0000000
--- a/room/ktx/api/res-2.1.0-alpha05.txt
+++ /dev/null
diff --git a/room/ktx/api/restricted_2.1.0-alpha05.txt b/room/ktx/api/restricted_2.1.0-alpha05.txt
deleted file mode 100644
index f31bf4d..0000000
--- a/room/ktx/api/restricted_2.1.0-alpha05.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX}) public final class CoroutinesRoom {
- method public static suspend <R> Object? execute(androidx.room.RoomDatabase p, java.util.concurrent.Callable<R> db, kotlin.coroutines.experimental.Continuation<? super R> callable);
- field public static final androidx.room.CoroutinesRoom.Companion! Companion;
- }
-
- public static final class CoroutinesRoom.Companion {
- method public suspend <R> Object? execute(androidx.room.RoomDatabase db, java.util.concurrent.Callable<R> callable, kotlin.coroutines.experimental.Continuation<? super R> p);
- }
-
-}
-
diff --git a/room/ktx/api/restricted_current.txt b/room/ktx/api/restricted_current.txt
deleted file mode 100644
index f31bf4d..0000000
--- a/room/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX}) public final class CoroutinesRoom {
- method public static suspend <R> Object? execute(androidx.room.RoomDatabase p, java.util.concurrent.Callable<R> db, kotlin.coroutines.experimental.Continuation<? super R> callable);
- field public static final androidx.room.CoroutinesRoom.Companion! Companion;
- }
-
- public static final class CoroutinesRoom.Companion {
- method public suspend <R> Object? execute(androidx.room.RoomDatabase db, java.util.concurrent.Callable<R> callable, kotlin.coroutines.experimental.Continuation<? super R> p);
- }
-
-}
-
diff --git a/room/ktx/build.gradle b/room/ktx/build.gradle
deleted file mode 100644
index cf774cd..0000000
--- a/room/ktx/build.gradle
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 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.
- */
-
-import static androidx.build.dependencies.DependenciesKt.*
-import androidx.build.LibraryGroups
-import androidx.build.LibraryVersions
-import androidx.build.SupportLibraryExtension
-
-plugins {
- id("SupportAndroidLibraryPlugin")
- id("org.jetbrains.kotlin.android")
-}
-
-dependencies {
- api(project(":room:room-common"))
- api(project(":room:room-runtime"))
- api(KOTLIN_STDLIB)
- api(KOTLIN_COROUTINES)
- testImplementation(JUNIT)
- testImplementation(MOCKITO_CORE)
-}
-
-supportLibrary {
- name = "Android Room Kotlin Extensions"
- publish = true
- mavenVersion = LibraryVersions.ROOM
- mavenGroup = LibraryGroups.ROOM
- inceptionYear = "2019"
- description = "Android Room Kotlin Extensions"
- url = SupportLibraryExtension.ARCHITECTURE_URL
-}
\ No newline at end of file
diff --git a/room/ktx/src/main/AndroidManifest.xml b/room/ktx/src/main/AndroidManifest.xml
deleted file mode 100644
index fe341fb..0000000
--- a/room/ktx/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<!--
- ~ Copyright (C) 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.
- -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="androidx.room.ktx">
-</manifest>
diff --git a/room/ktx/src/main/java/androidx/room/CoroutinesRoom.kt b/room/ktx/src/main/java/androidx/room/CoroutinesRoom.kt
deleted file mode 100644
index f4e3cc9..0000000
--- a/room/ktx/src/main/java/androidx/room/CoroutinesRoom.kt
+++ /dev/null
@@ -1,50 +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.room
-
-import androidx.annotation.RestrictTo
-import kotlinx.coroutines.asCoroutineDispatcher
-import kotlinx.coroutines.withContext
-import java.util.concurrent.Callable
-import kotlin.coroutines.coroutineContext
-
-/**
- * A helper class for supporting Kotlin Coroutines in Room.
- *
- * @hide
- */
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
-class CoroutinesRoom private constructor() {
-
- companion object {
-
- @JvmStatic
- suspend fun <R> execute(db: RoomDatabase, callable: Callable<R>): R {
- if (db.isOpen && db.inTransaction()) {
- return callable.call()
- }
-
- // Use the transaction dispatcher if we are on a transaction coroutine, otherwise
- // use the query executor as dispatcher.
- val context = coroutineContext[TransactionElement]?.transactionDispatcher
- ?: db.queryExecutor.asCoroutineDispatcher()
- return withContext(context) {
- callable.call()
- }
- }
- }
-}
\ No newline at end of file
diff --git a/room/ktx/src/main/java/androidx/room/RoomDatabase.kt b/room/ktx/src/main/java/androidx/room/RoomDatabase.kt
deleted file mode 100644
index 86f1fde..0000000
--- a/room/ktx/src/main/java/androidx/room/RoomDatabase.kt
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright 2019 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.room
-
-import androidx.annotation.RestrictTo
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.Job
-import kotlinx.coroutines.asContextElement
-import kotlinx.coroutines.coroutineScope
-import kotlinx.coroutines.runBlocking
-import kotlinx.coroutines.suspendCancellableCoroutine
-import kotlinx.coroutines.withContext
-import java.util.concurrent.Executor
-import java.util.concurrent.RejectedExecutionException
-import java.util.concurrent.atomic.AtomicInteger
-import kotlin.coroutines.ContinuationInterceptor
-import kotlin.coroutines.CoroutineContext
-import kotlin.coroutines.coroutineContext
-import kotlin.coroutines.resume
-
-/**
- * Calls the specified suspending [block] in a database transaction. The transaction will be
- * marked as successful unless an exception is thrown in the suspending [block] or the coroutine
- * is cancelled.
- *
- * Performing blocking database operations is not permitted in a coroutine scope other than the
- * one received by the suspending block. It is recommended that all [Dao] function invoked within
- * the [block] be suspending functions.
- *
- * The dispatcher used to execute the given [block] will utilize threads from Room's query executor.
- */
-suspend fun <R> RoomDatabase.withTransaction(block: suspend CoroutineScope.() -> R): R {
- // Use inherited transaction context if available, this allows nested suspending transactions.
- val transactionContext =
- coroutineContext[TransactionElement]?.transactionDispatcher ?: createTransactionContext()
- return withContext(transactionContext) {
- val transactionElement = coroutineContext[TransactionElement]!!
- transactionElement.acquire()
- try {
- @Suppress("DEPRECATION")
- beginTransaction()
- try {
- // Wrap suspending block in a new scope to wait for any child coroutine.
- val result = coroutineScope {
- block.invoke(this)
- }
- @Suppress("DEPRECATION")
- setTransactionSuccessful()
- return@withContext result
- } finally {
- @Suppress("DEPRECATION")
- endTransaction()
- }
- } finally {
- transactionElement.release()
- }
- }
-}
-
-/**
- * Creates a [CoroutineContext] for performing database operations within a coroutine transaction.
- *
- * The context is a combination of a dispatcher, a [TransactionElement] and a thread local element.
- *
- * * The dispatcher will dispatch coroutines to a single thread that is taken over from the Room
- * query executor. If the coroutine context is switched, suspending DAO functions will be able to
- * dispatch to the transaction thread.
- *
- * * The [TransactionElement] serves as an indicator for inherited context, meaning, if there is a
- * switch of context, suspending DAO methods will be able to use the indicator to dispatch the
- * database operation to the transaction thread.
- *
- * * The thread local element serves as a second indicator and marks threads that are used to
- * execute coroutines within the coroutine transaction, more specifically it allows us to identify
- * if a blocking DAO method is invoked within the transaction coroutine. Never assign meaning to
- * this value, for now all we care is if its present or not.
- */
-private suspend fun RoomDatabase.createTransactionContext(): CoroutineContext {
- val controlJob = Job()
- val dispatcher = queryExecutor.acquireTransactionThread(controlJob)
- val transactionElement = TransactionElement(controlJob, dispatcher)
- val threadLocalElement =
- suspendingTransactionId.asContextElement(System.identityHashCode(controlJob))
- return dispatcher + transactionElement + threadLocalElement
-}
-
-/**
- * Acquires a thread from the executor and returns a [ContinuationInterceptor] to dispatch
- * coroutines to the acquired thread. The [controlJob] is used to control the release of the
- * thread by cancelling the job.
- */
-private suspend fun Executor.acquireTransactionThread(controlJob: Job): ContinuationInterceptor =
- suspendCancellableCoroutine { continuation ->
- continuation.invokeOnCancellation {
- // We got cancelled while waiting to acquire a thread, we can't stop our attempt to
- // acquire a thread, but we can cancel the controlling job so once it gets acquired it
- // is quickly released.
- controlJob.cancel()
- }
- try {
- execute {
- runBlocking {
- // Thread acquired, resume coroutine.
- continuation.resume(coroutineContext[ContinuationInterceptor]!!)
- controlJob.join()
- }
- }
- } catch (ex: RejectedExecutionException) {
- // Couldn't acquire a thread, cancel coroutine.
- continuation.cancel(
- IllegalStateException(
- "Unable to acquire a thread to perform the database transaction.", ex)
- )
- }
- }
-
-/**
- * A [CoroutineContext.Element] that indicates there is an on-going database transaction.
- *
- * @hide
- */
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-internal class TransactionElement(
- private val transactionThreadControlJob: Job,
- internal val transactionDispatcher: ContinuationInterceptor
-) : CoroutineContext.Element {
-
- companion object Key : CoroutineContext.Key<TransactionElement>
-
- override val key: CoroutineContext.Key<TransactionElement>
- get() = TransactionElement
-
- /**
- * Number of transactions (including nested ones) started with this element.
- * Call [acquire] to increase the count and [release] to decrease it. If the count reaches zero
- * when [release] is invoked then the transaction job is cancelled and the transaction thread
- * is released.
- */
- private val referenceCount = AtomicInteger(0)
-
- fun acquire() {
- referenceCount.incrementAndGet()
- }
-
- fun release() {
- val count = referenceCount.decrementAndGet()
- if (count < 0) {
- throw IllegalStateException("Transaction was never started or was already released.")
- } else if (count == 0) {
- // Cancel the job that controls the transaction thread, causing it to be released.
- transactionThreadControlJob.cancel()
- }
- }
-}
\ No newline at end of file
diff --git a/room/migration/src/main/java/androidx/room/migration/bundle/BundleUtil.java b/room/migration/src/main/java/androidx/room/migration/bundle/BundleUtil.java
index 7d5a77a..013fc45 100644
--- a/room/migration/src/main/java/androidx/room/migration/bundle/BundleUtil.java
+++ b/room/migration/src/main/java/androidx/room/migration/bundle/BundleUtil.java
@@ -23,7 +23,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class BundleUtil {
/**
* Placeholder for table names in queries.
diff --git a/room/migration/src/main/java/androidx/room/migration/bundle/DatabaseBundle.java b/room/migration/src/main/java/androidx/room/migration/bundle/DatabaseBundle.java
index 2f23737..23b36f5 100644
--- a/room/migration/src/main/java/androidx/room/migration/bundle/DatabaseBundle.java
+++ b/room/migration/src/main/java/androidx/room/migration/bundle/DatabaseBundle.java
@@ -33,7 +33,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class DatabaseBundle implements SchemaEquality<DatabaseBundle> {
@SerializedName("version")
private int mVersion;
diff --git a/room/migration/src/main/java/androidx/room/migration/bundle/DatabaseViewBundle.java b/room/migration/src/main/java/androidx/room/migration/bundle/DatabaseViewBundle.java
index e6741f3..bc88b45 100644
--- a/room/migration/src/main/java/androidx/room/migration/bundle/DatabaseViewBundle.java
+++ b/room/migration/src/main/java/androidx/room/migration/bundle/DatabaseViewBundle.java
@@ -26,7 +26,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class DatabaseViewBundle implements SchemaEquality<DatabaseViewBundle> {
@SerializedName("viewName")
diff --git a/room/migration/src/main/java/androidx/room/migration/bundle/EntityBundle.java b/room/migration/src/main/java/androidx/room/migration/bundle/EntityBundle.java
index 04aa4f6..09034d9 100644
--- a/room/migration/src/main/java/androidx/room/migration/bundle/EntityBundle.java
+++ b/room/migration/src/main/java/androidx/room/migration/bundle/EntityBundle.java
@@ -36,7 +36,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class EntityBundle implements SchemaEquality<EntityBundle> {
static final String NEW_TABLE_PREFIX = "_new_";
diff --git a/room/migration/src/main/java/androidx/room/migration/bundle/FieldBundle.java b/room/migration/src/main/java/androidx/room/migration/bundle/FieldBundle.java
index cb7c03f..c6612f4 100644
--- a/room/migration/src/main/java/androidx/room/migration/bundle/FieldBundle.java
+++ b/room/migration/src/main/java/androidx/room/migration/bundle/FieldBundle.java
@@ -26,7 +26,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class FieldBundle implements SchemaEquality<FieldBundle> {
@SerializedName("fieldPath")
private String mFieldPath;
diff --git a/room/migration/src/main/java/androidx/room/migration/bundle/ForeignKeyBundle.java b/room/migration/src/main/java/androidx/room/migration/bundle/ForeignKeyBundle.java
index cb6f7b7..3d45900 100644
--- a/room/migration/src/main/java/androidx/room/migration/bundle/ForeignKeyBundle.java
+++ b/room/migration/src/main/java/androidx/room/migration/bundle/ForeignKeyBundle.java
@@ -27,7 +27,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class ForeignKeyBundle implements SchemaEquality<ForeignKeyBundle> {
@SerializedName("table")
private String mTable;
diff --git a/room/migration/src/main/java/androidx/room/migration/bundle/FtsEntityBundle.java b/room/migration/src/main/java/androidx/room/migration/bundle/FtsEntityBundle.java
index 8bf86e7..d1fadf7 100644
--- a/room/migration/src/main/java/androidx/room/migration/bundle/FtsEntityBundle.java
+++ b/room/migration/src/main/java/androidx/room/migration/bundle/FtsEntityBundle.java
@@ -35,7 +35,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class FtsEntityBundle extends EntityBundle {
private static final String [] SHADOW_TABLE_NAME_SUFFIXES = {
diff --git a/room/migration/src/main/java/androidx/room/migration/bundle/FtsOptionsBundle.java b/room/migration/src/main/java/androidx/room/migration/bundle/FtsOptionsBundle.java
index 1cc3736..05a68ae 100644
--- a/room/migration/src/main/java/androidx/room/migration/bundle/FtsOptionsBundle.java
+++ b/room/migration/src/main/java/androidx/room/migration/bundle/FtsOptionsBundle.java
@@ -30,7 +30,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class FtsOptionsBundle implements SchemaEquality<FtsOptionsBundle> {
@SerializedName("tokenizer")
diff --git a/room/migration/src/main/java/androidx/room/migration/bundle/IndexBundle.java b/room/migration/src/main/java/androidx/room/migration/bundle/IndexBundle.java
index 9a970d0..baf15ab 100644
--- a/room/migration/src/main/java/androidx/room/migration/bundle/IndexBundle.java
+++ b/room/migration/src/main/java/androidx/room/migration/bundle/IndexBundle.java
@@ -27,7 +27,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class IndexBundle implements SchemaEquality<IndexBundle> {
// should match Index.kt
public static final String DEFAULT_PREFIX = "index_";
@@ -63,7 +63,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public String create(String tableName) {
return BundleUtil.replaceTableName(mCreateSql, tableName);
}
diff --git a/room/migration/src/main/java/androidx/room/migration/bundle/PrimaryKeyBundle.java b/room/migration/src/main/java/androidx/room/migration/bundle/PrimaryKeyBundle.java
index 99955a7..a77da7d 100644
--- a/room/migration/src/main/java/androidx/room/migration/bundle/PrimaryKeyBundle.java
+++ b/room/migration/src/main/java/androidx/room/migration/bundle/PrimaryKeyBundle.java
@@ -27,7 +27,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class PrimaryKeyBundle implements SchemaEquality<PrimaryKeyBundle> {
@SerializedName("columnNames")
private List<String> mColumnNames;
diff --git a/room/migration/src/main/java/androidx/room/migration/bundle/SchemaBundle.java b/room/migration/src/main/java/androidx/room/migration/bundle/SchemaBundle.java
index beb2c5e..190eb0e 100644
--- a/room/migration/src/main/java/androidx/room/migration/bundle/SchemaBundle.java
+++ b/room/migration/src/main/java/androidx/room/migration/bundle/SchemaBundle.java
@@ -43,7 +43,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class SchemaBundle implements SchemaEquality<SchemaBundle> {
@SerializedName("formatVersion")
@@ -80,7 +80,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static SchemaBundle deserialize(InputStream fis)
throws UnsupportedEncodingException {
InputStreamReader is = new InputStreamReader(fis, CHARSET);
@@ -95,7 +95,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static void serialize(SchemaBundle bundle, File file) throws IOException {
FileOutputStream fos = new FileOutputStream(file, false);
OutputStreamWriter osw = new OutputStreamWriter(fos, CHARSET);
diff --git a/room/migration/src/main/java/androidx/room/migration/bundle/SchemaEquality.java b/room/migration/src/main/java/androidx/room/migration/bundle/SchemaEquality.java
index bd1106d3..d300fea 100644
--- a/room/migration/src/main/java/androidx/room/migration/bundle/SchemaEquality.java
+++ b/room/migration/src/main/java/androidx/room/migration/bundle/SchemaEquality.java
@@ -24,7 +24,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
interface SchemaEquality<T> {
boolean isSchemaEqual(T other);
}
diff --git a/room/runtime/api/2.0.0.txt b/room/runtime/api/2.0.0.txt
index f732791..de2b4c7 100644
--- a/room/runtime/api/2.0.0.txt
+++ b/room/runtime/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room {
public class DatabaseConfiguration {
diff --git a/room/runtime/api/2.1.0-alpha02.txt b/room/runtime/api/2.1.0-alpha02.txt
index 2465b8c..4efbc8e 100644
--- a/room/runtime/api/2.1.0-alpha02.txt
+++ b/room/runtime/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room {
public class DatabaseConfiguration {
diff --git a/room/runtime/api/2.1.0-alpha04.txt b/room/runtime/api/2.1.0-alpha04.txt
index d7796fa..4efbc8e 100644
--- a/room/runtime/api/2.1.0-alpha04.txt
+++ b/room/runtime/api/2.1.0-alpha04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room {
public class DatabaseConfiguration {
@@ -81,7 +81,7 @@
method public void onOpen(androidx.sqlite.db.SupportSQLiteDatabase);
}
- public enum RoomDatabase.JournalMode {
+ public static enum RoomDatabase.JournalMode {
enum_constant public static final androidx.room.RoomDatabase.JournalMode AUTOMATIC;
enum_constant public static final androidx.room.RoomDatabase.JournalMode TRUNCATE;
enum_constant @RequiresApi(android.os.Build.VERSION_CODES.JELLY_BEAN) public static final androidx.room.RoomDatabase.JournalMode WRITE_AHEAD_LOGGING;
diff --git a/room/runtime/api/2.1.0-alpha05.txt b/room/runtime/api/2.1.0-alpha05.txt
deleted file mode 100644
index 00d448a..0000000
--- a/room/runtime/api/2.1.0-alpha05.txt
+++ /dev/null
@@ -1,108 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- public class DatabaseConfiguration {
- method public boolean isMigrationRequired(int, int);
- method @Deprecated public boolean isMigrationRequiredFrom(int);
- field public final boolean allowDestructiveMigrationOnDowngrade;
- field public final boolean allowMainThreadQueries;
- field public final java.util.List<androidx.room.RoomDatabase.Callback>? callbacks;
- field public final android.content.Context context;
- field public final androidx.room.RoomDatabase.JournalMode! journalMode;
- field public final androidx.room.RoomDatabase.MigrationContainer migrationContainer;
- field public final boolean multiInstanceInvalidation;
- field public final String? name;
- field public final java.util.concurrent.Executor queryExecutor;
- field public final boolean requireMigration;
- field public final androidx.sqlite.db.SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory;
- }
-
- public class InvalidationTracker {
- method @WorkerThread public void addObserver(androidx.room.InvalidationTracker.Observer);
- method public void refreshVersionsAsync();
- method @WorkerThread public void removeObserver(androidx.room.InvalidationTracker.Observer);
- }
-
- public abstract static class InvalidationTracker.Observer {
- ctor protected InvalidationTracker.Observer(String, java.lang.String...!);
- ctor public InvalidationTracker.Observer(String[]);
- method public abstract void onInvalidated(java.util.Set<java.lang.String>);
- }
-
- public class Room {
- ctor @Deprecated public Room();
- method public static <T extends androidx.room.RoomDatabase> androidx.room.RoomDatabase.Builder<T> databaseBuilder(android.content.Context, Class<T>, String);
- method public static <T extends androidx.room.RoomDatabase> androidx.room.RoomDatabase.Builder<T> inMemoryDatabaseBuilder(android.content.Context, Class<T>);
- field public static final String MASTER_TABLE_NAME = "room_master_table";
- }
-
- public abstract class RoomDatabase {
- ctor public RoomDatabase();
- method @Deprecated public void beginTransaction();
- method @WorkerThread public abstract void clearAllTables();
- method public void close();
- method public androidx.sqlite.db.SupportSQLiteStatement! compileStatement(String);
- method protected abstract androidx.room.InvalidationTracker createInvalidationTracker();
- method protected abstract androidx.sqlite.db.SupportSQLiteOpenHelper createOpenHelper(androidx.room.DatabaseConfiguration!);
- method @Deprecated public void endTransaction();
- method public androidx.room.InvalidationTracker getInvalidationTracker();
- method public androidx.sqlite.db.SupportSQLiteOpenHelper getOpenHelper();
- method public java.util.concurrent.Executor getQueryExecutor();
- method public boolean inTransaction();
- method @CallSuper public void init(androidx.room.DatabaseConfiguration);
- method protected void internalInitInvalidationTracker(androidx.sqlite.db.SupportSQLiteDatabase);
- method public boolean isOpen();
- method public android.database.Cursor! query(String!, Object[]?);
- method public android.database.Cursor! query(androidx.sqlite.db.SupportSQLiteQuery!);
- method public void runInTransaction(Runnable);
- method public <V> V! runInTransaction(java.util.concurrent.Callable<V>);
- method @Deprecated public void setTransactionSuccessful();
- field @Deprecated protected java.util.List<androidx.room.RoomDatabase.Callback>? mCallbacks;
- field @Deprecated protected volatile androidx.sqlite.db.SupportSQLiteDatabase! mDatabase;
- }
-
- public static class RoomDatabase.Builder<T extends androidx.room.RoomDatabase> {
- method public androidx.room.RoomDatabase.Builder<T> addCallback(androidx.room.RoomDatabase.Callback);
- method public androidx.room.RoomDatabase.Builder<T> addMigrations(androidx.room.migration.Migration...);
- method public androidx.room.RoomDatabase.Builder<T> allowMainThreadQueries();
- method public T build();
- method public androidx.room.RoomDatabase.Builder<T> enableMultiInstanceInvalidation();
- method public androidx.room.RoomDatabase.Builder<T> fallbackToDestructiveMigration();
- method public androidx.room.RoomDatabase.Builder<T> fallbackToDestructiveMigrationFrom(int...!);
- method public androidx.room.RoomDatabase.Builder<T> fallbackToDestructiveMigrationOnDowngrade();
- method public androidx.room.RoomDatabase.Builder<T> openHelperFactory(androidx.sqlite.db.SupportSQLiteOpenHelper.Factory?);
- method public androidx.room.RoomDatabase.Builder<T> setJournalMode(androidx.room.RoomDatabase.JournalMode);
- method public androidx.room.RoomDatabase.Builder<T> setQueryExecutor(java.util.concurrent.Executor);
- }
-
- public abstract static class RoomDatabase.Callback {
- ctor public RoomDatabase.Callback();
- method public void onCreate(androidx.sqlite.db.SupportSQLiteDatabase);
- method public void onOpen(androidx.sqlite.db.SupportSQLiteDatabase);
- }
-
- public enum RoomDatabase.JournalMode {
- enum_constant public static final androidx.room.RoomDatabase.JournalMode AUTOMATIC;
- enum_constant public static final androidx.room.RoomDatabase.JournalMode TRUNCATE;
- enum_constant @RequiresApi(android.os.Build.VERSION_CODES.JELLY_BEAN) public static final androidx.room.RoomDatabase.JournalMode WRITE_AHEAD_LOGGING;
- }
-
- public static class RoomDatabase.MigrationContainer {
- ctor public RoomDatabase.MigrationContainer();
- method public void addMigrations(androidx.room.migration.Migration...);
- method public java.util.List<androidx.room.migration.Migration>? findMigrationPath(int, int);
- }
-
-}
-
-package androidx.room.migration {
-
- public abstract class Migration {
- ctor public Migration(int, int);
- method public abstract void migrate(androidx.sqlite.db.SupportSQLiteDatabase);
- field public final int endVersion;
- field public final int startVersion;
- }
-
-}
-
diff --git a/room/runtime/api/current.txt b/room/runtime/api/current.txt
index 00d448a..4efbc8e 100644
--- a/room/runtime/api/current.txt
+++ b/room/runtime/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room {
public class DatabaseConfiguration {
@@ -38,13 +38,13 @@
public abstract class RoomDatabase {
ctor public RoomDatabase();
- method @Deprecated public void beginTransaction();
+ method public void beginTransaction();
method @WorkerThread public abstract void clearAllTables();
method public void close();
method public androidx.sqlite.db.SupportSQLiteStatement! compileStatement(String);
method protected abstract androidx.room.InvalidationTracker createInvalidationTracker();
method protected abstract androidx.sqlite.db.SupportSQLiteOpenHelper createOpenHelper(androidx.room.DatabaseConfiguration!);
- method @Deprecated public void endTransaction();
+ method public void endTransaction();
method public androidx.room.InvalidationTracker getInvalidationTracker();
method public androidx.sqlite.db.SupportSQLiteOpenHelper getOpenHelper();
method public java.util.concurrent.Executor getQueryExecutor();
@@ -56,7 +56,7 @@
method public android.database.Cursor! query(androidx.sqlite.db.SupportSQLiteQuery!);
method public void runInTransaction(Runnable);
method public <V> V! runInTransaction(java.util.concurrent.Callable<V>);
- method @Deprecated public void setTransactionSuccessful();
+ method public void setTransactionSuccessful();
field @Deprecated protected java.util.List<androidx.room.RoomDatabase.Callback>? mCallbacks;
field @Deprecated protected volatile androidx.sqlite.db.SupportSQLiteDatabase! mDatabase;
}
@@ -81,7 +81,7 @@
method public void onOpen(androidx.sqlite.db.SupportSQLiteDatabase);
}
- public enum RoomDatabase.JournalMode {
+ public static enum RoomDatabase.JournalMode {
enum_constant public static final androidx.room.RoomDatabase.JournalMode AUTOMATIC;
enum_constant public static final androidx.room.RoomDatabase.JournalMode TRUNCATE;
enum_constant @RequiresApi(android.os.Build.VERSION_CODES.JELLY_BEAN) public static final androidx.room.RoomDatabase.JournalMode WRITE_AHEAD_LOGGING;
diff --git a/room/runtime/api/res-2.1.0-alpha05.txt b/room/runtime/api/res-2.1.0-alpha05.txt
deleted file mode 100644
index e69de29..0000000
--- a/room/runtime/api/res-2.1.0-alpha05.txt
+++ /dev/null
diff --git a/room/runtime/api/restricted_2.0.0.txt b/room/runtime/api/restricted_2.0.0.txt
deleted file mode 100644
index 9738390..0000000
--- a/room/runtime/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1,162 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- public class DatabaseConfiguration {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public DatabaseConfiguration(android.content.Context, String?, androidx.sqlite.db.SupportSQLiteOpenHelper.Factory, androidx.room.RoomDatabase.MigrationContainer, java.util.List<androidx.room.RoomDatabase.Callback>?, boolean, androidx.room.RoomDatabase.JournalMode!, java.util.concurrent.Executor, boolean, java.util.Set<java.lang.Integer>?);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class EntityDeletionOrUpdateAdapter<T> extends androidx.room.SharedSQLiteStatement {
- ctor public EntityDeletionOrUpdateAdapter(androidx.room.RoomDatabase!);
- method protected abstract void bind(androidx.sqlite.db.SupportSQLiteStatement!, T!);
- method public final int handle(T!);
- method public final int handleMultiple(Iterable<T>!);
- method public final int handleMultiple(T[]!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class EntityInsertionAdapter<T> extends androidx.room.SharedSQLiteStatement {
- ctor public EntityInsertionAdapter(androidx.room.RoomDatabase!);
- method protected abstract void bind(androidx.sqlite.db.SupportSQLiteStatement!, T!);
- method public final void insert(T!);
- method public final void insert(T[]!);
- method public final void insert(Iterable<T>!);
- method public final long insertAndReturnId(T!);
- method public final long[]! insertAndReturnIdsArray(java.util.Collection<T>!);
- method public final long[]! insertAndReturnIdsArray(T[]!);
- method public final Long[]! insertAndReturnIdsArrayBox(java.util.Collection<T>!);
- method public final Long[]! insertAndReturnIdsArrayBox(T[]!);
- method public final java.util.List<java.lang.Long>! insertAndReturnIdsList(T[]!);
- method public final java.util.List<java.lang.Long>! insertAndReturnIdsList(java.util.Collection<T>!);
- }
-
- public class InvalidationTracker {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public InvalidationTracker(androidx.room.RoomDatabase!, java.lang.String...!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void addWeakObserver(androidx.room.InvalidationTracker.Observer!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @WorkerThread public void refreshVersionsSync();
- }
-
- public abstract class RoomDatabase {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void assertNotMainThread();
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final int MAX_BIND_PARAMETER_CNT = 999; // 0x3e7
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class RoomOpenHelper {
- ctor public RoomOpenHelper(androidx.room.DatabaseConfiguration, androidx.room.RoomOpenHelper.Delegate, String, String);
- ctor public RoomOpenHelper(androidx.room.DatabaseConfiguration, androidx.room.RoomOpenHelper.Delegate, String);
- method public void onConfigure(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onCreate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onDowngrade(androidx.sqlite.db.SupportSQLiteDatabase!, int, int);
- method public void onOpen(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onUpgrade(androidx.sqlite.db.SupportSQLiteDatabase!, int, int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract static class RoomOpenHelper.Delegate {
- ctor public RoomOpenHelper.Delegate(int);
- method protected abstract void createAllTables(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected abstract void dropAllTables(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected abstract void onCreate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected abstract void onOpen(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected abstract void validateMigration(androidx.sqlite.db.SupportSQLiteDatabase!);
- field public final int version;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class RoomSQLiteQuery {
- method public static androidx.room.RoomSQLiteQuery! acquire(String!, int);
- method public void bindBlob(int, byte[]!);
- method public void bindDouble(int, double);
- method public void bindLong(int, long);
- method public void bindNull(int);
- method public void bindString(int, String!);
- method public void bindTo(androidx.sqlite.db.SupportSQLiteProgram!);
- method public void clearBindings();
- method public void close();
- method public void copyArgumentsFrom(androidx.room.RoomSQLiteQuery!);
- method public static androidx.room.RoomSQLiteQuery! copyFrom(androidx.sqlite.db.SupportSQLiteQuery!);
- method public int getArgCount();
- method public String! getSql();
- method public void release();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class SharedSQLiteStatement {
- ctor public SharedSQLiteStatement(androidx.room.RoomDatabase!);
- method public androidx.sqlite.db.SupportSQLiteStatement! acquire();
- method protected void assertNotMainThread();
- method protected abstract String! createQuery();
- method public void release(androidx.sqlite.db.SupportSQLiteStatement!);
- }
-
-}
-
-package androidx.room.paging {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class LimitOffsetDataSource<T> {
- ctor protected LimitOffsetDataSource(androidx.room.RoomDatabase!, androidx.sqlite.db.SupportSQLiteQuery!, boolean, java.lang.String...!);
- ctor protected LimitOffsetDataSource(androidx.room.RoomDatabase!, androidx.room.RoomSQLiteQuery!, boolean, java.lang.String...!);
- method protected abstract java.util.List<T>! convertRows(android.database.Cursor!);
- method public boolean isInvalid();
- method public void loadInitial(androidx.paging.PositionalDataSource.LoadInitialParams, androidx.paging.PositionalDataSource.LoadInitialCallback<T>);
- method public void loadRange(androidx.paging.PositionalDataSource.LoadRangeParams, androidx.paging.PositionalDataSource.LoadRangeCallback<T>);
- }
-
-}
-
-package androidx.room.util {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class StringUtil {
- method public static void appendPlaceholders(StringBuilder!, int);
- method public static String? joinIntoString(java.util.List<java.lang.Integer>?);
- method public static StringBuilder! newStringBuilder();
- method public static java.util.List<java.lang.Integer>? splitToIntList(String?);
- field public static final String[]! EMPTY_STRING_ARRAY;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class TableInfo {
- ctor public TableInfo(String!, java.util.Map<java.lang.String,androidx.room.util.TableInfo.Column>!, java.util.Set<androidx.room.util.TableInfo.ForeignKey>!, java.util.Set<androidx.room.util.TableInfo.Index>!);
- ctor public TableInfo(String!, java.util.Map<java.lang.String,androidx.room.util.TableInfo.Column>!, java.util.Set<androidx.room.util.TableInfo.ForeignKey>!);
- method public boolean equals(Object?);
- method public int hashCode();
- method public static androidx.room.util.TableInfo! read(androidx.sqlite.db.SupportSQLiteDatabase!, String!);
- method public String toString();
- field public final java.util.Map<java.lang.String,androidx.room.util.TableInfo.Column>! columns;
- field public final java.util.Set<androidx.room.util.TableInfo.ForeignKey>! foreignKeys;
- field public final java.util.Set<androidx.room.util.TableInfo.Index>? indices;
- field public final String! name;
- }
-
- public static class TableInfo.Column {
- ctor public TableInfo.Column(String!, String!, boolean, int);
- method public boolean equals(Object?);
- method public int hashCode();
- method public boolean isPrimaryKey();
- method public String toString();
- field public final int affinity;
- field public final String! name;
- field public final boolean notNull;
- field public final int primaryKeyPosition;
- field public final String! type;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class TableInfo.ForeignKey {
- ctor public TableInfo.ForeignKey(String, String, String, java.util.List<java.lang.String>, java.util.List<java.lang.String>);
- method public boolean equals(Object?);
- method public int hashCode();
- method public String toString();
- field public final java.util.List<java.lang.String> columnNames;
- field public final String onDelete;
- field public final String onUpdate;
- field public final java.util.List<java.lang.String> referenceColumnNames;
- field public final String referenceTable;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class TableInfo.Index {
- ctor public TableInfo.Index(String!, boolean, java.util.List<java.lang.String>!);
- method public boolean equals(Object?);
- method public int hashCode();
- method public String toString();
- field public static final String DEFAULT_PREFIX = "index_";
- field public final java.util.List<java.lang.String>! columns;
- field public final String! name;
- field public final boolean unique;
- }
-
-}
-
diff --git a/room/runtime/api/restricted_2.1.0-alpha05.ignore b/room/runtime/api/restricted_2.1.0-alpha05.ignore
deleted file mode 100644
index 83c78c1..0000000
--- a/room/runtime/api/restricted_2.1.0-alpha05.ignore
+++ /dev/null
@@ -1,5 +0,0 @@
-// Baseline format: 1.0
-RemovedMethod: androidx.room.DatabaseConfiguration#DatabaseConfiguration(android.content.Context, String, androidx.sqlite.db.SupportSQLiteOpenHelper.Factory, androidx.room.RoomDatabase.MigrationContainer, java.util.List<androidx.room.RoomDatabase.Callback>, boolean, androidx.room.RoomDatabase.JournalMode, java.util.concurrent.Executor, boolean, java.util.Set<java.lang.Integer>):
- Removed constructor androidx.room.DatabaseConfiguration(android.content.Context,String,androidx.sqlite.db.SupportSQLiteOpenHelper.Factory,androidx.room.RoomDatabase.MigrationContainer,java.util.List<androidx.room.RoomDatabase.Callback>,boolean,androidx.room.RoomDatabase.JournalMode,java.util.concurrent.Executor,boolean,java.util.Set<java.lang.Integer>)
-
-
diff --git a/room/runtime/api/restricted_2.1.0-alpha05.txt b/room/runtime/api/restricted_2.1.0-alpha05.txt
deleted file mode 100644
index 10b8084..0000000
--- a/room/runtime/api/restricted_2.1.0-alpha05.txt
+++ /dev/null
@@ -1,183 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- public class DatabaseConfiguration {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public DatabaseConfiguration(android.content.Context, String?, androidx.sqlite.db.SupportSQLiteOpenHelper.Factory, androidx.room.RoomDatabase.MigrationContainer, java.util.List<androidx.room.RoomDatabase.Callback>?, boolean, androidx.room.RoomDatabase.JournalMode!, java.util.concurrent.Executor, boolean, boolean, boolean, java.util.Set<java.lang.Integer>?);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class EntityDeletionOrUpdateAdapter<T> extends androidx.room.SharedSQLiteStatement {
- ctor public EntityDeletionOrUpdateAdapter(androidx.room.RoomDatabase!);
- method protected abstract void bind(androidx.sqlite.db.SupportSQLiteStatement!, T!);
- method public final int handle(T!);
- method public final int handleMultiple(Iterable<T>!);
- method public final int handleMultiple(T[]!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class EntityInsertionAdapter<T> extends androidx.room.SharedSQLiteStatement {
- ctor public EntityInsertionAdapter(androidx.room.RoomDatabase!);
- method protected abstract void bind(androidx.sqlite.db.SupportSQLiteStatement!, T!);
- method public final void insert(T!);
- method public final void insert(T[]!);
- method public final void insert(Iterable<T>!);
- method public final long insertAndReturnId(T!);
- method public final long[]! insertAndReturnIdsArray(java.util.Collection<T>!);
- method public final long[]! insertAndReturnIdsArray(T[]!);
- method public final Long[]! insertAndReturnIdsArrayBox(java.util.Collection<T>!);
- method public final Long[]! insertAndReturnIdsArrayBox(T[]!);
- method public final java.util.List<java.lang.Long>! insertAndReturnIdsList(T[]!);
- method public final java.util.List<java.lang.Long>! insertAndReturnIdsList(java.util.Collection<T>!);
- }
-
- public class InvalidationTracker {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public InvalidationTracker(androidx.room.RoomDatabase!, java.lang.String...!);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public InvalidationTracker(androidx.room.RoomDatabase!, java.util.Map<java.lang.String,java.lang.String>!, java.util.Map<java.lang.String,java.util.Set<java.lang.String>>!, java.lang.String...!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void addWeakObserver(androidx.room.InvalidationTracker.Observer!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public <T> androidx.lifecycle.LiveData<T>! createLiveData(String[]!, java.util.concurrent.Callable<T>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @WorkerThread public void refreshVersionsSync();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MultiInstanceInvalidationService extends android.app.Service {
- ctor public MultiInstanceInvalidationService();
- method public android.os.IBinder? onBind(android.content.Intent!);
- }
-
- public abstract class RoomDatabase {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void assertNotMainThread();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void assertNotSuspendingTransaction();
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int MAX_BIND_PARAMETER_CNT = 999; // 0x3e7
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class RoomOpenHelper extends androidx.sqlite.db.SupportSQLiteOpenHelper.Callback {
- ctor public RoomOpenHelper(androidx.room.DatabaseConfiguration, androidx.room.RoomOpenHelper.Delegate, String, String);
- ctor public RoomOpenHelper(androidx.room.DatabaseConfiguration, androidx.room.RoomOpenHelper.Delegate, String);
- method public void onCreate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onUpgrade(androidx.sqlite.db.SupportSQLiteDatabase!, int, int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract static class RoomOpenHelper.Delegate {
- ctor public RoomOpenHelper.Delegate(int);
- method protected abstract void createAllTables(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected abstract void dropAllTables(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected abstract void onCreate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected abstract void onOpen(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected void onPostMigrate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected void onPreMigrate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected abstract void validateMigration(androidx.sqlite.db.SupportSQLiteDatabase!);
- field public final int version;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class RoomSQLiteQuery implements androidx.sqlite.db.SupportSQLiteProgram androidx.sqlite.db.SupportSQLiteQuery {
- method public static androidx.room.RoomSQLiteQuery! acquire(String!, int);
- method public void bindBlob(int, byte[]!);
- method public void bindDouble(int, double);
- method public void bindLong(int, long);
- method public void bindNull(int);
- method public void bindString(int, String!);
- method public void bindTo(androidx.sqlite.db.SupportSQLiteProgram!);
- method public void clearBindings();
- method public void close();
- method public void copyArgumentsFrom(androidx.room.RoomSQLiteQuery!);
- method public static androidx.room.RoomSQLiteQuery! copyFrom(androidx.sqlite.db.SupportSQLiteQuery!);
- method public int getArgCount();
- method public String! getSql();
- method public void release();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class SharedSQLiteStatement {
- ctor public SharedSQLiteStatement(androidx.room.RoomDatabase!);
- method public androidx.sqlite.db.SupportSQLiteStatement! acquire();
- method protected void assertNotMainThread();
- method protected abstract String! createQuery();
- method public void release(androidx.sqlite.db.SupportSQLiteStatement!);
- }
-
-}
-
-package androidx.room.paging {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class LimitOffsetDataSource<T> extends androidx.paging.PositionalDataSource<T> {
- ctor protected LimitOffsetDataSource(androidx.room.RoomDatabase!, androidx.sqlite.db.SupportSQLiteQuery!, boolean, java.lang.String...!);
- ctor protected LimitOffsetDataSource(androidx.room.RoomDatabase!, androidx.room.RoomSQLiteQuery!, boolean, java.lang.String...!);
- method protected abstract java.util.List<T>! convertRows(android.database.Cursor!);
- method public void loadInitial(androidx.paging.PositionalDataSource.LoadInitialParams, androidx.paging.PositionalDataSource.LoadInitialCallback<T>);
- method public void loadRange(androidx.paging.PositionalDataSource.LoadRangeParams, androidx.paging.PositionalDataSource.LoadRangeCallback<T>);
- }
-
-}
-
-package androidx.room.util {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class CursorUtil {
- method public static android.database.Cursor copyAndClose(android.database.Cursor);
- method public static int getColumnIndex(android.database.Cursor, String);
- method public static int getColumnIndexOrThrow(android.database.Cursor, String);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DBUtil {
- method public static void dropFtsSyncTriggers(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public static android.database.Cursor query(androidx.room.RoomDatabase!, androidx.sqlite.db.SupportSQLiteQuery!, boolean);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class FtsTableInfo {
- ctor public FtsTableInfo(String!, java.util.Set<java.lang.String>!, java.util.Set<java.lang.String>!);
- ctor public FtsTableInfo(String!, java.util.Set<java.lang.String>!, String!);
- method public static androidx.room.util.FtsTableInfo! read(androidx.sqlite.db.SupportSQLiteDatabase!, String!);
- field public final java.util.Set<java.lang.String>! columns;
- field public final String! name;
- field public final java.util.Set<java.lang.String>! options;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class StringUtil {
- method public static void appendPlaceholders(StringBuilder!, int);
- method public static String? joinIntoString(java.util.List<java.lang.Integer>?);
- method public static StringBuilder! newStringBuilder();
- method public static java.util.List<java.lang.Integer>? splitToIntList(String?);
- field public static final String[]! EMPTY_STRING_ARRAY;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TableInfo {
- ctor public TableInfo(String!, java.util.Map<java.lang.String,androidx.room.util.TableInfo.Column>!, java.util.Set<androidx.room.util.TableInfo.ForeignKey>!, java.util.Set<androidx.room.util.TableInfo.Index>!);
- ctor public TableInfo(String!, java.util.Map<java.lang.String,androidx.room.util.TableInfo.Column>!, java.util.Set<androidx.room.util.TableInfo.ForeignKey>!);
- method public static androidx.room.util.TableInfo! read(androidx.sqlite.db.SupportSQLiteDatabase!, String!);
- field public final java.util.Map<java.lang.String,androidx.room.util.TableInfo.Column>! columns;
- field public final java.util.Set<androidx.room.util.TableInfo.ForeignKey>! foreignKeys;
- field public final java.util.Set<androidx.room.util.TableInfo.Index>? indices;
- field public final String! name;
- }
-
- public static class TableInfo.Column {
- ctor public TableInfo.Column(String!, String!, boolean, int);
- method public boolean isPrimaryKey();
- field public final int affinity;
- field public final String! name;
- field public final boolean notNull;
- field public final int primaryKeyPosition;
- field public final String! type;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class TableInfo.ForeignKey {
- ctor public TableInfo.ForeignKey(String, String, String, java.util.List<java.lang.String>, java.util.List<java.lang.String>);
- field public final java.util.List<java.lang.String> columnNames;
- field public final String onDelete;
- field public final String onUpdate;
- field public final java.util.List<java.lang.String> referenceColumnNames;
- field public final String referenceTable;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class TableInfo.Index {
- ctor public TableInfo.Index(String!, boolean, java.util.List<java.lang.String>!);
- field public static final String DEFAULT_PREFIX = "index_";
- field public final java.util.List<java.lang.String>! columns;
- field public final String! name;
- field public final boolean unique;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ViewInfo {
- ctor public ViewInfo(String!, String!);
- method public static androidx.room.util.ViewInfo! read(androidx.sqlite.db.SupportSQLiteDatabase!, String!);
- field public final String! name;
- field public final String! sql;
- }
-
-}
-
diff --git a/room/runtime/api/restricted_current.txt b/room/runtime/api/restricted_current.txt
deleted file mode 100644
index 10b8084..0000000
--- a/room/runtime/api/restricted_current.txt
+++ /dev/null
@@ -1,183 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- public class DatabaseConfiguration {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public DatabaseConfiguration(android.content.Context, String?, androidx.sqlite.db.SupportSQLiteOpenHelper.Factory, androidx.room.RoomDatabase.MigrationContainer, java.util.List<androidx.room.RoomDatabase.Callback>?, boolean, androidx.room.RoomDatabase.JournalMode!, java.util.concurrent.Executor, boolean, boolean, boolean, java.util.Set<java.lang.Integer>?);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class EntityDeletionOrUpdateAdapter<T> extends androidx.room.SharedSQLiteStatement {
- ctor public EntityDeletionOrUpdateAdapter(androidx.room.RoomDatabase!);
- method protected abstract void bind(androidx.sqlite.db.SupportSQLiteStatement!, T!);
- method public final int handle(T!);
- method public final int handleMultiple(Iterable<T>!);
- method public final int handleMultiple(T[]!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class EntityInsertionAdapter<T> extends androidx.room.SharedSQLiteStatement {
- ctor public EntityInsertionAdapter(androidx.room.RoomDatabase!);
- method protected abstract void bind(androidx.sqlite.db.SupportSQLiteStatement!, T!);
- method public final void insert(T!);
- method public final void insert(T[]!);
- method public final void insert(Iterable<T>!);
- method public final long insertAndReturnId(T!);
- method public final long[]! insertAndReturnIdsArray(java.util.Collection<T>!);
- method public final long[]! insertAndReturnIdsArray(T[]!);
- method public final Long[]! insertAndReturnIdsArrayBox(java.util.Collection<T>!);
- method public final Long[]! insertAndReturnIdsArrayBox(T[]!);
- method public final java.util.List<java.lang.Long>! insertAndReturnIdsList(T[]!);
- method public final java.util.List<java.lang.Long>! insertAndReturnIdsList(java.util.Collection<T>!);
- }
-
- public class InvalidationTracker {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public InvalidationTracker(androidx.room.RoomDatabase!, java.lang.String...!);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public InvalidationTracker(androidx.room.RoomDatabase!, java.util.Map<java.lang.String,java.lang.String>!, java.util.Map<java.lang.String,java.util.Set<java.lang.String>>!, java.lang.String...!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void addWeakObserver(androidx.room.InvalidationTracker.Observer!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public <T> androidx.lifecycle.LiveData<T>! createLiveData(String[]!, java.util.concurrent.Callable<T>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @WorkerThread public void refreshVersionsSync();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class MultiInstanceInvalidationService extends android.app.Service {
- ctor public MultiInstanceInvalidationService();
- method public android.os.IBinder? onBind(android.content.Intent!);
- }
-
- public abstract class RoomDatabase {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void assertNotMainThread();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void assertNotSuspendingTransaction();
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final int MAX_BIND_PARAMETER_CNT = 999; // 0x3e7
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class RoomOpenHelper extends androidx.sqlite.db.SupportSQLiteOpenHelper.Callback {
- ctor public RoomOpenHelper(androidx.room.DatabaseConfiguration, androidx.room.RoomOpenHelper.Delegate, String, String);
- ctor public RoomOpenHelper(androidx.room.DatabaseConfiguration, androidx.room.RoomOpenHelper.Delegate, String);
- method public void onCreate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void onUpgrade(androidx.sqlite.db.SupportSQLiteDatabase!, int, int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract static class RoomOpenHelper.Delegate {
- ctor public RoomOpenHelper.Delegate(int);
- method protected abstract void createAllTables(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected abstract void dropAllTables(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected abstract void onCreate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected abstract void onOpen(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected void onPostMigrate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected void onPreMigrate(androidx.sqlite.db.SupportSQLiteDatabase!);
- method protected abstract void validateMigration(androidx.sqlite.db.SupportSQLiteDatabase!);
- field public final int version;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class RoomSQLiteQuery implements androidx.sqlite.db.SupportSQLiteProgram androidx.sqlite.db.SupportSQLiteQuery {
- method public static androidx.room.RoomSQLiteQuery! acquire(String!, int);
- method public void bindBlob(int, byte[]!);
- method public void bindDouble(int, double);
- method public void bindLong(int, long);
- method public void bindNull(int);
- method public void bindString(int, String!);
- method public void bindTo(androidx.sqlite.db.SupportSQLiteProgram!);
- method public void clearBindings();
- method public void close();
- method public void copyArgumentsFrom(androidx.room.RoomSQLiteQuery!);
- method public static androidx.room.RoomSQLiteQuery! copyFrom(androidx.sqlite.db.SupportSQLiteQuery!);
- method public int getArgCount();
- method public String! getSql();
- method public void release();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class SharedSQLiteStatement {
- ctor public SharedSQLiteStatement(androidx.room.RoomDatabase!);
- method public androidx.sqlite.db.SupportSQLiteStatement! acquire();
- method protected void assertNotMainThread();
- method protected abstract String! createQuery();
- method public void release(androidx.sqlite.db.SupportSQLiteStatement!);
- }
-
-}
-
-package androidx.room.paging {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class LimitOffsetDataSource<T> extends androidx.paging.PositionalDataSource<T> {
- ctor protected LimitOffsetDataSource(androidx.room.RoomDatabase!, androidx.sqlite.db.SupportSQLiteQuery!, boolean, java.lang.String...!);
- ctor protected LimitOffsetDataSource(androidx.room.RoomDatabase!, androidx.room.RoomSQLiteQuery!, boolean, java.lang.String...!);
- method protected abstract java.util.List<T>! convertRows(android.database.Cursor!);
- method public void loadInitial(androidx.paging.PositionalDataSource.LoadInitialParams, androidx.paging.PositionalDataSource.LoadInitialCallback<T>);
- method public void loadRange(androidx.paging.PositionalDataSource.LoadRangeParams, androidx.paging.PositionalDataSource.LoadRangeCallback<T>);
- }
-
-}
-
-package androidx.room.util {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class CursorUtil {
- method public static android.database.Cursor copyAndClose(android.database.Cursor);
- method public static int getColumnIndex(android.database.Cursor, String);
- method public static int getColumnIndexOrThrow(android.database.Cursor, String);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class DBUtil {
- method public static void dropFtsSyncTriggers(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public static android.database.Cursor query(androidx.room.RoomDatabase!, androidx.sqlite.db.SupportSQLiteQuery!, boolean);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class FtsTableInfo {
- ctor public FtsTableInfo(String!, java.util.Set<java.lang.String>!, java.util.Set<java.lang.String>!);
- ctor public FtsTableInfo(String!, java.util.Set<java.lang.String>!, String!);
- method public static androidx.room.util.FtsTableInfo! read(androidx.sqlite.db.SupportSQLiteDatabase!, String!);
- field public final java.util.Set<java.lang.String>! columns;
- field public final String! name;
- field public final java.util.Set<java.lang.String>! options;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class StringUtil {
- method public static void appendPlaceholders(StringBuilder!, int);
- method public static String? joinIntoString(java.util.List<java.lang.Integer>?);
- method public static StringBuilder! newStringBuilder();
- method public static java.util.List<java.lang.Integer>? splitToIntList(String?);
- field public static final String[]! EMPTY_STRING_ARRAY;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TableInfo {
- ctor public TableInfo(String!, java.util.Map<java.lang.String,androidx.room.util.TableInfo.Column>!, java.util.Set<androidx.room.util.TableInfo.ForeignKey>!, java.util.Set<androidx.room.util.TableInfo.Index>!);
- ctor public TableInfo(String!, java.util.Map<java.lang.String,androidx.room.util.TableInfo.Column>!, java.util.Set<androidx.room.util.TableInfo.ForeignKey>!);
- method public static androidx.room.util.TableInfo! read(androidx.sqlite.db.SupportSQLiteDatabase!, String!);
- field public final java.util.Map<java.lang.String,androidx.room.util.TableInfo.Column>! columns;
- field public final java.util.Set<androidx.room.util.TableInfo.ForeignKey>! foreignKeys;
- field public final java.util.Set<androidx.room.util.TableInfo.Index>? indices;
- field public final String! name;
- }
-
- public static class TableInfo.Column {
- ctor public TableInfo.Column(String!, String!, boolean, int);
- method public boolean isPrimaryKey();
- field public final int affinity;
- field public final String! name;
- field public final boolean notNull;
- field public final int primaryKeyPosition;
- field public final String! type;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class TableInfo.ForeignKey {
- ctor public TableInfo.ForeignKey(String, String, String, java.util.List<java.lang.String>, java.util.List<java.lang.String>);
- field public final java.util.List<java.lang.String> columnNames;
- field public final String onDelete;
- field public final String onUpdate;
- field public final java.util.List<java.lang.String> referenceColumnNames;
- field public final String referenceTable;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class TableInfo.Index {
- ctor public TableInfo.Index(String!, boolean, java.util.List<java.lang.String>!);
- field public static final String DEFAULT_PREFIX = "index_";
- field public final java.util.List<java.lang.String>! columns;
- field public final String! name;
- field public final boolean unique;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ViewInfo {
- ctor public ViewInfo(String!, String!);
- method public static androidx.room.util.ViewInfo! read(androidx.sqlite.db.SupportSQLiteDatabase!, String!);
- field public final String! name;
- field public final String! sql;
- }
-
-}
-
diff --git a/room/runtime/build.gradle b/room/runtime/build.gradle
index c7e7958..35b6ace 100644
--- a/room/runtime/build.gradle
+++ b/room/runtime/build.gradle
@@ -32,11 +32,10 @@
dependencies {
api(project(":room:room-common"))
- api(ANDROIDX_SQLITE_FRAMEWORK)
- api(ANDROIDX_SQLITE)
+ api(project(":sqlite:sqlite-framework"))
+ api(project(":sqlite:sqlite"))
implementation(ARCH_CORE_RUNTIME)
implementation(ANDROIDX_CORE)
- implementation(ANDROIDX_COLLECTION)
compileOnly(ARCH_PAGING_COMMON)
compileOnly(ARCH_LIFECYCLE_LIVEDATA_CORE)
implementation(ANDROIDX_COLLECTION)
@@ -61,8 +60,8 @@
def name = variant.name
def suffix = name.capitalize()
project.tasks.create(name: "jar${suffix}", type: Jar){
- dependsOn variant.javaCompileProvider.get()
- from variant.javaCompileProvider.get().destinationDir
+ dependsOn variant.javaCompile
+ from variant.javaCompile.destinationDir
destinationDir new File(project.buildDir, "libJar")
}
}
diff --git a/room/runtime/src/main/java/androidx/room/DatabaseConfiguration.java b/room/runtime/src/main/java/androidx/room/DatabaseConfiguration.java
index bb893fd..3bea10e 100644
--- a/room/runtime/src/main/java/androidx/room/DatabaseConfiguration.java
+++ b/room/runtime/src/main/java/androidx/room/DatabaseConfiguration.java
@@ -116,7 +116,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public DatabaseConfiguration(@NonNull Context context, @Nullable String name,
@NonNull SupportSQLiteOpenHelper.Factory sqliteOpenHelperFactory,
@NonNull RoomDatabase.MigrationContainer migrationContainer,
diff --git a/room/runtime/src/main/java/androidx/room/EntityDeletionOrUpdateAdapter.java b/room/runtime/src/main/java/androidx/room/EntityDeletionOrUpdateAdapter.java
index ec3122d..098a14b 100644
--- a/room/runtime/src/main/java/androidx/room/EntityDeletionOrUpdateAdapter.java
+++ b/room/runtime/src/main/java/androidx/room/EntityDeletionOrUpdateAdapter.java
@@ -27,7 +27,7 @@
* @param <T> The type parameter of the entity to be deleted
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@SuppressWarnings({"WeakerAccess", "unused"})
public abstract class EntityDeletionOrUpdateAdapter<T> extends SharedSQLiteStatement {
/**
diff --git a/room/runtime/src/main/java/androidx/room/EntityInsertionAdapter.java b/room/runtime/src/main/java/androidx/room/EntityInsertionAdapter.java
index bf5776d..97f3969 100644
--- a/room/runtime/src/main/java/androidx/room/EntityInsertionAdapter.java
+++ b/room/runtime/src/main/java/androidx/room/EntityInsertionAdapter.java
@@ -32,7 +32,7 @@
* @hide
*/
@SuppressWarnings({"WeakerAccess", "unused"})
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public abstract class EntityInsertionAdapter<T> extends SharedSQLiteStatement {
/**
* Creates an InsertionAdapter that can insert the entity type T into the given database.
diff --git a/room/runtime/src/main/java/androidx/room/InvalidationTracker.java b/room/runtime/src/main/java/androidx/room/InvalidationTracker.java
index fe33a55..8874e1e 100644
--- a/room/runtime/src/main/java/androidx/room/InvalidationTracker.java
+++ b/room/runtime/src/main/java/androidx/room/InvalidationTracker.java
@@ -127,7 +127,7 @@
* @hide
*/
@SuppressWarnings("WeakerAccess")
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public InvalidationTracker(RoomDatabase database, String... tableNames) {
this(database, new HashMap<String, String>(), Collections.<String, Set<String>>emptyMap(),
tableNames);
@@ -139,7 +139,7 @@
* @hide
*/
@SuppressWarnings("WeakerAccess")
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public InvalidationTracker(RoomDatabase database, Map<String, String> shadowTablesMap,
Map<String, Set<String>> viewTables, String... tableNames) {
mDatabase = database;
@@ -322,7 +322,7 @@
* @hide
*/
@SuppressWarnings("unused")
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public void addWeakObserver(Observer observer) {
addObserver(new WeakObserver(this, observer));
}
@@ -458,7 +458,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@WorkerThread
public void refreshVersionsSync() {
syncTriggers();
@@ -561,7 +561,7 @@
* invalidates.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public <T> LiveData<T> createLiveData(String[] tableNames, Callable<T> computeFunction) {
return mInvalidationLiveDataContainer.create(
validateAndResolveTableNames(tableNames), computeFunction);
diff --git a/room/runtime/src/main/java/androidx/room/MultiInstanceInvalidationService.java b/room/runtime/src/main/java/androidx/room/MultiInstanceInvalidationService.java
index 2c7a67a..833a43f 100644
--- a/room/runtime/src/main/java/androidx/room/MultiInstanceInvalidationService.java
+++ b/room/runtime/src/main/java/androidx/room/MultiInstanceInvalidationService.java
@@ -34,7 +34,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class MultiInstanceInvalidationService extends Service {
// synthetic access
diff --git a/room/runtime/src/main/java/androidx/room/RoomDatabase.java b/room/runtime/src/main/java/androidx/room/RoomDatabase.java
index a33383a..1c7c68a 100644
--- a/room/runtime/src/main/java/androidx/room/RoomDatabase.java
+++ b/room/runtime/src/main/java/androidx/room/RoomDatabase.java
@@ -60,6 +60,7 @@
*
* @see Database
*/
+//@SuppressWarnings({"unused", "WeakerAccess"})
public abstract class RoomDatabase {
private static final String DB_IMPL_SUFFIX = "_Impl";
/**
@@ -67,7 +68,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static final int MAX_BIND_PARAMETER_CNT = 999;
/**
* Set by the generated open helper.
@@ -106,22 +107,6 @@
}
/**
- * This id is only set on threads that are used to dispatch coroutines within a suspending
- * database transaction.
- */
- private final ThreadLocal<Integer> mSuspendingTransactionId = new ThreadLocal<>();
-
- /**
- * Gets the suspending transaction id of the current thread.
- *
- * @hide
- */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
- ThreadLocal<Integer> getSuspendingTransactionId() {
- return mSuspendingTransactionId;
- }
-
- /**
* Creates a RoomDatabase.
* <p>
* You cannot create an instance of a database, instead, you should acquire it via
@@ -233,7 +218,7 @@
* @hide
*/
@SuppressWarnings("WeakerAccess")
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
// used in generated code
public void assertNotMainThread() {
if (mAllowMainThreadQueries) {
@@ -245,21 +230,6 @@
}
}
- /**
- * Asserts that we are not on a suspending transaction.
- *
- * @hide
- */
- @SuppressWarnings("WeakerAccess")
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
- // used in generated code
- public void assertNotSuspendingTransaction() {
- if (!inTransaction() && mSuspendingTransactionId.get() != null) {
- throw new IllegalStateException("Cannot access database on a different coroutine"
- + " context inherited from a suspending transaction.");
- }
- }
-
// Below, there are wrapper methods for SupportSQLiteDatabase. This helps us track which
// methods we are using and also helps unit tests to mock this class without mocking
// all SQLite database methods.
@@ -283,7 +253,6 @@
*/
public Cursor query(SupportSQLiteQuery query) {
assertNotMainThread();
- assertNotSuspendingTransaction();
return mOpenHelper.getWritableDatabase().query(query);
}
@@ -295,16 +264,12 @@
*/
public SupportSQLiteStatement compileStatement(@NonNull String sql) {
assertNotMainThread();
- assertNotSuspendingTransaction();
return mOpenHelper.getWritableDatabase().compileStatement(sql);
}
/**
* Wrapper for {@link SupportSQLiteDatabase#beginTransaction()}.
- *
- * @deprecated Use {@link #runInTransaction(Runnable)}
*/
- @Deprecated
public void beginTransaction() {
assertNotMainThread();
SupportSQLiteDatabase database = mOpenHelper.getWritableDatabase();
@@ -314,10 +279,7 @@
/**
* Wrapper for {@link SupportSQLiteDatabase#endTransaction()}.
- *
- * @deprecated Use {@link #runInTransaction(Runnable)}
*/
- @Deprecated
public void endTransaction() {
mOpenHelper.getWritableDatabase().endTransaction();
if (!inTransaction()) {
@@ -337,10 +299,7 @@
/**
* Wrapper for {@link SupportSQLiteDatabase#setTransactionSuccessful()}.
- *
- * @deprecated Use {@link #runInTransaction(Runnable)}
*/
- @Deprecated
public void setTransactionSuccessful() {
mOpenHelper.getWritableDatabase().setTransactionSuccessful();
}
@@ -351,7 +310,6 @@
*
* @param body The piece of code to execute.
*/
- @SuppressWarnings("deprecation")
public void runInTransaction(@NonNull Runnable body) {
beginTransaction();
try {
@@ -370,7 +328,6 @@
* @param <V> The type of the return value.
* @return The value returned from the {@link Callable}.
*/
- @SuppressWarnings("deprecation")
public <V> V runInTransaction(@NonNull Callable<V> body) {
beginTransaction();
try {
@@ -729,8 +686,8 @@
*
* @return A new database instance.
*/
- @SuppressLint("RestrictedApi")
@NonNull
+ @SuppressLint("RestrictedApi")
public T build() {
//noinspection ConstantConditions
if (mContext == null) {
diff --git a/room/runtime/src/main/java/androidx/room/RoomOpenHelper.java b/room/runtime/src/main/java/androidx/room/RoomOpenHelper.java
index 7a9affba..b792693 100644
--- a/room/runtime/src/main/java/androidx/room/RoomOpenHelper.java
+++ b/room/runtime/src/main/java/androidx/room/RoomOpenHelper.java
@@ -34,7 +34,7 @@
* @hide
*/
@SuppressWarnings("unused")
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class RoomOpenHelper extends SupportSQLiteOpenHelper.Callback {
@Nullable
private DatabaseConfiguration mConfiguration;
@@ -165,7 +165,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public abstract static class Delegate {
public final int version;
diff --git a/room/runtime/src/main/java/androidx/room/RoomSQLiteQuery.java b/room/runtime/src/main/java/androidx/room/RoomSQLiteQuery.java
index 689352c..08db4a4 100644
--- a/room/runtime/src/main/java/androidx/room/RoomSQLiteQuery.java
+++ b/room/runtime/src/main/java/androidx/room/RoomSQLiteQuery.java
@@ -38,7 +38,7 @@
* @hide
*/
@SuppressWarnings("unused")
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class RoomSQLiteQuery implements SupportSQLiteQuery, SupportSQLiteProgram {
@SuppressWarnings("WeakerAccess")
@VisibleForTesting
diff --git a/room/runtime/src/main/java/androidx/room/RoomTrackingLiveData.java b/room/runtime/src/main/java/androidx/room/RoomTrackingLiveData.java
index 61ef38e..6074d7d 100644
--- a/room/runtime/src/main/java/androidx/room/RoomTrackingLiveData.java
+++ b/room/runtime/src/main/java/androidx/room/RoomTrackingLiveData.java
@@ -16,7 +16,6 @@
package androidx.room;
-
import android.annotation.SuppressLint;
import androidx.annotation.MainThread;
diff --git a/room/runtime/src/main/java/androidx/room/SharedSQLiteStatement.java b/room/runtime/src/main/java/androidx/room/SharedSQLiteStatement.java
index 20c06c8..57d3340 100644
--- a/room/runtime/src/main/java/androidx/room/SharedSQLiteStatement.java
+++ b/room/runtime/src/main/java/androidx/room/SharedSQLiteStatement.java
@@ -32,7 +32,7 @@
* @hide
*/
@SuppressWarnings({"WeakerAccess", "unused"})
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public abstract class SharedSQLiteStatement {
private final AtomicBoolean mLock = new AtomicBoolean(false);
diff --git a/room/runtime/src/main/java/androidx/room/paging/LimitOffsetDataSource.java b/room/runtime/src/main/java/androidx/room/paging/LimitOffsetDataSource.java
index 0607dd5..282389c 100644
--- a/room/runtime/src/main/java/androidx/room/paging/LimitOffsetDataSource.java
+++ b/room/runtime/src/main/java/androidx/room/paging/LimitOffsetDataSource.java
@@ -19,6 +19,7 @@
import android.database.Cursor;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.paging.PositionalDataSource;
import androidx.room.InvalidationTracker;
@@ -43,7 +44,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public abstract class LimitOffsetDataSource<T> extends PositionalDataSource<T> {
private final RoomSQLiteQuery mSourceQuery;
private final String mCountQuery;
@@ -76,8 +77,6 @@
/**
* Count number of rows query can return
- *
- * @hide
*/
@SuppressWarnings("WeakerAccess")
public int countItems() {
@@ -108,69 +107,58 @@
@Override
public void loadInitial(@NonNull LoadInitialParams params,
@NonNull LoadInitialCallback<T> callback) {
- List<T> list = Collections.emptyList();
- int totalCount = 0;
- int firstLoadPosition = 0;
- RoomSQLiteQuery sqLiteQuery = null;
- Cursor cursor = null;
-
- mDb.beginTransaction();
- try {
- totalCount = countItems();
- if (totalCount != 0) {
- // bound the size requested, based on known count
- firstLoadPosition = computeInitialLoadPosition(params, totalCount);
- int firstLoadSize = computeInitialLoadSize(params, firstLoadPosition, totalCount);
-
- sqLiteQuery = getSQLiteQuery(firstLoadPosition, firstLoadSize);
- cursor = mDb.query(sqLiteQuery);
- List<T> rows = convertRows(cursor);
- mDb.setTransactionSuccessful();
- list = rows;
- }
- } finally {
- if (cursor != null) {
- cursor.close();
- }
- mDb.endTransaction();
- if (sqLiteQuery != null) {
- sqLiteQuery.release();
- }
+ int totalCount = countItems();
+ if (totalCount == 0) {
+ callback.onResult(Collections.<T>emptyList(), 0, 0);
+ return;
}
- callback.onResult(list, firstLoadPosition, totalCount);
+ // bound the size requested, based on known count
+ final int firstLoadPosition = computeInitialLoadPosition(params, totalCount);
+ final int firstLoadSize = computeInitialLoadSize(params, firstLoadPosition, totalCount);
+
+ List<T> list = loadRange(firstLoadPosition, firstLoadSize);
+ if (list != null && list.size() == firstLoadSize) {
+ callback.onResult(list, firstLoadPosition, totalCount);
+ } else {
+ // null list, or size doesn't match request - DB modified between count and load
+ invalidate();
+ }
}
@Override
public void loadRange(@NonNull LoadRangeParams params,
@NonNull LoadRangeCallback<T> callback) {
- callback.onResult(loadRange(params.startPosition, params.loadSize));
+ List<T> list = loadRange(params.startPosition, params.loadSize);
+ if (list != null) {
+ callback.onResult(list);
+ } else {
+ invalidate();
+ }
}
/**
* Return the rows from startPos to startPos + loadCount
- *
- * @hide
*/
- @NonNull
+ @Nullable
public List<T> loadRange(int startPosition, int loadCount) {
- final RoomSQLiteQuery sqLiteQuery = getSQLiteQuery(startPosition, loadCount);
+ final RoomSQLiteQuery sqLiteQuery = RoomSQLiteQuery.acquire(mLimitOffsetQuery,
+ mSourceQuery.getArgCount() + 2);
+ sqLiteQuery.copyArgumentsFrom(mSourceQuery);
+ sqLiteQuery.bindLong(sqLiteQuery.getArgCount() - 1, loadCount);
+ sqLiteQuery.bindLong(sqLiteQuery.getArgCount(), startPosition);
if (mInTransaction) {
- //noinspection deprecation
mDb.beginTransaction();
Cursor cursor = null;
- //noinspection TryFinallyCanBeTryWithResources
try {
cursor = mDb.query(sqLiteQuery);
List<T> rows = convertRows(cursor);
- //noinspection deprecation
mDb.setTransactionSuccessful();
return rows;
} finally {
if (cursor != null) {
cursor.close();
}
- //noinspection deprecation
mDb.endTransaction();
sqLiteQuery.release();
}
@@ -185,13 +173,4 @@
}
}
}
-
- private RoomSQLiteQuery getSQLiteQuery(int startPosition, int loadCount) {
- final RoomSQLiteQuery sqLiteQuery = RoomSQLiteQuery.acquire(mLimitOffsetQuery,
- mSourceQuery.getArgCount() + 2);
- sqLiteQuery.copyArgumentsFrom(mSourceQuery);
- sqLiteQuery.bindLong(sqLiteQuery.getArgCount() - 1, loadCount);
- sqLiteQuery.bindLong(sqLiteQuery.getArgCount(), startPosition);
- return sqLiteQuery;
- }
}
diff --git a/room/runtime/src/main/java/androidx/room/util/CursorUtil.java b/room/runtime/src/main/java/androidx/room/util/CursorUtil.java
index 05b8c59..53ef36c 100644
--- a/room/runtime/src/main/java/androidx/room/util/CursorUtil.java
+++ b/room/runtime/src/main/java/androidx/room/util/CursorUtil.java
@@ -27,7 +27,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class CursorUtil {
/**
diff --git a/room/runtime/src/main/java/androidx/room/util/DBUtil.java b/room/runtime/src/main/java/androidx/room/util/DBUtil.java
index 0cdc494..dd0363e 100644
--- a/room/runtime/src/main/java/androidx/room/util/DBUtil.java
+++ b/room/runtime/src/main/java/androidx/room/util/DBUtil.java
@@ -34,7 +34,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class DBUtil {
/**
diff --git a/room/runtime/src/main/java/androidx/room/util/FtsTableInfo.java b/room/runtime/src/main/java/androidx/room/util/FtsTableInfo.java
index c076a02..0b59ed2 100644
--- a/room/runtime/src/main/java/androidx/room/util/FtsTableInfo.java
+++ b/room/runtime/src/main/java/androidx/room/util/FtsTableInfo.java
@@ -33,7 +33,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class FtsTableInfo {
// A set of valid FTS Options
diff --git a/room/runtime/src/main/java/androidx/room/util/StringUtil.java b/room/runtime/src/main/java/androidx/room/util/StringUtil.java
index 2b30eb6..b865138 100644
--- a/room/runtime/src/main/java/androidx/room/util/StringUtil.java
+++ b/room/runtime/src/main/java/androidx/room/util/StringUtil.java
@@ -30,7 +30,7 @@
*
* String utilities for Room
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class StringUtil {
@SuppressWarnings("unused")
diff --git a/room/runtime/src/main/java/androidx/room/util/TableInfo.java b/room/runtime/src/main/java/androidx/room/util/TableInfo.java
index c187334..819c726 100644
--- a/room/runtime/src/main/java/androidx/room/util/TableInfo.java
+++ b/room/runtime/src/main/java/androidx/room/util/TableInfo.java
@@ -46,7 +46,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@SuppressWarnings({"WeakerAccess", "unused", "TryFinallyCanBeTryWithResources",
"SimplifiableIfStatement"})
// if you change this class, you must change TableInfoWriter.kt
@@ -438,7 +438,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static class ForeignKey {
@NonNull
public final String referenceTable;
@@ -504,7 +504,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
static class ForeignKeyWithSequence implements Comparable<ForeignKeyWithSequence> {
final int mId;
final int mSequence;
@@ -534,7 +534,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static class Index {
// should match the value in Index.kt
public static final String DEFAULT_PREFIX = "index_";
diff --git a/room/runtime/src/main/java/androidx/room/util/ViewInfo.java b/room/runtime/src/main/java/androidx/room/util/ViewInfo.java
index 5e4b9b2..918f8da 100644
--- a/room/runtime/src/main/java/androidx/room/util/ViewInfo.java
+++ b/room/runtime/src/main/java/androidx/room/util/ViewInfo.java
@@ -30,7 +30,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class ViewInfo {
/**
diff --git a/room/runtime/src/test/java/androidx/room/util/FtsTableInfoTest.java b/room/runtime/src/test/java/androidx/room/util/FtsTableInfoTest.java
index f7c264d..881176d 100644
--- a/room/runtime/src/test/java/androidx/room/util/FtsTableInfoTest.java
+++ b/room/runtime/src/test/java/androidx/room/util/FtsTableInfoTest.java
@@ -68,10 +68,6 @@
"tokenize=unicode61 \"tokenchars=,\"");
assertOptions("CREATE VIRTUAL TABLE `Book` USING FTS4(tokenize=unicode61 "
- + "`tokenchars=,`)",
- "tokenize=unicode61 `tokenchars=,`");
-
- assertOptions("CREATE VIRTUAL TABLE `Book` USING FTS4(tokenize=unicode61 "
+ "\"tokenchars=.=\" \"separators=X\", `pages`, notindexed=pages)",
"tokenize=unicode61 \"tokenchars=.=\" \"separators=X\"",
"notindexed=pages");
diff --git a/room/rxjava2/api/2.0.0.txt b/room/rxjava2/api/2.0.0.txt
index 8a7a0fb..b92289e3 100644
--- a/room/rxjava2/api/2.0.0.txt
+++ b/room/rxjava2/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room {
public class EmptyResultSetException extends java.lang.RuntimeException {
diff --git a/room/rxjava2/api/2.1.0-alpha02.txt b/room/rxjava2/api/2.1.0-alpha02.txt
index 8a7a0fb..b92289e3 100644
--- a/room/rxjava2/api/2.1.0-alpha02.txt
+++ b/room/rxjava2/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room {
public class EmptyResultSetException extends java.lang.RuntimeException {
diff --git a/room/rxjava2/api/2.1.0-alpha04.txt b/room/rxjava2/api/2.1.0-alpha04.txt
index 8a7a0fb..b92289e3 100644
--- a/room/rxjava2/api/2.1.0-alpha04.txt
+++ b/room/rxjava2/api/2.1.0-alpha04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room {
public class EmptyResultSetException extends java.lang.RuntimeException {
diff --git a/room/rxjava2/api/2.1.0-alpha05.txt b/room/rxjava2/api/2.1.0-alpha05.txt
deleted file mode 100644
index 8a7a0fb..0000000
--- a/room/rxjava2/api/2.1.0-alpha05.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- public class EmptyResultSetException extends java.lang.RuntimeException {
- ctor public EmptyResultSetException(String!);
- }
-
- public class RxRoom {
- ctor @Deprecated public RxRoom();
- method public static io.reactivex.Flowable<java.lang.Object>! createFlowable(androidx.room.RoomDatabase!, java.lang.String...!);
- method public static io.reactivex.Observable<java.lang.Object>! createObservable(androidx.room.RoomDatabase!, java.lang.String...!);
- field public static final Object! NOTHING;
- }
-
-}
-
diff --git a/room/rxjava2/api/current.txt b/room/rxjava2/api/current.txt
index 8a7a0fb..b92289e3 100644
--- a/room/rxjava2/api/current.txt
+++ b/room/rxjava2/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room {
public class EmptyResultSetException extends java.lang.RuntimeException {
diff --git a/room/rxjava2/api/res-2.1.0-alpha05.txt b/room/rxjava2/api/res-2.1.0-alpha05.txt
deleted file mode 100644
index e69de29..0000000
--- a/room/rxjava2/api/res-2.1.0-alpha05.txt
+++ /dev/null
diff --git a/room/rxjava2/api/restricted_2.0.0.txt b/room/rxjava2/api/restricted_2.0.0.txt
deleted file mode 100644
index 098d0b9..0000000
--- a/room/rxjava2/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- public class RxRoom {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static <T> io.reactivex.Flowable<T>! createFlowable(androidx.room.RoomDatabase!, String[]!, java.util.concurrent.Callable<T>!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static <T> io.reactivex.Observable<T>! createObservable(androidx.room.RoomDatabase!, String[]!, java.util.concurrent.Callable<T>!);
- }
-
-}
-
diff --git a/room/rxjava2/api/restricted_2.1.0-alpha05.txt b/room/rxjava2/api/restricted_2.1.0-alpha05.txt
deleted file mode 100644
index 36290b8..0000000
--- a/room/rxjava2/api/restricted_2.1.0-alpha05.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- public class RxRoom {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static <T> io.reactivex.Flowable<T>! createFlowable(androidx.room.RoomDatabase!, String[]!, java.util.concurrent.Callable<T>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static <T> io.reactivex.Observable<T>! createObservable(androidx.room.RoomDatabase!, String[]!, java.util.concurrent.Callable<T>!);
- }
-
-}
-
diff --git a/room/rxjava2/api/restricted_current.txt b/room/rxjava2/api/restricted_current.txt
deleted file mode 100644
index 36290b8..0000000
--- a/room/rxjava2/api/restricted_current.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-// Signature format: 3.0
-package androidx.room {
-
- public class RxRoom {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static <T> io.reactivex.Flowable<T>! createFlowable(androidx.room.RoomDatabase!, String[]!, java.util.concurrent.Callable<T>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static <T> io.reactivex.Observable<T>! createObservable(androidx.room.RoomDatabase!, String[]!, java.util.concurrent.Callable<T>!);
- }
-
-}
-
diff --git a/room/rxjava2/src/main/java/androidx/room/RxRoom.java b/room/rxjava2/src/main/java/androidx/room/RxRoom.java
index 1e78572..2cb32d9 100644
--- a/room/rxjava2/src/main/java/androidx/room/RxRoom.java
+++ b/room/rxjava2/src/main/java/androidx/room/RxRoom.java
@@ -99,7 +99,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static <T> Flowable<T> createFlowable(final RoomDatabase database,
final String[] tableNames, final Callable<T> callable) {
Scheduler scheduler = Schedulers.from(database.getQueryExecutor());
@@ -163,7 +163,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static <T> Observable<T> createObservable(final RoomDatabase database,
final String[] tableNames, final Callable<T> callable) {
Scheduler scheduler = Schedulers.from(database.getQueryExecutor());
diff --git a/room/testing/api/2.0.0.txt b/room/testing/api/2.0.0.txt
index 3d2ed97..27556ec 100644
--- a/room/testing/api/2.0.0.txt
+++ b/room/testing/api/2.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room.testing {
public class MigrationTestHelper extends org.junit.rules.TestWatcher {
diff --git a/room/testing/api/2.1.0-alpha02.txt b/room/testing/api/2.1.0-alpha02.txt
index 3d2ed97..27556ec 100644
--- a/room/testing/api/2.1.0-alpha02.txt
+++ b/room/testing/api/2.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room.testing {
public class MigrationTestHelper extends org.junit.rules.TestWatcher {
diff --git a/room/testing/api/2.1.0-alpha04.txt b/room/testing/api/2.1.0-alpha04.txt
index 3d2ed97..27556ec 100644
--- a/room/testing/api/2.1.0-alpha04.txt
+++ b/room/testing/api/2.1.0-alpha04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room.testing {
public class MigrationTestHelper extends org.junit.rules.TestWatcher {
diff --git a/room/testing/api/2.1.0-alpha05.txt b/room/testing/api/2.1.0-alpha05.txt
deleted file mode 100644
index 3d2ed97..0000000
--- a/room/testing/api/2.1.0-alpha05.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.room.testing {
-
- public class MigrationTestHelper extends org.junit.rules.TestWatcher {
- ctor public MigrationTestHelper(android.app.Instrumentation!, String!);
- ctor public MigrationTestHelper(android.app.Instrumentation!, String!, androidx.sqlite.db.SupportSQLiteOpenHelper.Factory!);
- method public void closeWhenFinished(androidx.sqlite.db.SupportSQLiteDatabase!);
- method public void closeWhenFinished(androidx.room.RoomDatabase!);
- method public androidx.sqlite.db.SupportSQLiteDatabase! createDatabase(String!, int) throws java.io.IOException;
- method public androidx.sqlite.db.SupportSQLiteDatabase! runMigrationsAndValidate(String!, int, boolean, androidx.room.migration.Migration...!) throws java.io.IOException;
- }
-
-}
-
diff --git a/room/testing/api/current.txt b/room/testing/api/current.txt
index 3d2ed97..27556ec 100644
--- a/room/testing/api/current.txt
+++ b/room/testing/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.room.testing {
public class MigrationTestHelper extends org.junit.rules.TestWatcher {
diff --git a/room/testing/api/res-2.1.0-alpha05.txt b/room/testing/api/res-2.1.0-alpha05.txt
deleted file mode 100644
index e69de29..0000000
--- a/room/testing/api/res-2.1.0-alpha05.txt
+++ /dev/null
diff --git a/room/testing/api/restricted_2.0.0.txt b/room/testing/api/restricted_2.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/room/testing/api/restricted_2.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/room/testing/api/restricted_2.1.0-alpha05.txt b/room/testing/api/restricted_2.1.0-alpha05.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/room/testing/api/restricted_2.1.0-alpha05.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/room/testing/api/restricted_current.txt b/room/testing/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/room/testing/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/room/testing/build.gradle b/room/testing/build.gradle
index f98f7cf..f7aa608 100644
--- a/room/testing/build.gradle
+++ b/room/testing/build.gradle
@@ -26,8 +26,8 @@
dependencies {
api(project(":room:room-common"))
api(project(":room:room-runtime"))
- api(ANDROIDX_SQLITE)
- api(ANDROIDX_SQLITE_FRAMEWORK)
+ api(project(":sqlite:sqlite"))
+ api(project(":sqlite:sqlite-framework"))
api(project(":room:room-migration"))
implementation(ARCH_CORE_RUNTIME)
api(SUPPORT_CORE_UTILS, libs.support_exclude_config)
diff --git a/room/testing/src/main/java/androidx/room/testing/MigrationTestHelper.java b/room/testing/src/main/java/androidx/room/testing/MigrationTestHelper.java
index c0e1c4b..9cc827c 100644
--- a/room/testing/src/main/java/androidx/room/testing/MigrationTestHelper.java
+++ b/room/testing/src/main/java/androidx/room/testing/MigrationTestHelper.java
@@ -135,8 +135,8 @@
* @return A database connection which has the schema in the requested version.
* @throws IOException If it cannot find the schema description in the assets folder.
*/
- @SuppressLint("RestrictedApi")
@SuppressWarnings("SameParameterValue")
+ @SuppressLint("RestrictedApi")
public SupportSQLiteDatabase createDatabase(String name, int version) throws IOException {
File dbPath = mInstrumentation.getTargetContext().getDatabasePath(name);
if (dbPath.exists()) {
diff --git a/samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemo.java b/samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemo.java
index 0a30f48..54e995e 100644
--- a/samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemo.java
+++ b/samples/BiometricDemos/src/main/java/com/example/android/biometric/BiometricPromptDemo.java
@@ -152,6 +152,9 @@
final Button buttonAuthenticate;
buttonAuthenticate = findViewById(R.id.button_authenticate);
+ mBiometricPrompt = new BiometricPrompt(this /* fragmentActivity */, mExecutor,
+ mAuthenticationCallback);
+
try {
mKeyStore = KeyStore.getInstance("AndroidKeyStore");
} catch (java.security.KeyStoreException e) {
@@ -179,17 +182,6 @@
}
@Override
- protected void onResume() {
- super.onResume();
- // Developers should (re)create the BiometricPrompt every time the application is resumed.
- // This is necessary because it is possible for the executor and callback to be GC'd.
- // Instantiating the prompt here allows the library to handle things such as configuration
- // changes.
- mBiometricPrompt = new BiometricPrompt(this /* fragmentActivity */, mExecutor,
- mAuthenticationCallback);
- }
-
- @Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean(KEY_SAVED_USE_CRYPTO, mUseCrypto);
diff --git a/samples/Support7Demos/src/main/AndroidManifest.xml b/samples/Support7Demos/src/main/AndroidManifest.xml
index 3014c77..cfeef10 100644
--- a/samples/Support7Demos/src/main/AndroidManifest.xml
+++ b/samples/Support7Demos/src/main/AndroidManifest.xml
@@ -161,17 +161,8 @@
</activity>
<activity android:name=".app.ActionBarUsage"
- android:label="@string/action_bar_usage"
- android:theme="@style/Theme.AppCompat">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="com.example.android.supportv7.SAMPLE_CODE" />
- </intent-filter>
- </activity>
-
- <activity android:name=".app.ActionBarBackgroundChange"
- android:label="@string/action_bar_background_change"
- android:theme="@style/Theme.AppCompat.Light">
+ android:label="@string/action_bar_usage"
+ android:theme="@style/Theme.AppCompat">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.example.android.supportv7.SAMPLE_CODE" />
@@ -260,15 +251,6 @@
</intent-filter>
</activity>
- <activity android:name=".app.AppCompatWidgetsSwitches"
- android:label="@string/appcompat_widgets_switches"
- android:theme="@style/Theme.AppCompat.Light.DarkActionBar">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="com.example.android.supportv7.SAMPLE_CODE" />
- </intent-filter>
- </activity>
-
<activity android:name=".app.AppCompatWidgetsTextInput"
android:label="@string/appcompat_widgets_text_input"
android:theme="@style/Theme.AppCompat.Light.DarkActionBar">
@@ -336,19 +318,6 @@
</intent-filter>
</activity>
- <activity android:name=".app.ToolbarBackgroundChange"
- android:label="@string/toolbar_background_change"
- android:theme="@style/Theme.AppCompat.Light.NoActionBar">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="com.example.android.supportv7.SAMPLE_CODE" />
- </intent-filter>
-
- <meta-data
- android:name="android.app.default_searchable"
- android:value=".app.SearchActivity" />
- </activity>
-
<activity android:name=".app.DialogUsage"
android:label="@string/dialog_usage"
android:theme="@style/Theme.AppCompat.Light">
diff --git a/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/ActionBarBackgroundChange.java b/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/ActionBarBackgroundChange.java
deleted file mode 100644
index 51d18f7..0000000
--- a/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/ActionBarBackgroundChange.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2019 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 com.example.android.supportv7.app;
-
-import android.graphics.drawable.ColorDrawable;
-import android.os.Bundle;
-import android.view.View;
-
-import androidx.appcompat.app.ActionBar;
-import androidx.appcompat.app.AppCompatActivity;
-
-import com.example.android.supportv7.R;
-
-/**
- * This demonstrates changing background and elevation (on supported platforms) of ActionBar.
- */
-public class ActionBarBackgroundChange extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.action_bar_background_change);
-
- final ActionBar actionBar = getSupportActionBar();
- actionBar.setBackgroundDrawable(new ColorDrawable(0x00FFFFFF));
-
- findViewById(R.id.make_bg_transparent).setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- actionBar.setBackgroundDrawable(new ColorDrawable(0x00FFFFFF));
- actionBar.setElevation(0);
- }
- });
-
- findViewById(R.id.make_bg_color).setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- actionBar.setBackgroundDrawable(new ColorDrawable(0xFF80FFA0));
- actionBar.setElevation(20);
- }
- });
- }
-}
diff --git a/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatNightModeActivity.java b/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatNightModeActivity.java
index 30a24ef..87707bd 100644
--- a/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatNightModeActivity.java
+++ b/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatNightModeActivity.java
@@ -37,10 +37,6 @@
setContentView(R.layout.appcompat_night_mode);
}
- public void setModeNightFollowSystem(View view) {
- getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
- }
-
public void setModeNightNo(View view) {
getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_NO);
}
@@ -49,11 +45,7 @@
getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_YES);
}
- public void setModeNightAutoTime(View view) {
- getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_TIME);
- }
-
- public void setModeNightAutoBattery(View view) {
- getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY);
+ public void setModeNightAuto(View view) {
+ getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_AUTO);
}
}
\ No newline at end of file
diff --git a/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatNightModeAlertDialog.java b/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatNightModeAlertDialog.java
index ddd9135..efbd1ea 100644
--- a/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatNightModeAlertDialog.java
+++ b/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatNightModeAlertDialog.java
@@ -36,12 +36,6 @@
setContentView(R.layout.appcompat_night_mode);
}
- public void setModeNightFollowSystem(View view) {
- AlertDialog dialog = createAlertDialog();
- dialog.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
- dialog.show();
- }
-
public void setModeNightNo(View view) {
AlertDialog dialog = createAlertDialog();
dialog.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_NO);
@@ -54,15 +48,9 @@
dialog.show();
}
- public void setModeNightAutoTime(View view) {
+ public void setModeNightAuto(View view) {
AlertDialog dialog = createAlertDialog();
- dialog.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_TIME);
- dialog.show();
- }
-
- public void setModeNightAutoBattery(View view) {
- AlertDialog dialog = createAlertDialog();
- dialog.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY);
+ dialog.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_AUTO);
dialog.show();
}
diff --git a/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatNightModeDialog.java b/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatNightModeDialog.java
index d4d8ff1..8d1fe32 100644
--- a/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatNightModeDialog.java
+++ b/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatNightModeDialog.java
@@ -36,14 +36,6 @@
setContentView(R.layout.appcompat_night_mode);
}
- public void setModeNightFollowSystem(View view) {
- AppCompatDialog dialog = new AppCompatDialog(this, R.style.Theme_AppCompat_DayNight_Dialog);
- dialog.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
- dialog.setTitle(R.string.dialog_title);
- dialog.setContentView(R.layout.dialog_content);
- dialog.show();
- }
-
public void setModeNightNo(View view) {
AppCompatDialog dialog = new AppCompatDialog(this, R.style.Theme_AppCompat_DayNight_Dialog);
dialog.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_NO);
@@ -60,19 +52,13 @@
dialog.show();
}
- public void setModeNightAutoTime(View view) {
+ public void setModeNightAuto(View view) {
AppCompatDialog dialog = new AppCompatDialog(this, R.style.Theme_AppCompat_DayNight_Dialog);
- dialog.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_TIME);
+ dialog.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_AUTO);
dialog.setTitle(R.string.dialog_title);
dialog.setContentView(R.layout.dialog_content);
dialog.show();
}
- public void setModeNightAutoBattery(View view) {
- AppCompatDialog dialog = new AppCompatDialog(this, R.style.Theme_AppCompat_DayNight_Dialog);
- dialog.getDelegate().setLocalNightMode(AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY);
- dialog.setTitle(R.string.dialog_title);
- dialog.setContentView(R.layout.dialog_content);
- dialog.show();
- }
+
}
diff --git a/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatWidgetsSwitches.java b/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatWidgetsSwitches.java
deleted file mode 100644
index b134543..0000000
--- a/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/AppCompatWidgetsSwitches.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2019 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 com.example.android.supportv7.app;
-
-import android.os.Bundle;
-
-import androidx.appcompat.app.AppCompatActivity;
-
-import com.example.android.supportv7.R;
-
-/**
- * This demonstrates the styled {@link android.widget.Switch} and
- * {@link androidx.appcompat.widget.SwitchCompat} widgets in AppCompat.
- */
-public class AppCompatWidgetsSwitches extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.appcompat_widgets_switches);
- }
-}
diff --git a/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/ToolbarBackgroundChange.java b/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/ToolbarBackgroundChange.java
deleted file mode 100644
index 8fc939a..0000000
--- a/samples/Support7Demos/src/main/java/com/example/android/supportv7/app/ToolbarBackgroundChange.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2019 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 com.example.android.supportv7.app;
-
-import android.app.SearchManager;
-import android.graphics.drawable.ColorDrawable;
-import android.os.Bundle;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.View;
-import android.widget.Toast;
-
-import androidx.appcompat.app.ActionBar;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.appcompat.widget.SearchView;
-import androidx.appcompat.widget.Toolbar;
-
-import com.example.android.supportv7.R;
-
-/**
- * This demonstrates changing background and elevation (on supported platforms) of Toolbar.
- */
-public class ToolbarBackgroundChange extends AppCompatActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.toolbar_background_change);
-
- // Retrieve the Toolbar from our content view, and set it as the action bar
- Toolbar toolbar = findViewById(R.id.toolbar);
- setSupportActionBar(toolbar);
-
- final ActionBar actionBar = getSupportActionBar();
- findViewById(R.id.make_bg_transparent).setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- actionBar.setElevation(0);
- actionBar.setBackgroundDrawable(new ColorDrawable(0x00FFFFFF));
- }
- });
-
- findViewById(R.id.make_bg_color).setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- actionBar.setElevation(20);
- actionBar.setBackgroundDrawable(new ColorDrawable(0xFF80FFA0));
- }
- });
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- MenuInflater inflater = getMenuInflater();
- inflater.inflate(R.menu.actions, menu);
-
- // Retrieve the SearchView and plug it into SearchManager
- final SearchView searchView =
- (SearchView) menu.findItem(R.id.action_search).getActionView();
-
- SearchManager searchManager = (SearchManager) getSystemService(SEARCH_SERVICE);
- searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
-
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- Toast.makeText(this, "Selected Item: " + item.getTitle(), Toast.LENGTH_SHORT).show();
- return true;
- }
-
-}
diff --git a/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/SampleDynamicGroupMrp.java b/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/SampleDynamicGroupMrp.java
index 32f2689..033f8e1 100644
--- a/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/SampleDynamicGroupMrp.java
+++ b/samples/Support7Demos/src/main/java/com/example/android/supportv7/media/SampleDynamicGroupMrp.java
@@ -48,7 +48,6 @@
*/
final class SampleDynamicGroupMrp extends SampleMediaRouteProvider {
private static final String TAG = "SampleDynamicGroupMrp";
- static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
private static final String FIXED_VOLUME_ROUTE_ID = "fixed";
private static final String VARIABLE_VOLUME_BASIC_ROUTE_ID = "variable_basic";
@@ -89,7 +88,7 @@
return mController;
}
- void copyRouteWithNewId(String routeId) {
+ private void copyRouteWithNewId(String routeId) {
MediaRouteDescriptor routeDescriptor = mRouteDescriptors.get(routeId);
if (routeDescriptor == null || !routeDescriptor.isValid()) {
Log.w(TAG, "copyRouteWithNewId: Route doesn't exist or isn't valid : " + routeId);
@@ -265,8 +264,7 @@
SampleDynamicGroupRouteController(String dynamicGroupRouteId,
List<String> memberIds) {
mRouteId = dynamicGroupRouteId;
- MediaRouteDescriptor selectedRouteDescriptor = mRouteDescriptors.get(mRouteId);
- mTvSelectedCount = countTvFromRoute(selectedRouteDescriptor);
+ mTvSelectedCount = 0;
// Initialize DynamicRouteDescriptor with all the route descriptors.
List<MediaRouteDescriptor> routeDescriptors = getDescriptor().getRoutes();
@@ -284,15 +282,10 @@
mDynamicRouteDescriptors.put(routeId, builder.build());
}
}
- if (memberIds != null) {
- mMemberRouteIds.addAll(memberIds);
- }
mHelper = new RouteControlHelper(mRouteId);
updateDynamicRouteDescriptors();
- if (DEBUG) {
- Log.d(TAG, mRouteId + ": Controller created.");
- }
+ Log.d(TAG, mRouteId + ": Controller created.");
}
//////////////////////////////////////////////
@@ -314,32 +307,22 @@
mMemberRouteIds = routeIds;
}
- private boolean ensureDynamicRoute(String routeId) {
- MediaRouteDescriptor selectedRouteDescriptor = mRouteDescriptors.get(routeId);
- if (selectedRouteDescriptor == null) {
- return false;
- }
- if (!selectedRouteDescriptor.isDynamicGroupRoute()) {
- // We should reinitialize here not to add members twice
- mTvSelectedCount = 0;
- mMemberRouteIds.clear();
- copyRouteWithNewId(mRouteId);
- }
- return true;
- }
-
@Override
public void onAddMemberRoute(String routeId) {
DynamicRouteDescriptor dynamicDescriptor = mDynamicRouteDescriptors.get(routeId);
if (dynamicDescriptor == null) {
- Log.w(TAG, "onAddMemberRoute: Ignored for routeId: " + routeId);
+ Log.d(TAG, "onAddMemberRoute: Ignored for routeId: " + routeId);
return;
}
- if (!ensureDynamicRoute(mRouteId)) {
- Log.w(TAG, "onAddMemberRoute: Can't find selected route : " + mRouteId);
+ MediaRouteDescriptor selectedRouteDescriptor = mRouteDescriptors.get(mRouteId);
+ if (selectedRouteDescriptor == null) {
+ Log.d(TAG, "onAddMemberRoute: Can't find selected route : " + mRouteId);
return;
}
+ if (!selectedRouteDescriptor.isDynamicGroupRoute()) {
+ copyRouteWithNewId(mRouteId);
+ }
// Add each member route do dynamic group
MediaRouteDescriptor routeDescriptor = mRouteDescriptors.get(routeId);
@@ -384,9 +367,11 @@
new MediaRouteDescriptor.Builder(mRouteDescriptors.get(mRouteId));
for (String routeId : memberRouteIds) {
+ Log.d(TAG, "member : " + routeId);
+
DynamicRouteDescriptor dynamicDescriptor = mDynamicRouteDescriptors.get(routeId);
if (dynamicDescriptor == null) {
- Log.w(TAG, "onAddMemberRoute: Ignored for routeId: " + routeId);
+ Log.d(TAG, "onAddMemberRoute: Ignored for routeId: " + routeId);
return;
}
@@ -426,14 +411,18 @@
DynamicRouteDescriptor dynamicDescriptor = mDynamicRouteDescriptors.get(routeId);
if (dynamicDescriptor == null || !dynamicDescriptor.isUnselectable()
|| !mMemberRouteIds.remove(routeId)) {
- Log.w(TAG, "onRemoveMemberRoute: Ignored for routeId: " + routeId);
+ Log.d(TAG, "onRemoveMemberRoute: Ignored for routeId: " + routeId);
return;
}
- if (!ensureDynamicRoute(mRouteId)) {
- Log.w(TAG, "onRemoveMemberRoute: Can't find selected route : " + mRouteId);
+ MediaRouteDescriptor selectedRouteDescriptor = mRouteDescriptors.get(mRouteId);
+ if (selectedRouteDescriptor == null) {
+ Log.d(TAG, "onRemoveMemberRoute: Can't find selected route : " + mRouteId);
return;
}
+ if (!selectedRouteDescriptor.isDynamicGroupRoute()) {
+ copyRouteWithNewId(mRouteId);
+ }
MediaRouteDescriptor routeDescriptor = dynamicDescriptor.getRouteDescriptor();
DynamicRouteDescriptor.Builder builder =
diff --git a/samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/ListPopupWindowActivity.java b/samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/ListPopupWindowActivity.java
index 37d3f0e..203c09b 100644
--- a/samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/ListPopupWindowActivity.java
+++ b/samples/Support7Demos/src/main/java/com/example/android/supportv7/widget/ListPopupWindowActivity.java
@@ -16,7 +16,6 @@
package com.example.android.supportv7.widget;
-import android.graphics.Rect;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@@ -40,7 +39,6 @@
private ViewGroup mContainer;
private CheckBox mIsModal;
- private CheckBox mUseEpicenter;
private TextView mLog;
@@ -62,7 +60,6 @@
mContainer = findViewById(R.id.container);
mIsModal = (CheckBox) mContainer.findViewById(R.id.is_modal);
- mUseEpicenter = (CheckBox) mContainer.findViewById(R.id.use_custom_epicenter);
mLog = (TextView) mContainer.findViewById(R.id.log);
mButton = (Button) mContainer.findViewById(R.id.test_button);
@@ -116,11 +113,6 @@
mListPopupWindow.setAdapter(mListPopupAdapter);
mListPopupWindow.setAnchorView(mButton);
- final int hOffset = getResources().getDisplayMetrics().heightPixels / 3;
- final Rect epicenter = mUseEpicenter.isChecked()
- ? new Rect(0, hOffset, 0, hOffset) : null;
- mListPopupWindow.setEpicenterBounds(epicenter);
-
// Register a listener to be notified when an item in our popup window has
// been clicked.
mListPopupWindow.setOnItemClickListener(new AdapterView.OnItemClickListener() {
diff --git a/samples/Support7Demos/src/main/res/color/drawable_tint.xml b/samples/Support7Demos/src/main/res/color/drawable_tint.xml
deleted file mode 100644
index 44789c1..0000000
--- a/samples/Support7Demos/src/main/res/color/drawable_tint.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ 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.
- -->
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_pressed="true" android:color="#ff00ff"/>
- <item android:color="#0000ff"/>
-</selector>
\ No newline at end of file
diff --git a/samples/Support7Demos/src/main/res/drawable/switch_compat_thumb.xml b/samples/Support7Demos/src/main/res/drawable/switch_compat_thumb.xml
deleted file mode 100644
index 6e430e1..0000000
--- a/samples/Support7Demos/src/main/res/drawable/switch_compat_thumb.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="oval">
- <solid android:color="#FFFF00" />
- <size
- android:width="32dp"
- android:height="32dp" />
-</shape>
diff --git a/samples/Support7Demos/src/main/res/drawable/switch_compat_track.xml b/samples/Support7Demos/src/main/res/drawable/switch_compat_track.xml
deleted file mode 100644
index bb2775c..0000000
--- a/samples/Support7Demos/src/main/res/drawable/switch_compat_track.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android">
- <solid android:color="#FF0000" />
- <size
- android:width="64dp"
- android:height="32dp" />
-</shape>
diff --git a/samples/Support7Demos/src/main/res/layout/action_bar_background_change.xml b/samples/Support7Demos/src/main/res/layout/action_bar_background_change.xml
deleted file mode 100644
index 852c5ff..0000000
--- a/samples/Support7Demos/src/main/res/layout/action_bar_background_change.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:padding="12dp">
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="24dp"
- android:text="Changing elevation with the buttons below is only relevant on SDK 21+" />
-
- <Button
- android:id="@+id/make_bg_transparent"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="12dp"
- android:text="Transparent BG + no elevation" />
-
- <Button
- android:id="@+id/make_bg_color"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Color BG + elevation" />
-
-</LinearLayout>
\ No newline at end of file
diff --git a/samples/Support7Demos/src/main/res/layout/appcompat_night_mode.xml b/samples/Support7Demos/src/main/res/layout/appcompat_night_mode.xml
index cdae523..6039f60 100644
--- a/samples/Support7Demos/src/main/res/layout/appcompat_night_mode.xml
+++ b/samples/Support7Demos/src/main/res/layout/appcompat_night_mode.xml
@@ -27,11 +27,6 @@
<Button android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/mode_night_follow_system"
- android:onClick="setModeNightFollowSystem"/>
-
- <Button android:layout_width="match_parent"
- android:layout_height="wrap_content"
android:text="@string/mode_night_no"
android:onClick="setModeNightNo"/>
@@ -42,13 +37,8 @@
<Button android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/mode_night_auto_time"
- android:onClick="setModeNightAutoTime"/>
-
- <Button android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/mode_night_auto_battery"
- android:onClick="setModeNightAutoBattery"/>
+ android:text="@string/mode_night_auto"
+ android:onClick="setModeNightAuto"/>
<View
android:layout_width="match_parent"
diff --git a/samples/Support7Demos/src/main/res/layout/appcompat_widgets_buttons.xml b/samples/Support7Demos/src/main/res/layout/appcompat_widgets_buttons.xml
index 61bb49d..f481406 100644
--- a/samples/Support7Demos/src/main/res/layout/appcompat_widgets_buttons.xml
+++ b/samples/Support7Demos/src/main/res/layout/appcompat_widgets_buttons.xml
@@ -15,123 +15,144 @@
limitations under the License.
-->
-<ScrollView
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:padding="16dp">
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:padding="16dp">
+
+ <androidx.appcompat.widget.SwitchCompat
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:text="SwitchCompat"/>
+
+ <androidx.appcompat.widget.SwitchCompat
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:enabled="false"
+ android:text="SwitchCompat disabled"/>
+
+ <Switch
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:text="Switch"/>
+
+ <Switch
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:enabled="false"
+ android:text="Switch disabled"/>
<CheckBox
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="CheckBox" />
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="CheckBox"/>
<RadioGroup
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
<RadioButton
- android:id="@+id/radiobutton_1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="RadioButton" />
+ android:id="@+id/radiobutton_1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="RadioButton"/>
<RadioButton
- android:id="@+id/radiobutton_2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="RadioButton" />
+ android:id="@+id/radiobutton_2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="RadioButton"/>
</RadioGroup>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Button" />
+ android:text="Button"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
- android:text="Button disabled" />
+ android:text="Button disabled"/>
<Button
- style="@style/Widget.AppCompat.Button.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Button (small)" />
+ android:text="Button (small)"
+ style="@style/Widget.AppCompat.Button.Small"/>
<Button
- style="@style/Widget.AppCompat.Button.Small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
- android:text="Button (small) disabled" />
+ android:text="Button (small) disabled"
+ style="@style/Widget.AppCompat.Button.Small"/>
<Button
- style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Button (borderless)" />
+ android:text="Button (borderless)"
+ style="@style/Widget.AppCompat.Button.Borderless"/>
<Button
- style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
- android:text="Button (borderless) disabled" />
+ android:text="Button (borderless) disabled"
+ style="@style/Widget.AppCompat.Button.Borderless"/>
<Button
- style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Button (borderless + colored)" />
+ android:text="Button (borderless + colored)"
+ style="@style/Widget.AppCompat.Button.Borderless.Colored"/>
<Button
- style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
- android:text="Button (borderless + colored) disabled" />
+ android:text="Button (borderless + colored) disabled"
+ style="@style/Widget.AppCompat.Button.Borderless.Colored"/>
<Button
- style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Button (colored)" />
+ android:text="Button (colored)"
+ style="@style/Widget.AppCompat.Button.Colored"/>
<Button
- style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
- android:text="Button (colored) disabled" />
+ android:text="Button (colored) disabled"
+ style="@style/Widget.AppCompat.Button.Colored"/>
<Button
- style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button (colored + tinted)"
- app:backgroundTint="#00FF00" />
+ app:backgroundTint="#00FF00"
+ style="@style/Widget.AppCompat.Button.Colored"/>
<Button
- style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:enabled="false"
android:text="Button (colored + tinted) disabled"
- app:backgroundTint="#00FF00" />
+ app:backgroundTint="#00FF00"
+ style="@style/Widget.AppCompat.Button.Colored"/>
<RatingBar
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
</LinearLayout>
diff --git a/samples/Support7Demos/src/main/res/layout/appcompat_widgets_switches.xml b/samples/Support7Demos/src/main/res/layout/appcompat_widgets_switches.xml
deleted file mode 100644
index 2e24fc6..0000000
--- a/samples/Support7Demos/src/main/res/layout/appcompat_widgets_switches.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2019 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.
--->
-
-<ScrollView
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:padding="16dp">
-
- <Switch
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Switch" />
-
- <Switch
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:enabled="false"
- android:text="Switch disabled" />
-
- <androidx.appcompat.widget.SwitchCompat
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="SwitchCompat" />
-
- <androidx.appcompat.widget.SwitchCompat
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:enabled="false"
- android:text="SwitchCompat disabled" />
-
- <androidx.appcompat.widget.SwitchCompat
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:thumb="@drawable/switch_compat_thumb"
- app:track="@drawable/switch_compat_track"
- android:text="SwitchCompat custom drawables" />
-
- <androidx.appcompat.widget.SwitchCompat
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:thumb="@drawable/switch_compat_thumb"
- app:thumbTint="@color/color_sky_day"
- app:track="@drawable/switch_compat_track"
- app:trackTint="@color/color_sky_night"
- android:text="SwitchCompat custom drawables + tint" />
-
- </LinearLayout>
-
-</ScrollView>
\ No newline at end of file
diff --git a/samples/Support7Demos/src/main/res/layout/appcompat_widgets_text_views.xml b/samples/Support7Demos/src/main/res/layout/appcompat_widgets_text_views.xml
index 276ee6a..08207a46 100644
--- a/samples/Support7Demos/src/main/res/layout/appcompat_widgets_text_views.xml
+++ b/samples/Support7Demos/src/main/res/layout/appcompat_widgets_text_views.xml
@@ -54,14 +54,6 @@
android:text="@string/text_compound_compat"
app:drawableStartCompat="@drawable/ic_search" />
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/text_compound_compat"
- android:clickable="true"
- app:drawableStartCompat="@drawable/ic_search"
- app:drawableTint="@color/drawable_tint" />
-
</LinearLayout>
</ScrollView>
diff --git a/samples/Support7Demos/src/main/res/layout/list_popup_window_activity.xml b/samples/Support7Demos/src/main/res/layout/list_popup_window_activity.xml
index 5167c8f..34da5bb 100644
--- a/samples/Support7Demos/src/main/res/layout/list_popup_window_activity.xml
+++ b/samples/Support7Demos/src/main/res/layout/list_popup_window_activity.xml
@@ -32,23 +32,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentLeft="true"
- android:text="@string/list_popup_window_is_modal"
- android:paddingEnd="@dimen/control_offset_medium"
- android:paddingRight="@dimen/control_offset_medium"
- android:checked="true" />
-
- <CheckBox
- android:id="@+id/use_custom_epicenter"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
- android:text="@string/list_popup_window_use_epicenter"
- android:layout_toRightOf="@id/is_modal"
- android:layout_toEndOf="@id/is_modal"
- android:checked="false" />
+ android:text="@string/list_popup_window_is_modal"
+ android:checked="true" />
<TextView
android:id="@+id/log"
diff --git a/samples/Support7Demos/src/main/res/layout/toolbar_background_change.xml b/samples/Support7Demos/src/main/res/layout/toolbar_background_change.xml
deleted file mode 100644
index 4e12993..0000000
--- a/samples/Support7Demos/src/main/res/layout/toolbar_background_change.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2019 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.
- -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/toolbar"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="?attr/colorPrimaryDark"
- android:minHeight="?attr/actionBarSize"
- android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
- app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
-
- <Button
- android:id="@+id/make_bg_transparent"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="24dp"
- android:text="Transparent BG + no elevation" />
-
- <Button
- android:id="@+id/make_bg_color"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Color BG + elevation" />
-
-</LinearLayout>
\ No newline at end of file
diff --git a/samples/Support7Demos/src/main/res/values/dimens.xml b/samples/Support7Demos/src/main/res/values/dimens.xml
index 9bb0502..f2520b9 100644
--- a/samples/Support7Demos/src/main/res/values/dimens.xml
+++ b/samples/Support7Demos/src/main/res/values/dimens.xml
@@ -18,6 +18,5 @@
<dimen name="color_palette_size">60dp</dimen>
<dimen name="touch_item_min_height">60dp</dimen>
- <dimen name="control_offset_medium">10dip</dimen>
</resources>
diff --git a/samples/Support7Demos/src/main/res/values/strings.xml b/samples/Support7Demos/src/main/res/values/strings.xml
index c9db2ab..e023d85 100644
--- a/samples/Support7Demos/src/main/res/values/strings.xml
+++ b/samples/Support7Demos/src/main/res/values/strings.xml
@@ -65,7 +65,6 @@
<string name="action_bar_mechanics">AppCompat/Action Bar/Action Bar Mechanics</string>
<string name="action_bar_usage">AppCompat/Action Bar/Action Bar Usage</string>
- <string name="action_bar_background_change">AppCompat/Action Bar/Action Bar Background Change</string>
<string name="action_bar_tabs">AppCompat/Action Bar/Action Bar Tabs</string>
<string name="action_bar_settings_action_provider">AppCompat/Action Bar/Settings Action Provider</string>
<string name="action_bar_share_action_provider">AppCompat/Action Bar/ShareActionProvider</string>
@@ -76,7 +75,6 @@
<string name="action_bar_hide_scroll">AppCompat/Action Bar/Hide on Scroll</string>
<string name="appcompat_widgets_buttons">AppCompat/Widgets/Buttons</string>
<string name="appcompat_widgets_spinners">AppCompat/Widgets/Spinners</string>
- <string name="appcompat_widgets_switches">AppCompat/Widgets/Switches</string>
<string name="appcompat_widgets_text_input">AppCompat/Widgets/Text Input</string>
<string name="appcompat_widgets_text_views">AppCompat/Widgets/Text Views</string>
@@ -135,7 +133,6 @@
<string name="toolbar_display_options">AppCompat/Toolbar/Toolbar Display Options</string>
<string name="toolbar_fragment_pager">AppCompat/Toolbar/Toolbar Fragment ViewPager</string>
<string name="toolbar_action_mode">AppCompat/Toolbar/Action Mode</string>
- <string name="toolbar_background_change">AppCompat/Toolbar/Toolbar Background Change</string>
<string name="dialog_usage">AppCompat/Dialog/Dialog Usage</string>
<string name="dialog_title">My great dialog</string>
@@ -217,20 +214,17 @@
<string name="drawer_open">Open navigation drawer</string>
<string name="drawer_close">Close navigation drawer</string>
- <string name="mode_night_follow_system">MODE_NIGHT_FOLLOW_SYSTEM</string>
<string name="mode_night_yes">MODE_NIGHT_YES</string>
<string name="mode_night_no">MODE_NIGHT_NO</string>
- <string name="mode_night_auto_time">MODE_NIGHT_AUTO_TIME</string>
- <string name="mode_night_auto_battery">MODE_NIGHT_AUTO_BATTERY</string>
+ <string name="mode_night_auto">MODE_NIGHT_AUTO</string>
<string name="mode_night_activity_title">AppCompat/DayNight/Activity Usage</string>
<string name="mode_night_dialog_title">AppCompat/DayNight/Dialog Usage</string>
<string name="mode_night_alertdialog_title">AppCompat/DayNight/AlertDialog Usage</string>
<string name="list_popup_window_activity">AppCompat/List popup window</string>
- <string name="list_popup_window_summary">This activity illustrates the use of list popup windows. The popup window is shown by clicking the button above. The checkboxes controls the modality and transition epicenter bounds. The text area below logs various events - it should log a tap on itself when a non-modal popup window is dismissed by tapping on the log area.</string>
+ <string name="list_popup_window_summary">This activity illustrates the use of list popup windows. The popup window is shown by clicking the button above. The checkbox controls the modality. The text area below logs various events - it should log a tap on itself when a non-modal popup window is dismissed by tapping on the log area.</string>
<string name="list_popup_window_button">Show popup!</string>
- <string name="list_popup_window_is_modal">Is modal</string>
- <string name="list_popup_window_use_epicenter">Custom Epicenter</string>
+ <string name="list_popup_window_is_modal">is modal</string>
<string name="popup_menu_activity">AppCompat/Popup menu</string>
<string name="popup_menu_summary">This activity illustrates the use of popup menus. The popup menu is shown by clicking the button above. The text area below logs various events.</string>
diff --git a/samples/SupportCarDemos/src/main/AndroidManifest.xml b/samples/SupportCarDemos/src/main/AndroidManifest.xml
index a994028..2ecca36 100644
--- a/samples/SupportCarDemos/src/main/AndroidManifest.xml
+++ b/samples/SupportCarDemos/src/main/AndroidManifest.xml
@@ -142,17 +142,6 @@
android:value=".SupportCarDemoActivity" />
</activity>
- <activity android:name=".SwitchListItemActivity"
- android:label="SwitchListItem"
- android:parentActivityName=".SupportCarDemoActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.SAMPLE_CODE" />
- </intent-filter>
- <meta-data android:name="android.support.PARENT_ACTIVITY"
- android:value=".SupportCarDemoActivity" />
- </activity>
-
<activity android:name=".CarAlertDialogDemo"
android:label="CarAlertDialogDemo"
android:parentActivityName=".SupportCarDemoActivity">
@@ -196,18 +185,6 @@
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value=".SupportCarDemoActivity" />
</activity>
-
- <activity android:name=".TabLayoutDemoActivity"
- android:label="TabLayoutDemo"
- android:parentActivityName=".SupportCarDemoActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.SAMPLE_CODE" />
- </intent-filter>
- <meta-data android:name="android.support.PARENT_ACTIVITY"
- android:value=".SupportCarDemoActivity" />
- </activity>
-
<activity
android:name=".SpinnerActivity"
android:label="Spinner"
@@ -222,7 +199,6 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".SupportCarDemoActivity"/>
</activity>
-
<activity
android:name=".TextInputDemoActivity"
android:label="Text Input Demo"
@@ -237,7 +213,6 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".SupportCarDemoActivity"/>
</activity>
-
<activity
android:name=".GridLayoutTopBottomOffsetActivity"
android:label="Grid Layout Top/Bottom Offset Demo"
@@ -252,7 +227,6 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".SupportCarDemoActivity"/>
</activity>
-
<activity android:name=".MixedColumnPagedListViewActivity"
android:label="Mixed Column Paged List View"
android:parentActivityName=".SupportCarDemoActivity">
diff --git a/samples/SupportCarDemos/src/main/java/com/example/androidx/car/CarToolbarActivity.java b/samples/SupportCarDemos/src/main/java/com/example/androidx/car/CarToolbarActivity.java
index 7f99c46..6bfef1c 100644
--- a/samples/SupportCarDemos/src/main/java/com/example/androidx/car/CarToolbarActivity.java
+++ b/samples/SupportCarDemos/src/main/java/com/example/androidx/car/CarToolbarActivity.java
@@ -83,8 +83,6 @@
items.add(new CarMenuItem.Builder()
.setTitle("If-Room item")
.setDisplayBehavior(CarMenuItem.DisplayBehavior.IF_ROOM)
- .setIcon(Icon.createWithResource(this,
- android.R.drawable.sym_def_app_icon))
.setOnClickListener(onClickListener)
.build());
carToolbar.setMenuItems(items);
diff --git a/samples/SupportCarDemos/src/main/java/com/example/androidx/car/SwitchListItemActivity.java b/samples/SupportCarDemos/src/main/java/com/example/androidx/car/SwitchListItemActivity.java
deleted file mode 100644
index 7b9a95a..0000000
--- a/samples/SupportCarDemos/src/main/java/com/example/androidx/car/SwitchListItemActivity.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.car;
-
-import android.app.Activity;
-import android.content.Context;
-import android.os.Bundle;
-import android.widget.CompoundButton;
-import android.widget.Toast;
-
-import androidx.car.widget.CarToolbar;
-import androidx.car.widget.ListItem;
-import androidx.car.widget.ListItemAdapter;
-import androidx.car.widget.ListItemProvider;
-import androidx.car.widget.PagedListView;
-import androidx.car.widget.SwitchListItem;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Demo activity for {@link androidx.car.widget.SwitchListItem}.
- */
-public class SwitchListItemActivity extends Activity {
-
- private PagedListView mPagedListView;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_paged_list_view);
-
- CarToolbar toolbar = findViewById(R.id.car_toolbar);
- toolbar.setTitle(R.string.switch_list_item_title);
- toolbar.setNavigationIconOnClickListener(v -> finish());
-
- mPagedListView = findViewById(R.id.paged_list_view);
-
- SampleProvider provider = new SampleProvider(this);
- ListItemAdapter adapter = new ListItemAdapter(this, provider);
-
- mPagedListView.setAdapter(adapter);
- mPagedListView.setMaxPages(PagedListView.UNLIMITED_PAGES);
-
- SwitchListItem item = new SwitchListItem(this);
- item.setTitle("Clicking me to set checked state of item above");
- item.setSwitchOnCheckedChangeListener((buttonView, isChecked) -> {
- int size = adapter.getItemCount();
- // -2 to get second to last item (the one above).
- ((SwitchListItem) provider.mItems.get(size - 2)).setSwitchState(isChecked);
- adapter.notifyDataSetChanged();
- });
- provider.mItems.add(item);
- }
-
- private static class SampleProvider extends ListItemProvider {
- private Context mContext;
-
- private final List<ListItem> mItems = new ArrayList<>();
- private final ListItemProvider.ListProvider mListProvider =
- new ListItemProvider.ListProvider(mItems);
- private final CompoundButton.OnCheckedChangeListener mListener = (button, isChecked) ->
- Toast.makeText(mContext,
- "Switch is " + (isChecked ? "checked" : "unchecked"),
- Toast.LENGTH_SHORT).show();
-
- SampleProvider(Context context) {
- mContext = context;
-
- String longText = mContext.getString(R.string.long_text);
-
- SwitchListItem item;
-
- item = new SwitchListItem(mContext);
- item.setTitle("Title - show divider");
- item.setShowSwitchDivider(true);
- item.setSwitchOnCheckedChangeListener(mListener);
- mItems.add(item);
-
- item = new SwitchListItem(mContext);
- item.setBody("Body text");
- item.setSwitchOnCheckedChangeListener(mListener);
- mItems.add(item);
-
- item = new SwitchListItem(mContext);
- item.setTitle("Long body text");
- item.setBody(longText);
- item.setSwitchOnCheckedChangeListener(mListener);
- mItems.add(item);
-
- item = new SwitchListItem(mContext);
- item.setTitle("Clicking item toggles switch");
- item.setClickable(true);
- item.setSwitchOnCheckedChangeListener(mListener);
- mItems.add(item);
-
- item = new SwitchListItem(mContext);
- item.setTitle("Disabled item");
- item.setEnabled(false);
- item.setSwitchOnCheckedChangeListener(mListener);
- mItems.add(item);
- }
-
- @Override
- public ListItem get(int position) {
- return mListProvider.get(position);
- }
-
- @Override
- public int size() {
- return mListProvider.size();
- }
- }
-}
-
diff --git a/samples/SupportCarDemos/src/main/java/com/example/androidx/car/TabLayoutDemoActivity.java b/samples/SupportCarDemos/src/main/java/com/example/androidx/car/TabLayoutDemoActivity.java
deleted file mode 100644
index 353f183..0000000
--- a/samples/SupportCarDemos/src/main/java/com/example/androidx/car/TabLayoutDemoActivity.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.car;
-
-import android.os.Bundle;
-
-import androidx.appcompat.app.AppCompatActivity;
-
-import com.google.android.material.tabs.TabLayout;
-
-/**
- * Demo activity for themes and custom views on a {@link TabLayout}.
- */
-public class TabLayoutDemoActivity extends AppCompatActivity {
- private TabLayout mTabLayout;
-
- private boolean mShowText = true;
- private boolean mShowIcon = true;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.tab_bar_view_activity);
-
- mTabLayout = findViewById(R.id.tab_layout);
-
- findViewById(R.id.tab_align_start).setOnClickListener(
- v -> mTabLayout.setTabMode(TabLayout.MODE_SCROLLABLE));
-
- findViewById(R.id.tab_align_center).setOnClickListener(
- v -> mTabLayout.setTabMode(TabLayout.MODE_FIXED));
-
- findViewById(R.id.add_tab).setOnClickListener(v -> addTab());
- findViewById(R.id.remove_tab).setOnClickListener(v -> removeTab());
-
- findViewById(R.id.tab_text_and_icon).setOnClickListener(v -> {
- mShowText = true;
- mShowIcon = true;
- refreshTabs();
- });
-
- findViewById(R.id.tab_text_only).setOnClickListener(v -> {
- mShowText = true;
- mShowIcon = false;
- refreshTabs();
- });
-
- findViewById(R.id.tab_icon_only).setOnClickListener(v -> {
- mShowText = false;
- mShowIcon = true;
- refreshTabs();
- });
- }
-
- private void addTab() {
- int tabCount = mTabLayout.getTabCount();
-
- TabLayout.Tab tab = mTabLayout.newTab()
- .setCustomView(R.layout.car_tab_view);
-
- if (mShowIcon) {
- tab.setIcon(R.drawable.ic_home);
- }
-
- if (mShowText) {
- tab.setText("Tab " + tabCount);
- }
-
- mTabLayout.addTab(tab);
- }
-
- private void removeTab() {
- int tabCount = mTabLayout.getTabCount();
-
- if (tabCount > 0) {
- mTabLayout.removeTabAt(tabCount - 1);
- }
- }
-
- private void refreshTabs() {
- int tabCount = mTabLayout.getTabCount();
- mTabLayout.removeAllTabs();
-
- for (int i = 0; i < tabCount; i++) {
- addTab();
- }
- }
-}
diff --git a/samples/SupportCarDemos/src/main/res/drawable/ic_home.xml b/samples/SupportCarDemos/src/main/res/drawable/ic_home.xml
deleted file mode 100644
index 74a04f7..0000000
--- a/samples/SupportCarDemos/src/main/res/drawable/ic_home.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 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.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="48dp"
- android:height="48dp"
- android:viewportWidth="48.0"
- android:viewportHeight="48.0">
- <path
- android:pathData="M20,40V28h8v12h10V24h6L24,6 4,24h6v16z"
- android:fillColor="#000000"/>
-</vector>
diff --git a/samples/SupportCarDemos/src/main/res/layout/tab_bar_view_activity.xml b/samples/SupportCarDemos/src/main/res/layout/tab_bar_view_activity.xml
deleted file mode 100644
index c6cb3c3..0000000
--- a/samples/SupportCarDemos/src/main/res/layout/tab_bar_view_activity.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2019 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, softwareb
- ~ 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.
- -->
-<androidx.constraintlayout.widget.ConstraintLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:background="@android:color/black"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <com.google.android.material.tabs.TabLayout
- android:id="@+id/tab_layout"
- android:background="@android:color/black"
- android:layout_width="match_parent"
- android:layout_height="@dimen/car_app_bar_height"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toEndOf="parent" >
-
- <com.google.android.material.tabs.TabItem
- android:icon="@drawable/ic_home"
- android:text="Tab 0"
- android:layout="@layout/car_tab_view" />
- <com.google.android.material.tabs.TabItem
- android:icon="@drawable/ic_home"
- android:text="Tab 1"
- android:layout="@layout/car_tab_view" />
- <com.google.android.material.tabs.TabItem
- android:icon="@drawable/ic_home"
- android:text="Tab 2"
- android:layout="@layout/car_tab_view" />
- <com.google.android.material.tabs.TabItem
- android:icon="@drawable/ic_home"
- android:text="Tab 3"
- android:layout="@layout/car_tab_view" />
- </com.google.android.material.tabs.TabLayout>
-
- <Button
- android:id="@+id/tab_align_start"
- android:text="@string/button_tab_align_start"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/tab_align_center"
- app:layout_constraintHorizontal_chainStyle="packed" />
- <Button
- android:id="@+id/tab_align_center"
- android:text="@string/button_tab_align_center"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/car_padding_4"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@+id/tab_align_start"
- app:layout_constraintEnd_toStartOf="@+id/add_tab" />
- <Button
- android:id="@+id/add_tab"
- android:text="@string/button_add_tab"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/car_padding_4"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@+id/tab_align_center"
- app:layout_constraintEnd_toStartOf="@+id/remove_tab" />
- <Button
- android:id="@+id/remove_tab"
- android:text="@string/button_remove_tab"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/car_padding_4"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@+id/add_tab"
- app:layout_constraintEnd_toEndOf="parent" />
-
- <androidx.constraintlayout.widget.Guideline
- android:id="@+id/guideline"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- app:layout_constraintGuide_percent="0.7" />
-
- <Button
- android:id="@+id/tab_text_and_icon"
- android:text="@string/button_tab_text_and_icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/car_padding_4"
- app:layout_constraintTop_toTopOf="@+id/guideline"
- app:layout_constraintBottom_toBottomOf="@+id/guideline"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/tab_text_only"
- app:layout_constraintHorizontal_chainStyle="packed" />
- <Button
- android:id="@+id/tab_text_only"
- android:text="@string/button_tab_text_only"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/car_padding_4"
- app:layout_constraintTop_toTopOf="@+id/guideline"
- app:layout_constraintBottom_toBottomOf="@+id/guideline"
- app:layout_constraintStart_toEndOf="@+id/tab_text_and_icon"
- app:layout_constraintEnd_toStartOf="@+id/tab_icon_only" />
- <Button
- android:id="@+id/tab_icon_only"
- android:text="@string/button_tab_icon_only"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="@dimen/car_padding_4"
- app:layout_constraintTop_toTopOf="@+id/guideline"
- app:layout_constraintBottom_toBottomOf="@+id/guideline"
- app:layout_constraintStart_toEndOf="@+id/tab_text_only"
- app:layout_constraintEnd_toEndOf="parent" />
-
-</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/samples/SupportCarDemos/src/main/res/values/strings.xml b/samples/SupportCarDemos/src/main/res/values/strings.xml
index c2ab6f1..3383aaf8 100644
--- a/samples/SupportCarDemos/src/main/res/values/strings.xml
+++ b/samples/SupportCarDemos/src/main/res/values/strings.xml
@@ -22,7 +22,6 @@
<string name="paged_list_view_shrink_title">PagedListViewShrinkDemo</string>
<string name="text_list_item_title">TextListItem</string>
<string name="seekbar_list_item_title">SeekbarListItem</string>
- <string name="switch_list_item_title">SwitchListItem</string>
<string name="sub_header_list_item_title">SubheaderListItem</string>
<string name="alpha_jump_title">Alpha Jump Demo</string>
@@ -150,14 +149,5 @@
<string name="show_nothing">Show nothing</string>
<string name="show_buttons">Only show buttons</string>
<string name="show_everything">Show everything</string>
-
- <!-- Strings for TabBarViewActivity Demo. -->
- <string name="button_tab_align_start">Align start</string>
- <string name="button_tab_align_center">Align center</string>
- <string name="button_add_tab">Add tab</string>
- <string name="button_remove_tab">Remove tab</string>
- <string name="button_tab_text_and_icon">Text + Icon</string>
- <string name="button_tab_text_only">Text only</string>
- <string name="button_tab_icon_only">Icon only</string>
</resources>
diff --git a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/MediaSessionService.java b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/MediaSessionService.java
index 59697dd..80e388a 100644
--- a/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/MediaSessionService.java
+++ b/samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/MediaSessionService.java
@@ -16,7 +16,6 @@
package com.example.android.leanback;
-import android.annotation.SuppressLint;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
@@ -409,7 +408,6 @@
* @param mp Object of MediaPlayer。
*/
@Override
- @SuppressLint("NewApi")
public void onCompletion(MediaPlayer mp) {
// When current media item finishes playing, always reset rewind/ fastforward state
@@ -675,7 +673,6 @@
}
// Control the player to play the music item.
- @SuppressLint("NewApi")
private void play() {
// Only when player is not null (meaning the player has been created), the player is
// prepared (using the mInitialized as the flag to represent it,
@@ -748,7 +745,6 @@
* Also no matter current media item is fast forwarding or rewinding. Next music item will
* be played in normal speed.
*/
- @SuppressLint("NewApi")
private void next() {
if (mMediaItemList.isEmpty()) {
return;
@@ -782,7 +778,6 @@
* Also no matter current media item is fast forwarding or rewinding. Previous music item will
* be played in normal speed.
*/
- @SuppressLint("NewApi")
private void previous() {
if (mMediaItemList.isEmpty()) {
return;
@@ -814,7 +809,6 @@
}
// Play media item in a fast forward speed.
- @SuppressLint("NewApi")
private void fastForward() {
// To support fast forward action, the mRewindSpeedFactors must be provided through
// setFastForwardSpeedFactors() method;
@@ -911,7 +905,6 @@
// called.
// If we are in rewind mode, this function will compute the new position through rewinding
// speed and compare the start/ end rewinding time stamp.
- @SuppressLint("NewApi")
private void resetSpeedAndPlay() {
if (mIsRewindBegin) {
diff --git a/samples/SupportMediaDemos/src/main/res/layout/activity_video_player.xml b/samples/SupportMediaDemos/src/main/res/layout/activity_video_player.xml
index b05c0ef..82928d3 100644
--- a/samples/SupportMediaDemos/src/main/res/layout/activity_video_player.xml
+++ b/samples/SupportMediaDemos/src/main/res/layout/activity_video_player.xml
@@ -20,14 +20,12 @@
android:id="@+id/video_player_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layoutDirection="ltr"
android:keepScreenOn="true"
android:background="#3F51B5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layoutDirection="locale"
android:orientation="horizontal">
<CheckBox
@@ -55,7 +53,6 @@
android:layout_height="300dp"
android:layout_marginLeft="40dp"
android:layout_marginTop="40dp"
- android:layoutDirection="locale"
android:background="#000000"
widget:enableControlView="false"
widget:viewType="textureView"
diff --git a/samples/SupportPreferenceDemos/src/main/res/values/strings.xml b/samples/SupportPreferenceDemos/src/main/res/values/strings.xml
index 7fbc88e..de19c77 100644
--- a/samples/SupportPreferenceDemos/src/main/res/values/strings.xml
+++ b/samples/SupportPreferenceDemos/src/main/res/values/strings.xml
@@ -51,6 +51,7 @@
<string name="title_dropdown_preference">Dropdown preference</string>
<string name="title_seekbar_preference">Seekbar preference</string>
+ <string name="summary_seekbar_preference">This seekbar has a default value of 5 and a max value of 10</string>
<!--This section is for preferences that launch a dialog to edit the preference -->
<string name="dialogs">Dialogs</string>
diff --git a/samples/SupportPreferenceDemos/src/main/res/xml/preferences.xml b/samples/SupportPreferenceDemos/src/main/res/xml/preferences.xml
index 11e9737..0a5676b 100644
--- a/samples/SupportPreferenceDemos/src/main/res/xml/preferences.xml
+++ b/samples/SupportPreferenceDemos/src/main/res/xml/preferences.xml
@@ -70,6 +70,7 @@
<SeekBarPreference
android:key="seekbar"
android:title="@string/title_seekbar_preference"
+ android:summary="@string/summary_seekbar_preference"
android:max="10"
android:defaultValue="5"/>
</PreferenceCategory>
diff --git a/samples/SupportSliceDemos/src/main/java/com/example/androidx/slice/demos/SliceSelectionDialog.java b/samples/SupportSliceDemos/src/main/java/com/example/androidx/slice/demos/SliceSelectionDialog.java
index b2d7ce3..b955a11 100644
--- a/samples/SupportSliceDemos/src/main/java/com/example/androidx/slice/demos/SliceSelectionDialog.java
+++ b/samples/SupportSliceDemos/src/main/java/com/example/androidx/slice/demos/SliceSelectionDialog.java
@@ -20,7 +20,6 @@
import static android.app.slice.Slice.HINT_TITLE;
import static android.app.slice.SliceItem.FORMAT_TEXT;
-import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.app.slice.SliceProvider;
import android.content.ComponentName;
@@ -230,7 +229,6 @@
return String.valueOf(findTitle(context, content, SliceMetadata.from(context, content)));
}
- @SuppressLint("RestrictedApi")
protected static CharSequence findTitle(Context context, Slice loadedSlice,
SliceMetadata metaData) {
ListContent content = new ListContent(loadedSlice);
diff --git a/samples/SupportTransitionDemos/src/main/res/layout/red_square.xml b/samples/SupportTransitionDemos/src/main/res/layout/red_square.xml
index 1e05338..550b2c6 100644
--- a/samples/SupportTransitionDemos/src/main/res/layout/red_square.xml
+++ b/samples/SupportTransitionDemos/src/main/res/layout/red_square.xml
@@ -20,5 +20,4 @@
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_gravity="center"
- android:background="#f00"
- android:elevation="16dp"/>
+ android:background="#f00"/>
diff --git a/viewpager2/integration-tests/testapp/OWNERS b/samples/ViewPager2Demos/OWNERS
similarity index 100%
rename from viewpager2/integration-tests/testapp/OWNERS
rename to samples/ViewPager2Demos/OWNERS
diff --git a/samples/ViewPager2Demos/build.gradle b/samples/ViewPager2Demos/build.gradle
new file mode 100644
index 0000000..7b7b07c
--- /dev/null
+++ b/samples/ViewPager2Demos/build.gradle
@@ -0,0 +1,33 @@
+import static androidx.build.dependencies.DependenciesKt.KOTLIN_STDLIB
+import static androidx.build.dependencies.DependenciesKt.SUPPORT_DESIGN
+
+/*
+ * Copyright (C) 2017 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.
+ */
+
+plugins {
+ id("AndroidXPlugin")
+ id("com.android.application")
+ id("org.jetbrains.kotlin.android")
+ id('kotlin-android-extensions')
+}
+
+dependencies {
+ api(KOTLIN_STDLIB)
+ implementation(project(":viewpager2"))
+ implementation(project(":lifecycle:lifecycle-extensions"))
+ implementation(SUPPORT_DESIGN, libs.exclude_for_material)
+ implementation(project(":cardview"))
+}
diff --git a/samples/ViewPager2Demos/src/main/AndroidManifest.xml b/samples/ViewPager2Demos/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..60a06c2
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/AndroidManifest.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 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
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.androidx.viewpager2">
+
+ <application
+ android:icon="@drawable/app_sample_code"
+ android:label="@string/activity_sample_code"
+ android:supportsRtl="true"
+ android:theme="@style/Theme.AppCompat.Light">
+
+ <activity android:name=".CardViewActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.SAMPLE_CODE"/>
+ </intent-filter>
+ </activity>
+
+ <activity android:name=".CardFragmentActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.SAMPLE_CODE"/>
+ </intent-filter>
+ </activity>
+
+ <activity android:name=".MutableCollectionFragmentActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.SAMPLE_CODE"/>
+ </intent-filter>
+ </activity>
+
+ <activity android:name=".MutableCollectionViewActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.SAMPLE_CODE"/>
+ </intent-filter>
+ </activity>
+
+ <activity android:name=".CardViewTabLayoutActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.SAMPLE_CODE"/>
+ </intent-filter>
+ </activity>
+
+ <activity android:name=".BrowseActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
diff --git a/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/BaseCardActivity.kt b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/BaseCardActivity.kt
new file mode 100644
index 0000000..0c01905
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/BaseCardActivity.kt
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 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 com.example.androidx.viewpager2
+
+import android.os.Bundle
+import android.view.View
+import android.widget.AdapterView
+import android.widget.ArrayAdapter
+import android.widget.Button
+import android.widget.CheckBox
+import android.widget.Spinner
+import android.widget.SpinnerAdapter
+import androidx.fragment.app.FragmentActivity
+import androidx.viewpager2.widget.ViewPager2
+import androidx.viewpager2.widget.ViewPager2.ORIENTATION_HORIZONTAL
+import androidx.viewpager2.widget.ViewPager2.ORIENTATION_VERTICAL
+import com.example.androidx.viewpager2.cards.Card
+
+/**
+ * Base class for the two activities in the demo. Sets up the list of cards and implements UI to
+ * jump to arbitrary cards using setCurrentItem, either with or without smooth scrolling.
+ */
+abstract class BaseCardActivity : FragmentActivity() {
+
+ lateinit var viewPager: ViewPager2
+ private lateinit var cardSelector: Spinner
+ private lateinit var smoothScrollCheckBox: CheckBox
+ private lateinit var rotateCheckBox: CheckBox
+ private lateinit var translateCheckBox: CheckBox
+ private lateinit var scaleCheckBox: CheckBox
+ private lateinit var gotoPage: Button
+ private lateinit var orientationSelector: Spinner
+ private var orientation: Int = ORIENTATION_HORIZONTAL
+
+ private val translateX get() = orientation == ORIENTATION_VERTICAL &&
+ translateCheckBox.isChecked
+ private val translateY get() = orientation == ORIENTATION_HORIZONTAL &&
+ translateCheckBox.isChecked
+
+ protected open val layoutId: Int = R.layout.activity_no_tablayout
+
+ private val mAnimator = ViewPager2.PageTransformer { page, position ->
+ val absPos = Math.abs(position)
+ page.apply {
+ rotation = if (rotateCheckBox.isChecked) position * 360 else 0f
+ translationY = if (translateY) absPos * 500f else 0f
+ translationX = if (translateX) absPos * 350f else 0f
+ if (scaleCheckBox.isChecked) {
+ val scale = if (absPos > 1) 0F else 1 - absPos
+ scaleX = scale
+ scaleY = scale
+ } else {
+ scaleX = 1f
+ scaleY = 1f
+ }
+ }
+ }
+
+ public override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(layoutId)
+
+ viewPager = findViewById(R.id.view_pager)
+ orientationSelector = findViewById(R.id.orientation_spinner)
+ cardSelector = findViewById(R.id.card_spinner)
+ smoothScrollCheckBox = findViewById(R.id.smooth_scroll_checkbox)
+ rotateCheckBox = findViewById(R.id.rotate_checkbox)
+ translateCheckBox = findViewById(R.id.translate_checkbox)
+ scaleCheckBox = findViewById(R.id.scale_checkbox)
+ gotoPage = findViewById(R.id.jump_button)
+
+ orientationSelector.adapter = createOrientationAdapter()
+ cardSelector.adapter = createCardAdapter()
+
+ viewPager.setPageTransformer(mAnimator)
+
+ orientationSelector.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
+ override fun onItemSelected(
+ parent: AdapterView<*>,
+ view: View?,
+ position: Int,
+ id: Long
+ ) {
+ when (parent.selectedItem.toString()) {
+ HORIZONTAL -> orientation = ORIENTATION_HORIZONTAL
+ VERTICAL -> orientation = ORIENTATION_VERTICAL
+ }
+ viewPager.orientation = orientation
+ }
+
+ override fun onNothingSelected(adapterView: AdapterView<*>) {}
+ }
+
+ gotoPage.setOnClickListener {
+ val card = cardSelector.selectedItemPosition
+ val smoothScroll = smoothScrollCheckBox.isChecked
+ viewPager.setCurrentItem(card, smoothScroll)
+ }
+ }
+
+ private fun createAdapter(values: Set<String>): SpinnerAdapter {
+ val adapter = ArrayAdapter(
+ this, android.R.layout.simple_spinner_item, values.toTypedArray())
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
+ return adapter
+ }
+
+ private fun createCardAdapter(): SpinnerAdapter {
+ val adapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, Card.DECK)
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
+ return adapter
+ }
+
+ private fun createOrientationAdapter(): SpinnerAdapter {
+ val adapter = ArrayAdapter(this,
+ android.R.layout.simple_spinner_item, arrayOf(HORIZONTAL, VERTICAL))
+ adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
+ return adapter
+ }
+
+ companion object {
+ val cards = Card.DECK
+ private const val HORIZONTAL = "horizontal"
+ private const val VERTICAL = "vertical"
+ }
+}
diff --git a/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/BrowseActivity.kt b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/BrowseActivity.kt
new file mode 100644
index 0000000..4cd4877
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/BrowseActivity.kt
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2017 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 com.example.androidx.viewpager2
+
+import android.app.ListActivity
+import android.content.Intent
+import android.os.Bundle
+import android.view.View
+import android.widget.ListView
+import android.widget.SimpleAdapter
+
+/**
+ * This activity lists all the activities in this application.
+ */
+class BrowseActivity : ListActivity() {
+
+ public override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ listAdapter = SimpleAdapter(this, getData(),
+ android.R.layout.simple_list_item_1, arrayOf("title"),
+ intArrayOf(android.R.id.text1))
+ }
+
+ private fun getData(): List<Map<String, Any>> {
+ val myData = mutableListOf<Map<String, Any>>()
+
+ myData.add(mapOf("title" to "ViewPager2 with Views",
+ "intent" to activityToIntent(CardViewActivity::class.java.name)))
+ myData.add(mapOf("title" to "ViewPager2 with Fragments",
+ "intent" to activityToIntent(CardFragmentActivity::class.java.name)))
+ myData.add(mapOf("title" to "ViewPager2 with a Mutable Collection (Views)",
+ "intent" to activityToIntent(MutableCollectionViewActivity::class.java.name)))
+ myData.add(mapOf("title" to "ViewPager2 with a Mutable Collection (Fragments)",
+ "intent" to activityToIntent(MutableCollectionFragmentActivity::class.java.name)))
+ myData.add(mapOf("title" to "ViewPager2 with a TabLayout (Views)",
+ "intent" to activityToIntent(CardViewTabLayoutActivity::class.java.name)))
+
+ return myData
+ }
+
+ private fun activityToIntent(activity: String): Intent =
+ Intent(Intent.ACTION_VIEW).setClassName(this.packageName, activity)
+
+ override fun onListItemClick(listView: ListView, view: View, position: Int, id: Long) {
+ val map = listView.getItemAtPosition(position) as Map<String, Any>
+
+ val intent = Intent(map["intent"] as Intent)
+ intent.addCategory(Intent.CATEGORY_SAMPLE_CODE)
+ startActivity(intent)
+ }
+}
diff --git a/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/CardFragmentActivity.kt b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/CardFragmentActivity.kt
new file mode 100644
index 0000000..d60186b
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/CardFragmentActivity.kt
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 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 com.example.androidx.viewpager2
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+import androidx.viewpager2.adapter.FragmentStateAdapter
+
+import com.example.androidx.viewpager2.cards.Card
+import com.example.androidx.viewpager2.cards.CardView
+
+/**
+ * Shows how to use a [androidx.viewpager2.widget.ViewPager2] with Fragments, via a
+ * [androidx.viewpager2.adapter.FragmentStateAdapter]
+ *
+ * @see CardViewActivity for an example of using {@link androidx.viewpager2.widget.ViewPager2} with
+ * Views.
+ */
+class CardFragmentActivity : BaseCardActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ viewPager.adapter = object : FragmentStateAdapter(supportFragmentManager) {
+ override fun getItem(position: Int): Fragment {
+ return CardFragment.create(cards[position])
+ }
+
+ override fun getItemCount(): Int {
+ return cards.size
+ }
+ }
+ }
+
+ class CardFragment : Fragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ val cardView = CardView(layoutInflater, container!!)
+ cardView.bind(Card.fromBundle(arguments!!))
+ return cardView.view
+ }
+
+ companion object {
+
+ /** Creates a Fragment for a given [Card] */
+ fun create(card: Card): CardFragment {
+ val fragment = CardFragment()
+ fragment.arguments = card.toBundle()
+ return fragment
+ }
+ }
+ }
+}
diff --git a/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/CardViewActivity.kt b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/CardViewActivity.kt
new file mode 100644
index 0000000..48ec76f
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/CardViewActivity.kt
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2017 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 com.example.androidx.viewpager2
+
+import android.os.Bundle
+import android.view.ViewGroup
+import androidx.recyclerview.widget.RecyclerView
+import androidx.viewpager2.widget.ViewPager2
+
+import com.example.androidx.viewpager2.cards.Card
+import com.example.androidx.viewpager2.cards.CardView
+
+/**
+ * Shows how to use [ViewPager2.setAdapter] with Views.
+ *
+ * @see CardFragmentActivity for an example of using {@link ViewPager2} with Fragments.
+ */
+open class CardViewActivity : BaseCardActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ viewPager.adapter = object : RecyclerView.Adapter<CardViewHolder>() {
+ override fun onCreateViewHolder(
+ parent: ViewGroup,
+ viewType: Int
+ ): CardViewHolder {
+ return CardViewHolder(CardView(layoutInflater, parent))
+ }
+
+ override fun onBindViewHolder(holder: CardViewHolder, position: Int) {
+ holder.bind(cards[position])
+ }
+
+ override fun getItemCount(): Int {
+ return cards.size
+ }
+ }
+ }
+
+ class CardViewHolder internal constructor(
+ private val cardView: CardView
+ ) : RecyclerView.ViewHolder(cardView.view) {
+
+ internal fun bind(card: Card) {
+ cardView.bind(card)
+ }
+ }
+}
diff --git a/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/CardViewTabLayoutActivity.kt b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/CardViewTabLayoutActivity.kt
new file mode 100644
index 0000000..f73af1d
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/CardViewTabLayoutActivity.kt
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2019 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 com.example.androidx.viewpager2
+
+import android.os.Bundle
+import com.google.android.material.tabs.TabLayout
+
+class CardViewTabLayoutActivity : CardViewActivity() {
+
+ private lateinit var tabLayout: TabLayout
+
+ override val layoutId: Int = R.layout.activity_tablayout
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ tabLayout = findViewById(R.id.tabs)
+ TabLayoutMediator(tabLayout, viewPager) { tab, position ->
+ tab.text = cards[position].toString()
+ }.attach()
+ }
+}
\ No newline at end of file
diff --git a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/MutableCollectionBaseActivity.kt b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/MutableCollectionBaseActivity.kt
similarity index 100%
rename from viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/MutableCollectionBaseActivity.kt
rename to samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/MutableCollectionBaseActivity.kt
diff --git a/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/MutableCollectionFragmentActivity.kt b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/MutableCollectionFragmentActivity.kt
new file mode 100644
index 0000000..16fe50a
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/MutableCollectionFragmentActivity.kt
@@ -0,0 +1,105 @@
+/*
+ * 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 com.example.androidx.viewpager2
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.Button
+import android.widget.TextView
+import androidx.fragment.app.Fragment
+import androidx.recyclerview.widget.RecyclerView
+import androidx.viewpager2.adapter.FragmentStateAdapter
+import androidx.viewpager2.widget.ViewPager2
+
+private const val KEY_ITEM_TEXT = "com.example.androidx.viewpager2.KEY_ITEM_TEXT"
+private const val KEY_CLICK_COUNT = "com.example.androidx.viewpager2.KEY_CLICK_COUNT"
+
+/**
+ * Shows how to use [FragmentStateAdapter.notifyDataSetChanged] with [ViewPager2]. Here [ViewPager2]
+ * represents pages as [Fragment]s.
+ */
+class MutableCollectionFragmentActivity : MutableCollectionBaseActivity() {
+ override fun createViewPagerAdapter(): RecyclerView.Adapter<*> {
+ val items = items // avoids resolving the ViewModel multiple times
+ return object : FragmentStateAdapter(supportFragmentManager) {
+ override fun getItem(position: Int): PageFragment {
+ val itemId = items.itemId(position)
+ val itemText = items.getItemById(itemId)
+ return PageFragment.create(itemText)
+ }
+ override fun getItemCount(): Int = items.size
+ override fun getItemId(position: Int): Long = items.itemId(position)
+ override fun containsItem(itemId: Long): Boolean = items.contains(itemId)
+ }
+ }
+}
+
+class PageFragment : Fragment() {
+ private lateinit var textViewItemText: TextView
+ private lateinit var textViewCount: TextView
+ private lateinit var buttonCountIncrease: Button
+
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ val view = inflater.inflate(R.layout.item_mutable_collection, container, false)
+
+ textViewItemText = view.findViewById(R.id.textViewItemText)
+ textViewCount = view.findViewById(R.id.textViewCount)
+ buttonCountIncrease = view.findViewById(R.id.buttonCountIncrease)
+
+ textViewItemText.text = arguments?.getString(KEY_ITEM_TEXT) ?: throw IllegalStateException()
+
+ fun updateCountText(count: Int) {
+ textViewCount.text = "$count"
+ }
+ updateCountText(savedInstanceState?.getInt(KEY_CLICK_COUNT) ?: 0)
+
+ buttonCountIncrease.setOnClickListener {
+ updateCountText(clickCount() + 1)
+ }
+
+ return view
+ }
+
+ /**
+ * [FragmentStateAdapter] minimizes the number of [Fragment]s kept in memory by saving state of
+ [Fragment]s that are no longer near the viewport. Here we demonstrate this behavior by relying
+ on it to persist click counts through configuration changes (rotation) and data-set changes
+ (when items are added or removed).
+ */
+ override fun onSaveInstanceState(outState: Bundle) {
+ outState.putInt(KEY_CLICK_COUNT, clickCount())
+ }
+
+ private fun clickCount(): Int {
+ return "${textViewCount.text}".toInt()
+ }
+
+ companion object {
+ fun create(itemText: String) =
+ PageFragment().apply {
+ arguments = Bundle(1).apply {
+ putString(KEY_ITEM_TEXT, itemText)
+ }
+ }
+ }
+}
diff --git a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/MutableCollectionViewActivity.kt b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/MutableCollectionViewActivity.kt
similarity index 100%
rename from viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/MutableCollectionViewActivity.kt
rename to samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/MutableCollectionViewActivity.kt
diff --git a/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/TabLayoutMediator.java b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/TabLayoutMediator.java
new file mode 100644
index 0000000..9632a9b
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/TabLayoutMediator.java
@@ -0,0 +1,365 @@
+/*
+ * Copyright 2019 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 com.example.androidx.viewpager2;
+
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+import static androidx.viewpager2.widget.ViewPager2.SCROLL_STATE_DRAGGING;
+import static androidx.viewpager2.widget.ViewPager2.SCROLL_STATE_IDLE;
+import static androidx.viewpager2.widget.ViewPager2.SCROLL_STATE_SETTLING;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RestrictTo;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.viewpager2.widget.ViewPager2;
+
+import com.google.android.material.tabs.TabLayout;
+
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Method;
+
+/**
+ * A mediator to link a TabLayout with a ViewPager2. The mediator will synchronize the ViewPager2's
+ * position with the selected tab when a tab is selected, and the TabLayout's scroll position when
+ * the user drags the ViewPager2.
+ *
+ * Establish the link by creating an instance of this class, make sure the ViewPager2 has an adapter
+ * and then call {@link #attach()} on it. When creating an instance of this class, you must supply
+ * an implementation of {@link OnConfigureTabCallback} in which you set the text of the tab, and/or
+ * perform any styling of the tabs that you require.
+ *
+ * @hide
+ */
+@RestrictTo(LIBRARY_GROUP)
+public final class TabLayoutMediator {
+ private final @NonNull TabLayout mTabLayout;
+ private final @NonNull ViewPager2 mViewPager;
+ private final boolean mAutoRefresh;
+ private final OnConfigureTabCallback mOnConfigureTabCallback;
+ private RecyclerView.Adapter mAdapter;
+ private boolean mAttached;
+
+ private TabLayoutOnPageChangeCallback mOnPageChangeCallback;
+ private TabLayout.OnTabSelectedListener mOnTabSelectedListener;
+ private RecyclerView.AdapterDataObserver mPagerAdapterObserver;
+
+ /**
+ * A callback interface that must be implemented to set the text and styling of newly created
+ * tabs.
+ */
+ public interface OnConfigureTabCallback {
+ /**
+ * Called to configure the tab for the page at the specified position. Typically calls
+ * {@link TabLayout.Tab#setText(CharSequence)}, but any form of styling can be applied.
+ *
+ * @param tab The Tab which should be configured to represent the title of the item at the
+ * given position in the data set.
+ * @param position The position of the item within the adapter's data set.
+ */
+ void onConfigureTab(@NonNull TabLayout.Tab tab, int position);
+ }
+
+ /**
+ * Creates a TabLayoutMediator to synchronize a TabLayout and a ViewPager2 together. It will
+ * update the tabs automatically when the data set of the view pager's adapter changes. The link
+ * will be established after {@link #attach()} is called.
+ *
+ * @param tabLayout The tab bar to link
+ * @param viewPager The view pager to link
+ */
+ public TabLayoutMediator(@NonNull TabLayout tabLayout, @NonNull ViewPager2 viewPager,
+ @NonNull OnConfigureTabCallback onConfigureTabCallback) {
+ this(tabLayout, viewPager, true, onConfigureTabCallback);
+ }
+
+ /**
+ * Creates a TabLayoutMediator to synchronize a TabLayout and a ViewPager2 together. If {@code
+ * autoRefresh} is true, it will update the tabs automatically when the data set of the view
+ * pager's adapter changes. The link will be established after {@link #attach()} is called.
+ *
+ * @param tabLayout The tab bar to link
+ * @param viewPager The view pager to link
+ * @param autoRefresh If {@code true}, will recreate all tabs when the data set of the view
+ * pager's adapter changes.
+ */
+ public TabLayoutMediator(@NonNull TabLayout tabLayout, @NonNull ViewPager2 viewPager,
+ boolean autoRefresh, @NonNull OnConfigureTabCallback onConfigureTabCallback) {
+ mTabLayout = tabLayout;
+ mViewPager = viewPager;
+ mAutoRefresh = autoRefresh;
+ mOnConfigureTabCallback = onConfigureTabCallback;
+ }
+
+ /**
+ * Link the TabLayout and the ViewPager2 together.
+ * @throws IllegalStateException If the mediator is already attached, or the ViewPager2 has no
+ * adapter.
+ */
+ public void attach() {
+ if (mAttached) {
+ throw new IllegalStateException("TabLayoutMediator is already attached");
+ }
+ mAdapter = mViewPager.getAdapter();
+ if (mAdapter == null) {
+ throw new IllegalStateException("TabLayoutMediator attached before ViewPager2 has an "
+ + "adapter");
+ }
+ mAttached = true;
+
+ // Add our custom OnPageChangeCallback to the ViewPager
+ mOnPageChangeCallback = new TabLayoutOnPageChangeCallback(mTabLayout);
+ mViewPager.registerOnPageChangeCallback(mOnPageChangeCallback);
+
+ // Now we'll add a tab selected listener to set ViewPager's current item
+ mOnTabSelectedListener = new ViewPagerOnTabSelectedListener(mViewPager);
+ mTabLayout.addOnTabSelectedListener(mOnTabSelectedListener);
+
+ // Now we'll populate ourselves from the pager adapter, adding an observer if
+ // autoRefresh is enabled
+ if (mAutoRefresh) {
+ // Register our observer on the new adapter
+ mPagerAdapterObserver = new PagerAdapterObserver();
+ mAdapter.registerAdapterDataObserver(mPagerAdapterObserver);
+ }
+
+ populateTabsFromPagerAdapter();
+
+ // Now update the scroll position to match the ViewPager's current item
+ mTabLayout.setScrollPosition(mViewPager.getCurrentItem(), 0f, true);
+ }
+
+ /**
+ * Unlink the TabLayout and the ViewPager
+ */
+ public void detach() {
+ mAdapter.unregisterAdapterDataObserver(mPagerAdapterObserver);
+ mTabLayout.removeOnTabSelectedListener(mOnTabSelectedListener);
+ mViewPager.unregisterOnPageChangeCallback(mOnPageChangeCallback);
+ mPagerAdapterObserver = null;
+ mOnTabSelectedListener = null;
+ mOnPageChangeCallback = null;
+ }
+
+ @SuppressWarnings("WeakerAccess")
+ void populateTabsFromPagerAdapter() {
+ mTabLayout.removeAllTabs();
+
+ if (mAdapter != null) {
+ int adapterCount = mAdapter.getItemCount();
+ for (int i = 0; i < adapterCount; i++) {
+ TabLayout.Tab tab = mTabLayout.newTab();
+ mOnConfigureTabCallback.onConfigureTab(tab, i);
+ mTabLayout.addTab(tab, false);
+ }
+
+ // Make sure we reflect the currently set ViewPager item
+ if (adapterCount > 0) {
+ int currItem = mViewPager.getCurrentItem();
+ if (currItem != mTabLayout.getSelectedTabPosition()) {
+ mTabLayout.getTabAt(currItem).select();
+ }
+ }
+ }
+ }
+
+ /**
+ * A {@link ViewPager2.OnPageChangeCallback} class which contains the necessary calls back to
+ * the provided {@link TabLayout} so that the tab position is kept in sync.
+ *
+ * <p>This class stores the provided TabLayout weakly, meaning that you can use {@link
+ * ViewPager2#registerOnPageChangeCallback(ViewPager2.OnPageChangeCallback)} without removing
+ * the callback and not cause a leak.
+ */
+ private static class TabLayoutOnPageChangeCallback extends ViewPager2.OnPageChangeCallback {
+ private final WeakReference<TabLayout> mTabLayoutRef;
+ private int mPreviousScrollState;
+ private int mScrollState;
+
+ TabLayoutOnPageChangeCallback(TabLayout tabLayout) {
+ mTabLayoutRef = new WeakReference<>(tabLayout);
+ reset();
+ }
+
+ @Override
+ public void onPageScrollStateChanged(final int state) {
+ mPreviousScrollState = mScrollState;
+ mScrollState = state;
+ }
+
+ @Override
+ public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+ TabLayout tabLayout = mTabLayoutRef.get();
+ if (tabLayout != null) {
+ // Only update the text selection if we're not settling, or we are settling after
+ // being dragged
+ boolean updateText = mScrollState != SCROLL_STATE_SETTLING
+ || mPreviousScrollState == SCROLL_STATE_DRAGGING;
+ // Update the indicator if we're not settling after being idle. This is caused
+ // from a setCurrentItem() call and will be handled by an animation from
+ // onPageSelected() instead.
+ boolean updateIndicator = !(mScrollState == SCROLL_STATE_SETTLING
+ && mPreviousScrollState == SCROLL_STATE_IDLE);
+ setScrollPosition(tabLayout, position, positionOffset, updateText, updateIndicator);
+ }
+ }
+
+ @Override
+ public void onPageSelected(final int position) {
+ TabLayout tabLayout = mTabLayoutRef.get();
+ if (tabLayout != null
+ && tabLayout.getSelectedTabPosition() != position
+ && position < tabLayout.getTabCount()) {
+ // Select the tab, only updating the indicator if we're not being dragged/settled
+ // (since onPageScrolled will handle that).
+ boolean updateIndicator = mScrollState == SCROLL_STATE_IDLE
+ || (mScrollState == SCROLL_STATE_SETTLING
+ && mPreviousScrollState == SCROLL_STATE_IDLE);
+ selectTab(tabLayout, tabLayout.getTabAt(position), updateIndicator);
+ }
+ }
+
+ void reset() {
+ mPreviousScrollState = mScrollState = SCROLL_STATE_IDLE;
+ }
+ }
+
+ // region Reflective calls
+
+ // Temporarily call methods TabLayout.setScrollPosition(int, float, boolean, boolean) and
+ // TabLayout.selectTab(TabLayout.Tab, boolean) through reflection, until they have been made
+ // public in the Material Design Components library.
+
+ private static Method sSetScrollPosition;
+ private static Method sSelectTab;
+ private static final String SET_SCROLL_POSITION_NAME = "TabLayout.setScrollPosition(int, float,"
+ + " boolean, boolean)";
+ private static final String SELECT_TAB_NAME = "TabLayout.selectTab(TabLayout.Tab, boolean)";
+
+ static {
+ try {
+ sSetScrollPosition = TabLayout.class.getDeclaredMethod("setScrollPosition", int.class,
+ float.class, boolean.class, boolean.class);
+ sSetScrollPosition.setAccessible(true);
+
+ sSelectTab = TabLayout.class.getDeclaredMethod("selectTab", TabLayout.Tab.class,
+ boolean.class);
+ sSelectTab.setAccessible(true);
+ } catch (NoSuchMethodException e) {
+ throw new IllegalStateException("Can't reflect into method TabLayout"
+ + ".setScrollPosition(int, float, boolean, boolean)");
+ }
+ }
+
+ @SuppressWarnings("WeakerAccess")
+ static void setScrollPosition(TabLayout tabLayout, int position, float positionOffset,
+ boolean updateSelectedText, boolean updateIndicatorPosition) {
+ try {
+ if (sSetScrollPosition != null) {
+ sSetScrollPosition.invoke(tabLayout, position, positionOffset, updateSelectedText,
+ updateIndicatorPosition);
+ } else {
+ throwMethodNotFound(SET_SCROLL_POSITION_NAME);
+ }
+ } catch (Exception e) {
+ throwInvokeFailed(SET_SCROLL_POSITION_NAME);
+ }
+ }
+
+ @SuppressWarnings("WeakerAccess")
+ static void selectTab(TabLayout tabLayout, TabLayout.Tab tab, boolean updateIndicator) {
+ try {
+ if (sSelectTab != null) {
+ sSelectTab.invoke(tabLayout, tab, updateIndicator);
+ } else {
+ throwMethodNotFound(SELECT_TAB_NAME);
+ }
+ } catch (Exception e) {
+ throwInvokeFailed(SELECT_TAB_NAME);
+ }
+ }
+
+ private static void throwMethodNotFound(String method) {
+ throw new IllegalStateException("Method " + method + " not found");
+ }
+
+ private static void throwInvokeFailed(String method) {
+ throw new IllegalStateException("Couldn't invoke method " + method);
+ }
+
+ // endregion
+
+ /**
+ * A {@link TabLayout.OnTabSelectedListener} class which contains the necessary calls back to
+ * the provided {@link ViewPager2} so that the tab position is kept in sync.
+ */
+ private static class ViewPagerOnTabSelectedListener implements TabLayout.OnTabSelectedListener {
+ private final ViewPager2 mViewPager;
+
+ ViewPagerOnTabSelectedListener(ViewPager2 viewPager) {
+ this.mViewPager = viewPager;
+ }
+
+ @Override
+ public void onTabSelected(TabLayout.Tab tab) {
+ mViewPager.setCurrentItem(tab.getPosition(), true);
+ }
+
+ @Override
+ public void onTabUnselected(TabLayout.Tab tab) {
+ // No-op
+ }
+
+ @Override
+ public void onTabReselected(TabLayout.Tab tab) {
+ // No-op
+ }
+ }
+
+ private class PagerAdapterObserver extends RecyclerView.AdapterDataObserver {
+ PagerAdapterObserver() {}
+
+ @Override
+ public void onChanged() {
+ populateTabsFromPagerAdapter();
+ }
+
+ @Override
+ public void onItemRangeChanged(int positionStart, int itemCount) {
+ populateTabsFromPagerAdapter();
+ }
+
+ @Override
+ public void onItemRangeChanged(int positionStart, int itemCount, @Nullable Object payload) {
+ populateTabsFromPagerAdapter();
+ }
+
+ @Override
+ public void onItemRangeInserted(int positionStart, int itemCount) {
+ populateTabsFromPagerAdapter();
+ }
+
+ @Override
+ public void onItemRangeRemoved(int positionStart, int itemCount) {
+ populateTabsFromPagerAdapter();
+ }
+
+ @Override
+ public void onItemRangeMoved(int fromPosition, int toPosition, int itemCount) {
+ populateTabsFromPagerAdapter();
+ }
+ }
+}
diff --git a/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/cards/Card.kt b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/cards/Card.kt
new file mode 100644
index 0000000..f305fca
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/cards/Card.kt
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2017 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 com.example.androidx.viewpager2.cards
+
+import android.os.Bundle
+
+/**
+ * Playing card
+ */
+class Card private constructor(val suit: String, val value: String) {
+
+ val cornerLabel: String
+ get() = value + "\n" + suit
+
+ /** Use in conjunction with [Card.fromBundle] */
+ fun toBundle(): Bundle {
+ val args = Bundle(1)
+ args.putStringArray(ARGS_BUNDLE, arrayOf(suit, value))
+ return args
+ }
+
+ override fun toString(): String {
+ return "$value $suit"
+ }
+
+ companion object {
+ private val ARGS_BUNDLE = Card::class.java.name + ":Bundle"
+
+ val SUITS = setOf("♣" /* clubs*/, "♦" /* diamonds*/, "♥" /* hearts*/, "♠" /*spades*/)
+ val VALUES = setOf("2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A")
+ val DECK = SUITS.flatMap { suit ->
+ VALUES.map { value -> Card(suit, value) }
+ }
+
+ /** Use in conjunction with [Card.toBundle] */
+ fun fromBundle(bundle: Bundle): Card {
+ val spec = bundle.getStringArray(ARGS_BUNDLE)
+ return Card(spec[0], spec[1])
+ }
+ }
+}
diff --git a/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/cards/CardView.kt b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/cards/CardView.kt
new file mode 100644
index 0000000..cce007b
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/java/com/example/androidx/viewpager2/cards/CardView.kt
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 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 com.example.androidx.viewpager2.cards
+
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+
+import androidx.annotation.ColorRes
+
+import com.example.androidx.viewpager2.R
+
+/** Inflates and populates a [View] representing a [Card] */
+class CardView(layoutInflater: LayoutInflater, container: ViewGroup) {
+ val view: View = layoutInflater.inflate(R.layout.item_card_layout, container, false)
+ private val textSuite: TextView
+ private val textCorner1: TextView
+ private val textCorner2: TextView
+
+ init {
+ textSuite = view.findViewById(R.id.label_center)
+ textCorner1 = view.findViewById(R.id.label_top)
+ textCorner2 = view.findViewById(R.id.label_bottom)
+ }
+
+ /**
+ * Updates the view to represent the passed in card
+ */
+ fun bind(card: Card) {
+ textSuite.text = card.suit
+ view.setBackgroundResource(getColorRes(card))
+
+ val cornerLabel = card.cornerLabel
+ textCorner1.text = cornerLabel
+ textCorner2.text = cornerLabel
+ }
+
+ @ColorRes
+ private fun getColorRes(card: Card): Int {
+ val shade = getShade(card)
+ val color = getColor(card)
+ return COLOR_MAP[color][shade]
+ }
+
+ private fun getShade(card: Card): Int {
+ when (card.value) {
+ "2", "6", "10", "A" -> return 2
+ "3", "7", "J" -> return 3
+ "4", "8", "Q" -> return 0
+ "5", "9", "K" -> return 1
+ }
+ throw IllegalStateException("Card value cannot be $card.value")
+ }
+
+ private fun getColor(card: Card): Int {
+ when (card.suit) {
+ "♣" -> return 0
+ "♦" -> return 1
+ "♥" -> return 2
+ "♠" -> return 3
+ }
+ throw IllegalStateException("Card suit cannot be $card.suit")
+ }
+
+ companion object {
+ private val COLOR_MAP = arrayOf(
+ intArrayOf(R.color.red_100, R.color.red_300, R.color.red_500, R.color.red_700),
+ intArrayOf(R.color.blue_100, R.color.blue_300, R.color.blue_500, R.color.blue_700),
+ intArrayOf(R.color.green_100, R.color.green_300, R.color.green_500,
+ R.color.green_700),
+ intArrayOf(R.color.yellow_100, R.color.yellow_300, R.color.yellow_500,
+ R.color.yellow_700))
+ }
+}
diff --git a/viewpager2/integration-tests/testapp/src/main/res/drawable-hdpi/app_sample_code.png b/samples/ViewPager2Demos/src/main/res/drawable-hdpi/app_sample_code.png
similarity index 100%
rename from viewpager2/integration-tests/testapp/src/main/res/drawable-hdpi/app_sample_code.png
rename to samples/ViewPager2Demos/src/main/res/drawable-hdpi/app_sample_code.png
Binary files differ
diff --git a/viewpager2/integration-tests/testapp/src/main/res/drawable-mdpi/app_sample_code.png b/samples/ViewPager2Demos/src/main/res/drawable-mdpi/app_sample_code.png
similarity index 100%
rename from viewpager2/integration-tests/testapp/src/main/res/drawable-mdpi/app_sample_code.png
rename to samples/ViewPager2Demos/src/main/res/drawable-mdpi/app_sample_code.png
Binary files differ
diff --git a/samples/ViewPager2Demos/src/main/res/layout-land/activity_no_tablayout.xml b/samples/ViewPager2Demos/src/main/res/layout-land/activity_no_tablayout.xml
new file mode 100644
index 0000000..eea27aa
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/res/layout-land/activity_no_tablayout.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ tools:background="#FFFFFF">
+
+ <include layout="@layout/controls" />
+
+ <androidx.viewpager2.widget.ViewPager2
+ android:id="@+id/view_pager"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1" />
+
+</LinearLayout>
diff --git a/samples/ViewPager2Demos/src/main/res/layout-land/activity_tablayout.xml b/samples/ViewPager2Demos/src/main/res/layout-land/activity_tablayout.xml
new file mode 100644
index 0000000..e88df70
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/res/layout-land/activity_tablayout.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ tools:background="#FFFFFF">
+
+ <include layout="@layout/controls" />
+
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:orientation="vertical">
+
+ <com.google.android.material.tabs.TabLayout
+ android:id="@+id/tabs"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:tabMode="scrollable" />
+
+ <androidx.viewpager2.widget.ViewPager2
+ android:id="@+id/view_pager"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/samples/ViewPager2Demos/src/main/res/layout-land/controls.xml b/samples/ViewPager2Demos/src/main/res/layout-land/controls.xml
new file mode 100644
index 0000000..adc976f
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/res/layout-land/controls.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_margin="16dp"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical|start"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/label_orientation"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ <Spinner
+ android:id="@+id/orientation_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical|start"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/label_jump_to"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ <Spinner
+ android:id="@+id/card_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginLeft="8dp" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical|start"
+ android:orientation="horizontal">
+
+ <CheckBox
+ android:id="@+id/smooth_scroll_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/checkbox_smoothscroll"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ <Button
+ android:id="@+id/jump_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginLeft="8dp"
+ android:text="@string/label_jump"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ </LinearLayout>
+
+ <CheckBox
+ android:id="@+id/rotate_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/checkbox_rotate"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ <CheckBox
+ android:id="@+id/translate_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/checkbox_translate"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ <CheckBox
+ android:id="@+id/scale_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/checkbox_scale"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ </LinearLayout>
+
+ <View
+ android:layout_width="1dp"
+ android:layout_height="match_parent"
+ android:background="#000000" />
+
+</merge>
\ No newline at end of file
diff --git a/samples/ViewPager2Demos/src/main/res/layout/activity_mutable_collection.xml b/samples/ViewPager2Demos/src/main/res/layout/activity_mutable_collection.xml
new file mode 100644
index 0000000..5169047
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/res/layout/activity_mutable_collection.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ tools:background="#FFFF">
+
+ <androidx.viewpager2.widget.ViewPager2
+ android:id="@+id/viewPager"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1"/>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="?android:attr/listDivider"/>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_margin="5dp">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_margin="5dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Item:"/>
+
+ <Spinner
+ android:id="@+id/itemSpinner"
+ android:layout_margin="5dp"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:gravity="center">
+
+ <Button
+ android:id="@+id/buttonGoTo"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_margin="5dp"
+ android:text="Go to item"/>
+
+ <Button
+ android:id="@+id/buttonRemove"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_margin="5dp"
+ android:text="Remove item"/>
+
+ <Button
+ android:id="@+id/buttonAddBefore"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_margin="5dp"
+ android:text="Add new before"/>
+
+ <Button
+ android:id="@+id/buttonAddAfter"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_margin="5dp"
+ android:text="Add new after"/>
+ </LinearLayout>
+ </LinearLayout>
+</LinearLayout>
diff --git a/samples/ViewPager2Demos/src/main/res/layout/activity_no_tablayout.xml b/samples/ViewPager2Demos/src/main/res/layout/activity_no_tablayout.xml
new file mode 100644
index 0000000..4f2a646
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/res/layout/activity_no_tablayout.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ tools:background="#FFFFFF">
+
+ <include layout="@layout/controls" />
+
+ <androidx.viewpager2.widget.ViewPager2
+ android:id="@+id/view_pager"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+</LinearLayout>
diff --git a/samples/ViewPager2Demos/src/main/res/layout/activity_tablayout.xml b/samples/ViewPager2Demos/src/main/res/layout/activity_tablayout.xml
new file mode 100644
index 0000000..30120bd
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/res/layout/activity_tablayout.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ tools:background="#FFFFFF">
+
+ <include layout="@layout/controls" />
+
+ <com.google.android.material.tabs.TabLayout
+ android:id="@+id/tabs"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:tabMode="scrollable" />
+
+ <androidx.viewpager2.widget.ViewPager2
+ android:id="@+id/view_pager"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+</LinearLayout>
diff --git a/samples/ViewPager2Demos/src/main/res/layout/controls.xml b/samples/ViewPager2Demos/src/main/res/layout/controls.xml
new file mode 100644
index 0000000..b4bc4a8
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/res/layout/controls.xml
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ 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.
+ -->
+
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="16dp"
+ android:layout_marginTop="16dp"
+ android:layout_marginRight="16dp"
+ android:gravity="center_vertical|start"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/label_orientation"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ <Spinner
+ android:id="@+id/orientation_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:gravity="center_vertical|start"
+ android:orientation="horizontal">
+
+ <!--<TextView-->
+ <!--android:layout_width="wrap_content"-->
+ <!--android:layout_height="wrap_content"-->
+ <!--android:text="@string/label_jump_to"-->
+ <!--android:textAppearance="@android:style/TextAppearance.Medium" />-->
+
+ <Button
+ android:id="@+id/jump_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginLeft="8dp"
+ android:text="@string/label_jump_to"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ <Spinner
+ android:id="@+id/card_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginLeft="8dp" />
+
+ <CheckBox
+ android:id="@+id/smooth_scroll_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginLeft="8dp"
+ android:text="@string/checkbox_smoothscroll"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:layout_marginBottom="8dp"
+ android:gravity="center_vertical|start"
+ android:orientation="horizontal">
+
+ <CheckBox
+ android:id="@+id/rotate_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/checkbox_rotate"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ <CheckBox
+ android:id="@+id/translate_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginLeft="8dp"
+ android:text="@string/checkbox_translate"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ <CheckBox
+ android:id="@+id/scale_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="8dp"
+ android:layout_marginLeft="8dp"
+ android:text="@string/checkbox_scale"
+ android:textAppearance="@android:style/TextAppearance.Medium" />
+
+ </LinearLayout>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:background="#000000" />
+
+</merge>
\ No newline at end of file
diff --git a/samples/ViewPager2Demos/src/main/res/layout/item_card_layout.xml b/samples/ViewPager2Demos/src/main/res/layout/item_card_layout.xml
new file mode 100644
index 0000000..b179929a
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/res/layout/item_card_layout.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 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.
+-->
+
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:background="#FEFEFE"
+ android:padding="16dp">
+
+ <TextView
+ android:id="@+id/label_top"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top|start"
+ android:gravity="center"
+ android:textAppearance="@android:style/TextAppearance.Large"
+ tools:text="A"/>
+
+ <TextView
+ android:id="@+id/label_center"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:textAppearance="@android:style/TextAppearance.Large"
+ tools:text="♠"/>
+
+ <TextView
+ android:id="@+id/label_bottom"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom|end"
+ android:gravity="center"
+ android:textAppearance="@android:style/TextAppearance.Large"
+ android:rotation="180"
+ tools:text="A"/>
+</FrameLayout>
diff --git a/samples/ViewPager2Demos/src/main/res/layout/item_mutable_collection.xml b/samples/ViewPager2Demos/src/main/res/layout/item_mutable_collection.xml
new file mode 100644
index 0000000..60484f6
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/res/layout/item_mutable_collection.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center_vertical|start"
+ android:orientation="vertical"
+ tools:background="#F0FF">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:gravity="center"
+ android:background="#5F00"
+ android:layout_margin="20dp">
+
+ <TextView
+ android:layout_margin="5dp"
+ android:text="Id:"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+ <TextView
+ android:layout_margin="5dp"
+ android:id="@+id/textViewItemText"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:background="#50F0"
+ android:gravity="center"
+ android:layout_margin="20dp">
+
+ <TextView
+ android:layout_margin="5dp"
+ android:text="Count:"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"/>
+
+ <TextView
+ android:layout_margin="5dp"
+ android:id="@+id/textViewCount"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"/>
+ </LinearLayout>
+
+ <Button
+ android:id="@+id/buttonCountIncrease"
+ android:layout_margin="20dp"
+ android:layout_width="wrap_content"
+ android:text="Count++"
+ android:background="#500F"
+ android:layout_height="wrap_content"/>
+</LinearLayout>
diff --git a/samples/ViewPager2Demos/src/main/res/values/colors.xml b/samples/ViewPager2Demos/src/main/res/values/colors.xml
new file mode 100644
index 0000000..ce7d96d
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/res/values/colors.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 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.
+-->
+
+<resources>
+ <color name="red_100">#F4C7C3</color>
+ <color name="red_300">#E67C73</color>
+ <color name="red_500">#DB4437</color>
+ <color name="red_700">#C53929</color>
+ <color name="blue_100">#C6DAFC</color>
+ <color name="blue_300">#7BAAF7</color>
+ <color name="blue_500">#4285F4</color>
+ <color name="blue_700">#3367D6</color>
+ <color name="green_100">#B7E1CD</color>
+ <color name="green_300">#57BB8A</color>
+ <color name="green_500">#0F9D58</color>
+ <color name="green_700">#0B8043</color>
+ <color name="yellow_100">#FCE8B2</color>
+ <color name="yellow_300">#F7CB4D</color>
+ <color name="yellow_500">#F4B400</color>
+ <color name="yellow_700">#F09300</color>
+</resources>
\ No newline at end of file
diff --git a/samples/ViewPager2Demos/src/main/res/values/strings.xml b/samples/ViewPager2Demos/src/main/res/values/strings.xml
new file mode 100644
index 0000000..de3f1a3
--- /dev/null
+++ b/samples/ViewPager2Demos/src/main/res/values/strings.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 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.
+-->
+
+<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
+ <string name="activity_sample_code">ViewPager2 Demos</string>
+ <string name="label_orientation">Orientation:</string>
+ <string name="label_jump_to">Jump to:</string>
+ <string name="label_jump">Jump</string>
+ <string name="checkbox_smoothscroll">Smooth</string>
+ <string name="checkbox_rotate">Rotate</string>
+ <string name="checkbox_translate">Translate</string>
+ <string name="checkbox_scale">Scale</string>
+</resources>
diff --git a/savedstate/api/1.0.0-alpha01.txt b/savedstate/api/1.0.0-alpha01.txt
deleted file mode 100644
index e509849..0000000
--- a/savedstate/api/1.0.0-alpha01.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-// Signature format: 3.0
-package androidx.savedstate {
-
- public final class SavedStateRegistry {
- method @MainThread public android.os.Bundle? consumeRestoredStateForKey(String);
- method @MainThread public boolean isRestored();
- method @MainThread public void registerSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider);
- method @MainThread public void unregisterSavedStateProvider(String);
- }
-
- public static interface SavedStateRegistry.SavedStateProvider {
- method public android.os.Bundle saveState();
- }
-
- public final class SavedStateRegistryController {
- ctor public SavedStateRegistryController();
- method public androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
- method @MainThread public void performRestore(android.os.Bundle?);
- method @MainThread public void performSave(android.os.Bundle);
- }
-
- public interface SavedStateRegistryOwner {
- method public androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
- }
-
-}
-
diff --git a/savedstate/api/1.0.0-alpha02.txt b/savedstate/api/1.0.0-alpha02.txt
deleted file mode 100644
index ff8482b..0000000
--- a/savedstate/api/1.0.0-alpha02.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-// Signature format: 3.0
-package androidx.savedstate {
-
- public final class SavedStateRegistry {
- method @MainThread public android.os.Bundle? consumeRestoredStateForKey(String);
- method @MainThread public boolean isRestored();
- method @MainThread public void registerSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider);
- method @MainThread public void runOnNextRecreation(Class<? extends androidx.savedstate.SavedStateRegistry.AutoRecreated>);
- method @MainThread public void unregisterSavedStateProvider(String);
- }
-
- public static interface SavedStateRegistry.AutoRecreated {
- method public void onRecreated(androidx.savedstate.SavedStateRegistryOwner);
- }
-
- public static interface SavedStateRegistry.SavedStateProvider {
- method public android.os.Bundle saveState();
- }
-
- public final class SavedStateRegistryController {
- method public static androidx.savedstate.SavedStateRegistryController create(androidx.savedstate.SavedStateRegistryOwner);
- method public androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
- method @MainThread public void performRestore(android.os.Bundle?);
- method @MainThread public void performSave(android.os.Bundle);
- }
-
- public interface SavedStateRegistryOwner extends androidx.lifecycle.LifecycleOwner {
- method public androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
- }
-
-}
-
diff --git a/savedstate/api/current.txt b/savedstate/api/current.txt
deleted file mode 100644
index ff8482b..0000000
--- a/savedstate/api/current.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-// Signature format: 3.0
-package androidx.savedstate {
-
- public final class SavedStateRegistry {
- method @MainThread public android.os.Bundle? consumeRestoredStateForKey(String);
- method @MainThread public boolean isRestored();
- method @MainThread public void registerSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider);
- method @MainThread public void runOnNextRecreation(Class<? extends androidx.savedstate.SavedStateRegistry.AutoRecreated>);
- method @MainThread public void unregisterSavedStateProvider(String);
- }
-
- public static interface SavedStateRegistry.AutoRecreated {
- method public void onRecreated(androidx.savedstate.SavedStateRegistryOwner);
- }
-
- public static interface SavedStateRegistry.SavedStateProvider {
- method public android.os.Bundle saveState();
- }
-
- public final class SavedStateRegistryController {
- method public static androidx.savedstate.SavedStateRegistryController create(androidx.savedstate.SavedStateRegistryOwner);
- method public androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
- method @MainThread public void performRestore(android.os.Bundle?);
- method @MainThread public void performSave(android.os.Bundle);
- }
-
- public interface SavedStateRegistryOwner extends androidx.lifecycle.LifecycleOwner {
- method public androidx.savedstate.SavedStateRegistry getSavedStateRegistry();
- }
-
-}
-
diff --git a/savedstate/api/res-1.0.0-alpha02.txt b/savedstate/api/res-1.0.0-alpha02.txt
deleted file mode 100644
index e69de29..0000000
--- a/savedstate/api/res-1.0.0-alpha02.txt
+++ /dev/null
diff --git a/savedstate/api/restricted_1.0.0-alpha01.txt b/savedstate/api/restricted_1.0.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/savedstate/api/restricted_1.0.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/savedstate/api/restricted_1.0.0-alpha02.txt b/savedstate/api/restricted_1.0.0-alpha02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/savedstate/api/restricted_1.0.0-alpha02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/savedstate/api/restricted_current.txt b/savedstate/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/savedstate/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/savedstate/build.gradle b/savedstate/build.gradle
deleted file mode 100644
index 1f73a3d..0000000
--- a/savedstate/build.gradle
+++ /dev/null
@@ -1,39 +0,0 @@
-import static androidx.build.dependencies.DependenciesKt.*
-import androidx.build.LibraryGroups
-import androidx.build.LibraryVersions
-
-plugins {
- id("SupportAndroidLibraryPlugin")
- id("kotlin-android")
-}
-
-android {
- lintOptions {
- fatal("UnknownNullness")
- }
- buildTypes.all {
- consumerProguardFiles("proguard-rules.pro")
- }
-}
-
-dependencies {
- api("androidx.annotation:annotation:1.0.0")
- implementation(ARCH_CORE_COMMON)
- implementation(ARCH_LIFECYCLE_COMMON, libs.exclude_annotations_transitive)
- androidTestImplementation(KOTLIN_STDLIB)
- androidTestImplementation(ARCH_LIFECYCLE_RUNTIME, libs.exclude_annotations_transitive)
- androidTestImplementation(TEST_EXT_JUNIT)
- androidTestImplementation(TEST_CORE)
- androidTestImplementation(TEST_RUNNER)
- androidTestImplementation(TEST_RULES)
- androidTestImplementation(TRUTH)
-}
-
-supportLibrary {
- name = "Activity"
- publish = true
- mavenVersion = LibraryVersions.SAVEDSTATE
- mavenGroup = LibraryGroups.SAVEDSTATE
- inceptionYear = "2018"
- description = "Provides the base Activity subclass and the relevant hooks to build a composable structure on top."
-}
diff --git a/savedstate/bundle/api/1.0.0-alpha01.txt b/savedstate/bundle/api/1.0.0-alpha01.txt
new file mode 100644
index 0000000..44e2567
--- /dev/null
+++ b/savedstate/bundle/api/1.0.0-alpha01.txt
@@ -0,0 +1,15 @@
+// Signature format: 2.0
+package androidx.savedstate.bundle {
+
+ public final class BundleSavedStateRegistry extends androidx.savedstate.AbstractSavedStateRegistry<android.os.Bundle> {
+ ctor public BundleSavedStateRegistry();
+ method @MainThread public void performRestore(android.os.Bundle?);
+ method @MainThread public void performSave(android.os.Bundle);
+ }
+
+ public interface BundleSavedStateRegistryOwner {
+ method public androidx.savedstate.SavedStateRegistry<android.os.Bundle> getBundleSavedStateRegistry();
+ }
+
+}
+
diff --git a/savedstate/bundle/api/current.txt b/savedstate/bundle/api/current.txt
new file mode 100644
index 0000000..44e2567
--- /dev/null
+++ b/savedstate/bundle/api/current.txt
@@ -0,0 +1,15 @@
+// Signature format: 2.0
+package androidx.savedstate.bundle {
+
+ public final class BundleSavedStateRegistry extends androidx.savedstate.AbstractSavedStateRegistry<android.os.Bundle> {
+ ctor public BundleSavedStateRegistry();
+ method @MainThread public void performRestore(android.os.Bundle?);
+ method @MainThread public void performSave(android.os.Bundle);
+ }
+
+ public interface BundleSavedStateRegistryOwner {
+ method public androidx.savedstate.SavedStateRegistry<android.os.Bundle> getBundleSavedStateRegistry();
+ }
+
+}
+
diff --git a/savedstate/api/res-1.0.0-alpha01.txt b/savedstate/bundle/api/res-1.0.0-alpha01.txt
similarity index 100%
rename from savedstate/api/res-1.0.0-alpha01.txt
rename to savedstate/bundle/api/res-1.0.0-alpha01.txt
diff --git a/savedstate/bundle/build.gradle b/savedstate/bundle/build.gradle
new file mode 100644
index 0000000..6963997
--- /dev/null
+++ b/savedstate/bundle/build.gradle
@@ -0,0 +1,35 @@
+import static androidx.build.dependencies.DependenciesKt.*
+import androidx.build.LibraryGroups
+import androidx.build.LibraryVersions
+
+plugins {
+ id("SupportAndroidLibraryPlugin")
+ id("kotlin-android")
+}
+
+android {
+ lintOptions {
+ fatal("UnknownNullness")
+ }
+}
+
+dependencies {
+ api("androidx.annotation:annotation:1.0.0")
+ api(project(":savedstate:savedstate-common"))
+
+ androidTestImplementation(KOTLIN_STDLIB)
+ androidTestImplementation(TEST_EXT_JUNIT)
+ androidTestImplementation(TEST_CORE)
+ androidTestImplementation(TEST_RUNNER)
+ androidTestImplementation(TEST_RULES)
+ androidTestImplementation(TRUTH)
+}
+
+supportLibrary {
+ name = "Activity"
+ publish = true
+ mavenVersion = LibraryVersions.SAVEDSTATE
+ mavenGroup = LibraryGroups.SAVEDSTATE
+ inceptionYear = "2018"
+ description = "Provides the base Activity subclass and the relevant hooks to build a composable structure on top."
+}
diff --git a/savedstate/bundle/src/androidTest/AndroidManifest.xml b/savedstate/bundle/src/androidTest/AndroidManifest.xml
new file mode 100644
index 0000000..c28734c
--- /dev/null
+++ b/savedstate/bundle/src/androidTest/AndroidManifest.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="androidx.savedstate.bundle">
+ <uses-sdk android:targetSdkVersion="${target-sdk-version}"/>
+
+ <application>
+ </application>
+
+</manifest>
diff --git a/savedstate/bundle/src/androidTest/java/androidx/savedstate/bundle/BundlableSavedStateRegistryTest.kt b/savedstate/bundle/src/androidTest/java/androidx/savedstate/bundle/BundlableSavedStateRegistryTest.kt
new file mode 100644
index 0000000..3b0b903
--- /dev/null
+++ b/savedstate/bundle/src/androidTest/java/androidx/savedstate/bundle/BundlableSavedStateRegistryTest.kt
@@ -0,0 +1,70 @@
+/*
+ * 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.savedstate.bundle
+
+import android.os.Bundle
+import androidx.test.filters.SmallTest
+import org.hamcrest.CoreMatchers.`is`
+import org.hamcrest.MatcherAssert.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@SmallTest
+@RunWith(JUnit4::class)
+class BundlableSavedStateRegistryTest {
+
+ @Test
+ fun saveRestoreFlow() {
+ val registry = BundleSavedStateRegistry()
+ registry.registerSavedStateProvider("a") { bundleOf("foo", 1) }
+ registry.registerSavedStateProvider("b") { bundleOf("foo", 2) }
+ val state = Bundle()
+ registry.performSave(state)
+
+ val newRegistry = BundleSavedStateRegistry()
+ newRegistry.performRestore(state)
+
+ assertThat(newRegistry.isRestored, `is`(true))
+ val bundleForA = newRegistry.consumeRestoredStateForKey("a")
+ val bundleForB = newRegistry.consumeRestoredStateForKey("b")
+
+ assertThat(bundleForA.isSame(bundleOf("foo", 1)), `is`(true))
+ assertThat(bundleForB.isSame(bundleOf("foo", 2)), `is`(true))
+ }
+}
+
+private fun bundleOf(key: String, value: Int): Bundle {
+ val result = Bundle()
+ result.putInt(key, value)
+ return result
+}
+
+private fun Bundle?.isSame(other: Bundle): Boolean {
+ if (this == null) {
+ return false
+ }
+ if (keySet() != other.keySet()) {
+ return false
+ }
+ for (key in keySet()) {
+ if (get(key) != other.get(key)) {
+ return false
+ }
+ }
+ return true
+}
\ No newline at end of file
diff --git a/savedstate/bundle/src/main/AndroidManifest.xml b/savedstate/bundle/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..f52ae56
--- /dev/null
+++ b/savedstate/bundle/src/main/AndroidManifest.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<manifest package="androidx.savedstate.bundle">
+</manifest>
diff --git a/savedstate/bundle/src/main/java/androidx/savedstate/bundle/BundleSavedStateRegistry.java b/savedstate/bundle/src/main/java/androidx/savedstate/bundle/BundleSavedStateRegistry.java
new file mode 100644
index 0000000..0c1d1e2
--- /dev/null
+++ b/savedstate/bundle/src/main/java/androidx/savedstate/bundle/BundleSavedStateRegistry.java
@@ -0,0 +1,80 @@
+/*
+ * 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.savedstate.bundle;
+
+import android.os.Bundle;
+
+import androidx.annotation.MainThread;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.savedstate.AbstractSavedStateRegistry;
+import androidx.savedstate.SavedStateRegistry;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * A default implementation of {@link SavedStateRegistry} backed by {@link Bundle}.
+ * <p>
+ * An owner of this {@link BundleSavedStateRegistry} must call {@link #performRestore(Bundle)}
+ * once previously saved state becomes available to it.
+ * <p>
+ * To collect saved state supplied by {@link SavedStateRegistry.SavedStateProvider}
+ * an owner should call {@link #performSave(Bundle)}
+ */
+public final class BundleSavedStateRegistry extends AbstractSavedStateRegistry<Bundle> {
+ private static final String SAVED_COMPONENTS_KEY =
+ "androidx.lifecycle.BundlableSavedStateRegistry.key";
+
+ /**
+ * An interface for an owner of this @{code {@link SavedStateRegistry} to restore saved state.
+ *
+ * @param savedState restored state
+ */
+ @SuppressWarnings("WeakerAccess")
+ @MainThread
+ public void performRestore(@Nullable Bundle savedState) {
+ Bundle componentsState = savedState != null ? savedState.getBundle(SAVED_COMPONENTS_KEY)
+ : null;
+ if (componentsState == null || componentsState.isEmpty()) {
+ restoreSavedState(null);
+ return;
+ }
+ Map<String, Bundle> initialState = new HashMap<>();
+ for (String key : componentsState.keySet()) {
+ initialState.put(key, componentsState.getBundle(key));
+ }
+ restoreSavedState(initialState);
+ }
+
+ /**
+ * An interface for an owner of this @{code {@link SavedStateRegistry}
+ * to perform state saving, it will call all registered providers and
+ * merge with unconsumed state.
+ *
+ * @param outBundle Bundle in which to place a saved state
+ */
+ @MainThread
+ public void performSave(@NonNull Bundle outBundle) {
+ Map<String, Bundle> bundleMap = saveState();
+ Bundle components = new Bundle();
+ for (Map.Entry<String, Bundle> entry : bundleMap.entrySet()) {
+ components.putBundle(entry.getKey(), entry.getValue());
+ }
+ outBundle.putBundle(SAVED_COMPONENTS_KEY, components);
+ }
+}
diff --git a/savedstate/bundle/src/main/java/androidx/savedstate/bundle/BundleSavedStateRegistryOwner.java b/savedstate/bundle/src/main/java/androidx/savedstate/bundle/BundleSavedStateRegistryOwner.java
new file mode 100644
index 0000000..5b6abdf
--- /dev/null
+++ b/savedstate/bundle/src/main/java/androidx/savedstate/bundle/BundleSavedStateRegistryOwner.java
@@ -0,0 +1,36 @@
+/*
+ * 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.savedstate.bundle;
+
+
+import android.os.Bundle;
+
+import androidx.annotation.NonNull;
+import androidx.savedstate.SavedStateRegistry;
+
+/**
+ * A scope that owns {@link SavedStateRegistry}
+ */
+public interface BundleSavedStateRegistryOwner {
+ /**
+ * Returns owned {@link SavedStateRegistry}
+ *
+ * @return a {@link SavedStateRegistry}
+ */
+ @NonNull
+ SavedStateRegistry<Bundle> getBundleSavedStateRegistry();
+}
diff --git a/savedstate/common/api/1.0.0-alpha01.txt b/savedstate/common/api/1.0.0-alpha01.txt
new file mode 100644
index 0000000..426cfdf
--- /dev/null
+++ b/savedstate/common/api/1.0.0-alpha01.txt
@@ -0,0 +1,26 @@
+// Signature format: 2.0
+package androidx.savedstate {
+
+ public abstract class AbstractSavedStateRegistry<S> implements androidx.savedstate.SavedStateRegistry<S> {
+ ctor public AbstractSavedStateRegistry();
+ method @MainThread public final S? consumeRestoredStateForKey(String);
+ method @MainThread public final boolean isRestored();
+ method @MainThread public final void registerSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider<S>);
+ method @MainThread protected final void restoreSavedState(java.util.Map<java.lang.String,S>?);
+ method @MainThread protected final java.util.Map<java.lang.String,S> saveState();
+ method @MainThread public final void unregisterSavedStateProvider(String);
+ }
+
+ public interface SavedStateRegistry<S> {
+ method @MainThread public S? consumeRestoredStateForKey(String);
+ method @MainThread public boolean isRestored();
+ method @MainThread public void registerSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider<S>);
+ method @MainThread public void unregisterSavedStateProvider(String);
+ }
+
+ public static interface SavedStateRegistry.SavedStateProvider<S> {
+ method public S saveState();
+ }
+
+}
+
diff --git a/savedstate/common/api/current.txt b/savedstate/common/api/current.txt
new file mode 100644
index 0000000..426cfdf
--- /dev/null
+++ b/savedstate/common/api/current.txt
@@ -0,0 +1,26 @@
+// Signature format: 2.0
+package androidx.savedstate {
+
+ public abstract class AbstractSavedStateRegistry<S> implements androidx.savedstate.SavedStateRegistry<S> {
+ ctor public AbstractSavedStateRegistry();
+ method @MainThread public final S? consumeRestoredStateForKey(String);
+ method @MainThread public final boolean isRestored();
+ method @MainThread public final void registerSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider<S>);
+ method @MainThread protected final void restoreSavedState(java.util.Map<java.lang.String,S>?);
+ method @MainThread protected final java.util.Map<java.lang.String,S> saveState();
+ method @MainThread public final void unregisterSavedStateProvider(String);
+ }
+
+ public interface SavedStateRegistry<S> {
+ method @MainThread public S? consumeRestoredStateForKey(String);
+ method @MainThread public boolean isRestored();
+ method @MainThread public void registerSavedStateProvider(String, androidx.savedstate.SavedStateRegistry.SavedStateProvider<S>);
+ method @MainThread public void unregisterSavedStateProvider(String);
+ }
+
+ public static interface SavedStateRegistry.SavedStateProvider<S> {
+ method public S saveState();
+ }
+
+}
+
diff --git a/savedstate/common/build.gradle b/savedstate/common/build.gradle
new file mode 100644
index 0000000..5cf97a3
--- /dev/null
+++ b/savedstate/common/build.gradle
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+import static androidx.build.dependencies.DependenciesKt.*
+import androidx.build.LibraryGroups
+import androidx.build.LibraryVersions
+import androidx.build.SupportLibraryExtension
+
+plugins {
+ id("SupportJavaLibraryPlugin")
+ id("kotlin")
+}
+
+dependencies {
+ api(SUPPORT_ANNOTATIONS)
+ implementation(ARCH_CORE_COMMON)
+
+ testImplementation(JUNIT)
+ testImplementation(TEST_EXT_JUNIT)
+ testImplementation(TEST_CORE)
+ testImplementation(TEST_RUNNER)
+ testImplementation(KOTLIN_STDLIB)
+}
+
+supportLibrary {
+ name = "Android Lifecycle Saved State"
+ publish = true
+ mavenVersion = LibraryVersions.SAVEDSTATE
+ mavenGroup = LibraryGroups.SAVEDSTATE
+ inceptionYear = "2018"
+ description = "Android Lifecycle Saved State"
+ url = SupportLibraryExtension.ARCHITECTURE_URL
+}
\ No newline at end of file
diff --git a/savedstate/common/src/main/AndroidManifest.xml b/savedstate/common/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..bbc896a
--- /dev/null
+++ b/savedstate/common/src/main/AndroidManifest.xml
@@ -0,0 +1,19 @@
+<!--
+ ~ 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.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="androidx.lifecycle.savedstate.common">
+</manifest>
diff --git a/savedstate/common/src/main/java/androidx/savedstate/AbstractSavedStateRegistry.java b/savedstate/common/src/main/java/androidx/savedstate/AbstractSavedStateRegistry.java
new file mode 100644
index 0000000..a1081de
--- /dev/null
+++ b/savedstate/common/src/main/java/androidx/savedstate/AbstractSavedStateRegistry.java
@@ -0,0 +1,130 @@
+/*
+ * 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.savedstate;
+
+import androidx.annotation.MainThread;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.arch.core.internal.SafeIterableMap;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * This class provides a skeletal implementation of the {@link SavedStateRegistry}.
+ * <p>
+ * Implementations simply need to call {@link #restoreSavedState(Map)} to initialize restored state
+ * and call {@link #saveState()} once system requests saved state.
+ *
+ * @param <S> represents a class for saving a state, typically it is {@link android.os.Bundle}
+ *
+ * @see androidx.activity.BundleSavedStateRegistry
+ */
+public abstract class AbstractSavedStateRegistry<S> implements SavedStateRegistry<S> {
+ private SafeIterableMap<String, SavedStateProvider<S>> mComponents =
+ new SafeIterableMap<>();
+ private Map<String, S> mSavedState;
+ private boolean mRestored;
+
+ @MainThread
+ @Nullable
+ @Override
+ public final S consumeRestoredStateForKey(@NonNull String key) {
+ if (!mRestored) {
+ throw new IllegalStateException("You can consumeRestoredStateForKey "
+ + "only after super.onCreate of corresponding component");
+ }
+ S state = null;
+ if (mSavedState != null) {
+ state = mSavedState.remove(key);
+ if (mSavedState.isEmpty()) {
+ mSavedState = null;
+ }
+ }
+ return state;
+ }
+
+ @MainThread
+ @Override
+ public final void registerSavedStateProvider(@NonNull String key,
+ @NonNull SavedStateProvider<S> provider) {
+ SavedStateProvider<S> previous = mComponents.putIfAbsent(key, provider);
+ if (previous != null) {
+ throw new IllegalArgumentException("SavedStateProvider with the given key is"
+ + " already registered");
+ }
+ }
+
+ /**
+ * Unregisters a component previously registered by the given {@code key}
+ *
+ * @param key a key with which a component was previously registered.
+ */
+ @MainThread
+ @Override
+ public final void unregisterSavedStateProvider(@NonNull String key) {
+ mComponents.remove(key);
+ }
+
+ /**
+ * Returns if state was restored after creation and can be safely consumed
+ * with {@link #consumeRestoredStateForKey(String)}
+ *
+ * @return true if state was restored.
+ */
+ @MainThread
+ @Override
+ public final boolean isRestored() {
+ return mRestored;
+ }
+
+ /**
+ * Subclasses of this {@code AbstractSavedStateRegistry} should call this
+ * method to initialize restored state.
+ */
+ @SuppressWarnings("WeakerAccess")
+ @MainThread
+ protected final void restoreSavedState(@Nullable Map<String, S> initialState) {
+ if (initialState != null) {
+ mSavedState = new HashMap<>(initialState);
+ }
+ mRestored = true;
+ }
+
+ /**
+ * Subclasses of this {@code AbstractSavedStateRegistry} should call this
+ * method to perform state saving, this method will call all registered providers and
+ * merge a state provided by them with all unconsumed values since previous restoration.
+ *
+ * @return state that should be saved.
+ */
+ @MainThread
+ @NonNull
+ protected final Map<String, S> saveState() {
+ Map<String, S> savedState = new HashMap<>();
+ if (mSavedState != null) {
+ savedState.putAll(mSavedState);
+ }
+ for (Iterator<Map.Entry<String, SavedStateProvider<S>>> it =
+ mComponents.iteratorWithAdditions(); it.hasNext(); ) {
+ Map.Entry<String, SavedStateProvider<S>> entry = it.next();
+ savedState.put(entry.getKey(), entry.getValue().saveState());
+ }
+ return savedState;
+ }
+}
diff --git a/savedstate/common/src/main/java/androidx/savedstate/SavedStateRegistry.java b/savedstate/common/src/main/java/androidx/savedstate/SavedStateRegistry.java
new file mode 100644
index 0000000..a0b069e
--- /dev/null
+++ b/savedstate/common/src/main/java/androidx/savedstate/SavedStateRegistry.java
@@ -0,0 +1,101 @@
+/*
+ * 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.savedstate;
+
+import androidx.annotation.MainThread;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+/**
+ * An interface for plugging components that consumes and contributes to the saved state.
+ *
+ * @param <S> represents a class for saving a state, typically it is {@link android.os.Bundle}
+ */
+public interface SavedStateRegistry<S> {
+ /**
+ * Consumes saved state previously supplied by {@link SavedStateProvider} registered
+ * via {@link #registerSavedStateProvider(String, SavedStateProvider)}
+ * with the given {@code key}.
+ * <p>
+ * This call clears an internal reference to returned saved state, so if you call it second time
+ * in the row it will return {@code null}.
+ * <p>
+ * All unconsumed values will be saved during {@code onSaveInstanceState(Bundle savedState)}
+ * <p>
+ * This method can be called after {@code super.onCreate(savedStateBundle)} of the corresponding
+ * component. Calling it before that will result in {@code IllegalArgumentException}.
+ * {@link Lifecycle.Event#ON_CREATE} can be used as a signal
+ * that a saved state can be safely consumed.
+ *
+ * @param key a key with which {@link SavedStateProvider} was previously registered.
+ * @return {@code S} with the previously saved state or {@code null}
+ */
+ @MainThread
+ @Nullable
+ S consumeRestoredStateForKey(@NonNull String key);
+
+ /**
+ * Returns if a state was restored and can be safely consumed
+ * with {@link #consumeRestoredStateForKey(String)}
+ *
+ * @return true if state was restored.
+ */
+ @MainThread
+ boolean isRestored();
+
+ /**
+ * This interface marks a component that contributes to saved state.
+ *
+ * @param <S> represents a class for saving a state, typically it is {@link android.os.Bundle}
+ */
+ interface SavedStateProvider<S> {
+ /**
+ * Called to retrieve a state from a component before being killed
+ * so later the state can be received from {@link #consumeRestoredStateForKey(String)}
+ *
+ * @return S with your saved state.
+ */
+ @NonNull
+ S saveState();
+ }
+
+ /**
+ * Registers a {@link SavedStateProvider} by the given {@code key}. This
+ * {@code savedStateProvider} will be called
+ * during state saving phase, returned object will be associated with the given {@code key}
+ * and can be used after the restoration via {@link #consumeRestoredStateForKey(String)}.
+ * <p>
+ * If there is unconsumed value with the same {@code key},
+ * the value supplied by {@code savedStateProvider} will be override and
+ * will be written to resulting saved state.
+ * <p> if a provider was already registered with the given {@code key}, an implementation should
+ * throw an {@link IllegalArgumentException}
+ * @param key a key with which returned saved state will be associated
+ * @param savedStateProvider savedStateProvider to get saved state.
+ */
+ @MainThread
+ void registerSavedStateProvider(@NonNull String key,
+ @NonNull SavedStateProvider<S> savedStateProvider);
+
+ /**
+ * Unregisters a component previously registered by the given {@code key}
+ *
+ * @param key a key with which a component was previously registered.
+ */
+ @MainThread
+ void unregisterSavedStateProvider(@NonNull String key);
+}
diff --git a/savedstate/common/src/test/java/androidx/savedstate/AbstractSavedStateRegistryTest.kt b/savedstate/common/src/test/java/androidx/savedstate/AbstractSavedStateRegistryTest.kt
new file mode 100644
index 0000000..e2e86e5
--- /dev/null
+++ b/savedstate/common/src/test/java/androidx/savedstate/AbstractSavedStateRegistryTest.kt
@@ -0,0 +1,117 @@
+/*
+ * 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.savedstate
+
+import org.hamcrest.CoreMatchers.`is`
+import org.hamcrest.CoreMatchers.nullValue
+import org.hamcrest.MatcherAssert.assertThat
+import org.junit.Assert
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(JUnit4::class)
+class AbstractSavedStateRegistryTest {
+
+ @Test
+ fun registerWithSameKey() {
+ val registry = TestSavedStateRegistry()
+ registry.registerSavedStateProvider("key") { "a" }
+ try {
+ registry.registerSavedStateProvider("key") { "b" }
+ Assert.fail("can't register with the same key")
+ } catch (e: IllegalArgumentException) {
+ // fail as expected
+ }
+ }
+
+ @Test
+ fun saveRestoreFlow() {
+ val registry = TestSavedStateRegistry()
+ registry.registerSavedStateProvider("a") { "bla" }
+ registry.registerSavedStateProvider("b") { "boo" }
+ val savedState = registry.savedState()
+
+ val newRegistry = TestSavedStateRegistry()
+ newRegistry.restoreState(savedState)
+
+ assertThat(newRegistry.isRestored, `is`(true))
+ assertThat(newRegistry.consumeRestoredStateForKey("a"), `is`("bla"))
+ assertThat(newRegistry.consumeRestoredStateForKey("b"), `is`("boo"))
+ }
+
+ @Test
+ fun consumeSameTwice() {
+ val registry = TestSavedStateRegistry()
+ registry.registerSavedStateProvider("a") { "foo" }
+ val state = registry.savedState()
+
+ val newStore = TestSavedStateRegistry()
+ newStore.restoreState(state)
+
+ assertThat(newStore.isRestored, `is`(true))
+ assertThat(newStore.consumeRestoredStateForKey("a"), `is`("foo"))
+ assertThat(newStore.consumeRestoredStateForKey("a"), nullValue())
+ }
+
+ @Test
+ fun unregister() {
+ val registry = TestSavedStateRegistry()
+ registry.registerSavedStateProvider("a") { "foo" }
+ registry.unregisterSavedStateProvider("a")
+ // this call should succeed
+ registry.registerSavedStateProvider("a") { "foo" }
+ registry.unregisterSavedStateProvider("a")
+
+ assertThat(registry.savedState().isEmpty(), `is`(true))
+ }
+
+ @Test
+ fun unconsumedSavedState() {
+ val registry = TestSavedStateRegistry()
+ registry.registerSavedStateProvider("a") { "foo" }
+ val savedState1 = registry.savedState()
+ val intermediateStore = TestSavedStateRegistry()
+ intermediateStore.restoreState(savedState1)
+ val savedState2 = intermediateStore.savedState()
+ val newRegistry = TestSavedStateRegistry()
+ newRegistry.restoreState(savedState2)
+ assertThat(newRegistry.consumeRestoredStateForKey("a"), `is`("foo"))
+ }
+
+ @Test
+ fun unconsumedSavedStateClashWithCallback() {
+ val registry = TestSavedStateRegistry()
+ registry.registerSavedStateProvider("a") { "foo" }
+ val savedState1 = registry.savedState()
+ val intermediateStore = TestSavedStateRegistry()
+ intermediateStore.restoreState(savedState1)
+ // there is unconsumed value for "a"
+ intermediateStore.registerSavedStateProvider("a") { "bar" }
+ val savedState2 = intermediateStore.savedState()
+ val newStore = TestSavedStateRegistry()
+ newStore.restoreState(savedState2)
+ assertThat(newStore.consumeRestoredStateForKey("a"), `is`("bar"))
+ }
+
+ class TestSavedStateRegistry : AbstractSavedStateRegistry<String>() {
+ fun restoreState(state: Map<String, String>) {
+ restoreSavedState(state)
+ }
+ fun savedState() = saveState()
+ }
+}
diff --git a/savedstate/proguard-rules.pro b/savedstate/proguard-rules.pro
deleted file mode 100644
index 164f745..0000000
--- a/savedstate/proguard-rules.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2019 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.
-
--keepclassmembers,allowobfuscation class * extends androidx.savedstate.SavedStateRegistry.AutoRecreated {
- <init>();
-}
\ No newline at end of file
diff --git a/savedstate/src/androidTest/AndroidManifest.xml b/savedstate/src/androidTest/AndroidManifest.xml
deleted file mode 100644
index e9a46d7..0000000
--- a/savedstate/src/androidTest/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ 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.
- -->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="androidx.savedstate.test">
- <uses-sdk android:targetSdkVersion="${target-sdk-version}"/>
-
- <application>
- </application>
-
-</manifest>
diff --git a/savedstate/src/androidTest/java/androidx/savedstate/ErrorInStaticBlock.java b/savedstate/src/androidTest/java/androidx/savedstate/ErrorInStaticBlock.java
deleted file mode 100644
index 2b9c360..0000000
--- a/savedstate/src/androidTest/java/androidx/savedstate/ErrorInStaticBlock.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2019 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.savedstate;
-
-import org.junit.Assert;
-
-public class ErrorInStaticBlock {
-
- static {
- Assert.fail("This class shouldn't be initialized!");
- }
-}
diff --git a/savedstate/src/androidTest/java/androidx/savedstate/SavedStateRegistryTest.kt b/savedstate/src/androidTest/java/androidx/savedstate/SavedStateRegistryTest.kt
deleted file mode 100644
index d7f4b3e..0000000
--- a/savedstate/src/androidTest/java/androidx/savedstate/SavedStateRegistryTest.kt
+++ /dev/null
@@ -1,222 +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.savedstate
-
-import android.os.Bundle
-import androidx.lifecycle.Lifecycle
-import androidx.lifecycle.LifecycleRegistry
-import androidx.test.filters.SmallTest
-import com.google.common.truth.Truth.assertThat
-import org.junit.Assert
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
-import java.lang.ClassCastException
-import java.lang.IllegalStateException
-
-@SmallTest
-@RunWith(JUnit4::class)
-class SavedStateRegistryTest {
-
- @Test
- fun saveRestoreFlow() {
- startFlow { registry ->
- registry.registerSavedStateProvider("a") { bundleOf("foo", 1) }
- registry.registerSavedStateProvider("b") { bundleOf("foo", 2) }
- }.recreateAndCheck { registry ->
- val bundleForA = registry.consumeRestoredStateForKey("a")
- val bundleForB = registry.consumeRestoredStateForKey("b")
- assertThat(bundleForA.isSame(bundleOf("foo", 1))).isTrue()
- assertThat(bundleForA.isSame(bundleOf("foo", 1))).isTrue()
- assertThat(bundleForB.isSame(bundleOf("foo", 2))).isTrue()
- }
- }
-
- @Test
- fun registerWithSameKey() {
- startFlow { registry ->
- registry.registerSavedStateProvider("key") { bundleOf("foo", "a") }
- try {
- registry.registerSavedStateProvider("key") { bundleOf("foo", "b") }
- Assert.fail("can't register with the same key")
- } catch (e: IllegalArgumentException) {
- // fail as expected
- }
- }
- }
-
- @Test
- fun consumeSameTwice() {
- startFlow { registry ->
- registry.registerSavedStateProvider("a") { bundleOf("key", "fo") }
- }.recreateAndCheck { registry ->
- assertThat(registry.consumeRestoredStateForKey("a").isSame(bundleOf("key", "fo")))
- .isTrue()
- assertThat(registry.consumeRestoredStateForKey("a")).isNull()
- }
- }
-
- @Test
- fun unregister() {
- startFlow { registry ->
- registry.registerSavedStateProvider("a") { bundleOf("key", "fo") }
- registry.unregisterSavedStateProvider("a")
- // this call should succeed
- registry.registerSavedStateProvider("a") { bundleOf("key", "fo") }
- registry.unregisterSavedStateProvider("a")
- }.recreateAndCheck { registry ->
- assertThat(registry.consumeRestoredStateForKey("a")).isNull()
- }
- }
-
- @Test
- fun unconsumedSavedState() {
- startFlow { registry ->
- registry.registerSavedStateProvider("a") { bundleOf("key", "fo") }
- }.recreateAndCheck {
- // so we don't consume anything after restoration
- }.recreateAndCheck { registry ->
- assertThat(registry.consumeRestoredStateForKey("a").isSame(bundleOf("key", "fo")))
- .isTrue()
- }
- }
-
- @Test
- fun unconsumedSavedStateClashWithCallback() {
- startFlow { registry ->
- registry.registerSavedStateProvider("a") { bundleOf("key", "fo") }
- }.recreateAndCheck { intermediateRegistry ->
- // there is unconsumed value for "a"
- intermediateRegistry.registerSavedStateProvider("a") { bundleOf("key", "ba") }
- }.recreateAndCheck { registry ->
- assertThat(registry.consumeRestoredStateForKey("a").isSame(bundleOf("key", "ba")))
- .isTrue()
- }
- }
-
- @Test
- fun autoRecreatedThrowOnMissingDefaultConstructor() {
- class InvalidConstructorClass(unused: Int) : SavedStateRegistry.AutoRecreated {
- override fun onRecreated(owner: SavedStateRegistryOwner) {
- TODO("not implemented")
- }
- }
- startFlow { registry ->
- try {
- registry.runOnNextRecreation(InvalidConstructorClass::class.java)
- Assert.fail()
- } catch (e: Exception) {
- assertThat(e).isInstanceOf(IllegalArgumentException::class.java)
- }
- }
- }
-
- @Test
- fun sneakClass() {
- startFlow { registry ->
- @Suppress("UNCHECKED_CAST")
- val sneak = ErrorInStaticBlock::class.java as Class<SavedStateRegistry.AutoRecreated>
- registry.runOnNextRecreation(sneak)
- }.recreate { owner ->
- try {
- owner.lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_CREATE)
- Assert.fail()
- } catch (e: Exception) {
- assertThat(e).isInstanceOf(ClassCastException::class.java)
- }
- }
- }
-
- @Test
- fun throwSavedStateRegistry() {
- val owner = FakeSavedStateRegistryOwner()
- // shouldn't throw, though we aren't even created
- owner.savedStateRegistry.runOnNextRecreation(ToBeRecreated::class.java)
- owner.savedStateRegistryController.performRestore(null)
- owner.lifecycleRegistry.markState(Lifecycle.State.RESUMED)
- owner.lifecycleRegistry.markState(Lifecycle.State.CREATED)
- try {
- owner.savedStateRegistry.runOnNextRecreation(ToBeRecreated::class.java)
- Assert.fail()
- } catch (e: IllegalStateException) {
- assertThat(e.message).contains("Can not perform this action after onSaveInstanceState")
- }
- owner.lifecycleRegistry.markState(Lifecycle.State.STARTED)
- // shouldn't fail
- owner.savedStateRegistry.runOnNextRecreation(ToBeRecreated::class.java)
- }
-
- private class TestFlow(val lastState: Bundle?) {
- fun recreate(block: (FakeSavedStateRegistryOwner) -> Unit): TestFlow {
- val fakeOwner = FakeSavedStateRegistryOwner()
- fakeOwner.savedStateRegistryController.performRestore(lastState)
- assertThat(fakeOwner.savedStateRegistry.isRestored).isTrue()
- block(fakeOwner)
- val outBundle = Bundle()
- fakeOwner.savedStateRegistryController.performSave(outBundle)
- return TestFlow(outBundle)
- }
-
- fun recreateAndCheck(block: (SavedStateRegistry) -> Unit): TestFlow {
- return recreate { block(it.savedStateRegistry) }
- }
- }
-
- private fun startFlow(block: (SavedStateRegistry) -> Unit) = TestFlow(null)
- .recreateAndCheck(block)
-}
-
-private class ToBeRecreated : SavedStateRegistry.AutoRecreated {
- override fun onRecreated(owner: SavedStateRegistryOwner) {
- TODO("not implemented")
- }
-}
-
-private class FakeSavedStateRegistryOwner : SavedStateRegistryOwner {
- val lifecycleRegistry = LifecycleRegistry(this)
- val savedStateRegistryController = SavedStateRegistryController.create(this)
-
- override fun getLifecycle() = lifecycleRegistry
- override fun getSavedStateRegistry() = savedStateRegistryController.savedStateRegistry
-}
-
-private fun bundleOf(key: String, value: Int): Bundle {
- val result = Bundle()
- result.putInt(key, value)
- return result
-}
-
-private fun bundleOf(key: String, value: String): Bundle {
- val result = Bundle()
- result.putString(key, value)
- return result
-}
-
-private fun Bundle?.isSame(other: Bundle): Boolean {
- if (this == null) {
- return false
- }
- if (keySet() != other.keySet()) {
- return false
- }
- for (key in keySet()) {
- if (get(key) != other.get(key)) {
- return false
- }
- }
- return true
-}
\ No newline at end of file
diff --git a/savedstate/src/main/AndroidManifest.xml b/savedstate/src/main/AndroidManifest.xml
deleted file mode 100644
index db70f2e..0000000
--- a/savedstate/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-<manifest package="androidx.savedstate">
-</manifest>
diff --git a/savedstate/src/main/java/androidx/savedstate/Recreator.java b/savedstate/src/main/java/androidx/savedstate/Recreator.java
deleted file mode 100644
index 35942d6..0000000
--- a/savedstate/src/main/java/androidx/savedstate/Recreator.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright 2019 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.savedstate;
-
-
-import android.annotation.SuppressLint;
-import android.os.Bundle;
-
-import androidx.annotation.NonNull;
-import androidx.lifecycle.GenericLifecycleObserver;
-import androidx.lifecycle.Lifecycle;
-import androidx.lifecycle.LifecycleOwner;
-import androidx.savedstate.SavedStateRegistry.AutoRecreated;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
-
-@SuppressLint("RestrictedApi")
-final class Recreator implements GenericLifecycleObserver {
-
- static final String CLASSES_KEY = "classes_to_restore";
- static final String COMPONENT_KEY = "androidx.savedstate.Restarter";
-
- private final SavedStateRegistryOwner mOwner;
-
- Recreator(SavedStateRegistryOwner owner) {
- mOwner = owner;
- }
-
- @Override
- public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
- if (event != Lifecycle.Event.ON_CREATE) {
- throw new AssertionError("Next event must be ON_CREATE");
- }
- source.getLifecycle().removeObserver(this);
- Bundle bundle = mOwner.getSavedStateRegistry()
- .consumeRestoredStateForKey(COMPONENT_KEY);
- if (bundle == null) {
- return;
- }
- ArrayList<String> classes = bundle.getStringArrayList(CLASSES_KEY);
- if (classes == null) {
- throw new IllegalStateException("Bundle with restored state for the component \""
- + COMPONENT_KEY + "\" must contain list of strings by the key \""
- + CLASSES_KEY + "\"");
- }
- for (String className : classes) {
- reflectiveNew(className);
- }
- }
-
- private void reflectiveNew(String className) {
- Class<? extends AutoRecreated> clazz;
- try {
- clazz = Class.forName(className, false,
- Recreator.class.getClassLoader()).asSubclass(AutoRecreated.class);
- } catch (ClassNotFoundException e) {
- throw new RuntimeException("Class " + className + " wasn't found", e);
- }
-
- Constructor<? extends AutoRecreated> constructor;
- try {
- constructor = clazz.getDeclaredConstructor();
- } catch (NoSuchMethodException e) {
- throw new IllegalStateException("Class" + clazz.getSimpleName() + " must have "
- + "default constructor in order to be automatically recreated", e);
- }
- constructor.setAccessible(true);
-
- AutoRecreated newInstance;
- try {
- newInstance = constructor.newInstance();
- } catch (Exception e) {
- throw new RuntimeException("Failed to instantiate " + className, e);
- }
- newInstance.onRecreated(mOwner);
- }
-
- static final class SavedStateProvider implements SavedStateRegistry.SavedStateProvider {
- @SuppressWarnings("WeakerAccess") // synthetic access
- final Set<String> mClasses = new HashSet<>();
-
- SavedStateProvider(final SavedStateRegistry registry) {
- registry.registerSavedStateProvider(COMPONENT_KEY, this);
- }
-
- @NonNull
- @Override
- public Bundle saveState() {
- Bundle bundle = new Bundle();
- bundle.putStringArrayList(CLASSES_KEY, new ArrayList<>(mClasses));
- return bundle;
- }
-
- void add(String className) {
- mClasses.add(className);
- }
- }
-}
diff --git a/savedstate/src/main/java/androidx/savedstate/SavedStateRegistry.java b/savedstate/src/main/java/androidx/savedstate/SavedStateRegistry.java
deleted file mode 100644
index be99367..0000000
--- a/savedstate/src/main/java/androidx/savedstate/SavedStateRegistry.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Copyright 2019 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.savedstate;
-
-import android.annotation.SuppressLint;
-import android.os.Bundle;
-
-import androidx.annotation.MainThread;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.arch.core.internal.SafeIterableMap;
-import androidx.lifecycle.GenericLifecycleObserver;
-import androidx.lifecycle.Lifecycle;
-import androidx.lifecycle.LifecycleOwner;
-
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * An interface for plugging components that consumes and contributes to the saved state.
- *
- * <p>This objects lifetime is bound to the lifecycle of owning component: when activity or
- * fragment is recreated, new instance of the object is created as well.
- */
-@SuppressLint("RestrictedApi")
-public final class SavedStateRegistry {
- private static final String SAVED_COMPONENTS_KEY =
- "androidx.lifecycle.BundlableSavedStateRegistry.key";
-
- private SafeIterableMap<String, SavedStateProvider> mComponents =
- new SafeIterableMap<>();
- @Nullable
- private Bundle mRestoredState;
- private boolean mRestored;
- private Recreator.SavedStateProvider mRecreatorProvider;
- boolean mAllowingSavingState = true;
-
- SavedStateRegistry() {
- }
-
- /**
- * Consumes saved state previously supplied by {@link SavedStateProvider} registered
- * via {@link #registerSavedStateProvider(String, SavedStateProvider)}
- * with the given {@code key}.
- * <p>
- * This call clears an internal reference to returned saved state, so if you call it second time
- * in the row it will return {@code null}.
- * <p>
- * All unconsumed values will be saved during {@code onSaveInstanceState(Bundle savedState)}
- * <p>
- * This method can be called after {@code super.onCreate(savedStateBundle)} of the corresponding
- * component. Calling it before that will result in {@code IllegalArgumentException}.
- * {@link Lifecycle.Event#ON_CREATE} can be used as a signal
- * that a saved state can be safely consumed.
- *
- * @param key a key with which {@link SavedStateProvider} was previously registered.
- * @return {@code S} with the previously saved state or {@code null}
- */
- @MainThread
- @Nullable
- public Bundle consumeRestoredStateForKey(@NonNull String key) {
- if (!mRestored) {
- throw new IllegalStateException("You can consumeRestoredStateForKey "
- + "only after super.onCreate of corresponding component");
- }
- if (mRestoredState != null) {
- Bundle result = mRestoredState.getBundle(key);
- mRestoredState.remove(key);
- if (mRestoredState.isEmpty()) {
- mRestoredState = null;
- }
- return result;
- }
- return null;
- }
-
- /**
- * Registers a {@link SavedStateProvider} by the given {@code key}. This
- * {@code savedStateProvider} will be called
- * during state saving phase, returned object will be associated with the given {@code key}
- * and can be used after the restoration via {@link #consumeRestoredStateForKey(String)}.
- * <p>
- * If there is unconsumed value with the same {@code key},
- * the value supplied by {@code savedStateProvider} will be override and
- * will be written to resulting saved state.
- * <p> if a provider was already registered with the given {@code key}, an implementation should
- * throw an {@link IllegalArgumentException}
- *
- * @param key a key with which returned saved state will be associated
- * @param provider savedStateProvider to get saved state.
- */
- @MainThread
- public void registerSavedStateProvider(@NonNull String key,
- @NonNull SavedStateProvider provider) {
- SavedStateProvider previous = mComponents.putIfAbsent(key, provider);
- if (previous != null) {
- throw new IllegalArgumentException("SavedStateProvider with the given key is"
- + " already registered");
- }
- }
-
- /**
- * Unregisters a component previously registered by the given {@code key}
- *
- * @param key a key with which a component was previously registered.
- */
- @MainThread
- public void unregisterSavedStateProvider(@NonNull String key) {
- mComponents.remove(key);
- }
-
- /**
- * Returns if state was restored after creation and can be safely consumed
- * with {@link #consumeRestoredStateForKey(String)}
- *
- * @return true if state was restored.
- */
- @MainThread
- public boolean isRestored() {
- return mRestored;
- }
-
- /**
- * Subclasses of this interface will be automatically recreated if they were previously
- * registered via {{@link #runOnNextRecreation(Class)}}.
- * <p>
- * Subclasses must have a default constructor
- */
- public interface AutoRecreated {
- /**
- * This method will be called during
- * dispatching of {@link androidx.lifecycle.Lifecycle.Event#ON_CREATE} of owning component.
- *
- * @param owner a component that was restarted
- */
- void onRecreated(@NonNull SavedStateRegistryOwner owner);
- }
-
- /**
- * Executes the given class when the owning component restarted.
- * <p>
- * The given class will be automatically instantiated via default constructor and method
- * {@link AutoRecreated#onRecreated(SavedStateRegistryOwner)} will be called.
- * It is called as part of dispatching of {@link androidx.lifecycle.Lifecycle.Event#ON_CREATE}
- * event.
- *
- * @param clazz that will need to be instantiated on the next component recreation
- * @throws IllegalStateException if you try to call if after {@link Lifecycle.Event#ON_STOP}
- * was dispatched
- */
- @MainThread
- public void runOnNextRecreation(@NonNull Class<? extends AutoRecreated> clazz) {
- if (!mAllowingSavingState) {
- throw new IllegalStateException(
- "Can not perform this action after onSaveInstanceState");
- }
- if (mRecreatorProvider == null) {
- mRecreatorProvider = new Recreator.SavedStateProvider(this);
- }
- try {
- clazz.getDeclaredConstructor();
- } catch (NoSuchMethodException e) {
- throw new IllegalArgumentException("Class" + clazz.getSimpleName() + " must have "
- + "default constructor in order to be automatically recreated", e);
- }
- mRecreatorProvider.add(clazz.getName());
- }
-
- /**
- * An interface for an owner of this @{code {@link SavedStateRegistry} to restore saved state.
- *
- */
- @SuppressWarnings("WeakerAccess")
- @MainThread
- void performRestore(@NonNull Lifecycle lifecycle, @Nullable Bundle savedState) {
- if (mRestored) {
- throw new IllegalStateException("SavedStateRegistry was already restored.");
- }
- if (savedState != null) {
- mRestoredState = savedState.getBundle(SAVED_COMPONENTS_KEY);
- }
-
- lifecycle.addObserver(new GenericLifecycleObserver() {
- @Override
- public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
- if (event == Lifecycle.Event.ON_START) {
- mAllowingSavingState = true;
- } else if (event == Lifecycle.Event.ON_STOP) {
- mAllowingSavingState = false;
- }
- }
- });
-
- mRestored = true;
- }
-
- /**
- * An interface for an owner of this @{code {@link SavedStateRegistry}
- * to perform state saving, it will call all registered providers and
- * merge with unconsumed state.
- *
- * @param outBundle Bundle in which to place a saved state
- */
- @MainThread
- void performSave(@NonNull Bundle outBundle) {
- Bundle components = new Bundle();
- if (mRestoredState != null) {
- components.putAll(mRestoredState);
- }
- for (Iterator<Map.Entry<String, SavedStateProvider>> it =
- mComponents.iteratorWithAdditions(); it.hasNext(); ) {
- Map.Entry<String, SavedStateProvider> entry1 = it.next();
- components.putBundle(entry1.getKey(), entry1.getValue().saveState());
- }
- outBundle.putBundle(SAVED_COMPONENTS_KEY, components);
- }
-
- /**
- * This interface marks a component that contributes to saved state.
- */
- public interface SavedStateProvider {
- /**
- * Called to retrieve a state from a component before being killed
- * so later the state can be received from {@link #consumeRestoredStateForKey(String)}
- *
- * @return S with your saved state.
- */
- @NonNull
- Bundle saveState();
- }
-}
diff --git a/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryController.java b/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryController.java
deleted file mode 100644
index 2519239..0000000
--- a/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryController.java
+++ /dev/null
@@ -1,87 +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.savedstate;
-
-import android.os.Bundle;
-
-import androidx.annotation.MainThread;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.lifecycle.Lifecycle;
-
-/**
- * An API for {@link SavedStateRegistryOwner} implementations to control {@link SavedStateRegistry}.
- * <p>
- * {@code SavedStateRegistryOwner} should call {@link #performRestore(Bundle)} to restore state of
- * {@link SavedStateRegistry} and {@link #performSave(Bundle)} to gather SavedState from it.
- */
-public final class SavedStateRegistryController {
- private final SavedStateRegistryOwner mOwner;
- private final SavedStateRegistry mRegistry;
-
- private SavedStateRegistryController(SavedStateRegistryOwner owner) {
- mOwner = owner;
- mRegistry = new SavedStateRegistry();
- }
-
- /**
- * Returns controlled {@link SavedStateRegistry}
- */
- @NonNull
- public SavedStateRegistry getSavedStateRegistry() {
- return mRegistry;
- }
-
- /**
- * An interface for an owner of this {@link SavedStateRegistry} to restore saved state.
- *
- * @param savedState restored state
- */
- @SuppressWarnings("WeakerAccess")
- @MainThread
- public void performRestore(@Nullable Bundle savedState) {
- Lifecycle lifecycle = mOwner.getLifecycle();
- if (lifecycle.getCurrentState() != Lifecycle.State.INITIALIZED) {
- throw new IllegalStateException("Restarter must be created only during "
- + "owner's initialization stage");
- }
- lifecycle.addObserver(new Recreator(mOwner));
- mRegistry.performRestore(lifecycle, savedState);
- }
-
- /**
- * An interface for an owner of this {@link SavedStateRegistry}
- * to perform state saving, it will call all registered providers and
- * merge with unconsumed state.
- *
- * @param outBundle Bundle in which to place a saved state
- */
- @MainThread
- public void performSave(@NonNull Bundle outBundle) {
- mRegistry.performSave(outBundle);
- }
-
- /**
- * Creates a {@link SavedStateRegistryController}.
- * <p>
- * It should be called during construction time of {@link SavedStateRegistryOwner}
- */
- @NonNull
- public static SavedStateRegistryController create(@NonNull SavedStateRegistryOwner owner) {
- return new SavedStateRegistryController(owner);
- }
-}
diff --git a/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryOwner.java b/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryOwner.java
deleted file mode 100644
index 18b3fb3..0000000
--- a/savedstate/src/main/java/androidx/savedstate/SavedStateRegistryOwner.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2019 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.savedstate;
-
-
-import androidx.annotation.NonNull;
-import androidx.lifecycle.LifecycleOwner;
-
-/**
- * A scope that owns {@link SavedStateRegistry}
- */
-public interface SavedStateRegistryOwner extends LifecycleOwner {
- /**
- * Returns owned {@link SavedStateRegistry}
- *
- * @return a {@link SavedStateRegistry}
- */
- @NonNull
- SavedStateRegistry getSavedStateRegistry();
-}
diff --git a/security/crypto/OWNERS b/security/crypto/OWNERS
deleted file mode 100644
index f856cfb..0000000
--- a/security/crypto/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-jmarkoff@google.com
\ No newline at end of file
diff --git a/security/crypto/api/1.0.0-alpha01.txt b/security/crypto/api/1.0.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/security/crypto/api/1.0.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/security/crypto/api/current.txt b/security/crypto/api/current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/security/crypto/api/current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/security/crypto/api/res-1.0.0-alpha01.txt b/security/crypto/api/res-1.0.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/security/crypto/api/res-1.0.0-alpha01.txt
+++ /dev/null
diff --git a/security/crypto/api/restricted_1.0.0-alpha01.txt b/security/crypto/api/restricted_1.0.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/security/crypto/api/restricted_1.0.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/security/crypto/api/restricted_current.txt b/security/crypto/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/security/crypto/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/security/crypto/build.gradle b/security/crypto/build.gradle
deleted file mode 100644
index 03e11af..0000000
--- a/security/crypto/build.gradle
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2019 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.
- */
-
-import static androidx.build.dependencies.DependenciesKt.*
-import androidx.build.LibraryGroups
-import androidx.build.LibraryVersions
-
-plugins {
- id("SupportAndroidLibraryPlugin")
- id("kotlin-android")
-}
-
-dependencies {}
-
-android {
- defaultConfig {
- minSdkVersion 23
- }
-}
-
-supportLibrary {
- name = "AndroidX Security"
- publish = false
- mavenVersion = LibraryVersions.SECURITY
- mavenGroup = LibraryGroups.SECURITY
- inceptionYear = "2019"
- description = "AndroidX Security"
-}
diff --git a/security/crypto/src/androidTest/AndroidManifest.xml b/security/crypto/src/androidTest/AndroidManifest.xml
deleted file mode 100644
index 7affe51..0000000
--- a/security/crypto/src/androidTest/AndroidManifest.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<!--
- Copyright (C) 2019 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 xmlns:android="http://schemas.android.com/apk/res/android"
- package="androidx.security.tests">
- <uses-sdk android:targetSdkVersion="${target-sdk-version}"/>
-</manifest>
diff --git a/security/crypto/src/main/AndroidManifest.xml b/security/crypto/src/main/AndroidManifest.xml
deleted file mode 100644
index e85a787..0000000
--- a/security/crypto/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2019 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.security"/>
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
index 31e96e2..7816fb8 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -41,7 +41,6 @@
includeProject(":animation:testing", "animation/testing")
includeProject(":animation:integration-tests:testapp", "animation/integration-tests/testapp")
includeProject(":appcompat", "appcompat")
-includeProject(":appcompat:appcompat-resources", "appcompat/resources")
includeProject(":arch:core-common", "arch/core-common")
includeProject(":arch:core-testing", "arch/core-testing")
includeProject(":arch:core-runtime", "arch/core-runtime")
@@ -84,10 +83,8 @@
includeProject(":jetifier-preprocessor", "jetifier/jetifier/preprocessor")
includeProject(":leanback", "leanback")
includeProject(":leanback-preference", "leanback-preference")
-includeProject(":lifecycle:integration-tests:lifecycle-testapp", "lifecycle/integration-tests/testapp")
-includeProject(":lifecycle:integration-tests:lifecycle-testapp-kotlin", "lifecycle/integration-tests/kotlintestapp")
+includeProject(":lifecycle:integration-tests:testapp", "lifecycle/integration-tests/testapp")
includeProject(":lifecycle:lifecycle-common", "lifecycle/common")
-includeProject(":lifecycle:lifecycle-common-eap", "lifecycle/common/eap")
includeProject(":lifecycle:lifecycle-common-java8", "lifecycle/common-java8")
includeProject(":lifecycle:lifecycle-compiler", "lifecycle/compiler")
includeProject(":lifecycle:lifecycle-extensions", "lifecycle/extensions")
@@ -147,8 +144,8 @@
includeProject(":room:room-benchmark", "room/benchmark")
includeProject(":room:room-common", "room/common")
includeProject(":room:room-compiler", "room/compiler")
+includeProject(":room:room-coroutines", "room/coroutines")
includeProject(":room:room-guava", "room/guava")
-includeProject(":room:room-ktx", "room/ktx")
includeProject(":room:room-migration", "room/migration")
includeProject(":room:room-runtime", "room/runtime")
includeProject(":room:room-rxjava2", "room/rxjava2")
@@ -157,8 +154,8 @@
includeProject(":remotecallback", "remotecallback")
includeProject(":versionedparcelable-annotation", "versionedparcelable/annotation")
includeProject(":versionedparcelable", "versionedparcelable")
-includeProject(":savedstate", "savedstate")
-includeProject(":security:security-crypto", "security/crypto")
+includeProject(":savedstate:savedstate-common", "savedstate/common")
+includeProject(":savedstate:savedstate-bundle", "savedstate/bundle")
includeProject(":sharetarget", "sharetarget")
includeProject(":sharetarget:integration-tests:testapp", "sharetarget/integration-tests/testapp")
includeProject(":slice-core", "slices/core")
@@ -180,7 +177,6 @@
includeProject(":vectordrawable-animated", "graphics/drawable/animated")
includeProject(":viewpager", "viewpager")
includeProject(":viewpager2", "viewpager2")
-includeProject(":viewpager2:integration-tests:testapp", "viewpager2/integration-tests/testapp")
includeProject(":wear", "wear")
includeProject(":webkit", "webkit")
includeProject(":webkit:integration-tests:testapp", "webkit/integration-tests/testapp")
@@ -229,6 +225,7 @@
includeProject(":support-v7-demos", new File(samplesRoot, "Support7Demos"))
includeProject(":support-v13-demos", new File(samplesRoot, "Support13Demos"))
includeProject(":support-wear-demos", new File(samplesRoot, "SupportWearDemos"))
+includeProject(":viewpager2-demos", new File(samplesRoot, "ViewPager2Demos"))
/////////////////////////////
//
@@ -271,9 +268,9 @@
// we need real android project to generate R.java, aidl etc files that mentioned in sources
if (!startParameter.projectProperties.containsKey('android.injected.invoked.from.ide')) {
// we don't need it in ide, so we don't configure it there
- includeProject(":docs-runner", "docs-runner")
+ includeProject(":docs-fake", "docs-fake")
}
// dumb test project that has a test for each size to ensure that at least one test is run
// for each size and test runner is happy when there is nothing to test.
-includeProject(":dumb-tests", "dumb-tests")
+includeProject(":dumb-tests", "dumb-tests")
\ No newline at end of file
diff --git a/sharetarget/api/1.0.0-alpha01.txt b/sharetarget/api/1.0.0-alpha01.txt
index da4f6cc..d802177 100644
--- a/sharetarget/api/1.0.0-alpha01.txt
+++ b/sharetarget/api/1.0.0-alpha01.txt
@@ -1 +1 @@
-// Signature format: 3.0
+// Signature format: 2.0
diff --git a/sharetarget/api/current.txt b/sharetarget/api/current.txt
index da4f6cc..d802177 100644
--- a/sharetarget/api/current.txt
+++ b/sharetarget/api/current.txt
@@ -1 +1 @@
-// Signature format: 3.0
+// Signature format: 2.0
diff --git a/sharetarget/api/restricted_1.0.0-alpha01.txt b/sharetarget/api/restricted_1.0.0-alpha01.txt
deleted file mode 100644
index bc91693..0000000
--- a/sharetarget/api/restricted_1.0.0-alpha01.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-// Signature format: 3.0
-package androidx.sharetarget {
-
- @RequiresApi(23) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ChooserTargetServiceCompat extends android.service.chooser.ChooserTargetService {
- ctor public ChooserTargetServiceCompat();
- method public java.util.List<android.service.chooser.ChooserTarget>! onGetChooserTargets(android.content.ComponentName!, android.content.IntentFilter!);
- }
-
- @RequiresApi(19) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ShortcutInfoCompatSaverImpl extends androidx.core.content.pm.ShortcutInfoCompatSaver {
- method @AnyThread public static androidx.sharetarget.ShortcutInfoCompatSaverImpl! getInstance(android.content.Context!);
- method @WorkerThread public androidx.core.graphics.drawable.IconCompat! getShortcutIcon(String!) throws java.lang.Exception;
- }
-
-}
-
diff --git a/sharetarget/api/restricted_current.txt b/sharetarget/api/restricted_current.txt
deleted file mode 100644
index bc91693..0000000
--- a/sharetarget/api/restricted_current.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-// Signature format: 3.0
-package androidx.sharetarget {
-
- @RequiresApi(23) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ChooserTargetServiceCompat extends android.service.chooser.ChooserTargetService {
- ctor public ChooserTargetServiceCompat();
- method public java.util.List<android.service.chooser.ChooserTarget>! onGetChooserTargets(android.content.ComponentName!, android.content.IntentFilter!);
- }
-
- @RequiresApi(19) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ShortcutInfoCompatSaverImpl extends androidx.core.content.pm.ShortcutInfoCompatSaver {
- method @AnyThread public static androidx.sharetarget.ShortcutInfoCompatSaverImpl! getInstance(android.content.Context!);
- method @WorkerThread public androidx.core.graphics.drawable.IconCompat! getShortcutIcon(String!) throws java.lang.Exception;
- }
-
-}
-
diff --git a/sharetarget/build.gradle b/sharetarget/build.gradle
index b036596..e4f5596 100644
--- a/sharetarget/build.gradle
+++ b/sharetarget/build.gradle
@@ -24,7 +24,6 @@
dependencies {
api(project(":core"))
- implementation("androidx.collection:collection:1.0.0")
api(GUAVA_LISTENABLE_FUTURE)
implementation("androidx.concurrent:concurrent-futures:1.0.0-alpha02")
diff --git a/sharetarget/src/androidTest/java/androidx/sharetarget/ShareTargetXmlParserTest.java b/sharetarget/src/androidTest/java/androidx/sharetarget/ShareTargetXmlParserTest.java
index 6a158e7..64415ea 100644
--- a/sharetarget/src/androidTest/java/androidx/sharetarget/ShareTargetXmlParserTest.java
+++ b/sharetarget/src/androidTest/java/androidx/sharetarget/ShareTargetXmlParserTest.java
@@ -25,7 +25,7 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -33,7 +33,7 @@
import java.util.ArrayList;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class ShareTargetXmlParserTest {
diff --git a/sharetarget/src/androidTest/java/androidx/sharetarget/ShortcutInfoCompatSaverTest.java b/sharetarget/src/androidTest/java/androidx/sharetarget/ShortcutInfoCompatSaverTest.java
index c020a09..e8ecdf2 100644
--- a/sharetarget/src/androidTest/java/androidx/sharetarget/ShortcutInfoCompatSaverTest.java
+++ b/sharetarget/src/androidTest/java/androidx/sharetarget/ShortcutInfoCompatSaverTest.java
@@ -37,7 +37,7 @@
import androidx.sharetarget.test.R;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import com.google.common.util.concurrent.ListenableFuture;
@@ -53,7 +53,7 @@
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class ShortcutInfoCompatSaverTest {
diff --git a/sharetarget/src/main/java/androidx/sharetarget/ChooserTargetServiceCompat.java b/sharetarget/src/main/java/androidx/sharetarget/ChooserTargetServiceCompat.java
index f713377..08c7504 100644
--- a/sharetarget/src/main/java/androidx/sharetarget/ChooserTargetServiceCompat.java
+++ b/sharetarget/src/main/java/androidx/sharetarget/ChooserTargetServiceCompat.java
@@ -16,7 +16,7 @@
package androidx.sharetarget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ComponentName;
import android.content.Context;
@@ -44,7 +44,7 @@
* @hide
*/
@RequiresApi(23)
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class ChooserTargetServiceCompat extends ChooserTargetService {
static final String TAG = "ChooserServiceCompat";
diff --git a/sharetarget/src/main/java/androidx/sharetarget/ShareTargetCompat.java b/sharetarget/src/main/java/androidx/sharetarget/ShareTargetCompat.java
index 09b6262..cc6b347 100644
--- a/sharetarget/src/main/java/androidx/sharetarget/ShareTargetCompat.java
+++ b/sharetarget/src/main/java/androidx/sharetarget/ShareTargetCompat.java
@@ -16,7 +16,7 @@
package androidx.sharetarget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
@@ -25,7 +25,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
class ShareTargetCompat {
static class TargetData {
final String mScheme;
diff --git a/sharetarget/src/main/java/androidx/sharetarget/ShareTargetXmlParser.java b/sharetarget/src/main/java/androidx/sharetarget/ShareTargetXmlParser.java
index b87fad1..3a7584d 100644
--- a/sharetarget/src/main/java/androidx/sharetarget/ShareTargetXmlParser.java
+++ b/sharetarget/src/main/java/androidx/sharetarget/ShareTargetXmlParser.java
@@ -16,7 +16,7 @@
package androidx.sharetarget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.content.res.Resources;
@@ -35,7 +35,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
class ShareTargetXmlParser {
static final String TAG = "ShareTargetXmlParser";
diff --git a/sharetarget/src/main/java/androidx/sharetarget/ShortcutInfoCompatSaverImpl.java b/sharetarget/src/main/java/androidx/sharetarget/ShortcutInfoCompatSaverImpl.java
index c0ef1dc..fcff477 100644
--- a/sharetarget/src/main/java/androidx/sharetarget/ShortcutInfoCompatSaverImpl.java
+++ b/sharetarget/src/main/java/androidx/sharetarget/ShortcutInfoCompatSaverImpl.java
@@ -16,7 +16,7 @@
package androidx.sharetarget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Bitmap;
@@ -60,7 +60,7 @@
* @hide
*/
@RequiresApi(19)
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
//TODO: we need Futures.addCallback and CallbackToFutureAdapter, update once they're available
public class ShortcutInfoCompatSaverImpl extends ShortcutInfoCompatSaver {
diff --git a/slices/benchmark/src/androidTest/java/androidx/slice/SliceSerializeMetrics.java b/slices/benchmark/src/androidTest/java/androidx/slice/SliceSerializeMetrics.java
index 0b26fbd..4ac3e58 100644
--- a/slices/benchmark/src/androidTest/java/androidx/slice/SliceSerializeMetrics.java
+++ b/slices/benchmark/src/androidTest/java/androidx/slice/SliceSerializeMetrics.java
@@ -39,7 +39,7 @@
import androidx.slice.core.SliceHints;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
import androidx.test.platform.app.InstrumentationRegistry;
@@ -57,7 +57,7 @@
import java.util.List;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@MediumTest
@SdkSuppress(minSdkVersion = 19)
public class SliceSerializeMetrics {
diff --git a/slices/benchmark/src/androidTest/java/androidx/slice/SliceViewMetrics.java b/slices/benchmark/src/androidTest/java/androidx/slice/SliceViewMetrics.java
index 080b552..9b091d1 100644
--- a/slices/benchmark/src/androidTest/java/androidx/slice/SliceViewMetrics.java
+++ b/slices/benchmark/src/androidTest/java/androidx/slice/SliceViewMetrics.java
@@ -26,8 +26,8 @@
import androidx.slice.widget.SliceView;
import androidx.test.annotation.UiThreadTest;
import androidx.test.core.app.ApplicationProvider;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
-import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Rule;
@@ -41,7 +41,7 @@
import java.util.Arrays;
@RunWith(Parameterized.class)
-@SmallTest
+@MediumTest
@SdkSuppress(minSdkVersion = 19)
public class SliceViewMetrics {
diff --git a/slices/builders/api/1.0.0.txt b/slices/builders/api/1.0.0.txt
index bcdd533..291321c 100644
--- a/slices/builders/api/1.0.0.txt
+++ b/slices/builders/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slice.builders {
@RequiresApi(19) public class GridRowBuilder {
diff --git a/slices/builders/api/1.1.0-alpha01.txt b/slices/builders/api/1.1.0-alpha01.txt
index 606f3bd..791cd1d 100644
--- a/slices/builders/api/1.1.0-alpha01.txt
+++ b/slices/builders/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slice.builders {
@RequiresApi(19) public class GridRowBuilder {
diff --git a/slices/builders/api/current.txt b/slices/builders/api/current.txt
index 606f3bd..791cd1d 100644
--- a/slices/builders/api/current.txt
+++ b/slices/builders/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slice.builders {
@RequiresApi(19) public class GridRowBuilder {
diff --git a/slices/builders/api/restricted_1.0.0.txt b/slices/builders/api/restricted_1.0.0.txt
deleted file mode 100644
index 8275a58..0000000
--- a/slices/builders/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,333 +0,0 @@
-// Signature format: 3.0
-package androidx.slice.builders {
-
- @RequiresApi(19) public class GridRowBuilder {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public GridRowBuilder(androidx.slice.builders.ListBuilder);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.GridRowBuilder addCell(androidx.core.util.Consumer<androidx.slice.builders.GridRowBuilder.CellBuilder>);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public java.util.List<androidx.slice.builders.GridRowBuilder.CellBuilder>! getCells();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getDescription();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getLayoutDirection();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.SliceAction! getPrimaryAction();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.GridRowBuilder.CellBuilder! getSeeMoreCell();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.app.PendingIntent! getSeeMoreIntent();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.GridRowBuilder setSeeMoreCell(androidx.core.util.Consumer<androidx.slice.builders.GridRowBuilder.CellBuilder>);
- }
-
- public static class GridRowBuilder.CellBuilder {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public GridRowBuilder.CellBuilder(androidx.slice.builders.GridRowBuilder);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public GridRowBuilder.CellBuilder(androidx.slice.builders.GridRowBuilder, android.net.Uri);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getCellDescription();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.app.PendingIntent! getContentIntent();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public java.util.List<java.lang.Boolean>! getLoadings();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public java.util.List<java.lang.Object>! getObjects();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence? getSubtitle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence? getTitle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public java.util.List<java.lang.Integer>! getTypes();
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final int TYPE_IMAGE = 2; // 0x2
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final int TYPE_TEXT = 0; // 0x0
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final int TYPE_TITLE = 1; // 0x1
- }
-
- @RequiresApi(19) public class ListBuilder extends androidx.slice.builders.TemplateSliceBuilder {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public ListBuilder(android.content.Context, android.net.Uri);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.ListBuilder addGridRow(androidx.core.util.Consumer<androidx.slice.builders.GridRowBuilder>);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.ListBuilder addInputRange(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.InputRangeBuilder>);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.ListBuilder addRange(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.RangeBuilder>);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.ListBuilder addRow(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.RowBuilder>);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.impl.ListBuilder! getImpl();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.ListBuilder setColor(@ColorInt int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.ListBuilder setHeader(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.HeaderBuilder>);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.ListBuilder setKeywords(java.util.List<java.lang.String>!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.ListBuilder setSeeMoreRow(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.RowBuilder>);
- }
-
- public static class ListBuilder.HeaderBuilder {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public ListBuilder.HeaderBuilder(android.net.Uri!);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public ListBuilder.HeaderBuilder(androidx.slice.builders.ListBuilder);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public ListBuilder.HeaderBuilder(androidx.slice.builders.ListBuilder, android.net.Uri);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getContentDescription();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getLayoutDirection();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.SliceAction! getPrimaryAction();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getSubtitle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getSummary();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getTitle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.net.Uri! getUri();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean isSubtitleLoading();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean isSummaryLoading();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean isTitleLoading();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface ListBuilder.ImageMode {
- }
-
- public static class ListBuilder.InputRangeBuilder {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public ListBuilder.InputRangeBuilder(androidx.slice.builders.ListBuilder);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.app.PendingIntent! getAction();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getContentDescription();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.app.PendingIntent! getInputAction();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getLayoutDirection();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getMax();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getMin();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.SliceAction! getPrimaryAction();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getSubtitle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.core.graphics.drawable.IconCompat! getThumb();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getTitle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getValue();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean isValueSet();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface ListBuilder.LayoutDirection {
- }
-
- public static class ListBuilder.RangeBuilder {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public ListBuilder.RangeBuilder(androidx.slice.builders.ListBuilder);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getContentDescription();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getLayoutDirection();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getMax();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.SliceAction! getPrimaryAction();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getSubtitle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getTitle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getValue();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean isValueSet();
- }
-
- public static class ListBuilder.RowBuilder {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public ListBuilder.RowBuilder(androidx.slice.builders.ListBuilder);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public ListBuilder.RowBuilder(androidx.slice.builders.ListBuilder, android.net.Uri);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public ListBuilder.RowBuilder(android.content.Context, android.net.Uri);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getContentDescription();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public java.util.List<java.lang.Object>! getEndItems();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public java.util.List<java.lang.Boolean>! getEndLoads();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public java.util.List<java.lang.Integer>! getEndTypes();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getLayoutDirection();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.SliceAction! getPrimaryAction();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getSubtitle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public long getTimeStamp();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public CharSequence! getTitle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.builders.SliceAction! getTitleAction();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.core.graphics.drawable.IconCompat! getTitleIcon();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getTitleImageMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.net.Uri! getUri();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean hasDefaultToggle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean hasEndActionOrToggle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean hasEndImage();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean hasTimestamp();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean isSubtitleLoading();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean isTitleActionLoading();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean isTitleItemLoading();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean isTitleLoading();
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final int TYPE_ACTION = 2; // 0x2
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final int TYPE_ICON = 1; // 0x1
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final int TYPE_TIMESTAMP = 0; // 0x0
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public class MessagingSliceBuilder extends androidx.slice.builders.TemplateSliceBuilder {
- ctor public MessagingSliceBuilder(android.content.Context, android.net.Uri);
- method public androidx.slice.builders.MessagingSliceBuilder! add(androidx.slice.builders.MessagingSliceBuilder.MessageBuilder!);
- method public androidx.slice.builders.MessagingSliceBuilder! add(androidx.core.util.Consumer<androidx.slice.builders.MessagingSliceBuilder.MessageBuilder>!);
- field public static final int MAXIMUM_RETAINED_MESSAGES = 50; // 0x32
- }
-
- public static final class MessagingSliceBuilder.MessageBuilder extends androidx.slice.builders.TemplateSliceBuilder {
- ctor public MessagingSliceBuilder.MessageBuilder(androidx.slice.builders.MessagingSliceBuilder!);
- method @RequiresApi(23) public androidx.slice.builders.MessagingSliceBuilder.MessageBuilder! addSource(android.graphics.drawable.Icon!);
- method public androidx.slice.builders.MessagingSliceBuilder.MessageBuilder! addSource(androidx.core.graphics.drawable.IconCompat!);
- method public androidx.slice.builders.MessagingSliceBuilder.MessageBuilder! addText(CharSequence!);
- method public androidx.slice.builders.MessagingSliceBuilder.MessageBuilder! addTimestamp(long);
- }
-
- @RequiresApi(19) public class SliceAction {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(23) public SliceAction(android.app.PendingIntent, android.graphics.drawable.Icon, CharSequence);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(23) public SliceAction(android.app.PendingIntent, android.graphics.drawable.Icon, int, CharSequence);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(23) public SliceAction(android.app.PendingIntent, android.graphics.drawable.Icon, CharSequence, boolean);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceAction(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, CharSequence);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceAction(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, int, CharSequence);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceAction(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, CharSequence, boolean);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceAction(android.app.PendingIntent, CharSequence, boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.Slice buildSlice(androidx.slice.Slice.Builder);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.core.SliceActionImpl getImpl();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void setPrimaryAction(androidx.slice.Slice.Builder);
- }
-
- @RequiresApi(19) public abstract class TemplateSliceBuilder {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) protected TemplateSliceBuilder(androidx.slice.builders.impl.TemplateBuilderImpl!);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public TemplateSliceBuilder(android.content.Context!, android.net.Uri!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) protected boolean checkCompatible(androidx.slice.SliceSpec!, android.net.Uri!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) protected androidx.slice.Slice.Builder! getBuilder();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) protected androidx.slice.Clock! getClock();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) protected androidx.slice.builders.impl.TemplateBuilderImpl! selectImpl(android.net.Uri!);
- }
-
-}
-
-package androidx.slice.builders.impl {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class GridRowBuilderListV1Impl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- ctor public GridRowBuilderListV1Impl(androidx.slice.builders.impl.ListBuilderV1Impl, androidx.slice.builders.GridRowBuilder!);
- method public void addCell(androidx.slice.builders.GridRowBuilder.CellBuilder!);
- method public void apply(androidx.slice.Slice.Builder!);
- method public void setContentDescription(CharSequence!);
- method public void setLayoutDirection(int);
- method public void setPrimaryAction(androidx.slice.builders.SliceAction!);
- method public void setSeeMoreAction(android.app.PendingIntent!);
- method public void setSeeMoreCell(androidx.slice.builders.GridRowBuilder.CellBuilder);
- }
-
- public static final class GridRowBuilderListV1Impl.CellBuilderImpl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void apply(androidx.slice.Slice.Builder!);
- method public void fillFrom(androidx.slice.builders.GridRowBuilder.CellBuilder!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public interface ListBuilder {
- method public void addAction(androidx.slice.builders.SliceAction!);
- method public void addGridRow(androidx.slice.builders.GridRowBuilder!);
- method public void addInputRange(androidx.slice.builders.ListBuilder.InputRangeBuilder!);
- method public void addRange(androidx.slice.builders.ListBuilder.RangeBuilder!);
- method public void addRow(androidx.slice.builders.ListBuilder.RowBuilder!);
- method public void setColor(@ColorInt int);
- method public void setHeader(androidx.slice.builders.ListBuilder.HeaderBuilder!);
- method public void setIsError(boolean);
- method public void setKeywords(java.util.Set<java.lang.String>!);
- method public void setLayoutDirection(int);
- method public void setSeeMoreAction(android.app.PendingIntent!);
- method public void setSeeMoreRow(androidx.slice.builders.ListBuilder.RowBuilder!);
- method public void setTtl(long);
- method @RequiresApi(26) public void setTtl(java.time.Duration?);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class ListBuilderBasicImpl extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.ListBuilder {
- ctor public ListBuilderBasicImpl(androidx.slice.Slice.Builder!, androidx.slice.SliceSpec!);
- method public void addAction(androidx.slice.builders.SliceAction!);
- method public void addGridRow(androidx.slice.builders.GridRowBuilder!);
- method public void addInputRange(androidx.slice.builders.ListBuilder.InputRangeBuilder!);
- method public void addRange(androidx.slice.builders.ListBuilder.RangeBuilder!);
- method public void addRow(androidx.slice.builders.ListBuilder.RowBuilder!);
- method public void apply(androidx.slice.Slice.Builder!);
- method public void setColor(@ColorInt int);
- method public void setHeader(androidx.slice.builders.ListBuilder.HeaderBuilder!);
- method public void setIsError(boolean);
- method public void setKeywords(java.util.Set<java.lang.String>!);
- method public void setLayoutDirection(int);
- method public void setSeeMoreAction(android.app.PendingIntent!);
- method public void setSeeMoreRow(androidx.slice.builders.ListBuilder.RowBuilder!);
- method public void setTtl(long);
- method @RequiresApi(26) public void setTtl(java.time.Duration?);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class ListBuilderV1Impl extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.ListBuilder {
- ctor public ListBuilderV1Impl(androidx.slice.Slice.Builder!, androidx.slice.SliceSpec!);
- ctor public ListBuilderV1Impl(androidx.slice.Slice.Builder!, androidx.slice.SliceSpec!, androidx.slice.Clock!);
- method public void addAction(androidx.slice.builders.SliceAction);
- method public void addGridRow(androidx.slice.builders.GridRowBuilder);
- method public void addInputRange(androidx.slice.builders.ListBuilder.InputRangeBuilder!);
- method public void addRange(androidx.slice.builders.ListBuilder.RangeBuilder!);
- method public void addRow(androidx.slice.builders.ListBuilder.RowBuilder);
- method public void addRow(androidx.slice.builders.impl.ListBuilderV1Impl.RowBuilderImpl);
- method public void apply(androidx.slice.Slice.Builder!);
- method public void setColor(@ColorInt int);
- method public void setHeader(androidx.slice.builders.ListBuilder.HeaderBuilder);
- method public void setIsError(boolean);
- method public void setKeywords(java.util.Set<java.lang.String>);
- method public void setLayoutDirection(int);
- method public void setSeeMoreAction(android.app.PendingIntent!);
- method public void setSeeMoreRow(androidx.slice.builders.ListBuilder.RowBuilder!);
- method public void setTtl(long);
- method @RequiresApi(26) public void setTtl(java.time.Duration?);
- }
-
- public static class ListBuilderV1Impl.HeaderBuilderImpl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- method public void apply(androidx.slice.Slice.Builder!);
- }
-
- public static class ListBuilderV1Impl.InputRangeBuilderImpl extends androidx.slice.builders.impl.ListBuilderV1Impl.RangeBuilderImpl {
- }
-
- public static class ListBuilderV1Impl.RangeBuilderImpl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- method public void apply(androidx.slice.Slice.Builder!);
- field protected CharSequence! mContentDescr;
- field protected int mLayoutDir;
- field protected int mMax;
- field protected int mMin;
- field protected androidx.slice.builders.SliceAction! mPrimaryAction;
- field protected CharSequence! mSubtitle;
- field protected CharSequence! mTitle;
- field protected int mValue;
- field protected boolean mValueSet;
- }
-
- public static class ListBuilderV1Impl.RowBuilderImpl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- method protected void addEndItem(long);
- method public void apply(androidx.slice.Slice.Builder!);
- method protected void setSubtitle(CharSequence!);
- method protected void setTitleItem(androidx.core.graphics.drawable.IconCompat!, int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class MessagingBasicImpl extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.MessagingBuilder {
- ctor public MessagingBasicImpl(androidx.slice.Slice.Builder!, androidx.slice.SliceSpec!);
- method public void add(androidx.slice.builders.impl.TemplateBuilderImpl!);
- method public void apply(androidx.slice.Slice.Builder!);
- method public androidx.slice.builders.impl.TemplateBuilderImpl! createMessageBuilder();
- }
-
- public static final class MessagingBasicImpl.MessageBuilder extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.MessagingBuilder.MessageBuilder {
- ctor public MessagingBasicImpl.MessageBuilder(androidx.slice.builders.impl.MessagingBasicImpl!);
- method @RequiresApi(23) public void addSource(android.graphics.drawable.Icon!);
- method public void addText(CharSequence!);
- method public void addTimestamp(long);
- method public void apply(androidx.slice.Slice.Builder!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public interface MessagingBuilder {
- method public void add(androidx.slice.builders.impl.TemplateBuilderImpl!);
- method public androidx.slice.builders.impl.TemplateBuilderImpl! createMessageBuilder();
- }
-
- public static interface MessagingBuilder.MessageBuilder {
- method @RequiresApi(23) public void addSource(android.graphics.drawable.Icon!);
- method public void addText(CharSequence!);
- method public void addTimestamp(long);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class MessagingListV1Impl extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.MessagingBuilder {
- ctor public MessagingListV1Impl(androidx.slice.Slice.Builder!, androidx.slice.SliceSpec!);
- method public void add(androidx.slice.builders.impl.TemplateBuilderImpl!);
- method public void apply(androidx.slice.Slice.Builder!);
- method public androidx.slice.builders.impl.TemplateBuilderImpl! createMessageBuilder();
- }
-
- public static final class MessagingListV1Impl.MessageBuilder extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.MessagingBuilder.MessageBuilder {
- ctor public MessagingListV1Impl.MessageBuilder(androidx.slice.builders.impl.MessagingListV1Impl!);
- method @RequiresApi(23) public void addSource(android.graphics.drawable.Icon!);
- method public void addText(CharSequence!);
- method public void addTimestamp(long);
- method public void apply(androidx.slice.Slice.Builder!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class MessagingV1Impl extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.MessagingBuilder {
- ctor public MessagingV1Impl(androidx.slice.Slice.Builder!, androidx.slice.SliceSpec!);
- method public void add(androidx.slice.builders.impl.TemplateBuilderImpl!);
- method public void apply(androidx.slice.Slice.Builder!);
- method public androidx.slice.builders.impl.TemplateBuilderImpl! createMessageBuilder();
- }
-
- public static final class MessagingV1Impl.MessageBuilder extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.MessagingBuilder.MessageBuilder {
- ctor public MessagingV1Impl.MessageBuilder(androidx.slice.builders.impl.MessagingV1Impl!);
- method @RequiresApi(23) public void addSource(android.graphics.drawable.Icon!);
- method public void addText(CharSequence!);
- method public void addTimestamp(long);
- method public void apply(androidx.slice.Slice.Builder!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public abstract class TemplateBuilderImpl {
- ctor protected TemplateBuilderImpl(androidx.slice.Slice.Builder!, androidx.slice.SliceSpec!);
- ctor protected TemplateBuilderImpl(androidx.slice.Slice.Builder!, androidx.slice.SliceSpec!, androidx.slice.Clock!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public abstract void apply(androidx.slice.Slice.Builder!);
- method public androidx.slice.Slice! build();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.Slice.Builder! createChildBuilder();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.Slice.Builder! getBuilder();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.Clock! getClock();
- method protected void setBuilder(androidx.slice.Slice.Builder!);
- }
-
-}
-
diff --git a/slices/builders/api/restricted_1.1.0-alpha01.ignore b/slices/builders/api/restricted_1.1.0-alpha01.ignore
deleted file mode 100644
index 2232ab0..0000000
--- a/slices/builders/api/restricted_1.1.0-alpha01.ignore
+++ /dev/null
@@ -1,59 +0,0 @@
-// Baseline format: 1.0
-AddedAbstractMethod: androidx.slice.builders.impl.ListBuilder#addSelection(androidx.slice.builders.SelectionBuilder):
- Added method androidx.slice.builders.impl.ListBuilder.addSelection(androidx.slice.builders.SelectionBuilder)
-
-
-RemovedClass: androidx.slice.builders.impl.ListBuilderV1Impl:
- Removed class androidx.slice.builders.impl.ListBuilderV1Impl
-
-
-RemovedMethod: androidx.slice.builders.GridRowBuilder#GridRowBuilder(androidx.slice.builders.ListBuilder):
- Removed constructor androidx.slice.builders.GridRowBuilder(androidx.slice.builders.ListBuilder)
-RemovedMethod: androidx.slice.builders.GridRowBuilder#addCell(androidx.core.util.Consumer<androidx.slice.builders.GridRowBuilder.CellBuilder>):
- Removed method androidx.slice.builders.GridRowBuilder.addCell(androidx.core.util.Consumer<androidx.slice.builders.GridRowBuilder.CellBuilder>)
-RemovedMethod: androidx.slice.builders.GridRowBuilder#setSeeMoreCell(androidx.core.util.Consumer<androidx.slice.builders.GridRowBuilder.CellBuilder>):
- Removed method androidx.slice.builders.GridRowBuilder.setSeeMoreCell(androidx.core.util.Consumer<androidx.slice.builders.GridRowBuilder.CellBuilder>)
-RemovedMethod: androidx.slice.builders.GridRowBuilder.CellBuilder#CellBuilder(androidx.slice.builders.GridRowBuilder):
- Removed constructor androidx.slice.builders.GridRowBuilder.CellBuilder(androidx.slice.builders.GridRowBuilder)
-RemovedMethod: androidx.slice.builders.GridRowBuilder.CellBuilder#CellBuilder(androidx.slice.builders.GridRowBuilder, android.net.Uri):
- Removed constructor androidx.slice.builders.GridRowBuilder.CellBuilder(androidx.slice.builders.GridRowBuilder,android.net.Uri)
-RemovedMethod: androidx.slice.builders.ListBuilder#ListBuilder(android.content.Context, android.net.Uri):
- Removed constructor androidx.slice.builders.ListBuilder(android.content.Context,android.net.Uri)
-RemovedMethod: androidx.slice.builders.ListBuilder#addGridRow(androidx.core.util.Consumer<androidx.slice.builders.GridRowBuilder>):
- Removed method androidx.slice.builders.ListBuilder.addGridRow(androidx.core.util.Consumer<androidx.slice.builders.GridRowBuilder>)
-RemovedMethod: androidx.slice.builders.ListBuilder#addInputRange(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.InputRangeBuilder>):
- Removed method androidx.slice.builders.ListBuilder.addInputRange(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.InputRangeBuilder>)
-RemovedMethod: androidx.slice.builders.ListBuilder#addRange(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.RangeBuilder>):
- Removed method androidx.slice.builders.ListBuilder.addRange(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.RangeBuilder>)
-RemovedMethod: androidx.slice.builders.ListBuilder#addRow(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.RowBuilder>):
- Removed method androidx.slice.builders.ListBuilder.addRow(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.RowBuilder>)
-RemovedMethod: androidx.slice.builders.ListBuilder#setColor(int):
- Removed method androidx.slice.builders.ListBuilder.setColor(int)
-RemovedMethod: androidx.slice.builders.ListBuilder#setHeader(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.HeaderBuilder>):
- Removed method androidx.slice.builders.ListBuilder.setHeader(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.HeaderBuilder>)
-RemovedMethod: androidx.slice.builders.ListBuilder#setKeywords(java.util.List<java.lang.String>):
- Removed method androidx.slice.builders.ListBuilder.setKeywords(java.util.List<java.lang.String>)
-RemovedMethod: androidx.slice.builders.ListBuilder#setSeeMoreRow(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.RowBuilder>):
- Removed method androidx.slice.builders.ListBuilder.setSeeMoreRow(androidx.core.util.Consumer<androidx.slice.builders.ListBuilder.RowBuilder>)
-RemovedMethod: androidx.slice.builders.ListBuilder.HeaderBuilder#HeaderBuilder(androidx.slice.builders.ListBuilder):
- Removed constructor androidx.slice.builders.ListBuilder.HeaderBuilder(androidx.slice.builders.ListBuilder)
-RemovedMethod: androidx.slice.builders.ListBuilder.HeaderBuilder#HeaderBuilder(androidx.slice.builders.ListBuilder, android.net.Uri):
- Removed constructor androidx.slice.builders.ListBuilder.HeaderBuilder(androidx.slice.builders.ListBuilder,android.net.Uri)
-RemovedMethod: androidx.slice.builders.ListBuilder.InputRangeBuilder#InputRangeBuilder(androidx.slice.builders.ListBuilder):
- Removed constructor androidx.slice.builders.ListBuilder.InputRangeBuilder(androidx.slice.builders.ListBuilder)
-RemovedMethod: androidx.slice.builders.ListBuilder.RangeBuilder#RangeBuilder(androidx.slice.builders.ListBuilder):
- Removed constructor androidx.slice.builders.ListBuilder.RangeBuilder(androidx.slice.builders.ListBuilder)
-RemovedMethod: androidx.slice.builders.ListBuilder.RowBuilder#RowBuilder(android.content.Context, android.net.Uri):
- Removed constructor androidx.slice.builders.ListBuilder.RowBuilder(android.content.Context,android.net.Uri)
-RemovedMethod: androidx.slice.builders.ListBuilder.RowBuilder#RowBuilder(androidx.slice.builders.ListBuilder):
- Removed constructor androidx.slice.builders.ListBuilder.RowBuilder(androidx.slice.builders.ListBuilder)
-RemovedMethod: androidx.slice.builders.ListBuilder.RowBuilder#RowBuilder(androidx.slice.builders.ListBuilder, android.net.Uri):
- Removed constructor androidx.slice.builders.ListBuilder.RowBuilder(androidx.slice.builders.ListBuilder,android.net.Uri)
-RemovedMethod: androidx.slice.builders.TemplateSliceBuilder#checkCompatible(androidx.slice.SliceSpec, android.net.Uri):
- Removed method androidx.slice.builders.TemplateSliceBuilder.checkCompatible(androidx.slice.SliceSpec,android.net.Uri)
-RemovedMethod: androidx.slice.builders.TemplateSliceBuilder#selectImpl(android.net.Uri):
- Removed method androidx.slice.builders.TemplateSliceBuilder.selectImpl(android.net.Uri)
-RemovedMethod: androidx.slice.builders.impl.GridRowBuilderListV1Impl#GridRowBuilderListV1Impl(androidx.slice.builders.impl.ListBuilderV1Impl, androidx.slice.builders.GridRowBuilder):
- Removed constructor androidx.slice.builders.impl.GridRowBuilderListV1Impl(androidx.slice.builders.impl.ListBuilderV1Impl,androidx.slice.builders.GridRowBuilder)
-
-
diff --git a/slices/builders/api/restricted_1.1.0-alpha01.txt b/slices/builders/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index bb5d9b4..0000000
--- a/slices/builders/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1,133 +0,0 @@
-// Signature format: 3.0
-package androidx.slice.builders {
-
- @RequiresApi(19) public class GridRowBuilder {
- }
-
- public static class GridRowBuilder.CellBuilder {
- }
-
- @RequiresApi(19) public class ListBuilder extends androidx.slice.builders.TemplateSliceBuilder {
- }
-
- public static class ListBuilder.HeaderBuilder {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public ListBuilder.HeaderBuilder(android.net.Uri!);
- }
-
-
- public static class ListBuilder.InputRangeBuilder {
- }
-
-
- public static class ListBuilder.RangeBuilder {
- }
-
- public static class ListBuilder.RowBuilder {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public class MessagingSliceBuilder extends androidx.slice.builders.TemplateSliceBuilder {
- ctor public MessagingSliceBuilder(android.content.Context, android.net.Uri);
- method public androidx.slice.builders.MessagingSliceBuilder! add(androidx.slice.builders.MessagingSliceBuilder.MessageBuilder!);
- method public androidx.slice.builders.MessagingSliceBuilder! add(androidx.core.util.Consumer<androidx.slice.builders.MessagingSliceBuilder.MessageBuilder>!);
- field public static final int MAXIMUM_RETAINED_MESSAGES = 50; // 0x32
- }
-
- public static final class MessagingSliceBuilder.MessageBuilder extends androidx.slice.builders.TemplateSliceBuilder {
- ctor public MessagingSliceBuilder.MessageBuilder(androidx.slice.builders.MessagingSliceBuilder!);
- method @RequiresApi(23) public androidx.slice.builders.MessagingSliceBuilder.MessageBuilder! addSource(android.graphics.drawable.Icon!);
- method public androidx.slice.builders.MessagingSliceBuilder.MessageBuilder! addSource(androidx.core.graphics.drawable.IconCompat!);
- method public androidx.slice.builders.MessagingSliceBuilder.MessageBuilder! addText(CharSequence!);
- method public androidx.slice.builders.MessagingSliceBuilder.MessageBuilder! addTimestamp(long);
- }
-
- @RequiresApi(19) public class SelectionBuilder {
- }
-
- @RequiresApi(19) public class SliceAction implements androidx.slice.core.SliceAction {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceAction(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, @androidx.slice.builders.ListBuilder.ImageMode int, CharSequence);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceAction(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, CharSequence, boolean);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceAction(android.app.PendingIntent, CharSequence, boolean);
- }
-
- @RequiresApi(19) public abstract class TemplateSliceBuilder {
- }
-
-}
-
-package androidx.slice.builders.impl {
-
-
- public static final class GridRowBuilderListV1Impl.CellBuilderImpl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- method public void fillFrom(androidx.slice.builders.GridRowBuilder.CellBuilder!);
- }
-
-
-
-
- public static class ListBuilderImpl.HeaderBuilderImpl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- method public void apply(androidx.slice.Slice.Builder!);
- }
-
- public static class ListBuilderImpl.InputRangeBuilderImpl extends androidx.slice.builders.impl.ListBuilderImpl.RangeBuilderImpl {
- }
-
- public static class ListBuilderImpl.RangeBuilderImpl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- method public void apply(androidx.slice.Slice.Builder!);
- field protected CharSequence! mContentDescr;
- field protected int mLayoutDir;
- field protected int mMax;
- field protected int mMin;
- field protected androidx.slice.builders.SliceAction! mPrimaryAction;
- field protected CharSequence! mSubtitle;
- field protected CharSequence! mTitle;
- field protected int mValue;
- field protected boolean mValueSet;
- }
-
- public static class ListBuilderImpl.RowBuilderImpl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- method protected void addEndItem(long);
- method public void apply(androidx.slice.Slice.Builder!);
- method protected void setSubtitle(CharSequence!);
- method protected void setTitleItem(androidx.core.graphics.drawable.IconCompat!, int);
- }
-
-
- public static final class MessagingBasicImpl.MessageBuilder extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.MessagingBuilder.MessageBuilder {
- ctor public MessagingBasicImpl.MessageBuilder(androidx.slice.builders.impl.MessagingBasicImpl!);
- method @RequiresApi(23) public void addSource(android.graphics.drawable.Icon!);
- method public void addText(CharSequence!);
- method public void addTimestamp(long);
- method public void apply(androidx.slice.Slice.Builder!);
- }
-
-
- public static interface MessagingBuilder.MessageBuilder {
- method @RequiresApi(23) public void addSource(android.graphics.drawable.Icon!);
- method public void addText(CharSequence!);
- method public void addTimestamp(long);
- }
-
-
- public static final class MessagingListV1Impl.MessageBuilder extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.MessagingBuilder.MessageBuilder {
- ctor public MessagingListV1Impl.MessageBuilder(androidx.slice.builders.impl.MessagingListV1Impl!);
- method @RequiresApi(23) public void addSource(android.graphics.drawable.Icon!);
- method public void addText(CharSequence!);
- method public void addTimestamp(long);
- method public void apply(androidx.slice.Slice.Builder!);
- }
-
-
- public static final class MessagingV1Impl.MessageBuilder extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.MessagingBuilder.MessageBuilder {
- ctor public MessagingV1Impl.MessageBuilder(androidx.slice.builders.impl.MessagingV1Impl!);
- method @RequiresApi(23) public void addSource(android.graphics.drawable.Icon!);
- method public void addText(CharSequence!);
- method public void addTimestamp(long);
- method public void apply(androidx.slice.Slice.Builder!);
- }
-
-
-
-
-
-}
-
diff --git a/slices/builders/api/restricted_current.txt b/slices/builders/api/restricted_current.txt
deleted file mode 100644
index bb5d9b4..0000000
--- a/slices/builders/api/restricted_current.txt
+++ /dev/null
@@ -1,133 +0,0 @@
-// Signature format: 3.0
-package androidx.slice.builders {
-
- @RequiresApi(19) public class GridRowBuilder {
- }
-
- public static class GridRowBuilder.CellBuilder {
- }
-
- @RequiresApi(19) public class ListBuilder extends androidx.slice.builders.TemplateSliceBuilder {
- }
-
- public static class ListBuilder.HeaderBuilder {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public ListBuilder.HeaderBuilder(android.net.Uri!);
- }
-
-
- public static class ListBuilder.InputRangeBuilder {
- }
-
-
- public static class ListBuilder.RangeBuilder {
- }
-
- public static class ListBuilder.RowBuilder {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public class MessagingSliceBuilder extends androidx.slice.builders.TemplateSliceBuilder {
- ctor public MessagingSliceBuilder(android.content.Context, android.net.Uri);
- method public androidx.slice.builders.MessagingSliceBuilder! add(androidx.slice.builders.MessagingSliceBuilder.MessageBuilder!);
- method public androidx.slice.builders.MessagingSliceBuilder! add(androidx.core.util.Consumer<androidx.slice.builders.MessagingSliceBuilder.MessageBuilder>!);
- field public static final int MAXIMUM_RETAINED_MESSAGES = 50; // 0x32
- }
-
- public static final class MessagingSliceBuilder.MessageBuilder extends androidx.slice.builders.TemplateSliceBuilder {
- ctor public MessagingSliceBuilder.MessageBuilder(androidx.slice.builders.MessagingSliceBuilder!);
- method @RequiresApi(23) public androidx.slice.builders.MessagingSliceBuilder.MessageBuilder! addSource(android.graphics.drawable.Icon!);
- method public androidx.slice.builders.MessagingSliceBuilder.MessageBuilder! addSource(androidx.core.graphics.drawable.IconCompat!);
- method public androidx.slice.builders.MessagingSliceBuilder.MessageBuilder! addText(CharSequence!);
- method public androidx.slice.builders.MessagingSliceBuilder.MessageBuilder! addTimestamp(long);
- }
-
- @RequiresApi(19) public class SelectionBuilder {
- }
-
- @RequiresApi(19) public class SliceAction implements androidx.slice.core.SliceAction {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceAction(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, @androidx.slice.builders.ListBuilder.ImageMode int, CharSequence);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceAction(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, CharSequence, boolean);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceAction(android.app.PendingIntent, CharSequence, boolean);
- }
-
- @RequiresApi(19) public abstract class TemplateSliceBuilder {
- }
-
-}
-
-package androidx.slice.builders.impl {
-
-
- public static final class GridRowBuilderListV1Impl.CellBuilderImpl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- method public void fillFrom(androidx.slice.builders.GridRowBuilder.CellBuilder!);
- }
-
-
-
-
- public static class ListBuilderImpl.HeaderBuilderImpl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- method public void apply(androidx.slice.Slice.Builder!);
- }
-
- public static class ListBuilderImpl.InputRangeBuilderImpl extends androidx.slice.builders.impl.ListBuilderImpl.RangeBuilderImpl {
- }
-
- public static class ListBuilderImpl.RangeBuilderImpl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- method public void apply(androidx.slice.Slice.Builder!);
- field protected CharSequence! mContentDescr;
- field protected int mLayoutDir;
- field protected int mMax;
- field protected int mMin;
- field protected androidx.slice.builders.SliceAction! mPrimaryAction;
- field protected CharSequence! mSubtitle;
- field protected CharSequence! mTitle;
- field protected int mValue;
- field protected boolean mValueSet;
- }
-
- public static class ListBuilderImpl.RowBuilderImpl extends androidx.slice.builders.impl.TemplateBuilderImpl {
- method protected void addEndItem(long);
- method public void apply(androidx.slice.Slice.Builder!);
- method protected void setSubtitle(CharSequence!);
- method protected void setTitleItem(androidx.core.graphics.drawable.IconCompat!, int);
- }
-
-
- public static final class MessagingBasicImpl.MessageBuilder extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.MessagingBuilder.MessageBuilder {
- ctor public MessagingBasicImpl.MessageBuilder(androidx.slice.builders.impl.MessagingBasicImpl!);
- method @RequiresApi(23) public void addSource(android.graphics.drawable.Icon!);
- method public void addText(CharSequence!);
- method public void addTimestamp(long);
- method public void apply(androidx.slice.Slice.Builder!);
- }
-
-
- public static interface MessagingBuilder.MessageBuilder {
- method @RequiresApi(23) public void addSource(android.graphics.drawable.Icon!);
- method public void addText(CharSequence!);
- method public void addTimestamp(long);
- }
-
-
- public static final class MessagingListV1Impl.MessageBuilder extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.MessagingBuilder.MessageBuilder {
- ctor public MessagingListV1Impl.MessageBuilder(androidx.slice.builders.impl.MessagingListV1Impl!);
- method @RequiresApi(23) public void addSource(android.graphics.drawable.Icon!);
- method public void addText(CharSequence!);
- method public void addTimestamp(long);
- method public void apply(androidx.slice.Slice.Builder!);
- }
-
-
- public static final class MessagingV1Impl.MessageBuilder extends androidx.slice.builders.impl.TemplateBuilderImpl implements androidx.slice.builders.impl.MessagingBuilder.MessageBuilder {
- ctor public MessagingV1Impl.MessageBuilder(androidx.slice.builders.impl.MessagingV1Impl!);
- method @RequiresApi(23) public void addSource(android.graphics.drawable.Icon!);
- method public void addText(CharSequence!);
- method public void addTimestamp(long);
- method public void apply(androidx.slice.Slice.Builder!);
- }
-
-
-
-
-
-}
-
diff --git a/slices/builders/build.gradle b/slices/builders/build.gradle
index 368e052..48c52dc 100644
--- a/slices/builders/build.gradle
+++ b/slices/builders/build.gradle
@@ -26,8 +26,7 @@
implementation(project(":slice-core"))
api(project(":remotecallback"))
implementation project(":annotation")
- implementation project(':core')
- implementation project(':collection')
+ implementation project(path: ':core')
}
supportLibrary {
diff --git a/slices/builders/ktx/api/1.0.0-alpha07.txt b/slices/builders/ktx/api/1.0.0-alpha07.txt
deleted file mode 100644
index d1c4426..0000000
--- a/slices/builders/ktx/api/1.0.0-alpha07.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-// Signature format: 3.0
-package androidx.slice.builders {
-
- public final class CellBuilderDsl extends androidx.slice.builders.GridRowBuilder.CellBuilder {
- ctor public CellBuilderDsl();
- }
-
- public final class GridRowBuilderDsl extends androidx.slice.builders.GridRowBuilder {
- ctor public GridRowBuilderDsl();
- }
-
- public final class GridRowBuilderKt {
- ctor public GridRowBuilderKt();
- method public static inline androidx.slice.builders.GridRowBuilder cell(androidx.slice.builders.GridRowBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.CellBuilderDsl,kotlin.Unit> buildCell);
- method public static inline androidx.slice.builders.GridRowBuilder seeMoreCell(androidx.slice.builders.GridRowBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.CellBuilderDsl,kotlin.Unit> buildCell);
- }
-
- public final class HeaderBuilderDsl extends androidx.slice.builders.ListBuilder.HeaderBuilder {
- ctor public HeaderBuilderDsl();
- }
-
- public final class InputRangeBuilderDsl extends androidx.slice.builders.ListBuilder.InputRangeBuilder {
- ctor public InputRangeBuilderDsl();
- }
-
- public final class ListBuilderDsl extends androidx.slice.builders.ListBuilder {
- ctor public ListBuilderDsl(android.content.Context context, android.net.Uri uri, long ttl);
- }
-
- public final class ListBuilderKt {
- ctor public ListBuilderKt();
- method public static inline androidx.slice.builders.ListBuilder gridRow(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.GridRowBuilderDsl,kotlin.Unit> buildGrid);
- method public static inline androidx.slice.builders.ListBuilder header(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.HeaderBuilderDsl,kotlin.Unit> buildHeader);
- method public static inline androidx.slice.builders.ListBuilder inputRange(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.InputRangeBuilderDsl,kotlin.Unit> buildInputRange);
- method public static inline androidx.slice.Slice list(android.content.Context context, android.net.Uri uri, long ttl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.ListBuilderDsl,kotlin.Unit> addRows);
- method public static inline androidx.slice.builders.ListBuilder range(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RangeBuilderDsl,kotlin.Unit> buildRange);
- method public static inline androidx.slice.builders.ListBuilder row(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RowBuilderDsl,kotlin.Unit> buildRow);
- method public static inline androidx.slice.builders.ListBuilder seeMoreRow(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RowBuilderDsl,kotlin.Unit> buildRow);
- method public static androidx.slice.builders.SliceAction tapSliceAction(android.app.PendingIntent pendingIntent, androidx.core.graphics.drawable.IconCompat icon, @androidx.slice.builders.ListBuilder.ImageMode int imageMode = 0, CharSequence title);
- method public static androidx.slice.builders.SliceAction toggleSliceAction(android.app.PendingIntent pendingIntent, androidx.core.graphics.drawable.IconCompat? icon = null, CharSequence title, boolean isChecked);
- }
-
- public final class RangeBuilderDsl extends androidx.slice.builders.ListBuilder.RangeBuilder {
- ctor public RangeBuilderDsl();
- }
-
- public final class RowBuilderDsl extends androidx.slice.builders.ListBuilder.RowBuilder {
- ctor public RowBuilderDsl();
- }
-
-}
-
diff --git a/slices/builders/ktx/api/1.0.0-alpha6.txt b/slices/builders/ktx/api/1.0.0-alpha6.txt
index d1c4426..0d90542 100644
--- a/slices/builders/ktx/api/1.0.0-alpha6.txt
+++ b/slices/builders/ktx/api/1.0.0-alpha6.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slice.builders {
public final class CellBuilderDsl extends androidx.slice.builders.GridRowBuilder.CellBuilder {
@@ -11,8 +11,8 @@
public final class GridRowBuilderKt {
ctor public GridRowBuilderKt();
- method public static inline androidx.slice.builders.GridRowBuilder cell(androidx.slice.builders.GridRowBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.CellBuilderDsl,kotlin.Unit> buildCell);
- method public static inline androidx.slice.builders.GridRowBuilder seeMoreCell(androidx.slice.builders.GridRowBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.CellBuilderDsl,kotlin.Unit> buildCell);
+ method public static androidx.slice.builders.GridRowBuilder cell(androidx.slice.builders.GridRowBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.CellBuilderDsl,kotlin.Unit> buildCell);
+ method public static androidx.slice.builders.GridRowBuilder seeMoreCell(androidx.slice.builders.GridRowBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.CellBuilderDsl,kotlin.Unit> buildCell);
}
public final class HeaderBuilderDsl extends androidx.slice.builders.ListBuilder.HeaderBuilder {
@@ -29,13 +29,13 @@
public final class ListBuilderKt {
ctor public ListBuilderKt();
- method public static inline androidx.slice.builders.ListBuilder gridRow(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.GridRowBuilderDsl,kotlin.Unit> buildGrid);
- method public static inline androidx.slice.builders.ListBuilder header(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.HeaderBuilderDsl,kotlin.Unit> buildHeader);
- method public static inline androidx.slice.builders.ListBuilder inputRange(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.InputRangeBuilderDsl,kotlin.Unit> buildInputRange);
- method public static inline androidx.slice.Slice list(android.content.Context context, android.net.Uri uri, long ttl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.ListBuilderDsl,kotlin.Unit> addRows);
- method public static inline androidx.slice.builders.ListBuilder range(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RangeBuilderDsl,kotlin.Unit> buildRange);
- method public static inline androidx.slice.builders.ListBuilder row(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RowBuilderDsl,kotlin.Unit> buildRow);
- method public static inline androidx.slice.builders.ListBuilder seeMoreRow(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RowBuilderDsl,kotlin.Unit> buildRow);
+ method public static androidx.slice.builders.ListBuilder gridRow(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.GridRowBuilderDsl,kotlin.Unit> buildGrid);
+ method public static androidx.slice.builders.ListBuilder header(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.HeaderBuilderDsl,kotlin.Unit> buildHeader);
+ method public static androidx.slice.builders.ListBuilder inputRange(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.InputRangeBuilderDsl,kotlin.Unit> buildInputRange);
+ method public static androidx.slice.Slice list(android.content.Context context, android.net.Uri uri, long ttl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.ListBuilderDsl,kotlin.Unit> addRows);
+ method public static androidx.slice.builders.ListBuilder range(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RangeBuilderDsl,kotlin.Unit> buildRange);
+ method public static androidx.slice.builders.ListBuilder row(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RowBuilderDsl,kotlin.Unit> buildRow);
+ method public static androidx.slice.builders.ListBuilder seeMoreRow(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RowBuilderDsl,kotlin.Unit> buildRow);
method public static androidx.slice.builders.SliceAction tapSliceAction(android.app.PendingIntent pendingIntent, androidx.core.graphics.drawable.IconCompat icon, @androidx.slice.builders.ListBuilder.ImageMode int imageMode = 0, CharSequence title);
method public static androidx.slice.builders.SliceAction toggleSliceAction(android.app.PendingIntent pendingIntent, androidx.core.graphics.drawable.IconCompat? icon = null, CharSequence title, boolean isChecked);
}
diff --git a/slices/builders/ktx/api/current.txt b/slices/builders/ktx/api/current.txt
index d1c4426..0d90542 100644
--- a/slices/builders/ktx/api/current.txt
+++ b/slices/builders/ktx/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slice.builders {
public final class CellBuilderDsl extends androidx.slice.builders.GridRowBuilder.CellBuilder {
@@ -11,8 +11,8 @@
public final class GridRowBuilderKt {
ctor public GridRowBuilderKt();
- method public static inline androidx.slice.builders.GridRowBuilder cell(androidx.slice.builders.GridRowBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.CellBuilderDsl,kotlin.Unit> buildCell);
- method public static inline androidx.slice.builders.GridRowBuilder seeMoreCell(androidx.slice.builders.GridRowBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.CellBuilderDsl,kotlin.Unit> buildCell);
+ method public static androidx.slice.builders.GridRowBuilder cell(androidx.slice.builders.GridRowBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.CellBuilderDsl,kotlin.Unit> buildCell);
+ method public static androidx.slice.builders.GridRowBuilder seeMoreCell(androidx.slice.builders.GridRowBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.CellBuilderDsl,kotlin.Unit> buildCell);
}
public final class HeaderBuilderDsl extends androidx.slice.builders.ListBuilder.HeaderBuilder {
@@ -29,13 +29,13 @@
public final class ListBuilderKt {
ctor public ListBuilderKt();
- method public static inline androidx.slice.builders.ListBuilder gridRow(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.GridRowBuilderDsl,kotlin.Unit> buildGrid);
- method public static inline androidx.slice.builders.ListBuilder header(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.HeaderBuilderDsl,kotlin.Unit> buildHeader);
- method public static inline androidx.slice.builders.ListBuilder inputRange(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.InputRangeBuilderDsl,kotlin.Unit> buildInputRange);
- method public static inline androidx.slice.Slice list(android.content.Context context, android.net.Uri uri, long ttl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.ListBuilderDsl,kotlin.Unit> addRows);
- method public static inline androidx.slice.builders.ListBuilder range(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RangeBuilderDsl,kotlin.Unit> buildRange);
- method public static inline androidx.slice.builders.ListBuilder row(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RowBuilderDsl,kotlin.Unit> buildRow);
- method public static inline androidx.slice.builders.ListBuilder seeMoreRow(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RowBuilderDsl,kotlin.Unit> buildRow);
+ method public static androidx.slice.builders.ListBuilder gridRow(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.GridRowBuilderDsl,kotlin.Unit> buildGrid);
+ method public static androidx.slice.builders.ListBuilder header(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.HeaderBuilderDsl,kotlin.Unit> buildHeader);
+ method public static androidx.slice.builders.ListBuilder inputRange(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.InputRangeBuilderDsl,kotlin.Unit> buildInputRange);
+ method public static androidx.slice.Slice list(android.content.Context context, android.net.Uri uri, long ttl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.ListBuilderDsl,kotlin.Unit> addRows);
+ method public static androidx.slice.builders.ListBuilder range(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RangeBuilderDsl,kotlin.Unit> buildRange);
+ method public static androidx.slice.builders.ListBuilder row(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RowBuilderDsl,kotlin.Unit> buildRow);
+ method public static androidx.slice.builders.ListBuilder seeMoreRow(androidx.slice.builders.ListBuilderDsl, kotlin.jvm.functions.Function1<? super androidx.slice.builders.RowBuilderDsl,kotlin.Unit> buildRow);
method public static androidx.slice.builders.SliceAction tapSliceAction(android.app.PendingIntent pendingIntent, androidx.core.graphics.drawable.IconCompat icon, @androidx.slice.builders.ListBuilder.ImageMode int imageMode = 0, CharSequence title);
method public static androidx.slice.builders.SliceAction toggleSliceAction(android.app.PendingIntent pendingIntent, androidx.core.graphics.drawable.IconCompat? icon = null, CharSequence title, boolean isChecked);
}
diff --git a/slices/builders/ktx/api/res-1.0.0-alpha07.txt b/slices/builders/ktx/api/res-1.0.0-alpha07.txt
deleted file mode 100644
index e69de29..0000000
--- a/slices/builders/ktx/api/res-1.0.0-alpha07.txt
+++ /dev/null
diff --git a/slices/builders/ktx/api/restricted_1.0.0-alpha07.txt b/slices/builders/ktx/api/restricted_1.0.0-alpha07.txt
deleted file mode 100644
index ad5f46d..0000000
--- a/slices/builders/ktx/api/restricted_1.0.0-alpha07.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-// Signature format: 3.0
-package androidx.slice.builders {
-
- @RestrictTo({LIBRARY}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface SliceMarker {
- }
-
-}
-
diff --git a/slices/builders/ktx/api/restricted_current.txt b/slices/builders/ktx/api/restricted_current.txt
deleted file mode 100644
index ad5f46d..0000000
--- a/slices/builders/ktx/api/restricted_current.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-// Signature format: 3.0
-package androidx.slice.builders {
-
- @RestrictTo({LIBRARY}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface SliceMarker {
- }
-
-}
-
diff --git a/slices/builders/ktx/src/androidTest/java/androidx/slice/builders/SliceBuildersKtxTest.kt b/slices/builders/ktx/src/androidTest/java/androidx/slice/builders/SliceBuildersKtxTest.kt
index 2a06809..f7dfb6a 100644
--- a/slices/builders/ktx/src/androidTest/java/androidx/slice/builders/SliceBuildersKtxTest.kt
+++ b/slices/builders/ktx/src/androidTest/java/androidx/slice/builders/SliceBuildersKtxTest.kt
@@ -25,13 +25,11 @@
import androidx.slice.builders.ListBuilder.ICON_IMAGE
import androidx.slice.builders.ktx.test.R
import androidx.test.core.app.ApplicationProvider
-import androidx.test.filters.MediumTest
import androidx.test.filters.SdkSuppress
import org.junit.Assert.assertEquals
import org.junit.Test
@SdkSuppress(minSdkVersion = 19)
-@MediumTest
class SliceBuildersKtxTest {
private val testUri = Uri.parse("content://com.example.android.sliceuri")
private val context = ApplicationProvider.getApplicationContext() as android.content.Context
diff --git a/slices/builders/src/main/java/androidx/slice/builders/ListBuilder.java b/slices/builders/src/main/java/androidx/slice/builders/ListBuilder.java
index abada04..bb01603 100644
--- a/slices/builders/src/main/java/androidx/slice/builders/ListBuilder.java
+++ b/slices/builders/src/main/java/androidx/slice/builders/ListBuilder.java
@@ -17,7 +17,7 @@
package androidx.slice.builders;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.PendingIntent;
import android.content.Context;
@@ -37,7 +37,7 @@
import androidx.slice.Slice;
import androidx.slice.SliceSpecs;
import androidx.slice.builders.impl.ListBuilderBasicImpl;
-import androidx.slice.builders.impl.ListBuilderImpl;
+import androidx.slice.builders.impl.ListBuilderV1Impl;
import androidx.slice.builders.impl.TemplateBuilderImpl;
import androidx.slice.core.SliceHints;
@@ -435,12 +435,10 @@
*/
@RestrictTo(LIBRARY)
@Override
- protected TemplateBuilderImpl selectImpl() {
- if (checkCompatible(SliceSpecs.LIST_V2)) {
- return new ListBuilderImpl(getBuilder(), SliceSpecs.LIST_V2, getClock());
- } else if (checkCompatible(SliceSpecs.LIST)) {
- return new ListBuilderImpl(getBuilder(), SliceSpecs.LIST, getClock());
- } else if (checkCompatible(SliceSpecs.BASIC)) {
+ protected TemplateBuilderImpl selectImpl(Uri uri) {
+ if (checkCompatible(SliceSpecs.LIST, uri)) {
+ return new ListBuilderV1Impl(getBuilder(), SliceSpecs.LIST, getClock());
+ } else if (checkCompatible(SliceSpecs.BASIC, uri)) {
return new ListBuilderBasicImpl(getBuilder(), SliceSpecs.BASIC);
}
return null;
@@ -1470,7 +1468,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public HeaderBuilder(Uri uri) {
mUri = uri;
}
diff --git a/slices/builders/src/main/java/androidx/slice/builders/MessagingSliceBuilder.java b/slices/builders/src/main/java/androidx/slice/builders/MessagingSliceBuilder.java
index e91c43f..8b9b6cf 100644
--- a/slices/builders/src/main/java/androidx/slice/builders/MessagingSliceBuilder.java
+++ b/slices/builders/src/main/java/androidx/slice/builders/MessagingSliceBuilder.java
@@ -17,7 +17,7 @@
package androidx.slice.builders;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.drawable.Icon;
@@ -40,7 +40,7 @@
* Builder to construct slice content in a messaging format.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
public class MessagingSliceBuilder extends TemplateSliceBuilder {
@@ -87,12 +87,12 @@
*/
@RestrictTo(LIBRARY)
@Override
- protected TemplateBuilderImpl selectImpl() {
- if (checkCompatible(SliceSpecs.MESSAGING)) {
+ protected TemplateBuilderImpl selectImpl(Uri uri) {
+ if (checkCompatible(SliceSpecs.MESSAGING, uri)) {
return new MessagingV1Impl(getBuilder(), SliceSpecs.MESSAGING);
- } else if (checkCompatible(SliceSpecs.LIST)) {
+ } else if (checkCompatible(SliceSpecs.LIST, uri)) {
return new MessagingListV1Impl(getBuilder(), SliceSpecs.LIST);
- } else if (checkCompatible(SliceSpecs.BASIC)) {
+ } else if (checkCompatible(SliceSpecs.BASIC, uri)) {
return new MessagingBasicImpl(getBuilder(), SliceSpecs.BASIC);
}
return null;
diff --git a/slices/builders/src/main/java/androidx/slice/builders/SliceAction.java b/slices/builders/src/main/java/androidx/slice/builders/SliceAction.java
index 3906a39..3fbe6fd 100644
--- a/slices/builders/src/main/java/androidx/slice/builders/SliceAction.java
+++ b/slices/builders/src/main/java/androidx/slice/builders/SliceAction.java
@@ -17,7 +17,6 @@
package androidx.slice.builders;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.slice.builders.ListBuilder.ICON_IMAGE;
import android.app.PendingIntent;
@@ -104,7 +103,7 @@
* @see ListBuilder#LARGE_IMAGE
* @hide
*/
- @RestrictTo(LIBRARY_GROUP)
+ @RestrictTo(LIBRARY)
public SliceAction(@NonNull PendingIntent action, @NonNull IconCompat actionIcon,
@ListBuilder.ImageMode int imageMode, @NonNull CharSequence actionTitle) {
mSliceAction = new SliceActionImpl(action, actionIcon, imageMode, actionTitle);
@@ -121,7 +120,7 @@
* @param isChecked the state of the toggle.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP)
+ @RestrictTo(LIBRARY)
public SliceAction(@NonNull PendingIntent action, @NonNull IconCompat actionIcon,
@NonNull CharSequence actionTitle, boolean isChecked) {
mSliceAction = new SliceActionImpl(action, actionIcon, actionTitle, isChecked);
@@ -136,7 +135,7 @@
* @param isChecked the state of the toggle.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP)
+ @RestrictTo(LIBRARY)
public SliceAction(@NonNull PendingIntent action, @NonNull CharSequence actionTitle,
boolean isChecked) {
mSliceAction = new SliceActionImpl(action, actionTitle, isChecked);
diff --git a/slices/builders/src/main/java/androidx/slice/builders/TemplateSliceBuilder.java b/slices/builders/src/main/java/androidx/slice/builders/TemplateSliceBuilder.java
index dd9464c..763a46f 100644
--- a/slices/builders/src/main/java/androidx/slice/builders/TemplateSliceBuilder.java
+++ b/slices/builders/src/main/java/androidx/slice/builders/TemplateSliceBuilder.java
@@ -69,7 +69,7 @@
mBuilder = new Slice.Builder(uri);
mContext = context;
mSpecs = getSpecs(uri);
- mImpl = selectImpl();
+ mImpl = selectImpl(uri);
if (mImpl == null) {
throw new IllegalArgumentException("No valid specs found");
}
@@ -102,7 +102,7 @@
* @hide
*/
@RestrictTo(LIBRARY)
- protected TemplateBuilderImpl selectImpl() {
+ protected TemplateBuilderImpl selectImpl(Uri uri) {
return null;
}
@@ -110,7 +110,7 @@
* @hide
*/
@RestrictTo(LIBRARY)
- protected boolean checkCompatible(SliceSpec candidate) {
+ protected boolean checkCompatible(SliceSpec candidate, Uri uri) {
final int size = mSpecs.size();
for (int i = 0; i < size; i++) {
if (mSpecs.get(i).canRender(candidate)) {
diff --git a/slices/builders/src/main/java/androidx/slice/builders/impl/GridRowBuilderListV1Impl.java b/slices/builders/src/main/java/androidx/slice/builders/impl/GridRowBuilderListV1Impl.java
index d519eeb..7dc2296 100644
--- a/slices/builders/src/main/java/androidx/slice/builders/impl/GridRowBuilderListV1Impl.java
+++ b/slices/builders/src/main/java/androidx/slice/builders/impl/GridRowBuilderListV1Impl.java
@@ -57,7 +57,7 @@
/**
*/
- public GridRowBuilderListV1Impl(@NonNull ListBuilderImpl parent, GridRowBuilder builder) {
+ public GridRowBuilderListV1Impl(@NonNull ListBuilderV1Impl parent, GridRowBuilder builder) {
super(parent.createChildBuilder(), null);
if (builder.getLayoutDirection() != -1) {
setLayoutDirection(builder.getLayoutDirection());
diff --git a/slices/builders/src/main/java/androidx/slice/builders/impl/ListBuilderImpl.java b/slices/builders/src/main/java/androidx/slice/builders/impl/ListBuilderImpl.java
deleted file mode 100644
index 9c7bb1a..0000000
--- a/slices/builders/src/main/java/androidx/slice/builders/impl/ListBuilderImpl.java
+++ /dev/null
@@ -1,781 +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.slice.builders.impl;
-
-import static android.app.slice.Slice.HINT_ACTIONS;
-import static android.app.slice.Slice.HINT_ERROR;
-import static android.app.slice.Slice.HINT_KEYWORDS;
-import static android.app.slice.Slice.HINT_LARGE;
-import static android.app.slice.Slice.HINT_LAST_UPDATED;
-import static android.app.slice.Slice.HINT_LIST_ITEM;
-import static android.app.slice.Slice.HINT_NO_TINT;
-import static android.app.slice.Slice.HINT_PARTIAL;
-import static android.app.slice.Slice.HINT_SEE_MORE;
-import static android.app.slice.Slice.HINT_SHORTCUT;
-import static android.app.slice.Slice.HINT_SUMMARY;
-import static android.app.slice.Slice.HINT_TITLE;
-import static android.app.slice.Slice.HINT_TTL;
-import static android.app.slice.Slice.SUBTYPE_COLOR;
-import static android.app.slice.Slice.SUBTYPE_CONTENT_DESCRIPTION;
-import static android.app.slice.Slice.SUBTYPE_LAYOUT_DIRECTION;
-import static android.app.slice.Slice.SUBTYPE_MAX;
-import static android.app.slice.Slice.SUBTYPE_RANGE;
-import static android.app.slice.Slice.SUBTYPE_VALUE;
-import static android.app.slice.SliceItem.FORMAT_ACTION;
-import static android.app.slice.SliceItem.FORMAT_SLICE;
-import static android.app.slice.SliceItem.FORMAT_TEXT;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.slice.builders.ListBuilder.ICON_IMAGE;
-import static androidx.slice.builders.ListBuilder.INFINITY;
-import static androidx.slice.builders.ListBuilder.LARGE_IMAGE;
-import static androidx.slice.core.SliceHints.SUBTYPE_MILLIS;
-import static androidx.slice.core.SliceHints.SUBTYPE_MIN;
-
-import android.app.PendingIntent;
-import android.net.Uri;
-
-import androidx.annotation.ColorInt;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
-import androidx.annotation.RestrictTo;
-import androidx.core.graphics.drawable.IconCompat;
-import androidx.core.util.Pair;
-import androidx.slice.Clock;
-import androidx.slice.Slice;
-import androidx.slice.SliceItem;
-import androidx.slice.SliceSpec;
-import androidx.slice.SliceSpecs;
-import androidx.slice.SystemClock;
-import androidx.slice.builders.GridRowBuilder;
-import androidx.slice.builders.ListBuilder.HeaderBuilder;
-import androidx.slice.builders.ListBuilder.InputRangeBuilder;
-import androidx.slice.builders.ListBuilder.RangeBuilder;
-import androidx.slice.builders.ListBuilder.RowBuilder;
-import androidx.slice.builders.SelectionBuilder;
-import androidx.slice.builders.SliceAction;
-import androidx.slice.core.SliceQuery;
-
-import java.time.Duration;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @hide
- */
-@RestrictTo(LIBRARY)
-@RequiresApi(19)
-public class ListBuilderImpl extends TemplateBuilderImpl implements ListBuilder {
-
- private List<Slice> mSliceActions;
- private Set<String> mKeywords;
- private Slice mSliceHeader;
- private boolean mIsError;
- private boolean mFirstRowChecked;
- private boolean mIsFirstRowTypeValid;
- private boolean mFirstRowHasText;
-
- public ListBuilderImpl(Slice.Builder b, SliceSpec spec) {
- this(b, spec, new SystemClock());
- }
-
- /**
- */
- public ListBuilderImpl(Slice.Builder b, SliceSpec spec, Clock clock) {
- super(b, spec, clock);
- }
-
- /**
- */
- @Override
- public void apply(Slice.Builder builder) {
- builder.addLong(getClock().currentTimeMillis(), SUBTYPE_MILLIS, HINT_LAST_UPDATED);
- if (mSliceHeader != null) {
- builder.addSubSlice(mSliceHeader);
- }
- if (mSliceActions != null) {
- Slice.Builder sb = new Slice.Builder(builder);
- for (int i = 0; i < mSliceActions.size(); i++) {
- sb.addSubSlice(mSliceActions.get(i));
- }
- builder.addSubSlice(sb.addHints(HINT_ACTIONS).build());
- }
- if (mIsError) {
- builder.addHints(HINT_ERROR);
- }
- if (mKeywords != null) {
- Slice.Builder sb = new Slice.Builder(getBuilder());
- for (String keyword : mKeywords) {
- sb.addText(keyword, null);
- }
- getBuilder().addSubSlice(sb.addHints(HINT_KEYWORDS).build());
- }
- }
-
- /**
- * Construct the slice.
- */
- @Override
- public Slice build() {
- Slice slice = super.build();
- boolean isLoading = SliceQuery.find(slice, null, HINT_PARTIAL, null) != null;
- boolean isEmpty = SliceQuery.find(slice, FORMAT_SLICE, HINT_LIST_ITEM, null) == null;
- String[] hints = new String[] {HINT_SHORTCUT, HINT_TITLE};
- SliceItem action = SliceQuery.find(slice, FORMAT_ACTION, hints, null);
- List<SliceItem> possiblePrimaries = SliceQuery.findAll(slice, FORMAT_SLICE, hints, null);
- if (!isLoading && !isEmpty && action == null
- && (possiblePrimaries == null || possiblePrimaries.isEmpty())) {
- throw new IllegalStateException("A slice requires a primary action; ensure one of your "
- + "builders has called #setPrimaryAction with a valid SliceAction.");
- }
- if (mFirstRowChecked && !mIsFirstRowTypeValid) {
- throw new IllegalStateException("A slice cannot have the first row be"
- + " constructed from a GridRowBuilder, consider using #setHeader.");
- }
- if (mFirstRowChecked && !mFirstRowHasText) {
- throw new IllegalStateException("A slice requires the first row to have some text.");
- }
- return slice;
- }
-
- /**
- * Add a row to list builder.
- */
- @NonNull
- @Override
- public void addRow(@NonNull RowBuilder builder) {
- RowBuilderImpl impl = new RowBuilderImpl(createChildBuilder());
- impl.fillFrom(builder);
- checkRow(true, impl.hasText());
- addRow(impl);
- }
-
- /**
- * Add a row to list builder.
- */
- @NonNull
- public void addRow(@NonNull RowBuilderImpl builder) {
- checkRow(true, builder.hasText());
- builder.getBuilder().addHints(HINT_LIST_ITEM);
- getBuilder().addSubSlice(builder.build());
- }
-
- /**
- */
- @NonNull
- @Override
- public void addGridRow(@NonNull GridRowBuilder builder) {
- checkRow(false, false);
- GridRowBuilderListV1Impl impl = new GridRowBuilderListV1Impl(this, builder);
- impl.getBuilder().addHints(HINT_LIST_ITEM);
- getBuilder().addSubSlice(impl.build());
- }
-
- /**
- */
- @Override
- public void setHeader(@NonNull HeaderBuilder builder) {
- mIsFirstRowTypeValid = true;
- mFirstRowHasText = true;
- mFirstRowChecked = true;
- HeaderBuilderImpl impl = new HeaderBuilderImpl(this);
- impl.fillFrom(builder);
- mSliceHeader = impl.build();
- }
-
- /**
- */
- @Override
- public void addAction(@NonNull SliceAction action) {
- if (mSliceActions == null) {
- mSliceActions = new ArrayList<>();
- }
- Slice.Builder b = new Slice.Builder(getBuilder()).addHints(HINT_ACTIONS);
- mSliceActions.add(action.buildSlice(b));
- }
-
- @Override
- public void addInputRange(InputRangeBuilder builder) {
- InputRangeBuilderImpl impl = new InputRangeBuilderImpl(createChildBuilder(), builder);
- checkRow(true, impl.hasText());
- getBuilder().addSubSlice(impl.build(), SUBTYPE_RANGE);
- }
-
- @Override
- public void addRange(RangeBuilder builder) {
- RangeBuilderImpl impl = new RangeBuilderImpl(createChildBuilder(), builder);
- checkRow(true, impl.hasText());
- getBuilder().addSubSlice(impl.build(), SUBTYPE_RANGE);
- }
-
- @Override
- public void addSelection(SelectionBuilder builder) {
- // TODO: It feels like this should live in SelectionBuilderImpl.
- SelectionBuilderImpl impl = getSpec().canRender(SliceSpecs.LIST_V2)
- ? new SelectionBuilderListV2Impl(createChildBuilder(), builder)
- : new SelectionBuilderBasicImpl(createChildBuilder(), builder);
- getBuilder().addSubSlice(impl.build());
- }
-
- /**
- */
- @Override
- public void setSeeMoreRow(RowBuilder builder) {
- RowBuilderImpl impl = new RowBuilderImpl(createChildBuilder());
- impl.fillFrom(builder);
- impl.getBuilder().addHints(HINT_SEE_MORE);
- getBuilder().addSubSlice(impl.build());
- }
-
- /**
- */
- @Override
- public void setSeeMoreAction(PendingIntent intent) {
- getBuilder().addSubSlice(
- new Slice.Builder(getBuilder())
- .addHints(HINT_SEE_MORE)
- .addAction(intent, new Slice.Builder(getBuilder())
- .addHints(HINT_SEE_MORE).build(), null)
- .build());
- }
-
- /**
- */
- @NonNull
- @Override
- public void setColor(@ColorInt int color) {
- getBuilder().addInt(color, SUBTYPE_COLOR);
- }
-
- /**
- */
- @Override
- public void setKeywords(@NonNull Set<String> keywords) {
- mKeywords = keywords;
- }
-
- /**
- */
- @Override
- public void setTtl(long ttl) {
- long expiry = ttl == INFINITY ? INFINITY : getClock().currentTimeMillis() + ttl;
- getBuilder().addTimestamp(expiry, SUBTYPE_MILLIS, HINT_TTL);
- }
-
- @Override
- @RequiresApi(26)
- public void setTtl(@Nullable Duration ttl) {
- setTtl(ttl == null ? INFINITY : ttl.toMillis());
- }
-
- @Override
- public void setIsError(boolean isError) {
- mIsError = isError;
- }
-
- @Override
- public void setLayoutDirection(int layoutDirection) {
- getBuilder().addInt(layoutDirection, SUBTYPE_LAYOUT_DIRECTION);
- }
-
- /**
- * There are some requirements that first row of a list is not a grid row and has some text.
- * This method helps check whether first row fulfils these requirements.
- */
- private void checkRow(boolean isTypeValid, boolean hasText) {
- if (!mFirstRowChecked) {
- mFirstRowChecked = true;
- mIsFirstRowTypeValid = isTypeValid;
- mFirstRowHasText = hasText;
- }
- }
-
- /**
- * Builder to construct an input row.
- */
- public static class RangeBuilderImpl extends TemplateBuilderImpl {
- protected int mMin = 0;
- protected int mMax = 100;
- protected int mValue = 0;
- protected boolean mValueSet = false;
- protected CharSequence mTitle;
- protected CharSequence mSubtitle;
- protected CharSequence mContentDescr;
- protected SliceAction mPrimaryAction;
- protected int mLayoutDir = -1;
-
- RangeBuilderImpl(Slice.Builder sb, RangeBuilder builder) {
- super(sb, null);
- if (builder != null) {
- mValueSet = builder.isValueSet();
- mMax = builder.getMax();
- mValue = builder.getValue();
- mTitle = builder.getTitle();
- mSubtitle = builder.getSubtitle();
- mContentDescr = builder.getContentDescription();
- mPrimaryAction = builder.getPrimaryAction();
- mLayoutDir = builder.getLayoutDirection();
- }
- }
-
- @Override
- public void apply(Slice.Builder builder) {
- if (!mValueSet) {
- // Unset, make it whatever min is
- mValue = mMin;
- }
- if (!(mMin <= mValue && mValue <= mMax && mMin < mMax)) {
- throw new IllegalArgumentException(
- "Invalid range values, min=" + mMin + ", value=" + mValue + ", max=" + mMax
- + " ensure value falls within (min, max) and min < max.");
- }
-
- if (mTitle != null) {
- builder.addText(mTitle, null, HINT_TITLE);
- }
- if (mSubtitle != null) {
- builder.addText(mSubtitle, null);
- }
- if (mContentDescr != null) {
- builder.addText(mContentDescr, SUBTYPE_CONTENT_DESCRIPTION);
- }
- if (mPrimaryAction != null) {
- mPrimaryAction.setPrimaryAction(builder);
- }
- if (mLayoutDir != -1) {
- builder.addInt(mLayoutDir, SUBTYPE_LAYOUT_DIRECTION);
- }
- builder.addHints(HINT_LIST_ITEM)
- .addInt(mMin, SUBTYPE_MIN)
- .addInt(mMax, SUBTYPE_MAX)
- .addInt(mValue, SUBTYPE_VALUE);
- }
- boolean hasText() {
- return mTitle != null || mSubtitle != null;
- }
- }
-
- /**
- * Builder to construct an input range row.
- */
- public static class InputRangeBuilderImpl extends RangeBuilderImpl {
- private PendingIntent mAction;
- private IconCompat mThumb;
-
- InputRangeBuilderImpl(Slice.Builder sb, InputRangeBuilder builder) {
- super(sb, null);
- mValueSet = builder.isValueSet();
- mMin = builder.getMin();
- mMax = builder.getMax();
- mValue = builder.getValue();
- mTitle = builder.getTitle();
- mSubtitle = builder.getSubtitle();
- mContentDescr = builder.getContentDescription();
- mPrimaryAction = builder.getPrimaryAction();
- mLayoutDir = builder.getLayoutDirection();
- mAction = builder.getInputAction();
- mThumb = builder.getThumb();
- }
-
- @Override
- public void apply(Slice.Builder builder) {
- if (mAction == null) {
- throw new IllegalStateException("Input ranges must have an associated action.");
- }
- Slice.Builder sb = new Slice.Builder(builder);
- super.apply(sb);
- if (mThumb != null) {
- sb.addIcon(mThumb, null);
- }
- builder.addAction(mAction, sb.build(), SUBTYPE_RANGE).addHints(HINT_LIST_ITEM);
- }
- }
-
- /**
- */
- public static class RowBuilderImpl extends TemplateBuilderImpl {
-
- private SliceAction mPrimaryAction;
- private SliceItem mTitleItem;
- private SliceItem mSubtitleItem;
- private Slice mStartItem;
- private ArrayList<Slice> mEndItems = new ArrayList<>();
- private CharSequence mContentDescr;
-
- /**
- */
- private RowBuilderImpl(@NonNull ListBuilderImpl parent) {
- super(parent.createChildBuilder(), null);
- }
-
- /**
- */
- private RowBuilderImpl(@NonNull Uri uri) {
- super(new Slice.Builder(uri), null);
- }
-
- /**
- */
- RowBuilderImpl(Slice.Builder builder) {
- super(builder, null);
- }
-
- void fillFrom(RowBuilder builder) {
- if (builder.getUri() != null) {
- setBuilder(new Slice.Builder(builder.getUri()));
- }
- setPrimaryAction(builder.getPrimaryAction());
- if (builder.getLayoutDirection() != -1) {
- setLayoutDirection(builder.getLayoutDirection());
- }
- if (builder.getTitleAction() != null || builder.isTitleActionLoading()) {
- setTitleItem(builder.getTitleAction(), builder.isTitleActionLoading());
- } else if (builder.getTitleIcon() != null || builder.isTitleItemLoading()) {
- setTitleItem(builder.getTitleIcon(), builder.getTitleImageMode(),
- builder.isTitleItemLoading());
- } else if (builder.getTimeStamp() != -1L) {
- setTitleItem(builder.getTimeStamp());
- }
- if (builder.getTitle() != null || builder.isTitleLoading()) {
- setTitle(builder.getTitle(), builder.isTitleLoading());
- }
- if (builder.getSubtitle() != null || builder.isSubtitleLoading()) {
- setSubtitle(builder.getSubtitle(), builder.isSubtitleLoading());
- }
- if (builder.getContentDescription() != null) {
- setContentDescription(builder.getContentDescription());
- }
- List<Object> endItems = builder.getEndItems();
- List<Integer> endTypes = builder.getEndTypes();
- List<Boolean> endLoads = builder.getEndLoads();
- for (int i = 0; i < endItems.size(); i++) {
- switch (endTypes.get(i)) {
- case RowBuilder.TYPE_TIMESTAMP:
- addEndItem((Long) endItems.get(i));
- break;
- case RowBuilder.TYPE_ACTION:
- addEndItem((SliceAction) endItems.get(i), endLoads.get(i));
- break;
- case RowBuilder.TYPE_ICON:
- Pair<IconCompat, Integer> pair =
- (Pair<IconCompat, Integer>) endItems.get(i);
- addEndItem(pair.first, pair.second, endLoads.get(i));
- break;
- }
- }
- }
-
- /**
- */
- @NonNull
- private void setTitleItem(long timeStamp) {
- mStartItem = new Slice.Builder(getBuilder())
- .addTimestamp(timeStamp, null).addHints(HINT_TITLE).build();
- }
-
- /**
- */
- @NonNull
- protected void setTitleItem(IconCompat icon, int imageMode) {
- setTitleItem(icon, imageMode, false /* isLoading */);
- }
-
- /**
- */
- @NonNull
- private void setTitleItem(IconCompat icon, int imageMode, boolean isLoading) {
- ArrayList<String> hints = new ArrayList<>();
- if (imageMode != ICON_IMAGE) {
- hints.add(HINT_NO_TINT);
- }
- if (imageMode == LARGE_IMAGE) {
- hints.add(HINT_LARGE);
- }
- if (isLoading) {
- hints.add(HINT_PARTIAL);
- }
- Slice.Builder sb = new Slice.Builder(getBuilder())
- .addIcon(icon, null /* subType */, hints);
- if (isLoading) {
- sb.addHints(HINT_PARTIAL);
- }
- mStartItem = sb.addHints(HINT_TITLE).build();
- }
-
- /**
- */
- @NonNull
- private void setTitleItem(@NonNull SliceAction action) {
- setTitleItem(action, false /* isLoading */);
- }
-
- /**
- */
- private void setTitleItem(SliceAction action, boolean isLoading) {
- Slice.Builder sb = new Slice.Builder(getBuilder()).addHints(HINT_TITLE);
- if (isLoading) {
- sb.addHints(HINT_PARTIAL);
- }
- mStartItem = action.buildSlice(sb);
- }
-
- /**
- */
- @NonNull
- private void setPrimaryAction(@NonNull SliceAction action) {
- mPrimaryAction = action;
- }
-
- /**
- */
- @NonNull
- private void setTitle(CharSequence title) {
- setTitle(title, false /* isLoading */);
- }
-
- /**
- */
- private void setTitle(CharSequence title, boolean isLoading) {
- mTitleItem = new SliceItem(title, FORMAT_TEXT, null, new String[] {HINT_TITLE});
- if (isLoading) {
- mTitleItem.addHint(HINT_PARTIAL);
- }
- }
-
- /**
- */
- @NonNull
- protected void setSubtitle(CharSequence subtitle) {
- setSubtitle(subtitle, false /* isLoading */);
- }
-
- /**
- */
- private void setSubtitle(CharSequence subtitle, boolean isLoading) {
- mSubtitleItem = new SliceItem(subtitle, FORMAT_TEXT, null, new String[0]);
- if (isLoading) {
- mSubtitleItem.addHint(HINT_PARTIAL);
- }
- }
-
- /**
- */
- @NonNull
- protected void addEndItem(long timeStamp) {
- mEndItems.add(new Slice.Builder(getBuilder()).addTimestamp(timeStamp,
- null, new String[0]).build());
- }
-
- /**
- */
- @NonNull
- private void addEndItem(IconCompat icon, int imageMode) {
- addEndItem(icon, imageMode, false /* isLoading */);
- }
-
- /**
- */
- @NonNull
- private void addEndItem(IconCompat icon, int imageMode, boolean isLoading) {
- ArrayList<String> hints = new ArrayList<>();
- if (imageMode != ICON_IMAGE) {
- hints.add(HINT_NO_TINT);
- }
- if (imageMode == LARGE_IMAGE) {
- hints.add(HINT_LARGE);
- }
- if (isLoading) {
- hints.add(HINT_PARTIAL);
- }
- Slice.Builder sb = new Slice.Builder(getBuilder())
- .addIcon(icon, null /* subType */, hints);
- if (isLoading) {
- sb.addHints(HINT_PARTIAL);
- }
- mEndItems.add(sb.build());
- }
-
- /**
- */
- @NonNull
- private void addEndItem(@NonNull SliceAction action) {
- addEndItem(action, false /* isLoading */);
- }
-
- /**
- */
- private void addEndItem(@NonNull SliceAction action, boolean isLoading) {
- Slice.Builder sb = new Slice.Builder(getBuilder());
- if (isLoading) {
- sb.addHints(HINT_PARTIAL);
- }
- mEndItems.add(action.buildSlice(sb));
- }
-
- private void setContentDescription(CharSequence description) {
- mContentDescr = description;
- }
-
- private void setLayoutDirection(int layoutDirection) {
- getBuilder().addInt(layoutDirection, SUBTYPE_LAYOUT_DIRECTION);
- }
-
- boolean hasText() {
- return mTitleItem != null || mSubtitleItem != null;
- }
-
- /**
- */
- @Override
- public void apply(Slice.Builder b) {
- if (mStartItem != null) {
- b.addSubSlice(mStartItem);
- }
- if (mTitleItem != null) {
- b.addItem(mTitleItem);
- }
- if (mSubtitleItem != null) {
- b.addItem(mSubtitleItem);
- }
- for (int i = 0; i < mEndItems.size(); i++) {
- Slice item = mEndItems.get(i);
- b.addSubSlice(item);
- }
- if (mContentDescr != null) {
- b.addText(mContentDescr, SUBTYPE_CONTENT_DESCRIPTION);
- }
- if (mPrimaryAction != null) {
- mPrimaryAction.setPrimaryAction(b);
- }
- }
- }
-
- /**
- */
- public static class HeaderBuilderImpl extends TemplateBuilderImpl {
-
- private SliceItem mTitleItem;
- private SliceItem mSubtitleItem;
- private SliceItem mSummaryItem;
- private SliceAction mPrimaryAction;
- private CharSequence mContentDescr;
-
- /**
- */
- HeaderBuilderImpl(@NonNull ListBuilderImpl parent) {
- super(parent.createChildBuilder(), null);
- }
-
- /**
- */
- private HeaderBuilderImpl(@NonNull Uri uri) {
- super(new Slice.Builder(uri), null);
- }
-
- void fillFrom(HeaderBuilder builder) {
- if (builder.getUri() != null) {
- setBuilder(new Slice.Builder(builder.getUri()));
- }
- setPrimaryAction(builder.getPrimaryAction());
- if (builder.getLayoutDirection() != -1) {
- setLayoutDirection(builder.getLayoutDirection());
- }
- if (builder.getTitle() != null || builder.isTitleLoading()) {
- setTitle(builder.getTitle(), builder.isTitleLoading());
- }
- if (builder.getSubtitle() != null || builder.isSubtitleLoading()) {
- setSubtitle(builder.getSubtitle(), builder.isSubtitleLoading());
- }
- if (builder.getSummary() != null || builder.isSummaryLoading()) {
- setSummary(builder.getSummary(), builder.isSummaryLoading());
- }
- if (builder.getContentDescription() != null) {
- setContentDescription(builder.getContentDescription());
- }
- }
-
- /**
- */
- @Override
- public void apply(Slice.Builder b) {
- if (mTitleItem != null) {
- b.addItem(mTitleItem);
- }
- if (mSubtitleItem != null) {
- b.addItem(mSubtitleItem);
- }
- if (mSummaryItem != null) {
- b.addItem(mSummaryItem);
- }
- if (mContentDescr != null) {
- b.addText(mContentDescr, SUBTYPE_CONTENT_DESCRIPTION);
- }
- if (mPrimaryAction != null) {
- mPrimaryAction.setPrimaryAction(b);
- }
- if (mSubtitleItem == null && mTitleItem == null) {
- throw new IllegalStateException("Header requires a title or subtitle to be set.");
- }
- }
-
- /**
- */
- private void setTitle(CharSequence title, boolean isLoading) {
- mTitleItem = new SliceItem(title, FORMAT_TEXT, null, new String[] {HINT_TITLE});
- if (isLoading) {
- mTitleItem.addHint(HINT_PARTIAL);
- }
- }
-
- /**
- */
- private void setSubtitle(CharSequence subtitle, boolean isLoading) {
- mSubtitleItem = new SliceItem(subtitle, FORMAT_TEXT, null, new String[0]);
- if (isLoading) {
- mSubtitleItem.addHint(HINT_PARTIAL);
- }
- }
-
- /**
- */
- private void setSummary(CharSequence summarySubtitle, boolean isLoading) {
- mSummaryItem = new SliceItem(summarySubtitle, FORMAT_TEXT, null,
- new String[] {HINT_SUMMARY});
- if (isLoading) {
- mSummaryItem.addHint(HINT_PARTIAL);
- }
- }
-
- /**
- */
- private void setPrimaryAction(SliceAction action) {
- mPrimaryAction = action;
- }
-
- /**
- */
- private void setContentDescription(CharSequence description) {
- mContentDescr = description;
- }
-
- private void setLayoutDirection(int layoutDirection) {
- getBuilder().addInt(layoutDirection, SUBTYPE_LAYOUT_DIRECTION);
- }
- }
-}
diff --git a/slices/builders/src/main/java/androidx/slice/builders/impl/ListBuilderV1Impl.java b/slices/builders/src/main/java/androidx/slice/builders/impl/ListBuilderV1Impl.java
new file mode 100644
index 0000000..c7e51a7
--- /dev/null
+++ b/slices/builders/src/main/java/androidx/slice/builders/impl/ListBuilderV1Impl.java
@@ -0,0 +1,777 @@
+/*
+ * 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.slice.builders.impl;
+
+import static android.app.slice.Slice.HINT_ACTIONS;
+import static android.app.slice.Slice.HINT_ERROR;
+import static android.app.slice.Slice.HINT_KEYWORDS;
+import static android.app.slice.Slice.HINT_LARGE;
+import static android.app.slice.Slice.HINT_LAST_UPDATED;
+import static android.app.slice.Slice.HINT_LIST_ITEM;
+import static android.app.slice.Slice.HINT_NO_TINT;
+import static android.app.slice.Slice.HINT_PARTIAL;
+import static android.app.slice.Slice.HINT_SEE_MORE;
+import static android.app.slice.Slice.HINT_SHORTCUT;
+import static android.app.slice.Slice.HINT_SUMMARY;
+import static android.app.slice.Slice.HINT_TITLE;
+import static android.app.slice.Slice.HINT_TTL;
+import static android.app.slice.Slice.SUBTYPE_COLOR;
+import static android.app.slice.Slice.SUBTYPE_CONTENT_DESCRIPTION;
+import static android.app.slice.Slice.SUBTYPE_LAYOUT_DIRECTION;
+import static android.app.slice.Slice.SUBTYPE_MAX;
+import static android.app.slice.Slice.SUBTYPE_RANGE;
+import static android.app.slice.Slice.SUBTYPE_VALUE;
+import static android.app.slice.SliceItem.FORMAT_ACTION;
+import static android.app.slice.SliceItem.FORMAT_SLICE;
+import static android.app.slice.SliceItem.FORMAT_TEXT;
+
+import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.slice.builders.ListBuilder.ICON_IMAGE;
+import static androidx.slice.builders.ListBuilder.INFINITY;
+import static androidx.slice.builders.ListBuilder.LARGE_IMAGE;
+import static androidx.slice.core.SliceHints.SUBTYPE_MILLIS;
+import static androidx.slice.core.SliceHints.SUBTYPE_MIN;
+
+import android.app.PendingIntent;
+import android.net.Uri;
+
+import androidx.annotation.ColorInt;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+import androidx.annotation.RestrictTo;
+import androidx.core.graphics.drawable.IconCompat;
+import androidx.core.util.Pair;
+import androidx.slice.Clock;
+import androidx.slice.Slice;
+import androidx.slice.SliceItem;
+import androidx.slice.SliceSpec;
+import androidx.slice.SystemClock;
+import androidx.slice.builders.GridRowBuilder;
+import androidx.slice.builders.ListBuilder.HeaderBuilder;
+import androidx.slice.builders.ListBuilder.InputRangeBuilder;
+import androidx.slice.builders.ListBuilder.RangeBuilder;
+import androidx.slice.builders.ListBuilder.RowBuilder;
+import androidx.slice.builders.SelectionBuilder;
+import androidx.slice.builders.SliceAction;
+import androidx.slice.core.SliceQuery;
+
+import java.time.Duration;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @hide
+ */
+@RestrictTo(LIBRARY)
+@RequiresApi(19)
+public class ListBuilderV1Impl extends TemplateBuilderImpl implements ListBuilder {
+
+ private List<Slice> mSliceActions;
+ private Set<String> mKeywords;
+ private Slice mSliceHeader;
+ private boolean mIsError;
+ private boolean mFirstRowChecked;
+ private boolean mIsFirstRowTypeValid;
+ private boolean mFirstRowHasText;
+
+ public ListBuilderV1Impl(Slice.Builder b, SliceSpec spec) {
+ this(b, spec, new SystemClock());
+ }
+
+ /**
+ */
+ public ListBuilderV1Impl(Slice.Builder b, SliceSpec spec, Clock clock) {
+ super(b, spec, clock);
+ }
+
+ /**
+ */
+ @Override
+ public void apply(Slice.Builder builder) {
+ builder.addLong(getClock().currentTimeMillis(), SUBTYPE_MILLIS, HINT_LAST_UPDATED);
+ if (mSliceHeader != null) {
+ builder.addSubSlice(mSliceHeader);
+ }
+ if (mSliceActions != null) {
+ Slice.Builder sb = new Slice.Builder(builder);
+ for (int i = 0; i < mSliceActions.size(); i++) {
+ sb.addSubSlice(mSliceActions.get(i));
+ }
+ builder.addSubSlice(sb.addHints(HINT_ACTIONS).build());
+ }
+ if (mIsError) {
+ builder.addHints(HINT_ERROR);
+ }
+ if (mKeywords != null) {
+ Slice.Builder sb = new Slice.Builder(getBuilder());
+ for (String keyword : mKeywords) {
+ sb.addText(keyword, null);
+ }
+ getBuilder().addSubSlice(sb.addHints(HINT_KEYWORDS).build());
+ }
+ }
+
+ /**
+ * Construct the slice.
+ */
+ @Override
+ public Slice build() {
+ Slice slice = super.build();
+ boolean isLoading = SliceQuery.find(slice, null, HINT_PARTIAL, null) != null;
+ boolean isEmpty = SliceQuery.find(slice, FORMAT_SLICE, HINT_LIST_ITEM, null) == null;
+ String[] hints = new String[] {HINT_SHORTCUT, HINT_TITLE};
+ SliceItem action = SliceQuery.find(slice, FORMAT_ACTION, hints, null);
+ List<SliceItem> possiblePrimaries = SliceQuery.findAll(slice, FORMAT_SLICE, hints, null);
+ if (!isLoading && !isEmpty && action == null
+ && (possiblePrimaries == null || possiblePrimaries.isEmpty())) {
+ throw new IllegalStateException("A slice requires a primary action; ensure one of your "
+ + "builders has called #setPrimaryAction with a valid SliceAction.");
+ }
+ if (mFirstRowChecked && !mIsFirstRowTypeValid) {
+ throw new IllegalStateException("A slice cannot have the first row be"
+ + " constructed from a GridRowBuilder, consider using #setHeader.");
+ }
+ if (mFirstRowChecked && !mFirstRowHasText) {
+ throw new IllegalStateException("A slice requires the first row to have some text.");
+ }
+ return slice;
+ }
+
+ /**
+ * Add a row to list builder.
+ */
+ @NonNull
+ @Override
+ public void addRow(@NonNull RowBuilder builder) {
+ RowBuilderImpl impl = new RowBuilderImpl(createChildBuilder());
+ impl.fillFrom(builder);
+ checkRow(true, impl.hasText());
+ addRow(impl);
+ }
+
+ /**
+ * Add a row to list builder.
+ */
+ @NonNull
+ public void addRow(@NonNull RowBuilderImpl builder) {
+ checkRow(true, builder.hasText());
+ builder.getBuilder().addHints(HINT_LIST_ITEM);
+ getBuilder().addSubSlice(builder.build());
+ }
+
+ /**
+ */
+ @NonNull
+ @Override
+ public void addGridRow(@NonNull GridRowBuilder builder) {
+ checkRow(false, false);
+ GridRowBuilderListV1Impl impl = new GridRowBuilderListV1Impl(this, builder);
+ impl.getBuilder().addHints(HINT_LIST_ITEM);
+ getBuilder().addSubSlice(impl.build());
+ }
+
+ /**
+ */
+ @Override
+ public void setHeader(@NonNull HeaderBuilder builder) {
+ mIsFirstRowTypeValid = true;
+ mFirstRowHasText = true;
+ mFirstRowChecked = true;
+ HeaderBuilderImpl impl = new HeaderBuilderImpl(this);
+ impl.fillFrom(builder);
+ mSliceHeader = impl.build();
+ }
+
+ /**
+ */
+ @Override
+ public void addAction(@NonNull SliceAction action) {
+ if (mSliceActions == null) {
+ mSliceActions = new ArrayList<>();
+ }
+ Slice.Builder b = new Slice.Builder(getBuilder()).addHints(HINT_ACTIONS);
+ mSliceActions.add(action.buildSlice(b));
+ }
+
+ @Override
+ public void addInputRange(InputRangeBuilder builder) {
+ InputRangeBuilderImpl impl = new InputRangeBuilderImpl(createChildBuilder(), builder);
+ checkRow(true, impl.hasText());
+ getBuilder().addSubSlice(impl.build(), SUBTYPE_RANGE);
+ }
+
+ @Override
+ public void addRange(RangeBuilder builder) {
+ RangeBuilderImpl impl = new RangeBuilderImpl(createChildBuilder(), builder);
+ checkRow(true, impl.hasText());
+ getBuilder().addSubSlice(impl.build(), SUBTYPE_RANGE);
+ }
+
+ @Override
+ public void addSelection(SelectionBuilder builder) {
+ SelectionBuilderImpl impl = new SelectionBuilderV1Impl(createChildBuilder(), builder);
+ getBuilder().addSubSlice(impl.build());
+ }
+
+ /**
+ */
+ @Override
+ public void setSeeMoreRow(RowBuilder builder) {
+ RowBuilderImpl impl = new RowBuilderImpl(createChildBuilder());
+ impl.fillFrom(builder);
+ impl.getBuilder().addHints(HINT_SEE_MORE);
+ getBuilder().addSubSlice(impl.build());
+ }
+
+ /**
+ */
+ @Override
+ public void setSeeMoreAction(PendingIntent intent) {
+ getBuilder().addSubSlice(
+ new Slice.Builder(getBuilder())
+ .addHints(HINT_SEE_MORE)
+ .addAction(intent, new Slice.Builder(getBuilder())
+ .addHints(HINT_SEE_MORE).build(), null)
+ .build());
+ }
+
+ /**
+ */
+ @NonNull
+ @Override
+ public void setColor(@ColorInt int color) {
+ getBuilder().addInt(color, SUBTYPE_COLOR);
+ }
+
+ /**
+ */
+ @Override
+ public void setKeywords(@NonNull Set<String> keywords) {
+ mKeywords = keywords;
+ }
+
+ /**
+ */
+ @Override
+ public void setTtl(long ttl) {
+ long expiry = ttl == INFINITY ? INFINITY : getClock().currentTimeMillis() + ttl;
+ getBuilder().addTimestamp(expiry, SUBTYPE_MILLIS, HINT_TTL);
+ }
+
+ @Override
+ @RequiresApi(26)
+ public void setTtl(@Nullable Duration ttl) {
+ setTtl(ttl == null ? INFINITY : ttl.toMillis());
+ }
+
+ @Override
+ public void setIsError(boolean isError) {
+ mIsError = isError;
+ }
+
+ @Override
+ public void setLayoutDirection(int layoutDirection) {
+ getBuilder().addInt(layoutDirection, SUBTYPE_LAYOUT_DIRECTION);
+ }
+
+ /**
+ * There are some requirements that first row of a list is not a grid row and has some text.
+ * This method helps check whether first row fulfils these requirements.
+ */
+ private void checkRow(boolean isTypeValid, boolean hasText) {
+ if (!mFirstRowChecked) {
+ mFirstRowChecked = true;
+ mIsFirstRowTypeValid = isTypeValid;
+ mFirstRowHasText = hasText;
+ }
+ }
+
+ /**
+ * Builder to construct an input row.
+ */
+ public static class RangeBuilderImpl extends TemplateBuilderImpl {
+ protected int mMin = 0;
+ protected int mMax = 100;
+ protected int mValue = 0;
+ protected boolean mValueSet = false;
+ protected CharSequence mTitle;
+ protected CharSequence mSubtitle;
+ protected CharSequence mContentDescr;
+ protected SliceAction mPrimaryAction;
+ protected int mLayoutDir = -1;
+
+ RangeBuilderImpl(Slice.Builder sb, RangeBuilder builder) {
+ super(sb, null);
+ if (builder != null) {
+ mValueSet = builder.isValueSet();
+ mMax = builder.getMax();
+ mValue = builder.getValue();
+ mTitle = builder.getTitle();
+ mSubtitle = builder.getSubtitle();
+ mContentDescr = builder.getContentDescription();
+ mPrimaryAction = builder.getPrimaryAction();
+ mLayoutDir = builder.getLayoutDirection();
+ }
+ }
+
+ @Override
+ public void apply(Slice.Builder builder) {
+ if (!mValueSet) {
+ // Unset, make it whatever min is
+ mValue = mMin;
+ }
+ if (!(mMin <= mValue && mValue <= mMax && mMin < mMax)) {
+ throw new IllegalArgumentException(
+ "Invalid range values, min=" + mMin + ", value=" + mValue + ", max=" + mMax
+ + " ensure value falls within (min, max) and min < max.");
+ }
+
+ if (mTitle != null) {
+ builder.addText(mTitle, null, HINT_TITLE);
+ }
+ if (mSubtitle != null) {
+ builder.addText(mSubtitle, null);
+ }
+ if (mContentDescr != null) {
+ builder.addText(mContentDescr, SUBTYPE_CONTENT_DESCRIPTION);
+ }
+ if (mPrimaryAction != null) {
+ mPrimaryAction.setPrimaryAction(builder);
+ }
+ if (mLayoutDir != -1) {
+ builder.addInt(mLayoutDir, SUBTYPE_LAYOUT_DIRECTION);
+ }
+ builder.addHints(HINT_LIST_ITEM)
+ .addInt(mMin, SUBTYPE_MIN)
+ .addInt(mMax, SUBTYPE_MAX)
+ .addInt(mValue, SUBTYPE_VALUE);
+ }
+ boolean hasText() {
+ return mTitle != null || mSubtitle != null;
+ }
+ }
+
+ /**
+ * Builder to construct an input range row.
+ */
+ public static class InputRangeBuilderImpl extends RangeBuilderImpl {
+ private PendingIntent mAction;
+ private IconCompat mThumb;
+
+ InputRangeBuilderImpl(Slice.Builder sb, InputRangeBuilder builder) {
+ super(sb, null);
+ mValueSet = builder.isValueSet();
+ mMin = builder.getMin();
+ mMax = builder.getMax();
+ mValue = builder.getValue();
+ mTitle = builder.getTitle();
+ mSubtitle = builder.getSubtitle();
+ mContentDescr = builder.getContentDescription();
+ mPrimaryAction = builder.getPrimaryAction();
+ mLayoutDir = builder.getLayoutDirection();
+ mAction = builder.getInputAction();
+ mThumb = builder.getThumb();
+ }
+
+ @Override
+ public void apply(Slice.Builder builder) {
+ if (mAction == null) {
+ throw new IllegalStateException("Input ranges must have an associated action.");
+ }
+ Slice.Builder sb = new Slice.Builder(builder);
+ super.apply(sb);
+ if (mThumb != null) {
+ sb.addIcon(mThumb, null);
+ }
+ builder.addAction(mAction, sb.build(), SUBTYPE_RANGE).addHints(HINT_LIST_ITEM);
+ }
+ }
+
+ /**
+ */
+ public static class RowBuilderImpl extends TemplateBuilderImpl {
+
+ private SliceAction mPrimaryAction;
+ private SliceItem mTitleItem;
+ private SliceItem mSubtitleItem;
+ private Slice mStartItem;
+ private ArrayList<Slice> mEndItems = new ArrayList<>();
+ private CharSequence mContentDescr;
+
+ /**
+ */
+ private RowBuilderImpl(@NonNull ListBuilderV1Impl parent) {
+ super(parent.createChildBuilder(), null);
+ }
+
+ /**
+ */
+ private RowBuilderImpl(@NonNull Uri uri) {
+ super(new Slice.Builder(uri), null);
+ }
+
+ /**
+ */
+ RowBuilderImpl(Slice.Builder builder) {
+ super(builder, null);
+ }
+
+ void fillFrom(RowBuilder builder) {
+ if (builder.getUri() != null) {
+ setBuilder(new Slice.Builder(builder.getUri()));
+ }
+ setPrimaryAction(builder.getPrimaryAction());
+ if (builder.getLayoutDirection() != -1) {
+ setLayoutDirection(builder.getLayoutDirection());
+ }
+ if (builder.getTitleAction() != null || builder.isTitleActionLoading()) {
+ setTitleItem(builder.getTitleAction(), builder.isTitleActionLoading());
+ } else if (builder.getTitleIcon() != null || builder.isTitleItemLoading()) {
+ setTitleItem(builder.getTitleIcon(), builder.getTitleImageMode(),
+ builder.isTitleItemLoading());
+ } else if (builder.getTimeStamp() != -1L) {
+ setTitleItem(builder.getTimeStamp());
+ }
+ if (builder.getTitle() != null || builder.isTitleLoading()) {
+ setTitle(builder.getTitle(), builder.isTitleLoading());
+ }
+ if (builder.getSubtitle() != null || builder.isSubtitleLoading()) {
+ setSubtitle(builder.getSubtitle(), builder.isSubtitleLoading());
+ }
+ if (builder.getContentDescription() != null) {
+ setContentDescription(builder.getContentDescription());
+ }
+ List<Object> endItems = builder.getEndItems();
+ List<Integer> endTypes = builder.getEndTypes();
+ List<Boolean> endLoads = builder.getEndLoads();
+ for (int i = 0; i < endItems.size(); i++) {
+ switch (endTypes.get(i)) {
+ case RowBuilder.TYPE_TIMESTAMP:
+ addEndItem((Long) endItems.get(i));
+ break;
+ case RowBuilder.TYPE_ACTION:
+ addEndItem((SliceAction) endItems.get(i), endLoads.get(i));
+ break;
+ case RowBuilder.TYPE_ICON:
+ Pair<IconCompat, Integer> pair =
+ (Pair<IconCompat, Integer>) endItems.get(i);
+ addEndItem(pair.first, pair.second, endLoads.get(i));
+ break;
+ }
+ }
+ }
+
+ /**
+ */
+ @NonNull
+ private void setTitleItem(long timeStamp) {
+ mStartItem = new Slice.Builder(getBuilder())
+ .addTimestamp(timeStamp, null).addHints(HINT_TITLE).build();
+ }
+
+ /**
+ */
+ @NonNull
+ protected void setTitleItem(IconCompat icon, int imageMode) {
+ setTitleItem(icon, imageMode, false /* isLoading */);
+ }
+
+ /**
+ */
+ @NonNull
+ private void setTitleItem(IconCompat icon, int imageMode, boolean isLoading) {
+ ArrayList<String> hints = new ArrayList<>();
+ if (imageMode != ICON_IMAGE) {
+ hints.add(HINT_NO_TINT);
+ }
+ if (imageMode == LARGE_IMAGE) {
+ hints.add(HINT_LARGE);
+ }
+ if (isLoading) {
+ hints.add(HINT_PARTIAL);
+ }
+ Slice.Builder sb = new Slice.Builder(getBuilder())
+ .addIcon(icon, null /* subType */, hints);
+ if (isLoading) {
+ sb.addHints(HINT_PARTIAL);
+ }
+ mStartItem = sb.addHints(HINT_TITLE).build();
+ }
+
+ /**
+ */
+ @NonNull
+ private void setTitleItem(@NonNull SliceAction action) {
+ setTitleItem(action, false /* isLoading */);
+ }
+
+ /**
+ */
+ private void setTitleItem(SliceAction action, boolean isLoading) {
+ Slice.Builder sb = new Slice.Builder(getBuilder()).addHints(HINT_TITLE);
+ if (isLoading) {
+ sb.addHints(HINT_PARTIAL);
+ }
+ mStartItem = action.buildSlice(sb);
+ }
+
+ /**
+ */
+ @NonNull
+ private void setPrimaryAction(@NonNull SliceAction action) {
+ mPrimaryAction = action;
+ }
+
+ /**
+ */
+ @NonNull
+ private void setTitle(CharSequence title) {
+ setTitle(title, false /* isLoading */);
+ }
+
+ /**
+ */
+ private void setTitle(CharSequence title, boolean isLoading) {
+ mTitleItem = new SliceItem(title, FORMAT_TEXT, null, new String[] {HINT_TITLE});
+ if (isLoading) {
+ mTitleItem.addHint(HINT_PARTIAL);
+ }
+ }
+
+ /**
+ */
+ @NonNull
+ protected void setSubtitle(CharSequence subtitle) {
+ setSubtitle(subtitle, false /* isLoading */);
+ }
+
+ /**
+ */
+ private void setSubtitle(CharSequence subtitle, boolean isLoading) {
+ mSubtitleItem = new SliceItem(subtitle, FORMAT_TEXT, null, new String[0]);
+ if (isLoading) {
+ mSubtitleItem.addHint(HINT_PARTIAL);
+ }
+ }
+
+ /**
+ */
+ @NonNull
+ protected void addEndItem(long timeStamp) {
+ mEndItems.add(new Slice.Builder(getBuilder()).addTimestamp(timeStamp,
+ null, new String[0]).build());
+ }
+
+ /**
+ */
+ @NonNull
+ private void addEndItem(IconCompat icon, int imageMode) {
+ addEndItem(icon, imageMode, false /* isLoading */);
+ }
+
+ /**
+ */
+ @NonNull
+ private void addEndItem(IconCompat icon, int imageMode, boolean isLoading) {
+ ArrayList<String> hints = new ArrayList<>();
+ if (imageMode != ICON_IMAGE) {
+ hints.add(HINT_NO_TINT);
+ }
+ if (imageMode == LARGE_IMAGE) {
+ hints.add(HINT_LARGE);
+ }
+ if (isLoading) {
+ hints.add(HINT_PARTIAL);
+ }
+ Slice.Builder sb = new Slice.Builder(getBuilder())
+ .addIcon(icon, null /* subType */, hints);
+ if (isLoading) {
+ sb.addHints(HINT_PARTIAL);
+ }
+ mEndItems.add(sb.build());
+ }
+
+ /**
+ */
+ @NonNull
+ private void addEndItem(@NonNull SliceAction action) {
+ addEndItem(action, false /* isLoading */);
+ }
+
+ /**
+ */
+ private void addEndItem(@NonNull SliceAction action, boolean isLoading) {
+ Slice.Builder sb = new Slice.Builder(getBuilder());
+ if (isLoading) {
+ sb.addHints(HINT_PARTIAL);
+ }
+ mEndItems.add(action.buildSlice(sb));
+ }
+
+ private void setContentDescription(CharSequence description) {
+ mContentDescr = description;
+ }
+
+ private void setLayoutDirection(int layoutDirection) {
+ getBuilder().addInt(layoutDirection, SUBTYPE_LAYOUT_DIRECTION);
+ }
+
+ boolean hasText() {
+ return mTitleItem != null || mSubtitleItem != null;
+ }
+
+ /**
+ */
+ @Override
+ public void apply(Slice.Builder b) {
+ if (mStartItem != null) {
+ b.addSubSlice(mStartItem);
+ }
+ if (mTitleItem != null) {
+ b.addItem(mTitleItem);
+ }
+ if (mSubtitleItem != null) {
+ b.addItem(mSubtitleItem);
+ }
+ for (int i = 0; i < mEndItems.size(); i++) {
+ Slice item = mEndItems.get(i);
+ b.addSubSlice(item);
+ }
+ if (mContentDescr != null) {
+ b.addText(mContentDescr, SUBTYPE_CONTENT_DESCRIPTION);
+ }
+ if (mPrimaryAction != null) {
+ mPrimaryAction.setPrimaryAction(b);
+ }
+ }
+ }
+
+ /**
+ */
+ public static class HeaderBuilderImpl extends TemplateBuilderImpl {
+
+ private SliceItem mTitleItem;
+ private SliceItem mSubtitleItem;
+ private SliceItem mSummaryItem;
+ private SliceAction mPrimaryAction;
+ private CharSequence mContentDescr;
+
+ /**
+ */
+ HeaderBuilderImpl(@NonNull ListBuilderV1Impl parent) {
+ super(parent.createChildBuilder(), null);
+ }
+
+ /**
+ */
+ private HeaderBuilderImpl(@NonNull Uri uri) {
+ super(new Slice.Builder(uri), null);
+ }
+
+ void fillFrom(HeaderBuilder builder) {
+ if (builder.getUri() != null) {
+ setBuilder(new Slice.Builder(builder.getUri()));
+ }
+ setPrimaryAction(builder.getPrimaryAction());
+ if (builder.getLayoutDirection() != -1) {
+ setLayoutDirection(builder.getLayoutDirection());
+ }
+ if (builder.getTitle() != null || builder.isTitleLoading()) {
+ setTitle(builder.getTitle(), builder.isTitleLoading());
+ }
+ if (builder.getSubtitle() != null || builder.isSubtitleLoading()) {
+ setSubtitle(builder.getSubtitle(), builder.isSubtitleLoading());
+ }
+ if (builder.getSummary() != null || builder.isSummaryLoading()) {
+ setSummary(builder.getSummary(), builder.isSummaryLoading());
+ }
+ if (builder.getContentDescription() != null) {
+ setContentDescription(builder.getContentDescription());
+ }
+ }
+
+ /**
+ */
+ @Override
+ public void apply(Slice.Builder b) {
+ if (mTitleItem != null) {
+ b.addItem(mTitleItem);
+ }
+ if (mSubtitleItem != null) {
+ b.addItem(mSubtitleItem);
+ }
+ if (mSummaryItem != null) {
+ b.addItem(mSummaryItem);
+ }
+ if (mContentDescr != null) {
+ b.addText(mContentDescr, SUBTYPE_CONTENT_DESCRIPTION);
+ }
+ if (mPrimaryAction != null) {
+ mPrimaryAction.setPrimaryAction(b);
+ }
+ if (mSubtitleItem == null && mTitleItem == null) {
+ throw new IllegalStateException("Header requires a title or subtitle to be set.");
+ }
+ }
+
+ /**
+ */
+ private void setTitle(CharSequence title, boolean isLoading) {
+ mTitleItem = new SliceItem(title, FORMAT_TEXT, null, new String[] {HINT_TITLE});
+ if (isLoading) {
+ mTitleItem.addHint(HINT_PARTIAL);
+ }
+ }
+
+ /**
+ */
+ private void setSubtitle(CharSequence subtitle, boolean isLoading) {
+ mSubtitleItem = new SliceItem(subtitle, FORMAT_TEXT, null, new String[0]);
+ if (isLoading) {
+ mSubtitleItem.addHint(HINT_PARTIAL);
+ }
+ }
+
+ /**
+ */
+ private void setSummary(CharSequence summarySubtitle, boolean isLoading) {
+ mSummaryItem = new SliceItem(summarySubtitle, FORMAT_TEXT, null,
+ new String[] {HINT_SUMMARY});
+ if (isLoading) {
+ mSummaryItem.addHint(HINT_PARTIAL);
+ }
+ }
+
+ /**
+ */
+ private void setPrimaryAction(SliceAction action) {
+ mPrimaryAction = action;
+ }
+
+ /**
+ */
+ private void setContentDescription(CharSequence description) {
+ mContentDescr = description;
+ }
+
+ private void setLayoutDirection(int layoutDirection) {
+ getBuilder().addInt(layoutDirection, SUBTYPE_LAYOUT_DIRECTION);
+ }
+ }
+}
diff --git a/slices/builders/src/main/java/androidx/slice/builders/impl/MessagingListV1Impl.java b/slices/builders/src/main/java/androidx/slice/builders/impl/MessagingListV1Impl.java
index 66d93d3..5c422c1 100644
--- a/slices/builders/src/main/java/androidx/slice/builders/impl/MessagingListV1Impl.java
+++ b/slices/builders/src/main/java/androidx/slice/builders/impl/MessagingListV1Impl.java
@@ -35,13 +35,13 @@
@RequiresApi(19)
public class MessagingListV1Impl extends TemplateBuilderImpl implements MessagingBuilder{
- private final ListBuilderImpl mListBuilder;
+ private final ListBuilderV1Impl mListBuilder;
/**
*/
public MessagingListV1Impl(Slice.Builder b, SliceSpec spec) {
super(b, spec);
- mListBuilder = new ListBuilderImpl(b, spec);
+ mListBuilder = new ListBuilderV1Impl(b, spec);
mListBuilder.setTtl(INFINITY);
}
@@ -71,7 +71,7 @@
*/
public static final class MessageBuilder extends TemplateBuilderImpl
implements MessagingBuilder.MessageBuilder {
- final ListBuilderImpl.RowBuilderImpl mListBuilder;
+ final ListBuilderV1Impl.RowBuilderImpl mListBuilder;
/**
*/
@@ -81,7 +81,7 @@
private MessageBuilder(Slice.Builder builder) {
super(builder, null);
- mListBuilder = new ListBuilderImpl.RowBuilderImpl(builder);
+ mListBuilder = new ListBuilderV1Impl.RowBuilderImpl(builder);
}
/**
diff --git a/slices/builders/src/main/java/androidx/slice/builders/impl/SelectionBuilderImpl.java b/slices/builders/src/main/java/androidx/slice/builders/impl/SelectionBuilderImpl.java
index 606c121..6cda69d 100644
--- a/slices/builders/src/main/java/androidx/slice/builders/impl/SelectionBuilderImpl.java
+++ b/slices/builders/src/main/java/androidx/slice/builders/impl/SelectionBuilderImpl.java
@@ -16,13 +16,13 @@
package androidx.slice.builders.impl;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.slice.Slice;
import androidx.slice.builders.SelectionBuilder;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+
/**
* @hide
*/
diff --git a/slices/builders/src/main/java/androidx/slice/builders/impl/SelectionBuilderListV2Impl.java b/slices/builders/src/main/java/androidx/slice/builders/impl/SelectionBuilderListV2Impl.java
deleted file mode 100644
index 2644ae0..0000000
--- a/slices/builders/src/main/java/androidx/slice/builders/impl/SelectionBuilderListV2Impl.java
+++ /dev/null
@@ -1,83 +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.slice.builders.impl;
-
-import static android.app.slice.Slice.HINT_SELECTED;
-import static android.app.slice.Slice.HINT_TITLE;
-import static android.app.slice.Slice.SUBTYPE_CONTENT_DESCRIPTION;
-import static android.app.slice.Slice.SUBTYPE_LAYOUT_DIRECTION;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.slice.core.SliceHints.HINT_SELECTION_OPTION_VALUE;
-import static androidx.slice.core.SliceHints.SUBTYPE_SELECTION_OPTION_KEY;
-
-import androidx.annotation.RequiresApi;
-import androidx.annotation.RestrictTo;
-import androidx.core.util.Pair;
-import androidx.slice.Slice;
-import androidx.slice.builders.SelectionBuilder;
-
-import java.util.List;
-
-/**
- * @hide
- */
-@RestrictTo(LIBRARY)
-@RequiresApi(19)
-public class SelectionBuilderListV2Impl extends SelectionBuilderImpl {
- public SelectionBuilderListV2Impl(Slice.Builder parentSliceBuilder,
- SelectionBuilder selectionBuilder) {
- super(parentSliceBuilder, selectionBuilder);
- }
-
- @Override
- public void apply(Slice.Builder sliceBuilder) {
- final SelectionBuilder selectionBuilder = getSelectionBuilder();
-
- selectionBuilder.check();
-
- selectionBuilder.getPrimaryAction().setPrimaryAction(sliceBuilder);
-
- if (selectionBuilder.getTitle() != null) {
- sliceBuilder.addText(selectionBuilder.getTitle(), null, HINT_TITLE);
- }
-
- if (selectionBuilder.getSubtitle() != null) {
- sliceBuilder.addText(selectionBuilder.getSubtitle(), null);
- }
-
- if (selectionBuilder.getContentDescription() != null) {
- sliceBuilder.addText(selectionBuilder.getContentDescription(),
- SUBTYPE_CONTENT_DESCRIPTION);
- }
-
- if (selectionBuilder.getLayoutDirection() != -1) {
- sliceBuilder.addInt(selectionBuilder.getLayoutDirection(), SUBTYPE_LAYOUT_DIRECTION);
- }
-
- final List<Pair<String, CharSequence>> options = selectionBuilder.getOptions();
- for (Pair<String, CharSequence> option : options) {
- final Slice.Builder optionSubSliceBuilder = new Slice.Builder(sliceBuilder);
- if (option.first.equals(selectionBuilder.getSelectedOption())) {
- optionSubSliceBuilder.addHints(HINT_SELECTED);
- }
- optionSubSliceBuilder.addText(option.first, SUBTYPE_SELECTION_OPTION_KEY);
- optionSubSliceBuilder.addText(option.second, null, HINT_SELECTION_OPTION_VALUE);
- sliceBuilder.addSubSlice(optionSubSliceBuilder.build());
- }
- }
-}
diff --git a/slices/builders/src/main/java/androidx/slice/builders/impl/SelectionBuilderV1Impl.java b/slices/builders/src/main/java/androidx/slice/builders/impl/SelectionBuilderV1Impl.java
new file mode 100644
index 0000000..b7696d3f
--- /dev/null
+++ b/slices/builders/src/main/java/androidx/slice/builders/impl/SelectionBuilderV1Impl.java
@@ -0,0 +1,83 @@
+/*
+ * 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.slice.builders.impl;
+
+import static android.app.slice.Slice.HINT_SELECTED;
+import static android.app.slice.Slice.HINT_TITLE;
+import static android.app.slice.Slice.SUBTYPE_CONTENT_DESCRIPTION;
+import static android.app.slice.Slice.SUBTYPE_LAYOUT_DIRECTION;
+
+import static androidx.annotation.RestrictTo.Scope.LIBRARY;
+import static androidx.slice.core.SliceHints.HINT_SELECTION_OPTION_VALUE;
+import static androidx.slice.core.SliceHints.SUBTYPE_SELECTION_OPTION_KEY;
+
+import androidx.annotation.RequiresApi;
+import androidx.annotation.RestrictTo;
+import androidx.core.util.Pair;
+import androidx.slice.Slice;
+import androidx.slice.builders.SelectionBuilder;
+
+import java.util.List;
+
+/**
+ * @hide
+ */
+@RestrictTo(LIBRARY)
+@RequiresApi(19)
+public class SelectionBuilderV1Impl extends SelectionBuilderImpl {
+ public SelectionBuilderV1Impl(Slice.Builder parentSliceBuilder,
+ SelectionBuilder selectionBuilder) {
+ super(parentSliceBuilder, selectionBuilder);
+ }
+
+ @Override
+ public void apply(Slice.Builder sliceBuilder) {
+ final SelectionBuilder selectionBuilder = getSelectionBuilder();
+
+ selectionBuilder.check();
+
+ selectionBuilder.getPrimaryAction().setPrimaryAction(sliceBuilder);
+
+ if (selectionBuilder.getTitle() != null) {
+ sliceBuilder.addText(selectionBuilder.getTitle(), null, HINT_TITLE);
+ }
+
+ if (selectionBuilder.getSubtitle() != null) {
+ sliceBuilder.addText(selectionBuilder.getSubtitle(), null);
+ }
+
+ if (selectionBuilder.getContentDescription() != null) {
+ sliceBuilder.addText(selectionBuilder.getContentDescription(),
+ SUBTYPE_CONTENT_DESCRIPTION);
+ }
+
+ if (selectionBuilder.getLayoutDirection() != -1) {
+ sliceBuilder.addInt(selectionBuilder.getLayoutDirection(), SUBTYPE_LAYOUT_DIRECTION);
+ }
+
+ final List<Pair<String, CharSequence>> options = selectionBuilder.getOptions();
+ for (Pair<String, CharSequence> option : options) {
+ final Slice.Builder optionSubSliceBuilder = new Slice.Builder(sliceBuilder);
+ if (option.first.equals(selectionBuilder.getSelectedOption())) {
+ optionSubSliceBuilder.addHints(HINT_SELECTED);
+ }
+ optionSubSliceBuilder.addText(option.first, SUBTYPE_SELECTION_OPTION_KEY);
+ optionSubSliceBuilder.addText(option.second, null, HINT_SELECTION_OPTION_VALUE);
+ sliceBuilder.addSubSlice(optionSubSliceBuilder.build());
+ }
+ }
+}
diff --git a/slices/builders/src/main/java/androidx/slice/builders/impl/TemplateBuilderImpl.java b/slices/builders/src/main/java/androidx/slice/builders/impl/TemplateBuilderImpl.java
index aea52eb..c2daac6 100644
--- a/slices/builders/src/main/java/androidx/slice/builders/impl/TemplateBuilderImpl.java
+++ b/slices/builders/src/main/java/androidx/slice/builders/impl/TemplateBuilderImpl.java
@@ -88,12 +88,4 @@
public Clock getClock() {
return mClock;
}
-
- /**
- * @hide
- */
- @RestrictTo(LIBRARY)
- public SliceSpec getSpec() {
- return mSpec;
- }
}
diff --git a/slices/core/api/1.0.0.txt b/slices/core/api/1.0.0.txt
index 74aa14c..6abecd0 100644
--- a/slices/core/api/1.0.0.txt
+++ b/slices/core/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slice {
@RequiresApi(19) public final class Slice extends androidx.versionedparcelable.CustomVersionedParcelable implements androidx.versionedparcelable.VersionedParcelable {
diff --git a/slices/core/api/1.1.0-alpha01.txt b/slices/core/api/1.1.0-alpha01.txt
index b1999c8..3c3e69a 100644
--- a/slices/core/api/1.1.0-alpha01.txt
+++ b/slices/core/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slice {
@RequiresApi(19) public final class Slice extends androidx.versionedparcelable.CustomVersionedParcelable implements androidx.versionedparcelable.VersionedParcelable {
@@ -45,7 +45,7 @@
method public final int delete(android.net.Uri, String?, String[]?);
method @RequiresApi(19) public java.util.List<android.net.Uri> getPinnedSlices();
method public final String! getType(android.net.Uri!);
- method @RequiresApi(19) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public Object! getWrapper();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) @RequiresApi(19) public Object! getWrapper();
method public final android.net.Uri? insert(android.net.Uri, android.content.ContentValues?);
method @RequiresApi(19) public abstract androidx.slice.Slice! onBindSlice(android.net.Uri!);
method public final boolean onCreate();
@@ -63,7 +63,7 @@
public abstract class SliceProviderWithCallbacks<T extends androidx.slice.SliceProviderWithCallbacks> extends androidx.slice.SliceProvider implements androidx.remotecallback.CallbackBase<T> androidx.remotecallback.CallbackReceiver<T> {
ctor public SliceProviderWithCallbacks();
method public T! createRemoteCallback(android.content.Context!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
}
}
diff --git a/slices/core/api/current.txt b/slices/core/api/current.txt
index b1999c8..3c3e69a 100644
--- a/slices/core/api/current.txt
+++ b/slices/core/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slice {
@RequiresApi(19) public final class Slice extends androidx.versionedparcelable.CustomVersionedParcelable implements androidx.versionedparcelable.VersionedParcelable {
@@ -45,7 +45,7 @@
method public final int delete(android.net.Uri, String?, String[]?);
method @RequiresApi(19) public java.util.List<android.net.Uri> getPinnedSlices();
method public final String! getType(android.net.Uri!);
- method @RequiresApi(19) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public Object! getWrapper();
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) @RequiresApi(19) public Object! getWrapper();
method public final android.net.Uri? insert(android.net.Uri, android.content.ContentValues?);
method @RequiresApi(19) public abstract androidx.slice.Slice! onBindSlice(android.net.Uri!);
method public final boolean onCreate();
@@ -63,7 +63,7 @@
public abstract class SliceProviderWithCallbacks<T extends androidx.slice.SliceProviderWithCallbacks> extends androidx.slice.SliceProvider implements androidx.remotecallback.CallbackBase<T> androidx.remotecallback.CallbackReceiver<T> {
ctor public SliceProviderWithCallbacks();
method public T! createRemoteCallback(android.content.Context!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
}
}
diff --git a/slices/core/api/restricted_1.0.0.txt b/slices/core/api/restricted_1.0.0.txt
deleted file mode 100644
index 1a4de71..0000000
--- a/slices/core/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,311 +0,0 @@
-// Signature format: 3.0
-package androidx.slice {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public interface Clock {
- method public long currentTimeMillis();
- }
-
- @RequiresApi(19) public final class Slice {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public Slice();
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public Slice(android.os.Bundle!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static void appendHints(StringBuilder!, String[]!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.slice.Slice? bindSlice(android.content.Context!, android.net.Uri, java.util.Set<androidx.slice.SliceSpec>!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.slice.SliceSpec? getSpec();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean hasHint(@androidx.slice.Slice.SliceHint String!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.os.Bundle! toBundle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public String! toString(String!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class Slice.Builder {
- ctor public Slice.Builder(android.net.Uri);
- ctor public Slice.Builder(androidx.slice.Slice.Builder);
- method public androidx.slice.Slice.Builder! addAction(android.app.PendingIntent, androidx.slice.Slice, String?);
- method public androidx.slice.Slice.Builder! addAction(androidx.slice.SliceItem.ActionHandler, androidx.slice.Slice, String?);
- method public androidx.slice.Slice.Builder! addHints(@androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addHints(@androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method public androidx.slice.Slice.Builder! addIcon(androidx.core.graphics.drawable.IconCompat!, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addIcon(androidx.core.graphics.drawable.IconCompat!, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method public androidx.slice.Slice.Builder! addInt(int, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addInt(int, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public androidx.slice.Slice.Builder! addItem(androidx.slice.SliceItem!);
- method public androidx.slice.Slice.Builder! addLong(long, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addLong(long, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.slice.Slice.Builder! addRemoteInput(android.app.RemoteInput!, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.slice.Slice.Builder! addRemoteInput(android.app.RemoteInput!, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addSubSlice(androidx.slice.Slice);
- method public androidx.slice.Slice.Builder! addSubSlice(androidx.slice.Slice, String!);
- method public androidx.slice.Slice.Builder! addText(CharSequence!, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addText(CharSequence!, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method @Deprecated public androidx.slice.Slice.Builder! addTimestamp(long, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addTimestamp(long, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method public androidx.slice.Slice! build();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.slice.Slice.Builder! setSpec(androidx.slice.SliceSpec!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public static @interface Slice.SliceHint {
- }
-
- @RequiresApi(28) public class SliceConvert {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static java.util.Set<androidx.slice.SliceSpec>! wrap(java.util.Set<android.app.slice.SliceSpec>!);
- }
-
- @RequiresApi(19) public final class SliceItem {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceItem(Object!, @androidx.slice.SliceItem.SliceType String!, String!, @androidx.slice.Slice.SliceHint String[]!);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceItem(Object!, @androidx.slice.SliceItem.SliceType String!, String!, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceItem();
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceItem(android.app.PendingIntent!, androidx.slice.Slice!, String!, String!, @androidx.slice.Slice.SliceHint String[]!);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceItem(androidx.slice.SliceItem.ActionHandler!, androidx.slice.Slice!, String!, String!, @androidx.slice.Slice.SliceHint String[]!);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceItem(android.os.Bundle!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void addHint(@androidx.slice.Slice.SliceHint String!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean fireActionInternal(android.content.Context?, android.content.Intent?);
- method @RequiresApi(20) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.app.RemoteInput! getRemoteInput();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public long getTimestamp();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean hasAnyHints(@androidx.slice.Slice.SliceHint java.lang.String...!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean hasHints(@androidx.slice.Slice.SliceHint String[]!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.os.Bundle! toBundle();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public String! toString(String!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static String! typeToString(String!);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @androidx.slice.Slice.SliceHint protected String[]! mHints;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static interface SliceItem.ActionHandler {
- method public void onAction(androidx.slice.SliceItem!, android.content.Context!, android.content.Intent!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public static @interface SliceItem.SliceType {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class SliceItemHolder {
- ctor public SliceItemHolder();
- ctor public SliceItemHolder(String!, Object!, boolean);
- method public Object! getObj(String!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final class SliceItemHolderParcelizer {
- ctor public SliceItemHolderParcelizer();
- method public static androidx.slice.SliceItemHolder! read(androidx.versionedparcelable.VersionedParcel!);
- method public static void write(androidx.slice.SliceItemHolder!, androidx.versionedparcelable.VersionedParcel!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final class SliceItemParcelizer {
- ctor public SliceItemParcelizer();
- method public static androidx.slice.SliceItem! read(androidx.versionedparcelable.VersionedParcel!);
- method public static void write(androidx.slice.SliceItem!, androidx.versionedparcelable.VersionedParcel!);
- }
-
- @RequiresApi(19) public abstract class SliceManager {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public abstract java.util.Set<androidx.slice.SliceSpec> getPinnedSpecs(android.net.Uri);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final class SliceParcelizer {
- ctor public SliceParcelizer();
- method public static androidx.slice.Slice! read(androidx.versionedparcelable.VersionedParcel!);
- method public static void write(androidx.slice.Slice!, androidx.versionedparcelable.VersionedParcel!);
- }
-
- public abstract class SliceProvider {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public static android.app.PendingIntent! createPermissionIntent(android.content.Context!, android.net.Uri!, String!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public static androidx.slice.Slice! createPermissionSlice(android.content.Context!, android.net.Uri!, String!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public static androidx.slice.Clock! getClock();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public static java.util.Set<androidx.slice.SliceSpec>! getCurrentSpecs();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public static CharSequence! getPermissionString(android.content.Context!, String!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public Object! getWrapper();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public void handleSlicePinned(android.net.Uri!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public void handleSliceUnpinned(android.net.Uri!);
- method @RequiresApi(19) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @VisibleForTesting protected androidx.slice.compat.CompatPermissionManager! onCreatePermissionManager(String[]!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public static void setClock(androidx.slice.Clock!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public static void setSpecs(java.util.Set<androidx.slice.SliceSpec>!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public final class SliceSpec {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceSpec();
- ctor public SliceSpec(String, int);
- method public boolean canRender(androidx.slice.SliceSpec);
- method public boolean equals(Object?);
- method public int getRevision();
- method public String! getType();
- method public int hashCode();
- method public String toString();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final class SliceSpecParcelizer {
- ctor public SliceSpecParcelizer();
- method public static androidx.slice.SliceSpec! read(androidx.versionedparcelable.VersionedParcel!);
- method public static void write(androidx.slice.SliceSpec!, androidx.versionedparcelable.VersionedParcel!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public class SliceSpecs {
- field public static final androidx.slice.SliceSpec! BASIC;
- field public static final androidx.slice.SliceSpec! LIST;
- field public static final androidx.slice.SliceSpec! MESSAGING;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public class SystemClock implements androidx.slice.Clock {
- ctor public SystemClock();
- method public long currentTimeMillis();
- }
-
-}
-
-package androidx.slice.compat {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class CompatPermissionManager {
- ctor public CompatPermissionManager(android.content.Context!, String!, int, String[]!);
- method public int checkSlicePermission(android.net.Uri!, int, int);
- method public void grantSlicePermission(android.net.Uri!, String!);
- method public void revokeSlicePermission(android.net.Uri!, String!);
- field public static final String ALL_SUFFIX = "_all";
- }
-
- public static class CompatPermissionManager.PermissionState {
- method public String! getKey();
- method public boolean hasAccess(java.util.List<java.lang.String>!);
- method public boolean hasAllPermissions();
- method public java.util.Set<java.lang.String>! toPersistable();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class CompatPinnedList {
- ctor public CompatPinnedList(android.content.Context!, String!);
- method public boolean addPin(android.net.Uri!, String!, java.util.Set<androidx.slice.SliceSpec>!);
- method @VisibleForTesting protected long getBootTime();
- method public java.util.List<android.net.Uri>! getPinnedSlices();
- method public androidx.collection.ArraySet<androidx.slice.SliceSpec>! getSpecs(android.net.Uri!);
- method public boolean removePin(android.net.Uri!, String!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class SlicePermissionActivity {
- ctor public SlicePermissionActivity();
- method public void onClick(android.content.DialogInterface!, int);
- method protected void onCreate(android.os.Bundle!);
- method public void onDestroy();
- method public void onDismiss(android.content.DialogInterface!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class SliceProviderCompat {
- ctor public SliceProviderCompat(androidx.slice.SliceProvider!, androidx.slice.compat.CompatPermissionManager!, android.content.Context!);
- method public static void addSpecs(android.os.Bundle!, java.util.Set<androidx.slice.SliceSpec>!);
- method public static androidx.slice.Slice! bindSlice(android.content.Context!, android.net.Uri!, java.util.Set<androidx.slice.SliceSpec>!);
- method public static androidx.slice.Slice! bindSlice(android.content.Context!, android.content.Intent!, java.util.Set<androidx.slice.SliceSpec>!);
- method public android.os.Bundle! call(String!, String!, android.os.Bundle!);
- method public static int checkSlicePermission(android.content.Context!, String!, android.net.Uri!, int, int);
- method public String! getCallingPackage();
- method public static java.util.List<android.net.Uri>! getPinnedSlices(android.content.Context!);
- method public static java.util.Set<androidx.slice.SliceSpec>! getPinnedSpecs(android.content.Context!, android.net.Uri!);
- method public static java.util.Collection<android.net.Uri> getSliceDescendants(android.content.Context!, android.net.Uri);
- method public static java.util.Set<androidx.slice.SliceSpec>! getSpecs(android.os.Bundle!);
- method public static void grantSlicePermission(android.content.Context!, String!, String!, android.net.Uri!);
- method public static android.net.Uri! mapIntentToUri(android.content.Context!, android.content.Intent!);
- method public static void pinSlice(android.content.Context!, android.net.Uri!, java.util.Set<androidx.slice.SliceSpec>!);
- method public static void revokeSlicePermission(android.content.Context!, String!, String!, android.net.Uri!);
- method public static void unpinSlice(android.content.Context!, android.net.Uri!, java.util.Set<androidx.slice.SliceSpec>!);
- field public static final String ARG_SUPPORTS_VERSIONED_PARCELABLE = "supports_versioned_parcelable";
- field public static final String EXTRA_BIND_URI = "slice_uri";
- field public static final String EXTRA_INTENT = "slice_intent";
- field public static final String EXTRA_PID = "pid";
- field public static final String EXTRA_PKG = "pkg";
- field public static final String EXTRA_PROVIDER_PKG = "provider_pkg";
- field public static final String EXTRA_RESULT = "result";
- field public static final String EXTRA_SLICE = "slice";
- field public static final String EXTRA_SLICE_DESCENDANTS = "slice_descendants";
- field public static final String EXTRA_SUPPORTED_SPECS = "specs";
- field public static final String EXTRA_SUPPORTED_SPECS_REVS = "revs";
- field public static final String EXTRA_UID = "uid";
- field public static final String METHOD_CHECK_PERMISSION = "check_perms";
- field public static final String METHOD_GET_DESCENDANTS = "get_descendants";
- field public static final String METHOD_GET_PINNED_SPECS = "get_specs";
- field public static final String METHOD_GRANT_PERMISSION = "grant_perms";
- field public static final String METHOD_MAP_INTENT = "map_slice";
- field public static final String METHOD_MAP_ONLY_INTENT = "map_only";
- field public static final String METHOD_PIN = "pin_slice";
- field public static final String METHOD_REVOKE_PERMISSION = "revoke_perms";
- field public static final String METHOD_SLICE = "bind_slice";
- field public static final String METHOD_UNPIN = "unpin_slice";
- field public static final String PERMS_PREFIX = "slice_perms_";
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class SliceProviderWrapperContainer {
- }
-
- @RequiresApi(28) public static class SliceProviderWrapperContainer.SliceProviderWrapper {
- ctor public SliceProviderWrapperContainer.SliceProviderWrapper(androidx.slice.SliceProvider!, String[]!);
- method public void attachInfo(android.content.Context!, android.content.pm.ProviderInfo!);
- method public android.app.slice.Slice! onBindSlice(android.net.Uri!, java.util.Set<android.app.slice.SliceSpec>!);
- method public boolean onCreate();
- method public java.util.Collection<android.net.Uri>! onGetSliceDescendants(android.net.Uri!);
- method public android.net.Uri onMapIntentToUri(android.content.Intent!);
- method public void onSlicePinned(android.net.Uri!);
- method public void onSliceUnpinned(android.net.Uri!);
- }
-
-}
-
-package androidx.slice.core {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public class SliceActionImpl implements androidx.slice.core.SliceAction {
- ctor public SliceActionImpl(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, CharSequence);
- ctor public SliceActionImpl(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, int, CharSequence);
- ctor public SliceActionImpl(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, CharSequence, boolean);
- ctor public SliceActionImpl(android.app.PendingIntent, CharSequence, boolean);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceActionImpl(androidx.slice.SliceItem!);
- method public androidx.slice.Slice buildPrimaryActionSlice(androidx.slice.Slice.Builder);
- method public androidx.slice.Slice buildSlice(androidx.slice.Slice.Builder);
- method public android.app.PendingIntent getAction();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.slice.SliceItem! getActionItem();
- method public CharSequence? getContentDescription();
- method public androidx.core.graphics.drawable.IconCompat? getIcon();
- method public int getImageMode();
- method public int getPriority();
- method public androidx.slice.SliceItem? getSliceItem();
- method public String? getSubtype();
- method public CharSequence getTitle();
- method public boolean isActivity();
- method public boolean isChecked();
- method public boolean isDefaultToggle();
- method public boolean isToggle();
- method public void setActivity(boolean);
- method public androidx.slice.core.SliceActionImpl! setChecked(boolean);
- method public androidx.slice.core.SliceActionImpl? setContentDescription(CharSequence);
- method public androidx.slice.core.SliceActionImpl! setPriority(@IntRange(from=0L) int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public class SliceHints {
- field public static final String HINT_ACTIVITY = "activity";
- field public static final int ICON_IMAGE = 0; // 0x0
- field public static final long INFINITY = -1L; // 0xffffffffffffffffL
- field public static final int LARGE_IMAGE = 2; // 0x2
- field public static final String SLICE_METADATA_KEY = "android.metadata.SLICE_URI";
- field public static final int SMALL_IMAGE = 1; // 0x1
- field public static final String SUBTYPE_MILLIS = "millis";
- field public static final String SUBTYPE_MIN = "min";
- field public static final int UNKNOWN_IMAGE = 3; // 0x3
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface SliceHints.ImageMode {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public class SliceQuery {
- method public static androidx.slice.SliceItem! find(androidx.slice.Slice!, String!, String!, String!);
- method public static androidx.slice.SliceItem! find(androidx.slice.Slice!, String!);
- method public static androidx.slice.SliceItem! find(androidx.slice.SliceItem!, String!);
- method public static androidx.slice.SliceItem! find(androidx.slice.SliceItem!, String!, String!, String!);
- method public static androidx.slice.SliceItem! find(androidx.slice.Slice!, String!, String[]!, String[]!);
- method public static androidx.slice.SliceItem! find(androidx.slice.SliceItem!, String!, String[]!, String[]!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.SliceItem!, String!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.Slice!, String!, String!, String!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.SliceItem!, String!, String!, String!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.Slice!, String!, String[]!, String[]!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.SliceItem!, String!, String[]!, String[]!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.slice.SliceItem! findItem(androidx.slice.Slice!, android.net.Uri!);
- method public static androidx.slice.SliceItem! findNotContaining(androidx.slice.SliceItem!, java.util.List<androidx.slice.SliceItem>!);
- method public static androidx.slice.SliceItem! findSubtype(androidx.slice.Slice!, String!, String!);
- method public static androidx.slice.SliceItem! findSubtype(androidx.slice.SliceItem!, String!, String!);
- method public static androidx.slice.SliceItem! findTopLevelItem(androidx.slice.Slice!, String!, String!, String[]!, String[]!);
- method public static boolean hasAnyHints(androidx.slice.SliceItem!, java.lang.String...!);
- method public static boolean hasHints(androidx.slice.SliceItem!, java.lang.String...!);
- method public static boolean hasHints(androidx.slice.Slice!, java.lang.String...!);
- method public static java.util.Iterator<androidx.slice.SliceItem>! stream(androidx.slice.SliceItem!);
- method public static java.util.Iterator<androidx.slice.SliceItem>! stream(androidx.slice.Slice!);
- }
-
-}
-
diff --git a/slices/core/api/restricted_1.1.0-alpha01.ignore b/slices/core/api/restricted_1.1.0-alpha01.ignore
deleted file mode 100644
index af1addb..0000000
--- a/slices/core/api/restricted_1.1.0-alpha01.ignore
+++ /dev/null
@@ -1,21 +0,0 @@
-// Baseline format: 1.0
-RemovedClass: androidx.slice.SliceItemHolderParcelizer:
- Removed class androidx.slice.SliceItemHolderParcelizer
-RemovedClass: androidx.slice.SliceItemParcelizer:
- Removed class androidx.slice.SliceItemParcelizer
-RemovedClass: androidx.slice.SliceParcelizer:
- Removed class androidx.slice.SliceParcelizer
-RemovedClass: androidx.slice.SliceSpecParcelizer:
- Removed class androidx.slice.SliceSpecParcelizer
-
-
-RemovedMethod: androidx.slice.SliceItem#getTimestamp():
- Removed method androidx.slice.SliceItem.getTimestamp()
-RemovedMethod: androidx.slice.SliceItemHolder#SliceItemHolder():
- Removed constructor androidx.slice.SliceItemHolder()
-RemovedMethod: androidx.slice.core.SliceQuery#stream(androidx.slice.Slice):
- Removed method androidx.slice.core.SliceQuery.stream(androidx.slice.Slice)
-RemovedMethod: androidx.slice.core.SliceQuery#stream(androidx.slice.SliceItem):
- Removed method androidx.slice.core.SliceQuery.stream(androidx.slice.SliceItem)
-
-
diff --git a/slices/core/api/restricted_1.1.0-alpha01.txt b/slices/core/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index 135d4e8..0000000
--- a/slices/core/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1,243 +0,0 @@
-// Signature format: 3.0
-package androidx.slice {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public interface Clock {
- method public long currentTimeMillis();
- }
-
- @RequiresApi(19) public final class Slice extends androidx.versionedparcelable.CustomVersionedParcelable implements androidx.versionedparcelable.VersionedParcelable {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.slice.Slice? bindSlice(android.content.Context!, android.net.Uri, java.util.Set<androidx.slice.SliceSpec>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.slice.SliceSpec? getSpec();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean hasHint(@androidx.slice.Slice.SliceHint String!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class Slice.Builder {
- ctor public Slice.Builder(android.net.Uri);
- ctor public Slice.Builder(androidx.slice.Slice.Builder);
- method public androidx.slice.Slice.Builder! addAction(android.app.PendingIntent, androidx.slice.Slice, String?);
- method public androidx.slice.Slice.Builder! addAction(androidx.slice.SliceItem.ActionHandler, androidx.slice.Slice, String?);
- method public androidx.slice.Slice.Builder! addHints(@androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addHints(@androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method public androidx.slice.Slice.Builder! addIcon(androidx.core.graphics.drawable.IconCompat!, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addIcon(androidx.core.graphics.drawable.IconCompat!, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method public androidx.slice.Slice.Builder! addInt(int, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addInt(int, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public androidx.slice.Slice.Builder! addItem(androidx.slice.SliceItem!);
- method public androidx.slice.Slice.Builder! addLong(long, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addLong(long, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.slice.Slice.Builder! addRemoteInput(android.app.RemoteInput!, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.slice.Slice.Builder! addRemoteInput(android.app.RemoteInput!, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addSubSlice(androidx.slice.Slice);
- method public androidx.slice.Slice.Builder! addSubSlice(androidx.slice.Slice, String!);
- method public androidx.slice.Slice.Builder! addText(CharSequence!, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addText(CharSequence!, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method @Deprecated public androidx.slice.Slice.Builder! addTimestamp(long, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addTimestamp(long, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method public androidx.slice.Slice! build();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.slice.Slice.Builder! setSpec(androidx.slice.SliceSpec!);
- }
-
-
- @RequiresApi(28) public class SliceConvert {
- }
-
- @RequiresApi(19) public final class SliceItem extends androidx.versionedparcelable.CustomVersionedParcelable {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceItem(Object!, @androidx.slice.SliceItem.SliceType String!, String!, @androidx.slice.Slice.SliceHint String[]!);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceItem(Object!, @androidx.slice.SliceItem.SliceType String!, String!, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceItem();
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceItem(android.app.PendingIntent!, androidx.slice.Slice!, String!, String!, @androidx.slice.Slice.SliceHint String[]!);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceItem(androidx.slice.SliceItem.ActionHandler!, androidx.slice.Slice!, String!, String!, @androidx.slice.Slice.SliceHint String[]!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void addHint(@androidx.slice.Slice.SliceHint String!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean fireActionInternal(android.content.Context?, android.content.Intent?) throws android.app.PendingIntent.CanceledException;
- method @RequiresApi(20) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.app.RemoteInput! getRemoteInput();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public CharSequence! getSanitizedText();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public boolean hasAnyHints(@androidx.slice.Slice.SliceHint java.lang.String...!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface SliceItem.ActionHandler {
- method public void onAction(androidx.slice.SliceItem!, android.content.Context!, android.content.Intent!);
- }
-
-
-
- public static interface SliceItemHolder.HolderHandler {
- method public void handle(androidx.slice.SliceItemHolder!, String!);
- }
-
- public static class SliceItemHolder.SliceItemPool {
- ctor public SliceItemHolder.SliceItemPool();
- method public androidx.slice.SliceItemHolder! get();
- method public void release(androidx.slice.SliceItemHolder!);
- }
-
- @RequiresApi(19) public abstract class SliceManager {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public abstract java.util.Set<androidx.slice.SliceSpec> getPinnedSpecs(android.net.Uri);
- }
-
- public abstract class SliceProvider extends android.content.ContentProvider implements androidx.core.app.CoreComponentFactory.CompatWrapped {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public static android.app.PendingIntent! createPermissionIntent(android.content.Context!, android.net.Uri!, String!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public static androidx.slice.Slice! createPermissionSlice(android.content.Context!, android.net.Uri!, String!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @RequiresApi(19) public static androidx.slice.Clock! getClock();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public static java.util.Set<androidx.slice.SliceSpec>! getCurrentSpecs();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public static CharSequence! getPermissionString(android.content.Context!, String!);
- }
-
- public abstract class SliceProviderWithCallbacks<T extends androidx.slice.SliceProviderWithCallbacks> extends androidx.slice.SliceProvider implements androidx.remotecallback.CallbackBase<T> androidx.remotecallback.CallbackReceiver<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
- }
-
- @RequiresApi(19) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class SliceSpec implements androidx.versionedparcelable.VersionedParcelable {
- ctor public SliceSpec(String, int);
- method public boolean canRender(androidx.slice.SliceSpec);
- method public int getRevision();
- method public String! getType();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public class SliceSpecs {
- field public static final androidx.slice.SliceSpec! BASIC;
- field public static final androidx.slice.SliceSpec! LIST;
- field public static final androidx.slice.SliceSpec! LIST_V2;
- field public static final androidx.slice.SliceSpec! MESSAGING;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public class SystemClock implements androidx.slice.Clock {
- ctor public SystemClock();
- method public long currentTimeMillis();
- }
-
-}
-
-package androidx.slice.compat {
-
-
- public static class CompatPermissionManager.PermissionState {
- method public String! getKey();
- method public boolean hasAccess(java.util.List<java.lang.String>!);
- method public boolean hasAllPermissions();
- method public java.util.Set<java.lang.String>! toPersistable();
- }
-
-
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @RequiresApi(19) public class SliceProviderCompat {
- ctor public SliceProviderCompat(androidx.slice.SliceProvider!, androidx.slice.compat.CompatPermissionManager!, android.content.Context!);
- method public static void addSpecs(android.os.Bundle!, java.util.Set<androidx.slice.SliceSpec>!);
- method public static androidx.slice.Slice! bindSlice(android.content.Context!, android.net.Uri!, java.util.Set<androidx.slice.SliceSpec>!);
- method public static androidx.slice.Slice! bindSlice(android.content.Context!, android.content.Intent!, java.util.Set<androidx.slice.SliceSpec>!);
- method public android.os.Bundle! call(String!, String!, android.os.Bundle!);
- method public static int checkSlicePermission(android.content.Context!, String!, android.net.Uri!, int, int);
- method public String! getCallingPackage();
- method public static java.util.List<android.net.Uri>! getPinnedSlices(android.content.Context!);
- method public static java.util.Set<androidx.slice.SliceSpec>! getPinnedSpecs(android.content.Context!, android.net.Uri!);
- method public static java.util.Collection<android.net.Uri> getSliceDescendants(android.content.Context!, android.net.Uri);
- method public static java.util.Set<androidx.slice.SliceSpec>! getSpecs(android.os.Bundle!);
- method public static void grantSlicePermission(android.content.Context!, String!, String!, android.net.Uri!);
- method public static android.net.Uri! mapIntentToUri(android.content.Context!, android.content.Intent!);
- method public static void pinSlice(android.content.Context!, android.net.Uri!, java.util.Set<androidx.slice.SliceSpec>!);
- method public static void revokeSlicePermission(android.content.Context!, String!, String!, android.net.Uri!);
- method public static void unpinSlice(android.content.Context!, android.net.Uri!, java.util.Set<androidx.slice.SliceSpec>!);
- field public static final String ARG_SUPPORTS_VERSIONED_PARCELABLE = "supports_versioned_parcelable";
- field public static final String EXTRA_BIND_URI = "slice_uri";
- field public static final String EXTRA_INTENT = "slice_intent";
- field public static final String EXTRA_PID = "pid";
- field public static final String EXTRA_PKG = "pkg";
- field public static final String EXTRA_PROVIDER_PKG = "provider_pkg";
- field public static final String EXTRA_RESULT = "result";
- field public static final String EXTRA_SLICE = "slice";
- field public static final String EXTRA_SLICE_DESCENDANTS = "slice_descendants";
- field public static final String EXTRA_SUPPORTED_SPECS = "specs";
- field public static final String EXTRA_SUPPORTED_SPECS_REVS = "revs";
- field public static final String EXTRA_UID = "uid";
- field public static final String METHOD_CHECK_PERMISSION = "check_perms";
- field public static final String METHOD_GET_DESCENDANTS = "get_descendants";
- field public static final String METHOD_GET_PINNED_SPECS = "get_specs";
- field public static final String METHOD_GRANT_PERMISSION = "grant_perms";
- field public static final String METHOD_MAP_INTENT = "map_slice";
- field public static final String METHOD_MAP_ONLY_INTENT = "map_only";
- field public static final String METHOD_PIN = "pin_slice";
- field public static final String METHOD_REVOKE_PERMISSION = "revoke_perms";
- field public static final String METHOD_SLICE = "bind_slice";
- field public static final String METHOD_UNPIN = "unpin_slice";
- field public static final String PERMS_PREFIX = "slice_perms_";
- }
-
-
- @RequiresApi(28) public static class SliceProviderWrapperContainer.SliceProviderWrapper extends android.app.slice.SliceProvider {
- ctor public SliceProviderWrapperContainer.SliceProviderWrapper(androidx.slice.SliceProvider!, String[]!);
- method public boolean onCreate();
- }
-
-}
-
-package androidx.slice.core {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public class SliceActionImpl implements androidx.slice.core.SliceAction {
- ctor public SliceActionImpl(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, CharSequence);
- ctor public SliceActionImpl(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, @androidx.slice.core.SliceHints.ImageMode int, CharSequence);
- ctor public SliceActionImpl(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, CharSequence, boolean);
- ctor public SliceActionImpl(android.app.PendingIntent, CharSequence, boolean);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceActionImpl(androidx.slice.SliceItem!);
- method public androidx.slice.Slice buildPrimaryActionSlice(androidx.slice.Slice.Builder);
- method public androidx.slice.Slice buildSlice(androidx.slice.Slice.Builder);
- method public android.app.PendingIntent getAction();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.slice.SliceItem! getActionItem();
- method public CharSequence? getContentDescription();
- method public androidx.core.graphics.drawable.IconCompat? getIcon();
- method @androidx.slice.core.SliceHints.ImageMode public int getImageMode();
- method public int getPriority();
- method public androidx.slice.SliceItem? getSliceItem();
- method public String? getSubtype();
- method public CharSequence getTitle();
- method public boolean isActivity();
- method public boolean isChecked();
- method public boolean isDefaultToggle();
- method public boolean isToggle();
- method public void setActivity(boolean);
- method public androidx.slice.core.SliceActionImpl! setChecked(boolean);
- method public androidx.slice.core.SliceActionImpl? setContentDescription(CharSequence);
- method public androidx.slice.core.SliceActionImpl! setPriority(@IntRange(from=0) int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public class SliceHints {
- field public static final String HINT_ACTIVITY = "activity";
- field public static final String HINT_CACHED = "cached";
- field public static final String HINT_SELECTION_OPTION_VALUE = "selection_option_value";
- field public static final int ICON_IMAGE = 0; // 0x0
- field public static final long INFINITY = -1L; // 0xffffffffffffffffL
- field public static final int LARGE_IMAGE = 2; // 0x2
- field public static final String SLICE_METADATA_KEY = "android.metadata.SLICE_URI";
- field public static final int SMALL_IMAGE = 1; // 0x1
- field public static final String SUBTYPE_MILLIS = "millis";
- field public static final String SUBTYPE_MIN = "min";
- field public static final String SUBTYPE_SELECTION = "selection";
- field public static final String SUBTYPE_SELECTION_OPTION_KEY = "selection_option_key";
- field public static final int UNKNOWN_IMAGE = 3; // 0x3
- }
-
- @IntDef({androidx.slice.core.SliceHints.LARGE_IMAGE, androidx.slice.core.SliceHints.SMALL_IMAGE, androidx.slice.core.SliceHints.ICON_IMAGE, androidx.slice.core.SliceHints.UNKNOWN_IMAGE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface SliceHints.ImageMode {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public class SliceQuery {
- method public static androidx.slice.SliceItem! find(androidx.slice.Slice!, String!, String!, String!);
- method public static androidx.slice.SliceItem! find(androidx.slice.Slice!, String!);
- method public static androidx.slice.SliceItem! find(androidx.slice.SliceItem!, String!);
- method public static androidx.slice.SliceItem! find(androidx.slice.SliceItem!, String!, String!, String!);
- method public static androidx.slice.SliceItem! find(androidx.slice.Slice!, String!, String[]!, String[]!);
- method public static androidx.slice.SliceItem! find(androidx.slice.SliceItem!, String!, String[]!, String[]!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.SliceItem!, String!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.Slice!, String!, String!, String!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.SliceItem!, String!, String!, String!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.Slice!, String!, String[]!, String[]!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.SliceItem!, String!, String[]!, String[]!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.slice.SliceItem! findItem(androidx.slice.Slice!, android.net.Uri!);
- method public static androidx.slice.SliceItem! findNotContaining(androidx.slice.SliceItem!, java.util.List<androidx.slice.SliceItem>!);
- method public static androidx.slice.SliceItem! findSubtype(androidx.slice.Slice!, String!, String!);
- method public static androidx.slice.SliceItem! findSubtype(androidx.slice.SliceItem!, String!, String!);
- method public static androidx.slice.SliceItem! findTopLevelItem(androidx.slice.Slice!, String!, String!, String[]!, String[]!);
- method public static boolean hasAnyHints(androidx.slice.SliceItem!, java.lang.String...!);
- method public static boolean hasHints(androidx.slice.SliceItem!, java.lang.String...!);
- method public static boolean hasHints(androidx.slice.Slice!, java.lang.String...!);
- }
-
-}
-
diff --git a/slices/core/api/restricted_current.txt b/slices/core/api/restricted_current.txt
deleted file mode 100644
index 135d4e8..0000000
--- a/slices/core/api/restricted_current.txt
+++ /dev/null
@@ -1,243 +0,0 @@
-// Signature format: 3.0
-package androidx.slice {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public interface Clock {
- method public long currentTimeMillis();
- }
-
- @RequiresApi(19) public final class Slice extends androidx.versionedparcelable.CustomVersionedParcelable implements androidx.versionedparcelable.VersionedParcelable {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.slice.Slice? bindSlice(android.content.Context!, android.net.Uri, java.util.Set<androidx.slice.SliceSpec>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.slice.SliceSpec? getSpec();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean hasHint(@androidx.slice.Slice.SliceHint String!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class Slice.Builder {
- ctor public Slice.Builder(android.net.Uri);
- ctor public Slice.Builder(androidx.slice.Slice.Builder);
- method public androidx.slice.Slice.Builder! addAction(android.app.PendingIntent, androidx.slice.Slice, String?);
- method public androidx.slice.Slice.Builder! addAction(androidx.slice.SliceItem.ActionHandler, androidx.slice.Slice, String?);
- method public androidx.slice.Slice.Builder! addHints(@androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addHints(@androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method public androidx.slice.Slice.Builder! addIcon(androidx.core.graphics.drawable.IconCompat!, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addIcon(androidx.core.graphics.drawable.IconCompat!, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method public androidx.slice.Slice.Builder! addInt(int, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addInt(int, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public androidx.slice.Slice.Builder! addItem(androidx.slice.SliceItem!);
- method public androidx.slice.Slice.Builder! addLong(long, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addLong(long, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.slice.Slice.Builder! addRemoteInput(android.app.RemoteInput!, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.slice.Slice.Builder! addRemoteInput(android.app.RemoteInput!, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addSubSlice(androidx.slice.Slice);
- method public androidx.slice.Slice.Builder! addSubSlice(androidx.slice.Slice, String!);
- method public androidx.slice.Slice.Builder! addText(CharSequence!, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addText(CharSequence!, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method @Deprecated public androidx.slice.Slice.Builder! addTimestamp(long, String?, @androidx.slice.Slice.SliceHint java.lang.String...!);
- method public androidx.slice.Slice.Builder! addTimestamp(long, String?, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- method public androidx.slice.Slice! build();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.slice.Slice.Builder! setSpec(androidx.slice.SliceSpec!);
- }
-
-
- @RequiresApi(28) public class SliceConvert {
- }
-
- @RequiresApi(19) public final class SliceItem extends androidx.versionedparcelable.CustomVersionedParcelable {
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceItem(Object!, @androidx.slice.SliceItem.SliceType String!, String!, @androidx.slice.Slice.SliceHint String[]!);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceItem(Object!, @androidx.slice.SliceItem.SliceType String!, String!, @androidx.slice.Slice.SliceHint java.util.List<java.lang.String>!);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceItem();
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceItem(android.app.PendingIntent!, androidx.slice.Slice!, String!, String!, @androidx.slice.Slice.SliceHint String[]!);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceItem(androidx.slice.SliceItem.ActionHandler!, androidx.slice.Slice!, String!, String!, @androidx.slice.Slice.SliceHint String[]!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public void addHint(@androidx.slice.Slice.SliceHint String!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean fireActionInternal(android.content.Context?, android.content.Intent?) throws android.app.PendingIntent.CanceledException;
- method @RequiresApi(20) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.app.RemoteInput! getRemoteInput();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public CharSequence! getSanitizedText();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public boolean hasAnyHints(@androidx.slice.Slice.SliceHint java.lang.String...!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface SliceItem.ActionHandler {
- method public void onAction(androidx.slice.SliceItem!, android.content.Context!, android.content.Intent!);
- }
-
-
-
- public static interface SliceItemHolder.HolderHandler {
- method public void handle(androidx.slice.SliceItemHolder!, String!);
- }
-
- public static class SliceItemHolder.SliceItemPool {
- ctor public SliceItemHolder.SliceItemPool();
- method public androidx.slice.SliceItemHolder! get();
- method public void release(androidx.slice.SliceItemHolder!);
- }
-
- @RequiresApi(19) public abstract class SliceManager {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public abstract java.util.Set<androidx.slice.SliceSpec> getPinnedSpecs(android.net.Uri);
- }
-
- public abstract class SliceProvider extends android.content.ContentProvider implements androidx.core.app.CoreComponentFactory.CompatWrapped {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public static android.app.PendingIntent! createPermissionIntent(android.content.Context!, android.net.Uri!, String!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public static androidx.slice.Slice! createPermissionSlice(android.content.Context!, android.net.Uri!, String!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @RequiresApi(19) public static androidx.slice.Clock! getClock();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public static java.util.Set<androidx.slice.SliceSpec>! getCurrentSpecs();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public static CharSequence! getPermissionString(android.content.Context!, String!);
- }
-
- public abstract class SliceProviderWithCallbacks<T extends androidx.slice.SliceProviderWithCallbacks> extends androidx.slice.SliceProvider implements androidx.remotecallback.CallbackBase<T> androidx.remotecallback.CallbackReceiver<T> {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.remotecallback.RemoteCallback! toRemoteCallback(Class<T>!, android.content.Context!, String!, android.os.Bundle!, String!);
- }
-
- @RequiresApi(19) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class SliceSpec implements androidx.versionedparcelable.VersionedParcelable {
- ctor public SliceSpec(String, int);
- method public boolean canRender(androidx.slice.SliceSpec);
- method public int getRevision();
- method public String! getType();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public class SliceSpecs {
- field public static final androidx.slice.SliceSpec! BASIC;
- field public static final androidx.slice.SliceSpec! LIST;
- field public static final androidx.slice.SliceSpec! LIST_V2;
- field public static final androidx.slice.SliceSpec! MESSAGING;
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public class SystemClock implements androidx.slice.Clock {
- ctor public SystemClock();
- method public long currentTimeMillis();
- }
-
-}
-
-package androidx.slice.compat {
-
-
- public static class CompatPermissionManager.PermissionState {
- method public String! getKey();
- method public boolean hasAccess(java.util.List<java.lang.String>!);
- method public boolean hasAllPermissions();
- method public java.util.Set<java.lang.String>! toPersistable();
- }
-
-
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @RequiresApi(19) public class SliceProviderCompat {
- ctor public SliceProviderCompat(androidx.slice.SliceProvider!, androidx.slice.compat.CompatPermissionManager!, android.content.Context!);
- method public static void addSpecs(android.os.Bundle!, java.util.Set<androidx.slice.SliceSpec>!);
- method public static androidx.slice.Slice! bindSlice(android.content.Context!, android.net.Uri!, java.util.Set<androidx.slice.SliceSpec>!);
- method public static androidx.slice.Slice! bindSlice(android.content.Context!, android.content.Intent!, java.util.Set<androidx.slice.SliceSpec>!);
- method public android.os.Bundle! call(String!, String!, android.os.Bundle!);
- method public static int checkSlicePermission(android.content.Context!, String!, android.net.Uri!, int, int);
- method public String! getCallingPackage();
- method public static java.util.List<android.net.Uri>! getPinnedSlices(android.content.Context!);
- method public static java.util.Set<androidx.slice.SliceSpec>! getPinnedSpecs(android.content.Context!, android.net.Uri!);
- method public static java.util.Collection<android.net.Uri> getSliceDescendants(android.content.Context!, android.net.Uri);
- method public static java.util.Set<androidx.slice.SliceSpec>! getSpecs(android.os.Bundle!);
- method public static void grantSlicePermission(android.content.Context!, String!, String!, android.net.Uri!);
- method public static android.net.Uri! mapIntentToUri(android.content.Context!, android.content.Intent!);
- method public static void pinSlice(android.content.Context!, android.net.Uri!, java.util.Set<androidx.slice.SliceSpec>!);
- method public static void revokeSlicePermission(android.content.Context!, String!, String!, android.net.Uri!);
- method public static void unpinSlice(android.content.Context!, android.net.Uri!, java.util.Set<androidx.slice.SliceSpec>!);
- field public static final String ARG_SUPPORTS_VERSIONED_PARCELABLE = "supports_versioned_parcelable";
- field public static final String EXTRA_BIND_URI = "slice_uri";
- field public static final String EXTRA_INTENT = "slice_intent";
- field public static final String EXTRA_PID = "pid";
- field public static final String EXTRA_PKG = "pkg";
- field public static final String EXTRA_PROVIDER_PKG = "provider_pkg";
- field public static final String EXTRA_RESULT = "result";
- field public static final String EXTRA_SLICE = "slice";
- field public static final String EXTRA_SLICE_DESCENDANTS = "slice_descendants";
- field public static final String EXTRA_SUPPORTED_SPECS = "specs";
- field public static final String EXTRA_SUPPORTED_SPECS_REVS = "revs";
- field public static final String EXTRA_UID = "uid";
- field public static final String METHOD_CHECK_PERMISSION = "check_perms";
- field public static final String METHOD_GET_DESCENDANTS = "get_descendants";
- field public static final String METHOD_GET_PINNED_SPECS = "get_specs";
- field public static final String METHOD_GRANT_PERMISSION = "grant_perms";
- field public static final String METHOD_MAP_INTENT = "map_slice";
- field public static final String METHOD_MAP_ONLY_INTENT = "map_only";
- field public static final String METHOD_PIN = "pin_slice";
- field public static final String METHOD_REVOKE_PERMISSION = "revoke_perms";
- field public static final String METHOD_SLICE = "bind_slice";
- field public static final String METHOD_UNPIN = "unpin_slice";
- field public static final String PERMS_PREFIX = "slice_perms_";
- }
-
-
- @RequiresApi(28) public static class SliceProviderWrapperContainer.SliceProviderWrapper extends android.app.slice.SliceProvider {
- ctor public SliceProviderWrapperContainer.SliceProviderWrapper(androidx.slice.SliceProvider!, String[]!);
- method public boolean onCreate();
- }
-
-}
-
-package androidx.slice.core {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public class SliceActionImpl implements androidx.slice.core.SliceAction {
- ctor public SliceActionImpl(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, CharSequence);
- ctor public SliceActionImpl(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, @androidx.slice.core.SliceHints.ImageMode int, CharSequence);
- ctor public SliceActionImpl(android.app.PendingIntent, androidx.core.graphics.drawable.IconCompat, CharSequence, boolean);
- ctor public SliceActionImpl(android.app.PendingIntent, CharSequence, boolean);
- ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public SliceActionImpl(androidx.slice.SliceItem!);
- method public androidx.slice.Slice buildPrimaryActionSlice(androidx.slice.Slice.Builder);
- method public androidx.slice.Slice buildSlice(androidx.slice.Slice.Builder);
- method public android.app.PendingIntent getAction();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.slice.SliceItem! getActionItem();
- method public CharSequence? getContentDescription();
- method public androidx.core.graphics.drawable.IconCompat? getIcon();
- method @androidx.slice.core.SliceHints.ImageMode public int getImageMode();
- method public int getPriority();
- method public androidx.slice.SliceItem? getSliceItem();
- method public String? getSubtype();
- method public CharSequence getTitle();
- method public boolean isActivity();
- method public boolean isChecked();
- method public boolean isDefaultToggle();
- method public boolean isToggle();
- method public void setActivity(boolean);
- method public androidx.slice.core.SliceActionImpl! setChecked(boolean);
- method public androidx.slice.core.SliceActionImpl? setContentDescription(CharSequence);
- method public androidx.slice.core.SliceActionImpl! setPriority(@IntRange(from=0) int);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public class SliceHints {
- field public static final String HINT_ACTIVITY = "activity";
- field public static final String HINT_CACHED = "cached";
- field public static final String HINT_SELECTION_OPTION_VALUE = "selection_option_value";
- field public static final int ICON_IMAGE = 0; // 0x0
- field public static final long INFINITY = -1L; // 0xffffffffffffffffL
- field public static final int LARGE_IMAGE = 2; // 0x2
- field public static final String SLICE_METADATA_KEY = "android.metadata.SLICE_URI";
- field public static final int SMALL_IMAGE = 1; // 0x1
- field public static final String SUBTYPE_MILLIS = "millis";
- field public static final String SUBTYPE_MIN = "min";
- field public static final String SUBTYPE_SELECTION = "selection";
- field public static final String SUBTYPE_SELECTION_OPTION_KEY = "selection_option_key";
- field public static final int UNKNOWN_IMAGE = 3; // 0x3
- }
-
- @IntDef({androidx.slice.core.SliceHints.LARGE_IMAGE, androidx.slice.core.SliceHints.SMALL_IMAGE, androidx.slice.core.SliceHints.ICON_IMAGE, androidx.slice.core.SliceHints.UNKNOWN_IMAGE}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface SliceHints.ImageMode {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @RequiresApi(19) public class SliceQuery {
- method public static androidx.slice.SliceItem! find(androidx.slice.Slice!, String!, String!, String!);
- method public static androidx.slice.SliceItem! find(androidx.slice.Slice!, String!);
- method public static androidx.slice.SliceItem! find(androidx.slice.SliceItem!, String!);
- method public static androidx.slice.SliceItem! find(androidx.slice.SliceItem!, String!, String!, String!);
- method public static androidx.slice.SliceItem! find(androidx.slice.Slice!, String!, String[]!, String[]!);
- method public static androidx.slice.SliceItem! find(androidx.slice.SliceItem!, String!, String[]!, String[]!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.SliceItem!, String!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.Slice!, String!, String!, String!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.SliceItem!, String!, String!, String!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.Slice!, String!, String[]!, String[]!);
- method public static java.util.List<androidx.slice.SliceItem>! findAll(androidx.slice.SliceItem!, String!, String[]!, String[]!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static androidx.slice.SliceItem! findItem(androidx.slice.Slice!, android.net.Uri!);
- method public static androidx.slice.SliceItem! findNotContaining(androidx.slice.SliceItem!, java.util.List<androidx.slice.SliceItem>!);
- method public static androidx.slice.SliceItem! findSubtype(androidx.slice.Slice!, String!, String!);
- method public static androidx.slice.SliceItem! findSubtype(androidx.slice.SliceItem!, String!, String!);
- method public static androidx.slice.SliceItem! findTopLevelItem(androidx.slice.Slice!, String!, String!, String[]!, String[]!);
- method public static boolean hasAnyHints(androidx.slice.SliceItem!, java.lang.String...!);
- method public static boolean hasHints(androidx.slice.SliceItem!, java.lang.String...!);
- method public static boolean hasHints(androidx.slice.Slice!, java.lang.String...!);
- }
-
-}
-
diff --git a/slices/core/build.gradle b/slices/core/build.gradle
index 6fb3c0d..b0c132c 100644
--- a/slices/core/build.gradle
+++ b/slices/core/build.gradle
@@ -26,7 +26,6 @@
dependencies {
implementation project(":annotation")
implementation project(":appcompat")
- api project(":collection")
api(project(":remotecallback"))
androidTestImplementation(TEST_EXT_JUNIT)
diff --git a/slices/core/src/androidTest/java/androidx/slice/SlicePermissionTest.java b/slices/core/src/androidTest/java/androidx/slice/SlicePermissionTest.java
index 6b97b64..bff1608 100644
--- a/slices/core/src/androidTest/java/androidx/slice/SlicePermissionTest.java
+++ b/slices/core/src/androidTest/java/androidx/slice/SlicePermissionTest.java
@@ -30,8 +30,8 @@
import androidx.slice.compat.CompatPermissionManager;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.After;
import org.junit.Before;
@@ -39,7 +39,7 @@
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
@SdkSuppress(minSdkVersion = 19)
public class SlicePermissionTest {
diff --git a/slices/core/src/androidTest/java/androidx/slice/SliceProviderCallbackTest.java b/slices/core/src/androidTest/java/androidx/slice/SliceProviderCallbackTest.java
index ce9fdad..a15f6f9b 100644
--- a/slices/core/src/androidTest/java/androidx/slice/SliceProviderCallbackTest.java
+++ b/slices/core/src/androidTest/java/androidx/slice/SliceProviderCallbackTest.java
@@ -30,8 +30,8 @@
import androidx.remotecallback.RemoteCallback;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -41,7 +41,7 @@
@SdkSuppress(minSdkVersion = 26)
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
public class SliceProviderCallbackTest {
private static Provider sProvider;
diff --git a/slices/core/src/androidTest/java/androidx/slice/SliceTest.java b/slices/core/src/androidTest/java/androidx/slice/SliceTest.java
index a313ccb..7af2097 100644
--- a/slices/core/src/androidTest/java/androidx/slice/SliceTest.java
+++ b/slices/core/src/androidTest/java/androidx/slice/SliceTest.java
@@ -48,8 +48,8 @@
import androidx.slice.core.test.R;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -60,7 +60,7 @@
import java.util.concurrent.TimeUnit;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
@SdkSuppress(minSdkVersion = 19)
public class SliceTest {
diff --git a/slices/core/src/androidTest/java/androidx/slice/compat/CompatPermissionManagerTest.java b/slices/core/src/androidTest/java/androidx/slice/compat/CompatPermissionManagerTest.java
index 97f2bea..14e5d2a 100644
--- a/slices/core/src/androidTest/java/androidx/slice/compat/CompatPermissionManagerTest.java
+++ b/slices/core/src/androidTest/java/androidx/slice/compat/CompatPermissionManagerTest.java
@@ -36,8 +36,8 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -45,7 +45,7 @@
import org.mockito.stubbing.Answer;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
@SdkSuppress(minSdkVersion = 19)
public class CompatPermissionManagerTest {
diff --git a/slices/core/src/androidTest/java/androidx/slice/compat/SliceProviderCompatTest.java b/slices/core/src/androidTest/java/androidx/slice/compat/SliceProviderCompatTest.java
index deecabc..d559c76 100644
--- a/slices/core/src/androidTest/java/androidx/slice/compat/SliceProviderCompatTest.java
+++ b/slices/core/src/androidTest/java/androidx/slice/compat/SliceProviderCompatTest.java
@@ -40,8 +40,8 @@
import androidx.slice.SliceSpec;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -49,7 +49,7 @@
import java.util.Collections;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
@SdkSuppress(minSdkVersion = 19)
public class SliceProviderCompatTest {
diff --git a/slices/core/src/main/java/androidx/slice/ArrayUtils.java b/slices/core/src/main/java/androidx/slice/ArrayUtils.java
index 2330507..1b72f27 100644
--- a/slices/core/src/main/java/androidx/slice/ArrayUtils.java
+++ b/slices/core/src/main/java/androidx/slice/ArrayUtils.java
@@ -26,7 +26,7 @@
/**
* @hide
*/
-@RestrictTo(Scope.LIBRARY_GROUP)
+@RestrictTo(Scope.LIBRARY)
@RequiresApi(19)
class ArrayUtils {
diff --git a/slices/core/src/main/java/androidx/slice/Clock.java b/slices/core/src/main/java/androidx/slice/Clock.java
index a1b758e..d2507e8 100644
--- a/slices/core/src/main/java/androidx/slice/Clock.java
+++ b/slices/core/src/main/java/androidx/slice/Clock.java
@@ -16,7 +16,7 @@
package androidx.slice;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
@@ -24,7 +24,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
public interface Clock {
long currentTimeMillis();
diff --git a/slices/core/src/main/java/androidx/slice/Slice.java b/slices/core/src/main/java/androidx/slice/Slice.java
index 2aa2fe6..035b582 100644
--- a/slices/core/src/main/java/androidx/slice/Slice.java
+++ b/slices/core/src/main/java/androidx/slice/Slice.java
@@ -207,7 +207,7 @@
* @return The spec for this slice
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public @Nullable SliceSpec getSpec() {
return mSpec;
}
@@ -253,7 +253,7 @@
/**
* @hide
*/
- @RestrictTo(Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(Scope.LIBRARY_GROUP)
public boolean hasHint(@SliceHint String hint) {
return ArrayUtils.contains(mHints, hint);
}
@@ -261,7 +261,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Override
public void onPreParceling(boolean isStream) {
}
@@ -269,7 +269,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Override
public void onPostParceling() {
for (int i = mItems.length - 1; i >= 0; i--) {
@@ -286,7 +286,7 @@
* A Builder used to construct {@link Slice}s
* @hide
*/
- @RestrictTo(Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(Scope.LIBRARY_GROUP)
public static class Builder {
private final Uri mUri;
@@ -321,7 +321,7 @@
* Add the spec for this slice.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public Builder setSpec(SliceSpec spec) {
mSpec = spec;
return this;
@@ -444,7 +444,7 @@
* @see SliceItem#getSubType()
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public Slice.Builder addRemoteInput(RemoteInput remoteInput, @Nullable String subType,
@SliceHint List<String> hints) {
Preconditions.checkNotNull(remoteInput);
@@ -457,7 +457,7 @@
* @see SliceItem#getSubType()
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public Slice.Builder addRemoteInput(RemoteInput remoteInput, @Nullable String subType,
@SliceHint String... hints) {
Preconditions.checkNotNull(remoteInput);
@@ -534,7 +534,7 @@
* Add a SliceItem to the slice being constructed.
* @hide
*/
- @RestrictTo(Scope.LIBRARY_GROUP)
+ @RestrictTo(Scope.LIBRARY)
public Slice.Builder addItem(SliceItem item) {
mItems.add(item);
return this;
@@ -608,7 +608,7 @@
* @return The Slice provided by the app or null if none is given.
* @see Slice
*/
- @RestrictTo(Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(Scope.LIBRARY_GROUP)
@Nullable
public static Slice bindSlice(Context context, @NonNull Uri uri,
Set<SliceSpec> supportedSpecs) {
diff --git a/slices/core/src/main/java/androidx/slice/SliceItem.java b/slices/core/src/main/java/androidx/slice/SliceItem.java
index 1457e22..d0a4d6c 100644
--- a/slices/core/src/main/java/androidx/slice/SliceItem.java
+++ b/slices/core/src/main/java/androidx/slice/SliceItem.java
@@ -125,7 +125,7 @@
/**
* @hide
*/
- @RestrictTo(Scope.LIBRARY_GROUP)
+ @RestrictTo(Scope.LIBRARY)
public SliceItem(Object obj, @SliceType String format, String subType,
@Slice.SliceHint String[] hints) {
mHints = hints;
@@ -137,7 +137,7 @@
/**
* @hide
*/
- @RestrictTo(Scope.LIBRARY_GROUP)
+ @RestrictTo(Scope.LIBRARY)
public SliceItem(Object obj, @SliceType String format, String subType,
@Slice.SliceHint List<String> hints) {
this (obj, format, subType, hints.toArray(new String[hints.size()]));
@@ -147,14 +147,14 @@
* Used by VersionedParcelable.
* @hide
*/
- @RestrictTo(Scope.LIBRARY_GROUP)
+ @RestrictTo(Scope.LIBRARY)
public SliceItem() {
}
/**
* @hide
*/
- @RestrictTo(Scope.LIBRARY_GROUP)
+ @RestrictTo(Scope.LIBRARY)
public SliceItem(PendingIntent intent, Slice slice, String format, String subType,
@Slice.SliceHint String[] hints) {
this(new Pair<Object, Slice>(intent, slice), format, subType, hints);
@@ -163,7 +163,7 @@
/**
* @hide
*/
- @RestrictTo(Scope.LIBRARY_GROUP)
+ @RestrictTo(Scope.LIBRARY)
public SliceItem(ActionHandler action, Slice slice, String format, String subType,
@Slice.SliceHint String[] hints) {
this(new Pair<Object, Slice>(action, slice), format, subType, hints);
@@ -189,7 +189,7 @@
/**
* @hide
*/
- @RestrictTo(Scope.LIBRARY_GROUP)
+ @RestrictTo(Scope.LIBRARY)
public void addHint(@Slice.SliceHint String hint) {
mHints = ArrayUtils.appendElement(String.class, mHints, hint);
}
@@ -236,7 +236,7 @@
* @return The text held by this {@link android.app.slice.SliceItem#FORMAT_TEXT} SliceItem with
* ony spans that are unsupported by the androidx Slice renderer removed.
*/
- @RestrictTo(Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(Scope.LIBRARY_GROUP)
public CharSequence getSanitizedText() {
if (mSanitizedText == null) mSanitizedText = sanitizeText(getText());
return mSanitizedText;
@@ -285,7 +285,7 @@
/**
* @hide
*/
- @RestrictTo(Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(Scope.LIBRARY_GROUP)
public boolean fireActionInternal(@Nullable Context context, @Nullable Intent i)
throws PendingIntent.CanceledException {
Object action = ((Pair<Object, Slice>) mObj).first;
@@ -304,7 +304,7 @@
* @hide
*/
@RequiresApi(20)
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public RemoteInput getRemoteInput() {
return (RemoteInput) mObj;
}
@@ -385,7 +385,7 @@
/**
* @hide
*/
- @RestrictTo(Scope.LIBRARY_GROUP)
+ @RestrictTo(Scope.LIBRARY)
public boolean hasAnyHints(@Slice.SliceHint String... hints) {
if (hints == null) return false;
for (String hint : hints) {
@@ -692,7 +692,7 @@
/**
* @hide
*/
- @RestrictTo(Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(Scope.LIBRARY_GROUP)
public interface ActionHandler {
/**
* Called when a pending intent would be sent on a real slice.
diff --git a/slices/core/src/main/java/androidx/slice/SliceManager.java b/slices/core/src/main/java/androidx/slice/SliceManager.java
index e0baa5e..710f747 100644
--- a/slices/core/src/main/java/androidx/slice/SliceManager.java
+++ b/slices/core/src/main/java/androidx/slice/SliceManager.java
@@ -64,7 +64,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public abstract @NonNull Set<SliceSpec> getPinnedSpecs(@NonNull Uri uri);
/**
diff --git a/slices/core/src/main/java/androidx/slice/SliceProvider.java b/slices/core/src/main/java/androidx/slice/SliceProvider.java
index 397db68..10bc5fc 100644
--- a/slices/core/src/main/java/androidx/slice/SliceProvider.java
+++ b/slices/core/src/main/java/androidx/slice/SliceProvider.java
@@ -239,7 +239,7 @@
* Generate a slice that contains a permission request.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@RequiresApi(19)
public static Slice createPermissionSlice(Context context, Uri sliceUri,
String callingPackage) {
@@ -271,7 +271,7 @@
* Create a PendingIntent pointing at the permission dialog.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@RequiresApi(19)
public static PendingIntent createPermissionIntent(Context context, Uri sliceUri,
String callingPackage) {
@@ -292,7 +292,7 @@
* Get string describing permission request.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@RequiresApi(19)
public static CharSequence getPermissionString(Context context, String callingPackage) {
PackageManager pm = context.getPackageManager();
@@ -483,7 +483,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@RequiresApi(19)
public static Set<SliceSpec> getCurrentSpecs() {
return sSpecs;
@@ -501,7 +501,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
@RequiresApi(19)
public static Clock getClock() {
return sClock;
diff --git a/slices/core/src/main/java/androidx/slice/SliceProviderWithCallbacks.java b/slices/core/src/main/java/androidx/slice/SliceProviderWithCallbacks.java
index c73a9ea..75ed987 100644
--- a/slices/core/src/main/java/androidx/slice/SliceProviderWithCallbacks.java
+++ b/slices/core/src/main/java/androidx/slice/SliceProviderWithCallbacks.java
@@ -16,7 +16,7 @@
package androidx.slice;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static androidx.remotecallback.ProviderRelayReceiver.ACTION_PROVIDER_RELAY;
import static androidx.remotecallback.RemoteCallback.EXTRA_METHOD;
import static androidx.remotecallback.RemoteCallback.TYPE_PROVIDER;
@@ -74,7 +74,7 @@
* @hide
*/
@Override
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public RemoteCallback toRemoteCallback(Class<T> cls, Context context, String authority,
Bundle args, String method) {
if (authority == null) {
diff --git a/slices/core/src/main/java/androidx/slice/SliceSpec.java b/slices/core/src/main/java/androidx/slice/SliceSpec.java
index 747b136..87dbdb2 100644
--- a/slices/core/src/main/java/androidx/slice/SliceSpec.java
+++ b/slices/core/src/main/java/androidx/slice/SliceSpec.java
@@ -43,7 +43,7 @@
* @see Slice
* @see SliceProvider#onBindSlice(Uri)
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@VersionedParcelize(allowSerialization = true)
@RequiresApi(19)
public final class SliceSpec implements VersionedParcelable {
diff --git a/slices/core/src/main/java/androidx/slice/SliceSpecs.java b/slices/core/src/main/java/androidx/slice/SliceSpecs.java
index 0374db9..890604c 100644
--- a/slices/core/src/main/java/androidx/slice/SliceSpecs.java
+++ b/slices/core/src/main/java/androidx/slice/SliceSpecs.java
@@ -23,7 +23,7 @@
* Constants for each of the slice specs
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@RequiresApi(19)
public class SliceSpecs {
@@ -39,11 +39,6 @@
public static final SliceSpec LIST = new SliceSpec("androidx.slice.LIST", 1);
/**
- * Same as LIST, but also supports selection rows.
- */
- public static final SliceSpec LIST_V2 = new SliceSpec("androidx.slice.LIST", 2);
-
- /**
* Messaging template. Each message contains a timestamp and a message, it optionally contains
* a source of where the message came from.
*/
diff --git a/slices/core/src/main/java/androidx/slice/SystemClock.java b/slices/core/src/main/java/androidx/slice/SystemClock.java
index 4b740f3..6b8c59c 100644
--- a/slices/core/src/main/java/androidx/slice/SystemClock.java
+++ b/slices/core/src/main/java/androidx/slice/SystemClock.java
@@ -16,7 +16,7 @@
package androidx.slice;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
@@ -24,7 +24,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
public class SystemClock implements Clock {
@Override
diff --git a/slices/core/src/main/java/androidx/slice/compat/SliceProviderCompat.java b/slices/core/src/main/java/androidx/slice/compat/SliceProviderCompat.java
index 630b212..17614c9 100644
--- a/slices/core/src/main/java/androidx/slice/compat/SliceProviderCompat.java
+++ b/slices/core/src/main/java/androidx/slice/compat/SliceProviderCompat.java
@@ -22,6 +22,7 @@
import static androidx.core.content.PermissionChecker.PERMISSION_DENIED;
import static androidx.core.content.PermissionChecker.PERMISSION_GRANTED;
+import android.annotation.SuppressLint;
import android.content.ContentProviderClient;
import android.content.ContentResolver;
import android.content.Context;
@@ -64,7 +65,7 @@
/**
* @hide
*/
-@RestrictTo(Scope.LIBRARY_GROUP)
+@RestrictTo(Scope.LIBRARY)
@RequiresApi(19)
public class SliceProviderCompat {
public static final String PERMS_PREFIX = "slice_perms_";
@@ -138,6 +139,7 @@
/**
* Called by SliceProvider when compat is needed.
*/
+ @SuppressLint("RestrictedApi")
public Bundle call(String method, String arg, Bundle extras) {
if (method.equals(METHOD_SLICE)) {
Uri uri = extras.getParcelable(EXTRA_BIND_URI);
@@ -417,6 +419,7 @@
}
}
+ @SuppressLint("RestrictedApi")
private static Slice parseSlice(final Context context, Bundle res) {
if (res == null) {
return null;
diff --git a/slices/core/src/main/java/androidx/slice/core/SliceActionImpl.java b/slices/core/src/main/java/androidx/slice/core/SliceActionImpl.java
index b642ac9..891985b 100644
--- a/slices/core/src/main/java/androidx/slice/core/SliceActionImpl.java
+++ b/slices/core/src/main/java/androidx/slice/core/SliceActionImpl.java
@@ -29,8 +29,8 @@
import static android.app.slice.SliceItem.FORMAT_INT;
import static android.app.slice.SliceItem.FORMAT_TEXT;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY;
import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
import static androidx.slice.core.SliceHints.ICON_IMAGE;
import static androidx.slice.core.SliceHints.LARGE_IMAGE;
import static androidx.slice.core.SliceHints.SMALL_IMAGE;
@@ -52,7 +52,7 @@
* Class representing an action, supports tappable icons, custom toggle icons, and default toggles.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
public class SliceActionImpl implements SliceAction {
@@ -147,7 +147,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP)
+ @RestrictTo(LIBRARY)
public SliceActionImpl(SliceItem slice) {
mSliceItem = slice;
SliceItem actionItem = SliceQuery.find(slice, FORMAT_ACTION);
@@ -225,7 +225,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public SliceItem getActionItem() {
return mActionItem;
}
diff --git a/slices/core/src/main/java/androidx/slice/core/SliceHints.java b/slices/core/src/main/java/androidx/slice/core/SliceHints.java
index 28de8ca..04c2ca9 100644
--- a/slices/core/src/main/java/androidx/slice/core/SliceHints.java
+++ b/slices/core/src/main/java/androidx/slice/core/SliceHints.java
@@ -16,7 +16,7 @@
package androidx.slice.core;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import static java.lang.annotation.RetentionPolicy.SOURCE;
@@ -30,7 +30,7 @@
* Temporary class to contain hint constants for slices to be used.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(19)
public class SliceHints {
diff --git a/slices/core/src/main/java/androidx/slice/core/SliceQuery.java b/slices/core/src/main/java/androidx/slice/core/SliceQuery.java
index 9665874..e687e85 100644
--- a/slices/core/src/main/java/androidx/slice/core/SliceQuery.java
+++ b/slices/core/src/main/java/androidx/slice/core/SliceQuery.java
@@ -37,7 +37,7 @@
* Utilities for finding content within a Slice.
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@RequiresApi(19)
public class SliceQuery {
@@ -298,7 +298,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static SliceItem findItem(Slice s, final Uri uri) {
return findSliceItem(toQueue(s), new Filter<SliceItem>() {
@Override
diff --git a/slices/core/src/main/res-public/values-as/strings.xml b/slices/core/src/main/res-public/values-as/strings.xml
deleted file mode 100644
index 5ddcef2..0000000
--- a/slices/core/src/main/res-public/values-as/strings.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="slice_provider" msgid="7510675753826300262">"androidx.slice.compat.SliceProviderCompat"</string>
-</resources>
diff --git a/slices/view/api/1.0.0.txt b/slices/view/api/1.0.0.txt
index 37f7b37..4c426cd 100644
--- a/slices/view/api/1.0.0.txt
+++ b/slices/view/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slice {
@RequiresApi(19) public class SliceMetadata {
diff --git a/slices/view/api/1.1.0-alpha01.txt b/slices/view/api/1.1.0-alpha01.txt
index e6ce12a..b6acced 100644
--- a/slices/view/api/1.1.0-alpha01.txt
+++ b/slices/view/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slice {
@RequiresApi(19) public class SliceMetadata {
diff --git a/slices/view/api/current.txt b/slices/view/api/current.txt
index e6ce12a..b6acced 100644
--- a/slices/view/api/current.txt
+++ b/slices/view/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slice {
@RequiresApi(19) public class SliceMetadata {
diff --git a/slices/view/api/restricted_1.0.0.txt b/slices/view/api/restricted_1.0.0.txt
deleted file mode 100644
index 835c78a..0000000
--- a/slices/view/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,366 +0,0 @@
-// Signature format: 3.0
-package androidx.slice {
-
- @RequiresApi(19) public class SliceMetadata {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static java.util.List<androidx.slice.core.SliceAction>? getSliceActions(androidx.slice.Slice);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface SliceMetadata.SliceLoadingState {
- }
-
- @RequiresApi(19) public class SliceStructure {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceStructure(androidx.slice.SliceItem!);
- }
-
- @RequiresApi(19) public class SliceUtils {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static androidx.slice.Slice! convert(android.content.Context!, androidx.slice.Slice!, androidx.slice.SliceUtils.SerializeOptions!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static androidx.core.graphics.drawable.IconCompat! convert(android.content.Context!, androidx.core.graphics.drawable.IconCompat!, androidx.slice.SliceUtils.SerializeOptions!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static int getLoadingState(androidx.slice.Slice);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static java.util.List<androidx.slice.SliceItem>? getSliceActions(androidx.slice.Slice);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static java.util.List<java.lang.String>? getSliceKeywords(androidx.slice.Slice);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static void serializeSlice(androidx.slice.Slice, android.content.Context, java.io.OutputStream, String, androidx.slice.SliceUtils.SerializeOptions);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final int LOADING_ALL = 0; // 0x0
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final int LOADING_COMPLETE = 2; // 0x2
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final int LOADING_PARTIAL = 1; // 0x1
- }
-
- public static class SliceUtils.SerializeOptions {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void checkThrow(String!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getActionMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public android.graphics.Bitmap.CompressFormat! getFormat();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getImageMode();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getMaxHeight();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getMaxWidth();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public int getQuality();
- }
-
- public static class SliceUtils.SliceParseException {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceUtils.SliceParseException(String!, Throwable!);
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public SliceUtils.SliceParseException(String!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public abstract class SliceViewManagerBase extends androidx.slice.SliceViewManager {
- method public void registerSliceCallback(android.net.Uri, androidx.slice.SliceViewManager.SliceCallback);
- method public void registerSliceCallback(android.net.Uri, java.util.concurrent.Executor, androidx.slice.SliceViewManager.SliceCallback);
- method public void unregisterSliceCallback(android.net.Uri, androidx.slice.SliceViewManager.SliceCallback);
- field protected final android.content.Context! mContext;
- }
-
-}
-
-package androidx.slice.widget {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class ActionRow {
- ctor public ActionRow(android.content.Context!, boolean);
- method public void setActions(java.util.List<androidx.slice.core.SliceAction>, int);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface EventInfo.SliceActionType {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface EventInfo.SliceButtonPosition {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface EventInfo.SliceRowType {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public class GridContent {
- ctor public GridContent(android.content.Context!, androidx.slice.SliceItem!);
- method public int getActualHeight();
- method public androidx.slice.SliceItem? getColorItem();
- method public CharSequence? getContentDescription();
- method public androidx.slice.SliceItem? getContentIntent();
- method public java.util.ArrayList<androidx.slice.widget.GridContent.CellContent> getGridContent();
- method public int getLargestImageMode();
- method public androidx.slice.SliceItem? getLayoutDirItem();
- method public int getMaxCellLineCount();
- method public androidx.slice.SliceItem? getSeeMoreItem();
- method public int getSmallHeight();
- method public CharSequence? getTitle();
- method public boolean hasImage();
- method public boolean isAllImages();
- method public boolean isValid();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class GridContent.CellContent {
- ctor public GridContent.CellContent(androidx.slice.SliceItem!);
- method public java.util.ArrayList<androidx.slice.SliceItem>! getCellItems();
- method public CharSequence? getContentDescription();
- method public androidx.slice.SliceItem! getContentIntent();
- method public int getImageMode();
- method public int getTextCount();
- method public androidx.slice.SliceItem? getTitleItem();
- method public boolean hasImage();
- method public boolean isImageOnly();
- method public boolean isValid();
- method public boolean populate(androidx.slice.SliceItem!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class GridRowView extends androidx.slice.widget.SliceChildView {
- ctor public GridRowView(android.content.Context!);
- ctor public GridRowView(android.content.Context!, android.util.AttributeSet!);
- method public void onClick(android.view.View!);
- method protected void onMeasure(int, int);
- method public boolean onTouch(android.view.View!, android.view.MotionEvent!);
- method public void resetView();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class LargeSliceAdapter {
- ctor public LargeSliceAdapter(android.content.Context!);
- method public int getItemCount();
- method public long getItemId(int);
- method public int getItemViewType(int);
- method public java.util.Set<androidx.slice.SliceItem>! getLoadingActions();
- method public void onBindViewHolder(androidx.slice.widget.LargeSliceAdapter.SliceViewHolder!, int);
- method public androidx.slice.widget.LargeSliceAdapter.SliceViewHolder! onCreateViewHolder(android.view.ViewGroup!, int);
- method public void onSliceActionLoading(androidx.slice.SliceItem!, int);
- method public void setAllowTwoLines(boolean);
- method public void setInsets(int, int, int, int);
- method public void setLastUpdated(long);
- method public void setLoadingActions(java.util.Set<androidx.slice.SliceItem>!);
- method public void setMaxSmallHeight(int);
- method public void setParents(androidx.slice.widget.SliceView!, androidx.slice.widget.LargeTemplateView!);
- method public void setShowLastUpdated(boolean);
- method public void setSliceActions(java.util.List<androidx.slice.core.SliceAction>!);
- method public void setSliceItems(java.util.List<androidx.slice.SliceItem>!, int, int);
- method public void setSliceObserver(androidx.slice.widget.SliceView.OnSliceActionListener!);
- method public void setStyle(androidx.slice.widget.SliceStyle!);
- }
-
- public class LargeSliceAdapter.SliceViewHolder {
- ctor public LargeSliceAdapter.SliceViewHolder(android.view.View!);
- method public void onClick(android.view.View!);
- method public boolean onTouch(android.view.View!, android.view.MotionEvent!);
- field public final androidx.slice.widget.SliceChildView! mSliceChildView;
- }
-
- protected static class LargeSliceAdapter.SliceWrapper {
- ctor public LargeSliceAdapter.SliceWrapper(androidx.slice.SliceItem!, androidx.slice.widget.LargeSliceAdapter.IdGenerator!, int);
- method public static int getFormat(androidx.slice.SliceItem!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class LargeTemplateView extends androidx.slice.widget.SliceChildView {
- ctor public LargeTemplateView(android.content.Context!);
- method public void onAttachedToWindow();
- method public void onForegroundActivated(android.view.MotionEvent!);
- method protected void onMeasure(int, int);
- method public void resetView();
- method public void setScrollable(boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public class ListContent {
- ctor public ListContent(android.content.Context!, androidx.slice.Slice!);
- ctor public ListContent(android.content.Context!, androidx.slice.Slice!, androidx.slice.widget.SliceStyle!);
- ctor public ListContent(android.content.Context!, androidx.slice.Slice!, android.util.AttributeSet!, int, int);
- method public androidx.slice.SliceItem? getColorItem();
- method public androidx.slice.SliceItem? getHeaderItem();
- method public int getHeaderTemplateType();
- method public java.util.ArrayList<androidx.slice.SliceItem> getItemsForNonScrollingList(int);
- method public int getLargeHeight(int, boolean);
- method public androidx.slice.SliceItem? getLayoutDirItem();
- method public int getListHeight(java.util.List<androidx.slice.SliceItem>!);
- method public androidx.slice.SliceItem? getPrimaryAction();
- method public java.util.ArrayList<androidx.slice.SliceItem> getRowItems();
- method public static int getRowType(android.content.Context!, androidx.slice.SliceItem!, boolean, java.util.List<androidx.slice.core.SliceAction>!);
- method public androidx.slice.SliceItem? getSeeMoreItem();
- method public androidx.slice.Slice? getSlice();
- method public java.util.List<androidx.slice.core.SliceAction>? getSliceActions();
- method public int getSmallHeight();
- method public boolean hasHeader();
- method public boolean isValid();
- method public static boolean isValidHeader(androidx.slice.SliceItem!);
- method public void setMaxSmallHeight(int);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class MessageView extends androidx.slice.widget.SliceChildView {
- ctor public MessageView(android.content.Context!);
- method protected void onFinishInflate();
- method public void resetView();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(21) public class RemoteInputView {
- ctor public RemoteInputView(android.content.Context!, android.util.AttributeSet!);
- method public void afterTextChanged(android.text.Editable!);
- method public void beforeTextChanged(CharSequence!, int, int, int);
- method public void dispatchFinishTemporaryDetach();
- method public void dispatchStartTemporaryDetach();
- method public void focusAnimated();
- method public static androidx.slice.widget.RemoteInputView! inflate(android.content.Context!, android.view.ViewGroup!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final boolean isConfirmKey(int);
- method public void onClick(android.view.View!);
- method protected void onFinishInflate();
- method public boolean onRequestSendAccessibilityEvent(android.view.View!, android.view.accessibility.AccessibilityEvent!);
- method public void onTextChanged(CharSequence!, int, int, int);
- method public boolean onTouchEvent(android.view.MotionEvent!);
- method public void setAction(androidx.slice.SliceItem!);
- method public void setRemoteInput(android.app.RemoteInput[]!, android.app.RemoteInput!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void setRevealParameters(int, int, int);
- field public static final Object! VIEW_TAG;
- }
-
- public static class RemoteInputView.RemoteEditText {
- ctor public RemoteInputView.RemoteEditText(android.content.Context!, android.util.AttributeSet!);
- method public void getFocusedRect(android.graphics.Rect!);
- method public void onCommitCompletion(android.view.inputmethod.CompletionInfo!);
- method public android.view.inputmethod.InputConnection! onCreateInputConnection(android.view.inputmethod.EditorInfo!);
- method protected void onFocusChanged(boolean, int, android.graphics.Rect!);
- method public boolean onKeyDown(int, android.view.KeyEvent!);
- method public boolean onKeyUp(int, android.view.KeyEvent!);
- method protected void onVisibilityChanged(android.view.View!, int);
- method public void setCustomSelectionActionModeCallback(android.view.ActionMode.Callback!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public class RowContent {
- ctor public RowContent(android.content.Context!, androidx.slice.SliceItem!, boolean);
- method public boolean endItemsContainAction();
- method public int getActualHeight(int);
- method public CharSequence? getContentDescription();
- method public java.util.ArrayList<androidx.slice.SliceItem>! getEndItems();
- method public androidx.slice.SliceItem? getInputRangeThumb();
- method public androidx.slice.SliceItem? getLayoutDirItem();
- method public int getLineCount();
- method public androidx.slice.SliceItem? getPrimaryAction();
- method public androidx.slice.SliceItem? getRange();
- method public androidx.slice.SliceItem getSlice();
- method public int getSmallHeight(int);
- method public androidx.slice.SliceItem? getStartItem();
- method public androidx.slice.SliceItem? getSubtitleItem();
- method public androidx.slice.SliceItem? getSummaryItem();
- method public androidx.slice.SliceItem? getTitleItem();
- method public java.util.ArrayList<androidx.slice.core.SliceAction>! getToggleItems();
- method public boolean isDefaultSeeMore();
- method public boolean isValid();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class RowView extends androidx.slice.widget.SliceChildView {
- ctor public RowView(android.content.Context!);
- method public void onClick(android.view.View!);
- method protected void onLayout(boolean, int, int, int, int);
- method protected void onMeasure(int, int);
- method public void resetView();
- method public void setSingleItem(boolean);
- field protected java.util.Set<androidx.slice.SliceItem>! mLoadingActions;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(19) public class ShortcutContent {
- ctor public ShortcutContent(androidx.slice.widget.ListContent);
- method public androidx.slice.Slice! buildSlice(androidx.slice.Slice.Builder!);
- method public androidx.slice.SliceItem! getActionItem();
- method public androidx.slice.SliceItem! getColorItem();
- method public androidx.slice.SliceItem! getIcon();
- method public androidx.slice.SliceItem! getLabel();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class ShortcutView extends androidx.slice.widget.SliceChildView {
- ctor public ShortcutView(android.content.Context!);
- method public boolean performClick();
- method public void resetView();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class SliceActionView {
- ctor public SliceActionView(android.content.Context!);
- method public androidx.slice.core.SliceActionImpl? getAction();
- method public void onCheckedChanged(android.widget.CompoundButton!, boolean);
- method public void onClick(android.view.View!);
- method public void sendAction();
- method public void setAction(androidx.slice.core.SliceActionImpl, androidx.slice.widget.EventInfo!, androidx.slice.widget.SliceView.OnSliceActionListener!, int, androidx.slice.widget.SliceActionView.SliceActionLoadingListener!);
- method public void setLoading(boolean);
- method public void toggle();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public abstract class SliceChildView {
- ctor public SliceChildView(android.content.Context);
- ctor public SliceChildView(android.content.Context!, android.util.AttributeSet!);
- method public int getActualHeight();
- method public java.util.Set<androidx.slice.SliceItem>! getLoadingActions();
- method public int getMode();
- method public int getSmallHeight();
- method public abstract void resetView();
- method public void setActionLoading(androidx.slice.SliceItem!);
- method public void setAllowTwoLines(boolean);
- method public void setInsets(int, int, int, int);
- method public void setLastUpdated(long);
- method public void setLoadingActions(java.util.Set<androidx.slice.SliceItem>!);
- method public void setMaxSmallHeight(int);
- method public void setMode(int);
- method public void setShowLastUpdated(boolean);
- method public void setSliceActionListener(androidx.slice.widget.SliceView.OnSliceActionListener!);
- method public void setSliceActionLoadingListener(androidx.slice.widget.SliceActionView.SliceActionLoadingListener!);
- method public void setSliceActions(java.util.List<androidx.slice.core.SliceAction>!);
- method public void setSliceContent(androidx.slice.widget.ListContent!);
- method public void setSliceItem(androidx.slice.SliceItem!, boolean, int, int, androidx.slice.widget.SliceView.OnSliceActionListener!);
- method public void setStyle(androidx.slice.widget.SliceStyle!);
- method public void setTint(@ColorInt int);
- field protected int mInsetBottom;
- field protected int mInsetEnd;
- field protected int mInsetStart;
- field protected int mInsetTop;
- field protected long mLastUpdated;
- field protected androidx.slice.widget.SliceActionView.SliceActionLoadingListener! mLoadingListener;
- field protected int mMode;
- field protected androidx.slice.widget.SliceView.OnSliceActionListener! mObserver;
- field protected boolean mShowLastUpdated;
- field protected androidx.slice.widget.SliceStyle! mSliceStyle;
- field protected int mTintColor;
- }
-
- @RequiresApi(19) public final class SliceLiveData {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.lifecycle.LiveData<androidx.slice.Slice> fromStream(android.content.Context, androidx.slice.SliceViewManager!, java.io.InputStream, androidx.slice.widget.SliceLiveData.OnErrorListener!);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final androidx.slice.SliceSpec! OLD_BASIC;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final androidx.slice.SliceSpec! OLD_LIST;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final java.util.Set<androidx.slice.SliceSpec>! SUPPORTED_SPECS;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class SliceStyle {
- ctor public SliceStyle(android.content.Context!, android.util.AttributeSet!, int, int);
- method public int getGridBottomPadding();
- method public int getGridSubtitleSize();
- method public int getGridTitleSize();
- method public int getGridTopPadding();
- method public int getHeaderSubtitleSize();
- method public int getHeaderTitleSize();
- method public int getSubtitleColor();
- method public int getSubtitleSize();
- method public int getTintColor();
- method public int getTitleColor();
- method public int getTitleSize();
- method public int getVerticalGridTextPadding();
- method public int getVerticalHeaderTextPadding();
- method public int getVerticalTextPadding();
- method public void setTintColor(int);
- }
-
- @RequiresApi(19) public class SliceView {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean isShowingActionRow();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public boolean isSliceViewClickable();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static String! modeToString(int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void setClickInfo(int[]!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void setMode(int, boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void setShowActionRow(boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void setTint(int);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static final java.util.Comparator<androidx.slice.core.SliceAction>! SLICE_ACTION_PRIORITY_COMPARATOR;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface SliceView.SliceMode {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) @RequiresApi(19) public class SliceViewUtil {
- method @ColorInt public static int applyAlpha(float, int);
- method @ColorInt public static int applyAlphaAttr(android.content.Context, @AttrRes int, int);
- method public static void createCircledIcon(android.content.Context, int, androidx.core.graphics.drawable.IconCompat!, boolean, android.view.ViewGroup!);
- method public static androidx.core.graphics.drawable.IconCompat! createIconFromDrawable(android.graphics.drawable.Drawable!);
- method public static android.graphics.Bitmap getCircularBitmap(android.graphics.Bitmap!);
- method @ColorInt public static int getColorAccent(android.content.Context);
- method @ColorInt public static int getColorAttr(android.content.Context, @AttrRes int);
- method @ColorInt public static int getColorError(android.content.Context);
- method @ColorInt public static int getDefaultColor(android.content.Context, int);
- method @ColorInt public static int getDisabled(android.content.Context, int);
- method public static android.graphics.drawable.Drawable! getDrawable(android.content.Context, @AttrRes int);
- method public static int getThemeAttr(android.content.Context, @AttrRes int);
- method public static CharSequence! getTimestampString(android.content.Context!, long);
- method public static int resolveLayoutDirection(int);
- method public static void tintIndeterminateProgressBar(android.content.Context!, android.widget.ProgressBar!);
- }
-
-}
-
diff --git a/slices/view/build.gradle b/slices/view/build.gradle
index acce371..a8aa16f 100644
--- a/slices/view/build.gradle
+++ b/slices/view/build.gradle
@@ -25,7 +25,6 @@
dependencies {
implementation(project(":slice-core"))
implementation(project(":recyclerview"))
- implementation(project(":collection"))
api(ARCH_LIFECYCLE_LIVEDATA_CORE, libs.exclude_annotations_transitive)
androidTestImplementation(project(":slice-builders"))
@@ -48,5 +47,4 @@
description = "A library that handles rendering of slice content into supported templates"
failOnUncheckedWarnings = false
failOnDeprecationWarnings = false
- trackRestrictedAPIs = false
}
diff --git a/slices/view/src/androidTest/java/androidx/slice/SliceBuilderTest.java b/slices/view/src/androidTest/java/androidx/slice/SliceBuilderTest.java
index f6a2bb6..f4835bc8 100644
--- a/slices/view/src/androidTest/java/androidx/slice/SliceBuilderTest.java
+++ b/slices/view/src/androidTest/java/androidx/slice/SliceBuilderTest.java
@@ -40,8 +40,8 @@
import androidx.slice.widget.SliceLiveData;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -52,7 +52,7 @@
* Tests for content validation of the different slice builders.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
@SdkSuppress(minSdkVersion = 19)
public class SliceBuilderTest {
diff --git a/slices/view/src/androidTest/java/androidx/slice/SliceMetadataTest.java b/slices/view/src/androidTest/java/androidx/slice/SliceMetadataTest.java
index c31eff0f..07232cc 100644
--- a/slices/view/src/androidTest/java/androidx/slice/SliceMetadataTest.java
+++ b/slices/view/src/androidTest/java/androidx/slice/SliceMetadataTest.java
@@ -55,8 +55,8 @@
import androidx.slice.widget.SliceLiveData;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Assert;
import org.junit.Before;
@@ -74,7 +74,7 @@
* Tests for {@link SliceMetadata}.
*/
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
@SdkSuppress(minSdkVersion = 19)
public class SliceMetadataTest {
@@ -485,16 +485,6 @@
}
@Test
- public void testGetToggleEmptySlice() {
- Uri uri = Uri.parse("content://pkg/slice");
-
- ListBuilder lb = new ListBuilder(mContext, uri, ListBuilder.INFINITY);
- Slice rowSlice = lb.build();
- SliceMetadata rowInfo = SliceMetadata.from(mContext, rowSlice);
- assertTrue(rowInfo.getToggles().isEmpty());
- }
-
- @Test
public void testSendToggleAction() {
final AtomicBoolean toggleState = new AtomicBoolean(true);
final CountDownLatch latch = new CountDownLatch(3);
diff --git a/slices/view/src/androidTest/java/androidx/slice/SliceViewManagerTest.java b/slices/view/src/androidTest/java/androidx/slice/SliceViewManagerTest.java
index 784796e..f91dcc6 100644
--- a/slices/view/src/androidTest/java/androidx/slice/SliceViewManagerTest.java
+++ b/slices/view/src/androidTest/java/androidx/slice/SliceViewManagerTest.java
@@ -42,8 +42,8 @@
import androidx.slice.widget.SliceLiveData;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -55,7 +55,7 @@
import java.util.concurrent.Executor;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
@SdkSuppress(minSdkVersion = 19)
public class SliceViewManagerTest {
diff --git a/slices/view/src/androidTest/java/androidx/slice/SliceXmlTest.java b/slices/view/src/androidTest/java/androidx/slice/SliceXmlTest.java
index 803d163..9804365 100644
--- a/slices/view/src/androidTest/java/androidx/slice/SliceXmlTest.java
+++ b/slices/view/src/androidTest/java/androidx/slice/SliceXmlTest.java
@@ -43,8 +43,8 @@
import androidx.slice.view.R;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -56,7 +56,7 @@
import java.util.List;
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
@SdkSuppress(minSdkVersion = 19)
public class SliceXmlTest {
diff --git a/slices/view/src/androidTest/java/androidx/slice/widget/SliceLiveDataTest.java b/slices/view/src/androidTest/java/androidx/slice/widget/SliceLiveDataTest.java
index ae76464..73a323c 100644
--- a/slices/view/src/androidTest/java/androidx/slice/widget/SliceLiveDataTest.java
+++ b/slices/view/src/androidTest/java/androidx/slice/widget/SliceLiveDataTest.java
@@ -45,8 +45,8 @@
import androidx.test.annotation.UiThreadTest;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.After;
@@ -62,7 +62,7 @@
import java.util.concurrent.CountDownLatch;
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
@SdkSuppress(minSdkVersion = 19)
public class SliceLiveDataTest {
diff --git a/slices/view/src/main/java/androidx/slice/SliceMetadata.java b/slices/view/src/main/java/androidx/slice/SliceMetadata.java
index 257963d..b407c45 100644
--- a/slices/view/src/main/java/androidx/slice/SliceMetadata.java
+++ b/slices/view/src/main/java/androidx/slice/SliceMetadata.java
@@ -241,8 +241,8 @@
toggles.add(action);
}
}
- } else if (mHeaderContent != null) {
- toggles.addAll(mHeaderContent.getToggleItems());
+ } else {
+ toggles = mHeaderContent.getToggleItems();
}
return toggles;
}
@@ -498,7 +498,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public ListContent getListContent() {
return mListContent;
}
diff --git a/slices/view/src/main/java/androidx/slice/SliceUtils.java b/slices/view/src/main/java/androidx/slice/SliceUtils.java
index 9c2f258..91323ff 100644
--- a/slices/view/src/main/java/androidx/slice/SliceUtils.java
+++ b/slices/view/src/main/java/androidx/slice/SliceUtils.java
@@ -32,6 +32,7 @@
import static java.lang.annotation.RetentionPolicy.SOURCE;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
@@ -184,6 +185,7 @@
* @param options Options defining how to handle non-serializable items.
* @throws IllegalArgumentException if the slice cannot be serialized using the given options.
*/
+ @SuppressLint("RestrictedApi")
public static void serializeSlice(@NonNull Slice s, @NonNull final Context context,
@NonNull OutputStream output,
@NonNull final SerializeOptions options) throws IllegalArgumentException {
@@ -264,6 +266,7 @@
* @param listener Listener used to handle actions when reconstructing the slice.
* @throws SliceParseException if the InputStream cannot be parsed.
*/
+ @SuppressLint("RestrictedApi")
public static @NonNull Slice parseSlice(@NonNull final Context context,
@NonNull InputStream input, @NonNull String encoding,
@NonNull final SliceActionListener listener) throws IOException, SliceParseException {
diff --git a/slices/view/src/main/java/androidx/slice/widget/GridContent.java b/slices/view/src/main/java/androidx/slice/widget/GridContent.java
index bbc8c70..6159025 100644
--- a/slices/view/src/main/java/androidx/slice/widget/GridContent.java
+++ b/slices/view/src/main/java/androidx/slice/widget/GridContent.java
@@ -52,7 +52,7 @@
* Extracts information required to present content in a grid format from a slice.
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@RequiresApi(19)
public class GridContent extends SliceContent {
@@ -236,7 +236,7 @@
* Extracts information required to present content in a cell.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static class CellContent {
private SliceItem mContentIntent;
private ArrayList<SliceItem> mCellItems = new ArrayList<>();
diff --git a/slices/view/src/main/java/androidx/slice/widget/LargeSliceAdapter.java b/slices/view/src/main/java/androidx/slice/widget/LargeSliceAdapter.java
new file mode 100644
index 0000000..548074d
--- /dev/null
+++ b/slices/view/src/main/java/androidx/slice/widget/LargeSliceAdapter.java
@@ -0,0 +1,403 @@
+/*
+ * Copyright 2017 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.slice.widget;
+
+import static android.app.slice.Slice.HINT_HORIZONTAL;
+import static android.app.slice.Slice.SUBTYPE_MESSAGE;
+import static android.app.slice.Slice.SUBTYPE_SOURCE;
+import static android.app.slice.SliceItem.FORMAT_ACTION;
+import static android.app.slice.SliceItem.FORMAT_SLICE;
+
+import static androidx.slice.widget.SliceView.MODE_LARGE;
+
+import android.app.slice.Slice;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewGroup.LayoutParams;
+
+import androidx.annotation.RequiresApi;
+import androidx.annotation.RestrictTo;
+import androidx.collection.ArrayMap;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.slice.SliceItem;
+import androidx.slice.core.SliceAction;
+import androidx.slice.core.SliceQuery;
+import androidx.slice.view.R;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @hide
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY)
+@RequiresApi(19)
+public class LargeSliceAdapter extends RecyclerView.Adapter<LargeSliceAdapter.SliceViewHolder>
+ implements SliceActionView.SliceActionLoadingListener {
+
+ static final int TYPE_DEFAULT = 1;
+ static final int TYPE_HEADER = 2; // TODO: headers shouldn't scroll off
+ static final int TYPE_GRID = 3;
+ static final int TYPE_MESSAGE = 4;
+ static final int TYPE_MESSAGE_LOCAL = 5;
+
+ static final int HEADER_INDEX = 0;
+
+ private final IdGenerator mIdGen = new IdGenerator();
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ final Context mContext;
+ private List<SliceWrapper> mSlices = new ArrayList<>();
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ SliceView.OnSliceActionListener mSliceObserver;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ int mColor;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ SliceStyle mSliceStyle;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ List<SliceAction> mSliceActions;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ boolean mShowLastUpdated;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ long mLastUpdated;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ SliceView mParent;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ LargeTemplateView mTemplateView;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ int mInsetStart;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ int mInsetTop;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ int mInsetEnd;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ int mInsetBottom;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ Set<SliceItem> mLoadingActions = new HashSet<>();
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ boolean mAllowTwoLines;
+ @SuppressWarnings("WeakerAccess") /* synthetic access */
+ SliceViewPolicy mPolicy;
+
+ public LargeSliceAdapter(Context context) {
+ mContext = context;
+ setHasStableIds(true);
+ }
+
+ /**
+ * Sets the SliceView parent and the template parent.
+ */
+ public void setParents(SliceView parent, LargeTemplateView templateView) {
+ mParent = parent;
+ mTemplateView = templateView;
+ }
+
+ /**
+ * Sets the insets (padding) for slice view. LargeSliceAdapter will handle determining
+ * if a child needs a particular padding, i.e. if it's the first row then the top inset
+ * will be applied to it whereas subsequent rows would get a top inset of 0.
+ */
+ public void setInsets(int l, int t, int r, int b) {
+ mInsetStart = l;
+ mInsetTop = t;
+ mInsetEnd = r;
+ mInsetBottom = b;
+ }
+
+ /**
+ * Sets the observer to pass down to child views.
+ */
+ public void setSliceObserver(SliceView.OnSliceActionListener observer) {
+ mSliceObserver = observer;
+ }
+
+ /**
+ * Sets the actions to display for this slice, this adjusts what's displayed in the header item.
+ */
+ public void setSliceActions(List<SliceAction> actions) {
+ mSliceActions = actions;
+ notifyHeaderChanged();
+ }
+
+ /**
+ * Set the {@link SliceItem}'s to be displayed in the adapter and the accent color.
+ */
+ public void setSliceItems(List<SliceContent> slices, int color, int mode) {
+ if (slices == null) {
+ mLoadingActions.clear();
+ mSlices.clear();
+ } else {
+ mIdGen.resetUsage();
+ mSlices = new ArrayList<>(slices.size());
+ for (SliceContent s : slices) {
+ mSlices.add(new SliceWrapper(s, mIdGen, mode));
+ }
+ }
+ mColor = color;
+ notifyDataSetChanged();
+ }
+
+ /**
+ * Sets the style information to use for views in this adapter.
+ */
+ public void setStyle(SliceStyle style) {
+ mSliceStyle = style;
+ notifyDataSetChanged();
+ }
+
+ /**
+ * Sets the policy information to use for views in this adapter.
+ */
+ public void setPolicy(SliceViewPolicy p) {
+ mPolicy = p;
+ }
+
+ /**
+ * Sets whether the last updated time should be shown on the slice.
+ */
+ public void setShowLastUpdated(boolean showLastUpdated) {
+ if (mShowLastUpdated != showLastUpdated) {
+ mShowLastUpdated = showLastUpdated;
+ notifyHeaderChanged();
+ }
+ }
+
+ /**
+ * Sets when the slice was last updated.
+ */
+ public void setLastUpdated(long lastUpdated) {
+ if (mLastUpdated != lastUpdated) {
+ mLastUpdated = lastUpdated;
+ notifyHeaderChanged();
+ }
+ }
+
+ /**
+ * Indicates that no actions should be loading and updates the views.
+ */
+ public void setLoadingActions(Set<SliceItem> actions) {
+ if (actions == null) {
+ mLoadingActions.clear();
+ } else {
+ mLoadingActions = actions;
+ }
+ notifyDataSetChanged();
+ }
+
+ /**
+ * Returns the currently loading actions.
+ */
+ public Set<SliceItem> getLoadingActions() {
+ return mLoadingActions;
+ }
+
+ @Override
+ public void onSliceActionLoading(SliceItem actionItem, int position) {
+ mLoadingActions.add(actionItem);
+ if (getItemCount() > position) {
+ notifyItemChanged(position);
+ } else {
+ notifyDataSetChanged();
+ }
+ }
+
+ /**
+ * Sets whether this slice can have 2 lines of subtitle text in the first row.
+ */
+ public void setAllowTwoLines(boolean allowTwoLines) {
+ mAllowTwoLines = allowTwoLines;
+ notifyHeaderChanged();
+ }
+
+ /**
+ * Notifies that content in the header of this adapter has changed.
+ */
+ public void notifyHeaderChanged() {
+ if (getItemCount() > 0) {
+ notifyItemChanged(HEADER_INDEX);
+ }
+ }
+
+ @Override
+ public SliceViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ View v = inflateForType(viewType);
+ v.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
+ return new SliceViewHolder(v);
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ return mSlices.get(position).mType;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return mSlices.get(position).mId;
+ }
+
+ @Override
+ public int getItemCount() {
+ return mSlices.size();
+ }
+
+ @Override
+ public void onBindViewHolder(SliceViewHolder holder, int position) {
+ SliceWrapper slice = mSlices.get(position);
+ holder.bind(slice.mItem, position);
+ }
+
+ private View inflateForType(int viewType) {
+ switch (viewType) {
+ case TYPE_GRID:
+ return LayoutInflater.from(mContext).inflate(R.layout.abc_slice_grid, null);
+ case TYPE_MESSAGE:
+ return LayoutInflater.from(mContext).inflate(R.layout.abc_slice_message, null);
+ case TYPE_MESSAGE_LOCAL:
+ return LayoutInflater.from(mContext).inflate(R.layout.abc_slice_message_local,
+ null);
+ default:
+ return new RowView(mContext);
+ }
+ }
+
+ protected static class SliceWrapper {
+ final SliceContent mItem;
+ final int mType;
+ final long mId;
+
+ public SliceWrapper(SliceContent item, IdGenerator idGen, int mode) {
+ mItem = item;
+ mType = getFormat(item.getSliceItem());
+ mId = idGen.getId(item.getSliceItem());
+ }
+
+ public static int getFormat(SliceItem item) {
+ if (SUBTYPE_MESSAGE.equals(item.getSubType())) {
+ // TODO: Better way to determine me or not? Something more like Messaging style.
+ if (SliceQuery.findSubtype(item, null, SUBTYPE_SOURCE) != null) {
+ return TYPE_MESSAGE;
+ } else {
+ return TYPE_MESSAGE_LOCAL;
+ }
+ }
+ if (item.hasHint(HINT_HORIZONTAL)) {
+ return TYPE_GRID;
+ }
+ if (!item.hasHint(Slice.HINT_LIST_ITEM)) {
+ return TYPE_HEADER;
+ }
+ return TYPE_DEFAULT;
+ }
+ }
+
+ /**
+ * A {@link RecyclerView.ViewHolder} for presenting slices in {@link LargeSliceAdapter}.
+ */
+ public class SliceViewHolder extends RecyclerView.ViewHolder implements View.OnTouchListener,
+ View.OnClickListener {
+ public final SliceChildView mSliceChildView;
+
+ public SliceViewHolder(View itemView) {
+ super(itemView);
+ mSliceChildView = itemView instanceof SliceChildView ? (SliceChildView) itemView : null;
+ }
+
+ void bind(SliceContent item, int position) {
+ if (mSliceChildView == null || item == null) {
+ return;
+ }
+ // Click listener used to pipe click events to parent
+ mSliceChildView.setOnClickListener(this);
+ // Touch listener used to pipe events to touch feedback drawable
+ mSliceChildView.setOnTouchListener(this);
+ mSliceChildView.setSliceActionLoadingListener(LargeSliceAdapter.this);
+
+ final boolean isHeader = position == HEADER_INDEX;
+ int mode = mParent != null ? mParent.getMode() : MODE_LARGE;
+ mSliceChildView.setLoadingActions(mLoadingActions);
+ mSliceChildView.setPolicy(mPolicy);
+ mSliceChildView.setTint(mColor);
+ mSliceChildView.setStyle(mSliceStyle);
+ mSliceChildView.setShowLastUpdated(isHeader && mShowLastUpdated);
+ mSliceChildView.setLastUpdated(isHeader ? mLastUpdated : -1);
+ // Only apply top / bottom insets to first / last rows
+ int top = position == 0 ? mInsetTop : 0;
+ int bottom = position == getItemCount() - 1 ? mInsetBottom : 0;
+ mSliceChildView.setInsets(mInsetStart, top, mInsetEnd, bottom);
+ mSliceChildView.setAllowTwoLines(mAllowTwoLines);
+ mSliceChildView.setSliceActions(isHeader ? mSliceActions : null);
+ mSliceChildView.setSliceItem(item, isHeader, position, getItemCount(), mSliceObserver);
+ int[] info = new int[2];
+ info[0] = ListContent.getRowType(item, isHeader, mSliceActions);
+ info[1] = position;
+ mSliceChildView.setTag(info);
+ }
+
+ @Override
+ public void onClick(View v) {
+ if (mParent != null) {
+ mParent.setClickInfo((int[]) v.getTag());
+ mParent.performClick();
+ }
+ }
+
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ if (mTemplateView != null) {
+ mTemplateView.onForegroundActivated(event);
+ }
+ return false;
+ }
+ }
+
+ private static class IdGenerator {
+ private long mNextLong = 0;
+ private final ArrayMap<String, Long> mCurrentIds = new ArrayMap<>();
+ private final ArrayMap<String, Integer> mUsedIds = new ArrayMap<>();
+
+ IdGenerator() {
+ }
+
+ public long getId(SliceItem item) {
+ String str = genString(item);
+ if (!mCurrentIds.containsKey(str)) {
+ mCurrentIds.put(str, mNextLong++);
+ }
+ long id = mCurrentIds.get(str);
+ Integer usedIdIndex = mUsedIds.get(str);
+ int index = usedIdIndex != null ? usedIdIndex : 0;
+ mUsedIds.put(str, index + 1);
+ return id + index * 10000;
+ }
+
+ private String genString(SliceItem item) {
+ if (FORMAT_SLICE.equals(item.getFormat())
+ || FORMAT_ACTION.equals(item.getFormat())) {
+ return String.valueOf(item.getSlice().getItems().size());
+ }
+ return item.toString();
+ }
+
+ public void resetUsage() {
+ mUsedIds.clear();
+ }
+ }
+}
diff --git a/slices/view/src/main/java/androidx/slice/widget/LargeTemplateView.java b/slices/view/src/main/java/androidx/slice/widget/LargeTemplateView.java
new file mode 100644
index 0000000..0ac711a
--- /dev/null
+++ b/slices/view/src/main/java/androidx/slice/widget/LargeTemplateView.java
@@ -0,0 +1,246 @@
+/*
+ * Copyright 2017 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.slice.widget;
+
+import android.content.Context;
+import android.os.Build;
+import android.view.MotionEvent;
+import android.view.View;
+import android.widget.FrameLayout;
+
+import androidx.annotation.RequiresApi;
+import androidx.annotation.RestrictTo;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.slice.SliceItem;
+import androidx.slice.core.SliceAction;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @hide
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY)
+@RequiresApi(19)
+public class LargeTemplateView extends SliceChildView implements
+ SliceViewPolicy.PolicyChangeListener {
+
+ private SliceView mParent;
+ private final View mForeground;
+ private final LargeSliceAdapter mAdapter;
+ private final RecyclerView mRecyclerView;
+ private ListContent mListContent;
+ private ArrayList<SliceContent> mDisplayedItems = new ArrayList<>();
+ private int mDisplayedItemsHeight = 0;
+ private int[] mLoc = new int[2];
+
+ public LargeTemplateView(Context context) {
+ super(context);
+ mRecyclerView = new RecyclerView(getContext());
+ mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
+ mAdapter = new LargeSliceAdapter(context);
+ mRecyclerView.setAdapter(mAdapter);
+ addView(mRecyclerView);
+
+ mForeground = new View(getContext());
+ mForeground.setBackground(SliceViewUtil.getDrawable(getContext(),
+ android.R.attr.selectableItemBackground));
+ addView(mForeground);
+
+ FrameLayout.LayoutParams lp = (LayoutParams) mForeground.getLayoutParams();
+ lp.width = LayoutParams.MATCH_PARENT;
+ lp.height = LayoutParams.MATCH_PARENT;
+ mForeground.setLayoutParams(lp);
+ }
+
+ @Override
+ public void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ mParent = (SliceView) getParent();
+ mAdapter.setParents(mParent, this);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int height = MeasureSpec.getSize(heightMeasureSpec);
+ if (!mViewPolicy.isScrollable() && mDisplayedItems.size() > 0
+ && mDisplayedItemsHeight != height) {
+ updateDisplayedItems(height);
+ }
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+ }
+
+ @Override
+ public void setInsets(int l, int t, int r, int b) {
+ super.setInsets(l, t, r, b);
+ mAdapter.setInsets(l, t, r, b);
+ }
+
+ /**
+ * Called when the foreground view handling touch feedback should be activated.
+ * @param event the event to handle.
+ */
+ public void onForegroundActivated(MotionEvent event) {
+ if (mParent != null && !mParent.isSliceViewClickable()) {
+ // Only show highlight if clickable
+ mForeground.setPressed(false);
+ return;
+ }
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ mForeground.getLocationOnScreen(mLoc);
+ final int x = (int) (event.getRawX() - mLoc[0]);
+ final int y = (int) (event.getRawY() - mLoc[1]);
+ mForeground.getBackground().setHotspot(x, y);
+ }
+ int action = event.getActionMasked();
+ if (action == MotionEvent.ACTION_DOWN) {
+ mForeground.setPressed(true);
+ } else if (action == MotionEvent.ACTION_CANCEL
+ || action == MotionEvent.ACTION_UP
+ || action == MotionEvent.ACTION_MOVE) {
+ mForeground.setPressed(false);
+ }
+ }
+
+ @Override
+ public void setPolicy(SliceViewPolicy policy) {
+ super.setPolicy(policy);
+ mAdapter.setPolicy(policy);
+ policy.setListener(this);
+ }
+
+ @Override
+ public void setActionLoading(SliceItem item) {
+ mAdapter.onSliceActionLoading(item, 0 /* header position */);
+ }
+
+ @Override
+ public void setLoadingActions(Set<SliceItem> loadingActions) {
+ mAdapter.setLoadingActions(loadingActions);
+ }
+
+ @Override
+ public Set<SliceItem> getLoadingActions() {
+ return mAdapter.getLoadingActions();
+ }
+
+ @Override
+ public void setTint(int tint) {
+ super.setTint(tint);
+ updateDisplayedItems(getMeasuredHeight());
+ }
+
+ @Override
+ public void setSliceActionListener(SliceView.OnSliceActionListener observer) {
+ mObserver = observer;
+ if (mAdapter != null) {
+ mAdapter.setSliceObserver(mObserver);
+ }
+ }
+
+ @Override
+ public void setSliceActions(List<SliceAction> actions) {
+ mAdapter.setSliceActions(actions);
+ }
+
+ @Override
+ public void setSliceContent(ListContent sliceContent) {
+ mListContent = sliceContent;
+ int sliceHeight = mListContent.getHeight(mSliceStyle, mViewPolicy);
+ updateDisplayedItems(sliceHeight);
+ }
+
+ @Override
+ public void setStyle(SliceStyle style) {
+ super.setStyle(style);
+ mAdapter.setStyle(style);
+ }
+
+ @Override
+ public void setShowLastUpdated(boolean showLastUpdated) {
+ super.setShowLastUpdated(showLastUpdated);
+ mAdapter.setShowLastUpdated(showLastUpdated);
+ }
+
+ @Override
+ public void setLastUpdated(long lastUpdated) {
+ super.setLastUpdated(lastUpdated);
+ mAdapter.setLastUpdated(lastUpdated);
+ }
+
+ @Override
+ public void setAllowTwoLines(boolean allowTwoLines) {
+ mAdapter.setAllowTwoLines(allowTwoLines);
+ }
+
+ private void updateDisplayedItems(int height) {
+ if (mListContent == null || !mListContent.isValid()) {
+ resetView();
+ return;
+ }
+ mDisplayedItems = mListContent.getRowItems(height, mSliceStyle, mViewPolicy);
+ mDisplayedItemsHeight = mListContent.getListHeight(mDisplayedItems, mSliceStyle,
+ mViewPolicy);
+ mAdapter.setSliceItems(mDisplayedItems, mTintColor, mViewPolicy.getMode());
+ updateOverscroll();
+ }
+
+ private void updateOverscroll() {
+ boolean scrollable = mDisplayedItemsHeight > getMeasuredHeight();
+ mRecyclerView.setOverScrollMode(mViewPolicy.isScrollable() && scrollable
+ ? View.OVER_SCROLL_IF_CONTENT_SCROLLS
+ : View.OVER_SCROLL_NEVER);
+ }
+
+ @Override
+ public void resetView() {
+ mDisplayedItemsHeight = 0;
+ mDisplayedItems.clear();
+ mAdapter.setSliceItems(null, -1, getMode());
+ mListContent = null;
+ }
+
+ @Override
+ public void onScrollingChanged(boolean newScrolling) {
+ if (mListContent != null) {
+ updateDisplayedItems(mListContent.getHeight(mSliceStyle, mViewPolicy));
+ }
+ }
+
+ @Override
+ public void onMaxHeightChanged(int newNewHeight) {
+ if (mListContent != null) {
+ updateDisplayedItems(mListContent.getHeight(mSliceStyle, mViewPolicy));
+ }
+ }
+
+ @Override
+ public void onMaxSmallChanged(int newMaxSmallHeight) {
+ if (mAdapter != null) {
+ mAdapter.notifyHeaderChanged();
+ }
+ }
+
+ @Override
+ public void onModeChanged(int newMode) {
+ if (mListContent != null) {
+ updateDisplayedItems(mListContent.getHeight(mSliceStyle, mViewPolicy));
+ }
+ }
+}
diff --git a/slices/view/src/main/java/androidx/slice/widget/ListContent.java b/slices/view/src/main/java/androidx/slice/widget/ListContent.java
index 2b28b91..3770505 100644
--- a/slices/view/src/main/java/androidx/slice/widget/ListContent.java
+++ b/slices/view/src/main/java/androidx/slice/widget/ListContent.java
@@ -52,7 +52,7 @@
* Extracts information required to present content in a list format from a slice.
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@RequiresApi(19)
public class ListContent extends SliceContent {
diff --git a/slices/view/src/main/java/androidx/slice/widget/RowContent.java b/slices/view/src/main/java/androidx/slice/widget/RowContent.java
index 72c2cf3..6544d31 100644
--- a/slices/view/src/main/java/androidx/slice/widget/RowContent.java
+++ b/slices/view/src/main/java/androidx/slice/widget/RowContent.java
@@ -57,7 +57,7 @@
* Extracts information required to present content in a row format from a slice.
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@RequiresApi(19)
public class RowContent extends SliceContent {
private static final String TAG = "RowContent";
diff --git a/slices/view/src/main/java/androidx/slice/widget/RowStyle.java b/slices/view/src/main/java/androidx/slice/widget/RowStyle.java
deleted file mode 100644
index 2f8e5e4..0000000
--- a/slices/view/src/main/java/androidx/slice/widget/RowStyle.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2019 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.slice.widget;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-
-import androidx.annotation.RequiresApi;
-import androidx.annotation.RestrictTo;
-import androidx.slice.view.R;
-
-/**
- * Holds style information shared between child views of a row
- * @hide
- */
-@RestrictTo(RestrictTo.Scope.LIBRARY)
-@RequiresApi(19)
-public class RowStyle {
- private int mTitleItemEndPadding;
- private int mContentStartPadding;
- private int mContentEndPadding;
- private int mEndItemStartPadding;
- private int mEndItemEndPadding;
- private int mBottomDividerStartPadding;
- private int mBottomDividerEndPadding;
- private int mActionDividerHeight;
-
- public RowStyle(Context context, int resId) {
- TypedArray a = context.getTheme().obtainStyledAttributes(resId, R.styleable.RowStyle);
- try {
- mTitleItemEndPadding = (int) a.getDimension(
- R.styleable.RowStyle_titleItemEndPadding, -1);
- mContentStartPadding = (int) a.getDimension(
- R.styleable.RowStyle_contentStartPadding, -1);
- mContentEndPadding = (int) a.getDimension(
- R.styleable.RowStyle_contentEndPadding, -1);
- mEndItemStartPadding = (int) a.getDimension(
- R.styleable.RowStyle_endItemStartPadding, -1);
- mEndItemEndPadding = (int) a.getDimension(
- R.styleable.RowStyle_endItemEndPadding, -1);
- mBottomDividerStartPadding = (int) a.getDimension(
- R.styleable.RowStyle_bottomDividerStartPadding, -1);
- mBottomDividerEndPadding = (int) a.getDimension(
- R.styleable.RowStyle_bottomDividerEndPadding, -1);
- mActionDividerHeight = (int) a.getDimension(
- R.styleable.RowStyle_actionDividerHeight, -1);
- } finally {
- a.recycle();
- }
- }
-
- public int getTitleItemEndPadding() {
- return mTitleItemEndPadding;
- }
-
- public int getContentStartPadding() {
- return mContentStartPadding;
- }
-
- public int getContentEndPadding() {
- return mContentEndPadding;
- }
-
- public int getEndItemStartPadding() {
- return mEndItemStartPadding;
- }
-
- public int getEndItemEndPadding() {
- return mEndItemEndPadding;
- }
-
- public int getBottomDividerStartPadding() {
- return mBottomDividerStartPadding;
- }
-
- public int getBottomDividerEndPadding() {
- return mBottomDividerEndPadding;
- }
-
- public int getActionDividerHeight() {
- return mActionDividerHeight;
- }
-}
diff --git a/slices/view/src/main/java/androidx/slice/widget/RowView.java b/slices/view/src/main/java/androidx/slice/widget/RowView.java
index a710afb0..bc7a6acd 100644
--- a/slices/view/src/main/java/androidx/slice/widget/RowView.java
+++ b/slices/view/src/main/java/androidx/slice/widget/RowView.java
@@ -81,7 +81,7 @@
/**
* Row item is in small template format and can be used to construct list items for use
- * with {@link TemplateView}.
+ * with {@link LargeTemplateView}.
*
* @hide
*/
@@ -156,6 +156,7 @@
private int mIdealRangeHeight;
// How big mRangeBar wants to be.
private int mMeasuredRangeHeight;
+ private int mMaxSmallHeight;
public RowView(Context context) {
super(context);
@@ -182,57 +183,6 @@
}
@Override
- public void setStyle(SliceStyle styles) {
- super.setStyle(styles);
- applyRowStyle();
- }
-
- private void applyRowStyle() {
- if (mSliceStyle == null || mSliceStyle.getRowStyle() == null) {
- return;
- }
-
- final RowStyle rowStyle = mSliceStyle.getRowStyle();
- setViewPaddingEnd(mStartContainer, rowStyle.getTitleItemEndPadding());
- setViewSidePaddings(mContent,
- rowStyle.getContentStartPadding(), rowStyle.getContentEndPadding());
- setViewSidePaddings(mEndContainer,
- rowStyle.getEndItemStartPadding(), rowStyle.getEndItemEndPadding());
- setViewSideMargins(mBottomDivider,
- rowStyle.getBottomDividerStartPadding(), rowStyle.getBottomDividerEndPadding());
- setViewHeight(mActionDivider, rowStyle.getActionDividerHeight());
- }
-
- private void setViewPaddingEnd(View v, int end) {
- if (v != null && end >= 0) {
- v.setPaddingRelative(v.getPaddingStart(), v.getPaddingTop(), end, v.getPaddingBottom());
- }
- }
-
- private void setViewSidePaddings(View v, int start, int end) {
- if (v != null && start >= 0 && end >= 0) {
- v.setPaddingRelative(start, v.getPaddingTop(), end, v.getPaddingBottom());
- }
- }
-
- private void setViewSideMargins(View v, int start, int end) {
- if (v != null && start >= 0 && end >= 0) {
- final MarginLayoutParams params = (MarginLayoutParams) v.getLayoutParams();
- params.setMarginStart(start);
- params.setMarginEnd(end);
- mBottomDivider.setLayoutParams(params);
- }
- }
-
- private void setViewHeight(View v, int height) {
- if (v != null && height >= 0) {
- final ViewGroup.LayoutParams params = v.getLayoutParams();
- params.height = height;
- v.setLayoutParams(params);
- }
- }
-
- @Override
public void setInsets(int l, int t, int r, int b) {
super.setInsets(l, t, r, b);
mRootView.setPadding(l, t, r, b);
@@ -294,16 +244,12 @@
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int totalHeight = mRowContent != null
? mRowContent.getHeight(mSliceStyle, mViewPolicy) : 0;
- int childWidth = 0;
-
int rowHeight = getRowContentHeight();
if (rowHeight != 0) {
// Might be gone if we have range / progress but nothing else
mRootView.setVisibility(View.VISIBLE);
heightMeasureSpec = MeasureSpec.makeMeasureSpec(rowHeight, MeasureSpec.EXACTLY);
measureChild(mRootView, widthMeasureSpec, heightMeasureSpec);
-
- childWidth = mRootView.getMeasuredWidth();
} else {
mRootView.setVisibility(View.GONE);
}
@@ -317,11 +263,10 @@
// Remember the measured height later for onLayout, since super.onMeasure will overwrite
// it.
mMeasuredRangeHeight = mRangeBar.getMeasuredHeight();
- childWidth = Math.max(childWidth, mRangeBar.getMeasuredWidth());
}
- childWidth = Math.max(childWidth, getSuggestedMinimumWidth());
- setMeasuredDimension(resolveSizeAndState(childWidth, widthMeasureSpec, 0), totalHeight);
+ int totalHeightSpec = MeasureSpec.makeMeasureSpec(totalHeight, MeasureSpec.EXACTLY);
+ super.onMeasure(widthMeasureSpec, totalHeightSpec);
}
@Override
@@ -403,7 +348,18 @@
addSubtitle(titleItem != null /* hasTitle */);
- mBottomDivider.setVisibility(mRowContent.hasBottomDivider() ? View.VISIBLE : View.GONE);
+ if (mRowContent.hasBottomDivider()) {
+ if (mSliceStyle != null) {
+ final int padding = mSliceStyle.getHeaderDividerPadding();
+ LinearLayout.LayoutParams lp =
+ (LinearLayout.LayoutParams) mBottomDivider.getLayoutParams();
+ lp.setMargins(padding, 0, padding, 0);
+ mBottomDivider.setLayoutParams(lp);
+ }
+ mBottomDivider.setVisibility(View.VISIBLE);
+ } else {
+ mBottomDivider.setVisibility(View.GONE);
+ }
SliceItem primaryAction = mRowContent.getPrimaryAction();
if (primaryAction != null && primaryAction != mStartItem) {
@@ -856,7 +812,7 @@
} else {
if (mRowIndex == 0) {
// Header clicks are a little weird and SliceView needs to know about them to
- // maintain loading state; this is hooked up in SliceAdapter -- it will call
+ // maintain loading state; this is hooked up in LargeSliceAdapter -- it will call
// through to SliceView parent which has the info to perform the click.
performClick();
} else {
diff --git a/slices/view/src/main/java/androidx/slice/widget/SliceAdapter.java b/slices/view/src/main/java/androidx/slice/widget/SliceAdapter.java
deleted file mode 100644
index 37f153b..0000000
--- a/slices/view/src/main/java/androidx/slice/widget/SliceAdapter.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * Copyright 2017 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.slice.widget;
-
-import static android.app.slice.Slice.HINT_HORIZONTAL;
-import static android.app.slice.Slice.SUBTYPE_MESSAGE;
-import static android.app.slice.Slice.SUBTYPE_SOURCE;
-import static android.app.slice.SliceItem.FORMAT_ACTION;
-import static android.app.slice.SliceItem.FORMAT_SLICE;
-
-import static androidx.slice.widget.SliceView.MODE_LARGE;
-
-import android.app.slice.Slice;
-import android.content.Context;
-import android.view.LayoutInflater;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewGroup.LayoutParams;
-
-import androidx.annotation.RequiresApi;
-import androidx.annotation.RestrictTo;
-import androidx.collection.ArrayMap;
-import androidx.recyclerview.widget.RecyclerView;
-import androidx.slice.SliceItem;
-import androidx.slice.core.SliceAction;
-import androidx.slice.core.SliceQuery;
-import androidx.slice.view.R;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @hide
- */
-@RestrictTo(RestrictTo.Scope.LIBRARY)
-@RequiresApi(19)
-public class SliceAdapter extends RecyclerView.Adapter<SliceAdapter.SliceViewHolder>
- implements SliceActionView.SliceActionLoadingListener {
-
- static final int TYPE_DEFAULT = 1;
- static final int TYPE_HEADER = 2; // TODO: headers shouldn't scroll off
- static final int TYPE_GRID = 3;
- static final int TYPE_MESSAGE = 4;
- static final int TYPE_MESSAGE_LOCAL = 5;
-
- static final int HEADER_INDEX = 0;
-
- private final IdGenerator mIdGen = new IdGenerator();
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- final Context mContext;
- private List<SliceWrapper> mSlices = new ArrayList<>();
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- SliceView.OnSliceActionListener mSliceObserver;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- int mColor;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- SliceStyle mSliceStyle;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- List<SliceAction> mSliceActions;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- boolean mShowLastUpdated;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- long mLastUpdated;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- SliceView mParent;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- TemplateView mTemplateView;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- int mInsetStart;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- int mInsetTop;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- int mInsetEnd;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- int mInsetBottom;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- Set<SliceItem> mLoadingActions = new HashSet<>();
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- boolean mAllowTwoLines;
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- SliceViewPolicy mPolicy;
-
- public SliceAdapter(Context context) {
- mContext = context;
- setHasStableIds(true);
- }
-
- /**
- * Sets the SliceView parent and the template parent.
- */
- public void setParents(SliceView parent, TemplateView templateView) {
- mParent = parent;
- mTemplateView = templateView;
- }
-
- /**
- * Sets the insets (padding) for slice view. SliceAdapter will handle determining
- * if a child needs a particular padding, i.e. if it's the first row then the top inset
- * will be applied to it whereas subsequent rows would get a top inset of 0.
- */
- public void setInsets(int l, int t, int r, int b) {
- mInsetStart = l;
- mInsetTop = t;
- mInsetEnd = r;
- mInsetBottom = b;
- }
-
- /**
- * Sets the observer to pass down to child views.
- */
- public void setSliceObserver(SliceView.OnSliceActionListener observer) {
- mSliceObserver = observer;
- }
-
- /**
- * Sets the actions to display for this slice, this adjusts what's displayed in the header item.
- */
- public void setSliceActions(List<SliceAction> actions) {
- mSliceActions = actions;
- notifyHeaderChanged();
- }
-
- /**
- * Set the {@link SliceItem}'s to be displayed in the adapter and the accent color.
- */
- public void setSliceItems(List<SliceContent> slices, int color, int mode) {
- if (slices == null) {
- mLoadingActions.clear();
- mSlices.clear();
- } else {
- mIdGen.resetUsage();
- mSlices = new ArrayList<>(slices.size());
- for (SliceContent s : slices) {
- mSlices.add(new SliceWrapper(s, mIdGen, mode));
- }
- }
- mColor = color;
- notifyDataSetChanged();
- }
-
- /**
- * Sets the style information to use for views in this adapter.
- */
- public void setStyle(SliceStyle style) {
- mSliceStyle = style;
- notifyDataSetChanged();
- }
-
- /**
- * Sets the policy information to use for views in this adapter.
- */
- public void setPolicy(SliceViewPolicy p) {
- mPolicy = p;
- }
-
- /**
- * Sets whether the last updated time should be shown on the slice.
- */
- public void setShowLastUpdated(boolean showLastUpdated) {
- if (mShowLastUpdated != showLastUpdated) {
- mShowLastUpdated = showLastUpdated;
- notifyHeaderChanged();
- }
- }
-
- /**
- * Sets when the slice was last updated.
- */
- public void setLastUpdated(long lastUpdated) {
- if (mLastUpdated != lastUpdated) {
- mLastUpdated = lastUpdated;
- notifyHeaderChanged();
- }
- }
-
- /**
- * Indicates that no actions should be loading and updates the views.
- */
- public void setLoadingActions(Set<SliceItem> actions) {
- if (actions == null) {
- mLoadingActions.clear();
- } else {
- mLoadingActions = actions;
- }
- notifyDataSetChanged();
- }
-
- /**
- * Returns the currently loading actions.
- */
- public Set<SliceItem> getLoadingActions() {
- return mLoadingActions;
- }
-
- @Override
- public void onSliceActionLoading(SliceItem actionItem, int position) {
- mLoadingActions.add(actionItem);
- if (getItemCount() > position) {
- notifyItemChanged(position);
- } else {
- notifyDataSetChanged();
- }
- }
-
- /**
- * Sets whether this slice can have 2 lines of subtitle text in the first row.
- */
- public void setAllowTwoLines(boolean allowTwoLines) {
- mAllowTwoLines = allowTwoLines;
- notifyHeaderChanged();
- }
-
- /**
- * Notifies that content in the header of this adapter has changed.
- */
- public void notifyHeaderChanged() {
- if (getItemCount() > 0) {
- notifyItemChanged(HEADER_INDEX);
- }
- }
-
- @Override
- public SliceViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- View v = inflateForType(viewType);
- v.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
- return new SliceViewHolder(v);
- }
-
- @Override
- public int getItemViewType(int position) {
- return mSlices.get(position).mType;
- }
-
- @Override
- public long getItemId(int position) {
- return mSlices.get(position).mId;
- }
-
- @Override
- public int getItemCount() {
- return mSlices.size();
- }
-
- @Override
- public void onBindViewHolder(SliceViewHolder holder, int position) {
- SliceWrapper slice = mSlices.get(position);
- holder.bind(slice.mItem, position);
- }
-
- private View inflateForType(int viewType) {
- switch (viewType) {
- case TYPE_GRID:
- return LayoutInflater.from(mContext).inflate(R.layout.abc_slice_grid, null);
- case TYPE_MESSAGE:
- return LayoutInflater.from(mContext).inflate(R.layout.abc_slice_message, null);
- case TYPE_MESSAGE_LOCAL:
- return LayoutInflater.from(mContext).inflate(R.layout.abc_slice_message_local,
- null);
- default:
- return new RowView(mContext);
- }
- }
-
- protected static class SliceWrapper {
- final SliceContent mItem;
- final int mType;
- final long mId;
-
- public SliceWrapper(SliceContent item, IdGenerator idGen, int mode) {
- mItem = item;
- mType = getFormat(item.getSliceItem());
- mId = idGen.getId(item.getSliceItem());
- }
-
- public static int getFormat(SliceItem item) {
- if (SUBTYPE_MESSAGE.equals(item.getSubType())) {
- // TODO: Better way to determine me or not? Something more like Messaging style.
- if (SliceQuery.findSubtype(item, null, SUBTYPE_SOURCE) != null) {
- return TYPE_MESSAGE;
- } else {
- return TYPE_MESSAGE_LOCAL;
- }
- }
- if (item.hasHint(HINT_HORIZONTAL)) {
- return TYPE_GRID;
- }
- if (!item.hasHint(Slice.HINT_LIST_ITEM)) {
- return TYPE_HEADER;
- }
- return TYPE_DEFAULT;
- }
- }
-
- /**
- * A {@link RecyclerView.ViewHolder} for presenting slices in {@link SliceAdapter}.
- */
- public class SliceViewHolder extends RecyclerView.ViewHolder implements View.OnTouchListener,
- View.OnClickListener {
- public final SliceChildView mSliceChildView;
-
- public SliceViewHolder(View itemView) {
- super(itemView);
- mSliceChildView = itemView instanceof SliceChildView ? (SliceChildView) itemView : null;
- }
-
- void bind(SliceContent item, int position) {
- if (mSliceChildView == null || item == null) {
- return;
- }
- // Click listener used to pipe click events to parent
- mSliceChildView.setOnClickListener(this);
- // Touch listener used to pipe events to touch feedback drawable
- mSliceChildView.setOnTouchListener(this);
- mSliceChildView.setSliceActionLoadingListener(SliceAdapter.this);
-
- final boolean isHeader = position == HEADER_INDEX;
- int mode = mParent != null ? mParent.getMode() : MODE_LARGE;
- mSliceChildView.setLoadingActions(mLoadingActions);
- mSliceChildView.setPolicy(mPolicy);
- mSliceChildView.setTint(mColor);
- mSliceChildView.setStyle(mSliceStyle);
- mSliceChildView.setShowLastUpdated(isHeader && mShowLastUpdated);
- mSliceChildView.setLastUpdated(isHeader ? mLastUpdated : -1);
- // Only apply top / bottom insets to first / last rows
- int top = position == 0 ? mInsetTop : 0;
- int bottom = position == getItemCount() - 1 ? mInsetBottom : 0;
- mSliceChildView.setInsets(mInsetStart, top, mInsetEnd, bottom);
- mSliceChildView.setAllowTwoLines(mAllowTwoLines);
- mSliceChildView.setSliceActions(isHeader ? mSliceActions : null);
- mSliceChildView.setSliceItem(item, isHeader, position, getItemCount(), mSliceObserver);
- int[] info = new int[2];
- info[0] = ListContent.getRowType(item, isHeader, mSliceActions);
- info[1] = position;
- mSliceChildView.setTag(info);
- }
-
- @Override
- public void onClick(View v) {
- if (mParent != null) {
- mParent.setClickInfo((int[]) v.getTag());
- mParent.performClick();
- }
- }
-
- @Override
- public boolean onTouch(View v, MotionEvent event) {
- if (mTemplateView != null) {
- mTemplateView.onForegroundActivated(event);
- }
- return false;
- }
- }
-
- private static class IdGenerator {
- private long mNextLong = 0;
- private final ArrayMap<String, Long> mCurrentIds = new ArrayMap<>();
- private final ArrayMap<String, Integer> mUsedIds = new ArrayMap<>();
-
- IdGenerator() {
- }
-
- public long getId(SliceItem item) {
- String str = genString(item);
- if (!mCurrentIds.containsKey(str)) {
- mCurrentIds.put(str, mNextLong++);
- }
- long id = mCurrentIds.get(str);
- Integer usedIdIndex = mUsedIds.get(str);
- int index = usedIdIndex != null ? usedIdIndex : 0;
- mUsedIds.put(str, index + 1);
- return id + index * 10000;
- }
-
- private String genString(SliceItem item) {
- if (FORMAT_SLICE.equals(item.getFormat())
- || FORMAT_ACTION.equals(item.getFormat())) {
- return String.valueOf(item.getSlice().getItems().size());
- }
- return item.toString();
- }
-
- public void resetUsage() {
- mUsedIds.clear();
- }
- }
-}
diff --git a/slices/view/src/main/java/androidx/slice/widget/SliceLiveData.java b/slices/view/src/main/java/androidx/slice/widget/SliceLiveData.java
index d0a1228..8d50336 100644
--- a/slices/view/src/main/java/androidx/slice/widget/SliceLiveData.java
+++ b/slices/view/src/main/java/androidx/slice/widget/SliceLiveData.java
@@ -16,7 +16,7 @@
package androidx.slice.widget;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.PendingIntent;
import android.content.Context;
@@ -123,7 +123,7 @@
* Version for testing
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@NonNull
public static CachedSliceLiveData fromStream(@NonNull Context context,
SliceViewManager manager, @NonNull InputStream input, OnErrorListener listener) {
diff --git a/slices/view/src/main/java/androidx/slice/widget/SliceStyle.java b/slices/view/src/main/java/androidx/slice/widget/SliceStyle.java
index 83be746b..8995dea 100644
--- a/slices/view/src/main/java/androidx/slice/widget/SliceStyle.java
+++ b/slices/view/src/main/java/androidx/slice/widget/SliceStyle.java
@@ -48,6 +48,7 @@
private int mSubtitleColor;
private int mHeaderTitleSize;
private int mHeaderSubtitleSize;
+ private int mHeaderDividerPadding;
private int mVerticalHeaderTextPadding;
private int mTitleSize;
private int mSubtitleSize;
@@ -74,8 +75,6 @@
private int mListMinScrollHeight;
private int mListLargeHeight;
- private RowStyle mRowStyle;
-
public SliceStyle(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.SliceView,
defStyleAttr, defStyleRes);
@@ -91,6 +90,8 @@
R.styleable.SliceView_headerSubtitleSize, 0);
mVerticalHeaderTextPadding = (int) a.getDimension(
R.styleable.SliceView_headerTextVerticalPadding, 0);
+ mHeaderDividerPadding = (int) a.getDimension(
+ R.styleable.SliceView_headerDividerPadding, 0);
mTitleSize = (int) a.getDimension(R.styleable.SliceView_titleSize, 0);
mSubtitleSize = (int) a.getDimension(
@@ -107,11 +108,6 @@
R.styleable.SliceView_gridTextVerticalPadding, defaultVerticalGridPadding);
mGridTopPadding = (int) a.getDimension(R.styleable.SliceView_gridTopPadding, 0);
mGridBottomPadding = (int) a.getDimension(R.styleable.SliceView_gridBottomPadding, 0);
-
- int rowStyleRes = a.getResourceId(R.styleable.SliceView_rowStyle, 0);
- if (rowStyleRes != 0) {
- mRowStyle = new RowStyle(context, rowStyleRes);
- }
} finally {
a.recycle();
}
@@ -171,6 +167,10 @@
return mVerticalHeaderTextPadding;
}
+ public int getHeaderDividerPadding() {
+ return mHeaderDividerPadding;
+ }
+
public int getTitleSize() {
return mTitleSize;
}
@@ -203,10 +203,6 @@
return mGridBottomPadding;
}
- public RowStyle getRowStyle() {
- return mRowStyle;
- }
-
public int getRowHeight(RowContent row, SliceViewPolicy policy) {
int maxHeight = policy.getMaxSmallHeight() > 0 ? policy.getMaxSmallHeight() : mRowMaxHeight;
if (row.getRange() != null || policy.getMode() == MODE_LARGE) {
diff --git a/slices/view/src/main/java/androidx/slice/widget/SliceView.java b/slices/view/src/main/java/androidx/slice/widget/SliceView.java
index 54060f6..5670098 100644
--- a/slices/view/src/main/java/androidx/slice/widget/SliceView.java
+++ b/slices/view/src/main/java/androidx/slice/widget/SliceView.java
@@ -212,7 +212,7 @@
mActionRowHeight = getResources().getDimensionPixelSize(
R.dimen.abc_slice_action_row_height);
mViewPolicy = new SliceViewPolicy();
- mCurrentView = new TemplateView(getContext());
+ mCurrentView = new LargeTemplateView(getContext());
mCurrentView.setPolicy(mViewPolicy);
addView(mCurrentView, getChildLp(mCurrentView));
applyConfigurations();
@@ -297,14 +297,20 @@
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
- return (mLongClickListener != null && handleTouchForLongpress(ev))
- || super.onInterceptTouchEvent(ev);
+ boolean ret = super.onInterceptTouchEvent(ev);
+ if (mLongClickListener != null) {
+ return handleTouchForLongpress(ev);
+ }
+ return ret;
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
- return (mLongClickListener != null && handleTouchForLongpress(ev))
- || super.onTouchEvent(ev);
+ boolean ret = super.onTouchEvent(ev);
+ if (mLongClickListener != null) {
+ return handleTouchForLongpress(ev);
+ }
+ return ret;
}
private boolean handleTouchForLongpress(MotionEvent ev) {
@@ -317,7 +323,7 @@
mPressing = true;
mInLongpress = false;
mHandler.postDelayed(mLongpressCheck, ViewConfiguration.getLongPressTimeout());
- return false;
+ break;
case MotionEvent.ACTION_MOVE:
final int deltaX = (int) ev.getRawX() - mDownX;
@@ -327,21 +333,16 @@
mPressing = false;
mHandler.removeCallbacks(mLongpressCheck);
}
- // If a long press has already happened, consume further movement.
- return mInLongpress;
+ break;
case MotionEvent.ACTION_CANCEL:
case MotionEvent.ACTION_UP:
- boolean wasInLongpress = mInLongpress;
mPressing = false;
mInLongpress = false;
mHandler.removeCallbacks(mLongpressCheck);
- // If a long press just happened, consume up event to avoid a duplicate short click.
- return wasInLongpress;
-
- default:
- return false;
+ break;
}
+ return mInLongpress;
}
private int getHeightForMode(int maxHeight) {
@@ -705,7 +706,7 @@
newView = true;
} else if (mode != MODE_SHORTCUT && isCurrentViewShortcut) {
removeView(mCurrentView);
- mCurrentView = new TemplateView(getContext());
+ mCurrentView = new LargeTemplateView(getContext());
addView(mCurrentView, getChildLp(mCurrentView));
newView = true;
}
diff --git a/slices/view/src/main/java/androidx/slice/widget/TemplateView.java b/slices/view/src/main/java/androidx/slice/widget/TemplateView.java
deleted file mode 100644
index a331ec1..0000000
--- a/slices/view/src/main/java/androidx/slice/widget/TemplateView.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright 2017 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.slice.widget;
-
-import android.content.Context;
-import android.os.Build;
-import android.view.MotionEvent;
-import android.view.View;
-import android.widget.FrameLayout;
-
-import androidx.annotation.RequiresApi;
-import androidx.annotation.RestrictTo;
-import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-import androidx.slice.SliceItem;
-import androidx.slice.core.SliceAction;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-/**
- * @hide
- */
-@RestrictTo(RestrictTo.Scope.LIBRARY)
-@RequiresApi(19)
-public class TemplateView extends SliceChildView implements
- SliceViewPolicy.PolicyChangeListener {
-
- private SliceView mParent;
- private final View mForeground;
- private final SliceAdapter mAdapter;
- private final RecyclerView mRecyclerView;
- private ListContent mListContent;
- private ArrayList<SliceContent> mDisplayedItems = new ArrayList<>();
- private int mDisplayedItemsHeight = 0;
- private int[] mLoc = new int[2];
-
- public TemplateView(Context context) {
- super(context);
- mRecyclerView = new RecyclerView(getContext());
- mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
- mAdapter = new SliceAdapter(context);
- mRecyclerView.setAdapter(mAdapter);
- addView(mRecyclerView);
-
- mForeground = new View(getContext());
- mForeground.setBackground(SliceViewUtil.getDrawable(getContext(),
- android.R.attr.selectableItemBackground));
- addView(mForeground);
-
- FrameLayout.LayoutParams lp = (LayoutParams) mForeground.getLayoutParams();
- lp.width = LayoutParams.MATCH_PARENT;
- lp.height = LayoutParams.MATCH_PARENT;
- mForeground.setLayoutParams(lp);
- }
-
- @Override
- public void onAttachedToWindow() {
- super.onAttachedToWindow();
- mParent = (SliceView) getParent();
- mAdapter.setParents(mParent, this);
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- int height = MeasureSpec.getSize(heightMeasureSpec);
- if (!mViewPolicy.isScrollable() && mDisplayedItems.size() > 0
- && mDisplayedItemsHeight != height) {
- updateDisplayedItems(height);
- }
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- }
-
- @Override
- public void setInsets(int l, int t, int r, int b) {
- super.setInsets(l, t, r, b);
- mAdapter.setInsets(l, t, r, b);
- }
-
- /**
- * Called when the foreground view handling touch feedback should be activated.
- * @param event the event to handle.
- */
- public void onForegroundActivated(MotionEvent event) {
- if (mParent != null && !mParent.isSliceViewClickable()) {
- // Only show highlight if clickable
- mForeground.setPressed(false);
- return;
- }
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- mForeground.getLocationOnScreen(mLoc);
- final int x = (int) (event.getRawX() - mLoc[0]);
- final int y = (int) (event.getRawY() - mLoc[1]);
- mForeground.getBackground().setHotspot(x, y);
- }
- int action = event.getActionMasked();
- if (action == MotionEvent.ACTION_DOWN) {
- mForeground.setPressed(true);
- } else if (action == MotionEvent.ACTION_CANCEL
- || action == MotionEvent.ACTION_UP
- || action == MotionEvent.ACTION_MOVE) {
- mForeground.setPressed(false);
- }
- }
-
- @Override
- public void setPolicy(SliceViewPolicy policy) {
- super.setPolicy(policy);
- mAdapter.setPolicy(policy);
- policy.setListener(this);
- }
-
- @Override
- public void setActionLoading(SliceItem item) {
- mAdapter.onSliceActionLoading(item, 0 /* header position */);
- }
-
- @Override
- public void setLoadingActions(Set<SliceItem> loadingActions) {
- mAdapter.setLoadingActions(loadingActions);
- }
-
- @Override
- public Set<SliceItem> getLoadingActions() {
- return mAdapter.getLoadingActions();
- }
-
- @Override
- public void setTint(int tint) {
- super.setTint(tint);
- updateDisplayedItems(getMeasuredHeight());
- }
-
- @Override
- public void setSliceActionListener(SliceView.OnSliceActionListener observer) {
- mObserver = observer;
- if (mAdapter != null) {
- mAdapter.setSliceObserver(mObserver);
- }
- }
-
- @Override
- public void setSliceActions(List<SliceAction> actions) {
- mAdapter.setSliceActions(actions);
- }
-
- @Override
- public void setSliceContent(ListContent sliceContent) {
- mListContent = sliceContent;
- int sliceHeight = mListContent.getHeight(mSliceStyle, mViewPolicy);
- updateDisplayedItems(sliceHeight);
- }
-
- @Override
- public void setStyle(SliceStyle style) {
- super.setStyle(style);
- mAdapter.setStyle(style);
- }
-
- @Override
- public void setShowLastUpdated(boolean showLastUpdated) {
- super.setShowLastUpdated(showLastUpdated);
- mAdapter.setShowLastUpdated(showLastUpdated);
- }
-
- @Override
- public void setLastUpdated(long lastUpdated) {
- super.setLastUpdated(lastUpdated);
- mAdapter.setLastUpdated(lastUpdated);
- }
-
- @Override
- public void setAllowTwoLines(boolean allowTwoLines) {
- mAdapter.setAllowTwoLines(allowTwoLines);
- }
-
- private void updateDisplayedItems(int height) {
- if (mListContent == null || !mListContent.isValid()) {
- resetView();
- return;
- }
- mDisplayedItems = mListContent.getRowItems(height, mSliceStyle, mViewPolicy);
- mDisplayedItemsHeight = mListContent.getListHeight(mDisplayedItems, mSliceStyle,
- mViewPolicy);
- mAdapter.setSliceItems(mDisplayedItems, mTintColor, mViewPolicy.getMode());
- updateOverscroll();
- }
-
- private void updateOverscroll() {
- boolean scrollable = mDisplayedItemsHeight > getMeasuredHeight();
- mRecyclerView.setOverScrollMode(mViewPolicy.isScrollable() && scrollable
- ? View.OVER_SCROLL_IF_CONTENT_SCROLLS
- : View.OVER_SCROLL_NEVER);
- }
-
- @Override
- public void resetView() {
- mDisplayedItemsHeight = 0;
- mDisplayedItems.clear();
- mAdapter.setSliceItems(null, -1, getMode());
- mListContent = null;
- }
-
- @Override
- public void onScrollingChanged(boolean newScrolling) {
- if (mListContent != null) {
- updateDisplayedItems(mListContent.getHeight(mSliceStyle, mViewPolicy));
- }
- }
-
- @Override
- public void onMaxHeightChanged(int newNewHeight) {
- if (mListContent != null) {
- updateDisplayedItems(mListContent.getHeight(mSliceStyle, mViewPolicy));
- }
- }
-
- @Override
- public void onMaxSmallChanged(int newMaxSmallHeight) {
- if (mAdapter != null) {
- mAdapter.notifyHeaderChanged();
- }
- }
-
- @Override
- public void onModeChanged(int newMode) {
- if (mListContent != null) {
- updateDisplayedItems(mListContent.getHeight(mSliceStyle, mViewPolicy));
- }
- }
-}
diff --git a/slices/view/src/main/res-public/values/public_attrs.xml b/slices/view/src/main/res-public/values/public_attrs.xml
index dd8e6b6..ff4facc 100644
--- a/slices/view/src/main/res-public/values/public_attrs.xml
+++ b/slices/view/src/main/res-public/values/public_attrs.xml
@@ -23,6 +23,7 @@
<public type="attr" name="headerTitleSize" />
<public type="attr" name="headerSubtitleSize" />
<public type="attr" name="headerTextVerticalPadding" />
+ <public type="attr" name="headerDividerPadding" />
<public type="attr" name="titleSize" />
<public type="attr" name="subtitleSize" />
<public type="attr" name="textVerticalPadding" />
@@ -31,14 +32,5 @@
<public type="attr" name="gridTextVerticalPadding" />
<public type="attr" name="gridTopPadding" />
<public type="attr" name="gridBottomPadding" />
- <public type="attr" name="rowViewStyle" />
<public type="attr" name="sliceViewStyle" />
- <public type="attr" name="titleItemEndPadding" />
- <public type="attr" name="contentStartPadding" />
- <public type="attr" name="contentEndPadding" />
- <public type="attr" name="endItemStartPadding" />
- <public type="attr" name="endItemEndPadding" />
- <public type="attr" name="bottomDividerStartPadding" />
- <public type="attr" name="bottomDividerEndPadding" />
- <public type="attr" name="actionDividerHeight" />
</resources>
diff --git a/slices/view/src/main/res/layout/abc_slice_small_template.xml b/slices/view/src/main/res/layout/abc_slice_small_template.xml
index 1e4fce3..583f3ee 100644
--- a/slices/view/src/main/res/layout/abc_slice_small_template.xml
+++ b/slices/view/src/main/res/layout/abc_slice_small_template.xml
@@ -86,7 +86,6 @@
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="?android:attr/listDivider"
- android:layout_gravity="center_vertical"
android:visibility="gone"/>
<LinearLayout
diff --git a/slices/view/src/main/res/values-as/strings.xml b/slices/view/src/main/res/values-as/strings.xml
index 78cc260..dbc598f 100644
--- a/slices/view/src/main/res/values-as/strings.xml
+++ b/slices/view/src/main/res/values-as/strings.xml
@@ -20,7 +20,7 @@
<string name="abc_slice_more_content" msgid="6405516388971241142">"+ <xliff:g id="NUMBER">%1$d</xliff:g>"</string>
<string name="abc_slice_more" msgid="1983560225998630901">"অধিক"</string>
<string name="abc_slice_show_more" msgid="1567717014004692768">"অধিক দেখুৱাওক"</string>
- <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> আপডে’ট কৰা হৈছিল"</string>
+ <string name="abc_slice_updated" msgid="8155085405396453848">"<xliff:g id="TIME">%1$s</xliff:g> আপডেট কৰা হৈছিল"</string>
<plurals name="abc_slice_duration_min" formatted="false" msgid="6996334305156847955">
<item quantity="one"><xliff:g id="ID_2">%d</xliff:g> মিনিট আগেয়ে</item>
<item quantity="other"><xliff:g id="ID_2">%d</xliff:g> মিনিট আগেয়ে</item>
diff --git a/slices/view/src/main/res/values/attrs.xml b/slices/view/src/main/res/values/attrs.xml
index f6108fa..c7dfb49 100644
--- a/slices/view/src/main/res/values/attrs.xml
+++ b/slices/view/src/main/res/values/attrs.xml
@@ -32,6 +32,8 @@
<attr name="headerSubtitleSize" format="dimension"/>
<!-- Vertical padding to use between header title text and header subtitle text. -->
<attr name="headerTextVerticalPadding" format="dimension" />
+ <!-- Padding to use between header divider and the edge of the view. -->
+ <attr name="headerDividerPadding" format="dimension" />
<!-- Text size to use for title text in a non-header row of the slice. -->
<attr name="titleSize" format="dimension" />
@@ -54,36 +56,9 @@
last row of a slice. Use this to specify padding to apply to the bottom of the grid row in
this situation. -->
<attr name="gridBottomPadding" format="dimension" />
-
- <!-- To apply a style for all slice rows shown within an activity or app you
- may set this in your app theme pointing to your custom RowView style.-->
- <attr name="rowStyle" format="reference" />
</declare-styleable>
<!-- To apply a style for all slices shown within an activity or app you
may set this in your app theme pointing to your custom SliceView style.-->
<attr name="sliceViewStyle" format="reference" />
-
- <declare-styleable name="RowStyle">
- <!-- Padding to the end edge of title items shown in the row. -->
- <attr name="titleItemEndPadding" format="dimension" />
-
- <!-- Padding to the start edge of the content in the row. -->
- <attr name="contentStartPadding" format="dimension" />
- <!-- Padding to the end edge of the content in the row. -->
- <attr name="contentEndPadding" format="dimension" />
-
- <!-- Padding to the start edge of the collection of items shown at the end of the row. -->
- <attr name="endItemStartPadding" format="dimension" />
- <!-- Padding to the end edge of the collection of items shown at the end of the row. -->
- <attr name="endItemEndPadding" format="dimension" />
-
- <!-- Padding to the start edge of the bottom divider in the row. -->
- <attr name="bottomDividerStartPadding" format="dimension" />
- <!-- Padding to the end edge of the bottom divider in the row. -->
- <attr name="bottomDividerEndPadding" format="dimension" />
-
- <!-- Height to use for action divider in the row. -->
- <attr name="actionDividerHeight" format="dimension"/>
- </declare-styleable>
</resources>
\ No newline at end of file
diff --git a/slidingpanelayout/api/1.0.0.txt b/slidingpanelayout/api/1.0.0.txt
index fc3aa2f..fa97413 100644
--- a/slidingpanelayout/api/1.0.0.txt
+++ b/slidingpanelayout/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slidingpanelayout.widget {
public class SlidingPaneLayout extends android.view.ViewGroup {
diff --git a/slidingpanelayout/api/1.1.0-alpha01.txt b/slidingpanelayout/api/1.1.0-alpha01.txt
deleted file mode 100644
index fc3aa2f..0000000
--- a/slidingpanelayout/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-// Signature format: 3.0
-package androidx.slidingpanelayout.widget {
-
- public class SlidingPaneLayout extends android.view.ViewGroup {
- ctor public SlidingPaneLayout(android.content.Context);
- ctor public SlidingPaneLayout(android.content.Context, android.util.AttributeSet?);
- ctor public SlidingPaneLayout(android.content.Context, android.util.AttributeSet?, int);
- method protected boolean canScroll(android.view.View!, boolean, int, int, int);
- method @Deprecated public boolean canSlide();
- method public boolean closePane();
- method @ColorInt public int getCoveredFadeColor();
- method @Px public int getParallaxDistance();
- method @ColorInt public int getSliderFadeColor();
- method public boolean isOpen();
- method public boolean isSlideable();
- method public boolean openPane();
- method public void setCoveredFadeColor(@ColorInt int);
- method public void setPanelSlideListener(androidx.slidingpanelayout.widget.SlidingPaneLayout.PanelSlideListener?);
- method public void setParallaxDistance(@Px int);
- method @Deprecated public void setShadowDrawable(android.graphics.drawable.Drawable!);
- method public void setShadowDrawableLeft(android.graphics.drawable.Drawable?);
- method public void setShadowDrawableRight(android.graphics.drawable.Drawable?);
- method @Deprecated public void setShadowResource(@DrawableRes int);
- method public void setShadowResourceLeft(int);
- method public void setShadowResourceRight(int);
- method public void setSliderFadeColor(@ColorInt int);
- method @Deprecated public void smoothSlideClosed();
- method @Deprecated public void smoothSlideOpen();
- }
-
- public static class SlidingPaneLayout.LayoutParams extends android.view.ViewGroup.MarginLayoutParams {
- ctor public SlidingPaneLayout.LayoutParams();
- ctor public SlidingPaneLayout.LayoutParams(int, int);
- ctor public SlidingPaneLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
- ctor public SlidingPaneLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
- ctor public SlidingPaneLayout.LayoutParams(androidx.slidingpanelayout.widget.SlidingPaneLayout.LayoutParams);
- ctor public SlidingPaneLayout.LayoutParams(android.content.Context, android.util.AttributeSet?);
- field public float weight;
- }
-
- public static interface SlidingPaneLayout.PanelSlideListener {
- method public void onPanelClosed(android.view.View);
- method public void onPanelOpened(android.view.View);
- method public void onPanelSlide(android.view.View, float);
- }
-
- public static class SlidingPaneLayout.SimplePanelSlideListener implements androidx.slidingpanelayout.widget.SlidingPaneLayout.PanelSlideListener {
- ctor public SlidingPaneLayout.SimplePanelSlideListener();
- method public void onPanelClosed(android.view.View!);
- method public void onPanelOpened(android.view.View!);
- method public void onPanelSlide(android.view.View!, float);
- }
-
-}
-
diff --git a/slidingpanelayout/api/current.txt b/slidingpanelayout/api/current.txt
index fc3aa2f..fa97413 100644
--- a/slidingpanelayout/api/current.txt
+++ b/slidingpanelayout/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.slidingpanelayout.widget {
public class SlidingPaneLayout extends android.view.ViewGroup {
diff --git a/slidingpanelayout/api/res-1.1.0-alpha01.txt b/slidingpanelayout/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/slidingpanelayout/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/slidingpanelayout/api/restricted_1.0.0.txt b/slidingpanelayout/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/slidingpanelayout/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/slidingpanelayout/api/restricted_1.1.0-alpha01.txt b/slidingpanelayout/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/slidingpanelayout/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/slidingpanelayout/api/restricted_current.txt b/slidingpanelayout/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/slidingpanelayout/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/slidingpanelayout/src/main/java/androidx/slidingpanelayout/widget/SlidingPaneLayout.java b/slidingpanelayout/src/main/java/androidx/slidingpanelayout/widget/SlidingPaneLayout.java
index 282d377..6f380a7 100644
--- a/slidingpanelayout/src/main/java/androidx/slidingpanelayout/widget/SlidingPaneLayout.java
+++ b/slidingpanelayout/src/main/java/androidx/slidingpanelayout/widget/SlidingPaneLayout.java
@@ -117,10 +117,6 @@
*/
private static final int MIN_FLING_VELOCITY = 400; // dips per second
- /** Class name may be obfuscated by Proguard. Hardcode the string for accessibility usage. */
- private static final String ACCESSIBILITY_CLASS_NAME =
- "androidx.slidingpanelayout.widget.SlidingPaneLayout";
-
/**
* The fade color used for the panel covered by the slider. 0 = no fading.
*/
@@ -1524,7 +1520,7 @@
copyNodeInfoNoChildren(info, superNode);
superNode.recycle();
- info.setClassName(ACCESSIBILITY_CLASS_NAME);
+ info.setClassName(SlidingPaneLayout.class.getName());
info.setSource(host);
final ViewParent parent = ViewCompat.getParentForAccessibility(host);
@@ -1550,7 +1546,7 @@
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(host, event);
- event.setClassName(ACCESSIBILITY_CLASS_NAME);
+ event.setClassName(SlidingPaneLayout.class.getName());
}
@Override
diff --git a/studiow b/studiow
index 2ba8f59..bb45724 100755
--- a/studiow
+++ b/studiow
@@ -6,9 +6,9 @@
function getStudioUrl() {
- version="3.4.0.12"
- ideaMajorVersion="183"
- buildNumber="5256591"
+ version="3.3.0.17"
+ ideaMajorVersion="182"
+ buildNumber="5138683"
osName="$1"
studioUrl="https://dl.google.com/dl/android/studio/ide-zips/${version}/android-studio-ide-${ideaMajorVersion}.${buildNumber}-${osName}.zip"
echo "${studioUrl}"
@@ -43,44 +43,12 @@
mv "${tempPath}" "${destPath}"
}
-function findStudioMacAppPath() {
- echo "$(find "${studioUnzippedPath}" -type d -depth 1 -name "Android Studio*.app")"
-}
-
-function getLicensePath() {
- if [ "${osName}" == "mac" ]; then
- appPath="$(findStudioMacAppPath)"
- echo "${appPath}/Contents/Resources/LICENSE.txt"
- else
- echo "${studioUnzippedPath}/android-studio/LICENSE.txt"
- fi
-}
-
function checkLicenseAgreement() {
# TODO: Is there a more official way to check that the user accepts the license?
-
- licenseAcceptedPath="${studioUnzippedPath}/STUDIOW_LICENSE_ACCEPTED"
-
- if [ ! -f "${licenseAcceptedPath}" ]; then
- if [ "${acceptsLicenseAgreement}" == "-y" ]; then
- touch "${licenseAcceptedPath}"
- else
- read -r -n 1 -p "Do you accept the license agreement at $(getLicensePath) [Y/n]? " reply
-
- if [ ! -z "${reply}" ]; then
- # Fix missing newline
- echo
- fi
-
- case "${reply}" in
- [yY]|"")
- touch "${licenseAcceptedPath}"
- ;;
- *)
- exit 1
- ;;
- esac
- fi
+ if [ "${acceptsLicenseAgreement}" != "-y" ]; then
+ echo "Do you accept the license agreement at ${studioUnzippedPath}/android-studio/LICENSE.txt ?"
+ echo "If you do, then rerun this script with a '-y' argument"
+ exit 1
fi
}
@@ -111,11 +79,11 @@
}
function runStudioMac() {
- appPath="$(findStudioMacAppPath)"
- echo "open ${appPath}"
+ studioPath="${studioUnzippedPath}/Android Studio.app"
+ echo "open ${studioPath}"
env STUDIO_PROPERTIES="${projectDir}/development/studio/idea.properties" \
STUDIO_VM_OPTIONS="${projectDir}/development/studio/studio.vmoptions" \
- open -a "${appPath}" "${projectDir}"
+ open -a "${studioPath}" "${projectDir}"
}
function runStudio() {
diff --git a/swiperefreshlayout/api/1.0.0.txt b/swiperefreshlayout/api/1.0.0.txt
index 0bdcef9..d64e003 100644
--- a/swiperefreshlayout/api/1.0.0.txt
+++ b/swiperefreshlayout/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.swiperefreshlayout.widget {
public class CircularProgressDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Animatable {
diff --git a/swiperefreshlayout/api/1.1.0-alpha01.txt b/swiperefreshlayout/api/1.1.0-alpha01.txt
index 5f5a01e..26a01ea 100644
--- a/swiperefreshlayout/api/1.1.0-alpha01.txt
+++ b/swiperefreshlayout/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.swiperefreshlayout.widget {
public class CircularProgressDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Animatable {
diff --git a/swiperefreshlayout/api/current.txt b/swiperefreshlayout/api/current.txt
index 5f5a01e..26a01ea 100644
--- a/swiperefreshlayout/api/current.txt
+++ b/swiperefreshlayout/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.swiperefreshlayout.widget {
public class CircularProgressDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Animatable {
diff --git a/swiperefreshlayout/api/restricted_1.0.0.txt b/swiperefreshlayout/api/restricted_1.0.0.txt
deleted file mode 100644
index 704ee59..0000000
--- a/swiperefreshlayout/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-// Signature format: 3.0
-package androidx.swiperefreshlayout.widget {
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface CircularProgressDrawable.ProgressDrawableSize {
- }
-
-}
-
diff --git a/swiperefreshlayout/api/restricted_1.1.0-alpha01.txt b/swiperefreshlayout/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index b8fbe3b..0000000
--- a/swiperefreshlayout/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-// Signature format: 3.0
-package androidx.swiperefreshlayout.widget {
-
- @IntDef({androidx.swiperefreshlayout.widget.CircularProgressDrawable.LARGE, androidx.swiperefreshlayout.widget.CircularProgressDrawable.DEFAULT}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CircularProgressDrawable.ProgressDrawableSize {
- }
-
-}
-
diff --git a/swiperefreshlayout/api/restricted_current.txt b/swiperefreshlayout/api/restricted_current.txt
deleted file mode 100644
index b8fbe3b..0000000
--- a/swiperefreshlayout/api/restricted_current.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-// Signature format: 3.0
-package androidx.swiperefreshlayout.widget {
-
- @IntDef({androidx.swiperefreshlayout.widget.CircularProgressDrawable.LARGE, androidx.swiperefreshlayout.widget.CircularProgressDrawable.DEFAULT}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface CircularProgressDrawable.ProgressDrawableSize {
- }
-
-}
-
diff --git a/swiperefreshlayout/build.gradle b/swiperefreshlayout/build.gradle
index 8248007..dbf32ef2 100644
--- a/swiperefreshlayout/build.gradle
+++ b/swiperefreshlayout/build.gradle
@@ -7,7 +7,7 @@
}
dependencies {
- api(project(":annotation"))
+ api("androidx.annotation:annotation:1.0.0")
api(project(":core"))
api("androidx.interpolator:interpolator:1.0.0")
diff --git a/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingChild2Test.java b/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingChild2Test.java
index dd3dc88..4a8593e 100644
--- a/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingChild2Test.java
+++ b/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingChild2Test.java
@@ -37,7 +37,7 @@
import androidx.core.view.ViewCompat;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -51,7 +51,7 @@
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class SwipeRefreshLayoutNestedScrollingChild2Test {
private SwipeRefreshLayout mSwipeRefreshLayout;
diff --git a/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingChild3Test.java b/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingChild3Test.java
index 1020a1b..9100d76 100644
--- a/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingChild3Test.java
+++ b/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingChild3Test.java
@@ -35,7 +35,7 @@
import androidx.core.view.ViewCompat;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -46,7 +46,7 @@
* NestedScrollingChild3 implementation.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class SwipeRefreshLayoutNestedScrollingChild3Test {
private SwipeRefreshLayout mSwipeRefreshLayout;
diff --git a/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParent2Test.java b/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParent2Test.java
index f5a16c1..8a114c3 100644
--- a/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParent2Test.java
+++ b/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParent2Test.java
@@ -38,7 +38,7 @@
import androidx.core.view.ViewCompat;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -52,7 +52,7 @@
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class SwipeRefreshLayoutNestedScrollingParent2Test {
private SwipeRefreshLayout mSwipeRefreshLayout;
diff --git a/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParent3Test.java b/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParent3Test.java
index ece591a..e3fc182 100644
--- a/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParent3Test.java
+++ b/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutNestedScrollingParent3Test.java
@@ -37,7 +37,7 @@
import androidx.core.view.ViewCompat;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -53,7 +53,7 @@
* refresh circle is pulled onto the screen when it should be.
*/
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class SwipeRefreshLayoutNestedScrollingParent3Test {
private SwipeRefreshLayout mSwipeRefreshLayout;
diff --git a/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutTest.java b/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutTest.java
index b87c17e..fe1324e 100644
--- a/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutTest.java
+++ b/swiperefreshlayout/src/androidTest/java/androidx/swiperefreshlayout/widget/SwipeRefreshLayoutTest.java
@@ -35,6 +35,7 @@
import androidx.test.espresso.action.ViewActions;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import androidx.testutils.PollingCheck;
@@ -67,7 +68,7 @@
}
@Test
- @LargeTest
+ @MediumTest
public void testStartAndStopRefreshing() throws Throwable {
SwipeRefreshLayout.OnRefreshListener mockListener =
mock(SwipeRefreshLayout.OnRefreshListener.class);
@@ -98,7 +99,7 @@
}
@Test
- @LargeTest
+ @MediumTest
public void testSwipeDownToRefresh() throws Throwable {
assertFalse(mSwipeRefresh.isRefreshing());
diff --git a/swiperefreshlayout/src/main/java/androidx/swiperefreshlayout/widget/CircularProgressDrawable.java b/swiperefreshlayout/src/main/java/androidx/swiperefreshlayout/widget/CircularProgressDrawable.java
index d397f84..c862104 100644
--- a/swiperefreshlayout/src/main/java/androidx/swiperefreshlayout/widget/CircularProgressDrawable.java
+++ b/swiperefreshlayout/src/main/java/androidx/swiperefreshlayout/widget/CircularProgressDrawable.java
@@ -16,7 +16,7 @@
package androidx.swiperefreshlayout.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.ValueAnimator;
@@ -68,7 +68,7 @@
private static final Interpolator MATERIAL_INTERPOLATOR = new FastOutSlowInInterpolator();
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
@IntDef({LARGE, DEFAULT})
public @interface ProgressDrawableSize {
diff --git a/testutils/src/main/java/androidx/testutils/AppCompatActivityUtils.java b/testutils/src/main/java/androidx/testutils/AppCompatActivityUtils.java
index b6af67a..f92ba2f 100644
--- a/testutils/src/main/java/androidx/testutils/AppCompatActivityUtils.java
+++ b/testutils/src/main/java/androidx/testutils/AppCompatActivityUtils.java
@@ -38,26 +38,9 @@
};
/**
- * Wait until the specified number of cycles have passed.
- *
- * @param cycles The number of cycles to wait
- * @param rule The test's ActivityTestRule
- */
- public static void waitForCycles(final int cycles,
- final ActivityTestRule<? extends RecreatedAppCompatActivity> rule) {
- try {
- for (int i = 0; i < cycles; i++) {
- rule.runOnUiThread(DO_NOTHING);
- }
- } catch (Throwable throwable) {
- throw new RuntimeException(throwable);
- }
- }
-
- /**
* Waits for the execution of the provided activity test rule.
*
- * @param rule Activity test rule to wait for
+ * @param rule Activity test rule to wait for.
*/
public static void waitForExecution(
final ActivityTestRule<? extends RecreatedAppCompatActivity> rule) {
@@ -65,7 +48,12 @@
// the UI thread and then the execution will be added onto the queue after that.
// The two-cycle wait makes sure fragments have the opportunity to complete both
// before returning.
- waitForCycles(2, rule);
+ try {
+ rule.runOnUiThread(DO_NOTHING);
+ rule.runOnUiThread(DO_NOTHING);
+ } catch (Throwable throwable) {
+ throw new RuntimeException(throwable);
+ }
}
private static void runOnUiThreadRethrow(
diff --git a/testutils/src/main/java/androidx/testutils/FragmentActivityUtils.java b/testutils/src/main/java/androidx/testutils/FragmentActivityUtils.java
index 22d0edd..dc8edc5 100644
--- a/testutils/src/main/java/androidx/testutils/FragmentActivityUtils.java
+++ b/testutils/src/main/java/androidx/testutils/FragmentActivityUtils.java
@@ -38,34 +38,17 @@
}
};
- /**
- * Wait until the specified number of cycles have passed.
- *
- * @param cycles The number of cycles to wait
- * @param rule The test's ActivityTestRule
- */
- public static void waitForCycles(final int cycles,
- final ActivityTestRule<? extends FragmentActivity> rule) {
- try {
- for (int i = 0; i < cycles; i++) {
- rule.runOnUiThread(DO_NOTHING);
- }
- } catch (Throwable throwable) {
- throw new RuntimeException(throwable);
- }
- }
-
- /**
- * Waits for the execution of the provided activity test rule.
- *
- * @param rule Activity test rule to wait for
- */
- public static void waitForExecution(final ActivityTestRule<? extends FragmentActivity> rule) {
+ private static void waitForExecution(final ActivityTestRule<? extends FragmentActivity> rule) {
// Wait for two cycles. When starting a postponed transition, it will post to
// the UI thread and then the execution will be added onto the queue after that.
// The two-cycle wait makes sure fragments have the opportunity to complete both
// before returning.
- waitForCycles(2, rule);
+ try {
+ rule.runOnUiThread(DO_NOTHING);
+ rule.runOnUiThread(DO_NOTHING);
+ } catch (Throwable throwable) {
+ throw new RuntimeException(throwable);
+ }
}
private static void runOnUiThreadRethrow(ActivityTestRule<? extends Activity> rule,
diff --git a/testutils/src/main/java/androidx/testutils/LifecycleOwnerUtils.java b/testutils/src/main/java/androidx/testutils/LifecycleOwnerUtils.java
deleted file mode 100644
index a88bef9..0000000
--- a/testutils/src/main/java/androidx/testutils/LifecycleOwnerUtils.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2019 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.testutils;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import android.app.Activity;
-
-import androidx.lifecycle.Lifecycle;
-import androidx.lifecycle.LifecycleObserver;
-import androidx.lifecycle.LifecycleOwner;
-import androidx.lifecycle.OnLifecycleEvent;
-import androidx.test.rule.ActivityTestRule;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Utility methods for testing LifecycleOwners
- */
-public class LifecycleOwnerUtils {
- private static final Runnable DO_NOTHING = new Runnable() {
- @Override
- public void run() {
- }
- };
-
- /**
- * Waits until the the Activity current held the ActivityTestRule has the specified
- * {@link androidx.lifecycle.Lifecycle.State}. If the owner has not hit that state within a
- * suitable time period, it asserts that the current state equals the given state.
- */
- public static <T extends Activity & LifecycleOwner> void waitUntilState(
- final ActivityTestRule<T> activityRule,
- final Lifecycle.State state) throws Throwable {
- waitUntilState(activityRule.getActivity(), activityRule, state);
- }
-
- /**
- * Waits until the given {@link LifecycleOwner} has the specified
- * {@link androidx.lifecycle.Lifecycle.State}. If the owner has not hit that state within a
- * suitable time period, it asserts that the current state equals the given state.
- */
- public static void waitUntilState(final LifecycleOwner owner,
- final ActivityTestRule<?> activityRule,
- final Lifecycle.State state) throws Throwable {
- final CountDownLatch latch = new CountDownLatch(1);
- activityRule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- final Lifecycle.State currentState = owner.getLifecycle().getCurrentState();
- if (currentState == state) {
- latch.countDown();
- return;
- }
- owner.getLifecycle().addObserver(new LifecycleObserver() {
- @OnLifecycleEvent(Lifecycle.Event.ON_ANY)
- public void onStateChanged(LifecycleOwner provider) {
- if (provider.getLifecycle().getCurrentState() == state) {
- latch.countDown();
- provider.getLifecycle().removeObserver(this);
- }
- }
- });
- }
- });
- boolean latchResult = latch.await(30, TimeUnit.SECONDS);
- assertThat("expected " + state + " never happened. Current state:"
- + owner.getLifecycle().getCurrentState(), latchResult, is(true));
-
- // wait for another loop to ensure all observers are called
- activityRule.runOnUiThread(DO_NOTHING);
- }
-
- private LifecycleOwnerUtils() {
- }
-}
diff --git a/textclassifier/api/1.0.0-alpha01.txt b/textclassifier/api/1.0.0-alpha01.txt
index 596a655..2d0c5d9 100644
--- a/textclassifier/api/1.0.0-alpha01.txt
+++ b/textclassifier/api/1.0.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.textclassifier {
public final class TextClassification {
diff --git a/textclassifier/api/1.0.0-alpha02.txt b/textclassifier/api/1.0.0-alpha02.txt
index 043c858..917a84d 100644
--- a/textclassifier/api/1.0.0-alpha02.txt
+++ b/textclassifier/api/1.0.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.textclassifier {
public final class TextClassification {
diff --git a/textclassifier/api/1.0.0-alpha03.txt b/textclassifier/api/1.0.0-alpha03.txt
deleted file mode 100644
index 043c858..0000000
--- a/textclassifier/api/1.0.0-alpha03.txt
+++ /dev/null
@@ -1,240 +0,0 @@
-// Signature format: 3.0
-package androidx.textclassifier {
-
- public final class TextClassification {
- method public static androidx.textclassifier.TextClassification createFromBundle(android.os.Bundle);
- method public java.util.List<androidx.core.app.RemoteActionCompat> getActions();
- method @FloatRange(from=0.0, to=1.0) public float getConfidenceScore(String!);
- method public String getEntityType(int);
- method @IntRange(from=0) public int getEntityTypeCount();
- method public android.os.Bundle getExtras();
- method public String? getId();
- method public CharSequence? getText();
- method public android.os.Bundle toBundle();
- }
-
- public static final class TextClassification.Builder {
- ctor public TextClassification.Builder();
- method public androidx.textclassifier.TextClassification.Builder addAction(androidx.core.app.RemoteActionCompat);
- method public androidx.textclassifier.TextClassification build();
- method public androidx.textclassifier.TextClassification.Builder! setEntityType(String, @FloatRange(from=0.0, to=1.0) float);
- method public androidx.textclassifier.TextClassification.Builder setExtras(android.os.Bundle?);
- method public androidx.textclassifier.TextClassification.Builder setId(String?);
- method public androidx.textclassifier.TextClassification.Builder! setText(CharSequence?);
- }
-
- public static final class TextClassification.Request {
- method public static androidx.textclassifier.TextClassification.Request! createFromBundle(android.os.Bundle);
- method public androidx.core.os.LocaleListCompat? getDefaultLocales();
- method @IntRange(from=0) public int getEndIndex();
- method public android.os.Bundle getExtras();
- method public Long? getReferenceTime();
- method @IntRange(from=0) public int getStartIndex();
- method public CharSequence getText();
- method public android.os.Bundle toBundle();
- }
-
- public static final class TextClassification.Request.Builder {
- ctor public TextClassification.Request.Builder(CharSequence, @IntRange(from=0) int, @IntRange(from=0) int);
- method public androidx.textclassifier.TextClassification.Request build();
- method public androidx.textclassifier.TextClassification.Request.Builder setDefaultLocales(androidx.core.os.LocaleListCompat?);
- method public androidx.textclassifier.TextClassification.Request.Builder setExtras(android.os.Bundle?);
- method public androidx.textclassifier.TextClassification.Request.Builder setReferenceTime(Long?);
- }
-
- public final class TextClassificationContext {
- method public static androidx.textclassifier.TextClassificationContext createFromBundle(android.os.Bundle);
- method public String getPackageName();
- method public String getWidgetType();
- method public String? getWidgetVersion();
- method public android.os.Bundle toBundle();
- }
-
- public static final class TextClassificationContext.Builder {
- ctor public TextClassificationContext.Builder(String, String);
- method public androidx.textclassifier.TextClassificationContext build();
- method public androidx.textclassifier.TextClassificationContext.Builder! setWidgetVersion(String?);
- }
-
- public final class TextClassificationManager {
- method public androidx.textclassifier.TextClassifier getDefaultTextClassifier();
- method public androidx.textclassifier.TextClassifier getTextClassifier();
- method public static androidx.textclassifier.TextClassificationManager! of(android.content.Context);
- method public void setTextClassifier(androidx.textclassifier.TextClassifier?);
- }
-
- public final class TextClassificationSessionId {
- method public static androidx.textclassifier.TextClassificationSessionId createFromBundle(android.os.Bundle);
- method public android.os.Bundle toBundle();
- }
-
- public abstract class TextClassifier {
- ctor public TextClassifier();
- method @WorkerThread public androidx.textclassifier.TextClassification classifyText(androidx.textclassifier.TextClassification.Request);
- method @WorkerThread public androidx.textclassifier.TextLinks generateLinks(androidx.textclassifier.TextLinks.Request);
- method public int getMaxGenerateLinksTextLength();
- method @WorkerThread public androidx.textclassifier.TextSelection suggestSelection(androidx.textclassifier.TextSelection.Request);
- field public static final String HINT_TEXT_IS_EDITABLE = "android.text_is_editable";
- field public static final String HINT_TEXT_IS_NOT_EDITABLE = "android.text_is_not_editable";
- field public static final androidx.textclassifier.TextClassifier! NO_OP;
- field public static final String TYPE_ADDRESS = "address";
- field public static final String TYPE_DATE = "date";
- field public static final String TYPE_DATE_TIME = "datetime";
- field public static final String TYPE_EMAIL = "email";
- field public static final String TYPE_FLIGHT_NUMBER = "flight";
- field public static final String TYPE_OTHER = "other";
- field public static final String TYPE_PHONE = "phone";
- field public static final String TYPE_UNKNOWN = "";
- field public static final String TYPE_URL = "url";
- field public static final String WIDGET_TYPE_CUSTOM_EDITTEXT = "customedit";
- field public static final String WIDGET_TYPE_CUSTOM_TEXTVIEW = "customview";
- field public static final String WIDGET_TYPE_CUSTOM_UNSELECTABLE_TEXTVIEW = "nosel-customview";
- field public static final String WIDGET_TYPE_EDITTEXT = "edittext";
- field public static final String WIDGET_TYPE_EDIT_WEBVIEW = "edit-webview";
- field public static final String WIDGET_TYPE_TEXTVIEW = "textview";
- field public static final String WIDGET_TYPE_UNKNOWN = "unknown";
- field public static final String WIDGET_TYPE_UNSELECTABLE_TEXTVIEW = "nosel-textview";
- field public static final String WIDGET_TYPE_WEBVIEW = "webview";
- }
-
- public static final class TextClassifier.EntityConfig {
- method public static androidx.textclassifier.TextClassifier.EntityConfig createFromBundle(android.os.Bundle);
- method public java.util.Collection<java.lang.String> getHints();
- method public java.util.Collection<java.lang.String>! resolveEntityTypes(java.util.Collection<java.lang.String>?);
- method public boolean shouldIncludeDefaultEntityTypes();
- method public android.os.Bundle toBundle();
- }
-
- public static final class TextClassifier.EntityConfig.Builder {
- ctor public TextClassifier.EntityConfig.Builder();
- method public androidx.textclassifier.TextClassifier.EntityConfig build();
- method public androidx.textclassifier.TextClassifier.EntityConfig.Builder! setExcludedEntityTypes(java.util.Collection<java.lang.String>?);
- method public androidx.textclassifier.TextClassifier.EntityConfig.Builder! setHints(java.util.Collection<java.lang.String>?);
- method public androidx.textclassifier.TextClassifier.EntityConfig.Builder! setIncludeDefaultEntityTypes(boolean);
- method public androidx.textclassifier.TextClassifier.EntityConfig.Builder! setIncludedEntityTypes(java.util.Collection<java.lang.String>?);
- }
-
- public final class TextLinks {
- method public int apply(android.text.Spannable, androidx.textclassifier.TextClassifier, androidx.textclassifier.TextLinksParams);
- method public static androidx.textclassifier.TextLinks createFromBundle(android.os.Bundle);
- method public android.os.Bundle getExtras();
- method public java.util.Collection<androidx.textclassifier.TextLinks.TextLink> getLinks();
- method public android.os.Bundle toBundle();
- field public static final int APPLY_STRATEGY_IGNORE = 0; // 0x0
- field public static final int APPLY_STRATEGY_REPLACE = 1; // 0x1
- field public static final int STATUS_DIFFERENT_TEXT = 3; // 0x3
- field public static final int STATUS_LINKS_APPLIED = 0; // 0x0
- field public static final int STATUS_NO_LINKS_APPLIED = 2; // 0x2
- field public static final int STATUS_NO_LINKS_FOUND = 1; // 0x1
- field public static final int STATUS_UNKNOWN = -1; // 0xffffffff
- }
-
- public static final class TextLinks.Builder {
- ctor public TextLinks.Builder(CharSequence);
- method public androidx.textclassifier.TextLinks.Builder addLink(int, int, java.util.Map<java.lang.String,java.lang.Float>);
- method public androidx.textclassifier.TextLinks build();
- method public androidx.textclassifier.TextLinks.Builder clearTextLinks();
- method public androidx.textclassifier.TextLinks.Builder setExtras(android.os.Bundle?);
- }
-
- public static class TextLinks.DefaultTextLinkSpan extends androidx.textclassifier.TextLinks.TextLinkSpan {
- ctor public TextLinks.DefaultTextLinkSpan(androidx.textclassifier.TextLinks.TextLinkSpanData);
- method @CallSuper public void onClick(android.view.View);
- method @UiThread public void onTextClassificationResult(android.widget.TextView, androidx.textclassifier.TextClassification);
- }
-
- public static final class TextLinks.Request {
- method public static androidx.textclassifier.TextLinks.Request createFromBundle(android.os.Bundle);
- method public androidx.core.os.LocaleListCompat? getDefaultLocales();
- method public androidx.textclassifier.TextClassifier.EntityConfig getEntityConfig();
- method public android.os.Bundle getExtras();
- method public Long? getReferenceTime();
- method public CharSequence getText();
- method public android.os.Bundle toBundle();
- }
-
- public static final class TextLinks.Request.Builder {
- ctor public TextLinks.Request.Builder(CharSequence);
- method public androidx.textclassifier.TextLinks.Request build();
- method public androidx.textclassifier.TextLinks.Request.Builder setDefaultLocales(androidx.core.os.LocaleListCompat?);
- method public androidx.textclassifier.TextLinks.Request.Builder setEntityConfig(androidx.textclassifier.TextClassifier.EntityConfig?);
- method public androidx.textclassifier.TextLinks.Request.Builder setExtras(android.os.Bundle?);
- method public androidx.textclassifier.TextLinks.Request.Builder setReferenceTime(Long?);
- }
-
- public static interface TextLinks.SpanFactory {
- method public androidx.textclassifier.TextLinks.TextLinkSpan! createSpan(androidx.textclassifier.TextLinks.TextLinkSpanData);
- }
-
- public static final class TextLinks.TextLink {
- method public static androidx.textclassifier.TextLinks.TextLink createFromBundle(android.os.Bundle);
- method @FloatRange(from=0.0, to=1.0) public float getConfidenceScore(String!);
- method public int getEnd();
- method public String getEntityType(int);
- method public int getEntityTypeCount();
- method public int getStart();
- method public android.os.Bundle toBundle();
- }
-
- public abstract static class TextLinks.TextLinkSpan extends android.text.style.ClickableSpan {
- ctor public TextLinks.TextLinkSpan(androidx.textclassifier.TextLinks.TextLinkSpanData);
- method public final androidx.textclassifier.TextLinks.TextLinkSpanData getTextLinkSpanData();
- }
-
- public static class TextLinks.TextLinkSpanData {
- method public androidx.textclassifier.TextLinks.TextLink getTextLink();
- }
-
- public final class TextLinksParams {
- field public static final androidx.textclassifier.TextLinksParams! DEFAULT_PARAMS;
- }
-
- public static final class TextLinksParams.Builder {
- ctor public TextLinksParams.Builder();
- method public androidx.textclassifier.TextLinksParams build();
- method public androidx.textclassifier.TextLinksParams.Builder setApplyStrategy(int);
- method public androidx.textclassifier.TextLinksParams.Builder setDefaultLocales(androidx.core.os.LocaleListCompat?);
- method public androidx.textclassifier.TextLinksParams.Builder setEntityConfig(androidx.textclassifier.TextClassifier.EntityConfig?);
- method public androidx.textclassifier.TextLinksParams.Builder setReferenceTime(Long?);
- method public androidx.textclassifier.TextLinksParams.Builder setSpanFactory(androidx.textclassifier.TextLinks.SpanFactory?);
- }
-
- public final class TextSelection {
- method public static androidx.textclassifier.TextSelection createFromBundle(android.os.Bundle);
- method @FloatRange(from=0.0, to=1.0) public float getConfidenceScore(String!);
- method public String getEntityType(int);
- method @IntRange(from=0) public int getEntityTypeCount();
- method public android.os.Bundle getExtras();
- method public String? getId();
- method public int getSelectionEndIndex();
- method public int getSelectionStartIndex();
- method public android.os.Bundle toBundle();
- }
-
- public static final class TextSelection.Builder {
- ctor public TextSelection.Builder(@IntRange(from=0) int, @IntRange(from=0) int);
- method public androidx.textclassifier.TextSelection build();
- method public androidx.textclassifier.TextSelection.Builder setEntityType(String, @FloatRange(from=0.0, to=1.0) float);
- method public androidx.textclassifier.TextSelection.Builder setExtras(android.os.Bundle?);
- method public androidx.textclassifier.TextSelection.Builder setId(String?);
- }
-
- public static final class TextSelection.Request {
- method public static androidx.textclassifier.TextSelection.Request createFromBundle(android.os.Bundle);
- method public androidx.core.os.LocaleListCompat? getDefaultLocales();
- method @IntRange(from=0) public int getEndIndex();
- method public android.os.Bundle getExtras();
- method @IntRange(from=0) public int getStartIndex();
- method public CharSequence getText();
- method public android.os.Bundle toBundle();
- }
-
- public static final class TextSelection.Request.Builder {
- ctor public TextSelection.Request.Builder(CharSequence, @IntRange(from=0) int, @IntRange(from=0) int);
- method public androidx.textclassifier.TextSelection.Request build();
- method public androidx.textclassifier.TextSelection.Request.Builder setDefaultLocales(androidx.core.os.LocaleListCompat?);
- method public androidx.textclassifier.TextSelection.Request.Builder setExtras(android.os.Bundle?);
- }
-
-}
-
diff --git a/textclassifier/api/current.txt b/textclassifier/api/current.txt
index 043c858..917a84d 100644
--- a/textclassifier/api/current.txt
+++ b/textclassifier/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.textclassifier {
public final class TextClassification {
diff --git a/textclassifier/api/res-1.0.0-alpha03.txt b/textclassifier/api/res-1.0.0-alpha03.txt
deleted file mode 100644
index e69de29..0000000
--- a/textclassifier/api/res-1.0.0-alpha03.txt
+++ /dev/null
diff --git a/textclassifier/api/restricted_1.0.0-alpha03.txt b/textclassifier/api/restricted_1.0.0-alpha03.txt
deleted file mode 100644
index a20a31b..0000000
--- a/textclassifier/api/restricted_1.0.0-alpha03.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-// Signature format: 3.0
-package androidx.textclassifier {
-
-
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class SelectionEvent {
- method public static androidx.textclassifier.SelectionEvent createFromBundle(android.os.Bundle);
- method public static androidx.textclassifier.SelectionEvent createSelectionActionEvent(int, int, @androidx.textclassifier.SelectionEvent.ActionType int);
- method public static androidx.textclassifier.SelectionEvent createSelectionActionEvent(int, int, @androidx.textclassifier.SelectionEvent.ActionType int, androidx.textclassifier.TextClassification);
- method public static androidx.textclassifier.SelectionEvent createSelectionModifiedEvent(int, int);
- method public static androidx.textclassifier.SelectionEvent createSelectionModifiedEvent(int, int, androidx.textclassifier.TextClassification);
- method public static androidx.textclassifier.SelectionEvent createSelectionModifiedEvent(int, int, androidx.textclassifier.TextSelection);
- method public static androidx.textclassifier.SelectionEvent createSelectionStartedEvent(@androidx.textclassifier.SelectionEvent.InvocationMethod int, int);
- method public long getDurationSincePreviousEvent();
- method public long getDurationSinceSessionStart();
- method public int getEnd();
- method public String getEntityType();
- method public int getEventIndex();
- method public long getEventTime();
- method @androidx.textclassifier.SelectionEvent.EventType public int getEventType();
- method @androidx.textclassifier.SelectionEvent.InvocationMethod public int getInvocationMethod();
- method public String getPackageName();
- method public String? getResultId();
- method public androidx.textclassifier.TextClassificationSessionId? getSessionId();
- method public int getSmartEnd();
- method public int getSmartStart();
- method public int getStart();
- method public String getWidgetType();
- method public String? getWidgetVersion();
- method public static boolean isTerminal(@androidx.textclassifier.SelectionEvent.EventType int);
- method public android.os.Bundle toBundle();
- field public static final int ACTION_ABANDON = 107; // 0x6b
- field public static final int ACTION_COPY = 101; // 0x65
- field public static final int ACTION_CUT = 103; // 0x67
- field public static final int ACTION_DRAG = 106; // 0x6a
- field public static final int ACTION_OTHER = 108; // 0x6c
- field public static final int ACTION_OVERTYPE = 100; // 0x64
- field public static final int ACTION_PASTE = 102; // 0x66
- field public static final int ACTION_RESET = 201; // 0xc9
- field public static final int ACTION_SELECT_ALL = 200; // 0xc8
- field public static final int ACTION_SHARE = 104; // 0x68
- field public static final int ACTION_SMART_SHARE = 105; // 0x69
- field public static final int EVENT_AUTO_SELECTION = 5; // 0x5
- field public static final int EVENT_SELECTION_MODIFIED = 2; // 0x2
- field public static final int EVENT_SELECTION_STARTED = 1; // 0x1
- field public static final int EVENT_SMART_SELECTION_MULTI = 4; // 0x4
- field public static final int EVENT_SMART_SELECTION_SINGLE = 3; // 0x3
- field public static final int INVOCATION_LINK = 2; // 0x2
- field public static final int INVOCATION_MANUAL = 1; // 0x1
- field public static final int INVOCATION_UNKNOWN = 0; // 0x0
- }
-
-
-
-
- public final class TextClassificationSessionId {
- }
-
- public abstract class TextClassifier {
- }
-
- public static final class TextClassifier.EntityConfig {
- }
-
- public final class TextLinks {
- }
-
-
-
- public static class TextLinks.TextLinkSpanData {
- }
-
- public final class TextLinksParams {
- }
-
-}
-
-package androidx.textclassifier.widget {
-
- @RequiresApi(android.os.Build.VERSION_CODES.M) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @UiThread public final class ToolbarController {
- method public static androidx.textclassifier.widget.ToolbarController! getInstance(android.widget.TextView!);
- method public void show(java.util.List<androidx.core.app.RemoteActionCompat>!, int, int);
- }
-
-}
-
diff --git a/textclassifier/api/restricted_current.txt b/textclassifier/api/restricted_current.txt
deleted file mode 100644
index a20a31b..0000000
--- a/textclassifier/api/restricted_current.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-// Signature format: 3.0
-package androidx.textclassifier {
-
-
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public final class SelectionEvent {
- method public static androidx.textclassifier.SelectionEvent createFromBundle(android.os.Bundle);
- method public static androidx.textclassifier.SelectionEvent createSelectionActionEvent(int, int, @androidx.textclassifier.SelectionEvent.ActionType int);
- method public static androidx.textclassifier.SelectionEvent createSelectionActionEvent(int, int, @androidx.textclassifier.SelectionEvent.ActionType int, androidx.textclassifier.TextClassification);
- method public static androidx.textclassifier.SelectionEvent createSelectionModifiedEvent(int, int);
- method public static androidx.textclassifier.SelectionEvent createSelectionModifiedEvent(int, int, androidx.textclassifier.TextClassification);
- method public static androidx.textclassifier.SelectionEvent createSelectionModifiedEvent(int, int, androidx.textclassifier.TextSelection);
- method public static androidx.textclassifier.SelectionEvent createSelectionStartedEvent(@androidx.textclassifier.SelectionEvent.InvocationMethod int, int);
- method public long getDurationSincePreviousEvent();
- method public long getDurationSinceSessionStart();
- method public int getEnd();
- method public String getEntityType();
- method public int getEventIndex();
- method public long getEventTime();
- method @androidx.textclassifier.SelectionEvent.EventType public int getEventType();
- method @androidx.textclassifier.SelectionEvent.InvocationMethod public int getInvocationMethod();
- method public String getPackageName();
- method public String? getResultId();
- method public androidx.textclassifier.TextClassificationSessionId? getSessionId();
- method public int getSmartEnd();
- method public int getSmartStart();
- method public int getStart();
- method public String getWidgetType();
- method public String? getWidgetVersion();
- method public static boolean isTerminal(@androidx.textclassifier.SelectionEvent.EventType int);
- method public android.os.Bundle toBundle();
- field public static final int ACTION_ABANDON = 107; // 0x6b
- field public static final int ACTION_COPY = 101; // 0x65
- field public static final int ACTION_CUT = 103; // 0x67
- field public static final int ACTION_DRAG = 106; // 0x6a
- field public static final int ACTION_OTHER = 108; // 0x6c
- field public static final int ACTION_OVERTYPE = 100; // 0x64
- field public static final int ACTION_PASTE = 102; // 0x66
- field public static final int ACTION_RESET = 201; // 0xc9
- field public static final int ACTION_SELECT_ALL = 200; // 0xc8
- field public static final int ACTION_SHARE = 104; // 0x68
- field public static final int ACTION_SMART_SHARE = 105; // 0x69
- field public static final int EVENT_AUTO_SELECTION = 5; // 0x5
- field public static final int EVENT_SELECTION_MODIFIED = 2; // 0x2
- field public static final int EVENT_SELECTION_STARTED = 1; // 0x1
- field public static final int EVENT_SMART_SELECTION_MULTI = 4; // 0x4
- field public static final int EVENT_SMART_SELECTION_SINGLE = 3; // 0x3
- field public static final int INVOCATION_LINK = 2; // 0x2
- field public static final int INVOCATION_MANUAL = 1; // 0x1
- field public static final int INVOCATION_UNKNOWN = 0; // 0x0
- }
-
-
-
-
- public final class TextClassificationSessionId {
- }
-
- public abstract class TextClassifier {
- }
-
- public static final class TextClassifier.EntityConfig {
- }
-
- public final class TextLinks {
- }
-
-
-
- public static class TextLinks.TextLinkSpanData {
- }
-
- public final class TextLinksParams {
- }
-
-}
-
-package androidx.textclassifier.widget {
-
- @RequiresApi(android.os.Build.VERSION_CODES.M) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @UiThread public final class ToolbarController {
- method public static androidx.textclassifier.widget.ToolbarController! getInstance(android.widget.TextView!);
- method public void show(java.util.List<androidx.core.app.RemoteActionCompat>!, int, int);
- }
-
-}
-
diff --git a/textclassifier/build.gradle b/textclassifier/build.gradle
index f9f51cd..b835d87 100644
--- a/textclassifier/build.gradle
+++ b/textclassifier/build.gradle
@@ -7,11 +7,10 @@
}
dependencies {
- api(project(":appcompat"))
- api(project(":annotation"))
+ api("androidx.appcompat:appcompat:1.0.0")
+ api("androidx.annotation:annotation:1.0.0")
implementation("androidx.collection:collection:1.0.0")
- // TODO: change to 1.1.0-alpha04 after release
- api(project(":core"))
+ api("androidx.core:core:1.1.0-alpha01")
androidTestImplementation(TEST_EXT_JUNIT)
androidTestImplementation(TEST_CORE)
diff --git a/textclassifier/integration-tests/testapp/src/main/java/androidx/textclassifier/integration/testapp/SimpleTextClassifier.java b/textclassifier/integration-tests/testapp/src/main/java/androidx/textclassifier/integration/testapp/SimpleTextClassifier.java
index c1feefd..f74dde0 100644
--- a/textclassifier/integration-tests/testapp/src/main/java/androidx/textclassifier/integration/testapp/SimpleTextClassifier.java
+++ b/textclassifier/integration-tests/testapp/src/main/java/androidx/textclassifier/integration/testapp/SimpleTextClassifier.java
@@ -15,7 +15,6 @@
*/
package androidx.textclassifier.integration.testapp;
-import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
@@ -85,7 +84,6 @@
}
@Override
- @SuppressLint("RestrictedApi")
public void onSelectionEvent(SelectionEvent event) {
super.onSelectionEvent(event);
}
diff --git a/textclassifier/src/androidTest/java/androidx/textclassifier/MatchMakerImplTest.java b/textclassifier/src/androidTest/java/androidx/textclassifier/MatchMakerImplTest.java
index e385cef..4a2506f 100644
--- a/textclassifier/src/androidTest/java/androidx/textclassifier/MatchMakerImplTest.java
+++ b/textclassifier/src/androidTest/java/androidx/textclassifier/MatchMakerImplTest.java
@@ -35,7 +35,7 @@
import androidx.core.app.RemoteActionCompat;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.textclassifier.LegacyTextClassifier.MatchMakerImpl;
import androidx.textclassifier.LegacyTextClassifier.MatchMakerImpl.PermissionsChecker;
@@ -48,7 +48,7 @@
/**
* Unit tests for {@link MatchMakerImpl}.
*/
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public final class MatchMakerImplTest {
diff --git a/textclassifier/src/androidTest/java/androidx/textclassifier/PlatformTextClassifierWrapperTest.java b/textclassifier/src/androidTest/java/androidx/textclassifier/PlatformTextClassifierWrapperTest.java
index 533c999..dddee39 100644
--- a/textclassifier/src/androidTest/java/androidx/textclassifier/PlatformTextClassifierWrapperTest.java
+++ b/textclassifier/src/androidTest/java/androidx/textclassifier/PlatformTextClassifierWrapperTest.java
@@ -24,15 +24,15 @@
import androidx.core.os.LocaleListCompat;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
/** UnInstrumentation unit tests for {@link PlatformTextClassifierWrapper}. */
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
public class PlatformTextClassifierWrapperTest {
diff --git a/textclassifier/src/androidTest/java/androidx/textclassifier/TextClassificationTest.java b/textclassifier/src/androidTest/java/androidx/textclassifier/TextClassificationTest.java
index 813c9ee..7f70783 100644
--- a/textclassifier/src/androidTest/java/androidx/textclassifier/TextClassificationTest.java
+++ b/textclassifier/src/androidTest/java/androidx/textclassifier/TextClassificationTest.java
@@ -27,6 +27,7 @@
import android.graphics.Color;
import android.os.Bundle;
import android.os.LocaleList;
+import android.text.SpannableString;
import androidx.core.app.RemoteActionCompat;
import androidx.core.graphics.drawable.IconCompat;
@@ -45,7 +46,7 @@
@RunWith(AndroidJUnit4.class)
public final class TextClassificationTest {
private static final Long REFERENCE_TIME_IN_MS = 946684800000L; // 2000-01-01 00:00:00
- private static final String TEXT = "This is an apple";
+ private static final CharSequence TEXT = new SpannableString("This is an apple");
private static final int START_INDEX = 2;
private static final int END_INDEX = 5;
private static final String ID = "id";
@@ -107,7 +108,7 @@
TextClassification.Request result = TextClassification.Request.createFromBundle(
reference.toBundle());
- assertEquals(TEXT, result.getText().toString());
+ assertEquals(TEXT, result.getText());
assertEquals(START_INDEX, result.getStartIndex());
assertEquals(END_INDEX, result.getEndIndex());
assertEquals(LOCALE_LIST.toLanguageTags(), result.getDefaultLocales().toLanguageTags());
@@ -123,7 +124,7 @@
TextClassification.Request result = TextClassification.Request.createFromBundle(
reference.toBundle());
- assertEquals(TEXT, result.getText().toString());
+ assertEquals(TEXT, result.getText());
assertEquals(START_INDEX, result.getStartIndex());
assertEquals(END_INDEX, result.getEndIndex());
assertEquals(null, result.getReferenceTime());
@@ -138,7 +139,7 @@
assertThat(platformRequest.getStartIndex()).isEqualTo(START_INDEX);
assertThat(platformRequest.getEndIndex()).isEqualTo(END_INDEX);
- assertThat(platformRequest.getText().toString()).isEqualTo(TEXT);
+ assertThat(platformRequest.getText()).isEqualTo(TEXT);
assertThat(platformRequest.getDefaultLocales().toLanguageTags())
.isEqualTo(LOCALE_LIST.toLanguageTags());
assertThat(platformRequest.getReferenceTime().toInstant().toEpochMilli())
@@ -162,7 +163,7 @@
assertThat(request.getStartIndex()).isEqualTo(START_INDEX);
assertThat(request.getEndIndex()).isEqualTo(END_INDEX);
- assertThat(request.getText().toString()).isEqualTo(TEXT);
+ assertThat(request.getText()).isEqualTo(TEXT);
assertThat(request.getDefaultLocales().toLanguageTags())
.isEqualTo(LOCALE_LIST.toLanguageTags());
assertThat(request.getReferenceTime()).isEqualTo(REFERENCE_TIME_IN_MS);
@@ -181,7 +182,7 @@
android.view.textclassifier.TextClassification platformTextClassification =
new android.view.textclassifier.TextClassification.Builder()
- .setText(TEXT)
+ .setText(TEXT.toString())
.addAction(remoteAction0.toRemoteAction())
.addAction(remoteAction1.toRemoteAction())
.setEntityType(TextClassifier.TYPE_ADDRESS, ADDRESS_SCORE)
@@ -200,7 +201,7 @@
public void testConvertFromPlatformTextClassification_O() {
android.view.textclassifier.TextClassification platformTextClassification =
new android.view.textclassifier.TextClassification.Builder()
- .setText(TEXT)
+ .setText(TEXT.toString())
.setEntityType(TextClassifier.TYPE_ADDRESS, ADDRESS_SCORE)
.setEntityType(TextClassifier.TYPE_PHONE, PHONE_SCORE)
.setIcon(mContext.getDrawable(R.drawable.abc_ic_star_black_16dp))
@@ -242,7 +243,7 @@
android.view.textclassifier.TextClassification platformTextClassification =
(android.view.textclassifier.TextClassification) reference.toPlatform(mContext);
- assertThat(platformTextClassification.getText()).isEqualTo(TEXT);
+ assertThat(platformTextClassification.getText()).isEqualTo(TEXT.toString());
assertThat(platformTextClassification.getIcon()).isNotNull();
assertThat(platformTextClassification.getOnClickListener()).isNotNull();
assertThat(platformTextClassification.getEntityCount()).isEqualTo(2);
@@ -251,34 +252,6 @@
assertThat(platformTextClassification.getIntent()).isNull();
}
- // Ensures the package manager can recognize a url scheme that is not all lowercase.
- // b/123640937
- @Test
- public void testNormalizeUriSchemeInRequest() {
- // Change scheme to lower case if classifying a URI.
- String text = "Visit hTTp://www.android.com today";
- String expected = "Visit http://www.android.com today";
- int startIndex = text.indexOf("hTTp://www.android.com");
- int endIndex = startIndex + "hTTp://www.android.com".length();
- TextClassification.Request request =
- new TextClassification.Request.Builder(text, startIndex, endIndex).build();
- assertThat(request.getText().toString()).isEqualTo(expected);
-
- // No changes if classifying non-URIs.
- text = "Visit hTTp://www.android.com today";
- startIndex = text.indexOf("hTTp");
- endIndex = startIndex + "hTTp".length();
- request = new TextClassification.Request.Builder(text, startIndex, endIndex).build();
- assertThat(request.getText().toString()).isEqualTo(text);
-
- // No changes if classifying URLs that do not specify any scheme.
- text = "Visit www.android.com today";
- startIndex = text.indexOf("www.android.com");
- endIndex = startIndex + "www.android.com".length();
- request = new TextClassification.Request.Builder(text, startIndex, endIndex).build();
- assertThat(request.getText().toString()).isEqualTo(text);
- }
-
private static TextClassification.Request.Builder createTextClassificationRequestBuilder() {
return new TextClassification.Request.Builder(TEXT, START_INDEX, END_INDEX)
.setDefaultLocales(LOCALE_LIST)
@@ -287,7 +260,7 @@
private TextClassification.Builder createExpectedBuilder() {
TextClassification.Builder builder = new TextClassification.Builder()
- .setText(TEXT)
+ .setText(TEXT.toString())
.setEntityType(TextClassifier.TYPE_ADDRESS, ADDRESS_SCORE)
.setEntityType(TextClassifier.TYPE_PHONE, PHONE_SCORE)
.setId(ID);
diff --git a/textclassifier/src/androidTest/java/androidx/textclassifier/TextLinkSpanTest.java b/textclassifier/src/androidTest/java/androidx/textclassifier/TextLinkSpanTest.java
index 7b0dd7e..bf1b863 100644
--- a/textclassifier/src/androidTest/java/androidx/textclassifier/TextLinkSpanTest.java
+++ b/textclassifier/src/androidTest/java/androidx/textclassifier/TextLinkSpanTest.java
@@ -45,7 +45,7 @@
import androidx.test.espresso.UiController;
import androidx.test.espresso.ViewAction;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import androidx.textclassifier.TextLinks.TextLink;
import androidx.textclassifier.TextLinks.TextLinkSpan;
@@ -64,7 +64,7 @@
import java.util.concurrent.atomic.AtomicBoolean;
/** Unit tests for {@link TextLinkSpan}. */
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public final class TextLinkSpanTest {
diff --git a/textclassifier/src/androidTest/java/androidx/textclassifier/TextLinksParamsTest.java b/textclassifier/src/androidTest/java/androidx/textclassifier/TextLinksParamsTest.java
index 50f1424..4c3ff27 100644
--- a/textclassifier/src/androidTest/java/androidx/textclassifier/TextLinksParamsTest.java
+++ b/textclassifier/src/androidTest/java/androidx/textclassifier/TextLinksParamsTest.java
@@ -28,7 +28,7 @@
import androidx.annotation.Nullable;
import androidx.collection.ArrayMap;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.Before;
import org.junit.Test;
@@ -37,7 +37,7 @@
import java.util.Map;
-@MediumTest
+@SmallTest
public class TextLinksParamsTest {
private Map<String, Float> mDummyEntityScores;
diff --git a/textclassifier/src/androidTest/java/androidx/textclassifier/TextSelectionTest.java b/textclassifier/src/androidTest/java/androidx/textclassifier/TextSelectionTest.java
index 5f66ee1..2a92aa6 100644
--- a/textclassifier/src/androidTest/java/androidx/textclassifier/TextSelectionTest.java
+++ b/textclassifier/src/androidTest/java/androidx/textclassifier/TextSelectionTest.java
@@ -38,7 +38,7 @@
public final class TextSelectionTest {
private static final float EPSILON = 1e-7f;
- private static final String TEXT = "This is an apple";
+ private static final CharSequence TEXT = "This is an apple";
private static final int START_INDEX = 2;
private static final int END_INDEX = 5;
private static final String ID = "id";
@@ -114,7 +114,7 @@
assertThat(platformRequest.getStartIndex()).isEqualTo(START_INDEX);
assertThat(platformRequest.getEndIndex()).isEqualTo(END_INDEX);
- assertThat(platformRequest.getText().toString()).isEqualTo(TEXT);
+ assertThat(platformRequest.getText()).isEqualTo(TEXT);
assertThat(platformRequest.getDefaultLocales().toLanguageTags())
.isEqualTo(LOCALE_LIST.toLanguageTags());
}
@@ -131,7 +131,7 @@
TextSelection.Request request = TextSelection.Request.fromPlatfrom(platformRequest);
assertThat(request.getStartIndex()).isEqualTo(START_INDEX);
assertThat(request.getEndIndex()).isEqualTo(END_INDEX);
- assertThat(request.getText().toString()).isEqualTo(TEXT);
+ assertThat(request.getText()).isEqualTo(TEXT);
assertThat(request.getDefaultLocales().toLanguageTags())
.isEqualTo(LOCALE_LIST.toLanguageTags());
}
diff --git a/textclassifier/src/androidTest/java/androidx/textclassifier/widget/FloatingToolbarTest.java b/textclassifier/src/androidTest/java/androidx/textclassifier/widget/FloatingToolbarTest.java
index 78470df..875c315 100644
--- a/textclassifier/src/androidTest/java/androidx/textclassifier/widget/FloatingToolbarTest.java
+++ b/textclassifier/src/androidTest/java/androidx/textclassifier/widget/FloatingToolbarTest.java
@@ -63,7 +63,7 @@
import androidx.test.espresso.action.Press;
import androidx.test.espresso.action.Tap;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
import androidx.test.rule.ActivityTestRule;
import androidx.textclassifier.R;
@@ -83,7 +83,7 @@
/**
* Tests for {@link FloatingToolbar}.
*/
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.M)
public final class FloatingToolbarTest {
diff --git a/textclassifier/src/androidTest/java/androidx/textclassifier/widget/ToolbarControllerTest.java b/textclassifier/src/androidTest/java/androidx/textclassifier/widget/ToolbarControllerTest.java
index ffa848e..67a46c1 100644
--- a/textclassifier/src/androidTest/java/androidx/textclassifier/widget/ToolbarControllerTest.java
+++ b/textclassifier/src/androidTest/java/androidx/textclassifier/widget/ToolbarControllerTest.java
@@ -54,7 +54,7 @@
import androidx.test.espresso.ViewAction;
import androidx.test.espresso.ViewInteraction;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
import androidx.test.rule.ActivityTestRule;
import androidx.textclassifier.test.R;
@@ -73,7 +73,7 @@
/**
* Tests for {@link ToolbarController}.
*/
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.M)
public final class ToolbarControllerTest {
diff --git a/textclassifier/src/main/java/androidx/textclassifier/ConvertUtils.java b/textclassifier/src/main/java/androidx/textclassifier/ConvertUtils.java
index 910ddf34..3b07118 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/ConvertUtils.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/ConvertUtils.java
@@ -16,6 +16,7 @@
package androidx.textclassifier;
+import android.annotation.SuppressLint;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
@@ -86,6 +87,7 @@
@NonNull
@RequiresApi(28)
+ @SuppressLint("RestrictedApi")
static Map<String, Float> createFloatMapFromTextLinks(
@NonNull android.view.textclassifier.TextLinks.TextLink textLink) {
Preconditions.checkNotNull(textLink);
diff --git a/textclassifier/src/main/java/androidx/textclassifier/EntityConfidence.java b/textclassifier/src/main/java/androidx/textclassifier/EntityConfidence.java
index d442c82..71ca580 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/EntityConfidence.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/EntityConfidence.java
@@ -16,6 +16,7 @@
package androidx.textclassifier;
+import android.annotation.SuppressLint;
import androidx.annotation.FloatRange;
import androidx.annotation.NonNull;
@@ -49,6 +50,7 @@
* @param source a map from entity to a confidence value in the range 0 (low confidence) to
* 1 (high confidence).
*/
+ @SuppressLint("RestrictedApi")
EntityConfidence(@NonNull Map<String, Float> source) {
Preconditions.checkNotNull(source);
diff --git a/textclassifier/src/main/java/androidx/textclassifier/LegacyTextClassifier.java b/textclassifier/src/main/java/androidx/textclassifier/LegacyTextClassifier.java
index 387b8b9..e59fd27d 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/LegacyTextClassifier.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/LegacyTextClassifier.java
@@ -16,6 +16,7 @@
package androidx.textclassifier;
+import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
@@ -73,6 +74,7 @@
private final MatchMaker mMatchMaker;
@VisibleForTesting()
+ @SuppressLint("RestrictedApi")
LegacyTextClassifier(MatchMaker matchMaker) {
mMatchMaker = Preconditions.checkNotNull(matchMaker);
}
@@ -188,6 +190,7 @@
createPermissionsChecker(context));
}
+ @SuppressLint("RestrictedApi")
MatchMakerImpl(
Context context,
PackageManager packageManager,
@@ -329,6 +332,7 @@
}
@Nullable
+ @SuppressLint("RestrictedApi")
private RemoteActionCompat createRemoteAction(
Intent intent, String title, String description, int requestCode) {
final ResolveInfo resolveInfo = mPackageManager.resolveActivity(intent, 0);
diff --git a/textclassifier/src/main/java/androidx/textclassifier/PlatformTextClassifier.java b/textclassifier/src/main/java/androidx/textclassifier/PlatformTextClassifier.java
index 9779cac..45eb069 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/PlatformTextClassifier.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/PlatformTextClassifier.java
@@ -16,6 +16,7 @@
package androidx.textclassifier;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build;
import android.os.LocaleList;
@@ -39,6 +40,7 @@
private final androidx.textclassifier.TextClassifier mTextClassifier;
private final Context mContext;
+ @SuppressLint("RestrictedApi")
PlatformTextClassifier(
@NonNull Context context,
@NonNull androidx.textclassifier.TextClassifier textClassifier) {
diff --git a/textclassifier/src/main/java/androidx/textclassifier/PlatformTextClassifierWrapper.java b/textclassifier/src/main/java/androidx/textclassifier/PlatformTextClassifierWrapper.java
index c8ef185..a3d46b7 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/PlatformTextClassifierWrapper.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/PlatformTextClassifierWrapper.java
@@ -35,6 +35,7 @@
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
@RequiresApi(Build.VERSION_CODES.O)
+@SuppressLint("RestrictedApi")
public class PlatformTextClassifierWrapper extends TextClassifier {
private final android.view.textclassifier.TextClassifier mPlatformTextClassifier;
private final Context mContext;
@@ -68,6 +69,7 @@
@WorkerThread
@Override
// TODO https://issuetracker.google.com/issues/116776070
+ @SuppressLint({"WrongThread", "RestrictedApi"})
public TextSelection suggestSelection(@NonNull TextSelection.Request request) {
Preconditions.checkNotNull(request);
ensureNotOnMainThread();
@@ -112,6 +114,7 @@
@NonNull
@WorkerThread
@Override
+ @SuppressLint({"WrongThread", "RestrictedApi"}) // TODO https://issuetracker.google.com/issues/116776070
public TextLinks generateLinks(@NonNull TextLinks.Request request) {
Preconditions.checkNotNull(request);
ensureNotOnMainThread();
diff --git a/textclassifier/src/main/java/androidx/textclassifier/SelectionEvent.java b/textclassifier/src/main/java/androidx/textclassifier/SelectionEvent.java
index 4049d6d..cd522c6 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/SelectionEvent.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/SelectionEvent.java
@@ -40,7 +40,7 @@
*
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public final class SelectionEvent {
private static final String EXTRA_ABSOLUTE_START = "extra_absolute_start";
private static final String EXTRA_ABSOLUTE_END = "extra_absolute_end";
@@ -184,6 +184,7 @@
@Nullable
private TextSelection mTextSelection;
+ @SuppressLint("RestrictedApi")
/* package */ SelectionEvent(
int start, int end,
@EventType int eventType, @EntityType String entityType,
@@ -308,6 +309,7 @@
* @throws IllegalArgumentException if end is less than start
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public static SelectionEvent createSelectionModifiedEvent(int start, int end) {
Preconditions.checkArgument(end >= start, "end cannot be less than start");
return new SelectionEvent(
@@ -327,6 +329,7 @@
* @throws IllegalArgumentException if end is less than start
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public static SelectionEvent createSelectionModifiedEvent(
int start, int end, @NonNull TextClassification classification) {
Preconditions.checkArgument(end >= start, "end cannot be less than start");
@@ -354,6 +357,7 @@
* @throws IllegalArgumentException if end is less than start
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public static SelectionEvent createSelectionModifiedEvent(
int start, int end, @NonNull TextSelection selection) {
Preconditions.checkArgument(end >= start, "end cannot be less than start");
@@ -379,6 +383,7 @@
* @throws IllegalArgumentException if end is less than start
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public static SelectionEvent createSelectionActionEvent(
int start, int end, @SelectionEvent.ActionType int actionType) {
Preconditions.checkArgument(end >= start, "end cannot be less than start");
@@ -403,6 +408,7 @@
* @throws IllegalArgumentException If actionType is not a valid SelectionEvent actionType
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public static SelectionEvent createSelectionActionEvent(
int start, int end, @SelectionEvent.ActionType int actionType,
@NonNull TextClassification classification) {
@@ -738,10 +744,10 @@
* @hide
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
- @SuppressLint("WrongConstant")
@RequiresApi(28)
@NonNull
// Lint does not know the constants in platform and here are same
+ @SuppressLint({"WrongConstant", "RestrictedApi"})
Object toPlatform(@NonNull Context context) {
Preconditions.checkNotNull(context);
@@ -765,6 +771,7 @@
@NonNull
@RequiresApi(28)
+ @SuppressLint("RestrictedApi")
private android.view.textclassifier.SelectionEvent toPlatformSelectionModifiedEvent(
@NonNull Context context) {
Preconditions.checkNotNull(context);
@@ -785,8 +792,8 @@
@NonNull
@RequiresApi(28)
- @SuppressLint("WrongConstant")
// Lint does not know the constants in platform and here are same
+ @SuppressLint({"WrongConstant", "RestrictedApi"})
private android.view.textclassifier.SelectionEvent toPlatformSelectionActionEvent(
@NonNull Context context) {
Preconditions.checkNotNull(context);
diff --git a/textclassifier/src/main/java/androidx/textclassifier/SessionStrategy.java b/textclassifier/src/main/java/androidx/textclassifier/SessionStrategy.java
new file mode 100644
index 0000000..31986d8
--- /dev/null
+++ b/textclassifier/src/main/java/androidx/textclassifier/SessionStrategy.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 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.textclassifier;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+
+/**
+ * Strategy on session handling in {@link TextClassifier}.
+ *
+ * @hide
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY)
+interface SessionStrategy {
+
+ void destroy();
+
+ void reportSelectionEvent(@NonNull SelectionEvent event);
+
+ boolean isDestroyed();
+
+ /**
+ * Represents a session-less implementation.
+ */
+ SessionStrategy NO_OP = new SessionStrategy() {
+ /**
+ * @see {@link TextClassifier#destroy()}
+ */
+ @Override
+ public void destroy() {
+ }
+
+ /**
+ * @see {@link TextClassifier#isDestroyed()} ()}
+ */
+ @Override
+ public boolean isDestroyed() {
+ return false;
+ }
+
+ /**
+ * @see {@link TextClassifier#reportSelectionEvent(SelectionEvent)} ()}
+ */
+ @Override
+ public void reportSelectionEvent(@NonNull SelectionEvent event) {
+ }
+ };
+}
diff --git a/textclassifier/src/main/java/androidx/textclassifier/TextClassification.java b/textclassifier/src/main/java/androidx/textclassifier/TextClassification.java
index 4c4e197..21602e6 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/TextClassification.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/TextClassification.java
@@ -21,11 +21,8 @@
import android.app.RemoteAction;
import android.content.Context;
import android.graphics.drawable.Drawable;
-import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
-import android.text.SpannableString;
-import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
@@ -73,8 +70,6 @@
*/
public final class TextClassification {
- private static final String LOG_TAG = "TextClassification";
-
private static final String EXTRA_TEXT = "text";
private static final String EXTRA_ACTIONS = "actions";
private static final String EXTRA_ENTITY_CONFIDENCE = "entity_conf";
@@ -227,6 +222,7 @@
@RequiresApi(26)
@SuppressWarnings("deprecation") // To support O
@NonNull
+ @SuppressLint("RestrictedApi")
static TextClassification fromPlatform(
@NonNull Context context,
@NonNull android.view.textclassifier.TextClassification textClassification) {
@@ -294,9 +290,9 @@
* @hide
*/
// Lint does not know @EntityType in platform and here are same.
+ @SuppressLint({"WrongConstant", "RestrictedApi"})
@SuppressWarnings("deprecation") // To support O
@RestrictTo(RestrictTo.Scope.LIBRARY)
- @SuppressLint("WrongConstant")
@RequiresApi(26)
@NonNull
Object toPlatform(@NonNull Context context) {
@@ -395,6 +391,7 @@
* first.
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public Builder addAction(@NonNull RemoteActionCompat action) {
Preconditions.checkArgument(action != null);
mActions.add(action);
@@ -568,6 +565,7 @@
* @param startIndex start index of the text to classify
* @param endIndex end index of the text to classify
*/
+ @SuppressLint("RestrictedApi")
public Builder(
@NonNull CharSequence text,
@IntRange(from = 0) int startIndex,
@@ -627,36 +625,9 @@
*/
@NonNull
public Request build() {
- return new Request(
- normalizeIfUri(mText, mStartIndex, mEndIndex),
- mStartIndex, mEndIndex, mDefaultLocales, mReferenceTime,
+ return new Request(mText, mStartIndex, mEndIndex, mDefaultLocales, mReferenceTime,
mExtras == null ? Bundle.EMPTY : BundleUtils.deepCopy(mExtras));
}
-
- // Ensures the package manager can recognize a url scheme that is not all lowercase.
- // b/123640937
- @Nullable
- private static CharSequence normalizeIfUri(
- CharSequence text, int startIndex, int endIndex) {
- try {
- // TODO: Skip if running Android Q.
- final Uri uri = Uri.parse(text.subSequence(startIndex, endIndex).toString());
- final String scheme = uri.getScheme();
- final String lower = scheme == null ? null : scheme.toLowerCase(Locale.ROOT);
- if (lower != null && !scheme.equals(lower)) {
- final String normalized = uri.buildUpon().scheme(lower).build().toString();
- if (normalized.length() == (endIndex - startIndex)) {
- return new SpannableString(
- new SpannableStringBuilder(text)
- .replace(startIndex, endIndex, normalized));
- }
- }
- } catch (Exception e) {
- // Catching to ensure no crashes from this method.
- Log.e(LOG_TAG, "Error fixing uri scheme", e);
- }
- return text;
- }
}
/**
diff --git a/textclassifier/src/main/java/androidx/textclassifier/TextClassificationContext.java b/textclassifier/src/main/java/androidx/textclassifier/TextClassificationContext.java
index 61622ae..fce79de 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/TextClassificationContext.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/TextClassificationContext.java
@@ -16,6 +16,7 @@
package androidx.textclassifier;
+import android.annotation.SuppressLint;
import android.os.Bundle;
import androidx.annotation.NonNull;
@@ -39,6 +40,7 @@
private final String mWidgetType;
@Nullable private final String mWidgetVersion;
+ @SuppressLint("RestrictedApi")
TextClassificationContext(
String packageName,
String widgetType,
@@ -100,6 +102,7 @@
*
* @return this builder
*/
+ @SuppressLint("RestrictedApi")
public Builder(@NonNull String packageName, @NonNull @WidgetType String widgetType) {
mPackageName = Preconditions.checkNotNull(packageName);
mWidgetType = Preconditions.checkNotNull(widgetType);
@@ -144,6 +147,7 @@
* {@link #toBundle()}.
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public static TextClassificationContext createFromBundle(@NonNull Bundle bundle) {
Preconditions.checkNotNull(bundle);
diff --git a/textclassifier/src/main/java/androidx/textclassifier/TextClassificationManager.java b/textclassifier/src/main/java/androidx/textclassifier/TextClassificationManager.java
index 7881195..e1b8e7c 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/TextClassificationManager.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/TextClassificationManager.java
@@ -16,6 +16,7 @@
package androidx.textclassifier;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build;
@@ -27,7 +28,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.core.util.Preconditions;
-import java.lang.ref.WeakReference;
import java.util.WeakHashMap;
/**
@@ -35,9 +35,8 @@
*/
public final class TextClassificationManager {
private static final Object sLock = new Object();
- // The value has to be wrapped by a WeakReference as it is holding a reference to the key.
@GuardedBy("sLock")
- private static final WeakHashMap<Context, WeakReference<TextClassificationManager>> sMapping =
+ private static final WeakHashMap<Context, TextClassificationManager> sMapping =
new WeakHashMap<>();
private final Context mContext;
@@ -49,6 +48,7 @@
/** @hide **/
@RestrictTo(RestrictTo.Scope.LIBRARY)
@VisibleForTesting
+ @SuppressLint("RestrictedApi")
TextClassificationManager(@NonNull Context context) {
mContext = Preconditions.checkNotNull(context);
mDefaultTextClassifier = defaultTextClassifier(context);
@@ -58,21 +58,17 @@
* Returns an instance of {@link TextClassificationManager} for the specified context.
* Each context has its own {@link TextClassificationManager}.
*/
+ @SuppressLint("RestrictedApi")
public static TextClassificationManager of(@NonNull Context context) {
Preconditions.checkNotNull(context);
- TextClassificationManager textClassificationManager = null;
synchronized (sLock) {
- WeakReference<TextClassificationManager> textClassificationManagerWeakReference =
- sMapping.get(context);
- if (textClassificationManagerWeakReference != null) {
- textClassificationManager = textClassificationManagerWeakReference.get();
- }
+ TextClassificationManager textClassificationManager = sMapping.get(context);
if (textClassificationManager == null) {
textClassificationManager = new TextClassificationManager(context);
- sMapping.put(context, new WeakReference<>(textClassificationManager));
+ sMapping.put(context, textClassificationManager);
}
+ return textClassificationManager;
}
- return textClassificationManager;
}
/**
diff --git a/textclassifier/src/main/java/androidx/textclassifier/TextClassificationSessionId.java b/textclassifier/src/main/java/androidx/textclassifier/TextClassificationSessionId.java
index c2de5fd..59ad156 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/TextClassificationSessionId.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/TextClassificationSessionId.java
@@ -16,6 +16,7 @@
package androidx.textclassifier;
+import android.annotation.SuppressLint;
import android.os.Bundle;
import androidx.annotation.NonNull;
@@ -127,6 +128,7 @@
* {@link #toBundle()}.
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public static TextClassificationSessionId createFromBundle(@NonNull Bundle bundle) {
Preconditions.checkNotNull(bundle);
diff --git a/textclassifier/src/main/java/androidx/textclassifier/TextClassifier.java b/textclassifier/src/main/java/androidx/textclassifier/TextClassifier.java
index 0c4e828..d615ccd 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/TextClassifier.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/TextClassifier.java
@@ -16,6 +16,7 @@
package androidx.textclassifier;
+import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Looper;
@@ -78,7 +79,7 @@
public static final String TYPE_FLIGHT_NUMBER = "flight";
/** @hide */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
@StringDef(value = {
TYPE_UNKNOWN,
@@ -154,6 +155,7 @@
*/
@WorkerThread
@NonNull
+ @SuppressLint("RestrictedApi")
public TextSelection suggestSelection(@NonNull TextSelection.Request request) {
Preconditions.checkNotNull(request);
ensureNotOnMainThread();
@@ -170,6 +172,7 @@
*/
@WorkerThread
@NonNull
+ @SuppressLint("RestrictedApi")
public TextClassification classifyText(@NonNull TextClassification.Request request) {
Preconditions.checkNotNull(request);
ensureNotOnMainThread();
@@ -188,6 +191,7 @@
*/
@WorkerThread
@NonNull
+ @SuppressLint("RestrictedApi")
public TextLinks generateLinks(@NonNull TextLinks.Request request) {
Preconditions.checkNotNull(request);
ensureNotOnMainThread();
diff --git a/textclassifier/src/main/java/androidx/textclassifier/TextLinks.java b/textclassifier/src/main/java/androidx/textclassifier/TextLinks.java
index 53c4ce6..8976999 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/TextLinks.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/TextLinks.java
@@ -188,10 +188,7 @@
* Annotates the given text with the generated links.
*
* <p><strong>NOTE: </strong>It may be necessary to set a LinkMovementMethod on the TextView
- * widget to properly handle links. See {@link TextView#setMovementMethod(MovementMethod)}.
- * It is also necessary that the TextView be focusable.
- * See {@link TextView#setFocusable(boolean)}} and
- * {@link TextView#setFocusableInTouchMode(boolean)}.
+ * widget to properly handle links. See {@link TextView#setMovementMethod(MovementMethod)}
*
* @param text the text to apply the links to. Must match the original text
* @param textClassifier the TextClassifier to use to classify a clicked link. Should usually
@@ -201,6 +198,7 @@
* @return the status code which indicates the operation is success or not.
*/
@Status
+ @SuppressLint("RestrictedApi")
public int apply(
@NonNull Spannable text,
@NonNull TextClassifier textClassifier,
@@ -233,6 +231,7 @@
*/
@VisibleForTesting
@RestrictTo(RestrictTo.Scope.LIBRARY)
+ @SuppressLint("RestrictedApi")
TextLink(int start, int end, @NonNull Map<String, Float> entityScores) {
Preconditions.checkNotNull(entityScores);
Preconditions.checkArgument(!entityScores.isEmpty());
@@ -413,6 +412,7 @@
@Nullable private Long mReferenceTime = null;
@Nullable private Bundle mExtras;
+ @SuppressLint("RestrictedApi")
public Builder(@NonNull CharSequence text) {
mText = Preconditions.checkNotNull(text);
}
@@ -546,6 +546,7 @@
* @hide
*/
@RestrictTo(RestrictTo.Scope.LIBRARY)
+ @SuppressLint("RestrictedApi")
TextLinkSpanData(
@NonNull TextLink textLink,
@NonNull TextClassifier textClassifier,
@@ -588,6 +589,7 @@
public abstract static class TextLinkSpan extends ClickableSpan {
private TextLinkSpanData mTextLinkSpanData;
+ @SuppressLint("RestrictedApi")
public TextLinkSpan(@NonNull TextLinkSpanData textLinkSpanData) {
mTextLinkSpanData = Preconditions.checkNotNull(textLinkSpanData);
}
@@ -756,6 +758,7 @@
*
* @param fullText The full text to annotate with links.
*/
+ @SuppressLint("RestrictedApi")
public Builder(@NonNull CharSequence fullText) {
mFullText = Preconditions.checkNotNull(fullText);
mLinks = new ArrayList<>();
@@ -769,6 +772,7 @@
* @throws IllegalArgumentException if entityScores is null or empty.
*/
@NonNull
+ @SuppressLint("RestrictedApi")
public Builder addLink(int start, int end, @NonNull Map<String, Float> entityScores) {
mLinks.add(new TextLink(start, end, Preconditions.checkNotNull(entityScores)));
return this;
@@ -778,6 +782,7 @@
* @hide
*/
@NonNull
+ @SuppressLint("RestrictedApi")
Builder addLink(TextLink link) {
mLinks.add(Preconditions.checkNotNull(link));
return this;
@@ -818,6 +823,7 @@
@RestrictTo(RestrictTo.Scope.LIBRARY)
@RequiresApi(28)
@NonNull
+ @SuppressLint("RestrictedApi")
// TODO: In Q, we should make getText public and use it here.
static TextLinks fromPlatform(
@NonNull android.view.textclassifier.TextLinks textLinks,
diff --git a/textclassifier/src/main/java/androidx/textclassifier/TextLinksParams.java b/textclassifier/src/main/java/androidx/textclassifier/TextLinksParams.java
index b673c28..71f85e1 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/TextLinksParams.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/TextLinksParams.java
@@ -16,6 +16,7 @@
package androidx.textclassifier;
+import android.annotation.SuppressLint;
import android.text.Spannable;
import android.text.style.ClickableSpan;
@@ -101,6 +102,7 @@
* @return a status code indicating whether or not the links were successfully applied
*/
@TextLinks.Status
+ @SuppressLint("RestrictedApi")
int apply(@NonNull Spannable text,
@NonNull TextLinks textLinks,
@NonNull TextClassifier textClassifier) {
diff --git a/textclassifier/src/main/java/androidx/textclassifier/TextSelection.java b/textclassifier/src/main/java/androidx/textclassifier/TextSelection.java
index 6e66b71..94bcef6 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/TextSelection.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/TextSelection.java
@@ -175,6 +175,7 @@
@RestrictTo(RestrictTo.Scope.LIBRARY)
@RequiresApi(26)
@NonNull
+ @SuppressLint("RestrictedApi")
static TextSelection fromPlatform(
@NonNull android.view.textclassifier.TextSelection textSelection) {
Preconditions.checkNotNull(textSelection);
@@ -236,6 +237,7 @@
* @param startIndex the start index of the text selection.
* @param endIndex the end index of the text selection. Must be greater than startIndex
*/
+ @SuppressLint("RestrictedApi")
public Builder(@IntRange(from = 0) int startIndex, @IntRange(from = 0) int endIndex) {
Preconditions.checkArgument(startIndex >= 0);
Preconditions.checkArgument(endIndex > startIndex);
@@ -409,6 +411,7 @@
* @param startIndex start index of the selected part of text
* @param endIndex end index of the selected part of text
*/
+ @SuppressLint("RestrictedApi")
public Builder(
@NonNull CharSequence text,
@IntRange(from = 0) int startIndex,
diff --git a/textclassifier/src/main/java/androidx/textclassifier/widget/FloatingToolbar.java b/textclassifier/src/main/java/androidx/textclassifier/widget/FloatingToolbar.java
index 3adf957..98ea3ed 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/widget/FloatingToolbar.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/widget/FloatingToolbar.java
@@ -16,12 +16,13 @@
package androidx.textclassifier.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.res.TypedArray;
@@ -84,7 +85,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(Build.VERSION_CODES.M)
final class FloatingToolbar {
@@ -133,7 +134,7 @@
int oldLeft, int oldRight, int oldTop, int oldBottom) {
mNewRect.set(newLeft, newRight, newTop, newBottom);
mOldRect.set(oldLeft, oldRight, oldTop, oldBottom);
- if (mPopup.isShowing() && (mNewRect.width() != mOldRect.width())) {
+ if (mPopup.isShowing() && !mNewRect.equals(mOldRect)) {
mWidthChanged = true;
updateLayout();
}
@@ -184,6 +185,7 @@
/**
* Initializes a floating toolbar.
*/
+ @SuppressLint("RestrictedApi")
FloatingToolbar(View view) {
// TODO(b/65172902): Pass context in constructor when DecorView (and other callers)
// supports multi-display.
@@ -203,6 +205,7 @@
* NOTE: Call {@link #updateLayout()} or {@link #show()} to effect visual changes to the
* toolbar.
*/
+ @SuppressLint("RestrictedApi")
public void setMenu(SupportMenu menu) {
mMenu = Preconditions.checkNotNull(menu);
}
@@ -233,6 +236,7 @@
* NOTE: Call {@link #updateLayout()} or {@link #show()} to effect visual changes to the
* toolbar.
*/
+ @SuppressLint("RestrictedApi")
public void setContentRect(Rect rect) {
mContentRect.set(Preconditions.checkNotNull(rect));
}
@@ -319,12 +323,12 @@
List<SupportMenuItem> menuItems = getVisibleAndEnabledMenuItems(mMenu);
Collections.sort(menuItems, mMenuItemComparator);
if (!isCurrentlyShowing(menuItems) || mWidthChanged) {
- mPopup.hide();
+ mPopup.dismiss();
mPopup.layoutMenuItems(menuItems, mMenuItemClickListener, mSuggestedWidth);
mShowingMenuItems = menuItems;
}
if (menuItems.isEmpty()) {
- mPopup.dismiss();
+ // don't update or show the toolbar.
} else if (!mPopup.isShowing()) {
mPopup.show(mContentRect);
} else if (!mPreviousContentRect.equals(mContentRect)) {
@@ -489,6 +493,7 @@
/* Outside touch handling */
final Runnable mDismissRunnable;
final View.OnClickListener mOnOutsideTouchHandler;
+ PopupWindow.OnDismissListener mOnDismiss;
boolean mOpenOverflowUpwards; // Whether the overflow opens upwards or downwards.
boolean mIsOverflowOpen;
@@ -501,6 +506,7 @@
* @param parent A parent view to get the {@link android.view.View#getWindowToken()} token
* from.
*/
+ @SuppressLint("RestrictedApi")
FloatingToolbarPopup(
Context context, View parent, Runnable dismissRunnable) {
mParent = Preconditions.checkNotNull(parent);
@@ -512,6 +518,9 @@
public void onClick(View v) {
hide();
mDismissRunnable.run();
+ if (mOnDismiss != null) {
+ mOnDismiss.onDismiss();
+ }
}
};
mPopupWindow = createPopupWindow(mContentContainer, mOnOutsideTouchHandler);
@@ -586,6 +595,7 @@
* Sets the floating popup's onDismissListener.
*/
public void setOnDismissListener(@Nullable final PopupWindow.OnDismissListener onDismiss) {
+ mOnDismiss = onDismiss;
mPopupWindow.setOnDismissListener(onDismiss);
}
@@ -620,6 +630,7 @@
* Shows this popup at the specified coordinates.
* The specified coordinates may be adjusted to make sure the popup is entirely on-screen.
*/
+ @SuppressLint("RestrictedApi")
public void show(Rect contentRectOnScreen) {
Preconditions.checkNotNull(contentRectOnScreen);
@@ -689,6 +700,7 @@
* The specified coordinates may be adjusted to make sure the popup is entirely on-screen.
* This is a no-op if this popup is not showing.
*/
+ @SuppressLint("RestrictedApi")
void updateCoordinates(Rect contentRectOnScreen) {
Preconditions.checkNotNull(contentRectOnScreen);
@@ -1177,6 +1189,7 @@
*
* @return The menu items that are not included in this main panel.
*/
+ @SuppressLint("RestrictedApi")
List<SupportMenuItem> layoutMainPanelItems(
List<SupportMenuItem> menuItems, final int toolbarWidth) {
Preconditions.checkNotNull(menuItems);
@@ -1524,6 +1537,7 @@
return listener;
}
+ @SuppressLint("RestrictedApi")
private static Size measure(View view) {
Preconditions.checkState(view.getParent() == null);
view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
@@ -1578,6 +1592,7 @@
private final FloatingToolbarPopup mPopup;
+ @SuppressLint("RestrictedApi")
OverflowPanel(FloatingToolbarPopup popup) {
super(Preconditions.checkNotNull(popup).mContext);
this.mPopup = popup;
@@ -1639,6 +1654,7 @@
private final Context mContext;
+ @SuppressLint("RestrictedApi")
OverflowPanelViewHelper(Context context, int iconTextSpacing) {
mContext = Preconditions.checkNotNull(context);
mIconTextSpacing = iconTextSpacing;
@@ -1647,6 +1663,7 @@
mCalculator = createMenuButton(null);
}
+ @SuppressLint("RestrictedApi")
public View getView(SupportMenuItem menuItem, int minimumWidth, View convertView) {
Preconditions.checkNotNull(menuItem);
if (convertView != null) {
@@ -1753,10 +1770,7 @@
popupWindow.setOutsideTouchable(true);
popupWindow.setWindowLayoutType(WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL);
popupWindow.setAnimationStyle(0);
- int color = Color.TRANSPARENT;
- // Want to see the floating window? Uncomment the next line.
- //color = Color.argb(50, 0, 0, 0);
- popupWindow.setBackgroundDrawable(new ColorDrawable(color));
+ popupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
content.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
popupContentHolder.addView(content);
@@ -1793,6 +1807,7 @@
}
// TODO: Replace with SupportMenuItem method when those are implemented.
+ @SuppressLint("RestrictedApi")
static boolean requiresOverflow(SupportMenuItem menuItem) {
if (menuItem instanceof MenuItemImpl) {
final MenuItemImpl impl = (MenuItemImpl) menuItem;
@@ -1802,6 +1817,7 @@
}
// TODO: Replace with SupportMenuItem method when those are implemented.
+ @SuppressLint("RestrictedApi")
static boolean requiresActionButton(SupportMenuItem menuItem) {
return menuItem instanceof MenuItemImpl
&& ((MenuItemImpl) menuItem).requiresActionButton();
diff --git a/textclassifier/src/main/java/androidx/textclassifier/widget/ToolbarController.java b/textclassifier/src/main/java/androidx/textclassifier/widget/ToolbarController.java
index 6c9210a..204899b 100644
--- a/textclassifier/src/main/java/androidx/textclassifier/widget/ToolbarController.java
+++ b/textclassifier/src/main/java/androidx/textclassifier/widget/ToolbarController.java
@@ -16,8 +16,9 @@
package androidx.textclassifier.widget;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.ClipData;
import android.content.ClipboardManager;
@@ -61,7 +62,7 @@
*
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
@RequiresApi(Build.VERSION_CODES.M)
@UiThread
public final class ToolbarController {
@@ -88,13 +89,13 @@
if (controller == null) {
sInstance = new WeakReference<>(new ToolbarController(textView));
} else if (controller.mTextView != textView) {
- logv("New textView. Dismissing previous toolbar.");
dismissImmediately(controller.mToolbar);
sInstance = new WeakReference<>(new ToolbarController(textView));
}
return sInstance.get();
}
+ @SuppressLint("RestrictedApi")
private ToolbarController(TextView textView) {
mTextView = Preconditions.checkNotNull(textView);
mContentRect = new Rect();
@@ -116,6 +117,7 @@
* @param end text end index for positioning the toolbar;
* the toolbar will not be shown this index is invalid for the associated textView
*/
+ @SuppressLint("RestrictedApi")
public void show(List<RemoteActionCompat> actions, int start, int end) {
Preconditions.checkNotNull(actions);
Preconditions.checkArgumentInRange(start, 0, end - 1, "start");
@@ -126,17 +128,15 @@
return;
}
- logv("About to show new toolbar state. Dismissing old state");
dismissImmediately(mToolbar);
+ setListeners(mTextView, start, end, mToolbar);
final SupportMenu menu = createMenu(mTextView, mHighlight, actions);
- if (canShowToolbar(mTextView, true) && menu.hasVisibleItems()) {
- setListeners(mTextView, start, end, mToolbar);
+ if (hasValidTextView(mTextView) && menu.hasVisibleItems()) {
setHighlight(mTextView, mHighlight, start, end, mToolbar);
updateRectCoordinates(mContentRect, mTextView, start, end);
mToolbar.setContentRect(mContentRect);
mToolbar.setMenu(menu);
mToolbar.show();
- logv("Showing toolbar");
}
}
@@ -151,25 +151,9 @@
toolbar.dismiss();
}
- /**
- * Returns true if the textView should be allowed to show a toolbar. Otherwise, returns false.
- *
- * @param textView the textView
- * @param assumeWindowFocus if true, this method assumes the window in which the textView is in
- * has focus. Should typically be set to {@code true} unless the caller
- * knows the window does not have focus.
- */
@SuppressWarnings("WeakerAccess") /* synthetic access */
- static boolean canShowToolbar(TextView textView, boolean assumeWindowFocus) {
- final boolean viewFocus = textView.hasFocus();
- final boolean viewAttached = textView.isAttachedToWindow();
- final boolean canShowToolbar = assumeWindowFocus && viewFocus && viewAttached;
- if (!canShowToolbar) {
- logv(String.format("canShowToolbar=false. "
- + "Reason: windowFocus=%b, viewFocus=%b, viewAttached=%b",
- assumeWindowFocus, viewFocus, viewAttached));
- }
- return canShowToolbar;
+ static boolean hasValidTextView(TextView textView) {
+ return textView.isAttachedToWindow();
}
@SuppressWarnings("WeakerAccess") /* synthetic access */
@@ -187,7 +171,9 @@
final int end = spannable.getSpanEnd(highlight);
final int min = Math.max(0, Math.min(start, end));
final int max = Math.max(0, Math.max(start, end));
- return textView.getText().subSequence(min, max).toString();
+ if (min >= 0) {
+ return textView.getText().subSequence(min, max).toString();
+ }
}
return null;
}
@@ -215,7 +201,7 @@
textView.postDelayed(new Runnable() {
@Override
public void run() {
- if (canShowToolbar(textView, true)
+ if (hasValidTextView(textView)
&& originalText.equals(textView.getText().toString())
&& toolbar.isShowing()) {
((Spannable) text).setSpan(highlight, start, end, 0);
@@ -245,6 +231,7 @@
y + textView.getTotalPaddingTop() - textView.getScrollY() + xy[1]};
}
+ @SuppressLint("RestrictedApi")
private static SupportMenu createMenu(
final TextView textView,
final BackgroundSpan highlight,
@@ -331,106 +318,137 @@
return menu;
}
- /* To enable verbose logging. Run the following command:
- * adb shell setprop log.tag.ToolbarController VERBOSE && adb shell stop && adb shell start
- */
- @SuppressWarnings("WeakerAccess") /* synthetic access */
- static void logv(String message) {
- if (Log.isLoggable(LOG_TAG, Log.VERBOSE)) {
- Log.v(LOG_TAG, message);
- }
- }
-
private static void setListeners(
TextView textView, int start, int end, FloatingToolbar toolbar) {
+ final ViewTreeObserver observer = textView.getViewTreeObserver();
+ final OnCoordinatesChangeHandler onCoordinatesChangeHandler =
+ new OnCoordinatesChangeHandler(toolbar, textView, start, end);
+ final OnWindowFocusChangeListener onWindowFocusChangeListener =
+ new OnWindowFocusChangeListener(toolbar);
+ final OnTextViewFocusChangeListener onTextViewFocusChangeListener =
+ new OnTextViewFocusChangeListener(textView, toolbar);
+ final OnTextViewDetachedListener onTextViewDetachedListener =
+ new OnTextViewDetachedListener(toolbar);
+ observer.addOnPreDrawListener(onCoordinatesChangeHandler);
+ observer.addOnWindowFocusChangeListener(onWindowFocusChangeListener);
+ observer.addOnGlobalFocusChangeListener(onTextViewFocusChangeListener);
+ observer.addOnWindowAttachListener(onTextViewDetachedListener);
+ final ActionModeCallback selectionCallback = new ActionModeCallback(
+ toolbar, textView.getCustomSelectionActionModeCallback(), false);
+ final ActionModeCallback insertionCallback = new ActionModeCallback(
+ toolbar, textView.getCustomInsertionActionModeCallback(), true);
+ textView.setCustomSelectionActionModeCallback(selectionCallback);
+ textView.setCustomInsertionActionModeCallback(insertionCallback);
toolbar.setOnDismissListener(
new OnToolbarDismissListener(
textView,
- new TextViewListener(toolbar, textView, start, end),
- new ActionModeCallback(
- toolbar,
- textView.getCustomSelectionActionModeCallback(),
- /* preferMe= */ false),
- new ActionModeCallback(
- toolbar,
- textView.getCustomInsertionActionModeCallback(),
- /* preferMe= */ true)));
+ onCoordinatesChangeHandler,
+ onWindowFocusChangeListener,
+ onTextViewFocusChangeListener,
+ onTextViewDetachedListener,
+ selectionCallback,
+ insertionCallback));
}
/**
- * Listens for several TextView events to reposition or dismiss the toolbar.
+ * Repositions the toolbar when the coordinates of the highlighted text changes.
+ * It does this by checking just before every draw frame if the coordinates of the highlighted
+ * text have changed. Because this callback is called on every draw frame, it only recalculates
+ * the highlights position when the toolbar is actively showing.
*/
- private static final class TextViewListener implements
- ViewTreeObserver.OnPreDrawListener,
- ViewTreeObserver.OnWindowFocusChangeListener,
- ViewTreeObserver.OnGlobalFocusChangeListener,
- ViewTreeObserver.OnWindowAttachListener {
-
- private static final long THROTTLE_DELAY_MS = 300;
+ private static final class OnCoordinatesChangeHandler
+ implements ViewTreeObserver.OnPreDrawListener {
private final FloatingToolbar mToolbar;
private final TextView mTextView;
private final Rect mContentRect;
- private final Rect mTempRect;
private final int mStart;
private final int mEnd;
- private long mLastUpdateTimeMs = System.currentTimeMillis() - THROTTLE_DELAY_MS;
+ private int[] mLocation = new int[2];
- TextViewListener(FloatingToolbar toolbar, TextView textView, int start, int end) {
+ @SuppressLint("RestrictedApi")
+ OnCoordinatesChangeHandler(
+ FloatingToolbar toolbar, TextView textView, int start, int end) {
mToolbar = Preconditions.checkNotNull(toolbar);
mTextView = Preconditions.checkNotNull(textView);
+ mTextView.getRootView().getLocationOnScreen(mLocation);
mContentRect = new Rect();
- mTempRect = new Rect();
mStart = start;
mEnd = end;
}
@Override
public boolean onPreDraw() {
- final long now = System.currentTimeMillis();
- if (!maybeDismissToolbar(true, "onPreDraw")
- && mToolbar.isShowing()
- && now - mLastUpdateTimeMs >= THROTTLE_DELAY_MS) {
- updateRectCoordinates(mTempRect, mTextView, mStart, mEnd);
- if (!mTempRect.equals(mContentRect)) {
+ if (mToolbar.isShowing()) {
+ final int[] location = new int[2];
+ mTextView.getRootView().getLocationOnScreen(location);
+ if (location[0] != mLocation[0] || location[1] != mLocation[1]) {
// View moved.
- mContentRect.set(mTempRect);
+ updateRectCoordinates(mContentRect, mTextView, mStart, mEnd);
mToolbar.setContentRect(mContentRect);
mToolbar.updateLayout();
- mLastUpdateTimeMs = now;
}
+ mLocation = location;
}
return true;
}
+ }
+
+ private static final class OnWindowFocusChangeListener
+ implements ViewTreeObserver.OnWindowFocusChangeListener {
+
+ private final FloatingToolbar mToolbar;
+
+ @SuppressLint("RestrictedApi")
+ OnWindowFocusChangeListener(FloatingToolbar toolbar) {
+ mToolbar = Preconditions.checkNotNull(toolbar);
+ }
@Override
public void onWindowFocusChanged(boolean hasFocus) {
- maybeDismissToolbar(hasFocus, "onWindowFocusChanged");
+ if (!hasFocus) {
+ mToolbar.dismiss();
+ }
+ }
+ }
+
+ private static final class OnTextViewFocusChangeListener
+ implements ViewTreeObserver.OnGlobalFocusChangeListener {
+
+ private final TextView mTextView;
+ private final FloatingToolbar mToolbar;
+
+ @SuppressLint("RestrictedApi")
+ OnTextViewFocusChangeListener(TextView textView, FloatingToolbar toolbar) {
+ mTextView = Preconditions.checkNotNull(textView);
+ mToolbar = Preconditions.checkNotNull(toolbar);
}
@Override
- public void onGlobalFocusChanged(View oldFocus, View newFocus) {
- maybeDismissToolbar(true, "onGlobalFocusChanged");
+ public void onGlobalFocusChanged(View v, View v1) {
+ if (!mTextView.hasFocus()) {
+ mToolbar.dismiss();
+ }
+ }
+ }
+
+ private static final class OnTextViewDetachedListener
+ implements ViewTreeObserver.OnWindowAttachListener {
+
+ private final FloatingToolbar mToolbar;
+
+ @SuppressLint("RestrictedApi")
+ OnTextViewDetachedListener(FloatingToolbar toolbar) {
+ mToolbar = Preconditions.checkNotNull(toolbar);
}
@Override
- public void onWindowAttached() {
- maybeDismissToolbar(true, "onWindowAttached");
- }
+ public void onWindowAttached() {}
@Override
public void onWindowDetached() {
- maybeDismissToolbar(true, "onWindowDetached");
- }
-
- private boolean maybeDismissToolbar(boolean assumeWindowFocus, String caller) {
- if (canShowToolbar(mTextView, assumeWindowFocus)) {
- return false;
- }
- logv("TextViewListener." + caller + ": Dismissing toolbar.");
- dismissImmediately(mToolbar);
- return true;
+ mToolbar.dismiss();
}
}
@@ -443,6 +461,7 @@
@Nullable final ActionMode.Callback mOriginalCallback;
private final boolean mPreferMe;
+ @SuppressLint("RestrictedApi")
ActionModeCallback(
FloatingToolbar toolbar,
@Nullable ActionMode.Callback originalCallback,
@@ -465,8 +484,6 @@
// custom callback is set.
if (mOriginalCallback == null
|| mOriginalCallback.onCreateActionMode(actionMode, menu)) {
- logv("ActionModeCallback: Dismissing toolbar. hasCallback="
- + (mOriginalCallback != null));
dismissImmediately(mToolbar);
return true;
}
@@ -508,45 +525,39 @@
private static final class OnToolbarDismissListener implements PopupWindow.OnDismissListener {
private final TextView mTextView;
- private final ViewTreeObserver mObserver;
- private final TextViewListener mTextViewListener;
+ private final OnCoordinatesChangeHandler mOnCoordinatesChangeHandler;
+ private final OnWindowFocusChangeListener mOnWindowFocusChangeListener;
+ private final OnTextViewFocusChangeListener mOnFocusChangeListener;
+ private final OnTextViewDetachedListener mOnTextViewDetachedListener;
private final ActionModeCallback mSelectionCallback;
private final ActionModeCallback mInsertionCallback;
+ @SuppressLint("RestrictedApi")
OnToolbarDismissListener(
TextView textView,
- TextViewListener textViewListener,
+ OnCoordinatesChangeHandler onCoordinatesChangeHandler,
+ OnWindowFocusChangeListener onWindowFocusChangeListener,
+ OnTextViewFocusChangeListener onTextViewFocusChangeListener,
+ OnTextViewDetachedListener onTextViewDetachedListener,
ActionModeCallback selectionCallback,
ActionModeCallback insertionCallback) {
mTextView = Preconditions.checkNotNull(textView);
- mObserver = mTextView.getViewTreeObserver();
- mTextViewListener = Preconditions.checkNotNull(textViewListener);
- registerListeners();
+ mOnCoordinatesChangeHandler = Preconditions.checkNotNull(onCoordinatesChangeHandler);
+ mOnWindowFocusChangeListener = Preconditions.checkNotNull(onWindowFocusChangeListener);
+ mOnFocusChangeListener = Preconditions.checkNotNull(onTextViewFocusChangeListener);
+ mOnTextViewDetachedListener = Preconditions.checkNotNull(onTextViewDetachedListener);
mSelectionCallback = Preconditions.checkNotNull(selectionCallback);
mInsertionCallback = Preconditions.checkNotNull(insertionCallback);
- setCallbacks();
}
- private void registerListeners() {
- mObserver.addOnPreDrawListener(mTextViewListener);
- mObserver.addOnWindowFocusChangeListener(mTextViewListener);
- mObserver.addOnGlobalFocusChangeListener(mTextViewListener);
- mObserver.addOnWindowAttachListener(mTextViewListener);
- }
-
- private void unregisterListeners() {
- mObserver.removeOnPreDrawListener(mTextViewListener);
- mObserver.removeOnWindowFocusChangeListener(mTextViewListener);
- mObserver.removeOnGlobalFocusChangeListener(mTextViewListener);
- mObserver.removeOnWindowAttachListener(mTextViewListener);
- }
-
- private void setCallbacks() {
- mTextView.setCustomSelectionActionModeCallback(mSelectionCallback);
- mTextView.setCustomInsertionActionModeCallback(mInsertionCallback);
- }
-
- private void clearCallbacks() {
+ @Override
+ public void onDismiss() {
+ removeHighlight(mTextView);
+ final ViewTreeObserver observer = mTextView.getViewTreeObserver();
+ observer.removeOnPreDrawListener(mOnCoordinatesChangeHandler);
+ observer.removeOnWindowFocusChangeListener(mOnWindowFocusChangeListener);
+ observer.removeOnGlobalFocusChangeListener(mOnFocusChangeListener);
+ observer.removeOnWindowAttachListener(mOnTextViewDetachedListener);
if (mSelectionCallback == mTextView.getCustomSelectionActionModeCallback()) {
mTextView.setCustomSelectionActionModeCallback(
mSelectionCallback.mOriginalCallback);
@@ -556,19 +567,13 @@
mInsertionCallback.mOriginalCallback);
}
}
-
- @Override
- public void onDismiss() {
- removeHighlight(mTextView);
- unregisterListeners();
- clearCallbacks();
- }
}
private static final class OnMenuItemClickListener implements MenuItem.OnMenuItemClickListener {
private final FloatingToolbar mToolbar;
+ @SuppressLint("RestrictedApi")
OnMenuItemClickListener(FloatingToolbar toolbar) {
mToolbar = Preconditions.checkNotNull(toolbar);
}
diff --git a/textclassifier/src/main/res/values-am/strings.xml b/textclassifier/src/main/res/values-am/strings.xml
index 831ac2b..7218771 100644
--- a/textclassifier/src/main/res/values-am/strings.xml
+++ b/textclassifier/src/main/res/values-am/strings.xml
@@ -19,7 +19,7 @@
<string name="email" msgid="5568050657313893478">"ኢሜይል"</string>
<string name="email_desc" msgid="6941280589171810022">"ለተመረጡ አድራሻዎች ኢሜይል ላክ"</string>
<string name="dial" msgid="7317293545368448453">"ደውል"</string>
- <string name="dial_desc" msgid="5129451396208040332">"ወደ ተመረጠው ስልክ ቁጥር ደውል"</string>
+ <string name="dial_desc" msgid="5129451396208040332">"ወደተመረጠው ስልክ ቁጥር ደውል"</string>
<string name="browse" msgid="3733970143542020945">"ክፈት"</string>
<string name="browse_desc" msgid="3898254913938219011">"የተመረጠውን ዩአርኤል ክፈት"</string>
<string name="sms" msgid="5495416906312064886">"መልዕክት"</string>
diff --git a/textclassifier/src/main/res/values-ar/strings.xml b/textclassifier/src/main/res/values-ar/strings.xml
index 52fb7d7..b2569b9 100644
--- a/textclassifier/src/main/res/values-ar/strings.xml
+++ b/textclassifier/src/main/res/values-ar/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"إرسال بريد إلكتروني"</string>
+ <string name="email" msgid="5568050657313893478">"البريد الإلكتروني"</string>
<string name="email_desc" msgid="6941280589171810022">"مراسلة العنوان المحدد عبر البريد الإلكتروني"</string>
<string name="dial" msgid="7317293545368448453">"اتصال"</string>
<string name="dial_desc" msgid="5129451396208040332">"الاتصال برقم الهاتف المحدد"</string>
<string name="browse" msgid="3733970143542020945">"فتح"</string>
<string name="browse_desc" msgid="3898254913938219011">"فتح عنوان URL المحدد"</string>
- <string name="sms" msgid="5495416906312064886">"إرسال رسائل قصيرة"</string>
+ <string name="sms" msgid="5495416906312064886">"رسالة"</string>
<string name="sms_desc" msgid="8293660783374489324">"مراسلة رقم الهاتف المحدد"</string>
<string name="add_contact" msgid="9005634177208282449">"إضافة"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"إضافة إلى جهات الاتصال"</string>
diff --git a/textclassifier/src/main/res/values-as/strings.xml b/textclassifier/src/main/res/values-as/strings.xml
deleted file mode 100644
index 7f52871..0000000
--- a/textclassifier/src/main/res/values-as/strings.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 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.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"ইমেইল কৰক"</string>
- <string name="email_desc" msgid="6941280589171810022">"বাছনি কৰা ঠিকনালৈ ইমেইল পঠিয়াওক"</string>
- <string name="dial" msgid="7317293545368448453">"কল কৰক"</string>
- <string name="dial_desc" msgid="5129451396208040332">"বাছনি কৰা ফ\'ন নম্বৰত কল কৰক"</string>
- <string name="browse" msgid="3733970143542020945">"খোলক"</string>
- <string name="browse_desc" msgid="3898254913938219011">"বাছনি কৰা URL খোলক"</string>
- <string name="sms" msgid="5495416906312064886">"বাৰ্তা পঠিয়াওক"</string>
- <string name="sms_desc" msgid="8293660783374489324">"বাছনি কৰা ফ’ন নম্বৰলৈ বাৰ্তা পঠিয়াওক"</string>
- <string name="add_contact" msgid="9005634177208282449">"যোগ কৰক"</string>
- <string name="add_contact_desc" msgid="2475604767309086575">"সর্ম্পকসূচীত যোগ কৰক"</string>
- <string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"অধিক বিকল্প"</string>
- <string name="floating_toolbar_close_overflow_description" msgid="6243666280435354232">"অভাৰফ্ল\' বন্ধ কৰক"</string>
- <string name="abc_share" msgid="7091841667818715717">"শ্বেয়াৰ কৰক"</string>
-</resources>
diff --git a/textclassifier/src/main/res/values-az/strings.xml b/textclassifier/src/main/res/values-az/strings.xml
index b8de8f8..e8b583e 100644
--- a/textclassifier/src/main/res/values-az/strings.xml
+++ b/textclassifier/src/main/res/values-az/strings.xml
@@ -16,14 +16,14 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"E-poçt yazın"</string>
+ <string name="email" msgid="5568050657313893478">"E-poçt"</string>
<string name="email_desc" msgid="6941280589171810022">"Seçilmiş ünvana e-məktub yazın"</string>
<string name="dial" msgid="7317293545368448453">"Zəng edin"</string>
<string name="dial_desc" msgid="5129451396208040332">"Seçilmiş telefon nömrəsinə zəng edin"</string>
<string name="browse" msgid="3733970143542020945">"Açın"</string>
<string name="browse_desc" msgid="3898254913938219011">"Seçilmiş linki açın"</string>
- <string name="sms" msgid="5495416906312064886">"Mesaj yazın"</string>
- <string name="sms_desc" msgid="8293660783374489324">"Seçilmiş telefon nömrəsinə mesaj göndərin"</string>
+ <string name="sms" msgid="5495416906312064886">"Mesaj"</string>
+ <string name="sms_desc" msgid="8293660783374489324">"Seçilmiş telefon nömrəsini mesajla göndərin"</string>
<string name="add_contact" msgid="9005634177208282449">"Əlavə edin"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Kontakta əlavə edin"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"Digər seçimlər"</string>
diff --git a/textclassifier/src/main/res/values-bs/strings.xml b/textclassifier/src/main/res/values-bs/strings.xml
index 0ad050a..0bc610f8 100644
--- a/textclassifier/src/main/res/values-bs/strings.xml
+++ b/textclassifier/src/main/res/values-bs/strings.xml
@@ -16,14 +16,14 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Pošalji e-poruku"</string>
- <string name="email_desc" msgid="6941280589171810022">"Pošalji e-poruku na odabranu adresu"</string>
- <string name="dial" msgid="7317293545368448453">"Pozovi"</string>
- <string name="dial_desc" msgid="5129451396208040332">"Pozovi odabrani broj telefona"</string>
+ <string name="email" msgid="5568050657313893478">"E-pošta"</string>
+ <string name="email_desc" msgid="6941280589171810022">"Pošaljite e-poruku na odabrane adrese"</string>
+ <string name="dial" msgid="7317293545368448453">"Poziv"</string>
+ <string name="dial_desc" msgid="5129451396208040332">"Pozovite odabrani broj telefona"</string>
<string name="browse" msgid="3733970143542020945">"Otvori"</string>
- <string name="browse_desc" msgid="3898254913938219011">"Otvori odabrani URL"</string>
- <string name="sms" msgid="5495416906312064886">"Pošalji SMS"</string>
- <string name="sms_desc" msgid="8293660783374489324">"Pošalji SMS odabranom broju telefona"</string>
+ <string name="browse_desc" msgid="3898254913938219011">"Otvorite odabrani URL"</string>
+ <string name="sms" msgid="5495416906312064886">"Poruka"</string>
+ <string name="sms_desc" msgid="8293660783374489324">"Pošaljite poruku odabranom broju telefona"</string>
<string name="add_contact" msgid="9005634177208282449">"Dodaj"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Dodaj u kontakte"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"Više opcija"</string>
diff --git a/textclassifier/src/main/res/values-ca/strings.xml b/textclassifier/src/main/res/values-ca/strings.xml
index e4932cb..0f2cf5ab 100644
--- a/textclassifier/src/main/res/values-ca/strings.xml
+++ b/textclassifier/src/main/res/values-ca/strings.xml
@@ -22,7 +22,7 @@
<string name="dial_desc" msgid="5129451396208040332">"Truca al número de telèfon seleccionat"</string>
<string name="browse" msgid="3733970143542020945">"Obre"</string>
<string name="browse_desc" msgid="3898254913938219011">"Obre l\'URL seleccionat"</string>
- <string name="sms" msgid="5495416906312064886">"Envia un SMS"</string>
+ <string name="sms" msgid="5495416906312064886">"Missatge"</string>
<string name="sms_desc" msgid="8293660783374489324">"Envia un missatge al número de telèfon seleccionat"</string>
<string name="add_contact" msgid="9005634177208282449">"Afegeix"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Afegeix als contactes"</string>
diff --git a/textclassifier/src/main/res/values-cs/strings.xml b/textclassifier/src/main/res/values-cs/strings.xml
index 757a68d..cc7360f 100644
--- a/textclassifier/src/main/res/values-cs/strings.xml
+++ b/textclassifier/src/main/res/values-cs/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Poslat e-mail"</string>
+ <string name="email" msgid="5568050657313893478">"E‑mail"</string>
<string name="email_desc" msgid="6941280589171810022">"Napsat na vybranou e‑mailovou adresu"</string>
- <string name="dial" msgid="7317293545368448453">"Zavolat"</string>
+ <string name="dial" msgid="7317293545368448453">"Volat"</string>
<string name="dial_desc" msgid="5129451396208040332">"Zavolat na vybrané telefonní číslo"</string>
<string name="browse" msgid="3733970143542020945">"Otevřít"</string>
<string name="browse_desc" msgid="3898254913938219011">"Otevřít vybranou adresu URL"</string>
- <string name="sms" msgid="5495416906312064886">"Napsat zprávu"</string>
+ <string name="sms" msgid="5495416906312064886">"Zpráva"</string>
<string name="sms_desc" msgid="8293660783374489324">"Napsat SMS na vybrané telefonní číslo"</string>
<string name="add_contact" msgid="9005634177208282449">"Přidat"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Přidat do kontaktů"</string>
diff --git a/textclassifier/src/main/res/values-da/strings.xml b/textclassifier/src/main/res/values-da/strings.xml
index d519fc9..50e7f3d 100644
--- a/textclassifier/src/main/res/values-da/strings.xml
+++ b/textclassifier/src/main/res/values-da/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Send mail"</string>
+ <string name="email" msgid="5568050657313893478">"Mail"</string>
<string name="email_desc" msgid="6941280589171810022">"Send en mail til den valgte adresse"</string>
- <string name="dial" msgid="7317293545368448453">"Ring op"</string>
+ <string name="dial" msgid="7317293545368448453">"Opkald"</string>
<string name="dial_desc" msgid="5129451396208040332">"Ring til det valgte telefonnummer"</string>
<string name="browse" msgid="3733970143542020945">"Åbn"</string>
<string name="browse_desc" msgid="3898254913938219011">"Åbn den valgte webadresse"</string>
- <string name="sms" msgid="5495416906312064886">"Send besked"</string>
+ <string name="sms" msgid="5495416906312064886">"Besked"</string>
<string name="sms_desc" msgid="8293660783374489324">"Send en besked til det valgte telefonnummer"</string>
<string name="add_contact" msgid="9005634177208282449">"Tilføj"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Føj til kontakter"</string>
diff --git a/textclassifier/src/main/res/values-de/strings.xml b/textclassifier/src/main/res/values-de/strings.xml
index 463609c..373ba36 100644
--- a/textclassifier/src/main/res/values-de/strings.xml
+++ b/textclassifier/src/main/res/values-de/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"E-Mail senden"</string>
+ <string name="email" msgid="5568050657313893478">"E-Mail"</string>
<string name="email_desc" msgid="6941280589171810022">"E-Mail an ausgewählte Adresse senden"</string>
<string name="dial" msgid="7317293545368448453">"Anruf"</string>
<string name="dial_desc" msgid="5129451396208040332">"Ausgewählte Telefonnummer anrufen"</string>
<string name="browse" msgid="3733970143542020945">"Öffnen"</string>
<string name="browse_desc" msgid="3898254913938219011">"Ausgewählte URL öffnen"</string>
- <string name="sms" msgid="5495416906312064886">"SMS senden"</string>
+ <string name="sms" msgid="5495416906312064886">"SMS"</string>
<string name="sms_desc" msgid="8293660783374489324">"SMS an ausgewählte Telefonnummer senden"</string>
<string name="add_contact" msgid="9005634177208282449">"Hinzufügen"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Zu Kontakten hinzufügen"</string>
diff --git a/textclassifier/src/main/res/values-es/strings.xml b/textclassifier/src/main/res/values-es/strings.xml
index dd4c644..007e62e 100644
--- a/textclassifier/src/main/res/values-es/strings.xml
+++ b/textclassifier/src/main/res/values-es/strings.xml
@@ -16,14 +16,14 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Enviar correo"</string>
+ <string name="email" msgid="5568050657313893478">"Correo electrónico"</string>
<string name="email_desc" msgid="6941280589171810022">"Enviar un correo electrónico a la dirección seleccionada"</string>
<string name="dial" msgid="7317293545368448453">"Llamar"</string>
<string name="dial_desc" msgid="5129451396208040332">"Llamar al número de teléfono seleccionado"</string>
<string name="browse" msgid="3733970143542020945">"Abrir"</string>
<string name="browse_desc" msgid="3898254913938219011">"Abrir la URL seleccionada"</string>
- <string name="sms" msgid="5495416906312064886">"Enviar SMS"</string>
- <string name="sms_desc" msgid="8293660783374489324">"Enviar SMS al teléfono seleccionado"</string>
+ <string name="sms" msgid="5495416906312064886">"Mensaje"</string>
+ <string name="sms_desc" msgid="8293660783374489324">"Enviar un mensaje al número de teléfono seleccionado"</string>
<string name="add_contact" msgid="9005634177208282449">"Añadir"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Añadir a contactos"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"Más opciones"</string>
diff --git a/textclassifier/src/main/res/values-et/strings.xml b/textclassifier/src/main/res/values-et/strings.xml
index b4b2e29..da2ecfb 100644
--- a/textclassifier/src/main/res/values-et/strings.xml
+++ b/textclassifier/src/main/res/values-et/strings.xml
@@ -16,16 +16,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Saada meil"</string>
- <string name="email_desc" msgid="6941280589171810022">"Saada valitud aadressile meil"</string>
- <string name="dial" msgid="7317293545368448453">"Helista"</string>
- <string name="dial_desc" msgid="5129451396208040332">"Helista valitud telefoninumbrile"</string>
+ <string name="email" msgid="5568050657313893478">"E-post"</string>
+ <string name="email_desc" msgid="6941280589171810022">"Valitud aadressile meili saatmine"</string>
+ <string name="dial" msgid="7317293545368448453">"Kõne"</string>
+ <string name="dial_desc" msgid="5129451396208040332">"Valitud telefoninumbrile helistamine"</string>
<string name="browse" msgid="3733970143542020945">"Ava"</string>
- <string name="browse_desc" msgid="3898254913938219011">"Ava valitud URL"</string>
- <string name="sms" msgid="5495416906312064886">"Saada sõnum"</string>
- <string name="sms_desc" msgid="8293660783374489324">"Saada valitud telefoninumbrile sõnum"</string>
+ <string name="browse_desc" msgid="3898254913938219011">"Valitud URL-i avamine"</string>
+ <string name="sms" msgid="5495416906312064886">"Sõnum"</string>
+ <string name="sms_desc" msgid="8293660783374489324">"Valitud telefoninumbrile sõnumi saatmine"</string>
<string name="add_contact" msgid="9005634177208282449">"Lisa"</string>
- <string name="add_contact_desc" msgid="2475604767309086575">"Lisa kontaktidesse"</string>
+ <string name="add_contact_desc" msgid="2475604767309086575">"Lisamine kontaktidesse"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"Rohkem valikuid"</string>
<string name="floating_toolbar_close_overflow_description" msgid="6243666280435354232">"Ületäite sulgemine"</string>
<string name="abc_share" msgid="7091841667818715717">"Jaga"</string>
diff --git a/textclassifier/src/main/res/values-eu/strings.xml b/textclassifier/src/main/res/values-eu/strings.xml
index 5b98777..0cfaf81 100644
--- a/textclassifier/src/main/res/values-eu/strings.xml
+++ b/textclassifier/src/main/res/values-eu/strings.xml
@@ -16,7 +16,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Bidali mezu bat"</string>
+ <string name="email" msgid="5568050657313893478">"Bidali mezu elektroniko bat"</string>
<string name="email_desc" msgid="6941280589171810022">"Bidali mezu elektroniko bat hautatutako helbidera"</string>
<string name="dial" msgid="7317293545368448453">"Deitu"</string>
<string name="dial_desc" msgid="5129451396208040332">"Deitu hautatutako telefono-zenbakira"</string>
diff --git a/textclassifier/src/main/res/values-fa/strings.xml b/textclassifier/src/main/res/values-fa/strings.xml
index 0c01dc6..f9d259f 100644
--- a/textclassifier/src/main/res/values-fa/strings.xml
+++ b/textclassifier/src/main/res/values-fa/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"فرستادن ایمیل"</string>
+ <string name="email" msgid="5568050657313893478">"ایمیل"</string>
<string name="email_desc" msgid="6941280589171810022">"ارسال ایمیل به نشانی انتخابی"</string>
- <string name="dial" msgid="7317293545368448453">"تماس گرفتن"</string>
+ <string name="dial" msgid="7317293545368448453">"تماس"</string>
<string name="dial_desc" msgid="5129451396208040332">"تماس با شماره تلفن انتخابی"</string>
<string name="browse" msgid="3733970143542020945">"باز کردن"</string>
<string name="browse_desc" msgid="3898254913938219011">"باز کردن نشانی وب انتخابی"</string>
- <string name="sms" msgid="5495416906312064886">"فرستادن پیام"</string>
+ <string name="sms" msgid="5495416906312064886">"پیام"</string>
<string name="sms_desc" msgid="8293660783374489324">"ارسال پیام به شماره تلفن انتخابی"</string>
<string name="add_contact" msgid="9005634177208282449">"افزودن"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"افزودن به مخاطبین"</string>
diff --git a/textclassifier/src/main/res/values-fr-rCA/strings.xml b/textclassifier/src/main/res/values-fr-rCA/strings.xml
index d56c13f..d1ff08c 100644
--- a/textclassifier/src/main/res/values-fr-rCA/strings.xml
+++ b/textclassifier/src/main/res/values-fr-rCA/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Envoyer un courriel"</string>
+ <string name="email" msgid="5568050657313893478">"Courriel"</string>
<string name="email_desc" msgid="6941280589171810022">"Envoyer un courriel à l\'adresse sélectionnée"</string>
<string name="dial" msgid="7317293545368448453">"Appeler"</string>
<string name="dial_desc" msgid="5129451396208040332">"Téléphoner au numéro sélectionné"</string>
<string name="browse" msgid="3733970143542020945">"Ouvrir"</string>
<string name="browse_desc" msgid="3898254913938219011">"Ouvrir l\'adresse URL sélectionnée"</string>
- <string name="sms" msgid="5495416906312064886">"Envoyer un texto"</string>
+ <string name="sms" msgid="5495416906312064886">"Message"</string>
<string name="sms_desc" msgid="8293660783374489324">"Envoyer un message texte au numéro de téléphone sélectionné"</string>
<string name="add_contact" msgid="9005634177208282449">"Ajouter"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Ajouter aux contacts"</string>
diff --git a/textclassifier/src/main/res/values-fr/strings.xml b/textclassifier/src/main/res/values-fr/strings.xml
index 8fc7a9a..87beba5 100644
--- a/textclassifier/src/main/res/values-fr/strings.xml
+++ b/textclassifier/src/main/res/values-fr/strings.xml
@@ -16,14 +16,14 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Envoyer un e-mail"</string>
+ <string name="email" msgid="5568050657313893478">"E-mail"</string>
<string name="email_desc" msgid="6941280589171810022">"Envoyer un e-mail à l\'adresse sélectionnée"</string>
<string name="dial" msgid="7317293545368448453">"Appeler"</string>
<string name="dial_desc" msgid="5129451396208040332">"Appeler le numéro de téléphone sélectionné"</string>
<string name="browse" msgid="3733970143542020945">"Ouvrir"</string>
<string name="browse_desc" msgid="3898254913938219011">"Ouvrir l\'URL sélectionnée"</string>
- <string name="sms" msgid="5495416906312064886">"Envoyer un SMS"</string>
- <string name="sms_desc" msgid="8293660783374489324">"Envoyer un SMS au numéro de téléphone sélectionné"</string>
+ <string name="sms" msgid="5495416906312064886">"Message"</string>
+ <string name="sms_desc" msgid="8293660783374489324">"Envoyer un message au numéro de téléphone sélectionné"</string>
<string name="add_contact" msgid="9005634177208282449">"Ajouter"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Ajouter aux contacts"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"Autres options"</string>
diff --git a/textclassifier/src/main/res/values-gl/strings.xml b/textclassifier/src/main/res/values-gl/strings.xml
index 2c4385c..b17e574 100644
--- a/textclassifier/src/main/res/values-gl/strings.xml
+++ b/textclassifier/src/main/res/values-gl/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Enviar correo e."</string>
+ <string name="email" msgid="5568050657313893478">"Correo electrónico"</string>
<string name="email_desc" msgid="6941280589171810022">"Envía un correo electrónico ao enderezo seleccionado"</string>
<string name="dial" msgid="7317293545368448453">"Chamar"</string>
<string name="dial_desc" msgid="5129451396208040332">"Chama ao número de teléfono seleccionado"</string>
<string name="browse" msgid="3733970143542020945">"Abrir"</string>
<string name="browse_desc" msgid="3898254913938219011">"Abre o URL seleccionado"</string>
- <string name="sms" msgid="5495416906312064886">"Enviar SMS"</string>
+ <string name="sms" msgid="5495416906312064886">"Enviar mensaxe"</string>
<string name="sms_desc" msgid="8293660783374489324">"Envía unha mensaxe ao número de teléfono seleccionado"</string>
<string name="add_contact" msgid="9005634177208282449">"Engadir"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Engade o elemento aos contactos"</string>
diff --git a/textclassifier/src/main/res/values-gu/strings.xml b/textclassifier/src/main/res/values-gu/strings.xml
index c92cbd17..84ec7d3 100644
--- a/textclassifier/src/main/res/values-gu/strings.xml
+++ b/textclassifier/src/main/res/values-gu/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"ઇમેઇલ કરો"</string>
+ <string name="email" msgid="5568050657313893478">"ઇમેઇલ"</string>
<string name="email_desc" msgid="6941280589171810022">"પસંદ કરેલા ઍડ્રેસ પર ઇમેઇલ મોકલો"</string>
- <string name="dial" msgid="7317293545368448453">"કૉલ કરો"</string>
+ <string name="dial" msgid="7317293545368448453">"કૉલ"</string>
<string name="dial_desc" msgid="5129451396208040332">"પસંદ કરેલા ફોન નંબર પર કૉલ કરો"</string>
<string name="browse" msgid="3733970143542020945">"ખોલો"</string>
<string name="browse_desc" msgid="3898254913938219011">"પસંદ કરેલું URL ખોલો"</string>
- <string name="sms" msgid="5495416906312064886">"સંદેશ મોકલો"</string>
+ <string name="sms" msgid="5495416906312064886">"સંદેશ"</string>
<string name="sms_desc" msgid="8293660783374489324">"પસંદ કરેલા ફોન નંબર પર સંદેશ મોકલો"</string>
<string name="add_contact" msgid="9005634177208282449">"ઉમેરો"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"સંપર્કોમાં ઉમેરો"</string>
diff --git a/textclassifier/src/main/res/values-hi/strings.xml b/textclassifier/src/main/res/values-hi/strings.xml
index e9cf510..0d3da9e2 100644
--- a/textclassifier/src/main/res/values-hi/strings.xml
+++ b/textclassifier/src/main/res/values-hi/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"ईमेल करें"</string>
+ <string name="email" msgid="5568050657313893478">"ईमेल"</string>
<string name="email_desc" msgid="6941280589171810022">"चुने गए पते पर ईमेल भेजें"</string>
<string name="dial" msgid="7317293545368448453">"कॉल करें"</string>
<string name="dial_desc" msgid="5129451396208040332">"चुने गए फ़ोन नंबर पर कॉल करें"</string>
<string name="browse" msgid="3733970143542020945">"खोलें"</string>
<string name="browse_desc" msgid="3898254913938219011">"चुना गया यूआरएल खोलें"</string>
- <string name="sms" msgid="5495416906312064886">"मैसेज करें"</string>
+ <string name="sms" msgid="5495416906312064886">"मैसेज"</string>
<string name="sms_desc" msgid="8293660783374489324">"चुने गए फ़ोन नंबर को मैसेज करें"</string>
<string name="add_contact" msgid="9005634177208282449">"जोड़ें"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"संपर्क सूची में जोड़ें"</string>
diff --git a/textclassifier/src/main/res/values-hr/strings.xml b/textclassifier/src/main/res/values-hr/strings.xml
index 0a05d23..197bf47 100644
--- a/textclassifier/src/main/res/values-hr/strings.xml
+++ b/textclassifier/src/main/res/values-hr/strings.xml
@@ -16,14 +16,14 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Pošalji e-poštu"</string>
- <string name="email_desc" msgid="6941280589171810022">"Pošalji e-poštu na odabranu adresu"</string>
- <string name="dial" msgid="7317293545368448453">"Nazovi"</string>
- <string name="dial_desc" msgid="5129451396208040332">"Nazovi odabrani telefonski broj"</string>
+ <string name="email" msgid="5568050657313893478">"E-pošta"</string>
+ <string name="email_desc" msgid="6941280589171810022">"Slanje e-poruke na odabranu adresu"</string>
+ <string name="dial" msgid="7317293545368448453">"Poziv"</string>
+ <string name="dial_desc" msgid="5129451396208040332">"Pozivanje odabranog telefonskog broja"</string>
<string name="browse" msgid="3733970143542020945">"Otvori"</string>
- <string name="browse_desc" msgid="3898254913938219011">"Otvori odabrani URL"</string>
- <string name="sms" msgid="5495416906312064886">"Pošalji poruku"</string>
- <string name="sms_desc" msgid="8293660783374489324">"Pošalji poruku na odabrani telefonski broj"</string>
+ <string name="browse_desc" msgid="3898254913938219011">"Otvaranje odabranog URL-a"</string>
+ <string name="sms" msgid="5495416906312064886">"Poruka"</string>
+ <string name="sms_desc" msgid="8293660783374489324">"Slanje poruke na odabrani telefonski broj"</string>
<string name="add_contact" msgid="9005634177208282449">"Dodaj"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Dodaj u kontakte"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"Više opcija"</string>
diff --git a/textclassifier/src/main/res/values-hu/strings.xml b/textclassifier/src/main/res/values-hu/strings.xml
index 59d8bf4..b58ea3c 100644
--- a/textclassifier/src/main/res/values-hu/strings.xml
+++ b/textclassifier/src/main/res/values-hu/strings.xml
@@ -17,7 +17,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="email" msgid="5568050657313893478">"E-mail"</string>
- <string name="email_desc" msgid="6941280589171810022">"E-mail küldése a kiválasztott címre"</string>
+ <string name="email_desc" msgid="6941280589171810022">"Kiválasztott cím elküldése e-mailben"</string>
<string name="dial" msgid="7317293545368448453">"Hívás"</string>
<string name="dial_desc" msgid="5129451396208040332">"Kiválasztott telefonszám hívása"</string>
<string name="browse" msgid="3733970143542020945">"Megnyitás"</string>
diff --git a/textclassifier/src/main/res/values-in/strings.xml b/textclassifier/src/main/res/values-in/strings.xml
index 85dbb52..ea214c8 100644
--- a/textclassifier/src/main/res/values-in/strings.xml
+++ b/textclassifier/src/main/res/values-in/strings.xml
@@ -17,13 +17,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="email" msgid="5568050657313893478">"Email"</string>
- <string name="email_desc" msgid="6941280589171810022">"Kirim email ke alamat yang dipilih"</string>
+ <string name="email_desc" msgid="6941280589171810022">"Mengirimkan email ke alamat yang dipilih"</string>
<string name="dial" msgid="7317293545368448453">"Panggil"</string>
- <string name="dial_desc" msgid="5129451396208040332">"Panggil nomor telepon yang dipilih"</string>
+ <string name="dial_desc" msgid="5129451396208040332">"Memanggil nomor telepon yang dipilih"</string>
<string name="browse" msgid="3733970143542020945">"Buka"</string>
<string name="browse_desc" msgid="3898254913938219011">"Buka URL yang dipilih"</string>
<string name="sms" msgid="5495416906312064886">"Pesan"</string>
- <string name="sms_desc" msgid="8293660783374489324">"Kirim SMS ke nomor telepon yang dipilih"</string>
+ <string name="sms_desc" msgid="8293660783374489324">"Mengirimkan SMS ke nomor telepon yang dipilih"</string>
<string name="add_contact" msgid="9005634177208282449">"Tambahkan"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Tambahkan ke kontak"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"Opsi lain"</string>
diff --git a/textclassifier/src/main/res/values-iw/strings.xml b/textclassifier/src/main/res/values-iw/strings.xml
index b577732..84df5c1 100644
--- a/textclassifier/src/main/res/values-iw/strings.xml
+++ b/textclassifier/src/main/res/values-iw/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"התכתבות באימייל"</string>
+ <string name="email" msgid="5568050657313893478">"אימייל"</string>
<string name="email_desc" msgid="6941280589171810022">"שליחת אימייל לכתובת שנבחרה"</string>
- <string name="dial" msgid="7317293545368448453">"ביצוע שיחה"</string>
+ <string name="dial" msgid="7317293545368448453">"שיחה"</string>
<string name="dial_desc" msgid="5129451396208040332">"התקשרות למספר הטלפון שנבחר"</string>
<string name="browse" msgid="3733970143542020945">"פתיחה"</string>
<string name="browse_desc" msgid="3898254913938219011">"פתיחה של כתובת האתר שנבחרה"</string>
- <string name="sms" msgid="5495416906312064886">"התכתבות בהודעות"</string>
+ <string name="sms" msgid="5495416906312064886">"הודעה"</string>
<string name="sms_desc" msgid="8293660783374489324">"שליחת הודעה למספר הטלפון שנבחר"</string>
<string name="add_contact" msgid="9005634177208282449">"הוספה"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"הוספה לאנשי הקשר"</string>
diff --git a/textclassifier/src/main/res/values-kk/strings.xml b/textclassifier/src/main/res/values-kk/strings.xml
index 70a0090..49cae0b 100644
--- a/textclassifier/src/main/res/values-kk/strings.xml
+++ b/textclassifier/src/main/res/values-kk/strings.xml
@@ -16,16 +16,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Эл. поштаны ашу"</string>
- <string name="email_desc" msgid="6941280589171810022">"Таңдалған мекенжайға хабар жіберу"</string>
+ <string name="email" msgid="5568050657313893478">"Электрондық пошта"</string>
+ <string name="email_desc" msgid="6941280589171810022">"Таңдалған электрондық пошта мекенжайына хабар жіберу"</string>
<string name="dial" msgid="7317293545368448453">"Қоңырау шалу"</string>
<string name="dial_desc" msgid="5129451396208040332">"Таңдалған телефон нөміріне қоңырау шалу"</string>
<string name="browse" msgid="3733970143542020945">"Ашу"</string>
<string name="browse_desc" msgid="3898254913938219011">"Таңдалған URL мекенжайын ашу"</string>
- <string name="sms" msgid="5495416906312064886">"Хабар жіберу"</string>
+ <string name="sms" msgid="5495416906312064886">"Хабар"</string>
<string name="sms_desc" msgid="8293660783374489324">"Таңдалған телефон нөміріне хабар жіберу"</string>
- <string name="add_contact" msgid="9005634177208282449">"Енгізу"</string>
- <string name="add_contact_desc" msgid="2475604767309086575">"Контактілер тізіміне енгізу"</string>
+ <string name="add_contact" msgid="9005634177208282449">"Қосу"</string>
+ <string name="add_contact_desc" msgid="2475604767309086575">"Контактілерге қосу"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"Басқа опциялар"</string>
<string name="floating_toolbar_close_overflow_description" msgid="6243666280435354232">"Қосымша мәзірді жабу"</string>
<string name="abc_share" msgid="7091841667818715717">"Бөлісу"</string>
diff --git a/textclassifier/src/main/res/values-km/strings.xml b/textclassifier/src/main/res/values-km/strings.xml
index e71c64b5..11fcb96 100644
--- a/textclassifier/src/main/res/values-km/strings.xml
+++ b/textclassifier/src/main/res/values-km/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"ផ្ញើអ៊ីមែល"</string>
+ <string name="email" msgid="5568050657313893478">"អ៊ីមែល"</string>
<string name="email_desc" msgid="6941280589171810022">"ផ្ញើអ៊ីមែលទៅអាសយដ្ឋានដែលបានជ្រើសរើស"</string>
- <string name="dial" msgid="7317293545368448453">"ហៅទូរសព្ទ"</string>
- <string name="dial_desc" msgid="5129451396208040332">"ហៅទូរសព្ទទៅលេខដែលបានជ្រើសរើស"</string>
+ <string name="dial" msgid="7317293545368448453">"ហៅ"</string>
+ <string name="dial_desc" msgid="5129451396208040332">"ហៅទៅលេខទូរសព្ទដែលបានជ្រើសរើស"</string>
<string name="browse" msgid="3733970143542020945">"បើក"</string>
<string name="browse_desc" msgid="3898254913938219011">"បើក URL ដែលបានជ្រើសរើស"</string>
- <string name="sms" msgid="5495416906312064886">"ផ្ញើសារ"</string>
+ <string name="sms" msgid="5495416906312064886">"សារ"</string>
<string name="sms_desc" msgid="8293660783374489324">"ផ្ញើសារទៅលេខទូរសព្ទដែលបានជ្រើសរើស"</string>
<string name="add_contact" msgid="9005634177208282449">"បញ្ចូល"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"បញ្ចូលទៅក្នុងទំនាក់ទំនង"</string>
diff --git a/textclassifier/src/main/res/values-kn/strings.xml b/textclassifier/src/main/res/values-kn/strings.xml
index 14dfb18..57769c7 100644
--- a/textclassifier/src/main/res/values-kn/strings.xml
+++ b/textclassifier/src/main/res/values-kn/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"ಇಮೇಲ್ ಮಾಡಿ"</string>
+ <string name="email" msgid="5568050657313893478">"ಇಮೇಲ್"</string>
<string name="email_desc" msgid="6941280589171810022">"ಆಯ್ಕೆಮಾಡಿದ ವಿಳಾಸಕ್ಕೆ ಇಮೇಲ್ ಮಾಡಿ"</string>
- <string name="dial" msgid="7317293545368448453">"ಕರೆ ಮಾಡಿ"</string>
+ <string name="dial" msgid="7317293545368448453">"ಕರೆ"</string>
<string name="dial_desc" msgid="5129451396208040332">"ಆಯ್ಕೆಮಾಡಿದ ಫೋನ್ ಸಂಖ್ಯೆಗೆ ಕರೆ ಮಾಡಿ"</string>
<string name="browse" msgid="3733970143542020945">"ತೆರೆಯಿರಿ"</string>
<string name="browse_desc" msgid="3898254913938219011">"ಆಯ್ಕೆ ಮಾಡಿದ URL ತೆರೆಯಿರಿ"</string>
- <string name="sms" msgid="5495416906312064886">"ಸಂದೇಶ ಕಳುಹಿಸಿ"</string>
+ <string name="sms" msgid="5495416906312064886">"ಸಂದೇಶ"</string>
<string name="sms_desc" msgid="8293660783374489324">"ಆಯ್ಕೆಮಾಡಿದ ಫೋನ್ ಸಂಖ್ಯೆಗೆ ಸಂದೇಶ ಕಳುಹಿಸಿ"</string>
<string name="add_contact" msgid="9005634177208282449">"ಸೇರಿಸಿ"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"ಸಂಪರ್ಕಗಳಿಗೆ ಸೇರಿಸಿ"</string>
diff --git a/textclassifier/src/main/res/values-ky/strings.xml b/textclassifier/src/main/res/values-ky/strings.xml
index 1ae09c4..f0da54b 100644
--- a/textclassifier/src/main/res/values-ky/strings.xml
+++ b/textclassifier/src/main/res/values-ky/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Электрондук кат жөнөтүү"</string>
+ <string name="email" msgid="5568050657313893478">"Электрондук почта"</string>
<string name="email_desc" msgid="6941280589171810022">"Тандалган дарекке электрондук кат жөнөтүү"</string>
<string name="dial" msgid="7317293545368448453">"Чалуу"</string>
<string name="dial_desc" msgid="5129451396208040332">"Тандалган телефон номерине чалуу"</string>
<string name="browse" msgid="3733970143542020945">"Ачуу"</string>
<string name="browse_desc" msgid="3898254913938219011">"Тандалган URL\'ди ачуу"</string>
- <string name="sms" msgid="5495416906312064886">"Билдирүү жөнөтүү"</string>
+ <string name="sms" msgid="5495416906312064886">"Билдирүү"</string>
<string name="sms_desc" msgid="8293660783374489324">"Тандалган телефон номерине билдирүү жөнөтүү"</string>
<string name="add_contact" msgid="9005634177208282449">"Кошуу"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Байланыштарга кошуу"</string>
diff --git a/textclassifier/src/main/res/values-lt/strings.xml b/textclassifier/src/main/res/values-lt/strings.xml
index 8055d7e..f0affddb 100644
--- a/textclassifier/src/main/res/values-lt/strings.xml
+++ b/textclassifier/src/main/res/values-lt/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Rašyti el. laišką"</string>
+ <string name="email" msgid="5568050657313893478">"El. paštas"</string>
<string name="email_desc" msgid="6941280589171810022">"Siųsti el. laišką pasirinktu adresu"</string>
<string name="dial" msgid="7317293545368448453">"Skambinti"</string>
<string name="dial_desc" msgid="5129451396208040332">"Skambinti pasirinktu telefono numeriu"</string>
<string name="browse" msgid="3733970143542020945">"Atidaryti"</string>
<string name="browse_desc" msgid="3898254913938219011">"Atidaryti pasirinktą URL"</string>
- <string name="sms" msgid="5495416906312064886">"Rašyti pranešimą"</string>
+ <string name="sms" msgid="5495416906312064886">"Pranešimas"</string>
<string name="sms_desc" msgid="8293660783374489324">"Siųsti pranešimą pasirinktu telefono numeriu"</string>
<string name="add_contact" msgid="9005634177208282449">"Pridėti"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Pridėti prie kontaktų"</string>
diff --git a/textclassifier/src/main/res/values-lv/strings.xml b/textclassifier/src/main/res/values-lv/strings.xml
index 01b7230..b3d2599 100644
--- a/textclassifier/src/main/res/values-lv/strings.xml
+++ b/textclassifier/src/main/res/values-lv/strings.xml
@@ -16,7 +16,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"E-pasts"</string>
+ <string name="email" msgid="5568050657313893478">"E-pasta ziņojums"</string>
<string name="email_desc" msgid="6941280589171810022">"Nosūtīt e-pasta ziņojumu uz atlasīto adresi"</string>
<string name="dial" msgid="7317293545368448453">"Zvans"</string>
<string name="dial_desc" msgid="5129451396208040332">"Zvanīt uz atlasīto tālruņa numuru"</string>
diff --git a/textclassifier/src/main/res/values-mk/strings.xml b/textclassifier/src/main/res/values-mk/strings.xml
index 39235db..dc5183b 100644
--- a/textclassifier/src/main/res/values-mk/strings.xml
+++ b/textclassifier/src/main/res/values-mk/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Испрати е-пошта"</string>
+ <string name="email" msgid="5568050657313893478">"Е-пошта"</string>
<string name="email_desc" msgid="6941280589171810022">"Испрати е-порака до избраната адреса"</string>
<string name="dial" msgid="7317293545368448453">"Повикај"</string>
<string name="dial_desc" msgid="5129451396208040332">"Повикај го избраниот телефонски број"</string>
<string name="browse" msgid="3733970143542020945">"Отвори"</string>
<string name="browse_desc" msgid="3898254913938219011">"Отвори ја избраната URL-адреса"</string>
- <string name="sms" msgid="5495416906312064886">"Испрати порака"</string>
+ <string name="sms" msgid="5495416906312064886">"Порака"</string>
<string name="sms_desc" msgid="8293660783374489324">"Испрати порака до избраниот телефонски број"</string>
<string name="add_contact" msgid="9005634177208282449">"Додај"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Додај во контакти"</string>
diff --git a/textclassifier/src/main/res/values-ml/strings.xml b/textclassifier/src/main/res/values-ml/strings.xml
index b8726a9..1d5d95b 100644
--- a/textclassifier/src/main/res/values-ml/strings.xml
+++ b/textclassifier/src/main/res/values-ml/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"ഇമെയിൽ അയയ്ക്കൂ"</string>
+ <string name="email" msgid="5568050657313893478">"ഇമെയിൽ"</string>
<string name="email_desc" msgid="6941280589171810022">"തിരഞ്ഞെടുത്ത വിലാസത്തിലേക്ക് ഇമെയിൽ അയയ്ക്കുക"</string>
<string name="dial" msgid="7317293545368448453">"വിളിക്കുക"</string>
<string name="dial_desc" msgid="5129451396208040332">"തിരഞ്ഞെടുത്ത ഫോൺ നമ്പറിലേക്ക് വിളിക്കുക"</string>
<string name="browse" msgid="3733970143542020945">"തുറക്കുക"</string>
<string name="browse_desc" msgid="3898254913938219011">"തിരഞ്ഞെടുത്ത URL തുറക്കുക"</string>
- <string name="sms" msgid="5495416906312064886">"സന്ദേശം അയയ്ക്കൂ"</string>
+ <string name="sms" msgid="5495416906312064886">"സന്ദേശം"</string>
<string name="sms_desc" msgid="8293660783374489324">"തിരഞ്ഞെടുത്ത ഫോൺ നമ്പറിലേക്ക് സന്ദേശം അയയ്ക്കുക"</string>
<string name="add_contact" msgid="9005634177208282449">"ചേർക്കുക"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"കോൺടാക്റ്റുകളിലേക്ക് ചേർക്കുക"</string>
diff --git a/textclassifier/src/main/res/values-mn/strings.xml b/textclassifier/src/main/res/values-mn/strings.xml
index 9dfd17b..c4e9d7e 100644
--- a/textclassifier/src/main/res/values-mn/strings.xml
+++ b/textclassifier/src/main/res/values-mn/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Имэйл бичих"</string>
+ <string name="email" msgid="5568050657313893478">"Имэйл"</string>
<string name="email_desc" msgid="6941280589171810022">"Сонгосон хаяг руу имэйл илгээх"</string>
<string name="dial" msgid="7317293545368448453">"Залгах"</string>
<string name="dial_desc" msgid="5129451396208040332">"Сонгосон утасны дугаар руу залгах"</string>
<string name="browse" msgid="3733970143542020945">"Нээх"</string>
<string name="browse_desc" msgid="3898254913938219011">"Сонгосон URL-г нээх"</string>
- <string name="sms" msgid="5495416906312064886">"Мессеж бичих"</string>
+ <string name="sms" msgid="5495416906312064886">"Мессеж"</string>
<string name="sms_desc" msgid="8293660783374489324">"Сонгосон утасны дугаар руу мессеж илгээх"</string>
<string name="add_contact" msgid="9005634177208282449">"Нэмэх"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Харилцагчид нэмэх"</string>
diff --git a/textclassifier/src/main/res/values-mr/strings.xml b/textclassifier/src/main/res/values-mr/strings.xml
index 11a2d55..895d1dc 100644
--- a/textclassifier/src/main/res/values-mr/strings.xml
+++ b/textclassifier/src/main/res/values-mr/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"ईमेल करा"</string>
+ <string name="email" msgid="5568050657313893478">"ईमेल"</string>
<string name="email_desc" msgid="6941280589171810022">"निवडलेल्या अॅड्रेसवर ईमेल करा"</string>
<string name="dial" msgid="7317293545368448453">"कॉल करा"</string>
<string name="dial_desc" msgid="5129451396208040332">"निवडलेल्या फोन नंबरवर कॉल करा"</string>
<string name="browse" msgid="3733970143542020945">"उघडा"</string>
<string name="browse_desc" msgid="3898254913938219011">"निवडलेली URL उघडा"</string>
- <string name="sms" msgid="5495416906312064886">"मेसेज करा"</string>
+ <string name="sms" msgid="5495416906312064886">"मेसेज"</string>
<string name="sms_desc" msgid="8293660783374489324">"निवडलेल्या फोन नंबरवर मेसेज करा"</string>
<string name="add_contact" msgid="9005634177208282449">"जोडा"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"संपर्कांमध्ये जोडा"</string>
diff --git a/textclassifier/src/main/res/values-my/strings.xml b/textclassifier/src/main/res/values-my/strings.xml
index 78edba2..9a159f0 100644
--- a/textclassifier/src/main/res/values-my/strings.xml
+++ b/textclassifier/src/main/res/values-my/strings.xml
@@ -16,16 +16,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"အီးမေးလ်ပို့ရန်"</string>
+ <string name="email" msgid="5568050657313893478">"အီးမေးလ်"</string>
<string name="email_desc" msgid="6941280589171810022">"ရွေးထားသည့် လိပ်စာသို့ အီးမေးလ်ပို့ရန်"</string>
<string name="dial" msgid="7317293545368448453">"ခေါ်ဆိုရန်"</string>
<string name="dial_desc" msgid="5129451396208040332">"ရွေးထားသည့် ဖုန်းနံပါတ်ကို ခေါ်ရန်"</string>
<string name="browse" msgid="3733970143542020945">"ဖွင့်ရန်"</string>
<string name="browse_desc" msgid="3898254913938219011">"ရွေးထားသည့် URL ကို ဖွင့်ရန်"</string>
- <string name="sms" msgid="5495416906312064886">"မက်ဆေ့ဂျ်ပို့ရန်"</string>
+ <string name="sms" msgid="5495416906312064886">"မက်ဆေ့ဂျ်"</string>
<string name="sms_desc" msgid="8293660783374489324">"ရွေးထားသည့် ဖုန်းနံပါတ်ကို မက်ဆေ့ဂျ်ပို့ရန်"</string>
<string name="add_contact" msgid="9005634177208282449">"ထည့်ရန်"</string>
- <string name="add_contact_desc" msgid="2475604767309086575">"အဆက်အသွယ်များသို့ ထည့်ရန်"</string>
+ <string name="add_contact_desc" msgid="2475604767309086575">"ထည့်ရန်"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"နောက်ထပ် ရွေးစရာများ"</string>
<string name="floating_toolbar_close_overflow_description" msgid="6243666280435354232">"အပိုမီနူးကို ပိတ်ရန်"</string>
<string name="abc_share" msgid="7091841667818715717">"မျှဝေရန်"</string>
diff --git a/textclassifier/src/main/res/values-nb/strings.xml b/textclassifier/src/main/res/values-nb/strings.xml
index 1959f52..31bac6e 100644
--- a/textclassifier/src/main/res/values-nb/strings.xml
+++ b/textclassifier/src/main/res/values-nb/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Send e-post"</string>
+ <string name="email" msgid="5568050657313893478">"E-post"</string>
<string name="email_desc" msgid="6941280589171810022">"Send e-post til den valgte adressen"</string>
<string name="dial" msgid="7317293545368448453">"Ring"</string>
<string name="dial_desc" msgid="5129451396208040332">"Ring det valgte telefonnummeret"</string>
<string name="browse" msgid="3733970143542020945">"Åpne"</string>
<string name="browse_desc" msgid="3898254913938219011">"Åpne den valgte nettadressen"</string>
- <string name="sms" msgid="5495416906312064886">"Send melding"</string>
+ <string name="sms" msgid="5495416906312064886">"Melding"</string>
<string name="sms_desc" msgid="8293660783374489324">"Send melding til det valgte telefonnummeret"</string>
<string name="add_contact" msgid="9005634177208282449">"Legg til"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Legg til i kontakter"</string>
diff --git a/textclassifier/src/main/res/values-ne/strings.xml b/textclassifier/src/main/res/values-ne/strings.xml
index 34325fe..e33e441 100644
--- a/textclassifier/src/main/res/values-ne/strings.xml
+++ b/textclassifier/src/main/res/values-ne/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"इमेल गर्नुहोस्"</string>
+ <string name="email" msgid="5568050657313893478">"इमेल"</string>
<string name="email_desc" msgid="6941280589171810022">"चयन गरिएको ठेगानामा इमेल पठाउनुहोस्"</string>
<string name="dial" msgid="7317293545368448453">"कल गर्नुहोस्"</string>
<string name="dial_desc" msgid="5129451396208040332">"चयन गरिएको फोन नम्बरमा कल गर्नुहोस्"</string>
<string name="browse" msgid="3733970143542020945">"खोल्नुहोस्"</string>
<string name="browse_desc" msgid="3898254913938219011">"चयन गरिएको URL खोल्नुहोस्"</string>
- <string name="sms" msgid="5495416906312064886">"सन्देश पठाउनुहोस्"</string>
+ <string name="sms" msgid="5495416906312064886">"सन्देश"</string>
<string name="sms_desc" msgid="8293660783374489324">"चयन गरिएको फोन नम्बरमा सन्देश पठाउनुहोस्"</string>
<string name="add_contact" msgid="9005634177208282449">"थप्नुहोस्"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"सम्पर्कहरूमा थप्नुहोस्"</string>
diff --git a/textclassifier/src/main/res/values-or/strings.xml b/textclassifier/src/main/res/values-or/strings.xml
index 00a45bb..3454944 100644
--- a/textclassifier/src/main/res/values-or/strings.xml
+++ b/textclassifier/src/main/res/values-or/strings.xml
@@ -18,14 +18,14 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="email" msgid="5568050657313893478">"ଇମେଲ୍"</string>
<string name="email_desc" msgid="6941280589171810022">"ଚୟନିତ ଠିକଣାକୁ ଇମେଲ୍ ପଠାନ୍ତୁ"</string>
- <string name="dial" msgid="7317293545368448453">"କଲ୍"</string>
+ <string name="dial" msgid="7317293545368448453">"କଲ୍ କରନ୍ତୁ"</string>
<string name="dial_desc" msgid="5129451396208040332">"ଚୟନିତ ଫୋନ୍ ନମ୍ବର୍କୁ କଲ୍ କରନ୍ତୁ"</string>
<string name="browse" msgid="3733970143542020945">"ଖୋଲନ୍ତୁ"</string>
<string name="browse_desc" msgid="3898254913938219011">"ଚୟନିତ URL ଖୋଲନ୍ତୁ"</string>
<string name="sms" msgid="5495416906312064886">"ମେସେଜ୍"</string>
<string name="sms_desc" msgid="8293660783374489324">"ଚୟନିତ ଫୋନ୍ ନମ୍ବର୍କୁ ମେସେଜ୍ ପଠାନ୍ତୁ"</string>
- <string name="add_contact" msgid="9005634177208282449">"ଯୋଗ କରନ୍ତୁ"</string>
- <string name="add_contact_desc" msgid="2475604767309086575">"ଯୋଗାଯୋଗରେ ଯୋଗ କରନ୍ତୁ"</string>
+ <string name="add_contact" msgid="9005634177208282449">"ଯୋଡ଼ନ୍ତୁ"</string>
+ <string name="add_contact_desc" msgid="2475604767309086575">"ଯୋଗାଯୋଗରେ ଯୋଡ଼ନ୍ତୁ"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"ଅଧିକ ବିକଳ୍ପ"</string>
<string name="floating_toolbar_close_overflow_description" msgid="6243666280435354232">"ଓଭରଫ୍ଲୋ ବନ୍ଦ କରନ୍ତୁ"</string>
<string name="abc_share" msgid="7091841667818715717">"ଶେୟାର୍ କରନ୍ତୁ"</string>
diff --git a/textclassifier/src/main/res/values-pa/strings.xml b/textclassifier/src/main/res/values-pa/strings.xml
index 004bc9c..6831001 100644
--- a/textclassifier/src/main/res/values-pa/strings.xml
+++ b/textclassifier/src/main/res/values-pa/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"ਈਮੇਲ ਖੋਲ੍ਹੋ"</string>
+ <string name="email" msgid="5568050657313893478">"ਈਮੇਲ"</string>
<string name="email_desc" msgid="6941280589171810022">"ਚੁਣੇ ਹੋਏ ਪਤੇ \'ਤੇ ਈਮੇਲ ਭੇਜੋ"</string>
<string name="dial" msgid="7317293545368448453">"ਕਾਲ ਕਰੋ"</string>
<string name="dial_desc" msgid="5129451396208040332">"ਚੁਣੇ ਗਏ ਫ਼ੋਨ ਨੰਬਰ \'ਤੇ ਕਾਲ ਕਰੋ"</string>
<string name="browse" msgid="3733970143542020945">"ਖੋਲ੍ਹੋ"</string>
<string name="browse_desc" msgid="3898254913938219011">"ਚੁਣਿਆ ਗਿਆ URL ਖੋਲ੍ਹੋ"</string>
- <string name="sms" msgid="5495416906312064886">"ਸੁਨੇਹਾ ਖੋਲ੍ਹੋ"</string>
+ <string name="sms" msgid="5495416906312064886">"ਸੁਨੇਹਾ"</string>
<string name="sms_desc" msgid="8293660783374489324">"ਚੁਣੇ ਗਏ ਫ਼ੋਨ ਨੰਬਰ \'ਤੇ ਸੁਨੇਹਾ ਭੇਜੋ"</string>
<string name="add_contact" msgid="9005634177208282449">"ਸ਼ਾਮਲ ਕਰੋ"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"ਸੰਪਰਕਾਂ ਵਿੱਚ ਸ਼ਾਮਲ ਕਰੋ"</string>
diff --git a/textclassifier/src/main/res/values-pt-rPT/strings.xml b/textclassifier/src/main/res/values-pt-rPT/strings.xml
index c1ff32b..3eef4f1e 100644
--- a/textclassifier/src/main/res/values-pt-rPT/strings.xml
+++ b/textclassifier/src/main/res/values-pt-rPT/strings.xml
@@ -22,7 +22,7 @@
<string name="dial_desc" msgid="5129451396208040332">"Ligar para o número de telefone selecionado"</string>
<string name="browse" msgid="3733970143542020945">"Abrir"</string>
<string name="browse_desc" msgid="3898254913938219011">"Abrir o URL selecionado"</string>
- <string name="sms" msgid="5495416906312064886">"Enviar mensagem"</string>
+ <string name="sms" msgid="5495416906312064886">"Mensagem"</string>
<string name="sms_desc" msgid="8293660783374489324">"Enviar uma mensagem para o número de telefone selecionado"</string>
<string name="add_contact" msgid="9005634177208282449">"Adicionar"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Adicionar aos contactos"</string>
diff --git a/textclassifier/src/main/res/values-ro/strings.xml b/textclassifier/src/main/res/values-ro/strings.xml
index 3656640..d41f9b7 100644
--- a/textclassifier/src/main/res/values-ro/strings.xml
+++ b/textclassifier/src/main/res/values-ro/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Trimiteți un e-mail"</string>
+ <string name="email" msgid="5568050657313893478">"E-mail"</string>
<string name="email_desc" msgid="6941280589171810022">"Trimiteți un e-mail la adresa selectată"</string>
- <string name="dial" msgid="7317293545368448453">"Sunați"</string>
- <string name="dial_desc" msgid="5129451396208040332">"Sunați la numărul de telefon selectat"</string>
+ <string name="dial" msgid="7317293545368448453">"Apelați"</string>
+ <string name="dial_desc" msgid="5129451396208040332">"Apelați numărul de telefon selectat"</string>
<string name="browse" msgid="3733970143542020945">"Deschideți"</string>
<string name="browse_desc" msgid="3898254913938219011">"Deschideți adresa URL selectată"</string>
- <string name="sms" msgid="5495416906312064886">"Trimiteți mesaj"</string>
+ <string name="sms" msgid="5495416906312064886">"Mesaj"</string>
<string name="sms_desc" msgid="8293660783374489324">"Trimiteți un mesaj la numărul de telefon selectat"</string>
<string name="add_contact" msgid="9005634177208282449">"Adăugați"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Adăugați în agendă"</string>
diff --git a/textclassifier/src/main/res/values-ru/strings.xml b/textclassifier/src/main/res/values-ru/strings.xml
index c3e4610..a34d303 100644
--- a/textclassifier/src/main/res/values-ru/strings.xml
+++ b/textclassifier/src/main/res/values-ru/strings.xml
@@ -16,7 +16,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Написать письмо"</string>
+ <string name="email" msgid="5568050657313893478">"Написать по почте"</string>
<string name="email_desc" msgid="6941280589171810022">"Отправить письмо выбранному адресату"</string>
<string name="dial" msgid="7317293545368448453">"Позвонить"</string>
<string name="dial_desc" msgid="5129451396208040332">"Позвонить по выбранному номеру"</string>
diff --git a/textclassifier/src/main/res/values-sl/strings.xml b/textclassifier/src/main/res/values-sl/strings.xml
index 9cf16f6..7a9981f 100644
--- a/textclassifier/src/main/res/values-sl/strings.xml
+++ b/textclassifier/src/main/res/values-sl/strings.xml
@@ -16,16 +16,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Odpri e-pošto"</string>
- <string name="email_desc" msgid="6941280589171810022">"Pošlji e-poštno sporočilo na izbrani naslov"</string>
- <string name="dial" msgid="7317293545368448453">"Pokliči"</string>
- <string name="dial_desc" msgid="5129451396208040332">"Pokliči izbrano telefonsko številko"</string>
- <string name="browse" msgid="3733970143542020945">"Odpri"</string>
- <string name="browse_desc" msgid="3898254913938219011">"Odpri izbrani URL"</string>
- <string name="sms" msgid="5495416906312064886">"Pošlji SMS"</string>
- <string name="sms_desc" msgid="8293660783374489324">"Pošlji SMS na izbrano telefonsko številko"</string>
- <string name="add_contact" msgid="9005634177208282449">"Dodaj"</string>
- <string name="add_contact_desc" msgid="2475604767309086575">"Dodaj med stike"</string>
+ <string name="email" msgid="5568050657313893478">"E-pošta"</string>
+ <string name="email_desc" msgid="6941280589171810022">"Pošiljanje e-poštnega sporočila na izbrani naslov"</string>
+ <string name="dial" msgid="7317293545368448453">"Telefonski klic"</string>
+ <string name="dial_desc" msgid="5129451396208040332">"Klic izbrane telefonske številke"</string>
+ <string name="browse" msgid="3733970143542020945">"Odpiranje"</string>
+ <string name="browse_desc" msgid="3898254913938219011">"Odpiranje izbranega URL-ja"</string>
+ <string name="sms" msgid="5495416906312064886">"Sporočilo"</string>
+ <string name="sms_desc" msgid="8293660783374489324">"Pošiljanje sporočila na izbrano telefonsko številko"</string>
+ <string name="add_contact" msgid="9005634177208282449">"Dodajanje"</string>
+ <string name="add_contact_desc" msgid="2475604767309086575">"Dodajanje med stike"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"Več možnosti"</string>
<string name="floating_toolbar_close_overflow_description" msgid="6243666280435354232">"Zapiranje dodatnih elementov"</string>
<string name="abc_share" msgid="7091841667818715717">"Skup. raba"</string>
diff --git a/textclassifier/src/main/res/values-sq/strings.xml b/textclassifier/src/main/res/values-sq/strings.xml
index 90f6619..2735efc 100644
--- a/textclassifier/src/main/res/values-sq/strings.xml
+++ b/textclassifier/src/main/res/values-sq/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Dërgo email"</string>
+ <string name="email" msgid="5568050657313893478">"Email"</string>
<string name="email_desc" msgid="6941280589171810022">"Dërgo email tek adresa e zgjedhur"</string>
<string name="dial" msgid="7317293545368448453">"Telefono"</string>
<string name="dial_desc" msgid="5129451396208040332">"Telefono në numrin e zgjedhur të telefonit"</string>
<string name="browse" msgid="3733970143542020945">"Hap"</string>
<string name="browse_desc" msgid="3898254913938219011">"Hap URL-në e zgjedhur"</string>
- <string name="sms" msgid="5495416906312064886">"Dërgo mesazh"</string>
+ <string name="sms" msgid="5495416906312064886">"Mesazh"</string>
<string name="sms_desc" msgid="8293660783374489324">"Dërgo mesazh te numri i zgjedhur i telefonit"</string>
<string name="add_contact" msgid="9005634177208282449">"Shto"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Shto te kontaktet"</string>
diff --git a/textclassifier/src/main/res/values-sv/strings.xml b/textclassifier/src/main/res/values-sv/strings.xml
index 8a677c4..483a79f 100644
--- a/textclassifier/src/main/res/values-sv/strings.xml
+++ b/textclassifier/src/main/res/values-sv/strings.xml
@@ -16,7 +16,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Skicka e-post"</string>
+ <string name="email" msgid="5568050657313893478">"E-post"</string>
<string name="email_desc" msgid="6941280589171810022">"Skicka e-post till vald adress"</string>
<string name="dial" msgid="7317293545368448453">"Ring"</string>
<string name="dial_desc" msgid="5129451396208040332">"Ring valt telefonnummer"</string>
diff --git a/textclassifier/src/main/res/values-sw/strings.xml b/textclassifier/src/main/res/values-sw/strings.xml
index e940614..0171aa6 100644
--- a/textclassifier/src/main/res/values-sw/strings.xml
+++ b/textclassifier/src/main/res/values-sw/strings.xml
@@ -16,9 +16,9 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Tuma barua pepe"</string>
+ <string name="email" msgid="5568050657313893478">"Barua pepe"</string>
<string name="email_desc" msgid="6941280589171810022">"Tuma barua pepe kwa anwani uliyochagua"</string>
- <string name="dial" msgid="7317293545368448453">"Piga simu"</string>
+ <string name="dial" msgid="7317293545368448453">"Simu"</string>
<string name="dial_desc" msgid="5129451396208040332">"Piga simu kwa nambari uliyochagua"</string>
<string name="browse" msgid="3733970143542020945">"Fungua"</string>
<string name="browse_desc" msgid="3898254913938219011">"Fungua URL uliyochagua"</string>
diff --git a/textclassifier/src/main/res/values-ta/strings.xml b/textclassifier/src/main/res/values-ta/strings.xml
index c90ac79..4f3123b 100644
--- a/textclassifier/src/main/res/values-ta/strings.xml
+++ b/textclassifier/src/main/res/values-ta/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"மின்னஞ்சல் அனுப்பு"</string>
+ <string name="email" msgid="5568050657313893478">"மின்னஞ்சல்"</string>
<string name="email_desc" msgid="6941280589171810022">"தேர்ந்தெடுத்த முகவரிக்கு மின்னஞ்சலை அனுப்பும்"</string>
<string name="dial" msgid="7317293545368448453">"அழை"</string>
<string name="dial_desc" msgid="5129451396208040332">"தேர்ந்தெடுத்த ஃபோன் எண்ணை அழைக்கும்"</string>
<string name="browse" msgid="3733970143542020945">"திற"</string>
<string name="browse_desc" msgid="3898254913938219011">"தேர்ந்தெடுத்த URLலைத் திறக்கும்"</string>
- <string name="sms" msgid="5495416906312064886">"செய்தி அனுப்பு"</string>
+ <string name="sms" msgid="5495416906312064886">"மெசேஜ்"</string>
<string name="sms_desc" msgid="8293660783374489324">"தேர்ந்தெடுத்த ஃபோன் எண்ணிற்கு மெசேஜ் அனுப்பும்"</string>
<string name="add_contact" msgid="9005634177208282449">"சேர்"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"தொடர்புகளில் சேர்க்கும்"</string>
diff --git a/textclassifier/src/main/res/values-te/strings.xml b/textclassifier/src/main/res/values-te/strings.xml
index 25e41ff..4adcfbf 100644
--- a/textclassifier/src/main/res/values-te/strings.xml
+++ b/textclassifier/src/main/res/values-te/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"ఇమెయిల్ పంపు"</string>
+ <string name="email" msgid="5568050657313893478">"ఇమెయిల్"</string>
<string name="email_desc" msgid="6941280589171810022">"ఎంచుకున్న చిరునామాకు ఇమెయిల్ను పంపుతుంది"</string>
- <string name="dial" msgid="7317293545368448453">"కాల్ చేయి"</string>
+ <string name="dial" msgid="7317293545368448453">"కాల్"</string>
<string name="dial_desc" msgid="5129451396208040332">"ఎంచుకున్న ఫోన్ నంబర్కు కాల్ చేస్తుంది"</string>
<string name="browse" msgid="3733970143542020945">"తెరువు"</string>
<string name="browse_desc" msgid="3898254913938219011">"ఎంచుకున్న URLని తెరుస్తుంది"</string>
- <string name="sms" msgid="5495416906312064886">"సందేశం పంపు"</string>
+ <string name="sms" msgid="5495416906312064886">"సందేశం"</string>
<string name="sms_desc" msgid="8293660783374489324">"ఎంచుకున్న ఫోన్ నంబర్కి సందేశం పంపుతుంది"</string>
<string name="add_contact" msgid="9005634177208282449">"జోడించు"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"పరిచయాలకు జోడిస్తుంది"</string>
diff --git a/textclassifier/src/main/res/values-tl/strings.xml b/textclassifier/src/main/res/values-tl/strings.xml
index f75b004..734524e 100644
--- a/textclassifier/src/main/res/values-tl/strings.xml
+++ b/textclassifier/src/main/res/values-tl/strings.xml
@@ -16,14 +16,14 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Mag-email"</string>
- <string name="email_desc" msgid="6941280589171810022">"Mag-email sa piniling address"</string>
- <string name="dial" msgid="7317293545368448453">"Tumawag"</string>
- <string name="dial_desc" msgid="5129451396208040332">"Tawagan ang piniling numero ng telepono"</string>
+ <string name="email" msgid="5568050657313893478">"Email"</string>
+ <string name="email_desc" msgid="6941280589171810022">"Mag-email sa napiling address"</string>
+ <string name="dial" msgid="7317293545368448453">"Tawag"</string>
+ <string name="dial_desc" msgid="5129451396208040332">"Tawagan ang napiling numero ng telepono"</string>
<string name="browse" msgid="3733970143542020945">"Buksan"</string>
- <string name="browse_desc" msgid="3898254913938219011">"Buksan ang piniling URL"</string>
- <string name="sms" msgid="5495416906312064886">"Magmensahe"</string>
- <string name="sms_desc" msgid="8293660783374489324">"Padalhan ng mensahe ang piniling numero ng telepono"</string>
+ <string name="browse_desc" msgid="3898254913938219011">"Buksan ang napiling URL"</string>
+ <string name="sms" msgid="5495416906312064886">"Mensahe"</string>
+ <string name="sms_desc" msgid="8293660783374489324">"Padalhan ng mensahe ang napiling numero ng telepono"</string>
<string name="add_contact" msgid="9005634177208282449">"Magdagdag"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Idagdag sa mga contact"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"Higit pang opsyon"</string>
diff --git a/textclassifier/src/main/res/values-tr/strings.xml b/textclassifier/src/main/res/values-tr/strings.xml
index 044d43f..be12836 100644
--- a/textclassifier/src/main/res/values-tr/strings.xml
+++ b/textclassifier/src/main/res/values-tr/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="email" msgid="5568050657313893478">"E-posta"</string>
<string name="email_desc" msgid="6941280589171810022">"Seçilen adrese e-posta gönder"</string>
- <string name="dial" msgid="7317293545368448453">"Telefon et"</string>
+ <string name="dial" msgid="7317293545368448453">"Ara"</string>
<string name="dial_desc" msgid="5129451396208040332">"Seçilen telefon numarasını ara"</string>
<string name="browse" msgid="3733970143542020945">"Aç"</string>
<string name="browse_desc" msgid="3898254913938219011">"Seçilen URL\'yi aç"</string>
diff --git a/textclassifier/src/main/res/values-uk/strings.xml b/textclassifier/src/main/res/values-uk/strings.xml
index a40df77..241021a 100644
--- a/textclassifier/src/main/res/values-uk/strings.xml
+++ b/textclassifier/src/main/res/values-uk/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"Написати лист"</string>
+ <string name="email" msgid="5568050657313893478">"Електронна адреса"</string>
<string name="email_desc" msgid="6941280589171810022">"Надіслати електронний лист на вибрану адресу"</string>
- <string name="dial" msgid="7317293545368448453">"Телефонувати"</string>
- <string name="dial_desc" msgid="5129451396208040332">"Телефонувати за вибраним номером"</string>
+ <string name="dial" msgid="7317293545368448453">"Виклик"</string>
+ <string name="dial_desc" msgid="5129451396208040332">"Набрати вибраний номер телефону"</string>
<string name="browse" msgid="3733970143542020945">"Відкрити"</string>
<string name="browse_desc" msgid="3898254913938219011">"Відкрити вибрану URL-адресу"</string>
- <string name="sms" msgid="5495416906312064886">"Написати SMS"</string>
+ <string name="sms" msgid="5495416906312064886">"Повідомлення"</string>
<string name="sms_desc" msgid="8293660783374489324">"Надіслати повідомлення за вибраним номером телефону"</string>
<string name="add_contact" msgid="9005634177208282449">"Додати"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Додати в контакти"</string>
diff --git a/textclassifier/src/main/res/values-ur/strings.xml b/textclassifier/src/main/res/values-ur/strings.xml
index acdb424..55b2e6d 100644
--- a/textclassifier/src/main/res/values-ur/strings.xml
+++ b/textclassifier/src/main/res/values-ur/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"ای میل بھیجیں"</string>
+ <string name="email" msgid="5568050657313893478">"ای میل"</string>
<string name="email_desc" msgid="6941280589171810022">"منتخب کردہ پتے پر ای میل کریں"</string>
- <string name="dial" msgid="7317293545368448453">"کال کریں"</string>
+ <string name="dial" msgid="7317293545368448453">"کال"</string>
<string name="dial_desc" msgid="5129451396208040332">"منتخب کردہ فون نمبر پر کال کریں"</string>
<string name="browse" msgid="3733970143542020945">"کھولیں"</string>
<string name="browse_desc" msgid="3898254913938219011">"منتخب کردہ URL کھولیں"</string>
- <string name="sms" msgid="5495416906312064886">"پیغام بھیجیں"</string>
+ <string name="sms" msgid="5495416906312064886">"پیغام"</string>
<string name="sms_desc" msgid="8293660783374489324">"منتخب کردہ فون نمبر پر پیغام بھیجیں"</string>
<string name="add_contact" msgid="9005634177208282449">"شامل کریں"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"رابطوں میں شامل کریں"</string>
diff --git a/textclassifier/src/main/res/values-uz/strings.xml b/textclassifier/src/main/res/values-uz/strings.xml
index 3f6b781..74d563d 100644
--- a/textclassifier/src/main/res/values-uz/strings.xml
+++ b/textclassifier/src/main/res/values-uz/strings.xml
@@ -17,14 +17,14 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="email" msgid="5568050657313893478">"E-pochta"</string>
- <string name="email_desc" msgid="6941280589171810022">"Belgilangan e-pochta manziliga xat yuborish"</string>
+ <string name="email_desc" msgid="6941280589171810022">"Belgilangan manzilga xat yuborish"</string>
<string name="dial" msgid="7317293545368448453">"Chaqiruv"</string>
<string name="dial_desc" msgid="5129451396208040332">"Belgilangan raqamga telefon qilish"</string>
<string name="browse" msgid="3733970143542020945">"Ochish"</string>
<string name="browse_desc" msgid="3898254913938219011">"Belgilangan URL manzilini ochish"</string>
- <string name="sms" msgid="5495416906312064886">"SMS yozish"</string>
+ <string name="sms" msgid="5495416906312064886">"Xabar"</string>
<string name="sms_desc" msgid="8293660783374489324">"Belgilangan telefon raqamiga SMS yuborish"</string>
- <string name="add_contact" msgid="9005634177208282449">"Saqlab olish"</string>
+ <string name="add_contact" msgid="9005634177208282449">"Qo‘shish"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"Kontaktlarga saqlash"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"Yana"</string>
<string name="floating_toolbar_close_overflow_description" msgid="6243666280435354232">"Qalqib turuvchi asboblar panelini yopish"</string>
diff --git a/textclassifier/src/main/res/values-zh-rCN/strings.xml b/textclassifier/src/main/res/values-zh-rCN/strings.xml
index afa89ca..a990409 100644
--- a/textclassifier/src/main/res/values-zh-rCN/strings.xml
+++ b/textclassifier/src/main/res/values-zh-rCN/strings.xml
@@ -16,13 +16,13 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"发送电子邮件"</string>
+ <string name="email" msgid="5568050657313893478">"电子邮件"</string>
<string name="email_desc" msgid="6941280589171810022">"将电子邮件发送至所选地址"</string>
<string name="dial" msgid="7317293545368448453">"通话"</string>
<string name="dial_desc" msgid="5129451396208040332">"拨打所选电话号码"</string>
<string name="browse" msgid="3733970143542020945">"打开"</string>
<string name="browse_desc" msgid="3898254913938219011">"打开所选网址"</string>
- <string name="sms" msgid="5495416906312064886">"发短信"</string>
+ <string name="sms" msgid="5495416906312064886">"短信"</string>
<string name="sms_desc" msgid="8293660783374489324">"将短信发送至所选电话号码"</string>
<string name="add_contact" msgid="9005634177208282449">"添加"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"添加到通讯录"</string>
diff --git a/textclassifier/src/main/res/values-zh-rHK/strings.xml b/textclassifier/src/main/res/values-zh-rHK/strings.xml
index 2ada5ec..946fd6c 100644
--- a/textclassifier/src/main/res/values-zh-rHK/strings.xml
+++ b/textclassifier/src/main/res/values-zh-rHK/strings.xml
@@ -22,7 +22,7 @@
<string name="dial_desc" msgid="5129451396208040332">"打指定嘅電話號碼"</string>
<string name="browse" msgid="3733970143542020945">"開啟"</string>
<string name="browse_desc" msgid="3898254913938219011">"打開指定網址"</string>
- <string name="sms" msgid="5495416906312064886">"發短訊"</string>
+ <string name="sms" msgid="5495416906312064886">"訊息"</string>
<string name="sms_desc" msgid="8293660783374489324">"傳短訊去指定電話號碼"</string>
<string name="add_contact" msgid="9005634177208282449">"新增"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"加入聯絡人"</string>
diff --git a/textclassifier/src/main/res/values-zh-rTW/strings.xml b/textclassifier/src/main/res/values-zh-rTW/strings.xml
index d2bd3ab..4fc184f 100644
--- a/textclassifier/src/main/res/values-zh-rTW/strings.xml
+++ b/textclassifier/src/main/res/values-zh-rTW/strings.xml
@@ -16,14 +16,14 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="email" msgid="5568050657313893478">"發送電子郵件"</string>
- <string name="email_desc" msgid="6941280589171810022">"將電子郵件寄到選取的地址"</string>
- <string name="dial" msgid="7317293545368448453">"撥號通話"</string>
- <string name="dial_desc" msgid="5129451396208040332">"撥打選取的電話號碼"</string>
+ <string name="email" msgid="5568050657313893478">"電子郵件"</string>
+ <string name="email_desc" msgid="6941280589171810022">"將電子郵件寄到所選地址"</string>
+ <string name="dial" msgid="7317293545368448453">"撥號"</string>
+ <string name="dial_desc" msgid="5129451396208040332">"撥打所選電話號碼"</string>
<string name="browse" msgid="3733970143542020945">"開啟"</string>
- <string name="browse_desc" msgid="3898254913938219011">"開啟選取的網址"</string>
- <string name="sms" msgid="5495416906312064886">"發送訊息"</string>
- <string name="sms_desc" msgid="8293660783374489324">"將訊息傳送到選取的電話號碼"</string>
+ <string name="browse_desc" msgid="3898254913938219011">"開啟所選網址"</string>
+ <string name="sms" msgid="5495416906312064886">"訊息"</string>
+ <string name="sms_desc" msgid="8293660783374489324">"將訊息傳送到所選電話號碼"</string>
<string name="add_contact" msgid="9005634177208282449">"新增"</string>
<string name="add_contact_desc" msgid="2475604767309086575">"新增至聯絡人"</string>
<string name="floating_toolbar_open_overflow_description" msgid="1187148927509077545">"更多選項"</string>
diff --git a/transition/api/1.0.0.txt b/transition/api/1.0.0.txt
index 9aa7a9a..dfbdb55 100644
--- a/transition/api/1.0.0.txt
+++ b/transition/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.transition {
public class ArcMotion extends androidx.transition.PathMotion {
diff --git a/transition/api/1.1.0-alpha01.txt b/transition/api/1.1.0-alpha01.txt
index 2a91937..62fcf63 100644
--- a/transition/api/1.1.0-alpha01.txt
+++ b/transition/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.transition {
public class ArcMotion extends androidx.transition.PathMotion {
diff --git a/transition/api/1.1.0-alpha02.txt b/transition/api/1.1.0-alpha02.txt
index 86a584c..b834b25 100644
--- a/transition/api/1.1.0-alpha02.txt
+++ b/transition/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.transition {
public class ArcMotion extends androidx.transition.PathMotion {
diff --git a/transition/api/current.txt b/transition/api/current.txt
index 86a584c..b834b25 100644
--- a/transition/api/current.txt
+++ b/transition/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.transition {
public class ArcMotion extends androidx.transition.PathMotion {
diff --git a/transition/api/restricted_1.0.0.txt b/transition/api/restricted_1.0.0.txt
deleted file mode 100644
index 4814c03..0000000
--- a/transition/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-// Signature format: 3.0
-package androidx.transition {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class FragmentTransitionSupport {
- ctor public FragmentTransitionSupport();
- method public void addTarget(Object!, android.view.View!);
- method public void addTargets(Object!, java.util.ArrayList<android.view.View>!);
- method public void beginDelayedTransition(android.view.ViewGroup!, Object!);
- method public boolean canHandle(Object!);
- method public Object! cloneTransition(Object!);
- method public Object! mergeTransitionsInSequence(Object!, Object!, Object!);
- method public Object! mergeTransitionsTogether(Object!, Object!, Object!);
- method public void removeTarget(Object!, android.view.View!);
- method public void replaceTargets(Object!, java.util.ArrayList<android.view.View>!, java.util.ArrayList<android.view.View>!);
- method public void scheduleHideFragmentView(Object!, android.view.View!, java.util.ArrayList<android.view.View>!);
- method public void scheduleRemoveTargets(Object!, Object!, java.util.ArrayList<android.view.View>!, Object!, java.util.ArrayList<android.view.View>!, Object!, java.util.ArrayList<android.view.View>!);
- method public void setEpicenter(Object!, android.view.View!);
- method public void setEpicenter(Object!, android.graphics.Rect!);
- method public void setSharedElementTargets(Object!, android.view.View!, java.util.ArrayList<android.view.View>!);
- method public void swapSharedElementTargets(Object!, java.util.ArrayList<android.view.View>!, java.util.ArrayList<android.view.View>!);
- method public Object! wrapTransitionInSet(Object!);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface Slide.GravityFlag {
- }
-
- public abstract class Transition {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void animate(android.animation.Animator!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void cancel();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void createAnimators(android.view.ViewGroup!, androidx.transition.TransitionValuesMaps!, androidx.transition.TransitionValuesMaps!, java.util.ArrayList<androidx.transition.TransitionValues>!, java.util.ArrayList<androidx.transition.TransitionValues>!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void end();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void pause(android.view.View!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void resume(android.view.View!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void runAnimators();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void start();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface Transition.MatchOrder {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface Visibility.Mode {
- }
-
-}
-
diff --git a/transition/build.gradle b/transition/build.gradle
index 04e5dfa..61f7c27 100644
--- a/transition/build.gradle
+++ b/transition/build.gradle
@@ -7,9 +7,8 @@
}
dependencies {
- api(project(":annotation"))
+ api("androidx.annotation:annotation:1.0.0")
api(project(":core"))
- implementation(project(":collection"))
compileOnly project(':fragment')
androidTestImplementation(TEST_EXT_JUNIT)
@@ -40,5 +39,4 @@
inceptionYear = "2016"
description = "Android Transition Support Library"
failOnDeprecationWarnings = false
- trackRestrictedAPIs = false
}
diff --git a/transition/src/androidTest/java/androidx/transition/ChangeBoundsTest.java b/transition/src/androidTest/java/androidx/transition/ChangeBoundsTest.java
index 8aba64f..c438bc2 100644
--- a/transition/src/androidTest/java/androidx/transition/ChangeBoundsTest.java
+++ b/transition/src/androidTest/java/androidx/transition/ChangeBoundsTest.java
@@ -30,14 +30,14 @@
import androidx.annotation.NonNull;
import androidx.test.annotation.UiThreadTest;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.transition.test.R;
import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
import org.junit.Test;
-@LargeTest
+@MediumTest
public class ChangeBoundsTest extends BaseTransitionTest {
@Override
diff --git a/transition/src/androidTest/java/androidx/transition/ChangeClipBoundsTest.java b/transition/src/androidTest/java/androidx/transition/ChangeClipBoundsTest.java
index 5c3cce8..bd4f8d1 100644
--- a/transition/src/androidTest/java/androidx/transition/ChangeClipBoundsTest.java
+++ b/transition/src/androidTest/java/androidx/transition/ChangeClipBoundsTest.java
@@ -30,13 +30,13 @@
import android.view.View;
import androidx.core.view.ViewCompat;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
import org.junit.Test;
import org.mockito.ArgumentMatcher;
-@LargeTest
+@MediumTest
public class ChangeClipBoundsTest extends BaseTransitionTest {
@Override
diff --git a/transition/src/androidTest/java/androidx/transition/ChangeImageTransformTest.java b/transition/src/androidTest/java/androidx/transition/ChangeImageTransformTest.java
index c053d88..4b2b8f9 100644
--- a/transition/src/androidTest/java/androidx/transition/ChangeImageTransformTest.java
+++ b/transition/src/androidTest/java/androidx/transition/ChangeImageTransformTest.java
@@ -41,7 +41,7 @@
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.transition.test.R;
@@ -50,7 +50,7 @@
import javax.annotation.Nullable;
-@LargeTest
+@MediumTest
public class ChangeImageTransformTest extends BaseTransitionTest {
private ChangeImageTransform mChangeImageTransform;
diff --git a/transition/src/androidTest/java/androidx/transition/ChangeScrollTest.java b/transition/src/androidTest/java/androidx/transition/ChangeScrollTest.java
index dfc96f3..bb2ea97 100644
--- a/transition/src/androidTest/java/androidx/transition/ChangeScrollTest.java
+++ b/transition/src/androidTest/java/androidx/transition/ChangeScrollTest.java
@@ -26,13 +26,13 @@
import android.widget.TextView;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.transition.test.R;
import org.junit.Test;
-@LargeTest
+@MediumTest
public class ChangeScrollTest extends BaseTransitionTest {
@Override
diff --git a/transition/src/androidTest/java/androidx/transition/ChangeTransformTest.java b/transition/src/androidTest/java/androidx/transition/ChangeTransformTest.java
index 45e509e..fa3d792 100644
--- a/transition/src/androidTest/java/androidx/transition/ChangeTransformTest.java
+++ b/transition/src/androidTest/java/androidx/transition/ChangeTransformTest.java
@@ -23,12 +23,12 @@
import android.view.View;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.transition.test.R;
import org.junit.Test;
-@LargeTest
+@MediumTest
public class ChangeTransformTest extends BaseTransitionTest {
@Override
diff --git a/transition/src/androidTest/java/androidx/transition/ExplodeTest.java b/transition/src/androidTest/java/androidx/transition/ExplodeTest.java
index ccba05f..d402a8b 100644
--- a/transition/src/androidTest/java/androidx/transition/ExplodeTest.java
+++ b/transition/src/androidTest/java/androidx/transition/ExplodeTest.java
@@ -36,8 +36,6 @@
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
import org.mockito.verification.VerificationMode;
@LargeTest
@@ -82,8 +80,8 @@
});
}
- @Ignore("Temporarily disabled due to b/112005299")
- @Test
+ // Temporarily disabled due to b/118137165.
+ // @Test
public void testExplode() throws Throwable {
rule.runOnUiThread(new Runnable() {
@Override
@@ -117,8 +115,8 @@
assertEquals(View.INVISIBLE, mYellowSquare.getVisibility());
}
- @Ignore("Temporarily disabled due to b/112005299")
- @Test
+ // Temporarily disabled due to b/112005299.
+ // @Test
public void testImplode() throws Throwable {
rule.runOnUiThread(new Runnable() {
@Override
diff --git a/transition/src/androidTest/java/androidx/transition/FadeTest.java b/transition/src/androidTest/java/androidx/transition/FadeTest.java
index d04e555..9dc373e 100644
--- a/transition/src/androidTest/java/androidx/transition/FadeTest.java
+++ b/transition/src/androidTest/java/androidx/transition/FadeTest.java
@@ -41,7 +41,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.test.annotation.UiThreadTest;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.transition.test.R;
@@ -49,7 +49,7 @@
import org.junit.Test;
-@LargeTest
+@MediumTest
public class FadeTest extends BaseTest {
private View mView;
diff --git a/transition/src/androidTest/java/androidx/transition/GhostViewTest.java b/transition/src/androidTest/java/androidx/transition/GhostViewTest.java
deleted file mode 100644
index a405458..0000000
--- a/transition/src/androidTest/java/androidx/transition/GhostViewTest.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Copyright 2019 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.transition;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertTrue;
-
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.Matrix;
-import android.graphics.Rect;
-import android.graphics.drawable.ColorDrawable;
-import android.os.Build;
-import android.os.Handler;
-import android.os.Looper;
-import android.view.PixelCopy;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewTreeObserver;
-import android.widget.FrameLayout;
-
-import androidx.test.annotation.UiThreadTest;
-import androidx.test.filters.MediumTest;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-@MediumTest
-public class GhostViewTest extends BaseTest {
-
- private static final int SIZE = 50;
-
- Context mContext;
- ViewGroup mRoot;
-
- @UiThreadTest
- @Before
- public void setUp() {
- mContext = rule.getActivity();
- mRoot = new FrameLayout(mContext);
- rule.getActivity().getRoot().addView(mRoot, new ViewGroup.LayoutParams(SIZE, SIZE));
- rule.getActivity().getRoot().setBackground(new ColorDrawable(Color.WHITE));
- }
-
- @Test
- public void testAddingViewAsGhost() throws Throwable {
- final FrameLayout parent1 = new FrameLayout(mContext);
- final View view = makeColorView(Color.RED);
- final FrameLayout parent2 = createParent2();
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- parent1.addView(view);
- mRoot.addView(parent1);
- mRoot.addView(parent2);
- }
- });
-
- waitForDraw(view);
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- GhostViewUtils.addGhost(view, parent2, new Matrix());
- }
- });
-
- waitForDraw(parent2);
- assertColor(Color.RED, drawBitmap(parent2));
- }
-
- private FrameLayout createParent2() {
- FrameLayout layout = new FrameLayout(mContext);
- // we need this as overlay port on pre18 works like this:
- // if finds the view with such id's and add overlay group inside
- // with this overlays would be added into the view we want.
- layout.setId(android.R.id.content);
- return layout;
- }
-
- @Test
- public void testMaintainingOriginalViewOrder() throws Throwable {
- final FrameLayout parent1 = new FrameLayout(mContext);
- final View redView = makeColorView(Color.RED);
- final View greenView = makeColorView(Color.GREEN);
- final FrameLayout parent2 = createParent2();
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- parent1.addView(redView);
- parent1.addView(greenView);
- mRoot.addView(parent1);
- mRoot.addView(parent2);
- }
- });
-
- waitForDraw(parent1);
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- GhostViewUtils.addGhost(greenView, parent2, new Matrix());
- GhostViewUtils.addGhost(redView, parent2, new Matrix());
- }
- });
-
- waitForDraw(parent2);
- assertColor(Color.GREEN, drawBitmap(parent2));
- }
-
- @Test
- public void testMaintainingOriginalViewOrderWithCustomOrdering() throws Throwable {
- final FrameLayout parent1 = new ReverseOrderFrameLayout(mContext);
- final View redView = makeColorView(Color.RED);
- final View greenView = makeColorView(Color.GREEN);
- final FrameLayout parent2 = createParent2();
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- parent1.addView(redView);
- parent1.addView(greenView);
- mRoot.addView(parent1);
- mRoot.addView(parent2);
- }
- });
-
- waitForDraw(parent1);
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- GhostViewUtils.addGhost(greenView, parent2, new Matrix());
- GhostViewUtils.addGhost(redView, parent2, new Matrix());
- }
- });
-
- waitForDraw(parent2);
- assertColor(Color.RED, drawBitmap(parent2));
- }
-
- @Test
- public void testMaintainingOriginalViewOrderWithCustomOrderingAndZ() throws Throwable {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
- return; // no Z prior lollipop
- }
- final FrameLayout parent1 = new ReverseOrderFrameLayout(mContext);
- final View redView = makeColorView(Color.RED);
- final View greenView = makeColorView(Color.GREEN);
- greenView.setElevation(10); // it will make greenView drawn on top of redView.
- final FrameLayout parent2 = createParent2();
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- parent1.addView(redView);
- parent1.addView(greenView);
- mRoot.addView(parent1);
- mRoot.addView(parent2);
- }
- });
-
- waitForDraw(parent1);
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- GhostViewUtils.addGhost(greenView, parent2, new Matrix());
- GhostViewUtils.addGhost(redView, parent2, new Matrix());
- }
- });
-
- waitForDraw(parent2);
- assertColor(Color.GREEN, drawBitmap(parent2));
- }
-
- @Test
- public void testPoppingGhostViewsOnTopOfOtherOverlayViews() throws Throwable {
- final FrameLayout parent1 = new FrameLayout(mContext);
- final View redView = makeColorView(Color.RED);
- final View greenView = makeColorView(Color.GREEN);
-
- final FrameLayout parent2 = createParent2();
-
- final View blueView = makeColorView(Color.BLUE);
-
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- parent1.addView(redView);
- parent1.addView(greenView);
- parent1.addView(blueView);
- mRoot.addView(parent1);
- mRoot.addView(parent2);
- }
- });
-
- waitForDraw(parent1);
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- GhostViewUtils.addGhost(greenView, parent2, new Matrix());
- ViewGroupUtils.getOverlay(parent2).add(blueView);
- GhostViewUtils.addGhost(redView, parent2, new Matrix());
- GhostViewUtils.removeGhost(redView);
- }
- });
-
- waitForDraw(parent2);
- assertColor(Color.GREEN, drawBitmap(parent2));
- }
-
- @Test
- public void testGhostViewDrawsWithShadow() throws Throwable {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
- return; // no shadows prior lollipop
- }
- final FrameLayout parent1 = new FrameLayout(mContext);
- final View shadowView = new View(mContext);
- final FrameLayout parent2 = createParent2();
- shadowView.setElevation(1000);
-
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- parent1.addView(shadowView, new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT, 1));
- mRoot.addView(parent1);
- mRoot.addView(parent2);
- }
- });
-
- waitForDraw(shadowView);
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- parent1.setVisibility(View.INVISIBLE);
- GhostViewUtils.addGhost(shadowView, parent2, new Matrix());
- }
- });
-
- waitForDraw(parent2);
- Bitmap bitmap = drawBitmap(parent2);
- int color = bitmap.getPixel(bitmap.getWidth() / 2, 3);
- assertNotEquals(Color.WHITE, color); // we have a shadow if the pixel is not white
- }
-
- private View makeColorView(int color) {
- View view = new View(mContext);
- view.setBackground(new ColorDrawable(color));
- return view;
- }
-
- private void assertColor(final int color, final Bitmap bitmap) {
- assertEquals(color, bitmap.getPixel(bitmap.getWidth() / 2, bitmap.getHeight() / 2));
- }
-
- private Bitmap drawBitmap(final ViewGroup view) throws Throwable {
- int width = view.getWidth();
- int height = view.getHeight();
- final Bitmap dest = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
- final CountDownLatch latch = new CountDownLatch(1);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- int[] offset = new int[2];
- view.getLocationInWindow(offset);
- Rect srcRect = new Rect(0, 0, width, height);
- srcRect.offset(offset[0], offset[1]);
- PixelCopy.OnPixelCopyFinishedListener onCopyFinished =
- new PixelCopy.OnPixelCopyFinishedListener() {
- @Override
- public void onPixelCopyFinished(int copyResult) {
- assertEquals(PixelCopy.SUCCESS, copyResult);
- latch.countDown();
- }
-
- };
- PixelCopy.request(rule.getActivity().getWindow(), srcRect, dest, onCopyFinished,
- new Handler(Looper.getMainLooper()));
- } else {
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- view.draw(new Canvas(dest));
- latch.countDown();
- }
- });
- }
- assertTrue(latch.await(1, TimeUnit.SECONDS));
- return dest;
- }
-
- private void waitForDraw(final View view) throws Throwable {
- final CountDownLatch latch = new CountDownLatch(1);
- rule.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- view.getViewTreeObserver().addOnPreDrawListener(
- new ViewTreeObserver.OnPreDrawListener() {
- @Override
- public boolean onPreDraw() {
- view.getViewTreeObserver().removeOnPreDrawListener(this);
- latch.countDown();
- return true;
- }
- });
- view.invalidate();
- }
- });
- assertTrue(latch.await(1, TimeUnit.SECONDS));
- }
-
- private class ReverseOrderFrameLayout extends FrameLayout {
-
- private ReverseOrderFrameLayout(Context context) {
- super(context);
- setChildrenDrawingOrderEnabled(true);
- }
-
- @Override
- protected int getChildDrawingOrder(int childCount, int i) {
- return childCount - i - 1;
- }
- }
-}
diff --git a/transition/src/androidTest/java/androidx/transition/SceneTest.java b/transition/src/androidTest/java/androidx/transition/SceneTest.java
index 61f1fd6..fa02615 100644
--- a/transition/src/androidTest/java/androidx/transition/SceneTest.java
+++ b/transition/src/androidTest/java/androidx/transition/SceneTest.java
@@ -25,12 +25,12 @@
import android.widget.FrameLayout;
import androidx.test.annotation.UiThreadTest;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.transition.test.R;
import org.junit.Test;
-@SmallTest
+@MediumTest
public class SceneTest extends BaseTransitionTest {
@Test
diff --git a/transition/src/androidTest/java/androidx/transition/SlideEdgeTest.java b/transition/src/androidTest/java/androidx/transition/SlideEdgeTest.java
index 8207905..6340f57 100644
--- a/transition/src/androidTest/java/androidx/transition/SlideEdgeTest.java
+++ b/transition/src/androidTest/java/androidx/transition/SlideEdgeTest.java
@@ -35,14 +35,14 @@
import androidx.core.util.Pair;
import androidx.test.filters.LargeTest;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Test;
import java.util.ArrayList;
-@SmallTest
+@MediumTest
public class SlideEdgeTest extends BaseTransitionTest {
private static final ArrayList<Pair<Integer, String>> SLIDE_EDGES = new ArrayList<>();
diff --git a/transition/src/androidTest/java/androidx/transition/TransitionSetTest.java b/transition/src/androidTest/java/androidx/transition/TransitionSetTest.java
index dfcb088..3a74d8f 100644
--- a/transition/src/androidTest/java/androidx/transition/TransitionSetTest.java
+++ b/transition/src/androidTest/java/androidx/transition/TransitionSetTest.java
@@ -33,13 +33,13 @@
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.transition.test.R;
import org.junit.Before;
import org.junit.Test;
-@SmallTest
+@MediumTest
public class TransitionSetTest extends BaseTest {
private final TransitionSet mTransitionSet = new TransitionSet();
diff --git a/transition/src/androidTest/java/androidx/transition/TranslationAnimationCreatorTest.java b/transition/src/androidTest/java/androidx/transition/TranslationAnimationCreatorTest.java
index 976277a..6620ad3 100644
--- a/transition/src/androidTest/java/androidx/transition/TranslationAnimationCreatorTest.java
+++ b/transition/src/androidTest/java/androidx/transition/TranslationAnimationCreatorTest.java
@@ -25,12 +25,12 @@
import android.view.animation.LinearInterpolator;
import androidx.test.annotation.UiThreadTest;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
-@LargeTest
+@SmallTest
public class TranslationAnimationCreatorTest extends BaseTest {
@Test
diff --git a/transition/src/main/java/androidx/transition/CanvasUtils.java b/transition/src/main/java/androidx/transition/CanvasUtils.java
deleted file mode 100644
index 4e6ac36..0000000
--- a/transition/src/main/java/androidx/transition/CanvasUtils.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2019 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.transition;
-
-import android.graphics.Canvas;
-import android.os.Build;
-
-import androidx.annotation.NonNull;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-class CanvasUtils {
-
- private static Method sReorderBarrierMethod;
- private static Method sInorderBarrierMethod;
- private static boolean sOrderMethodsFetched;
-
- /**
- * Enables Z support for the Canvas.
- *
- * IMPORTANT: This method doesn't work on Pie! It will thrown an exception instead
- */
- static void enableZ(@NonNull Canvas canvas, boolean enable) {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
- // no shadows yet added into a platform
- } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
- throw new IllegalStateException("This method doesn't work on Pie!");
- } else {
- if (!sOrderMethodsFetched) {
- try {
- sReorderBarrierMethod = Canvas.class.getDeclaredMethod(
- "insertReorderBarrier");
- sReorderBarrierMethod.setAccessible(true);
- sInorderBarrierMethod = Canvas.class.getDeclaredMethod(
- "insertInorderBarrier");
- sInorderBarrierMethod.setAccessible(true);
- } catch (NoSuchMethodException ignore) {
- // Do nothing
- }
- sOrderMethodsFetched = true;
- }
- try {
- if (enable && sReorderBarrierMethod != null) {
- sReorderBarrierMethod.invoke(canvas);
- }
- if (!enable && sInorderBarrierMethod != null) {
- sInorderBarrierMethod.invoke(canvas);
- }
- } catch (IllegalAccessException ignore) {
- // Do nothing
- } catch (InvocationTargetException e) {
- throw new RuntimeException(e.getCause());
- }
- }
- }
-
- private CanvasUtils() {
- }
-}
diff --git a/transition/src/main/java/androidx/transition/ChangeTransform.java b/transition/src/main/java/androidx/transition/ChangeTransform.java
index dd7acbf..b207a93 100644
--- a/transition/src/main/java/androidx/transition/ChangeTransform.java
+++ b/transition/src/main/java/androidx/transition/ChangeTransform.java
@@ -388,7 +388,7 @@
Matrix localEndMatrix = new Matrix(endMatrix);
ViewUtils.transformMatrixToLocal(sceneRoot, localEndMatrix);
- GhostView ghostView = GhostViewUtils.addGhost(view, sceneRoot, localEndMatrix);
+ GhostViewImpl ghostView = GhostViewUtils.addGhost(view, sceneRoot, localEndMatrix);
if (ghostView == null) {
return;
}
@@ -513,9 +513,9 @@
private static class GhostListener extends TransitionListenerAdapter {
private View mView;
- private GhostView mGhostView;
+ private GhostViewImpl mGhostView;
- GhostListener(View view, GhostView ghostView) {
+ GhostListener(View view, GhostViewImpl ghostView) {
mView = view;
mGhostView = ghostView;
}
diff --git a/transition/src/main/java/androidx/transition/FragmentTransitionSupport.java b/transition/src/main/java/androidx/transition/FragmentTransitionSupport.java
index 41c3e69..5a71f218 100644
--- a/transition/src/main/java/androidx/transition/FragmentTransitionSupport.java
+++ b/transition/src/main/java/androidx/transition/FragmentTransitionSupport.java
@@ -16,7 +16,7 @@
package androidx.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.graphics.Rect;
import android.view.View;
@@ -35,7 +35,7 @@
*/
// This is instantiated in androidx.fragment.app.FragmentTransition
@SuppressWarnings("unused")
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class FragmentTransitionSupport extends FragmentTransitionImpl {
@Override
diff --git a/transition/src/main/java/androidx/transition/GhostView.java b/transition/src/main/java/androidx/transition/GhostView.java
deleted file mode 100644
index cceb2ff..0000000
--- a/transition/src/main/java/androidx/transition/GhostView.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2017 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.transition;
-
-import android.view.View;
-import android.view.ViewGroup;
-
-interface GhostView {
-
- void setVisibility(int visibility);
-
- /**
- * Reserves a call to {@link ViewGroup#endViewTransition(View)} at the time when the GhostView
- * starts drawing its real view.
- */
- void reserveEndViewTransition(ViewGroup viewGroup, View view);
-
-}
diff --git a/transition/src/main/java/androidx/transition/GhostViewApi14.java b/transition/src/main/java/androidx/transition/GhostViewApi14.java
new file mode 100644
index 0000000..fa577d9
--- /dev/null
+++ b/transition/src/main/java/androidx/transition/GhostViewApi14.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright (C) 2017 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.transition;
+
+import android.annotation.SuppressLint;
+import android.graphics.Canvas;
+import android.graphics.Matrix;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.ViewParent;
+import android.view.ViewTreeObserver;
+import android.widget.FrameLayout;
+
+import androidx.annotation.NonNull;
+import androidx.core.view.ViewCompat;
+
+/**
+ * Backport of android.view.GhostView introduced in API level 21.
+ * <p>
+ * While the platform version uses ViewOverlay, this ghost view finds the closest FrameLayout in
+ * the hierarchy and adds itself there.
+ * <p>
+ * Since we cannot use RenderNode to delegate drawing, we instead use {@link View#draw(Canvas)} to
+ * draw the target view. We apply the same transformation matrix applied to the target view. For
+ * that, this view is sized as large as the parent FrameLayout (except padding) while the platform
+ * version becomes as large as the target view.
+ */
+@SuppressLint("ViewConstructor")
+class GhostViewApi14 extends View implements GhostViewImpl {
+
+ static GhostViewImpl addGhost(View view, ViewGroup viewGroup) {
+ GhostViewApi14 ghostView = getGhostView(view);
+ if (ghostView == null) {
+ FrameLayout frameLayout = findFrameLayout(viewGroup);
+ if (frameLayout == null) {
+ return null;
+ }
+ ghostView = new GhostViewApi14(view);
+ frameLayout.addView(ghostView);
+ }
+ ghostView.mReferences++;
+ return ghostView;
+ }
+
+ static void removeGhost(View view) {
+ GhostViewApi14 ghostView = getGhostView(view);
+ if (ghostView != null) {
+ ghostView.mReferences--;
+ if (ghostView.mReferences <= 0) {
+ ViewParent parent = ghostView.getParent();
+ if (parent instanceof ViewGroup) {
+ ViewGroup group = (ViewGroup) parent;
+ group.endViewTransition(ghostView);
+ group.removeView(ghostView);
+ }
+ }
+ }
+ }
+
+ /**
+ * Find the closest FrameLayout in the ascendant hierarchy from the specified {@code
+ * viewGroup}.
+ */
+ private static FrameLayout findFrameLayout(ViewGroup viewGroup) {
+ while (!(viewGroup instanceof FrameLayout)) {
+ ViewParent parent = viewGroup.getParent();
+ if (!(parent instanceof ViewGroup)) {
+ return null;
+ }
+ viewGroup = (ViewGroup) parent;
+ }
+ return (FrameLayout) viewGroup;
+ }
+
+ /** The target view */
+ final View mView;
+
+ /** The parent of the view that is disappearing at the beginning of the animation */
+ ViewGroup mStartParent;
+
+ /** The view that is disappearing at the beginning of the animation */
+ View mStartView;
+
+ /** The number of references to this ghost view */
+ int mReferences;
+
+ /** The horizontal distance from the ghost view to the target view */
+ private int mDeltaX;
+
+ /** The horizontal distance from the ghost view to the target view */
+ private int mDeltaY;
+
+ /** The current transformation matrix of the target view */
+ Matrix mCurrentMatrix;
+
+ /** The matrix applied to the ghost view canvas */
+ private final Matrix mMatrix = new Matrix();
+
+ private final ViewTreeObserver.OnPreDrawListener mOnPreDrawListener =
+ new ViewTreeObserver.OnPreDrawListener() {
+ @Override
+ public boolean onPreDraw() {
+ // The target view was invalidated; get the transformation.
+ mCurrentMatrix = mView.getMatrix();
+ // We draw the view.
+ ViewCompat.postInvalidateOnAnimation(GhostViewApi14.this);
+ if (mStartParent != null && mStartView != null) {
+ mStartParent.endViewTransition(mStartView);
+ ViewCompat.postInvalidateOnAnimation(mStartParent);
+ mStartParent = null;
+ mStartView = null;
+ }
+ return true;
+ }
+ };
+
+ GhostViewApi14(View view) {
+ super(view.getContext());
+ mView = view;
+ setLayerType(LAYER_TYPE_HARDWARE, null);
+ }
+
+ @Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ setGhostView(mView, this);
+ // Calculate the deltas
+ final int[] location = new int[2];
+ final int[] viewLocation = new int[2];
+ getLocationOnScreen(location);
+ mView.getLocationOnScreen(viewLocation);
+ viewLocation[0] = (int) (viewLocation[0] - mView.getTranslationX());
+ viewLocation[1] = (int) (viewLocation[1] - mView.getTranslationY());
+ mDeltaX = viewLocation[0] - location[0];
+ mDeltaY = viewLocation[1] - location[1];
+ // Monitor invalidation of the target view.
+ mView.getViewTreeObserver().addOnPreDrawListener(mOnPreDrawListener);
+ // Make the target view invisible because we draw it instead.
+ mView.setVisibility(INVISIBLE);
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ mView.getViewTreeObserver().removeOnPreDrawListener(mOnPreDrawListener);
+ mView.setVisibility(VISIBLE);
+ setGhostView(mView, null);
+ super.onDetachedFromWindow();
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ // Apply the matrix while adjusting the coordinates
+ mMatrix.set(mCurrentMatrix);
+ mMatrix.postTranslate(mDeltaX, mDeltaY);
+ canvas.setMatrix(mMatrix);
+ // Draw the target
+ mView.draw(canvas);
+ }
+
+ @Override
+ public void setVisibility(int visibility) {
+ super.setVisibility(visibility);
+ mView.setVisibility(visibility == VISIBLE ? INVISIBLE : VISIBLE);
+ }
+
+ @Override
+ public void reserveEndViewTransition(ViewGroup viewGroup, View view) {
+ mStartParent = viewGroup;
+ mStartView = view;
+ }
+
+ private static void setGhostView(@NonNull View view, GhostViewApi14 ghostView) {
+ view.setTag(R.id.ghost_view, ghostView);
+ }
+
+ static GhostViewApi14 getGhostView(@NonNull View view) {
+ return (GhostViewApi14) view.getTag(R.id.ghost_view);
+ }
+
+}
diff --git a/transition/src/main/java/androidx/transition/GhostViewApi21.java b/transition/src/main/java/androidx/transition/GhostViewApi21.java
new file mode 100644
index 0000000..4cf5ae8
--- /dev/null
+++ b/transition/src/main/java/androidx/transition/GhostViewApi21.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2017 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.transition;
+
+import android.graphics.Matrix;
+import android.util.Log;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.RequiresApi;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+@RequiresApi(21)
+class GhostViewApi21 implements GhostViewImpl {
+
+ private static final String TAG = "GhostViewApi21";
+
+ private static Class<?> sGhostViewClass;
+ private static boolean sGhostViewClassFetched;
+ private static Method sAddGhostMethod;
+ private static boolean sAddGhostMethodFetched;
+ private static Method sRemoveGhostMethod;
+ private static boolean sRemoveGhostMethodFetched;
+
+ static GhostViewImpl addGhost(View view, ViewGroup viewGroup, Matrix matrix) {
+ fetchAddGhostMethod();
+ if (sAddGhostMethod != null) {
+ try {
+ return new GhostViewApi21(
+ (View) sAddGhostMethod.invoke(null, view, viewGroup, matrix));
+ } catch (IllegalAccessException e) {
+ // Do nothing
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e.getCause());
+ }
+ }
+ return null;
+ }
+
+ static void removeGhost(View view) {
+ fetchRemoveGhostMethod();
+ if (sRemoveGhostMethod != null) {
+ try {
+ sRemoveGhostMethod.invoke(null, view);
+ } catch (IllegalAccessException e) {
+ // Do nothing
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e.getCause());
+ }
+ }
+ }
+
+ /** A handle to the platform android.view.GhostView. */
+ private final View mGhostView;
+
+ private GhostViewApi21(@NonNull View ghostView) {
+ mGhostView = ghostView;
+ }
+
+ @Override
+ public void setVisibility(int visibility) {
+ mGhostView.setVisibility(visibility);
+ }
+
+ @Override
+ public void reserveEndViewTransition(ViewGroup viewGroup, View view) {
+ // No need
+ }
+
+ private static void fetchGhostViewClass() {
+ if (!sGhostViewClassFetched) {
+ try {
+ sGhostViewClass = Class.forName("android.view.GhostView");
+ } catch (ClassNotFoundException e) {
+ Log.i(TAG, "Failed to retrieve GhostView class", e);
+ }
+ sGhostViewClassFetched = true;
+ }
+ }
+
+ private static void fetchAddGhostMethod() {
+ if (!sAddGhostMethodFetched) {
+ try {
+ fetchGhostViewClass();
+ sAddGhostMethod = sGhostViewClass.getDeclaredMethod("addGhost", View.class,
+ ViewGroup.class, Matrix.class);
+ sAddGhostMethod.setAccessible(true);
+ } catch (NoSuchMethodException e) {
+ Log.i(TAG, "Failed to retrieve addGhost method", e);
+ }
+ sAddGhostMethodFetched = true;
+ }
+ }
+
+ private static void fetchRemoveGhostMethod() {
+ if (!sRemoveGhostMethodFetched) {
+ try {
+ fetchGhostViewClass();
+ sRemoveGhostMethod = sGhostViewClass.getDeclaredMethod("removeGhost", View.class);
+ sRemoveGhostMethod.setAccessible(true);
+ } catch (NoSuchMethodException e) {
+ Log.i(TAG, "Failed to retrieve removeGhost method", e);
+ }
+ sRemoveGhostMethodFetched = true;
+ }
+ }
+
+}
diff --git a/transition/src/main/java/androidx/transition/GhostViewHolder.java b/transition/src/main/java/androidx/transition/GhostViewHolder.java
deleted file mode 100644
index 260d7af..0000000
--- a/transition/src/main/java/androidx/transition/GhostViewHolder.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright 2019 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.transition;
-
-import android.annotation.SuppressLint;
-import android.os.Build;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewParent;
-import android.widget.FrameLayout;
-
-import androidx.annotation.NonNull;
-
-import java.util.ArrayList;
-
-@SuppressLint("ViewConstructor")
-class GhostViewHolder extends FrameLayout {
-
- @NonNull
- private ViewGroup mParent;
- private boolean mAttached;
-
- GhostViewHolder(ViewGroup parent) {
- super(parent.getContext());
- setClipChildren(false);
- mParent = parent;
- mParent.setTag(R.id.ghost_view_holder, this);
- ViewGroupUtils.getOverlay(mParent).add(this);
- mAttached = true;
- }
-
- @Override
- public void onViewAdded(View child) {
- if (!mAttached) {
- throw new IllegalStateException("This GhostViewHolder is detached!");
- }
- super.onViewAdded(child);
- }
-
- @Override
- public void onViewRemoved(View child) {
- super.onViewRemoved(child);
- // before 4.3 onViewRemoved called before removing the child from the children list
- // after 4.3 onViewRemoved called after removing the child from the children
- // let's be on a safe side and check smartly
- if ((getChildCount() == 1 && getChildAt(0) == child)
- || getChildCount() == 0) {
- mParent.setTag(R.id.ghost_view_holder, null);
- ViewGroupUtils.getOverlay(mParent).remove(this);
- mAttached = false;
- }
- }
-
- static GhostViewHolder getHolder(@NonNull ViewGroup parent) {
- return (GhostViewHolder) parent.getTag(R.id.ghost_view_holder);
- }
-
- void popToOverlayTop() {
- if (!mAttached) {
- throw new IllegalStateException("This GhostViewHolder is detached!");
- }
- // we can't reuse the overlay object as this method can return another object after
- // calling remove as it was cleaned up because of no overlay view (in backport impl.)
- ViewGroupUtils.getOverlay(mParent).remove(this);
- ViewGroupUtils.getOverlay(mParent).add(this);
- }
-
-
- /**
- * Inserts a GhostView into the overlay's ViewGroup in the order in which they
- * should be displayed by the UI.
- */
- void addGhostView(GhostViewPort ghostView) {
- ArrayList<View> viewParents = new ArrayList<>();
- getParents(ghostView.mView, viewParents);
-
- int index = getInsertIndex(viewParents);
- if (index < 0 || index >= getChildCount()) {
- addView(ghostView);
- } else {
- addView(ghostView, index);
- }
- }
-
- /**
- * Find the index into the overlay to insert the GhostView based on the order that the
- * views should be drawn. This keeps GhostViews layered in the same order
- * that they are ordered in the UI.
- */
- private int getInsertIndex(ArrayList<View> viewParents) {
- ArrayList<View> tempParents = new ArrayList<>();
- int low = 0;
- int high = getChildCount() - 1;
-
- while (low <= high) {
- int mid = (low + high) / 2;
- GhostViewPort midView = (GhostViewPort) getChildAt(mid);
- getParents(midView.mView, tempParents);
- if (isOnTop(viewParents, tempParents)) {
- low = mid + 1;
- } else {
- high = mid - 1;
- }
- tempParents.clear();
- }
-
- return low;
- }
-
-
- /**
- * Returns true if viewParents is from a View that is on top of the comparedWith's view.
- * The ArrayLists contain the ancestors of views in order from top most grandparent, to
- * the view itself, in order. The goal is to find the first matching parent and then
- * compare the draw order of the siblings.
- */
- private static boolean isOnTop(ArrayList<View> viewParents, ArrayList<View> comparedWith) {
- if (viewParents.isEmpty() || comparedWith.isEmpty()
- || viewParents.get(0) != comparedWith.get(0)) {
- // Not the same decorView -- arbitrary ordering
- return true;
- }
- int depth = Math.min(viewParents.size(), comparedWith.size());
- for (int i = 1; i < depth; i++) {
- View viewParent = viewParents.get(i);
- View comparedWithParent = comparedWith.get(i);
-
- if (viewParent != comparedWithParent) {
- // i - 1 is the same parent, but these are different children.
- return isOnTop(viewParent, comparedWithParent);
- }
- }
-
- // one of these is the parent of the other
- return (comparedWith.size() == depth);
- }
-
- /**
- * Adds all the parents, grandparents, etc. of view to parents.
- */
- private static void getParents(View view, ArrayList<View> parents) {
- ViewParent parent = view.getParent();
- if (parent instanceof ViewGroup) {
- getParents((View) parent, parents);
- }
- parents.add(view);
- }
-
- /**
- * Returns true if view would be drawn on top of comparedWith or false otherwise.
- * view and comparedWith are siblings with the same parent. This uses the logic
- * that dispatchDraw uses to determine which View should be drawn first.
- */
- private static boolean isOnTop(View view, View comparedWith) {
- ViewGroup parent = (ViewGroup) view.getParent();
-
- final int childrenCount = parent.getChildCount();
-
- // From the implementation of ViewGroup.buildOrderedChildList() used by dispatchDraw:
- // The drawing order list is sorted by Z first.
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
- if (view.getZ() != comparedWith.getZ()) {
- return view.getZ() > comparedWith.getZ();
- }
- }
-
- // This default value shouldn't be used because both view and comparedWith
- // should be in the list. If there is an error, then just return an arbitrary
- // view is on top.
- boolean isOnTop = true;
- for (int i = 0; i < childrenCount; i++) {
- int childIndex = ViewGroupUtils.getChildDrawingOrder(parent, i);
- final View child = parent.getChildAt(childIndex);
- if (child == view) {
- isOnTop = false;
- break;
- } else if (child == comparedWith) {
- isOnTop = true;
- break;
- }
- }
-
- return isOnTop;
- }
-
-}
diff --git a/transition/src/main/java/androidx/transition/GhostViewImpl.java b/transition/src/main/java/androidx/transition/GhostViewImpl.java
new file mode 100644
index 0000000..5a4d6cf
--- /dev/null
+++ b/transition/src/main/java/androidx/transition/GhostViewImpl.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2017 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.transition;
+
+import android.view.View;
+import android.view.ViewGroup;
+
+interface GhostViewImpl {
+
+ void setVisibility(int visibility);
+
+ /**
+ * Reserves a call to {@link ViewGroup#endViewTransition(View)} at the time when the GhostView
+ * starts drawing its real view.
+ */
+ void reserveEndViewTransition(ViewGroup viewGroup, View view);
+
+}
diff --git a/transition/src/main/java/androidx/transition/GhostViewPlatform.java b/transition/src/main/java/androidx/transition/GhostViewPlatform.java
deleted file mode 100644
index 7d20d15..0000000
--- a/transition/src/main/java/androidx/transition/GhostViewPlatform.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (C) 2017 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.transition;
-
-import android.graphics.Matrix;
-import android.util.Log;
-import android.view.View;
-import android.view.ViewGroup;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RequiresApi;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-@RequiresApi(21)
-class GhostViewPlatform implements GhostView {
-
- private static final String TAG = "GhostViewApi21";
-
- private static Class<?> sGhostViewClass;
- private static boolean sGhostViewClassFetched;
- private static Method sAddGhostMethod;
- private static boolean sAddGhostMethodFetched;
- private static Method sRemoveGhostMethod;
- private static boolean sRemoveGhostMethodFetched;
-
- static GhostView addGhost(View view, ViewGroup viewGroup, Matrix matrix) {
- fetchAddGhostMethod();
- if (sAddGhostMethod != null) {
- try {
- return new GhostViewPlatform(
- (View) sAddGhostMethod.invoke(null, view, viewGroup, matrix));
- } catch (IllegalAccessException e) {
- // Do nothing
- } catch (InvocationTargetException e) {
- throw new RuntimeException(e.getCause());
- }
- }
- return null;
- }
-
- static void removeGhost(View view) {
- fetchRemoveGhostMethod();
- if (sRemoveGhostMethod != null) {
- try {
- sRemoveGhostMethod.invoke(null, view);
- } catch (IllegalAccessException e) {
- // Do nothing
- } catch (InvocationTargetException e) {
- throw new RuntimeException(e.getCause());
- }
- }
- }
-
- /** A handle to the platform android.view.GhostView. */
- private final View mGhostView;
-
- private GhostViewPlatform(@NonNull View ghostView) {
- mGhostView = ghostView;
- }
-
- @Override
- public void setVisibility(int visibility) {
- mGhostView.setVisibility(visibility);
- }
-
- @Override
- public void reserveEndViewTransition(ViewGroup viewGroup, View view) {
- // No need
- }
-
- private static void fetchGhostViewClass() {
- if (!sGhostViewClassFetched) {
- try {
- sGhostViewClass = Class.forName("android.view.GhostView");
- } catch (ClassNotFoundException e) {
- Log.i(TAG, "Failed to retrieve GhostView class", e);
- }
- sGhostViewClassFetched = true;
- }
- }
-
- private static void fetchAddGhostMethod() {
- if (!sAddGhostMethodFetched) {
- try {
- fetchGhostViewClass();
- sAddGhostMethod = sGhostViewClass.getDeclaredMethod("addGhost", View.class,
- ViewGroup.class, Matrix.class);
- sAddGhostMethod.setAccessible(true);
- } catch (NoSuchMethodException e) {
- Log.i(TAG, "Failed to retrieve addGhost method", e);
- }
- sAddGhostMethodFetched = true;
- }
- }
-
- private static void fetchRemoveGhostMethod() {
- if (!sRemoveGhostMethodFetched) {
- try {
- fetchGhostViewClass();
- sRemoveGhostMethod = sGhostViewClass.getDeclaredMethod("removeGhost", View.class);
- sRemoveGhostMethod.setAccessible(true);
- } catch (NoSuchMethodException e) {
- Log.i(TAG, "Failed to retrieve removeGhost method", e);
- }
- sRemoveGhostMethodFetched = true;
- }
- }
-
-}
diff --git a/transition/src/main/java/androidx/transition/GhostViewPort.java b/transition/src/main/java/androidx/transition/GhostViewPort.java
deleted file mode 100644
index 38b9289..0000000
--- a/transition/src/main/java/androidx/transition/GhostViewPort.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright 2019 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.transition;
-
-import android.annotation.SuppressLint;
-import android.graphics.Canvas;
-import android.graphics.Matrix;
-import android.view.View;
-import android.view.ViewGroup;
-import android.view.ViewTreeObserver;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.core.view.ViewCompat;
-
-/**
- * Backport of android.view.GhostView introduced in API level 21.
- */
-@SuppressLint("ViewConstructor")
-class GhostViewPort extends ViewGroup implements GhostView {
-
- /** The parent of the view that is disappearing at the beginning of the animation */
- ViewGroup mStartParent;
-
- /** The view that is disappearing at the beginning of the animation */
- View mStartView;
-
- /** The target view */
- final View mView;
-
- /** The number of references to this ghost view */
- int mReferences;
-
- @Nullable
- private Matrix mMatrix;
-
- private final ViewTreeObserver.OnPreDrawListener mOnPreDrawListener =
- new ViewTreeObserver.OnPreDrawListener() {
- @Override
- public boolean onPreDraw() {
- // We draw the view.
- ViewCompat.postInvalidateOnAnimation(GhostViewPort.this);
- if (mStartParent != null && mStartView != null) {
- mStartParent.endViewTransition(mStartView);
- ViewCompat.postInvalidateOnAnimation(mStartParent);
- mStartParent = null;
- mStartView = null;
- }
- return true;
- }
- };
-
- GhostViewPort(View view) {
- super(view.getContext());
- mView = view;
- setWillNotDraw(false);
- setLayerType(LAYER_TYPE_HARDWARE, null);
- }
-
- @Override
- public void setVisibility(int visibility) {
- super.setVisibility(visibility);
- if (getGhostView(mView) == this) {
- int inverseVisibility = (visibility == View.VISIBLE) ? View.INVISIBLE : View.VISIBLE;
- ViewUtils.setTransitionVisibility(mView, inverseVisibility);
- }
- }
-
- @Override
- protected void onLayout(boolean changed, int l, int t, int r, int b) {
-
- }
-
- void setMatrix(@NonNull Matrix matrix) {
- mMatrix = matrix;
- }
-
- @Override
- public void reserveEndViewTransition(ViewGroup viewGroup, View view) {
- mStartParent = viewGroup;
- mStartView = view;
- }
-
- @Override
- protected void onAttachedToWindow() {
- super.onAttachedToWindow();
- setGhostView(mView, this);
- // Monitor invalidation of the target view.
- mView.getViewTreeObserver().addOnPreDrawListener(mOnPreDrawListener);
- // Make the target view invisible because we draw it instead.
- ViewUtils.setTransitionVisibility(mView, INVISIBLE);
- if (mView.getParent() != null) {
- ((View) mView.getParent()).invalidate();
- }
- }
-
- @Override
- protected void onDetachedFromWindow() {
- mView.getViewTreeObserver().removeOnPreDrawListener(mOnPreDrawListener);
- ViewUtils.setTransitionVisibility(mView, VISIBLE);
- setGhostView(mView, null);
- if (mView.getParent() != null) {
- ((View) mView.getParent()).invalidate();
- }
- super.onDetachedFromWindow();
- }
-
- @Override
- protected void onDraw(Canvas canvas) {
- CanvasUtils.enableZ(canvas, true); // enable shadows
- canvas.setMatrix(mMatrix);
-
- // We need to mark mView as invalidated so drawChild() will recreate a RenderNode.
- // As invalidate() will do nothing while mView is INVISIBLE we need to silently
- // change it to VISIBLE, call invalidate and then change it back to INVISIBLE.
- ViewUtils.setTransitionVisibility(mView, VISIBLE);
- mView.invalidate();
- ViewUtils.setTransitionVisibility(mView, INVISIBLE);
-
- drawChild(canvas, mView, getDrawingTime());
- CanvasUtils.enableZ(canvas, false); // re-disable reordering/shadows
- }
-
- static void copySize(View from, View to) {
- ViewUtils.setLeftTopRightBottom(to,
- to.getLeft(),
- to.getTop(),
- to.getLeft() + from.getWidth(),
- to.getTop() + from.getHeight());
- }
-
- static GhostViewPort getGhostView(View view) {
- return (GhostViewPort) view.getTag(R.id.ghost_view);
- }
-
- static void setGhostView(@NonNull View view, @Nullable GhostViewPort ghostView) {
- view.setTag(R.id.ghost_view, ghostView);
- }
-
- static void calculateMatrix(View view, ViewGroup host, Matrix matrix) {
- ViewGroup parent = (ViewGroup) view.getParent();
- matrix.reset();
- ViewUtils.transformMatrixToGlobal(parent, matrix);
- matrix.preTranslate(-parent.getScrollX(), -parent.getScrollY());
- ViewUtils.transformMatrixToLocal(host, matrix);
- }
-
- static GhostViewPort addGhost(View view, ViewGroup viewGroup, Matrix matrix) {
- if (!(view.getParent() instanceof ViewGroup)) {
- throw new IllegalArgumentException("Ghosted views must be parented by a ViewGroup");
- }
- GhostViewHolder holder = GhostViewHolder.getHolder(viewGroup);
- GhostViewPort ghostView = getGhostView(view);
- int previousRefCount = 0;
- if (ghostView != null) {
- GhostViewHolder oldHolder = (GhostViewHolder) ghostView.getParent();
- if (oldHolder != holder) {
- previousRefCount = ghostView.mReferences;
- oldHolder.removeView(ghostView);
- ghostView = null;
- }
- }
- if (ghostView == null) {
- if (matrix == null) {
- matrix = new Matrix();
- calculateMatrix(view, viewGroup, matrix);
- }
- ghostView = new GhostViewPort(view);
- ghostView.setMatrix(matrix);
- if (holder == null) {
- holder = new GhostViewHolder(viewGroup);
- } else {
- holder.popToOverlayTop();
- }
- copySize(viewGroup, holder);
- copySize(viewGroup, ghostView);
- holder.addGhostView(ghostView);
- ghostView.mReferences = previousRefCount;
- } else if (matrix != null) {
- ghostView.setMatrix(matrix);
- }
- ghostView.mReferences++;
- return ghostView;
- }
-
- static void removeGhost(View view) {
- GhostViewPort ghostView = getGhostView(view);
- if (ghostView != null) {
- ghostView.mReferences--;
- if (ghostView.mReferences <= 0) {
- GhostViewHolder holder = (GhostViewHolder) ghostView.getParent();
- holder.removeView(ghostView);
- }
- }
- }
-
-}
diff --git a/transition/src/main/java/androidx/transition/GhostViewUtils.java b/transition/src/main/java/androidx/transition/GhostViewUtils.java
index ed202ec..9e460ca 100644
--- a/transition/src/main/java/androidx/transition/GhostViewUtils.java
+++ b/transition/src/main/java/androidx/transition/GhostViewUtils.java
@@ -21,26 +21,20 @@
import android.view.View;
import android.view.ViewGroup;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-
class GhostViewUtils {
- @Nullable
- static GhostView addGhost(@NonNull View view, @NonNull ViewGroup viewGroup,
- @Nullable Matrix matrix) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
- return GhostViewPlatform.addGhost(view, viewGroup, matrix);
- } else {
- return GhostViewPort.addGhost(view, viewGroup, matrix);
+ static GhostViewImpl addGhost(View view, ViewGroup viewGroup, Matrix matrix) {
+ if (Build.VERSION.SDK_INT >= 21) {
+ return GhostViewApi21.addGhost(view, viewGroup, matrix);
}
+ return GhostViewApi14.addGhost(view, viewGroup);
}
static void removeGhost(View view) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
- GhostViewPlatform.removeGhost(view);
+ if (Build.VERSION.SDK_INT >= 21) {
+ GhostViewApi21.removeGhost(view);
} else {
- GhostViewPort.removeGhost(view);
+ GhostViewApi14.removeGhost(view);
}
}
diff --git a/transition/src/main/java/androidx/transition/Slide.java b/transition/src/main/java/androidx/transition/Slide.java
index f4458a2..8eb67ca 100644
--- a/transition/src/main/java/androidx/transition/Slide.java
+++ b/transition/src/main/java/androidx/transition/Slide.java
@@ -16,7 +16,7 @@
package androidx.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.TimeInterpolator;
@@ -58,7 +58,7 @@
private int mSlideEdge = Gravity.BOTTOM;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
@IntDef({Gravity.LEFT, Gravity.TOP, Gravity.RIGHT, Gravity.BOTTOM, Gravity.START, Gravity.END})
public @interface GravityFlag {
diff --git a/transition/src/main/java/androidx/transition/Transition.java b/transition/src/main/java/androidx/transition/Transition.java
index 285570e..17e1568 100644
--- a/transition/src/main/java/androidx/transition/Transition.java
+++ b/transition/src/main/java/androidx/transition/Transition.java
@@ -16,7 +16,7 @@
package androidx.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -149,7 +149,7 @@
private static final int MATCH_LAST = MATCH_ITEM_ID;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@IntDef({MATCH_INSTANCE, MATCH_NAME, MATCH_ID, MATCH_ITEM_ID})
@Retention(RetentionPolicy.SOURCE)
public @interface MatchOrder {
@@ -697,7 +697,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected void createAnimators(ViewGroup sceneRoot, TransitionValuesMaps startValues,
TransitionValuesMaps endValues, ArrayList<TransitionValues> startValuesList,
ArrayList<TransitionValues> endValuesList) {
@@ -867,7 +867,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected void runAnimators() {
if (DBG) {
Log.d(LOG_TAG, "runAnimators() on " + this);
@@ -1710,7 +1710,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void pause(View sceneRoot) {
if (!mEnded) {
ArrayMap<Animator, AnimationInfo> runningAnimators = getRunningAnimators();
@@ -1742,7 +1742,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public void resume(View sceneRoot) {
if (mPaused) {
if (!mEnded) {
@@ -1889,7 +1889,7 @@
* @param animator The Animator to be run during this transition.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected void animate(Animator animator) {
// TODO: maybe pass auto-end as a boolean parameter?
if (animator == null) {
@@ -1922,7 +1922,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected void start() {
if (mNumInstances == 0) {
if (mListeners != null && mListeners.size() > 0) {
@@ -1949,7 +1949,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected void end() {
--mNumInstances;
if (mNumInstances == 0) {
@@ -1982,7 +1982,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void forceToEnd(ViewGroup sceneRoot) {
ArrayMap<Animator, AnimationInfo> runningAnimators = getRunningAnimators();
int numOldAnims = runningAnimators.size();
@@ -2003,7 +2003,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected void cancel() {
int numAnimators = mCurrentAnimators.size();
for (int i = numAnimators - 1; i >= 0; i--) {
diff --git a/transition/src/main/java/androidx/transition/TransitionSet.java b/transition/src/main/java/androidx/transition/TransitionSet.java
index d82b832..46377df 100644
--- a/transition/src/main/java/androidx/transition/TransitionSet.java
+++ b/transition/src/main/java/androidx/transition/TransitionSet.java
@@ -16,7 +16,7 @@
package androidx.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.TimeInterpolator;
import android.content.Context;
@@ -455,7 +455,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
protected void createAnimators(ViewGroup sceneRoot, TransitionValuesMaps startValues,
TransitionValuesMaps endValues, ArrayList<TransitionValues> startValuesList,
@@ -482,7 +482,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
protected void runAnimators() {
if (mTransitions.isEmpty()) {
@@ -550,7 +550,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void pause(View sceneRoot) {
super.pause(sceneRoot);
@@ -561,7 +561,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public void resume(View sceneRoot) {
super.resume(sceneRoot);
@@ -572,7 +572,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
protected void cancel() {
super.cancel();
@@ -583,7 +583,7 @@
}
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
void forceToEnd(ViewGroup sceneRoot) {
super.forceToEnd(sceneRoot);
diff --git a/transition/src/main/java/androidx/transition/ViewGroupUtils.java b/transition/src/main/java/androidx/transition/ViewGroupUtils.java
index 566c0cb..dee0fa9 100644
--- a/transition/src/main/java/androidx/transition/ViewGroupUtils.java
+++ b/transition/src/main/java/androidx/transition/ViewGroupUtils.java
@@ -21,17 +21,11 @@
import androidx.annotation.NonNull;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
/**
* Compatibility utilities for platform features of {@link ViewGroup}.
*/
class ViewGroupUtils {
- private static Method sGetChildDrawingOrderMethod;
- private static boolean sGetChildDrawingOrderMethodFetched;
-
/**
* Backward-compatible {@link ViewGroup#getOverlay()}.
*/
@@ -53,33 +47,6 @@
}
}
- /**
- * Returns the index of the child to draw for this iteration.
- */
- static int getChildDrawingOrder(@NonNull ViewGroup viewGroup, int i) {
- if (!sGetChildDrawingOrderMethodFetched) {
- try {
- sGetChildDrawingOrderMethod = ViewGroup.class.getDeclaredMethod(
- "getChildDrawingOrder", int.class, int.class);
- sGetChildDrawingOrderMethod.setAccessible(true);
- } catch (NoSuchMethodException ignore) {
-
- }
- sGetChildDrawingOrderMethodFetched = true;
- }
- if (sGetChildDrawingOrderMethod != null) {
- try {
- return (Integer) sGetChildDrawingOrderMethod.invoke(viewGroup,
- viewGroup.getChildCount(), i);
- } catch (IllegalAccessException ignore) {
- } catch (InvocationTargetException ignore) {
- }
- }
- // fallback implementation
- return i;
- }
-
-
private ViewGroupUtils() {
}
}
diff --git a/transition/src/main/java/androidx/transition/ViewOverlayApi14.java b/transition/src/main/java/androidx/transition/ViewOverlayApi14.java
index 38ae549..cf64ee2 100644
--- a/transition/src/main/java/androidx/transition/ViewOverlayApi14.java
+++ b/transition/src/main/java/androidx/transition/ViewOverlayApi14.java
@@ -16,7 +16,7 @@
package androidx.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.Context;
import android.graphics.Canvas;
@@ -135,8 +135,6 @@
*/
ViewOverlayApi14 mViewOverlay;
- private boolean mDisposed;
-
OverlayViewGroup(Context context, ViewGroup hostView, View requestingView,
ViewOverlayApi14 viewOverlay) {
super(context);
@@ -155,7 +153,6 @@
}
public void add(Drawable drawable) {
- assertNotDisposed();
if (mDrawables == null) {
mDrawables = new ArrayList<>();
@@ -173,7 +170,6 @@
mDrawables.remove(drawable);
invalidate(drawable.getBounds());
drawable.setCallback(null);
- disposeIfEmpty();
}
}
@@ -183,7 +179,6 @@
}
public void add(View child) {
- assertNotDisposed();
if (child.getParent() instanceof ViewGroup) {
ViewGroup parent = (ViewGroup) child.getParent();
if (parent != mHostView && parent.getParent() != null
@@ -207,28 +202,21 @@
parent.removeView(child);
}
}
- super.addView(child);
+ super.addView(child, getChildCount() - 1);
}
public void remove(View view) {
super.removeView(view);
- disposeIfEmpty();
- }
-
- private void assertNotDisposed() {
- if (mDisposed) {
- throw new IllegalStateException("This overlay was disposed already. "
- + "Please use a new one via ViewGroupUtils.getOverlay()");
- }
- }
-
- private void disposeIfEmpty() {
- if (getChildCount() == 0 && (mDrawables == null || mDrawables.size() == 0)) {
- mDisposed = true;
+ if (isEmpty()) {
mHostView.removeView(this);
}
}
+ boolean isEmpty() {
+ return getChildCount() == 0
+ && (mDrawables == null || mDrawables.size() == 0);
+ }
+
@Override
public void invalidateDrawable(@NonNull Drawable drawable) {
invalidate(drawable.getBounds());
@@ -277,7 +265,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected ViewParent invalidateChildInParentFast(int left, int top, Rect dirty) {
if (mHostView instanceof ViewGroup && sInvalidateChildInParentFastMethod != null) {
try {
diff --git a/transition/src/main/java/androidx/transition/ViewUtilsBase.java b/transition/src/main/java/androidx/transition/ViewUtilsBase.java
index 87917dd..a383d23 100644
--- a/transition/src/main/java/androidx/transition/ViewUtilsBase.java
+++ b/transition/src/main/java/androidx/transition/ViewUtilsBase.java
@@ -89,7 +89,7 @@
transformMatrixToLocal(vp, matrix);
matrix.postTranslate(vp.getScrollX(), vp.getScrollY());
}
- matrix.postTranslate(-view.getLeft(), -view.getTop());
+ matrix.postTranslate(view.getLeft(), view.getTop());
final Matrix vm = view.getMatrix();
if (!vm.isIdentity()) {
final Matrix inverted = new Matrix();
diff --git a/transition/src/main/java/androidx/transition/Visibility.java b/transition/src/main/java/androidx/transition/Visibility.java
index c27d93e..da4ef95 100644
--- a/transition/src/main/java/androidx/transition/Visibility.java
+++ b/transition/src/main/java/androidx/transition/Visibility.java
@@ -16,7 +16,7 @@
package androidx.transition;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -71,7 +71,7 @@
public static final int MODE_OUT = 0x2;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@SuppressLint("UniqueConstants") // because MODE_IN and Fade.IN are aliases.
@IntDef(flag = true, value = {MODE_IN, MODE_OUT, Fade.IN, Fade.OUT})
@Retention(RetentionPolicy.SOURCE)
diff --git a/transition/src/main/res/values/ids.xml b/transition/src/main/res/values/ids.xml
index b9dd584..4df456c 100644
--- a/transition/src/main/res/values/ids.xml
+++ b/transition/src/main/res/values/ids.xml
@@ -22,7 +22,6 @@
<item name="transition_transform" type="id"/>
<item name="parent_matrix" type="id"/>
<item name="ghost_view" type="id"/>
- <item name="ghost_view_holder" type="id"/>
<item name="save_non_transition_alpha" type="id"/>
<item name="save_overlay_view" type="id"/>
</resources>
diff --git a/tv-provider/api/1.0.0.txt b/tv-provider/api/1.0.0.txt
index a3dc91d..78580f3 100644
--- a/tv-provider/api/1.0.0.txt
+++ b/tv-provider/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.tvprovider.media.tv {
public final class Channel {
@@ -137,60 +137,9 @@
public final class PreviewProgram {
method public static androidx.tvprovider.media.tv.PreviewProgram! fromCursor(android.database.Cursor!);
- method public String[]! getAudioLanguages();
- method public String! getAuthor();
- method public int getAvailability();
- method public String[]! getCanonicalGenres();
method public long getChannelId();
- method public String! getContentId();
- method public android.media.tv.TvContentRating[]! getContentRatings();
- method public String! getDescription();
- method public int getDurationMillis();
- method public long getEndTimeUtcMillis();
- method public String! getEpisodeNumber();
- method public String! getEpisodeTitle();
- method public String! getGenre();
- method public long getId();
- method public android.content.Intent! getIntent() throws java.net.URISyntaxException;
- method public android.net.Uri! getIntentUri();
- method public long getInteractionCount();
- method public int getInteractionType();
- method public byte[]! getInternalProviderDataByteArray();
- method public Long! getInternalProviderFlag1();
- method public Long! getInternalProviderFlag2();
- method public Long! getInternalProviderFlag3();
- method public Long! getInternalProviderFlag4();
- method public String! getInternalProviderId();
- method public int getItemCount();
- method public int getLastPlaybackPositionMillis();
- method public String! getLogoContentDescription();
- method public android.net.Uri! getLogoUri();
- method public String! getLongDescription();
- method public String! getOfferPrice();
- method public int getPosterArtAspectRatio();
- method public android.net.Uri! getPosterArtUri();
- method public android.net.Uri! getPreviewAudioUri();
- method public android.net.Uri! getPreviewVideoUri();
- method public String! getReleaseDate();
- method public String! getReviewRating();
- method public int getReviewRatingStyle();
- method public String! getSeasonNumber();
- method public String! getSeasonTitle();
- method public long getStartTimeUtcMillis();
- method public String! getStartingPrice();
- method public int getThumbnailAspectRatio();
- method public android.net.Uri! getThumbnailUri();
- method public String! getTitle();
- method public int getTvSeriesItemType();
- method public int getType();
- method public int getVideoHeight();
- method public int getVideoWidth();
method public int getWeight();
method public boolean hasAnyUpdatedValues(androidx.tvprovider.media.tv.PreviewProgram!);
- method public boolean isBrowsable();
- method public boolean isLive();
- method public boolean isSearchable();
- method public boolean isTransient();
method public android.content.ContentValues! toContentValues();
}
@@ -198,41 +147,73 @@
ctor public PreviewProgram.Builder();
ctor public PreviewProgram.Builder(androidx.tvprovider.media.tv.PreviewProgram!);
method public androidx.tvprovider.media.tv.PreviewProgram! build();
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setAudioLanguages(String[]!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setAuthor(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setAvailability(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setBrowsable(boolean);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setCanonicalGenres(String[]!);
method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setChannelId(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setContentId(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setContentRatings(android.media.tv.TvContentRating[]!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setDescription(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setDurationMillis(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setEndTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setEpisodeNumber(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setEpisodeNumber(String!, int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setEpisodeTitle(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setGenre(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setId(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setIntent(android.content.Intent!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setIntentUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInteractionCount(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInteractionType(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInternalProviderData(byte[]!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInternalProviderFlag1(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInternalProviderFlag2(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInternalProviderFlag3(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInternalProviderFlag4(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInternalProviderId(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setItemCount(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setLastPlaybackPositionMillis(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setLive(boolean);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setLogoContentDescription(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setLogoUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setLongDescription(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setOfferPrice(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setPackageName(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setPosterArtAspectRatio(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setPosterArtUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setPreviewAudioUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setPreviewVideoUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setReleaseDate(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setReleaseDate(java.util.Date!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setReviewRating(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setReviewRatingStyle(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setSearchable(boolean);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setSeasonNumber(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setSeasonNumber(String!, int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setSeasonTitle(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setStartTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setStartingPrice(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setThumbnailAspectRatio(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setThumbnailUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setTitle(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setTransient(boolean);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setTvSeriesItemType(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setType(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setVideoHeight(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setVideoWidth(int);
method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setWeight(int);
}
public final class Program implements java.lang.Comparable<androidx.tvprovider.media.tv.Program> {
method public int compareTo(androidx.tvprovider.media.tv.Program);
method public static androidx.tvprovider.media.tv.Program! fromCursor(android.database.Cursor!);
- method public String[]! getAudioLanguages();
method public String[]! getBroadcastGenres();
- method public String[]! getCanonicalGenres();
method public long getChannelId();
- method public android.media.tv.TvContentRating[]! getContentRatings();
- method public String! getDescription();
method public long getEndTimeUtcMillis();
- method public String! getEpisodeNumber();
- method public String! getEpisodeTitle();
- method public long getId();
- method public byte[]! getInternalProviderDataByteArray();
- method public Long! getInternalProviderFlag1();
- method public Long! getInternalProviderFlag2();
- method public Long! getInternalProviderFlag3();
- method public Long! getInternalProviderFlag4();
- method public String! getLongDescription();
- method public android.net.Uri! getPosterArtUri();
- method public String! getReviewRating();
- method public int getReviewRatingStyle();
- method public String! getSeasonNumber();
- method public String! getSeasonTitle();
method public long getStartTimeUtcMillis();
- method public android.net.Uri! getThumbnailUri();
- method public String! getTitle();
- method public int getVideoHeight();
- method public int getVideoWidth();
method public boolean isRecordingProhibited();
- method public boolean isSearchable();
method public android.content.ContentValues! toContentValues();
}
@@ -240,11 +221,37 @@
ctor public Program.Builder();
ctor public Program.Builder(androidx.tvprovider.media.tv.Program!);
method public androidx.tvprovider.media.tv.Program! build();
+ method public androidx.tvprovider.media.tv.Program.Builder! setAudioLanguages(String[]!);
method public androidx.tvprovider.media.tv.Program.Builder! setBroadcastGenres(String[]!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setCanonicalGenres(String[]!);
method public androidx.tvprovider.media.tv.Program.Builder! setChannelId(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setContentRatings(android.media.tv.TvContentRating[]!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setDescription(String!);
method public androidx.tvprovider.media.tv.Program.Builder! setEndTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setEpisodeNumber(int);
+ method public androidx.tvprovider.media.tv.Program.Builder! setEpisodeNumber(String!, int);
+ method public androidx.tvprovider.media.tv.Program.Builder! setEpisodeTitle(String!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setId(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setInternalProviderData(byte[]!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setInternalProviderFlag1(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setInternalProviderFlag2(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setInternalProviderFlag3(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setInternalProviderFlag4(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setLongDescription(String!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setPackageName(String!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setPosterArtUri(android.net.Uri!);
method public androidx.tvprovider.media.tv.Program.Builder! setRecordingProhibited(boolean);
+ method public androidx.tvprovider.media.tv.Program.Builder! setReviewRating(String!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setReviewRatingStyle(int);
+ method public androidx.tvprovider.media.tv.Program.Builder! setSearchable(boolean);
+ method public androidx.tvprovider.media.tv.Program.Builder! setSeasonNumber(int);
+ method public androidx.tvprovider.media.tv.Program.Builder! setSeasonNumber(String!, int);
+ method public androidx.tvprovider.media.tv.Program.Builder! setSeasonTitle(String!);
method public androidx.tvprovider.media.tv.Program.Builder! setStartTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setThumbnailUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setTitle(String!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setVideoHeight(int);
+ method public androidx.tvprovider.media.tv.Program.Builder! setVideoWidth(int);
}
public final class TvContractCompat {
@@ -666,60 +673,9 @@
public final class WatchNextProgram {
method public static androidx.tvprovider.media.tv.WatchNextProgram! fromCursor(android.database.Cursor!);
- method public String[]! getAudioLanguages();
- method public String! getAuthor();
- method public int getAvailability();
- method public String[]! getCanonicalGenres();
- method public String! getContentId();
- method public android.media.tv.TvContentRating[]! getContentRatings();
- method public String! getDescription();
- method public int getDurationMillis();
- method public long getEndTimeUtcMillis();
- method public String! getEpisodeNumber();
- method public String! getEpisodeTitle();
- method public String! getGenre();
- method public long getId();
- method public android.content.Intent! getIntent() throws java.net.URISyntaxException;
- method public android.net.Uri! getIntentUri();
- method public long getInteractionCount();
- method public int getInteractionType();
- method public byte[]! getInternalProviderDataByteArray();
- method public Long! getInternalProviderFlag1();
- method public Long! getInternalProviderFlag2();
- method public Long! getInternalProviderFlag3();
- method public Long! getInternalProviderFlag4();
- method public String! getInternalProviderId();
- method public int getItemCount();
method public long getLastEngagementTimeUtcMillis();
- method public int getLastPlaybackPositionMillis();
- method public String! getLogoContentDescription();
- method public android.net.Uri! getLogoUri();
- method public String! getLongDescription();
- method public String! getOfferPrice();
- method public int getPosterArtAspectRatio();
- method public android.net.Uri! getPosterArtUri();
- method public android.net.Uri! getPreviewAudioUri();
- method public android.net.Uri! getPreviewVideoUri();
- method public String! getReleaseDate();
- method public String! getReviewRating();
- method public int getReviewRatingStyle();
- method public String! getSeasonNumber();
- method public String! getSeasonTitle();
- method public long getStartTimeUtcMillis();
- method public String! getStartingPrice();
- method public int getThumbnailAspectRatio();
- method public android.net.Uri! getThumbnailUri();
- method public String! getTitle();
- method public int getTvSeriesItemType();
- method public int getType();
- method public int getVideoHeight();
- method public int getVideoWidth();
method public int getWatchNextType();
method public boolean hasAnyUpdatedValues(androidx.tvprovider.media.tv.WatchNextProgram!);
- method public boolean isBrowsable();
- method public boolean isLive();
- method public boolean isSearchable();
- method public boolean isTransient();
method public android.content.ContentValues! toContentValues();
field public static final int WATCH_NEXT_TYPE_UNKNOWN = -1; // 0xffffffff
}
@@ -728,7 +684,62 @@
ctor public WatchNextProgram.Builder();
ctor public WatchNextProgram.Builder(androidx.tvprovider.media.tv.WatchNextProgram!);
method public androidx.tvprovider.media.tv.WatchNextProgram! build();
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setAudioLanguages(String[]!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setAuthor(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setAvailability(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setBrowsable(boolean);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setCanonicalGenres(String[]!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setContentId(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setContentRatings(android.media.tv.TvContentRating[]!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setDescription(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setDurationMillis(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setEndTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setEpisodeNumber(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setEpisodeNumber(String!, int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setEpisodeTitle(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setGenre(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setId(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setIntent(android.content.Intent!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setIntentUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInteractionCount(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInteractionType(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInternalProviderData(byte[]!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInternalProviderFlag1(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInternalProviderFlag2(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInternalProviderFlag3(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInternalProviderFlag4(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInternalProviderId(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setItemCount(int);
method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLastEngagementTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLastPlaybackPositionMillis(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLive(boolean);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLogoContentDescription(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLogoUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLongDescription(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setOfferPrice(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setPackageName(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setPosterArtAspectRatio(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setPosterArtUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setPreviewAudioUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setPreviewVideoUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setReleaseDate(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setReleaseDate(java.util.Date!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setReviewRating(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setReviewRatingStyle(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setSearchable(boolean);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setSeasonNumber(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setSeasonNumber(String!, int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setSeasonTitle(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setStartTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setStartingPrice(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setThumbnailAspectRatio(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setThumbnailUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setTitle(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setTransient(boolean);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setTvSeriesItemType(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setType(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setVideoHeight(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setVideoWidth(int);
method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setWatchNextType(int);
}
diff --git a/tv-provider/api/1.1.0-alpha01.ignore b/tv-provider/api/1.1.0-alpha01.ignore
deleted file mode 100644
index c51defd..0000000
--- a/tv-provider/api/1.1.0-alpha01.ignore
+++ /dev/null
@@ -1,9 +0,0 @@
-// Baseline format: 1.0
-HiddenSuperclass: androidx.tvprovider.media.tv.PreviewProgram:
- Public class androidx.tvprovider.media.tv.PreviewProgram stripped of unavailable superclass androidx.tvprovider.media.tv.BasePreviewProgram
-HiddenSuperclass: androidx.tvprovider.media.tv.Program:
- Public class androidx.tvprovider.media.tv.Program stripped of unavailable superclass androidx.tvprovider.media.tv.BaseProgram
-HiddenSuperclass: androidx.tvprovider.media.tv.WatchNextProgram:
- Public class androidx.tvprovider.media.tv.WatchNextProgram stripped of unavailable superclass androidx.tvprovider.media.tv.BasePreviewProgram
-
-
diff --git a/tv-provider/api/1.1.0-alpha01.txt b/tv-provider/api/1.1.0-alpha01.txt
deleted file mode 100644
index a3dc91d..0000000
--- a/tv-provider/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,736 +0,0 @@
-// Signature format: 3.0
-package androidx.tvprovider.media.tv {
-
- public final class Channel {
- method public static androidx.tvprovider.media.tv.Channel! fromCursor(android.database.Cursor!);
- method public int getAppLinkColor();
- method public android.net.Uri! getAppLinkIconUri();
- method public android.content.Intent! getAppLinkIntent() throws java.net.URISyntaxException;
- method public android.net.Uri! getAppLinkIntentUri();
- method public android.net.Uri! getAppLinkPosterArtUri();
- method public String! getAppLinkText();
- method public int getConfigurationDisplayOrder();
- method public String! getDescription();
- method public String! getDisplayName();
- method public String! getDisplayNumber();
- method public long getId();
- method public String! getInputId();
- method public byte[]! getInternalProviderDataByteArray();
- method public Long! getInternalProviderFlag1();
- method public Long! getInternalProviderFlag2();
- method public Long! getInternalProviderFlag3();
- method public Long! getInternalProviderFlag4();
- method public String! getInternalProviderId();
- method public String! getNetworkAffiliation();
- method public int getOriginalNetworkId();
- method public String! getPackageName();
- method public int getServiceId();
- method public String! getServiceType();
- method public String! getSystemChannelKey();
- method public int getTransportStreamId();
- method public String! getType();
- method public String! getVideoFormat();
- method public boolean isBrowsable();
- method public boolean isLocked();
- method public boolean isSearchable();
- method public boolean isTransient();
- method public android.content.ContentValues! toContentValues();
- }
-
- public static final class Channel.Builder {
- ctor public Channel.Builder();
- ctor public Channel.Builder(androidx.tvprovider.media.tv.Channel!);
- method public androidx.tvprovider.media.tv.Channel! build();
- method public androidx.tvprovider.media.tv.Channel.Builder! setAppLinkColor(int);
- method public androidx.tvprovider.media.tv.Channel.Builder! setAppLinkIconUri(android.net.Uri!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setAppLinkIntent(android.content.Intent!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setAppLinkIntentUri(android.net.Uri!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setAppLinkPosterArtUri(android.net.Uri!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setAppLinkText(String!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setConfigurationDisplayOrder(int);
- method public androidx.tvprovider.media.tv.Channel.Builder! setDescription(String!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setDisplayName(String!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setDisplayNumber(String!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setInputId(String!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setInternalProviderData(byte[]!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setInternalProviderData(String!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setInternalProviderFlag1(long);
- method public androidx.tvprovider.media.tv.Channel.Builder! setInternalProviderFlag2(long);
- method public androidx.tvprovider.media.tv.Channel.Builder! setInternalProviderFlag3(long);
- method public androidx.tvprovider.media.tv.Channel.Builder! setInternalProviderFlag4(long);
- method public androidx.tvprovider.media.tv.Channel.Builder! setInternalProviderId(String!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setNetworkAffiliation(String!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setOriginalNetworkId(int);
- method public androidx.tvprovider.media.tv.Channel.Builder! setSearchable(boolean);
- method public androidx.tvprovider.media.tv.Channel.Builder! setServiceId(int);
- method public androidx.tvprovider.media.tv.Channel.Builder! setServiceType(String!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setSystemChannelKey(String!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setTransient(boolean);
- method public androidx.tvprovider.media.tv.Channel.Builder! setTransportStreamId(int);
- method public androidx.tvprovider.media.tv.Channel.Builder! setType(String!);
- method public androidx.tvprovider.media.tv.Channel.Builder! setVideoFormat(String!);
- }
-
- @WorkerThread public class ChannelLogoUtils {
- ctor @Deprecated public ChannelLogoUtils();
- method @WorkerThread public static android.graphics.Bitmap! loadChannelLogo(android.content.Context, long);
- method public static boolean storeChannelLogo(android.content.Context, long, android.net.Uri);
- method @WorkerThread public static boolean storeChannelLogo(android.content.Context, long, android.graphics.Bitmap);
- }
-
- public class PreviewChannel {
- method public static androidx.tvprovider.media.tv.PreviewChannel! fromCursor(android.database.Cursor!);
- method public android.content.Intent! getAppLinkIntent() throws java.net.URISyntaxException;
- method public android.net.Uri! getAppLinkIntentUri();
- method public CharSequence! getDescription();
- method public CharSequence! getDisplayName();
- method public long getId();
- method public byte[]! getInternalProviderDataByteArray();
- method public Long! getInternalProviderFlag1();
- method public Long! getInternalProviderFlag2();
- method public Long! getInternalProviderFlag3();
- method public Long! getInternalProviderFlag4();
- method public String! getInternalProviderId();
- method @WorkerThread public android.graphics.Bitmap! getLogo(android.content.Context!);
- method public String! getPackageName();
- method public String! getType();
- method public boolean hasAnyUpdatedValues(androidx.tvprovider.media.tv.PreviewChannel!);
- method public boolean isBrowsable();
- }
-
- public static final class PreviewChannel.Builder {
- ctor public PreviewChannel.Builder();
- ctor public PreviewChannel.Builder(androidx.tvprovider.media.tv.PreviewChannel!);
- method public androidx.tvprovider.media.tv.PreviewChannel! build();
- method public androidx.tvprovider.media.tv.PreviewChannel.Builder! setAppLinkIntent(android.content.Intent!);
- method public androidx.tvprovider.media.tv.PreviewChannel.Builder! setAppLinkIntentUri(android.net.Uri!);
- method public androidx.tvprovider.media.tv.PreviewChannel.Builder! setDescription(CharSequence!);
- method public androidx.tvprovider.media.tv.PreviewChannel.Builder! setDisplayName(CharSequence!);
- method public androidx.tvprovider.media.tv.PreviewChannel.Builder! setInternalProviderData(byte[]!);
- method public androidx.tvprovider.media.tv.PreviewChannel.Builder! setInternalProviderFlag1(long);
- method public androidx.tvprovider.media.tv.PreviewChannel.Builder! setInternalProviderFlag2(long);
- method public androidx.tvprovider.media.tv.PreviewChannel.Builder! setInternalProviderFlag3(long);
- method public androidx.tvprovider.media.tv.PreviewChannel.Builder! setInternalProviderFlag4(long);
- method public androidx.tvprovider.media.tv.PreviewChannel.Builder! setInternalProviderId(String!);
- method public androidx.tvprovider.media.tv.PreviewChannel.Builder! setLogo(android.graphics.Bitmap);
- method public androidx.tvprovider.media.tv.PreviewChannel.Builder! setLogo(android.net.Uri);
- }
-
- @WorkerThread public class PreviewChannelHelper {
- ctor public PreviewChannelHelper(android.content.Context!);
- ctor public PreviewChannelHelper(android.content.Context!, int, int);
- method public void deletePreviewChannel(long);
- method public void deletePreviewProgram(long);
- method protected android.graphics.Bitmap! downloadBitmap(android.net.Uri) throws java.io.IOException;
- method public java.util.List<androidx.tvprovider.media.tv.PreviewChannel>! getAllChannels();
- method public androidx.tvprovider.media.tv.PreviewChannel! getPreviewChannel(long);
- method public androidx.tvprovider.media.tv.PreviewProgram! getPreviewProgram(long);
- method public androidx.tvprovider.media.tv.WatchNextProgram! getWatchNextProgram(long);
- method public long publishChannel(androidx.tvprovider.media.tv.PreviewChannel) throws java.io.IOException;
- method public long publishDefaultChannel(androidx.tvprovider.media.tv.PreviewChannel) throws java.io.IOException;
- method public long publishPreviewProgram(androidx.tvprovider.media.tv.PreviewProgram);
- method public long publishWatchNextProgram(androidx.tvprovider.media.tv.WatchNextProgram);
- method public void updatePreviewChannel(long, androidx.tvprovider.media.tv.PreviewChannel) throws java.io.IOException;
- method public void updatePreviewProgram(long, androidx.tvprovider.media.tv.PreviewProgram);
- method public void updateWatchNextProgram(androidx.tvprovider.media.tv.WatchNextProgram, long);
- }
-
- public final class PreviewProgram {
- method public static androidx.tvprovider.media.tv.PreviewProgram! fromCursor(android.database.Cursor!);
- method public String[]! getAudioLanguages();
- method public String! getAuthor();
- method public int getAvailability();
- method public String[]! getCanonicalGenres();
- method public long getChannelId();
- method public String! getContentId();
- method public android.media.tv.TvContentRating[]! getContentRatings();
- method public String! getDescription();
- method public int getDurationMillis();
- method public long getEndTimeUtcMillis();
- method public String! getEpisodeNumber();
- method public String! getEpisodeTitle();
- method public String! getGenre();
- method public long getId();
- method public android.content.Intent! getIntent() throws java.net.URISyntaxException;
- method public android.net.Uri! getIntentUri();
- method public long getInteractionCount();
- method public int getInteractionType();
- method public byte[]! getInternalProviderDataByteArray();
- method public Long! getInternalProviderFlag1();
- method public Long! getInternalProviderFlag2();
- method public Long! getInternalProviderFlag3();
- method public Long! getInternalProviderFlag4();
- method public String! getInternalProviderId();
- method public int getItemCount();
- method public int getLastPlaybackPositionMillis();
- method public String! getLogoContentDescription();
- method public android.net.Uri! getLogoUri();
- method public String! getLongDescription();
- method public String! getOfferPrice();
- method public int getPosterArtAspectRatio();
- method public android.net.Uri! getPosterArtUri();
- method public android.net.Uri! getPreviewAudioUri();
- method public android.net.Uri! getPreviewVideoUri();
- method public String! getReleaseDate();
- method public String! getReviewRating();
- method public int getReviewRatingStyle();
- method public String! getSeasonNumber();
- method public String! getSeasonTitle();
- method public long getStartTimeUtcMillis();
- method public String! getStartingPrice();
- method public int getThumbnailAspectRatio();
- method public android.net.Uri! getThumbnailUri();
- method public String! getTitle();
- method public int getTvSeriesItemType();
- method public int getType();
- method public int getVideoHeight();
- method public int getVideoWidth();
- method public int getWeight();
- method public boolean hasAnyUpdatedValues(androidx.tvprovider.media.tv.PreviewProgram!);
- method public boolean isBrowsable();
- method public boolean isLive();
- method public boolean isSearchable();
- method public boolean isTransient();
- method public android.content.ContentValues! toContentValues();
- }
-
- public static final class PreviewProgram.Builder {
- ctor public PreviewProgram.Builder();
- ctor public PreviewProgram.Builder(androidx.tvprovider.media.tv.PreviewProgram!);
- method public androidx.tvprovider.media.tv.PreviewProgram! build();
- method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setChannelId(long);
- method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setWeight(int);
- }
-
- public final class Program implements java.lang.Comparable<androidx.tvprovider.media.tv.Program> {
- method public int compareTo(androidx.tvprovider.media.tv.Program);
- method public static androidx.tvprovider.media.tv.Program! fromCursor(android.database.Cursor!);
- method public String[]! getAudioLanguages();
- method public String[]! getBroadcastGenres();
- method public String[]! getCanonicalGenres();
- method public long getChannelId();
- method public android.media.tv.TvContentRating[]! getContentRatings();
- method public String! getDescription();
- method public long getEndTimeUtcMillis();
- method public String! getEpisodeNumber();
- method public String! getEpisodeTitle();
- method public long getId();
- method public byte[]! getInternalProviderDataByteArray();
- method public Long! getInternalProviderFlag1();
- method public Long! getInternalProviderFlag2();
- method public Long! getInternalProviderFlag3();
- method public Long! getInternalProviderFlag4();
- method public String! getLongDescription();
- method public android.net.Uri! getPosterArtUri();
- method public String! getReviewRating();
- method public int getReviewRatingStyle();
- method public String! getSeasonNumber();
- method public String! getSeasonTitle();
- method public long getStartTimeUtcMillis();
- method public android.net.Uri! getThumbnailUri();
- method public String! getTitle();
- method public int getVideoHeight();
- method public int getVideoWidth();
- method public boolean isRecordingProhibited();
- method public boolean isSearchable();
- method public android.content.ContentValues! toContentValues();
- }
-
- public static class Program.Builder {
- ctor public Program.Builder();
- ctor public Program.Builder(androidx.tvprovider.media.tv.Program!);
- method public androidx.tvprovider.media.tv.Program! build();
- method public androidx.tvprovider.media.tv.Program.Builder! setBroadcastGenres(String[]!);
- method public androidx.tvprovider.media.tv.Program.Builder! setChannelId(long);
- method public androidx.tvprovider.media.tv.Program.Builder! setEndTimeUtcMillis(long);
- method public androidx.tvprovider.media.tv.Program.Builder! setRecordingProhibited(boolean);
- method public androidx.tvprovider.media.tv.Program.Builder! setStartTimeUtcMillis(long);
- }
-
- public final class TvContractCompat {
- method public static android.net.Uri! buildChannelLogoUri(long);
- method public static android.net.Uri! buildChannelLogoUri(android.net.Uri!);
- method public static android.net.Uri! buildChannelUri(long);
- method public static android.net.Uri! buildChannelUriForPassthroughInput(String!);
- method public static android.net.Uri! buildChannelsUriForInput(String?);
- method public static String! buildInputId(android.content.ComponentName!);
- method public static android.net.Uri! buildPreviewProgramUri(long);
- method public static android.net.Uri! buildPreviewProgramsUriForChannel(long);
- method public static android.net.Uri! buildPreviewProgramsUriForChannel(android.net.Uri!);
- method public static android.net.Uri! buildProgramUri(long);
- method public static android.net.Uri! buildProgramsUriForChannel(long);
- method public static android.net.Uri! buildProgramsUriForChannel(android.net.Uri!);
- method public static android.net.Uri! buildProgramsUriForChannel(long, long, long);
- method public static android.net.Uri! buildProgramsUriForChannel(android.net.Uri!, long, long);
- method public static android.net.Uri! buildRecordedProgramUri(long);
- method public static android.net.Uri! buildWatchNextProgramUri(long);
- method public static boolean isChannelUri(android.net.Uri!);
- method public static boolean isChannelUriForPassthroughInput(android.net.Uri!);
- method public static boolean isChannelUriForTunerInput(android.net.Uri!);
- method public static boolean isProgramUri(android.net.Uri!);
- method public static boolean isRecordedProgramUri(android.net.Uri!);
- method public static void requestChannelBrowsable(android.content.Context!, long);
- field public static final String ACTION_INITIALIZE_PROGRAMS = "android.media.tv.action.INITIALIZE_PROGRAMS";
- field public static final String ACTION_PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT = "android.media.tv.action.PREVIEW_PROGRAM_ADDED_TO_WATCH_NEXT";
- field public static final String ACTION_PREVIEW_PROGRAM_BROWSABLE_DISABLED = "android.media.tv.action.PREVIEW_PROGRAM_BROWSABLE_DISABLED";
- field public static final String ACTION_REQUEST_CHANNEL_BROWSABLE = "android.media.tv.action.REQUEST_CHANNEL_BROWSABLE";
- field public static final String ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED = "android.media.tv.action.WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED";
- field public static final String AUTHORITY = "android.media.tv";
- field public static final String EXTRA_CHANNEL_ID = "android.media.tv.extra.CHANNEL_ID";
- field public static final String EXTRA_PREVIEW_PROGRAM_ID = "android.media.tv.extra.PREVIEW_PROGRAM_ID";
- field public static final String EXTRA_WATCH_NEXT_PROGRAM_ID = "android.media.tv.extra.WATCH_NEXT_PROGRAM_ID";
- }
-
- public static interface TvContractCompat.BaseTvColumns extends android.provider.BaseColumns {
- field public static final String COLUMN_PACKAGE_NAME = "package_name";
- }
-
- public static final class TvContractCompat.Channels implements androidx.tvprovider.media.tv.TvContractCompat.BaseTvColumns {
- method public static String? getVideoResolution(String!);
- field public static final String COLUMN_APP_LINK_COLOR = "app_link_color";
- field public static final String COLUMN_APP_LINK_ICON_URI = "app_link_icon_uri";
- field public static final String COLUMN_APP_LINK_INTENT_URI = "app_link_intent_uri";
- field public static final String COLUMN_APP_LINK_POSTER_ART_URI = "app_link_poster_art_uri";
- field public static final String COLUMN_APP_LINK_TEXT = "app_link_text";
- field public static final String COLUMN_BROWSABLE = "browsable";
- field public static final String COLUMN_CONFIGURATION_DISPLAY_ORDER = "configuration_display_order";
- field public static final String COLUMN_DESCRIPTION = "description";
- field public static final String COLUMN_DISPLAY_NAME = "display_name";
- field public static final String COLUMN_DISPLAY_NUMBER = "display_number";
- field public static final String COLUMN_INPUT_ID = "input_id";
- field public static final String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
- field public static final String COLUMN_INTERNAL_PROVIDER_ID = "internal_provider_id";
- field public static final String COLUMN_LOCKED = "locked";
- field public static final String COLUMN_NETWORK_AFFILIATION = "network_affiliation";
- field public static final String COLUMN_ORIGINAL_NETWORK_ID = "original_network_id";
- field public static final String COLUMN_SEARCHABLE = "searchable";
- field public static final String COLUMN_SERVICE_ID = "service_id";
- field public static final String COLUMN_SERVICE_TYPE = "service_type";
- field public static final String COLUMN_SYSTEM_CHANNEL_KEY = "system_channel_key";
- field public static final String COLUMN_TRANSIENT = "transient";
- field public static final String COLUMN_TRANSPORT_STREAM_ID = "transport_stream_id";
- field public static final String COLUMN_TYPE = "type";
- field public static final String COLUMN_VERSION_NUMBER = "version_number";
- field public static final String COLUMN_VIDEO_FORMAT = "video_format";
- field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/channel";
- field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/channel";
- field public static final android.net.Uri! CONTENT_URI;
- field public static final String SERVICE_TYPE_AUDIO = "SERVICE_TYPE_AUDIO";
- field public static final String SERVICE_TYPE_AUDIO_VIDEO = "SERVICE_TYPE_AUDIO_VIDEO";
- field public static final String SERVICE_TYPE_OTHER = "SERVICE_TYPE_OTHER";
- field public static final String TYPE_1SEG = "TYPE_1SEG";
- field public static final String TYPE_ATSC_C = "TYPE_ATSC_C";
- field public static final String TYPE_ATSC_M_H = "TYPE_ATSC_M_H";
- field public static final String TYPE_ATSC_T = "TYPE_ATSC_T";
- field public static final String TYPE_CMMB = "TYPE_CMMB";
- field public static final String TYPE_DTMB = "TYPE_DTMB";
- field public static final String TYPE_DVB_C = "TYPE_DVB_C";
- field public static final String TYPE_DVB_C2 = "TYPE_DVB_C2";
- field public static final String TYPE_DVB_H = "TYPE_DVB_H";
- field public static final String TYPE_DVB_S = "TYPE_DVB_S";
- field public static final String TYPE_DVB_S2 = "TYPE_DVB_S2";
- field public static final String TYPE_DVB_SH = "TYPE_DVB_SH";
- field public static final String TYPE_DVB_T = "TYPE_DVB_T";
- field public static final String TYPE_DVB_T2 = "TYPE_DVB_T2";
- field public static final String TYPE_ISDB_C = "TYPE_ISDB_C";
- field public static final String TYPE_ISDB_S = "TYPE_ISDB_S";
- field public static final String TYPE_ISDB_T = "TYPE_ISDB_T";
- field public static final String TYPE_ISDB_TB = "TYPE_ISDB_TB";
- field public static final String TYPE_NTSC = "TYPE_NTSC";
- field public static final String TYPE_OTHER = "TYPE_OTHER";
- field public static final String TYPE_PAL = "TYPE_PAL";
- field public static final String TYPE_PREVIEW = "TYPE_PREVIEW";
- field public static final String TYPE_SECAM = "TYPE_SECAM";
- field public static final String TYPE_S_DMB = "TYPE_S_DMB";
- field public static final String TYPE_T_DMB = "TYPE_T_DMB";
- field public static final String VIDEO_FORMAT_1080I = "VIDEO_FORMAT_1080I";
- field public static final String VIDEO_FORMAT_1080P = "VIDEO_FORMAT_1080P";
- field public static final String VIDEO_FORMAT_2160P = "VIDEO_FORMAT_2160P";
- field public static final String VIDEO_FORMAT_240P = "VIDEO_FORMAT_240P";
- field public static final String VIDEO_FORMAT_360P = "VIDEO_FORMAT_360P";
- field public static final String VIDEO_FORMAT_4320P = "VIDEO_FORMAT_4320P";
- field public static final String VIDEO_FORMAT_480I = "VIDEO_FORMAT_480I";
- field public static final String VIDEO_FORMAT_480P = "VIDEO_FORMAT_480P";
- field public static final String VIDEO_FORMAT_576I = "VIDEO_FORMAT_576I";
- field public static final String VIDEO_FORMAT_576P = "VIDEO_FORMAT_576P";
- field public static final String VIDEO_FORMAT_720P = "VIDEO_FORMAT_720P";
- field public static final String VIDEO_RESOLUTION_ED = "VIDEO_RESOLUTION_ED";
- field public static final String VIDEO_RESOLUTION_FHD = "VIDEO_RESOLUTION_FHD";
- field public static final String VIDEO_RESOLUTION_HD = "VIDEO_RESOLUTION_HD";
- field public static final String VIDEO_RESOLUTION_SD = "VIDEO_RESOLUTION_SD";
- field public static final String VIDEO_RESOLUTION_UHD = "VIDEO_RESOLUTION_UHD";
- }
-
- public static final class TvContractCompat.Channels.Logo {
- field public static final String CONTENT_DIRECTORY = "logo";
- }
-
- public static final class TvContractCompat.PreviewPrograms implements androidx.tvprovider.media.tv.TvContractCompat.BaseTvColumns {
- field public static final int ASPECT_RATIO_16_9 = 0; // 0x0
- field public static final int ASPECT_RATIO_1_1 = 3; // 0x3
- field public static final int ASPECT_RATIO_2_3 = 4; // 0x4
- field public static final int ASPECT_RATIO_3_2 = 1; // 0x1
- field public static final int ASPECT_RATIO_4_3 = 2; // 0x2
- field public static final int ASPECT_RATIO_MOVIE_POSTER = 5; // 0x5
- field public static final int AVAILABILITY_AVAILABLE = 0; // 0x0
- field public static final int AVAILABILITY_FREE = 4; // 0x4
- field public static final int AVAILABILITY_FREE_WITH_SUBSCRIPTION = 1; // 0x1
- field public static final int AVAILABILITY_PAID_CONTENT = 2; // 0x2
- field public static final int AVAILABILITY_PURCHASED = 3; // 0x3
- field public static final String COLUMN_AUDIO_LANGUAGE = "audio_language";
- field public static final String COLUMN_AUTHOR = "author";
- field public static final String COLUMN_AVAILABILITY = "availability";
- field public static final String COLUMN_BROWSABLE = "browsable";
- field public static final String COLUMN_CANONICAL_GENRE = "canonical_genre";
- field public static final String COLUMN_CHANNEL_ID = "channel_id";
- field public static final String COLUMN_CONTENT_ID = "content_id";
- field public static final String COLUMN_CONTENT_RATING = "content_rating";
- field public static final String COLUMN_DURATION_MILLIS = "duration_millis";
- field public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
- field public static final String COLUMN_EPISODE_DISPLAY_NUMBER = "episode_display_number";
- field public static final String COLUMN_EPISODE_TITLE = "episode_title";
- field public static final String COLUMN_GENRE = "genre";
- field public static final String COLUMN_INTENT_URI = "intent_uri";
- field public static final String COLUMN_INTERACTION_COUNT = "interaction_count";
- field public static final String COLUMN_INTERACTION_TYPE = "interaction_type";
- field public static final String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
- field public static final String COLUMN_INTERNAL_PROVIDER_ID = "internal_provider_id";
- field public static final String COLUMN_ITEM_COUNT = "item_count";
- field public static final String COLUMN_LAST_PLAYBACK_POSITION_MILLIS = "last_playback_position_millis";
- field public static final String COLUMN_LIVE = "live";
- field public static final String COLUMN_LOGO_CONTENT_DESCRIPTION = "logo_content_description";
- field public static final String COLUMN_LOGO_URI = "logo_uri";
- field public static final String COLUMN_LONG_DESCRIPTION = "long_description";
- field public static final String COLUMN_OFFER_PRICE = "offer_price";
- field public static final String COLUMN_POSTER_ART_ASPECT_RATIO = "poster_art_aspect_ratio";
- field public static final String COLUMN_POSTER_ART_URI = "poster_art_uri";
- field public static final String COLUMN_PREVIEW_AUDIO_URI = "preview_audio_uri";
- field public static final String COLUMN_PREVIEW_VIDEO_URI = "preview_video_uri";
- field public static final String COLUMN_RELEASE_DATE = "release_date";
- field public static final String COLUMN_REVIEW_RATING = "review_rating";
- field public static final String COLUMN_REVIEW_RATING_STYLE = "review_rating_style";
- field public static final String COLUMN_SEARCHABLE = "searchable";
- field public static final String COLUMN_SEASON_DISPLAY_NUMBER = "season_display_number";
- field public static final String COLUMN_SEASON_TITLE = "season_title";
- field public static final String COLUMN_SHORT_DESCRIPTION = "short_description";
- field public static final String COLUMN_STARTING_PRICE = "starting_price";
- field public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
- field public static final String COLUMN_THUMBNAIL_ASPECT_RATIO = "poster_thumbnail_aspect_ratio";
- field public static final String COLUMN_THUMBNAIL_URI = "thumbnail_uri";
- field public static final String COLUMN_TITLE = "title";
- field public static final String COLUMN_TRANSIENT = "transient";
- field public static final String COLUMN_TV_SERIES_ITEM_TYPE = "tv_series_item_type";
- field public static final String COLUMN_TYPE = "type";
- field public static final String COLUMN_VERSION_NUMBER = "version_number";
- field public static final String COLUMN_VIDEO_HEIGHT = "video_height";
- field public static final String COLUMN_VIDEO_WIDTH = "video_width";
- field public static final String COLUMN_WEIGHT = "weight";
- field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/preview_program";
- field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/preview_program";
- field public static final android.net.Uri! CONTENT_URI;
- field public static final int INTERACTION_TYPE_FANS = 3; // 0x3
- field public static final int INTERACTION_TYPE_FOLLOWERS = 2; // 0x2
- field public static final int INTERACTION_TYPE_LIKES = 4; // 0x4
- field public static final int INTERACTION_TYPE_LISTENS = 1; // 0x1
- field public static final int INTERACTION_TYPE_THUMBS = 5; // 0x5
- field public static final int INTERACTION_TYPE_VIEWERS = 6; // 0x6
- field public static final int INTERACTION_TYPE_VIEWS = 0; // 0x0
- field public static final int REVIEW_RATING_STYLE_PERCENTAGE = 2; // 0x2
- field public static final int REVIEW_RATING_STYLE_STARS = 0; // 0x0
- field public static final int REVIEW_RATING_STYLE_THUMBS_UP_DOWN = 1; // 0x1
- field public static final int TV_SERIES_ITEM_TYPE_CHAPTER = 1; // 0x1
- field public static final int TV_SERIES_ITEM_TYPE_EPISODE = 0; // 0x0
- field public static final int TYPE_ALBUM = 8; // 0x8
- field public static final int TYPE_ARTIST = 9; // 0x9
- field public static final int TYPE_CHANNEL = 6; // 0x6
- field public static final int TYPE_CLIP = 4; // 0x4
- field public static final int TYPE_EVENT = 5; // 0x5
- field public static final int TYPE_GAME = 12; // 0xc
- field public static final int TYPE_MOVIE = 0; // 0x0
- field public static final int TYPE_PLAYLIST = 10; // 0xa
- field public static final int TYPE_STATION = 11; // 0xb
- field public static final int TYPE_TRACK = 7; // 0x7
- field public static final int TYPE_TV_EPISODE = 3; // 0x3
- field public static final int TYPE_TV_SEASON = 2; // 0x2
- field public static final int TYPE_TV_SERIES = 1; // 0x1
- }
-
- public static final class TvContractCompat.Programs implements androidx.tvprovider.media.tv.TvContractCompat.BaseTvColumns {
- field public static final String COLUMN_AUDIO_LANGUAGE = "audio_language";
- field public static final String COLUMN_BROADCAST_GENRE = "broadcast_genre";
- field public static final String COLUMN_CANONICAL_GENRE = "canonical_genre";
- field public static final String COLUMN_CHANNEL_ID = "channel_id";
- field public static final String COLUMN_CONTENT_RATING = "content_rating";
- field public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
- field public static final String COLUMN_EPISODE_DISPLAY_NUMBER = "episode_display_number";
- field @Deprecated public static final String COLUMN_EPISODE_NUMBER = "episode_number";
- field public static final String COLUMN_EPISODE_TITLE = "episode_title";
- field public static final String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
- field public static final String COLUMN_LONG_DESCRIPTION = "long_description";
- field public static final String COLUMN_POSTER_ART_URI = "poster_art_uri";
- field public static final String COLUMN_RECORDING_PROHIBITED = "recording_prohibited";
- field public static final String COLUMN_REVIEW_RATING = "review_rating";
- field public static final String COLUMN_REVIEW_RATING_STYLE = "review_rating_style";
- field public static final String COLUMN_SEARCHABLE = "searchable";
- field public static final String COLUMN_SEASON_DISPLAY_NUMBER = "season_display_number";
- field @Deprecated public static final String COLUMN_SEASON_NUMBER = "season_number";
- field public static final String COLUMN_SEASON_TITLE = "season_title";
- field public static final String COLUMN_SHORT_DESCRIPTION = "short_description";
- field public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
- field public static final String COLUMN_THUMBNAIL_URI = "thumbnail_uri";
- field public static final String COLUMN_TITLE = "title";
- field public static final String COLUMN_VERSION_NUMBER = "version_number";
- field public static final String COLUMN_VIDEO_HEIGHT = "video_height";
- field public static final String COLUMN_VIDEO_WIDTH = "video_width";
- field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/program";
- field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/program";
- field public static final android.net.Uri! CONTENT_URI;
- field public static final int REVIEW_RATING_STYLE_PERCENTAGE = 2; // 0x2
- field public static final int REVIEW_RATING_STYLE_STARS = 0; // 0x0
- field public static final int REVIEW_RATING_STYLE_THUMBS_UP_DOWN = 1; // 0x1
- }
-
- public static final class TvContractCompat.Programs.Genres {
- method public static String[]! decode(String);
- method public static String! encode(java.lang.String...);
- method public static boolean isCanonical(String!);
- field public static final String ANIMAL_WILDLIFE = "ANIMAL_WILDLIFE";
- field public static final String ARTS = "ARTS";
- field public static final String COMEDY = "COMEDY";
- field public static final String DRAMA = "DRAMA";
- field public static final String EDUCATION = "EDUCATION";
- field public static final String ENTERTAINMENT = "ENTERTAINMENT";
- field public static final String FAMILY_KIDS = "FAMILY_KIDS";
- field public static final String GAMING = "GAMING";
- field public static final String LIFE_STYLE = "LIFE_STYLE";
- field public static final String MOVIES = "MOVIES";
- field public static final String MUSIC = "MUSIC";
- field public static final String NEWS = "NEWS";
- field public static final String PREMIER = "PREMIER";
- field public static final String SHOPPING = "SHOPPING";
- field public static final String SPORTS = "SPORTS";
- field public static final String TECH_SCIENCE = "TECH_SCIENCE";
- field public static final String TRAVEL = "TRAVEL";
- }
-
- public static final class TvContractCompat.RecordedPrograms implements androidx.tvprovider.media.tv.TvContractCompat.BaseTvColumns {
- field public static final String COLUMN_AUDIO_LANGUAGE = "audio_language";
- field public static final String COLUMN_BROADCAST_GENRE = "broadcast_genre";
- field public static final String COLUMN_CANONICAL_GENRE = "canonical_genre";
- field public static final String COLUMN_CHANNEL_ID = "channel_id";
- field public static final String COLUMN_CONTENT_RATING = "content_rating";
- field public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
- field public static final String COLUMN_EPISODE_DISPLAY_NUMBER = "episode_display_number";
- field public static final String COLUMN_EPISODE_TITLE = "episode_title";
- field public static final String COLUMN_INPUT_ID = "input_id";
- field public static final String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
- field public static final String COLUMN_LONG_DESCRIPTION = "long_description";
- field public static final String COLUMN_POSTER_ART_URI = "poster_art_uri";
- field public static final String COLUMN_RECORDING_DATA_BYTES = "recording_data_bytes";
- field public static final String COLUMN_RECORDING_DATA_URI = "recording_data_uri";
- field public static final String COLUMN_RECORDING_DURATION_MILLIS = "recording_duration_millis";
- field public static final String COLUMN_RECORDING_EXPIRE_TIME_UTC_MILLIS = "recording_expire_time_utc_millis";
- field public static final String COLUMN_REVIEW_RATING = "review_rating";
- field public static final String COLUMN_REVIEW_RATING_STYLE = "review_rating_style";
- field public static final String COLUMN_SEARCHABLE = "searchable";
- field public static final String COLUMN_SEASON_DISPLAY_NUMBER = "season_display_number";
- field public static final String COLUMN_SEASON_TITLE = "season_title";
- field public static final String COLUMN_SHORT_DESCRIPTION = "short_description";
- field public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
- field public static final String COLUMN_THUMBNAIL_URI = "thumbnail_uri";
- field public static final String COLUMN_TITLE = "title";
- field public static final String COLUMN_VERSION_NUMBER = "version_number";
- field public static final String COLUMN_VIDEO_HEIGHT = "video_height";
- field public static final String COLUMN_VIDEO_WIDTH = "video_width";
- field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/recorded_program";
- field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/recorded_program";
- field public static final android.net.Uri! CONTENT_URI;
- field public static final int REVIEW_RATING_STYLE_PERCENTAGE = 2; // 0x2
- field public static final int REVIEW_RATING_STYLE_STARS = 0; // 0x0
- field public static final int REVIEW_RATING_STYLE_THUMBS_UP_DOWN = 1; // 0x1
- }
-
- public static final class TvContractCompat.WatchNextPrograms implements androidx.tvprovider.media.tv.TvContractCompat.BaseTvColumns {
- field public static final int ASPECT_RATIO_16_9 = 0; // 0x0
- field public static final int ASPECT_RATIO_1_1 = 3; // 0x3
- field public static final int ASPECT_RATIO_2_3 = 4; // 0x4
- field public static final int ASPECT_RATIO_3_2 = 1; // 0x1
- field public static final int ASPECT_RATIO_4_3 = 2; // 0x2
- field public static final int ASPECT_RATIO_MOVIE_POSTER = 5; // 0x5
- field public static final int AVAILABILITY_AVAILABLE = 0; // 0x0
- field public static final int AVAILABILITY_FREE = 4; // 0x4
- field public static final int AVAILABILITY_FREE_WITH_SUBSCRIPTION = 1; // 0x1
- field public static final int AVAILABILITY_PAID_CONTENT = 2; // 0x2
- field public static final int AVAILABILITY_PURCHASED = 3; // 0x3
- field public static final String COLUMN_AUDIO_LANGUAGE = "audio_language";
- field public static final String COLUMN_AUTHOR = "author";
- field public static final String COLUMN_AVAILABILITY = "availability";
- field public static final String COLUMN_BROWSABLE = "browsable";
- field public static final String COLUMN_CANONICAL_GENRE = "canonical_genre";
- field public static final String COLUMN_CONTENT_ID = "content_id";
- field public static final String COLUMN_CONTENT_RATING = "content_rating";
- field public static final String COLUMN_DURATION_MILLIS = "duration_millis";
- field public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
- field public static final String COLUMN_EPISODE_DISPLAY_NUMBER = "episode_display_number";
- field public static final String COLUMN_EPISODE_TITLE = "episode_title";
- field public static final String COLUMN_GENRE = "genre";
- field public static final String COLUMN_INTENT_URI = "intent_uri";
- field public static final String COLUMN_INTERACTION_COUNT = "interaction_count";
- field public static final String COLUMN_INTERACTION_TYPE = "interaction_type";
- field public static final String COLUMN_INTERNAL_PROVIDER_DATA = "internal_provider_data";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG1 = "internal_provider_flag1";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG2 = "internal_provider_flag2";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG3 = "internal_provider_flag3";
- field public static final String COLUMN_INTERNAL_PROVIDER_FLAG4 = "internal_provider_flag4";
- field public static final String COLUMN_INTERNAL_PROVIDER_ID = "internal_provider_id";
- field public static final String COLUMN_ITEM_COUNT = "item_count";
- field public static final String COLUMN_LAST_ENGAGEMENT_TIME_UTC_MILLIS = "last_engagement_time_utc_millis";
- field public static final String COLUMN_LAST_PLAYBACK_POSITION_MILLIS = "last_playback_position_millis";
- field public static final String COLUMN_LIVE = "live";
- field public static final String COLUMN_LOGO_CONTENT_DESCRIPTION = "logo_content_description";
- field public static final String COLUMN_LOGO_URI = "logo_uri";
- field public static final String COLUMN_LONG_DESCRIPTION = "long_description";
- field public static final String COLUMN_OFFER_PRICE = "offer_price";
- field public static final String COLUMN_POSTER_ART_ASPECT_RATIO = "poster_art_aspect_ratio";
- field public static final String COLUMN_POSTER_ART_URI = "poster_art_uri";
- field public static final String COLUMN_PREVIEW_AUDIO_URI = "preview_audio_uri";
- field public static final String COLUMN_PREVIEW_VIDEO_URI = "preview_video_uri";
- field public static final String COLUMN_RELEASE_DATE = "release_date";
- field public static final String COLUMN_REVIEW_RATING = "review_rating";
- field public static final String COLUMN_REVIEW_RATING_STYLE = "review_rating_style";
- field public static final String COLUMN_SEARCHABLE = "searchable";
- field public static final String COLUMN_SEASON_DISPLAY_NUMBER = "season_display_number";
- field public static final String COLUMN_SEASON_TITLE = "season_title";
- field public static final String COLUMN_SHORT_DESCRIPTION = "short_description";
- field public static final String COLUMN_STARTING_PRICE = "starting_price";
- field public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
- field public static final String COLUMN_THUMBNAIL_ASPECT_RATIO = "poster_thumbnail_aspect_ratio";
- field public static final String COLUMN_THUMBNAIL_URI = "thumbnail_uri";
- field public static final String COLUMN_TITLE = "title";
- field public static final String COLUMN_TRANSIENT = "transient";
- field public static final String COLUMN_TV_SERIES_ITEM_TYPE = "tv_series_item_type";
- field public static final String COLUMN_TYPE = "type";
- field public static final String COLUMN_VERSION_NUMBER = "version_number";
- field public static final String COLUMN_VIDEO_HEIGHT = "video_height";
- field public static final String COLUMN_VIDEO_WIDTH = "video_width";
- field public static final String COLUMN_WATCH_NEXT_TYPE = "watch_next_type";
- field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/watch_next_program";
- field public static final String CONTENT_TYPE = "vnd.android.cursor.dir/watch_next_program";
- field public static final android.net.Uri! CONTENT_URI;
- field public static final int INTERACTION_TYPE_FANS = 3; // 0x3
- field public static final int INTERACTION_TYPE_FOLLOWERS = 2; // 0x2
- field public static final int INTERACTION_TYPE_LIKES = 4; // 0x4
- field public static final int INTERACTION_TYPE_LISTENS = 1; // 0x1
- field public static final int INTERACTION_TYPE_THUMBS = 5; // 0x5
- field public static final int INTERACTION_TYPE_VIEWERS = 6; // 0x6
- field public static final int INTERACTION_TYPE_VIEWS = 0; // 0x0
- field public static final int REVIEW_RATING_STYLE_PERCENTAGE = 2; // 0x2
- field public static final int REVIEW_RATING_STYLE_STARS = 0; // 0x0
- field public static final int REVIEW_RATING_STYLE_THUMBS_UP_DOWN = 1; // 0x1
- field public static final int TV_SERIES_ITEM_TYPE_CHAPTER = 1; // 0x1
- field public static final int TV_SERIES_ITEM_TYPE_EPISODE = 0; // 0x0
- field public static final int TYPE_ALBUM = 8; // 0x8
- field public static final int TYPE_ARTIST = 9; // 0x9
- field public static final int TYPE_CHANNEL = 6; // 0x6
- field public static final int TYPE_CLIP = 4; // 0x4
- field public static final int TYPE_EVENT = 5; // 0x5
- field public static final int TYPE_GAME = 12; // 0xc
- field public static final int TYPE_MOVIE = 0; // 0x0
- field public static final int TYPE_PLAYLIST = 10; // 0xa
- field public static final int TYPE_STATION = 11; // 0xb
- field public static final int TYPE_TRACK = 7; // 0x7
- field public static final int TYPE_TV_EPISODE = 3; // 0x3
- field public static final int TYPE_TV_SEASON = 2; // 0x2
- field public static final int TYPE_TV_SERIES = 1; // 0x1
- field public static final int WATCH_NEXT_TYPE_CONTINUE = 0; // 0x0
- field public static final int WATCH_NEXT_TYPE_NEW = 2; // 0x2
- field public static final int WATCH_NEXT_TYPE_NEXT = 1; // 0x1
- field public static final int WATCH_NEXT_TYPE_WATCHLIST = 3; // 0x3
- }
-
- public final class WatchNextProgram {
- method public static androidx.tvprovider.media.tv.WatchNextProgram! fromCursor(android.database.Cursor!);
- method public String[]! getAudioLanguages();
- method public String! getAuthor();
- method public int getAvailability();
- method public String[]! getCanonicalGenres();
- method public String! getContentId();
- method public android.media.tv.TvContentRating[]! getContentRatings();
- method public String! getDescription();
- method public int getDurationMillis();
- method public long getEndTimeUtcMillis();
- method public String! getEpisodeNumber();
- method public String! getEpisodeTitle();
- method public String! getGenre();
- method public long getId();
- method public android.content.Intent! getIntent() throws java.net.URISyntaxException;
- method public android.net.Uri! getIntentUri();
- method public long getInteractionCount();
- method public int getInteractionType();
- method public byte[]! getInternalProviderDataByteArray();
- method public Long! getInternalProviderFlag1();
- method public Long! getInternalProviderFlag2();
- method public Long! getInternalProviderFlag3();
- method public Long! getInternalProviderFlag4();
- method public String! getInternalProviderId();
- method public int getItemCount();
- method public long getLastEngagementTimeUtcMillis();
- method public int getLastPlaybackPositionMillis();
- method public String! getLogoContentDescription();
- method public android.net.Uri! getLogoUri();
- method public String! getLongDescription();
- method public String! getOfferPrice();
- method public int getPosterArtAspectRatio();
- method public android.net.Uri! getPosterArtUri();
- method public android.net.Uri! getPreviewAudioUri();
- method public android.net.Uri! getPreviewVideoUri();
- method public String! getReleaseDate();
- method public String! getReviewRating();
- method public int getReviewRatingStyle();
- method public String! getSeasonNumber();
- method public String! getSeasonTitle();
- method public long getStartTimeUtcMillis();
- method public String! getStartingPrice();
- method public int getThumbnailAspectRatio();
- method public android.net.Uri! getThumbnailUri();
- method public String! getTitle();
- method public int getTvSeriesItemType();
- method public int getType();
- method public int getVideoHeight();
- method public int getVideoWidth();
- method public int getWatchNextType();
- method public boolean hasAnyUpdatedValues(androidx.tvprovider.media.tv.WatchNextProgram!);
- method public boolean isBrowsable();
- method public boolean isLive();
- method public boolean isSearchable();
- method public boolean isTransient();
- method public android.content.ContentValues! toContentValues();
- field public static final int WATCH_NEXT_TYPE_UNKNOWN = -1; // 0xffffffff
- }
-
- public static final class WatchNextProgram.Builder {
- ctor public WatchNextProgram.Builder();
- ctor public WatchNextProgram.Builder(androidx.tvprovider.media.tv.WatchNextProgram!);
- method public androidx.tvprovider.media.tv.WatchNextProgram! build();
- method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLastEngagementTimeUtcMillis(long);
- method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setWatchNextType(int);
- }
-
-}
-
diff --git a/tv-provider/api/current.txt b/tv-provider/api/current.txt
index a3dc91d..78580f3 100644
--- a/tv-provider/api/current.txt
+++ b/tv-provider/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.tvprovider.media.tv {
public final class Channel {
@@ -137,60 +137,9 @@
public final class PreviewProgram {
method public static androidx.tvprovider.media.tv.PreviewProgram! fromCursor(android.database.Cursor!);
- method public String[]! getAudioLanguages();
- method public String! getAuthor();
- method public int getAvailability();
- method public String[]! getCanonicalGenres();
method public long getChannelId();
- method public String! getContentId();
- method public android.media.tv.TvContentRating[]! getContentRatings();
- method public String! getDescription();
- method public int getDurationMillis();
- method public long getEndTimeUtcMillis();
- method public String! getEpisodeNumber();
- method public String! getEpisodeTitle();
- method public String! getGenre();
- method public long getId();
- method public android.content.Intent! getIntent() throws java.net.URISyntaxException;
- method public android.net.Uri! getIntentUri();
- method public long getInteractionCount();
- method public int getInteractionType();
- method public byte[]! getInternalProviderDataByteArray();
- method public Long! getInternalProviderFlag1();
- method public Long! getInternalProviderFlag2();
- method public Long! getInternalProviderFlag3();
- method public Long! getInternalProviderFlag4();
- method public String! getInternalProviderId();
- method public int getItemCount();
- method public int getLastPlaybackPositionMillis();
- method public String! getLogoContentDescription();
- method public android.net.Uri! getLogoUri();
- method public String! getLongDescription();
- method public String! getOfferPrice();
- method public int getPosterArtAspectRatio();
- method public android.net.Uri! getPosterArtUri();
- method public android.net.Uri! getPreviewAudioUri();
- method public android.net.Uri! getPreviewVideoUri();
- method public String! getReleaseDate();
- method public String! getReviewRating();
- method public int getReviewRatingStyle();
- method public String! getSeasonNumber();
- method public String! getSeasonTitle();
- method public long getStartTimeUtcMillis();
- method public String! getStartingPrice();
- method public int getThumbnailAspectRatio();
- method public android.net.Uri! getThumbnailUri();
- method public String! getTitle();
- method public int getTvSeriesItemType();
- method public int getType();
- method public int getVideoHeight();
- method public int getVideoWidth();
method public int getWeight();
method public boolean hasAnyUpdatedValues(androidx.tvprovider.media.tv.PreviewProgram!);
- method public boolean isBrowsable();
- method public boolean isLive();
- method public boolean isSearchable();
- method public boolean isTransient();
method public android.content.ContentValues! toContentValues();
}
@@ -198,41 +147,73 @@
ctor public PreviewProgram.Builder();
ctor public PreviewProgram.Builder(androidx.tvprovider.media.tv.PreviewProgram!);
method public androidx.tvprovider.media.tv.PreviewProgram! build();
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setAudioLanguages(String[]!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setAuthor(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setAvailability(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setBrowsable(boolean);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setCanonicalGenres(String[]!);
method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setChannelId(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setContentId(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setContentRatings(android.media.tv.TvContentRating[]!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setDescription(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setDurationMillis(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setEndTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setEpisodeNumber(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setEpisodeNumber(String!, int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setEpisodeTitle(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setGenre(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setId(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setIntent(android.content.Intent!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setIntentUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInteractionCount(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInteractionType(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInternalProviderData(byte[]!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInternalProviderFlag1(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInternalProviderFlag2(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInternalProviderFlag3(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInternalProviderFlag4(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setInternalProviderId(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setItemCount(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setLastPlaybackPositionMillis(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setLive(boolean);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setLogoContentDescription(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setLogoUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setLongDescription(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setOfferPrice(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setPackageName(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setPosterArtAspectRatio(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setPosterArtUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setPreviewAudioUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setPreviewVideoUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setReleaseDate(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setReleaseDate(java.util.Date!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setReviewRating(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setReviewRatingStyle(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setSearchable(boolean);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setSeasonNumber(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setSeasonNumber(String!, int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setSeasonTitle(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setStartTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setStartingPrice(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setThumbnailAspectRatio(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setThumbnailUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setTitle(String!);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setTransient(boolean);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setTvSeriesItemType(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setType(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setVideoHeight(int);
+ method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setVideoWidth(int);
method public androidx.tvprovider.media.tv.PreviewProgram.Builder! setWeight(int);
}
public final class Program implements java.lang.Comparable<androidx.tvprovider.media.tv.Program> {
method public int compareTo(androidx.tvprovider.media.tv.Program);
method public static androidx.tvprovider.media.tv.Program! fromCursor(android.database.Cursor!);
- method public String[]! getAudioLanguages();
method public String[]! getBroadcastGenres();
- method public String[]! getCanonicalGenres();
method public long getChannelId();
- method public android.media.tv.TvContentRating[]! getContentRatings();
- method public String! getDescription();
method public long getEndTimeUtcMillis();
- method public String! getEpisodeNumber();
- method public String! getEpisodeTitle();
- method public long getId();
- method public byte[]! getInternalProviderDataByteArray();
- method public Long! getInternalProviderFlag1();
- method public Long! getInternalProviderFlag2();
- method public Long! getInternalProviderFlag3();
- method public Long! getInternalProviderFlag4();
- method public String! getLongDescription();
- method public android.net.Uri! getPosterArtUri();
- method public String! getReviewRating();
- method public int getReviewRatingStyle();
- method public String! getSeasonNumber();
- method public String! getSeasonTitle();
method public long getStartTimeUtcMillis();
- method public android.net.Uri! getThumbnailUri();
- method public String! getTitle();
- method public int getVideoHeight();
- method public int getVideoWidth();
method public boolean isRecordingProhibited();
- method public boolean isSearchable();
method public android.content.ContentValues! toContentValues();
}
@@ -240,11 +221,37 @@
ctor public Program.Builder();
ctor public Program.Builder(androidx.tvprovider.media.tv.Program!);
method public androidx.tvprovider.media.tv.Program! build();
+ method public androidx.tvprovider.media.tv.Program.Builder! setAudioLanguages(String[]!);
method public androidx.tvprovider.media.tv.Program.Builder! setBroadcastGenres(String[]!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setCanonicalGenres(String[]!);
method public androidx.tvprovider.media.tv.Program.Builder! setChannelId(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setContentRatings(android.media.tv.TvContentRating[]!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setDescription(String!);
method public androidx.tvprovider.media.tv.Program.Builder! setEndTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setEpisodeNumber(int);
+ method public androidx.tvprovider.media.tv.Program.Builder! setEpisodeNumber(String!, int);
+ method public androidx.tvprovider.media.tv.Program.Builder! setEpisodeTitle(String!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setId(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setInternalProviderData(byte[]!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setInternalProviderFlag1(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setInternalProviderFlag2(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setInternalProviderFlag3(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setInternalProviderFlag4(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setLongDescription(String!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setPackageName(String!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setPosterArtUri(android.net.Uri!);
method public androidx.tvprovider.media.tv.Program.Builder! setRecordingProhibited(boolean);
+ method public androidx.tvprovider.media.tv.Program.Builder! setReviewRating(String!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setReviewRatingStyle(int);
+ method public androidx.tvprovider.media.tv.Program.Builder! setSearchable(boolean);
+ method public androidx.tvprovider.media.tv.Program.Builder! setSeasonNumber(int);
+ method public androidx.tvprovider.media.tv.Program.Builder! setSeasonNumber(String!, int);
+ method public androidx.tvprovider.media.tv.Program.Builder! setSeasonTitle(String!);
method public androidx.tvprovider.media.tv.Program.Builder! setStartTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.Program.Builder! setThumbnailUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setTitle(String!);
+ method public androidx.tvprovider.media.tv.Program.Builder! setVideoHeight(int);
+ method public androidx.tvprovider.media.tv.Program.Builder! setVideoWidth(int);
}
public final class TvContractCompat {
@@ -666,60 +673,9 @@
public final class WatchNextProgram {
method public static androidx.tvprovider.media.tv.WatchNextProgram! fromCursor(android.database.Cursor!);
- method public String[]! getAudioLanguages();
- method public String! getAuthor();
- method public int getAvailability();
- method public String[]! getCanonicalGenres();
- method public String! getContentId();
- method public android.media.tv.TvContentRating[]! getContentRatings();
- method public String! getDescription();
- method public int getDurationMillis();
- method public long getEndTimeUtcMillis();
- method public String! getEpisodeNumber();
- method public String! getEpisodeTitle();
- method public String! getGenre();
- method public long getId();
- method public android.content.Intent! getIntent() throws java.net.URISyntaxException;
- method public android.net.Uri! getIntentUri();
- method public long getInteractionCount();
- method public int getInteractionType();
- method public byte[]! getInternalProviderDataByteArray();
- method public Long! getInternalProviderFlag1();
- method public Long! getInternalProviderFlag2();
- method public Long! getInternalProviderFlag3();
- method public Long! getInternalProviderFlag4();
- method public String! getInternalProviderId();
- method public int getItemCount();
method public long getLastEngagementTimeUtcMillis();
- method public int getLastPlaybackPositionMillis();
- method public String! getLogoContentDescription();
- method public android.net.Uri! getLogoUri();
- method public String! getLongDescription();
- method public String! getOfferPrice();
- method public int getPosterArtAspectRatio();
- method public android.net.Uri! getPosterArtUri();
- method public android.net.Uri! getPreviewAudioUri();
- method public android.net.Uri! getPreviewVideoUri();
- method public String! getReleaseDate();
- method public String! getReviewRating();
- method public int getReviewRatingStyle();
- method public String! getSeasonNumber();
- method public String! getSeasonTitle();
- method public long getStartTimeUtcMillis();
- method public String! getStartingPrice();
- method public int getThumbnailAspectRatio();
- method public android.net.Uri! getThumbnailUri();
- method public String! getTitle();
- method public int getTvSeriesItemType();
- method public int getType();
- method public int getVideoHeight();
- method public int getVideoWidth();
method public int getWatchNextType();
method public boolean hasAnyUpdatedValues(androidx.tvprovider.media.tv.WatchNextProgram!);
- method public boolean isBrowsable();
- method public boolean isLive();
- method public boolean isSearchable();
- method public boolean isTransient();
method public android.content.ContentValues! toContentValues();
field public static final int WATCH_NEXT_TYPE_UNKNOWN = -1; // 0xffffffff
}
@@ -728,7 +684,62 @@
ctor public WatchNextProgram.Builder();
ctor public WatchNextProgram.Builder(androidx.tvprovider.media.tv.WatchNextProgram!);
method public androidx.tvprovider.media.tv.WatchNextProgram! build();
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setAudioLanguages(String[]!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setAuthor(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setAvailability(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setBrowsable(boolean);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setCanonicalGenres(String[]!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setContentId(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setContentRatings(android.media.tv.TvContentRating[]!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setDescription(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setDurationMillis(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setEndTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setEpisodeNumber(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setEpisodeNumber(String!, int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setEpisodeTitle(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setGenre(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setId(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setIntent(android.content.Intent!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setIntentUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInteractionCount(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInteractionType(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInternalProviderData(byte[]!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInternalProviderFlag1(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInternalProviderFlag2(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInternalProviderFlag3(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInternalProviderFlag4(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setInternalProviderId(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setItemCount(int);
method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLastEngagementTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLastPlaybackPositionMillis(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLive(boolean);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLogoContentDescription(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLogoUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setLongDescription(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setOfferPrice(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setPackageName(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setPosterArtAspectRatio(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setPosterArtUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setPreviewAudioUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setPreviewVideoUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setReleaseDate(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setReleaseDate(java.util.Date!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setReviewRating(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setReviewRatingStyle(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setSearchable(boolean);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setSeasonNumber(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setSeasonNumber(String!, int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setSeasonTitle(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setStartTimeUtcMillis(long);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setStartingPrice(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setThumbnailAspectRatio(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setThumbnailUri(android.net.Uri!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setTitle(String!);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setTransient(boolean);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setTvSeriesItemType(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setType(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setVideoHeight(int);
+ method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setVideoWidth(int);
method public androidx.tvprovider.media.tv.WatchNextProgram.Builder! setWatchNextType(int);
}
diff --git a/tv-provider/api/res-1.1.0-alpha01.txt b/tv-provider/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index e69de29..0000000
--- a/tv-provider/api/res-1.1.0-alpha01.txt
+++ /dev/null
diff --git a/tv-provider/api/restricted_1.0.0.txt b/tv-provider/api/restricted_1.0.0.txt
deleted file mode 100644
index d32f5ec..0000000
--- a/tv-provider/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,314 +0,0 @@
-// Signature format: 3.0
-package androidx.tvprovider.media.tv {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public abstract class BasePreviewProgram extends androidx.tvprovider.media.tv.BaseProgram {
- method public String! getAuthor();
- method public int getAvailability();
- method public String! getContentId();
- method public int getDurationMillis();
- method public long getEndTimeUtcMillis();
- method public String! getGenre();
- method public android.content.Intent! getIntent();
- method public android.net.Uri! getIntentUri();
- method public long getInteractionCount();
- method public int getInteractionType();
- method public String! getInternalProviderId();
- method public int getItemCount();
- method public int getLastPlaybackPositionMillis();
- method public String! getLogoContentDescription();
- method public android.net.Uri! getLogoUri();
- method public String! getOfferPrice();
- method public int getPosterArtAspectRatio();
- method public android.net.Uri! getPreviewAudioUri();
- method public android.net.Uri! getPreviewVideoUri();
- method public String! getReleaseDate();
- method public long getStartTimeUtcMillis();
- method public String! getStartingPrice();
- method public int getThumbnailAspectRatio();
- method public int getTvSeriesItemType();
- method public int getType();
- method public boolean isBrowsable();
- method public boolean isLive();
- method public boolean isTransient();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.ContentValues! toContentValues(boolean);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String[]! PROJECTION;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface BasePreviewProgram.AspectRatio {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface BasePreviewProgram.Availability {
- }
-
- public abstract static class BasePreviewProgram.Builder<T extends androidx.tvprovider.media.tv.BasePreviewProgram.Builder> extends androidx.tvprovider.media.tv.BaseProgram.Builder<T> {
- ctor public BasePreviewProgram.Builder();
- ctor public BasePreviewProgram.Builder(androidx.tvprovider.media.tv.BasePreviewProgram!);
- method public T! setAuthor(String!);
- method public T! setAvailability(int);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public T! setBrowsable(boolean);
- method public T! setContentId(String!);
- method public T! setDurationMillis(int);
- method public T! setEndTimeUtcMillis(long);
- method public T! setGenre(String!);
- method public T! setIntent(android.content.Intent!);
- method public T! setIntentUri(android.net.Uri!);
- method public T! setInteractionCount(long);
- method public T! setInteractionType(int);
- method public T! setInternalProviderId(String!);
- method public T! setItemCount(int);
- method public T! setLastPlaybackPositionMillis(int);
- method public T! setLive(boolean);
- method public T! setLogoContentDescription(String!);
- method public T! setLogoUri(android.net.Uri!);
- method public T! setOfferPrice(String!);
- method public T! setPosterArtAspectRatio(int);
- method public T! setPreviewAudioUri(android.net.Uri!);
- method public T! setPreviewVideoUri(android.net.Uri!);
- method public T! setReleaseDate(String!);
- method public T! setReleaseDate(java.util.Date!);
- method public T! setStartTimeUtcMillis(long);
- method public T! setStartingPrice(String!);
- method public T! setThumbnailAspectRatio(int);
- method public T! setTransient(boolean);
- method public T! setTvSeriesItemType(int);
- method public T! setType(int);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface BasePreviewProgram.InteractionType {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface BasePreviewProgram.TvSeriesItemType {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface BasePreviewProgram.Type {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public abstract class BaseProgram {
- method public boolean equals(Object?);
- method public String[]! getAudioLanguages();
- method public String[]! getCanonicalGenres();
- method public android.media.tv.TvContentRating[]! getContentRatings();
- method public String! getDescription();
- method public String! getEpisodeNumber();
- method public String! getEpisodeTitle();
- method public long getId();
- method public byte[]! getInternalProviderDataByteArray();
- method public Long! getInternalProviderFlag1();
- method public Long! getInternalProviderFlag2();
- method public Long! getInternalProviderFlag3();
- method public Long! getInternalProviderFlag4();
- method public String! getLongDescription();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public String! getPackageName();
- method public android.net.Uri! getPosterArtUri();
- method public String! getReviewRating();
- method public int getReviewRatingStyle();
- method public String! getSeasonNumber();
- method public String! getSeasonTitle();
- method public android.net.Uri! getThumbnailUri();
- method public String! getTitle();
- method public int getVideoHeight();
- method public int getVideoWidth();
- method public int hashCode();
- method public boolean isSearchable();
- method public android.content.ContentValues! toContentValues();
- method public String toString();
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String[]! PROJECTION;
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected android.content.ContentValues! mValues;
- }
-
- public abstract static class BaseProgram.Builder<T extends androidx.tvprovider.media.tv.BaseProgram.Builder> {
- ctor public BaseProgram.Builder();
- ctor public BaseProgram.Builder(androidx.tvprovider.media.tv.BaseProgram!);
- method public T! setAudioLanguages(String[]!);
- method public T! setCanonicalGenres(String[]!);
- method public T! setContentRatings(android.media.tv.TvContentRating[]!);
- method public T! setDescription(String!);
- method public T! setEpisodeNumber(int);
- method public T! setEpisodeNumber(String!, int);
- method public T! setEpisodeTitle(String!);
- method public T! setId(long);
- method public T! setInternalProviderData(byte[]!);
- method public T! setInternalProviderFlag1(long);
- method public T! setInternalProviderFlag2(long);
- method public T! setInternalProviderFlag3(long);
- method public T! setInternalProviderFlag4(long);
- method public T! setLongDescription(String!);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public T! setPackageName(String!);
- method public T! setPosterArtUri(android.net.Uri!);
- method public T! setReviewRating(String!);
- method public T! setReviewRatingStyle(int);
- method public T! setSearchable(boolean);
- method public T! setSeasonNumber(int);
- method public T! setSeasonNumber(String!, int);
- method public T! setSeasonTitle(String!);
- method public T! setThumbnailUri(android.net.Uri!);
- method public T! setTitle(String!);
- method public T! setVideoHeight(int);
- method public T! setVideoWidth(int);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected android.content.ContentValues! mValues;
- }
-
- public final class Channel {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean isSystemApproved();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.ContentValues! toContentValues(boolean);
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String[]! PROJECTION;
- }
-
- public static final class Channel.Builder {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.tvprovider.media.tv.Channel.Builder! setBrowsable(boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.tvprovider.media.tv.Channel.Builder! setLocked(boolean);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.tvprovider.media.tv.Channel.Builder! setSystemApproved(boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class CollectionUtils {
- method public static <T> T[]! concatAll(T[]!, T[]...!);
- }
-
- public class PreviewChannel {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.ContentValues! toContentValues();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class PreviewChannel.Columns {
- field public static final int COL_APP_LINK_INTENT_URI = 5; // 0x5
- field public static final int COL_DESCRIPTION = 4; // 0x4
- field public static final int COL_DISPLAY_NAME = 3; // 0x3
- field public static final int COL_ID = 0; // 0x0
- field public static final int COL_INTERNAL_PROVIDER_DATA = 7; // 0x7
- field public static final int COL_INTERNAL_PROVIDER_FLAG1 = 8; // 0x8
- field public static final int COL_INTERNAL_PROVIDER_FLAG2 = 9; // 0x9
- field public static final int COL_INTERNAL_PROVIDER_FLAG3 = 10; // 0xa
- field public static final int COL_INTERNAL_PROVIDER_FLAG4 = 11; // 0xb
- field public static final int COL_INTERNAL_PROVIDER_ID = 6; // 0x6
- field public static final int COL_PACKAGE_NAME = 1; // 0x1
- field public static final int COL_TYPE = 2; // 0x2
- field public static final String[]! PROJECTION;
- }
-
- @WorkerThread public class PreviewChannelHelper {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected void updatePreviewChannelInternal(long, androidx.tvprovider.media.tv.PreviewChannel);
- }
-
- public final class PreviewProgram extends androidx.tvprovider.media.tv.BasePreviewProgram {
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String[]! PROJECTION;
- }
-
- public final class Program extends androidx.tvprovider.media.tv.BaseProgram {
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String[]! PROJECTION;
- }
-
- public final class TvContractCompat {
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String ACTION_CHANNEL_BROWSABLE_REQUESTED = "android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String EXTRA_COLUMN_NAME = "android.media.tv.extra.COLUMN_NAME";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String EXTRA_DATA_TYPE = "android.media.tv.extra.DATA_TYPE";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String EXTRA_DEFAULT_VALUE = "android.media.tv.extra.DEFAULT_VALUE";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String EXTRA_EXISTING_COLUMN_NAMES = "android.media.tv.extra.EXISTING_COLUMN_NAMES";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String EXTRA_PACKAGE_NAME = "android.media.tv.extra.PACKAGE_NAME";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String METHOD_ADD_COLUMN = "add_column";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String METHOD_GET_COLUMNS = "get_columns";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String PARAM_BROWSABLE_ONLY = "browsable_only";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String PARAM_CANONICAL_GENRE = "canonical_genre";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String PARAM_CHANNEL = "channel";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String PARAM_END_TIME = "end_time";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String PARAM_INPUT = "input";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String PARAM_START_TIME = "start_time";
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String PERMISSION_READ_TV_LISTINGS = "android.permission.READ_TV_LISTINGS";
- }
-
- public static final class TvContractCompat.Channels implements androidx.tvprovider.media.tv.TvContractCompat.BaseTvColumns {
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String COLUMN_SYSTEM_APPROVED = "system_approved";
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface TvContractCompat.Channels.ServiceType {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface TvContractCompat.Channels.Type {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface TvContractCompat.Channels.VideoFormat {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface TvContractCompat.Channels.VideoResolution {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static interface TvContractCompat.PreviewProgramColumns {
- field public static final int ASPECT_RATIO_16_9 = 0; // 0x0
- field public static final int ASPECT_RATIO_1_1 = 3; // 0x3
- field public static final int ASPECT_RATIO_2_3 = 4; // 0x4
- field public static final int ASPECT_RATIO_3_2 = 1; // 0x1
- field public static final int ASPECT_RATIO_4_3 = 2; // 0x2
- field public static final int ASPECT_RATIO_MOVIE_POSTER = 5; // 0x5
- field public static final int AVAILABILITY_AVAILABLE = 0; // 0x0
- field public static final int AVAILABILITY_FREE = 4; // 0x4
- field public static final int AVAILABILITY_FREE_WITH_SUBSCRIPTION = 1; // 0x1
- field public static final int AVAILABILITY_PAID_CONTENT = 2; // 0x2
- field public static final int AVAILABILITY_PURCHASED = 3; // 0x3
- field public static final String COLUMN_AUTHOR = "author";
- field public static final String COLUMN_AVAILABILITY = "availability";
- field public static final String COLUMN_BROWSABLE = "browsable";
- field public static final String COLUMN_CONTENT_ID = "content_id";
- field public static final String COLUMN_DURATION_MILLIS = "duration_millis";
- field public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
- field public static final String COLUMN_GENRE = "genre";
- field public static final String COLUMN_INTENT_URI = "intent_uri";
- field public static final String COLUMN_INTERACTION_COUNT = "interaction_count";
- field public static final String COLUMN_INTERACTION_TYPE = "interaction_type";
- field public static final String COLUMN_INTERNAL_PROVIDER_ID = "internal_provider_id";
- field public static final String COLUMN_ITEM_COUNT = "item_count";
- field public static final String COLUMN_LAST_PLAYBACK_POSITION_MILLIS = "last_playback_position_millis";
- field public static final String COLUMN_LIVE = "live";
- field public static final String COLUMN_LOGO_CONTENT_DESCRIPTION = "logo_content_description";
- field public static final String COLUMN_LOGO_URI = "logo_uri";
- field public static final String COLUMN_OFFER_PRICE = "offer_price";
- field public static final String COLUMN_POSTER_ART_ASPECT_RATIO = "poster_art_aspect_ratio";
- field public static final String COLUMN_PREVIEW_AUDIO_URI = "preview_audio_uri";
- field public static final String COLUMN_PREVIEW_VIDEO_URI = "preview_video_uri";
- field public static final String COLUMN_RELEASE_DATE = "release_date";
- field public static final String COLUMN_STARTING_PRICE = "starting_price";
- field public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
- field public static final String COLUMN_THUMBNAIL_ASPECT_RATIO = "poster_thumbnail_aspect_ratio";
- field public static final String COLUMN_TRANSIENT = "transient";
- field public static final String COLUMN_TV_SERIES_ITEM_TYPE = "tv_series_item_type";
- field public static final String COLUMN_TYPE = "type";
- field public static final int INTERACTION_TYPE_FANS = 3; // 0x3
- field public static final int INTERACTION_TYPE_FOLLOWERS = 2; // 0x2
- field public static final int INTERACTION_TYPE_LIKES = 4; // 0x4
- field public static final int INTERACTION_TYPE_LISTENS = 1; // 0x1
- field public static final int INTERACTION_TYPE_THUMBS = 5; // 0x5
- field public static final int INTERACTION_TYPE_VIEWERS = 6; // 0x6
- field public static final int INTERACTION_TYPE_VIEWS = 0; // 0x0
- field public static final int TV_SERIES_ITEM_TYPE_CHAPTER = 1; // 0x1
- field public static final int TV_SERIES_ITEM_TYPE_EPISODE = 0; // 0x0
- field public static final int TYPE_ALBUM = 8; // 0x8
- field public static final int TYPE_ARTIST = 9; // 0x9
- field public static final int TYPE_CHANNEL = 6; // 0x6
- field public static final int TYPE_CLIP = 4; // 0x4
- field public static final int TYPE_EVENT = 5; // 0x5
- field public static final int TYPE_GAME = 12; // 0xc
- field public static final int TYPE_MOVIE = 0; // 0x0
- field public static final int TYPE_PLAYLIST = 10; // 0xa
- field public static final int TYPE_STATION = 11; // 0xb
- field public static final int TYPE_TRACK = 7; // 0x7
- field public static final int TYPE_TV_EPISODE = 3; // 0x3
- field public static final int TYPE_TV_SEASON = 2; // 0x2
- field public static final int TYPE_TV_SERIES = 1; // 0x1
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface TvContractCompat.Programs.Genres.Genre {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class TvContractUtils {
- method public static String! audioLanguagesToString(String[]!);
- method public static String! contentRatingsToString(android.media.tv.TvContentRating[]!);
- method public static String[]! stringToAudioLanguages(String!);
- method public static android.media.tv.TvContentRating[]! stringToContentRatings(String!);
- }
-
- public final class WatchNextProgram extends androidx.tvprovider.media.tv.BasePreviewProgram {
- field @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final String[]! PROJECTION;
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface WatchNextProgram.WatchNextType {
- }
-
-}
-
diff --git a/tv-provider/api/restricted_1.1.0-alpha01.txt b/tv-provider/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index e53e078..0000000
--- a/tv-provider/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1,248 +0,0 @@
-// Signature format: 3.0
-package androidx.tvprovider.media.tv {
-
-
- @IntDef({androidx.tvprovider.media.tv.BasePreviewProgram.ASPECT_RATIO_UNKNOWN, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_16_9, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_3_2, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_4_3, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_1_1, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_2_3, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_MOVIE_POSTER}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BasePreviewProgram.AspectRatio {
- }
-
- @IntDef({androidx.tvprovider.media.tv.BasePreviewProgram.AVAILABILITY_UNKNOWN, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.AVAILABILITY_AVAILABLE, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.AVAILABILITY_FREE_WITH_SUBSCRIPTION, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.AVAILABILITY_PAID_CONTENT, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.AVAILABILITY_PURCHASED, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.AVAILABILITY_FREE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BasePreviewProgram.Availability {
- }
-
- public abstract static class BasePreviewProgram.Builder<T extends androidx.tvprovider.media.tv.BasePreviewProgram.Builder> extends androidx.tvprovider.media.tv.BaseProgram.Builder<T> {
- ctor public BasePreviewProgram.Builder();
- ctor public BasePreviewProgram.Builder(androidx.tvprovider.media.tv.BasePreviewProgram!);
- method public T! setAuthor(String!);
- method public T! setAvailability(@androidx.tvprovider.media.tv.BasePreviewProgram.Availability int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public T! setBrowsable(boolean);
- method public T! setContentId(String!);
- method public T! setDurationMillis(int);
- method public T! setEndTimeUtcMillis(long);
- method public T! setGenre(String!);
- method public T! setIntent(android.content.Intent!);
- method public T! setIntentUri(android.net.Uri!);
- method public T! setInteractionCount(long);
- method public T! setInteractionType(@androidx.tvprovider.media.tv.BasePreviewProgram.InteractionType int);
- method public T! setInternalProviderId(String!);
- method public T! setItemCount(int);
- method public T! setLastPlaybackPositionMillis(int);
- method public T! setLive(boolean);
- method public T! setLogoContentDescription(String!);
- method public T! setLogoUri(android.net.Uri!);
- method public T! setOfferPrice(String!);
- method public T! setPosterArtAspectRatio(@androidx.tvprovider.media.tv.BasePreviewProgram.AspectRatio int);
- method public T! setPreviewAudioUri(android.net.Uri!);
- method public T! setPreviewVideoUri(android.net.Uri!);
- method public T! setReleaseDate(String!);
- method public T! setReleaseDate(java.util.Date!);
- method public T! setStartTimeUtcMillis(long);
- method public T! setStartingPrice(String!);
- method public T! setThumbnailAspectRatio(@androidx.tvprovider.media.tv.BasePreviewProgram.AspectRatio int);
- method public T! setTransient(boolean);
- method public T! setTvSeriesItemType(@androidx.tvprovider.media.tv.BasePreviewProgram.TvSeriesItemType int);
- method public T! setType(@androidx.tvprovider.media.tv.BasePreviewProgram.Type int);
- }
-
- @IntDef({androidx.tvprovider.media.tv.BasePreviewProgram.INTERACTION_TYPE_UNKNOWN, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_VIEWS, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_LISTENS, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_FOLLOWERS, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_FANS, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_LIKES, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_THUMBS, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_VIEWERS}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BasePreviewProgram.InteractionType {
- }
-
- @IntDef({androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TV_SERIES_ITEM_TYPE_EPISODE, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TV_SERIES_ITEM_TYPE_CHAPTER}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BasePreviewProgram.TvSeriesItemType {
- }
-
- @IntDef({androidx.tvprovider.media.tv.BasePreviewProgram.TYPE_UNKNOWN, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_MOVIE, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_TV_SERIES, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_TV_SEASON, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_TV_EPISODE, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_CLIP, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_EVENT, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_CHANNEL, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_TRACK, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_ALBUM, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_ARTIST, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_PLAYLIST, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_STATION, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_GAME}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BasePreviewProgram.Type {
- }
-
-
- public abstract static class BaseProgram.Builder<T extends androidx.tvprovider.media.tv.BaseProgram.Builder> {
- ctor public BaseProgram.Builder();
- ctor public BaseProgram.Builder(androidx.tvprovider.media.tv.BaseProgram!);
- method public T! setAudioLanguages(String[]!);
- method public T! setCanonicalGenres(@androidx.tvprovider.media.tv.TvContractCompat.Programs.Genres.Genre String[]!);
- method public T! setContentRatings(android.media.tv.TvContentRating[]!);
- method public T! setDescription(String!);
- method public T! setEpisodeNumber(int);
- method public T! setEpisodeNumber(String!, int);
- method public T! setEpisodeTitle(String!);
- method public T! setId(long);
- method public T! setInternalProviderData(byte[]!);
- method public T! setInternalProviderFlag1(long);
- method public T! setInternalProviderFlag2(long);
- method public T! setInternalProviderFlag3(long);
- method public T! setInternalProviderFlag4(long);
- method public T! setLongDescription(String!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public T! setPackageName(String!);
- method public T! setPosterArtUri(android.net.Uri!);
- method public T! setReviewRating(String!);
- method public T! setReviewRatingStyle(int);
- method public T! setSearchable(boolean);
- method public T! setSeasonNumber(int);
- method public T! setSeasonNumber(String!, int);
- method public T! setSeasonTitle(String!);
- method public T! setThumbnailUri(android.net.Uri!);
- method public T! setTitle(String!);
- method public T! setVideoHeight(int);
- method public T! setVideoWidth(int);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected android.content.ContentValues! mValues;
- }
-
- public final class Channel {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isSystemApproved();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.ContentValues! toContentValues(boolean);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String[]! PROJECTION;
- }
-
- public static final class Channel.Builder {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.tvprovider.media.tv.Channel.Builder! setBrowsable(boolean);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.tvprovider.media.tv.Channel.Builder! setLocked(boolean);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.tvprovider.media.tv.Channel.Builder! setSystemApproved(boolean);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class CollectionUtils {
- method public static <T> T[]! concatAll(T[]!, T[]...!);
- }
-
- public class PreviewChannel {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.ContentValues! toContentValues();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class PreviewChannel.Columns {
- field public static final int COL_APP_LINK_INTENT_URI = 5; // 0x5
- field public static final int COL_DESCRIPTION = 4; // 0x4
- field public static final int COL_DISPLAY_NAME = 3; // 0x3
- field public static final int COL_ID = 0; // 0x0
- field public static final int COL_INTERNAL_PROVIDER_DATA = 7; // 0x7
- field public static final int COL_INTERNAL_PROVIDER_FLAG1 = 8; // 0x8
- field public static final int COL_INTERNAL_PROVIDER_FLAG2 = 9; // 0x9
- field public static final int COL_INTERNAL_PROVIDER_FLAG3 = 10; // 0xa
- field public static final int COL_INTERNAL_PROVIDER_FLAG4 = 11; // 0xb
- field public static final int COL_INTERNAL_PROVIDER_ID = 6; // 0x6
- field public static final int COL_PACKAGE_NAME = 1; // 0x1
- field public static final int COL_TYPE = 2; // 0x2
- field public static final String[]! PROJECTION;
- }
-
- @WorkerThread public class PreviewChannelHelper {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void updatePreviewChannelInternal(long, androidx.tvprovider.media.tv.PreviewChannel);
- }
-
- public final class PreviewProgram extends androidx.tvprovider.media.tv.BasePreviewProgram {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String[]! PROJECTION;
- }
-
- public final class Program extends androidx.tvprovider.media.tv.BaseProgram implements java.lang.Comparable<androidx.tvprovider.media.tv.Program> {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String[]! PROJECTION;
- }
-
- public final class TvContractCompat {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String ACTION_CHANNEL_BROWSABLE_REQUESTED = "android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String EXTRA_COLUMN_NAME = "android.media.tv.extra.COLUMN_NAME";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String EXTRA_DATA_TYPE = "android.media.tv.extra.DATA_TYPE";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String EXTRA_DEFAULT_VALUE = "android.media.tv.extra.DEFAULT_VALUE";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String EXTRA_EXISTING_COLUMN_NAMES = "android.media.tv.extra.EXISTING_COLUMN_NAMES";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String EXTRA_PACKAGE_NAME = "android.media.tv.extra.PACKAGE_NAME";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String METHOD_ADD_COLUMN = "add_column";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String METHOD_GET_COLUMNS = "get_columns";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARAM_BROWSABLE_ONLY = "browsable_only";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARAM_CANONICAL_GENRE = "canonical_genre";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARAM_CHANNEL = "channel";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARAM_END_TIME = "end_time";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARAM_INPUT = "input";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARAM_START_TIME = "start_time";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PERMISSION_READ_TV_LISTINGS = "android.permission.READ_TV_LISTINGS";
- }
-
- public static final class TvContractCompat.Channels implements androidx.tvprovider.media.tv.TvContractCompat.BaseTvColumns {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String COLUMN_SYSTEM_APPROVED = "system_approved";
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @StringDef({androidx.tvprovider.media.tv.TvContractCompat.Channels.SERVICE_TYPE_OTHER, androidx.tvprovider.media.tv.TvContractCompat.Channels.SERVICE_TYPE_AUDIO_VIDEO, androidx.tvprovider.media.tv.TvContractCompat.Channels.SERVICE_TYPE_AUDIO}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface TvContractCompat.Channels.ServiceType {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @StringDef({androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_OTHER, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_NTSC, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_PAL, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_SECAM, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_T, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_T2, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_S, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_S2, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_C, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_C2, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_H, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_SH, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ATSC_T, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ATSC_C, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ATSC_M_H, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ISDB_T, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ISDB_TB, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ISDB_S, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ISDB_C, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_1SEG, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DTMB, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_CMMB, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_T_DMB, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_S_DMB, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_PREVIEW}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface TvContractCompat.Channels.Type {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @StringDef({androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_240P, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_360P, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_480I, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_576I, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_576P, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_720P, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_1080I, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_1080P, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_2160P, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_4320P}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface TvContractCompat.Channels.VideoFormat {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @StringDef({androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_RESOLUTION_SD, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_RESOLUTION_ED, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_RESOLUTION_HD, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_RESOLUTION_FHD, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_RESOLUTION_UHD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface TvContractCompat.Channels.VideoResolution {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface TvContractCompat.PreviewProgramColumns {
- field public static final int ASPECT_RATIO_16_9 = 0; // 0x0
- field public static final int ASPECT_RATIO_1_1 = 3; // 0x3
- field public static final int ASPECT_RATIO_2_3 = 4; // 0x4
- field public static final int ASPECT_RATIO_3_2 = 1; // 0x1
- field public static final int ASPECT_RATIO_4_3 = 2; // 0x2
- field public static final int ASPECT_RATIO_MOVIE_POSTER = 5; // 0x5
- field public static final int AVAILABILITY_AVAILABLE = 0; // 0x0
- field public static final int AVAILABILITY_FREE = 4; // 0x4
- field public static final int AVAILABILITY_FREE_WITH_SUBSCRIPTION = 1; // 0x1
- field public static final int AVAILABILITY_PAID_CONTENT = 2; // 0x2
- field public static final int AVAILABILITY_PURCHASED = 3; // 0x3
- field public static final String COLUMN_AUTHOR = "author";
- field public static final String COLUMN_AVAILABILITY = "availability";
- field public static final String COLUMN_BROWSABLE = "browsable";
- field public static final String COLUMN_CONTENT_ID = "content_id";
- field public static final String COLUMN_DURATION_MILLIS = "duration_millis";
- field public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
- field public static final String COLUMN_GENRE = "genre";
- field public static final String COLUMN_INTENT_URI = "intent_uri";
- field public static final String COLUMN_INTERACTION_COUNT = "interaction_count";
- field public static final String COLUMN_INTERACTION_TYPE = "interaction_type";
- field public static final String COLUMN_INTERNAL_PROVIDER_ID = "internal_provider_id";
- field public static final String COLUMN_ITEM_COUNT = "item_count";
- field public static final String COLUMN_LAST_PLAYBACK_POSITION_MILLIS = "last_playback_position_millis";
- field public static final String COLUMN_LIVE = "live";
- field public static final String COLUMN_LOGO_CONTENT_DESCRIPTION = "logo_content_description";
- field public static final String COLUMN_LOGO_URI = "logo_uri";
- field public static final String COLUMN_OFFER_PRICE = "offer_price";
- field public static final String COLUMN_POSTER_ART_ASPECT_RATIO = "poster_art_aspect_ratio";
- field public static final String COLUMN_PREVIEW_AUDIO_URI = "preview_audio_uri";
- field public static final String COLUMN_PREVIEW_VIDEO_URI = "preview_video_uri";
- field public static final String COLUMN_RELEASE_DATE = "release_date";
- field public static final String COLUMN_STARTING_PRICE = "starting_price";
- field public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
- field public static final String COLUMN_THUMBNAIL_ASPECT_RATIO = "poster_thumbnail_aspect_ratio";
- field public static final String COLUMN_TRANSIENT = "transient";
- field public static final String COLUMN_TV_SERIES_ITEM_TYPE = "tv_series_item_type";
- field public static final String COLUMN_TYPE = "type";
- field public static final int INTERACTION_TYPE_FANS = 3; // 0x3
- field public static final int INTERACTION_TYPE_FOLLOWERS = 2; // 0x2
- field public static final int INTERACTION_TYPE_LIKES = 4; // 0x4
- field public static final int INTERACTION_TYPE_LISTENS = 1; // 0x1
- field public static final int INTERACTION_TYPE_THUMBS = 5; // 0x5
- field public static final int INTERACTION_TYPE_VIEWERS = 6; // 0x6
- field public static final int INTERACTION_TYPE_VIEWS = 0; // 0x0
- field public static final int TV_SERIES_ITEM_TYPE_CHAPTER = 1; // 0x1
- field public static final int TV_SERIES_ITEM_TYPE_EPISODE = 0; // 0x0
- field public static final int TYPE_ALBUM = 8; // 0x8
- field public static final int TYPE_ARTIST = 9; // 0x9
- field public static final int TYPE_CHANNEL = 6; // 0x6
- field public static final int TYPE_CLIP = 4; // 0x4
- field public static final int TYPE_EVENT = 5; // 0x5
- field public static final int TYPE_GAME = 12; // 0xc
- field public static final int TYPE_MOVIE = 0; // 0x0
- field public static final int TYPE_PLAYLIST = 10; // 0xa
- field public static final int TYPE_STATION = 11; // 0xb
- field public static final int TYPE_TRACK = 7; // 0x7
- field public static final int TYPE_TV_EPISODE = 3; // 0x3
- field public static final int TYPE_TV_SEASON = 2; // 0x2
- field public static final int TYPE_TV_SERIES = 1; // 0x1
- }
-
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TvContractUtils {
- method public static String! audioLanguagesToString(String[]!);
- method public static String! contentRatingsToString(android.media.tv.TvContentRating[]!);
- method public static String[]! stringToAudioLanguages(String!);
- method public static android.media.tv.TvContentRating[]! stringToContentRatings(String!);
- }
-
- public final class WatchNextProgram extends androidx.tvprovider.media.tv.BasePreviewProgram {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String[]! PROJECTION;
- }
-
- @IntDef({androidx.tvprovider.media.tv.WatchNextProgram.WATCH_NEXT_TYPE_UNKNOWN, androidx.tvprovider.media.tv.TvContractCompat.WatchNextPrograms.WATCH_NEXT_TYPE_CONTINUE, androidx.tvprovider.media.tv.TvContractCompat.WatchNextPrograms.WATCH_NEXT_TYPE_NEXT, androidx.tvprovider.media.tv.TvContractCompat.WatchNextPrograms.WATCH_NEXT_TYPE_NEW, androidx.tvprovider.media.tv.TvContractCompat.WatchNextPrograms.WATCH_NEXT_TYPE_WATCHLIST}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface WatchNextProgram.WatchNextType {
- }
-
-}
-
diff --git a/tv-provider/api/restricted_current.txt b/tv-provider/api/restricted_current.txt
deleted file mode 100644
index e53e078..0000000
--- a/tv-provider/api/restricted_current.txt
+++ /dev/null
@@ -1,248 +0,0 @@
-// Signature format: 3.0
-package androidx.tvprovider.media.tv {
-
-
- @IntDef({androidx.tvprovider.media.tv.BasePreviewProgram.ASPECT_RATIO_UNKNOWN, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_16_9, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_3_2, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_4_3, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_1_1, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_2_3, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.ASPECT_RATIO_MOVIE_POSTER}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BasePreviewProgram.AspectRatio {
- }
-
- @IntDef({androidx.tvprovider.media.tv.BasePreviewProgram.AVAILABILITY_UNKNOWN, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.AVAILABILITY_AVAILABLE, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.AVAILABILITY_FREE_WITH_SUBSCRIPTION, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.AVAILABILITY_PAID_CONTENT, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.AVAILABILITY_PURCHASED, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.AVAILABILITY_FREE}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BasePreviewProgram.Availability {
- }
-
- public abstract static class BasePreviewProgram.Builder<T extends androidx.tvprovider.media.tv.BasePreviewProgram.Builder> extends androidx.tvprovider.media.tv.BaseProgram.Builder<T> {
- ctor public BasePreviewProgram.Builder();
- ctor public BasePreviewProgram.Builder(androidx.tvprovider.media.tv.BasePreviewProgram!);
- method public T! setAuthor(String!);
- method public T! setAvailability(@androidx.tvprovider.media.tv.BasePreviewProgram.Availability int);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public T! setBrowsable(boolean);
- method public T! setContentId(String!);
- method public T! setDurationMillis(int);
- method public T! setEndTimeUtcMillis(long);
- method public T! setGenre(String!);
- method public T! setIntent(android.content.Intent!);
- method public T! setIntentUri(android.net.Uri!);
- method public T! setInteractionCount(long);
- method public T! setInteractionType(@androidx.tvprovider.media.tv.BasePreviewProgram.InteractionType int);
- method public T! setInternalProviderId(String!);
- method public T! setItemCount(int);
- method public T! setLastPlaybackPositionMillis(int);
- method public T! setLive(boolean);
- method public T! setLogoContentDescription(String!);
- method public T! setLogoUri(android.net.Uri!);
- method public T! setOfferPrice(String!);
- method public T! setPosterArtAspectRatio(@androidx.tvprovider.media.tv.BasePreviewProgram.AspectRatio int);
- method public T! setPreviewAudioUri(android.net.Uri!);
- method public T! setPreviewVideoUri(android.net.Uri!);
- method public T! setReleaseDate(String!);
- method public T! setReleaseDate(java.util.Date!);
- method public T! setStartTimeUtcMillis(long);
- method public T! setStartingPrice(String!);
- method public T! setThumbnailAspectRatio(@androidx.tvprovider.media.tv.BasePreviewProgram.AspectRatio int);
- method public T! setTransient(boolean);
- method public T! setTvSeriesItemType(@androidx.tvprovider.media.tv.BasePreviewProgram.TvSeriesItemType int);
- method public T! setType(@androidx.tvprovider.media.tv.BasePreviewProgram.Type int);
- }
-
- @IntDef({androidx.tvprovider.media.tv.BasePreviewProgram.INTERACTION_TYPE_UNKNOWN, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_VIEWS, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_LISTENS, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_FOLLOWERS, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_FANS, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_LIKES, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_THUMBS, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.INTERACTION_TYPE_VIEWERS}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BasePreviewProgram.InteractionType {
- }
-
- @IntDef({androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TV_SERIES_ITEM_TYPE_EPISODE, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TV_SERIES_ITEM_TYPE_CHAPTER}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BasePreviewProgram.TvSeriesItemType {
- }
-
- @IntDef({androidx.tvprovider.media.tv.BasePreviewProgram.TYPE_UNKNOWN, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_MOVIE, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_TV_SERIES, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_TV_SEASON, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_TV_EPISODE, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_CLIP, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_EVENT, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_CHANNEL, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_TRACK, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_ALBUM, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_ARTIST, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_PLAYLIST, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_STATION, androidx.tvprovider.media.tv.TvContractCompat.PreviewProgramColumns.TYPE_GAME}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface BasePreviewProgram.Type {
- }
-
-
- public abstract static class BaseProgram.Builder<T extends androidx.tvprovider.media.tv.BaseProgram.Builder> {
- ctor public BaseProgram.Builder();
- ctor public BaseProgram.Builder(androidx.tvprovider.media.tv.BaseProgram!);
- method public T! setAudioLanguages(String[]!);
- method public T! setCanonicalGenres(@androidx.tvprovider.media.tv.TvContractCompat.Programs.Genres.Genre String[]!);
- method public T! setContentRatings(android.media.tv.TvContentRating[]!);
- method public T! setDescription(String!);
- method public T! setEpisodeNumber(int);
- method public T! setEpisodeNumber(String!, int);
- method public T! setEpisodeTitle(String!);
- method public T! setId(long);
- method public T! setInternalProviderData(byte[]!);
- method public T! setInternalProviderFlag1(long);
- method public T! setInternalProviderFlag2(long);
- method public T! setInternalProviderFlag3(long);
- method public T! setInternalProviderFlag4(long);
- method public T! setLongDescription(String!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public T! setPackageName(String!);
- method public T! setPosterArtUri(android.net.Uri!);
- method public T! setReviewRating(String!);
- method public T! setReviewRatingStyle(int);
- method public T! setSearchable(boolean);
- method public T! setSeasonNumber(int);
- method public T! setSeasonNumber(String!, int);
- method public T! setSeasonTitle(String!);
- method public T! setThumbnailUri(android.net.Uri!);
- method public T! setTitle(String!);
- method public T! setVideoHeight(int);
- method public T! setVideoWidth(int);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected android.content.ContentValues! mValues;
- }
-
- public final class Channel {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public boolean isSystemApproved();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.ContentValues! toContentValues(boolean);
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String[]! PROJECTION;
- }
-
- public static final class Channel.Builder {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.tvprovider.media.tv.Channel.Builder! setBrowsable(boolean);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.tvprovider.media.tv.Channel.Builder! setLocked(boolean);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public androidx.tvprovider.media.tv.Channel.Builder! setSystemApproved(boolean);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class CollectionUtils {
- method public static <T> T[]! concatAll(T[]!, T[]...!);
- }
-
- public class PreviewChannel {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public android.content.ContentValues! toContentValues();
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static class PreviewChannel.Columns {
- field public static final int COL_APP_LINK_INTENT_URI = 5; // 0x5
- field public static final int COL_DESCRIPTION = 4; // 0x4
- field public static final int COL_DISPLAY_NAME = 3; // 0x3
- field public static final int COL_ID = 0; // 0x0
- field public static final int COL_INTERNAL_PROVIDER_DATA = 7; // 0x7
- field public static final int COL_INTERNAL_PROVIDER_FLAG1 = 8; // 0x8
- field public static final int COL_INTERNAL_PROVIDER_FLAG2 = 9; // 0x9
- field public static final int COL_INTERNAL_PROVIDER_FLAG3 = 10; // 0xa
- field public static final int COL_INTERNAL_PROVIDER_FLAG4 = 11; // 0xb
- field public static final int COL_INTERNAL_PROVIDER_ID = 6; // 0x6
- field public static final int COL_PACKAGE_NAME = 1; // 0x1
- field public static final int COL_TYPE = 2; // 0x2
- field public static final String[]! PROJECTION;
- }
-
- @WorkerThread public class PreviewChannelHelper {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) protected void updatePreviewChannelInternal(long, androidx.tvprovider.media.tv.PreviewChannel);
- }
-
- public final class PreviewProgram extends androidx.tvprovider.media.tv.BasePreviewProgram {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String[]! PROJECTION;
- }
-
- public final class Program extends androidx.tvprovider.media.tv.BaseProgram implements java.lang.Comparable<androidx.tvprovider.media.tv.Program> {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String[]! PROJECTION;
- }
-
- public final class TvContractCompat {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String ACTION_CHANNEL_BROWSABLE_REQUESTED = "android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String EXTRA_COLUMN_NAME = "android.media.tv.extra.COLUMN_NAME";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String EXTRA_DATA_TYPE = "android.media.tv.extra.DATA_TYPE";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String EXTRA_DEFAULT_VALUE = "android.media.tv.extra.DEFAULT_VALUE";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String EXTRA_EXISTING_COLUMN_NAMES = "android.media.tv.extra.EXISTING_COLUMN_NAMES";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String EXTRA_PACKAGE_NAME = "android.media.tv.extra.PACKAGE_NAME";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String METHOD_ADD_COLUMN = "add_column";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String METHOD_GET_COLUMNS = "get_columns";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARAM_BROWSABLE_ONLY = "browsable_only";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARAM_CANONICAL_GENRE = "canonical_genre";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARAM_CHANNEL = "channel";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARAM_END_TIME = "end_time";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARAM_INPUT = "input";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PARAM_START_TIME = "start_time";
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String PERMISSION_READ_TV_LISTINGS = "android.permission.READ_TV_LISTINGS";
- }
-
- public static final class TvContractCompat.Channels implements androidx.tvprovider.media.tv.TvContractCompat.BaseTvColumns {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String COLUMN_SYSTEM_APPROVED = "system_approved";
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @StringDef({androidx.tvprovider.media.tv.TvContractCompat.Channels.SERVICE_TYPE_OTHER, androidx.tvprovider.media.tv.TvContractCompat.Channels.SERVICE_TYPE_AUDIO_VIDEO, androidx.tvprovider.media.tv.TvContractCompat.Channels.SERVICE_TYPE_AUDIO}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface TvContractCompat.Channels.ServiceType {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @StringDef({androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_OTHER, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_NTSC, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_PAL, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_SECAM, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_T, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_T2, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_S, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_S2, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_C, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_C2, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_H, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DVB_SH, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ATSC_T, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ATSC_C, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ATSC_M_H, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ISDB_T, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ISDB_TB, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ISDB_S, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_ISDB_C, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_1SEG, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_DTMB, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_CMMB, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_T_DMB, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_S_DMB, androidx.tvprovider.media.tv.TvContractCompat.Channels.TYPE_PREVIEW}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface TvContractCompat.Channels.Type {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @StringDef({androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_240P, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_360P, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_480I, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_576I, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_576P, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_720P, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_1080I, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_1080P, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_2160P, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_FORMAT_4320P}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface TvContractCompat.Channels.VideoFormat {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @StringDef({androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_RESOLUTION_SD, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_RESOLUTION_ED, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_RESOLUTION_HD, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_RESOLUTION_FHD, androidx.tvprovider.media.tv.TvContractCompat.Channels.VIDEO_RESOLUTION_UHD}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface TvContractCompat.Channels.VideoResolution {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static interface TvContractCompat.PreviewProgramColumns {
- field public static final int ASPECT_RATIO_16_9 = 0; // 0x0
- field public static final int ASPECT_RATIO_1_1 = 3; // 0x3
- field public static final int ASPECT_RATIO_2_3 = 4; // 0x4
- field public static final int ASPECT_RATIO_3_2 = 1; // 0x1
- field public static final int ASPECT_RATIO_4_3 = 2; // 0x2
- field public static final int ASPECT_RATIO_MOVIE_POSTER = 5; // 0x5
- field public static final int AVAILABILITY_AVAILABLE = 0; // 0x0
- field public static final int AVAILABILITY_FREE = 4; // 0x4
- field public static final int AVAILABILITY_FREE_WITH_SUBSCRIPTION = 1; // 0x1
- field public static final int AVAILABILITY_PAID_CONTENT = 2; // 0x2
- field public static final int AVAILABILITY_PURCHASED = 3; // 0x3
- field public static final String COLUMN_AUTHOR = "author";
- field public static final String COLUMN_AVAILABILITY = "availability";
- field public static final String COLUMN_BROWSABLE = "browsable";
- field public static final String COLUMN_CONTENT_ID = "content_id";
- field public static final String COLUMN_DURATION_MILLIS = "duration_millis";
- field public static final String COLUMN_END_TIME_UTC_MILLIS = "end_time_utc_millis";
- field public static final String COLUMN_GENRE = "genre";
- field public static final String COLUMN_INTENT_URI = "intent_uri";
- field public static final String COLUMN_INTERACTION_COUNT = "interaction_count";
- field public static final String COLUMN_INTERACTION_TYPE = "interaction_type";
- field public static final String COLUMN_INTERNAL_PROVIDER_ID = "internal_provider_id";
- field public static final String COLUMN_ITEM_COUNT = "item_count";
- field public static final String COLUMN_LAST_PLAYBACK_POSITION_MILLIS = "last_playback_position_millis";
- field public static final String COLUMN_LIVE = "live";
- field public static final String COLUMN_LOGO_CONTENT_DESCRIPTION = "logo_content_description";
- field public static final String COLUMN_LOGO_URI = "logo_uri";
- field public static final String COLUMN_OFFER_PRICE = "offer_price";
- field public static final String COLUMN_POSTER_ART_ASPECT_RATIO = "poster_art_aspect_ratio";
- field public static final String COLUMN_PREVIEW_AUDIO_URI = "preview_audio_uri";
- field public static final String COLUMN_PREVIEW_VIDEO_URI = "preview_video_uri";
- field public static final String COLUMN_RELEASE_DATE = "release_date";
- field public static final String COLUMN_STARTING_PRICE = "starting_price";
- field public static final String COLUMN_START_TIME_UTC_MILLIS = "start_time_utc_millis";
- field public static final String COLUMN_THUMBNAIL_ASPECT_RATIO = "poster_thumbnail_aspect_ratio";
- field public static final String COLUMN_TRANSIENT = "transient";
- field public static final String COLUMN_TV_SERIES_ITEM_TYPE = "tv_series_item_type";
- field public static final String COLUMN_TYPE = "type";
- field public static final int INTERACTION_TYPE_FANS = 3; // 0x3
- field public static final int INTERACTION_TYPE_FOLLOWERS = 2; // 0x2
- field public static final int INTERACTION_TYPE_LIKES = 4; // 0x4
- field public static final int INTERACTION_TYPE_LISTENS = 1; // 0x1
- field public static final int INTERACTION_TYPE_THUMBS = 5; // 0x5
- field public static final int INTERACTION_TYPE_VIEWERS = 6; // 0x6
- field public static final int INTERACTION_TYPE_VIEWS = 0; // 0x0
- field public static final int TV_SERIES_ITEM_TYPE_CHAPTER = 1; // 0x1
- field public static final int TV_SERIES_ITEM_TYPE_EPISODE = 0; // 0x0
- field public static final int TYPE_ALBUM = 8; // 0x8
- field public static final int TYPE_ARTIST = 9; // 0x9
- field public static final int TYPE_CHANNEL = 6; // 0x6
- field public static final int TYPE_CLIP = 4; // 0x4
- field public static final int TYPE_EVENT = 5; // 0x5
- field public static final int TYPE_GAME = 12; // 0xc
- field public static final int TYPE_MOVIE = 0; // 0x0
- field public static final int TYPE_PLAYLIST = 10; // 0xa
- field public static final int TYPE_STATION = 11; // 0xb
- field public static final int TYPE_TRACK = 7; // 0x7
- field public static final int TYPE_TV_EPISODE = 3; // 0x3
- field public static final int TYPE_TV_SEASON = 2; // 0x2
- field public static final int TYPE_TV_SERIES = 1; // 0x1
- }
-
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class TvContractUtils {
- method public static String! audioLanguagesToString(String[]!);
- method public static String! contentRatingsToString(android.media.tv.TvContentRating[]!);
- method public static String[]! stringToAudioLanguages(String!);
- method public static android.media.tv.TvContentRating[]! stringToContentRatings(String!);
- }
-
- public final class WatchNextProgram extends androidx.tvprovider.media.tv.BasePreviewProgram {
- field @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final String[]! PROJECTION;
- }
-
- @IntDef({androidx.tvprovider.media.tv.WatchNextProgram.WATCH_NEXT_TYPE_UNKNOWN, androidx.tvprovider.media.tv.TvContractCompat.WatchNextPrograms.WATCH_NEXT_TYPE_CONTINUE, androidx.tvprovider.media.tv.TvContractCompat.WatchNextPrograms.WATCH_NEXT_TYPE_NEXT, androidx.tvprovider.media.tv.TvContractCompat.WatchNextPrograms.WATCH_NEXT_TYPE_NEW, androidx.tvprovider.media.tv.TvContractCompat.WatchNextPrograms.WATCH_NEXT_TYPE_WATCHLIST}) @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface WatchNextProgram.WatchNextType {
- }
-
-}
-
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/BasePreviewProgram.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/BasePreviewProgram.java
index 1ca313e..3066427 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/BasePreviewProgram.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/BasePreviewProgram.java
@@ -16,7 +16,7 @@
package androidx.tvprovider.media.tv;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ContentValues;
import android.content.Intent;
@@ -46,7 +46,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String[] PROJECTION = getProjection();
private static final int INVALID_INT_VALUE = -1;
@@ -73,7 +73,7 @@
PreviewProgramColumns.TYPE_GAME
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface Type {}
/**
@@ -92,7 +92,7 @@
PreviewProgramColumns.ASPECT_RATIO_MOVIE_POSTER
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface AspectRatio {}
/**
@@ -110,7 +110,7 @@
PreviewProgramColumns.AVAILABILITY_FREE
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface Availability {}
/**
@@ -130,7 +130,7 @@
PreviewProgramColumns.INTERACTION_TYPE_VIEWERS,
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface InteractionType {}
/** @hide */
@@ -139,7 +139,7 @@
PreviewProgramColumns.TV_SERIES_ITEM_TYPE_CHAPTER
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface TvSeriesItemType {}
/**
@@ -422,7 +422,7 @@
* @param includeProtectedFields Whether the fields protected by system is included or not.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ContentValues toContentValues(boolean includeProtectedFields) {
ContentValues values = super.toContentValues();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
@@ -976,7 +976,7 @@
* @see androidx.tvprovider.media.tv.TvContractCompat.PreviewPrograms#COLUMN_BROWSABLE
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public T setBrowsable(boolean browsable) {
mValues.put(PreviewPrograms.COLUMN_BROWSABLE, browsable ? IS_BROWSABLE : 0);
return (T) this;
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/BaseProgram.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/BaseProgram.java
index d2ae4e7..964ba34 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/BaseProgram.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/BaseProgram.java
@@ -16,7 +16,7 @@
package androidx.tvprovider.media.tv;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ContentValues;
import android.database.Cursor;
@@ -44,7 +44,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String[] PROJECTION = getProjection();
private static final long INVALID_LONG_VALUE = -1;
@@ -59,7 +59,7 @@
ProgramColumns.REVIEW_RATING_STYLE_PERCENTAGE,
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@interface ReviewRatingStyle {}
/**
@@ -68,7 +68,7 @@
private static final int REVIEW_RATING_STYLE_UNKNOWN = -1;
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected ContentValues mValues;
/* package-private */
@@ -90,7 +90,7 @@
* @see androidx.tvprovider.media.tv.TvContractCompat.BaseTvColumns#COLUMN_PACKAGE_NAME
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public String getPackageName() {
return mValues.getAsString(BaseTvColumns.COLUMN_PACKAGE_NAME);
}
@@ -520,7 +520,7 @@
*/
public abstract static class Builder<T extends Builder> {
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected ContentValues mValues;
/**
@@ -558,7 +558,7 @@
* @see androidx.tvprovider.media.tv.TvContractCompat.BaseTvColumns#COLUMN_PACKAGE_NAME
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public T setPackageName(String packageName) {
mValues.put(BaseTvColumns.COLUMN_PACKAGE_NAME, packageName);
return (T) this;
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/Channel.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/Channel.java
index 4540289..45ee34c 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/Channel.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/Channel.java
@@ -15,7 +15,7 @@
*/
package androidx.tvprovider.media.tv;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ContentValues;
import android.content.Intent;
@@ -80,7 +80,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String[] PROJECTION = getProjection();
private static final long INVALID_CHANNEL_ID = -1;
@@ -312,7 +312,7 @@
* @return The value of {@link Channels#COLUMN_SYSTEM_APPROVED} for the channel.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public boolean isSystemApproved() {
Integer i = mValues.getAsInteger(Channels.COLUMN_SYSTEM_APPROVED);
return i != null && i == IS_SYSTEM_APPROVED;
@@ -372,7 +372,7 @@
* @param includeProtectedFields Whether the fields protected by system is included or not.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ContentValues toContentValues(boolean includeProtectedFields) {
ContentValues values = new ContentValues(mValues);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
@@ -621,7 +621,7 @@
* @return This Builder object to allow for chaining of calls to builder methods.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Builder setPackageName(String packageName) {
mValues.put(Channels.COLUMN_PACKAGE_NAME, packageName);
return this;
@@ -936,7 +936,7 @@
* @return This Builder object to allow for chaining of calls to builder methods.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Builder setBrowsable(boolean value) {
mValues.put(Channels.COLUMN_BROWSABLE, value ? IS_BROWSABLE : 0);
return this;
@@ -949,7 +949,7 @@
* @return This Builder object to allow for chaining of calls to builder methods.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Builder setSystemApproved(boolean value) {
mValues.put(Channels.COLUMN_SYSTEM_APPROVED, value ? IS_SYSTEM_APPROVED : 0);
return this;
@@ -989,7 +989,7 @@
* @return This Builder object to allow for chaining of calls to builder methods.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public Builder setLocked(boolean value) {
mValues.put(Channels.COLUMN_LOCKED, value ? IS_LOCKED : 0);
return this;
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/CollectionUtils.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/CollectionUtils.java
index 70963689..595e451 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/CollectionUtils.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/CollectionUtils.java
@@ -15,7 +15,7 @@
*/
package androidx.tvprovider.media.tv;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
@@ -25,7 +25,7 @@
* Static utilities for collections
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class CollectionUtils {
/**
* Returns an array with the arrays concatenated together.
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/PreviewChannel.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/PreviewChannel.java
index d7053ca..b0f4b8e 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/PreviewChannel.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/PreviewChannel.java
@@ -15,7 +15,7 @@
*/
package androidx.tvprovider.media.tv;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ContentValues;
import android.content.Context;
@@ -186,7 +186,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
boolean isLogoChanged() {
return mLogoChanged;
}
@@ -194,7 +194,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Uri getLogoUri() {
return mLogoUri;
}
@@ -292,7 +292,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public ContentValues toContentValues() {
ContentValues values = new ContentValues(mValues);
return values;
@@ -301,7 +301,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static class Columns {
public static final String[] PROJECTION = {
Channels._ID,
@@ -366,7 +366,7 @@
* @return This Builder object to allow for chaining of calls to builder methods.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
Builder setPackageName(String packageName) {
mValues.put(Channels.COLUMN_PACKAGE_NAME, packageName);
return this;
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/PreviewChannelHelper.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/PreviewChannelHelper.java
index 40b0bf8..06876c3 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/PreviewChannelHelper.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/PreviewChannelHelper.java
@@ -15,7 +15,7 @@
*/
package androidx.tvprovider.media.tv;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.annotation.SuppressLint;
import android.content.ContentResolver;
@@ -245,7 +245,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
protected void updatePreviewChannelInternal(long channelId, @NonNull PreviewChannel upgrade) {
mContext.getContentResolver().update(
TvContractCompat.buildChannelUri(channelId),
@@ -407,7 +407,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void updatePreviewProgramInternal(long programId, @NonNull PreviewProgram upgrade) {
mContext.getContentResolver().update(
TvContractCompat.buildPreviewProgramUri(programId),
@@ -468,7 +468,7 @@
*
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
void updateWatchNextProgram(long programId, @NonNull WatchNextProgram upgrade) {
mContext.getContentResolver().update(
TvContractCompat.buildWatchNextProgramUri(programId),
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/PreviewProgram.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/PreviewProgram.java
index 4b1b353..2b6a82e 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/PreviewProgram.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/PreviewProgram.java
@@ -15,7 +15,7 @@
*/
package androidx.tvprovider.media.tv;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ContentValues;
import android.database.Cursor;
@@ -78,7 +78,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String[] PROJECTION = getProjection();
private static final long INVALID_LONG_VALUE = -1;
@@ -150,7 +150,7 @@
* @param includeProtectedFields Whether the fields protected by system is included or not.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public ContentValues toContentValues(boolean includeProtectedFields) {
ContentValues values = super.toContentValues(includeProtectedFields);
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/Program.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/Program.java
index 4a4b3bd..b0808d0 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/Program.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/Program.java
@@ -15,7 +15,7 @@
*/
package androidx.tvprovider.media.tv;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ContentValues;
import android.database.Cursor;
@@ -75,7 +75,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String[] PROJECTION = getProjection();
private static final long INVALID_LONG_VALUE = -1;
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/TvContractCompat.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/TvContractCompat.java
index 1364515..6242c50 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/TvContractCompat.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/TvContractCompat.java
@@ -16,7 +16,7 @@
package androidx.tvprovider.media.tv;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.app.Activity;
import android.content.ComponentName;
@@ -72,7 +72,7 @@
* information available on the system.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String PERMISSION_READ_TV_LISTINGS = "android.permission.READ_TV_LISTINGS";
private static final String PATH_CHANNEL = "channel";
@@ -95,7 +95,7 @@
* </ul>
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String ACTION_CHANNEL_BROWSABLE_REQUESTED =
"android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED";
@@ -181,7 +181,7 @@
* The key for a bundle parameter containing a package name as a string.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String EXTRA_PACKAGE_NAME = "android.media.tv.extra.PACKAGE_NAME";
/** The key for a bundle parameter containing a program ID as a long integer. */
@@ -208,7 +208,7 @@
* @see #EXTRA_EXISTING_COLUMN_NAMES
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String METHOD_GET_COLUMNS = "get_columns";
/**
@@ -238,7 +238,7 @@
* @see #EXTRA_EXISTING_COLUMN_NAMES
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String METHOD_ADD_COLUMN = "add_column";
/**
@@ -249,7 +249,7 @@
* @see #METHOD_ADD_COLUMN
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String EXTRA_EXISTING_COLUMN_NAMES =
"android.media.tv.extra.EXISTING_COLUMN_NAMES";
@@ -260,7 +260,7 @@
* @see #METHOD_ADD_COLUMN
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String EXTRA_COLUMN_NAME = "android.media.tv.extra.COLUMN_NAME";
/**
@@ -271,7 +271,7 @@
* @see #METHOD_ADD_COLUMN
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String EXTRA_DATA_TYPE = "android.media.tv.extra.DATA_TYPE";
/**
@@ -282,7 +282,7 @@
* @see #METHOD_ADD_COLUMN
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String EXTRA_DEFAULT_VALUE = "android.media.tv.extra.DEFAULT_VALUE";
/**
@@ -290,7 +290,7 @@
* ID to filter channels.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String PARAM_INPUT = "input";
/**
@@ -298,7 +298,7 @@
* ID to filter programs.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String PARAM_CHANNEL = "channel";
/**
@@ -306,7 +306,7 @@
* time (in milliseconds since the epoch) to filter programs.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String PARAM_START_TIME = "start_time";
/**
@@ -314,7 +314,7 @@
* (in milliseconds since the epoch) to filter programs.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String PARAM_END_TIME = "end_time";
/**
@@ -323,7 +323,7 @@
* not affected.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String PARAM_BROWSABLE_ONLY = "browsable_only";
/**
@@ -331,7 +331,7 @@
* genre to filter programs.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String PARAM_CANONICAL_GENRE = "canonical_genre";
/**
@@ -602,7 +602,7 @@
* Common columns for the tables of TV programs.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
interface ProgramColumns {
/**
* The review rating style for five star rating.
@@ -920,7 +920,7 @@
* Common columns for the tables of preview programs.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public interface PreviewProgramColumns {
/**
* The program type for movie.
@@ -1537,7 +1537,7 @@
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/channel";
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef({
TYPE_OTHER,
TYPE_NTSC,
@@ -1751,7 +1751,7 @@
public static final String TYPE_PREVIEW = "TYPE_PREVIEW";
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef({
SERVICE_TYPE_OTHER,
SERVICE_TYPE_AUDIO_VIDEO,
@@ -1770,7 +1770,7 @@
public static final String SERVICE_TYPE_AUDIO = "SERVICE_TYPE_AUDIO";
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef({
VIDEO_FORMAT_240P,
VIDEO_FORMAT_360P,
@@ -1820,7 +1820,7 @@
public static final String VIDEO_FORMAT_4320P = "VIDEO_FORMAT_4320P";
/** @hide */
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@StringDef({
VIDEO_RESOLUTION_SD,
VIDEO_RESOLUTION_ED,
@@ -2284,7 +2284,7 @@
* <p>Type: INTEGER (boolean)
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String COLUMN_SYSTEM_APPROVED = "system_approved";
/**
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/TvContractUtils.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/TvContractUtils.java
index 18d897d..99383c0 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/TvContractUtils.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/TvContractUtils.java
@@ -15,7 +15,7 @@
*/
package androidx.tvprovider.media.tv;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.media.tv.TvContentRating;
import android.text.TextUtils;
@@ -30,7 +30,7 @@
* Static helper methods for working with {@link android.media.tv.TvContract}.
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public class TvContractUtils {
static final TvContentRating[] EMPTY = new TvContentRating[0];
diff --git a/tv-provider/src/main/java/androidx/tvprovider/media/tv/WatchNextProgram.java b/tv-provider/src/main/java/androidx/tvprovider/media/tv/WatchNextProgram.java
index 3bfe6b3..5c7d17e 100644
--- a/tv-provider/src/main/java/androidx/tvprovider/media/tv/WatchNextProgram.java
+++ b/tv-provider/src/main/java/androidx/tvprovider/media/tv/WatchNextProgram.java
@@ -15,7 +15,7 @@
*/
package androidx.tvprovider.media.tv;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.content.ContentValues;
import android.database.Cursor;
@@ -81,7 +81,7 @@
/**
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static final String[] PROJECTION = getProjection();
private static final long INVALID_LONG_VALUE = -1;
@@ -96,7 +96,7 @@
WatchNextPrograms.WATCH_NEXT_TYPE_WATCHLIST,
})
@Retention(RetentionPolicy.SOURCE)
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public @interface WatchNextType {
}
@@ -173,7 +173,7 @@
* @param includeProtectedFields Whether the fields protected by system is included or not.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@Override
public ContentValues toContentValues(boolean includeProtectedFields) {
ContentValues values = super.toContentValues(includeProtectedFields);
diff --git a/versionedparcelable/api/1.1.0-alpha01.txt b/versionedparcelable/api/1.1.0-alpha01.txt
index a53654a..25cea04 100644
--- a/versionedparcelable/api/1.1.0-alpha01.txt
+++ b/versionedparcelable/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.versionedparcelable {
public class ParcelUtils {
diff --git a/versionedparcelable/api/1.1.0-alpha02.txt b/versionedparcelable/api/1.1.0-alpha02.txt
index a53654a..25cea04 100644
--- a/versionedparcelable/api/1.1.0-alpha02.txt
+++ b/versionedparcelable/api/1.1.0-alpha02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.versionedparcelable {
public class ParcelUtils {
diff --git a/versionedparcelable/api/current.txt b/versionedparcelable/api/current.txt
index a53654a..25cea04 100644
--- a/versionedparcelable/api/current.txt
+++ b/versionedparcelable/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.versionedparcelable {
public class ParcelUtils {
diff --git a/versionedparcelable/api/restricted_1.0.0.txt b/versionedparcelable/api/restricted_1.0.0.txt
deleted file mode 100644
index 6905e03..0000000
--- a/versionedparcelable/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,153 +0,0 @@
-// Signature format: 3.0
-package androidx.versionedparcelable {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class CustomVersionedParcelable implements androidx.versionedparcelable.VersionedParcelable {
- ctor public CustomVersionedParcelable();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void onPostParceling();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void onPreParceling(boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD}) public @interface NonParcelField {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD}) public @interface ParcelField {
- method public abstract int value();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class ParcelImpl {
- ctor public ParcelImpl(androidx.versionedparcelable.VersionedParcelable!);
- ctor protected ParcelImpl(android.os.Parcel!);
- method public int describeContents();
- method public <T extends androidx.versionedparcelable.VersionedParcelable> T! getVersionedParcel();
- method public void writeToParcel(android.os.Parcel!, int);
- field public static final android.os.Parcelable.Creator<androidx.versionedparcelable.ParcelImpl>! CREATOR;
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ParcelUtils {
- method public static <T extends androidx.versionedparcelable.VersionedParcelable> T! fromInputStream(java.io.InputStream!);
- method public static <T extends androidx.versionedparcelable.VersionedParcelable> T! fromParcelable(android.os.Parcelable!);
- method public static void toOutputStream(androidx.versionedparcelable.VersionedParcelable!, java.io.OutputStream!);
- method public static android.os.Parcelable! toParcelable(androidx.versionedparcelable.VersionedParcelable!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class VersionedParcel {
- ctor public VersionedParcel();
- method protected abstract void closeField();
- method protected abstract androidx.versionedparcelable.VersionedParcel! createSubParcel();
- method protected static Throwable getRootCause(Throwable);
- method public boolean isStream();
- method public <T> T[]! readArray(T[]!, int);
- method protected <T> T[]! readArray(T[]!);
- method protected abstract boolean readBoolean();
- method public boolean readBoolean(boolean, int);
- method public boolean[]! readBooleanArray(boolean[]!, int);
- method protected boolean[]! readBooleanArray();
- method protected abstract android.os.Bundle! readBundle();
- method public android.os.Bundle! readBundle(android.os.Bundle!, int);
- method public byte readByte(byte, int);
- method protected abstract byte[]! readByteArray();
- method public byte[]! readByteArray(byte[]!, int);
- method public char[]! readCharArray(char[]!, int);
- method protected abstract double readDouble();
- method public double readDouble(double, int);
- method public double[]! readDoubleArray(double[]!, int);
- method protected double[]! readDoubleArray();
- method public Exception! readException(Exception!, int);
- method protected abstract boolean readField(int);
- method protected abstract float readFloat();
- method public float readFloat(float, int);
- method public float[]! readFloatArray(float[]!, int);
- method protected float[]! readFloatArray();
- method protected static <T extends androidx.versionedparcelable.VersionedParcelable> T! readFromParcel(String!, androidx.versionedparcelable.VersionedParcel!);
- method protected abstract int readInt();
- method public int readInt(int, int);
- method public int[]! readIntArray(int[]!, int);
- method protected int[]! readIntArray();
- method public <T> java.util.List<T>! readList(java.util.List<T>!, int);
- method protected abstract long readLong();
- method public long readLong(long, int);
- method public long[]! readLongArray(long[]!, int);
- method protected long[]! readLongArray();
- method protected abstract <T extends > T! readParcelable();
- method public <T extends > T! readParcelable(T!, int);
- method protected java.io.Serializable! readSerializable();
- method public <T> java.util.Set<T>! readSet(java.util.Set<T>!, int);
- method @RequiresApi(api=21) public android.util.Size! readSize(android.util.Size!, int);
- method @RequiresApi(api=21) public android.util.SizeF! readSizeF(android.util.SizeF!, int);
- method public android.util.SparseBooleanArray! readSparseBooleanArray(android.util.SparseBooleanArray!, int);
- method protected abstract String! readString();
- method public String! readString(String!, int);
- method protected abstract android.os.IBinder! readStrongBinder();
- method public android.os.IBinder! readStrongBinder(android.os.IBinder!, int);
- method public <T extends androidx.versionedparcelable.VersionedParcelable> T! readVersionedParcelable(T!, int);
- method protected <T extends androidx.versionedparcelable.VersionedParcelable> T! readVersionedParcelable();
- method protected abstract void setOutputField(int);
- method public void setSerializationFlags(boolean, boolean);
- method public <T> void writeArray(T[]!, int);
- method protected <T> void writeArray(T[]!);
- method protected abstract void writeBoolean(boolean);
- method public void writeBoolean(boolean, int);
- method public void writeBooleanArray(boolean[]!, int);
- method protected void writeBooleanArray(boolean[]!);
- method protected abstract void writeBundle(android.os.Bundle!);
- method public void writeBundle(android.os.Bundle!, int);
- method public void writeByte(byte, int);
- method protected abstract void writeByteArray(byte[]!);
- method protected abstract void writeByteArray(byte[]!, int, int);
- method public void writeByteArray(byte[]!, int);
- method public void writeByteArray(byte[]!, int, int, int);
- method public void writeCharArray(char[]!, int);
- method protected abstract void writeDouble(double);
- method public void writeDouble(double, int);
- method public void writeDoubleArray(double[]!, int);
- method protected void writeDoubleArray(double[]!);
- method public void writeException(Exception!, int);
- method protected abstract void writeFloat(float);
- method public void writeFloat(float, int);
- method public void writeFloatArray(float[]!, int);
- method protected void writeFloatArray(float[]!);
- method protected abstract void writeInt(int);
- method public void writeInt(int, int);
- method public void writeIntArray(int[]!, int);
- method protected void writeIntArray(int[]!);
- method public <T> void writeList(java.util.List<T>!, int);
- method protected abstract void writeLong(long);
- method public void writeLong(long, int);
- method public void writeLongArray(long[]!, int);
- method protected void writeLongArray(long[]!);
- method protected void writeNoException();
- method protected abstract void writeParcelable(android.os.Parcelable!);
- method public void writeParcelable(android.os.Parcelable!, int);
- method public void writeSerializable(java.io.Serializable!, int);
- method public <T> void writeSet(java.util.Set<T>!, int);
- method @RequiresApi(api=21) public void writeSize(android.util.Size!, int);
- method @RequiresApi(api=21) public void writeSizeF(android.util.SizeF!, int);
- method public void writeSparseBooleanArray(android.util.SparseBooleanArray!, int);
- method protected abstract void writeString(String!);
- method public void writeString(String!, int);
- method protected abstract void writeStrongBinder(android.os.IBinder!);
- method public void writeStrongBinder(android.os.IBinder!, int);
- method protected abstract void writeStrongInterface(android.os.IInterface!);
- method public void writeStrongInterface(android.os.IInterface!, int);
- method protected static <T extends androidx.versionedparcelable.VersionedParcelable> void writeToParcel(T!, androidx.versionedparcelable.VersionedParcel!);
- method public void writeVersionedParcelable(androidx.versionedparcelable.VersionedParcelable!, int);
- method protected void writeVersionedParcelable(androidx.versionedparcelable.VersionedParcelable!);
- }
-
- public static class VersionedParcel.ParcelException {
- ctor public VersionedParcel.ParcelException(Throwable!);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface VersionedParcelable {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public @interface VersionedParcelize {
- method public abstract boolean allowSerialization() default false;
- method public abstract int[] deprecatedIds() default {};
- method public abstract boolean ignoreParcelables() default false;
- method public abstract boolean isCustom() default false;
- method public abstract String jetifyAs() default "";
- }
-
-}
-
diff --git a/versionedparcelable/api/restricted_1.1.0-alpha02.ignore b/versionedparcelable/api/restricted_1.1.0-alpha02.ignore
deleted file mode 100644
index 13e19cd..0000000
--- a/versionedparcelable/api/restricted_1.1.0-alpha02.ignore
+++ /dev/null
@@ -1,27 +0,0 @@
-// Baseline format: 1.0
-AddedAbstractMethod: androidx.versionedparcelable.ParcelField#defaultValue():
- Added method androidx.versionedparcelable.ParcelField.defaultValue()
-AddedAbstractMethod: androidx.versionedparcelable.VersionedParcel#readCharSequence():
- Added method androidx.versionedparcelable.VersionedParcel.readCharSequence()
-AddedAbstractMethod: androidx.versionedparcelable.VersionedParcel#writeCharSequence(CharSequence):
- Added method androidx.versionedparcelable.VersionedParcel.writeCharSequence(CharSequence)
-AddedAbstractMethod: androidx.versionedparcelable.VersionedParcelize#factory():
- Added method androidx.versionedparcelable.VersionedParcelize.factory()
-
-
-ChangedStatic: androidx.versionedparcelable.VersionedParcel#readFromParcel(String, androidx.versionedparcelable.VersionedParcel):
- Method androidx.versionedparcelable.VersionedParcel.readFromParcel has changed 'static' qualifier
-ChangedStatic: androidx.versionedparcelable.VersionedParcel#writeToParcel(T, androidx.versionedparcelable.VersionedParcel):
- Method androidx.versionedparcelable.VersionedParcel.writeToParcel has changed 'static' qualifier
-
-
-ChangedType: androidx.versionedparcelable.VersionedParcel#readParcelable():
- Method androidx.versionedparcelable.VersionedParcel.readParcelable has changed return type from T (extends java.lang.Object) to T (extends android.os.Parcelable)
-ChangedType: androidx.versionedparcelable.VersionedParcel#readParcelable(T, int):
- Method androidx.versionedparcelable.VersionedParcel.readParcelable has changed return type from T (extends java.lang.Object) to T (extends android.os.Parcelable)
-
-
-RemovedMethod: androidx.versionedparcelable.VersionedParcel#VersionedParcel():
- Removed constructor androidx.versionedparcelable.VersionedParcel()
-
-
diff --git a/versionedparcelable/api/restricted_1.1.0-alpha02.txt b/versionedparcelable/api/restricted_1.1.0-alpha02.txt
deleted file mode 100644
index b934327..0000000
--- a/versionedparcelable/api/restricted_1.1.0-alpha02.txt
+++ /dev/null
@@ -1,153 +0,0 @@
-// Signature format: 3.0
-package androidx.versionedparcelable {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class CustomVersionedParcelable implements androidx.versionedparcelable.VersionedParcelable {
- ctor public CustomVersionedParcelable();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void onPostParceling();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void onPreParceling(boolean);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target(java.lang.annotation.ElementType.FIELD) public @interface NonParcelField {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target(java.lang.annotation.ElementType.FIELD) public @interface ParcelField {
- method public abstract String defaultValue() default "";
- method public abstract int value();
- }
-
-
- public class ParcelUtils {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static <T extends androidx.versionedparcelable.VersionedParcelable> T! fromInputStream(java.io.InputStream!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static <T extends androidx.versionedparcelable.VersionedParcelable> T! fromParcelable(android.os.Parcelable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static void toOutputStream(androidx.versionedparcelable.VersionedParcelable!, java.io.OutputStream!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.os.Parcelable! toParcelable(androidx.versionedparcelable.VersionedParcelable!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class VersionedParcel {
- ctor public VersionedParcel(androidx.collection.ArrayMap<java.lang.String,java.lang.reflect.Method>!, androidx.collection.ArrayMap<java.lang.String,java.lang.reflect.Method>!, androidx.collection.ArrayMap<java.lang.String,java.lang.Class>!);
- method protected abstract void closeField();
- method protected abstract androidx.versionedparcelable.VersionedParcel! createSubParcel();
- method protected static Throwable getRootCause(Throwable);
- method public boolean isStream();
- method public <T> T[]! readArray(T[]!, int);
- method protected <T> T[]! readArray(T[]!);
- method protected abstract boolean readBoolean();
- method public boolean readBoolean(boolean, int);
- method public boolean[]! readBooleanArray(boolean[]!, int);
- method protected boolean[]! readBooleanArray();
- method protected abstract android.os.Bundle! readBundle();
- method public android.os.Bundle! readBundle(android.os.Bundle!, int);
- method public byte readByte(byte, int);
- method protected abstract byte[]! readByteArray();
- method public byte[]! readByteArray(byte[]!, int);
- method public char[]! readCharArray(char[]!, int);
- method protected abstract CharSequence! readCharSequence();
- method public CharSequence! readCharSequence(CharSequence!, int);
- method protected abstract double readDouble();
- method public double readDouble(double, int);
- method public double[]! readDoubleArray(double[]!, int);
- method protected double[]! readDoubleArray();
- method public Exception! readException(Exception!, int);
- method protected abstract boolean readField(int);
- method protected abstract float readFloat();
- method public float readFloat(float, int);
- method public float[]! readFloatArray(float[]!, int);
- method protected float[]! readFloatArray();
- method protected <T extends androidx.versionedparcelable.VersionedParcelable> T! readFromParcel(String!, androidx.versionedparcelable.VersionedParcel!);
- method protected abstract int readInt();
- method public int readInt(int, int);
- method public int[]! readIntArray(int[]!, int);
- method protected int[]! readIntArray();
- method public <T> java.util.List<T>! readList(java.util.List<T>!, int);
- method protected abstract long readLong();
- method public long readLong(long, int);
- method public long[]! readLongArray(long[]!, int);
- method protected long[]! readLongArray();
- method public <K, V> java.util.Map<K,V>! readMap(java.util.Map<K,V>!, int);
- method protected abstract <T extends android.os.Parcelable> T! readParcelable();
- method public <T extends android.os.Parcelable> T! readParcelable(T!, int);
- method protected java.io.Serializable! readSerializable();
- method public <T> java.util.Set<T>! readSet(java.util.Set<T>!, int);
- method @RequiresApi(api=android.os.Build.VERSION_CODES.LOLLIPOP) public android.util.Size! readSize(android.util.Size!, int);
- method @RequiresApi(api=android.os.Build.VERSION_CODES.LOLLIPOP) public android.util.SizeF! readSizeF(android.util.SizeF!, int);
- method public android.util.SparseBooleanArray! readSparseBooleanArray(android.util.SparseBooleanArray!, int);
- method protected abstract String! readString();
- method public String! readString(String!, int);
- method protected abstract android.os.IBinder! readStrongBinder();
- method public android.os.IBinder! readStrongBinder(android.os.IBinder!, int);
- method public <T extends androidx.versionedparcelable.VersionedParcelable> T! readVersionedParcelable(T!, int);
- method protected <T extends androidx.versionedparcelable.VersionedParcelable> T! readVersionedParcelable();
- method protected abstract void setOutputField(int);
- method public void setSerializationFlags(boolean, boolean);
- method public <T> void writeArray(T[]!, int);
- method protected <T> void writeArray(T[]!);
- method protected abstract void writeBoolean(boolean);
- method public void writeBoolean(boolean, int);
- method public void writeBooleanArray(boolean[]!, int);
- method protected void writeBooleanArray(boolean[]!);
- method protected abstract void writeBundle(android.os.Bundle!);
- method public void writeBundle(android.os.Bundle!, int);
- method public void writeByte(byte, int);
- method protected abstract void writeByteArray(byte[]!);
- method protected abstract void writeByteArray(byte[]!, int, int);
- method public void writeByteArray(byte[]!, int);
- method public void writeByteArray(byte[]!, int, int, int);
- method public void writeCharArray(char[]!, int);
- method protected abstract void writeCharSequence(CharSequence!);
- method public void writeCharSequence(CharSequence!, int);
- method protected abstract void writeDouble(double);
- method public void writeDouble(double, int);
- method public void writeDoubleArray(double[]!, int);
- method protected void writeDoubleArray(double[]!);
- method public void writeException(Exception!, int);
- method protected abstract void writeFloat(float);
- method public void writeFloat(float, int);
- method public void writeFloatArray(float[]!, int);
- method protected void writeFloatArray(float[]!);
- method protected abstract void writeInt(int);
- method public void writeInt(int, int);
- method public void writeIntArray(int[]!, int);
- method protected void writeIntArray(int[]!);
- method public <T> void writeList(java.util.List<T>!, int);
- method protected abstract void writeLong(long);
- method public void writeLong(long, int);
- method public void writeLongArray(long[]!, int);
- method protected void writeLongArray(long[]!);
- method public <K, V> void writeMap(java.util.Map<K,V>!, int);
- method protected void writeNoException();
- method protected abstract void writeParcelable(android.os.Parcelable!);
- method public void writeParcelable(android.os.Parcelable!, int);
- method public void writeSerializable(java.io.Serializable!, int);
- method public <T> void writeSet(java.util.Set<T>!, int);
- method @RequiresApi(api=android.os.Build.VERSION_CODES.LOLLIPOP) public void writeSize(android.util.Size!, int);
- method @RequiresApi(api=android.os.Build.VERSION_CODES.LOLLIPOP) public void writeSizeF(android.util.SizeF!, int);
- method public void writeSparseBooleanArray(android.util.SparseBooleanArray!, int);
- method protected abstract void writeString(String!);
- method public void writeString(String!, int);
- method protected abstract void writeStrongBinder(android.os.IBinder!);
- method public void writeStrongBinder(android.os.IBinder!, int);
- method protected abstract void writeStrongInterface(android.os.IInterface!);
- method public void writeStrongInterface(android.os.IInterface!, int);
- method protected <T extends androidx.versionedparcelable.VersionedParcelable> void writeToParcel(T!, androidx.versionedparcelable.VersionedParcel!);
- method public void writeVersionedParcelable(androidx.versionedparcelable.VersionedParcelable!, int);
- method protected void writeVersionedParcelable(androidx.versionedparcelable.VersionedParcelable!);
- field protected final androidx.collection.ArrayMap<java.lang.String,java.lang.Class>! mParcelizerCache;
- field protected final androidx.collection.ArrayMap<java.lang.String,java.lang.reflect.Method>! mReadCache;
- field protected final androidx.collection.ArrayMap<java.lang.String,java.lang.reflect.Method>! mWriteCache;
- }
-
- public static class VersionedParcel.ParcelException extends java.lang.RuntimeException {
- ctor public VersionedParcel.ParcelException(Throwable!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) public @interface VersionedParcelize {
- method public abstract boolean allowSerialization() default false;
- method public abstract int[] deprecatedIds() default {};
- method public abstract Class factory() default void.class;
- method public abstract boolean ignoreParcelables() default false;
- method public abstract boolean isCustom() default false;
- method public abstract String jetifyAs() default "";
- }
-
-}
-
diff --git a/versionedparcelable/api/restricted_current.txt b/versionedparcelable/api/restricted_current.txt
deleted file mode 100644
index b934327..0000000
--- a/versionedparcelable/api/restricted_current.txt
+++ /dev/null
@@ -1,153 +0,0 @@
-// Signature format: 3.0
-package androidx.versionedparcelable {
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class CustomVersionedParcelable implements androidx.versionedparcelable.VersionedParcelable {
- ctor public CustomVersionedParcelable();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void onPostParceling();
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public void onPreParceling(boolean);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target(java.lang.annotation.ElementType.FIELD) public @interface NonParcelField {
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target(java.lang.annotation.ElementType.FIELD) public @interface ParcelField {
- method public abstract String defaultValue() default "";
- method public abstract int value();
- }
-
-
- public class ParcelUtils {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static <T extends androidx.versionedparcelable.VersionedParcelable> T! fromInputStream(java.io.InputStream!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static <T extends androidx.versionedparcelable.VersionedParcelable> T! fromParcelable(android.os.Parcelable!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static void toOutputStream(androidx.versionedparcelable.VersionedParcelable!, java.io.OutputStream!);
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static android.os.Parcelable! toParcelable(androidx.versionedparcelable.VersionedParcelable!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public abstract class VersionedParcel {
- ctor public VersionedParcel(androidx.collection.ArrayMap<java.lang.String,java.lang.reflect.Method>!, androidx.collection.ArrayMap<java.lang.String,java.lang.reflect.Method>!, androidx.collection.ArrayMap<java.lang.String,java.lang.Class>!);
- method protected abstract void closeField();
- method protected abstract androidx.versionedparcelable.VersionedParcel! createSubParcel();
- method protected static Throwable getRootCause(Throwable);
- method public boolean isStream();
- method public <T> T[]! readArray(T[]!, int);
- method protected <T> T[]! readArray(T[]!);
- method protected abstract boolean readBoolean();
- method public boolean readBoolean(boolean, int);
- method public boolean[]! readBooleanArray(boolean[]!, int);
- method protected boolean[]! readBooleanArray();
- method protected abstract android.os.Bundle! readBundle();
- method public android.os.Bundle! readBundle(android.os.Bundle!, int);
- method public byte readByte(byte, int);
- method protected abstract byte[]! readByteArray();
- method public byte[]! readByteArray(byte[]!, int);
- method public char[]! readCharArray(char[]!, int);
- method protected abstract CharSequence! readCharSequence();
- method public CharSequence! readCharSequence(CharSequence!, int);
- method protected abstract double readDouble();
- method public double readDouble(double, int);
- method public double[]! readDoubleArray(double[]!, int);
- method protected double[]! readDoubleArray();
- method public Exception! readException(Exception!, int);
- method protected abstract boolean readField(int);
- method protected abstract float readFloat();
- method public float readFloat(float, int);
- method public float[]! readFloatArray(float[]!, int);
- method protected float[]! readFloatArray();
- method protected <T extends androidx.versionedparcelable.VersionedParcelable> T! readFromParcel(String!, androidx.versionedparcelable.VersionedParcel!);
- method protected abstract int readInt();
- method public int readInt(int, int);
- method public int[]! readIntArray(int[]!, int);
- method protected int[]! readIntArray();
- method public <T> java.util.List<T>! readList(java.util.List<T>!, int);
- method protected abstract long readLong();
- method public long readLong(long, int);
- method public long[]! readLongArray(long[]!, int);
- method protected long[]! readLongArray();
- method public <K, V> java.util.Map<K,V>! readMap(java.util.Map<K,V>!, int);
- method protected abstract <T extends android.os.Parcelable> T! readParcelable();
- method public <T extends android.os.Parcelable> T! readParcelable(T!, int);
- method protected java.io.Serializable! readSerializable();
- method public <T> java.util.Set<T>! readSet(java.util.Set<T>!, int);
- method @RequiresApi(api=android.os.Build.VERSION_CODES.LOLLIPOP) public android.util.Size! readSize(android.util.Size!, int);
- method @RequiresApi(api=android.os.Build.VERSION_CODES.LOLLIPOP) public android.util.SizeF! readSizeF(android.util.SizeF!, int);
- method public android.util.SparseBooleanArray! readSparseBooleanArray(android.util.SparseBooleanArray!, int);
- method protected abstract String! readString();
- method public String! readString(String!, int);
- method protected abstract android.os.IBinder! readStrongBinder();
- method public android.os.IBinder! readStrongBinder(android.os.IBinder!, int);
- method public <T extends androidx.versionedparcelable.VersionedParcelable> T! readVersionedParcelable(T!, int);
- method protected <T extends androidx.versionedparcelable.VersionedParcelable> T! readVersionedParcelable();
- method protected abstract void setOutputField(int);
- method public void setSerializationFlags(boolean, boolean);
- method public <T> void writeArray(T[]!, int);
- method protected <T> void writeArray(T[]!);
- method protected abstract void writeBoolean(boolean);
- method public void writeBoolean(boolean, int);
- method public void writeBooleanArray(boolean[]!, int);
- method protected void writeBooleanArray(boolean[]!);
- method protected abstract void writeBundle(android.os.Bundle!);
- method public void writeBundle(android.os.Bundle!, int);
- method public void writeByte(byte, int);
- method protected abstract void writeByteArray(byte[]!);
- method protected abstract void writeByteArray(byte[]!, int, int);
- method public void writeByteArray(byte[]!, int);
- method public void writeByteArray(byte[]!, int, int, int);
- method public void writeCharArray(char[]!, int);
- method protected abstract void writeCharSequence(CharSequence!);
- method public void writeCharSequence(CharSequence!, int);
- method protected abstract void writeDouble(double);
- method public void writeDouble(double, int);
- method public void writeDoubleArray(double[]!, int);
- method protected void writeDoubleArray(double[]!);
- method public void writeException(Exception!, int);
- method protected abstract void writeFloat(float);
- method public void writeFloat(float, int);
- method public void writeFloatArray(float[]!, int);
- method protected void writeFloatArray(float[]!);
- method protected abstract void writeInt(int);
- method public void writeInt(int, int);
- method public void writeIntArray(int[]!, int);
- method protected void writeIntArray(int[]!);
- method public <T> void writeList(java.util.List<T>!, int);
- method protected abstract void writeLong(long);
- method public void writeLong(long, int);
- method public void writeLongArray(long[]!, int);
- method protected void writeLongArray(long[]!);
- method public <K, V> void writeMap(java.util.Map<K,V>!, int);
- method protected void writeNoException();
- method protected abstract void writeParcelable(android.os.Parcelable!);
- method public void writeParcelable(android.os.Parcelable!, int);
- method public void writeSerializable(java.io.Serializable!, int);
- method public <T> void writeSet(java.util.Set<T>!, int);
- method @RequiresApi(api=android.os.Build.VERSION_CODES.LOLLIPOP) public void writeSize(android.util.Size!, int);
- method @RequiresApi(api=android.os.Build.VERSION_CODES.LOLLIPOP) public void writeSizeF(android.util.SizeF!, int);
- method public void writeSparseBooleanArray(android.util.SparseBooleanArray!, int);
- method protected abstract void writeString(String!);
- method public void writeString(String!, int);
- method protected abstract void writeStrongBinder(android.os.IBinder!);
- method public void writeStrongBinder(android.os.IBinder!, int);
- method protected abstract void writeStrongInterface(android.os.IInterface!);
- method public void writeStrongInterface(android.os.IInterface!, int);
- method protected <T extends androidx.versionedparcelable.VersionedParcelable> void writeToParcel(T!, androidx.versionedparcelable.VersionedParcel!);
- method public void writeVersionedParcelable(androidx.versionedparcelable.VersionedParcelable!, int);
- method protected void writeVersionedParcelable(androidx.versionedparcelable.VersionedParcelable!);
- field protected final androidx.collection.ArrayMap<java.lang.String,java.lang.Class>! mParcelizerCache;
- field protected final androidx.collection.ArrayMap<java.lang.String,java.lang.reflect.Method>! mReadCache;
- field protected final androidx.collection.ArrayMap<java.lang.String,java.lang.reflect.Method>! mWriteCache;
- }
-
- public static class VersionedParcel.ParcelException extends java.lang.RuntimeException {
- ctor public VersionedParcel.ParcelException(Throwable!);
- }
-
- @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) public @interface VersionedParcelize {
- method public abstract boolean allowSerialization() default false;
- method public abstract int[] deprecatedIds() default {};
- method public abstract Class factory() default void.class;
- method public abstract boolean ignoreParcelables() default false;
- method public abstract boolean isCustom() default false;
- method public abstract String jetifyAs() default "";
- }
-
-}
-
diff --git a/versionedparcelable/build.gradle b/versionedparcelable/build.gradle
index 27858d6..1f5ae98 100644
--- a/versionedparcelable/build.gradle
+++ b/versionedparcelable/build.gradle
@@ -24,7 +24,7 @@
}
dependencies {
- implementation(project(":annotation"))
+ implementation("androidx.annotation:annotation:1.0.0")
implementation("androidx.collection:collection:1.0.0")
androidTestImplementation(TEST_EXT_JUNIT)
diff --git a/versionedparcelable/src/main/java/androidx/versionedparcelable/CustomVersionedParcelable.java b/versionedparcelable/src/main/java/androidx/versionedparcelable/CustomVersionedParcelable.java
index 9fc9bdd2..598b07c 100644
--- a/versionedparcelable/src/main/java/androidx/versionedparcelable/CustomVersionedParcelable.java
+++ b/versionedparcelable/src/main/java/androidx/versionedparcelable/CustomVersionedParcelable.java
@@ -23,7 +23,7 @@
* and right after deserialization to handle custom fields.
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public abstract class CustomVersionedParcelable implements VersionedParcelable {
/**
@@ -31,7 +31,7 @@
* to handle any custom fields that cannot be easily annotated.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public void onPreParceling(boolean isStream) {
}
@@ -40,7 +40,7 @@
* to handle any custom fields that cannot be easily annotated.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public void onPostParceling() {
}
}
diff --git a/versionedparcelable/src/main/java/androidx/versionedparcelable/NonParcelField.java b/versionedparcelable/src/main/java/androidx/versionedparcelable/NonParcelField.java
index 1fd53ec..7a5a850 100644
--- a/versionedparcelable/src/main/java/androidx/versionedparcelable/NonParcelField.java
+++ b/versionedparcelable/src/main/java/androidx/versionedparcelable/NonParcelField.java
@@ -16,7 +16,7 @@
package androidx.versionedparcelable;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
@@ -32,6 +32,6 @@
*/
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.FIELD)
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public @interface NonParcelField {
}
diff --git a/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelField.java b/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelField.java
index 9a5d6f1..c2590d8 100644
--- a/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelField.java
+++ b/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelField.java
@@ -29,7 +29,7 @@
*/
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.FIELD)
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public @interface ParcelField {
int value();
diff --git a/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelUtils.java b/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelUtils.java
index b9b3b04..3626a47 100644
--- a/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelUtils.java
+++ b/versionedparcelable/src/main/java/androidx/versionedparcelable/ParcelUtils.java
@@ -16,7 +16,7 @@
package androidx.versionedparcelable;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.Bundle;
import android.os.Parcelable;
@@ -41,7 +41,7 @@
* Turn a VersionedParcelable into a Parcelable
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static Parcelable toParcelable(VersionedParcelable obj) {
return new ParcelImpl(obj);
}
@@ -50,7 +50,7 @@
* Turn a Parcelable into a VersionedParcelable.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
@SuppressWarnings("TypeParameterUnusedInFormals")
public static <T extends VersionedParcelable> T fromParcelable(Parcelable p) {
if (!(p instanceof ParcelImpl)) {
@@ -63,7 +63,7 @@
* Write a VersionedParcelable into an OutputStream.
* @hide
*/
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static void toOutputStream(VersionedParcelable obj, OutputStream output) {
VersionedParcelStream stream = new VersionedParcelStream(null, output);
stream.writeVersionedParcelable(obj);
@@ -75,7 +75,7 @@
* @hide
*/
@SuppressWarnings("TypeParameterUnusedInFormals")
- @RestrictTo(LIBRARY_GROUP_PREFIX)
+ @RestrictTo(LIBRARY_GROUP)
public static <T extends VersionedParcelable> T fromInputStream(InputStream input) {
VersionedParcelStream stream = new VersionedParcelStream(input, null);
return stream.readVersionedParcelable();
diff --git a/versionedparcelable/src/main/java/androidx/versionedparcelable/VersionedParcel.java b/versionedparcelable/src/main/java/androidx/versionedparcelable/VersionedParcel.java
index bf30feb..9a09dc9c 100644
--- a/versionedparcelable/src/main/java/androidx/versionedparcelable/VersionedParcel.java
+++ b/versionedparcelable/src/main/java/androidx/versionedparcelable/VersionedParcel.java
@@ -16,7 +16,7 @@
package androidx.versionedparcelable;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.BadParcelableException;
import android.os.Build;
@@ -54,7 +54,7 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public abstract class VersionedParcel {
private static final String TAG = "VersionedParcel";
diff --git a/versionedparcelable/src/main/java/androidx/versionedparcelable/VersionedParcelize.java b/versionedparcelable/src/main/java/androidx/versionedparcelable/VersionedParcelize.java
index 25b417a..fe920ce 100644
--- a/versionedparcelable/src/main/java/androidx/versionedparcelable/VersionedParcelize.java
+++ b/versionedparcelable/src/main/java/androidx/versionedparcelable/VersionedParcelize.java
@@ -16,7 +16,7 @@
package androidx.versionedparcelable;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import android.os.IBinder;
import android.os.IInterface;
@@ -38,7 +38,7 @@
*/
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
public @interface VersionedParcelize {
/**
* Whether or not to allow this VersionedParcelable to be used with
diff --git a/viewpager/api/1.0.0.txt b/viewpager/api/1.0.0.txt
index 28fbc62..de25917 100644
--- a/viewpager/api/1.0.0.txt
+++ b/viewpager/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.viewpager.widget {
public abstract class PagerAdapter {
diff --git a/viewpager/api/1.1.0-alpha01.txt b/viewpager/api/1.1.0-alpha01.txt
index 50813a2..4343e5d 100644
--- a/viewpager/api/1.1.0-alpha01.txt
+++ b/viewpager/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.viewpager.widget {
public abstract class PagerAdapter {
@@ -88,7 +88,7 @@
field public static final int SCROLL_STATE_SETTLING = 2; // 0x2
}
- @java.lang.annotation.Inherited @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) public static @interface ViewPager.DecorView {
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) @java.lang.annotation.Inherited public static @interface ViewPager.DecorView {
}
public static class ViewPager.LayoutParams extends android.view.ViewGroup.LayoutParams {
diff --git a/viewpager/api/current.txt b/viewpager/api/current.txt
index 50813a2..4343e5d 100644
--- a/viewpager/api/current.txt
+++ b/viewpager/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.viewpager.widget {
public abstract class PagerAdapter {
@@ -88,7 +88,7 @@
field public static final int SCROLL_STATE_SETTLING = 2; // 0x2
}
- @java.lang.annotation.Inherited @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) public static @interface ViewPager.DecorView {
+ @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE) @java.lang.annotation.Inherited public static @interface ViewPager.DecorView {
}
public static class ViewPager.LayoutParams extends android.view.ViewGroup.LayoutParams {
diff --git a/viewpager/api/restricted_1.0.0.txt b/viewpager/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/viewpager/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/viewpager/api/restricted_1.1.0-alpha01.txt b/viewpager/api/restricted_1.1.0-alpha01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/viewpager/api/restricted_1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/viewpager/api/restricted_current.txt b/viewpager/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/viewpager/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/viewpager/src/main/java/androidx/viewpager/widget/ViewPager.java b/viewpager/src/main/java/androidx/viewpager/widget/ViewPager.java
index d1efc7d..c067c75 100644
--- a/viewpager/src/main/java/androidx/viewpager/widget/ViewPager.java
+++ b/viewpager/src/main/java/androidx/viewpager/widget/ViewPager.java
@@ -119,10 +119,6 @@
private static final int MIN_FLING_VELOCITY = 400; // dips
- /** Class name may be obfuscated by Proguard. Hardcode the string for accessibility usage. */
- private static final String ACCESSIBILITY_CLASS_NAME =
- "androidx.viewpager.widget.ViewPager";
-
static final int[] LAYOUT_ATTRS = new int[] {
android.R.attr.layout_gravity
};
@@ -3052,7 +3048,7 @@
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(host, event);
- event.setClassName(ACCESSIBILITY_CLASS_NAME);
+ event.setClassName(ViewPager.class.getName());
event.setScrollable(canScroll());
if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_SCROLLED && mAdapter != null) {
event.setItemCount(mAdapter.getCount());
@@ -3064,7 +3060,7 @@
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
- info.setClassName(ACCESSIBILITY_CLASS_NAME);
+ info.setClassName(ViewPager.class.getName());
info.setScrollable(canScroll());
if (canScrollHorizontally(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
diff --git a/viewpager2/api/1.0.0-alpha01.txt b/viewpager2/api/1.0.0-alpha01.txt
index fec64af..e7cd1bc 100644
--- a/viewpager2/api/1.0.0-alpha01.txt
+++ b/viewpager2/api/1.0.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.viewpager2.adapter {
public abstract class FragmentStateAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.viewpager2.adapter.FragmentViewHolder> implements androidx.viewpager2.adapter.StatefulAdapter {
@@ -37,7 +37,6 @@
method public final androidx.recyclerview.widget.RecyclerView.Adapter? getAdapter();
method public final int getCurrentItem();
method @androidx.viewpager2.widget.ViewPager2.Orientation public final int getOrientation();
- method public boolean isUserInputEnabled();
method public final void onViewAdded(android.view.View!);
method public final void registerOnPageChangeCallback(androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback);
method public final void setAdapter(androidx.recyclerview.widget.RecyclerView.Adapter?);
@@ -45,7 +44,6 @@
method public final void setCurrentItem(int, boolean);
method public final void setOrientation(@androidx.viewpager2.widget.ViewPager2.Orientation int);
method public final void setPageTransformer(androidx.viewpager2.widget.ViewPager2.PageTransformer?);
- method public void setUserInputEnabled(boolean);
method public final void unregisterOnPageChangeCallback(androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback);
field public static final int ORIENTATION_HORIZONTAL = 0; // 0x0
field public static final int ORIENTATION_VERTICAL = 1; // 0x1
diff --git a/viewpager2/api/1.0.0-alpha02.txt b/viewpager2/api/1.0.0-alpha02.txt
deleted file mode 100644
index 5607352..0000000
--- a/viewpager2/api/1.0.0-alpha02.txt
+++ /dev/null
@@ -1,72 +0,0 @@
-// Signature format: 3.0
-package androidx.viewpager2.adapter {
-
- public abstract class FragmentStateAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.viewpager2.adapter.FragmentViewHolder> implements androidx.viewpager2.adapter.StatefulAdapter {
- ctor public FragmentStateAdapter(androidx.fragment.app.FragmentManager);
- method public boolean containsItem(long);
- method public abstract androidx.fragment.app.Fragment getItem(int);
- method public final void onBindViewHolder(androidx.viewpager2.adapter.FragmentViewHolder, int);
- method public final androidx.viewpager2.adapter.FragmentViewHolder onCreateViewHolder(android.view.ViewGroup, int);
- method public final boolean onFailedToRecycleView(androidx.viewpager2.adapter.FragmentViewHolder);
- method public final void onViewAttachedToWindow(androidx.viewpager2.adapter.FragmentViewHolder);
- method public final void onViewRecycled(androidx.viewpager2.adapter.FragmentViewHolder);
- method public void restoreState(android.os.Parcelable);
- method public android.os.Parcelable saveState();
- method public final void setHasStableIds(boolean);
- }
-
- public final class FragmentViewHolder extends androidx.recyclerview.widget.RecyclerView.ViewHolder {
- }
-
- public interface StatefulAdapter {
- method public void restoreState(android.os.Parcelable);
- method public android.os.Parcelable saveState();
- }
-
-}
-
-package androidx.viewpager2.widget {
-
- public final class ViewPager2 extends android.view.ViewGroup {
- ctor public ViewPager2(android.content.Context);
- ctor public ViewPager2(android.content.Context, android.util.AttributeSet?);
- ctor public ViewPager2(android.content.Context, android.util.AttributeSet?, int);
- ctor @RequiresApi(21) public ViewPager2(android.content.Context, android.util.AttributeSet?, int, int);
- method public androidx.recyclerview.widget.RecyclerView.Adapter? getAdapter();
- method public int getCurrentItem();
- method @androidx.viewpager2.widget.ViewPager2.Orientation public int getOrientation();
- method public boolean isUserInputEnabled();
- method public void registerOnPageChangeCallback(androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback);
- method public void setAdapter(androidx.recyclerview.widget.RecyclerView.Adapter?);
- method public void setCurrentItem(int);
- method public void setCurrentItem(int, boolean);
- method public void setOrientation(@androidx.viewpager2.widget.ViewPager2.Orientation int);
- method public void setPageTransformer(androidx.viewpager2.widget.ViewPager2.PageTransformer?);
- method public void setUserInputEnabled(boolean);
- method public void unregisterOnPageChangeCallback(androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback);
- field public static final int ORIENTATION_HORIZONTAL = 0; // 0x0
- field public static final int ORIENTATION_VERTICAL = 1; // 0x1
- field public static final int SCROLL_STATE_DRAGGING = 1; // 0x1
- field public static final int SCROLL_STATE_IDLE = 0; // 0x0
- field public static final int SCROLL_STATE_SETTLING = 2; // 0x2
- }
-
- public abstract static class ViewPager2.OnPageChangeCallback {
- ctor public ViewPager2.OnPageChangeCallback();
- method public void onPageScrollStateChanged(@androidx.viewpager2.widget.ViewPager2.ScrollState int);
- method public void onPageScrolled(int, float, @Px int);
- method public void onPageSelected(int);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({androidx.viewpager2.widget.ViewPager2.ORIENTATION_HORIZONTAL, androidx.viewpager2.widget.ViewPager2.ORIENTATION_VERTICAL}) public static @interface ViewPager2.Orientation {
- }
-
- public static interface ViewPager2.PageTransformer {
- method public void transformPage(android.view.View, float);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({androidx.viewpager2.widget.ViewPager2.SCROLL_STATE_IDLE, androidx.viewpager2.widget.ViewPager2.SCROLL_STATE_DRAGGING, androidx.viewpager2.widget.ViewPager2.SCROLL_STATE_SETTLING}) public static @interface ViewPager2.ScrollState {
- }
-
-}
-
diff --git a/viewpager2/api/current.txt b/viewpager2/api/current.txt
index 5607352..e7cd1bc 100644
--- a/viewpager2/api/current.txt
+++ b/viewpager2/api/current.txt
@@ -1,12 +1,14 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.viewpager2.adapter {
public abstract class FragmentStateAdapter extends androidx.recyclerview.widget.RecyclerView.Adapter<androidx.viewpager2.adapter.FragmentViewHolder> implements androidx.viewpager2.adapter.StatefulAdapter {
ctor public FragmentStateAdapter(androidx.fragment.app.FragmentManager);
method public boolean containsItem(long);
method public abstract androidx.fragment.app.Fragment getItem(int);
+ method public final void onAttachedToRecyclerView(androidx.recyclerview.widget.RecyclerView);
method public final void onBindViewHolder(androidx.viewpager2.adapter.FragmentViewHolder, int);
method public final androidx.viewpager2.adapter.FragmentViewHolder onCreateViewHolder(android.view.ViewGroup, int);
+ method public final void onDetachedFromRecyclerView(androidx.recyclerview.widget.RecyclerView);
method public final boolean onFailedToRecycleView(androidx.viewpager2.adapter.FragmentViewHolder);
method public final void onViewAttachedToWindow(androidx.viewpager2.adapter.FragmentViewHolder);
method public final void onViewRecycled(androidx.viewpager2.adapter.FragmentViewHolder);
@@ -27,23 +29,22 @@
package androidx.viewpager2.widget {
- public final class ViewPager2 extends android.view.ViewGroup {
+ public class ViewPager2 extends android.view.ViewGroup {
ctor public ViewPager2(android.content.Context);
ctor public ViewPager2(android.content.Context, android.util.AttributeSet?);
ctor public ViewPager2(android.content.Context, android.util.AttributeSet?, int);
ctor @RequiresApi(21) public ViewPager2(android.content.Context, android.util.AttributeSet?, int, int);
- method public androidx.recyclerview.widget.RecyclerView.Adapter? getAdapter();
- method public int getCurrentItem();
- method @androidx.viewpager2.widget.ViewPager2.Orientation public int getOrientation();
- method public boolean isUserInputEnabled();
- method public void registerOnPageChangeCallback(androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback);
- method public void setAdapter(androidx.recyclerview.widget.RecyclerView.Adapter?);
- method public void setCurrentItem(int);
- method public void setCurrentItem(int, boolean);
- method public void setOrientation(@androidx.viewpager2.widget.ViewPager2.Orientation int);
- method public void setPageTransformer(androidx.viewpager2.widget.ViewPager2.PageTransformer?);
- method public void setUserInputEnabled(boolean);
- method public void unregisterOnPageChangeCallback(androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback);
+ method public final androidx.recyclerview.widget.RecyclerView.Adapter? getAdapter();
+ method public final int getCurrentItem();
+ method @androidx.viewpager2.widget.ViewPager2.Orientation public final int getOrientation();
+ method public final void onViewAdded(android.view.View!);
+ method public final void registerOnPageChangeCallback(androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback);
+ method public final void setAdapter(androidx.recyclerview.widget.RecyclerView.Adapter?);
+ method public final void setCurrentItem(int);
+ method public final void setCurrentItem(int, boolean);
+ method public final void setOrientation(@androidx.viewpager2.widget.ViewPager2.Orientation int);
+ method public final void setPageTransformer(androidx.viewpager2.widget.ViewPager2.PageTransformer?);
+ method public final void unregisterOnPageChangeCallback(androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback);
field public static final int ORIENTATION_HORIZONTAL = 0; // 0x0
field public static final int ORIENTATION_VERTICAL = 1; // 0x1
field public static final int SCROLL_STATE_DRAGGING = 1; // 0x1
diff --git a/viewpager2/api/res-1.0.0-alpha02.txt b/viewpager2/api/res-1.0.0-alpha02.txt
deleted file mode 100644
index e69de29..0000000
--- a/viewpager2/api/res-1.0.0-alpha02.txt
+++ /dev/null
diff --git a/viewpager2/api/restricted_1.0.0-alpha02.txt b/viewpager2/api/restricted_1.0.0-alpha02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/viewpager2/api/restricted_1.0.0-alpha02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/viewpager2/api/restricted_current.txt b/viewpager2/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/viewpager2/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/viewpager2/build.gradle b/viewpager2/build.gradle
index e068aa8..49e9039 100644
--- a/viewpager2/build.gradle
+++ b/viewpager2/build.gradle
@@ -27,7 +27,6 @@
api(project(":fragment"))
api(project(":recyclerview"))
implementation(project(":appcompat"))
- implementation(project(":collection"))
androidTestImplementation(TEST_EXT_JUNIT)
androidTestImplementation(TEST_CORE)
diff --git a/viewpager2/integration-tests/testapp/build.gradle b/viewpager2/integration-tests/testapp/build.gradle
deleted file mode 100644
index 2b3a756..0000000
--- a/viewpager2/integration-tests/testapp/build.gradle
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2017 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.
- */
-
-import static androidx.build.dependencies.DependenciesKt.ARCH_LIFECYCLE_EXTENSIONS
-import static androidx.build.dependencies.DependenciesKt.ESPRESSO_CORE
-import static androidx.build.dependencies.DependenciesKt.KOTLIN_STDLIB
-import static androidx.build.dependencies.DependenciesKt.SUPPORT_DESIGN
-import static androidx.build.dependencies.DependenciesKt.TEST_EXT_JUNIT
-import static androidx.build.dependencies.DependenciesKt.TEST_RULES
-
-plugins {
- id("AndroidXPlugin")
- id("com.android.application")
- id("org.jetbrains.kotlin.android")
- id('kotlin-android-extensions')
-}
-
-dependencies {
- api(KOTLIN_STDLIB)
- implementation(project(":viewpager2"))
- implementation(ARCH_LIFECYCLE_EXTENSIONS)
- implementation(SUPPORT_DESIGN)
- implementation(project(":cardview"))
-
- androidTestImplementation(TEST_RULES)
- androidTestImplementation(TEST_EXT_JUNIT)
- androidTestImplementation(ESPRESSO_CORE)
-}
diff --git a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/BaseTest.kt b/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/BaseTest.kt
deleted file mode 100644
index c6f68d6..0000000
--- a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/BaseTest.kt
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2
-
-import android.view.View
-import androidx.annotation.LayoutRes
-import androidx.fragment.app.FragmentActivity
-import androidx.test.espresso.Espresso.onIdle
-import androidx.test.espresso.assertion.ViewAssertions.matches
-import androidx.test.espresso.matcher.ViewMatchers.hasDescendant
-import androidx.test.espresso.matcher.ViewMatchers.withText
-import androidx.test.rule.ActivityTestRule
-import androidx.viewpager2.widget.ViewPager2
-import com.example.androidx.viewpager2.test.ViewPagerIdleWatcher
-import com.example.androidx.viewpager2.test.onCurrentPage
-import com.example.androidx.viewpager2.test.onViewPager
-import com.example.androidx.viewpager2.test.swipeNext
-import com.example.androidx.viewpager2.test.swipePrevious
-import org.hamcrest.Matcher
-import org.junit.After
-import org.junit.Before
-import org.junit.Rule
-
-/**
- * Base class for all tests. Contains common functionality, like finding the [ViewPager2] under
- * test, swiping back and forth on it and waiting for it to become idle.
- *
- * @see ViewPagerBaseTest
- * @see MutableCollectionBaseTest
- * @see TabLayoutTest
- */
-abstract class BaseTest<T : FragmentActivity>(clazz: Class<T>) {
- @Rule
- @JvmField
- var activityTestRule = ActivityTestRule(clazz)
-
- @get:LayoutRes
- abstract val layoutId: Int
-
- lateinit var idleWatcher: ViewPagerIdleWatcher
- lateinit var viewPager: ViewPager2
-
- @Before
- open fun setUp() {
- viewPager = activityTestRule.activity.findViewById(layoutId)
- idleWatcher = ViewPagerIdleWatcher(viewPager)
- }
-
- @After
- open fun tearDown() {
- idleWatcher.unregister()
- }
-
- fun swipeToNextPage() {
- onViewPager().perform(swipeNext())
- idleWatcher.waitForIdle()
- onIdle()
- }
-
- fun swipeToPreviousPage() {
- onViewPager().perform(swipePrevious())
- idleWatcher.waitForIdle()
- onIdle()
- }
-
- fun verifyCurrentPage(pageText: String) {
- verifyCurrentPage(hasDescendant(withText(pageText)))
- }
-
- fun verifyCurrentPage(matcher: Matcher<View>) {
- onCurrentPage().check(matches(matcher))
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/MutableCollectionBaseTest.kt b/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/MutableCollectionBaseTest.kt
deleted file mode 100644
index 7eb6dca..0000000
--- a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/MutableCollectionBaseTest.kt
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2
-
-import androidx.test.espresso.Espresso.onData
-import androidx.test.espresso.Espresso.onView
-import androidx.test.espresso.action.ViewActions.click
-import androidx.test.espresso.assertion.ViewAssertions.matches
-import androidx.test.espresso.matcher.ViewMatchers.hasDescendant
-import androidx.test.espresso.matcher.ViewMatchers.withId
-import androidx.test.espresso.matcher.ViewMatchers.withText
-import org.hamcrest.CoreMatchers.allOf
-import org.hamcrest.CoreMatchers.equalTo
-import org.junit.Test
-
-/**
- * Generic test class for testing [MutableCollectionBaseActivity]s. Swipes from the first to the
- * eighth page, increases the count on the eighth page, inserts a new page at the beginning, swipes
- * back to the eighth page, swipes back to the first page and finally to the newly inserted page. On
- * each page, verifies the page number and the expected count. Implementations simply define the
- * Activity under test, see [MutableCollectionViewTest] and [MutableCollectionFragmentTest].
- */
-abstract class MutableCollectionBaseTest<T : MutableCollectionBaseActivity>(clazz: Class<T>) :
- BaseTest<T>(clazz) {
- override val layoutId get() = R.id.viewPager
-
- @Test
- fun testKeepsState() {
- // increase count of page 1 to 1
- verifyPage(1)
- increaseCount()
- verifyCount(1)
-
- // increase count of page 8 to 3
- repeat(7) { swipeToNextPage() }
- verifyPage(8)
- repeat(3) { increaseCount() }
- verifyCount(3)
-
- // insert page at the beginning
- choosePage(1)
- insertPageBefore()
- // check that we're now looking at the page before page 8
- verifyPage(7)
- verifyCount(0)
- // swipe back to page 8
- swipeToNextPage()
- verifyPage(8)
- verifyCount(3)
-
- // swipe back to page 1
- repeat(7) { swipeToPreviousPage() }
- verifyPage(1)
- verifyCount(1)
-
- // check the newly inserted page
- swipeToPreviousPage()
- verifyPage(10)
- verifyCount(0)
- }
-
- private fun increaseCount() {
- onView(withId(R.id.buttonCountIncrease)).perform(click())
- }
-
- private fun verifyCount(count: Int) {
- onView(withId(R.id.textViewCount)).check(matches(withText("$count")))
- }
-
- private fun verifyPage(page: Int) {
- verifyCurrentPage(hasDescendant(allOf(
- withId(R.id.textViewItemText),
- withText("item#$page")
- )))
- }
-
- private fun choosePage(page: Int) {
- onView(withId(R.id.itemSpinner)).perform(click())
- onData(equalTo("item#$page")).perform(click())
- }
-
- private fun insertPageBefore() {
- onView(withId(R.id.buttonAddBefore)).perform(click())
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/MutableCollectionFragmentTest.kt b/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/MutableCollectionFragmentTest.kt
deleted file mode 100644
index a78db21..0000000
--- a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/MutableCollectionFragmentTest.kt
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
-import org.junit.runner.RunWith
-
-@LargeTest
-@RunWith(AndroidJUnit4::class)
-class MutableCollectionFragmentTest :
- MutableCollectionBaseTest<MutableCollectionFragmentActivity>(
- MutableCollectionFragmentActivity::class.java
- )
diff --git a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/MutableCollectionViewTest.kt b/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/MutableCollectionViewTest.kt
deleted file mode 100644
index 4bc13e1..0000000
--- a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/MutableCollectionViewTest.kt
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
-import org.junit.runner.RunWith
-
-@LargeTest
-@RunWith(AndroidJUnit4::class)
-class MutableCollectionViewTest :
- MutableCollectionBaseTest<MutableCollectionViewActivity>(
- MutableCollectionViewActivity::class.java
- )
diff --git a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/TabLayoutTest.kt b/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/TabLayoutTest.kt
deleted file mode 100644
index b02ea70..0000000
--- a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/TabLayoutTest.kt
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2
-
-import androidx.test.espresso.Espresso.onIdle
-import androidx.test.espresso.action.ViewActions.click
-import androidx.test.espresso.action.ViewActions.scrollTo
-import androidx.test.espresso.assertion.ViewAssertions.matches
-import androidx.test.espresso.matcher.ViewMatchers.isSelected
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.LargeTest
-import com.example.androidx.viewpager2.test.onTab
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@LargeTest
-@RunWith(AndroidJUnit4::class)
-class TabLayoutTest : BaseTest<CardViewTabLayoutActivity>(CardViewTabLayoutActivity::class.java) {
- private val nineOfHeartsTab = "9 ♥"
- private val tenOfHeartsTab = "10 ♥"
- private val nineOfHeartsPage = "9\n♥"
- private val tenOfHeartsPage = "10\n♥"
-
- override val layoutId get() = R.id.view_pager
-
- @Test
- fun testTabLayoutIntegration() {
- // test if ViewPager2 follows TabLayout when clicking a tab
- selectTab(tenOfHeartsTab)
- verifySelectedTab(tenOfHeartsTab)
- verifyCurrentPage(tenOfHeartsPage)
-
- // test if TabLayout follows ViewPager2 when swiping to a page
- swipeToPreviousPage()
- verifySelectedTab(nineOfHeartsTab)
- verifyCurrentPage(nineOfHeartsPage)
- }
-
- private fun selectTab(text: String) {
- onTab(text).perform(scrollTo(), click())
- idleWatcher.waitForIdle()
- onIdle()
- }
-
- private fun verifySelectedTab(text: String) {
- onTab(text).check(matches(isSelected()))
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/ViewPagerBaseTest.kt b/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/ViewPagerBaseTest.kt
deleted file mode 100644
index 38cf9f2..0000000
--- a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/ViewPagerBaseTest.kt
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2
-
-import androidx.test.espresso.Espresso.onData
-import androidx.test.espresso.Espresso.onView
-import androidx.test.espresso.action.ViewActions.click
-import androidx.test.espresso.matcher.ViewMatchers.isNotChecked
-import androidx.test.espresso.matcher.ViewMatchers.withId
-import androidx.viewpager2.widget.ViewPager2
-import androidx.viewpager2.widget.ViewPager2.ORIENTATION_HORIZONTAL
-import androidx.viewpager2.widget.ViewPager2.ORIENTATION_VERTICAL
-import com.example.androidx.viewpager2.test.AnimationVerifier
-import org.hamcrest.CoreMatchers.allOf
-import org.hamcrest.CoreMatchers.equalTo
-import org.junit.Before
-import org.junit.Test
-import org.junit.runners.Parameterized
-
-/**
- * Generic test class for testing [BaseCardActivity]s. For each combination of orientation, rotation
- * animation, translation animation and scale animation, swipes from the first to the second page
- * and verifies if the expected pages are shown and if the expected animation was performed.
- * Implementations simply define the Activity under test, see [ViewPagerViewTest] and
- * [ViewPagerFragmentTest].
- */
-abstract class ViewPagerBaseTest<T : BaseCardActivity>(
- clazz: Class<T>,
- private val config: TestConfig
-) : BaseTest<T>(clazz) {
- data class TestConfig(
- @ViewPager2.Orientation val orientation: Int,
- val animateRotate: Boolean,
- val animateTranslate: Boolean,
- val animateScale: Boolean
- )
-
- companion object {
- @JvmStatic
- @Parameterized.Parameters(name = "{0}")
- fun spec(): List<TestConfig> {
- return listOf(ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL).flatMap { orientation ->
- listOf(false, true).flatMap { rotate ->
- listOf(false, true).flatMap { translate ->
- listOf(false, true).map { scale ->
- TestConfig(orientation, rotate, translate, scale)
- }
- }
- }
- }
- }
- }
-
- override val layoutId get() = R.id.view_pager
-
- private val twoOfSpades = "2\n♣"
- private val threeOfSpades = "3\n♣"
-
- @Before
- override fun setUp() {
- super.setUp()
- selectOrientation()
- if (config.animateRotate) check(R.id.rotate_checkbox)
- if (config.animateTranslate) check(R.id.translate_checkbox)
- if (config.animateScale) check(R.id.scale_checkbox)
- }
-
- @Test
- fun testSwipe() {
- val animationVerifier = AnimationVerifier(viewPager)
-
- // Swipe to page 2
- animationVerifier.reset()
- swipeToNextPage()
- animationVerifier.verify()
- verifyCurrentPage(threeOfSpades)
-
- // Swipe back to page 1
- animationVerifier.reset()
- swipeToPreviousPage()
- animationVerifier.verify()
- verifyCurrentPage(twoOfSpades)
- }
-
- private fun selectOrientation() {
- onView(withId(R.id.orientation_spinner)).perform(click())
- onData(equalTo(
- when (config.orientation) {
- ORIENTATION_HORIZONTAL -> "horizontal"
- ORIENTATION_VERTICAL -> "vertical"
- else -> "unknown"
- }
- )).perform(click())
- }
-
- private fun check(id: Int) {
- onView(allOf(withId(id), isNotChecked())).perform(click())
- }
-
- private fun AnimationVerifier.verify() {
- awaitAnimation()
- verify(
- expectRotation = config.animateRotate,
- expectTranslation = config.animateTranslate,
- expectScale = config.animateScale
- )
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/ViewPagerFragmentTest.kt b/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/ViewPagerFragmentTest.kt
deleted file mode 100644
index f772201..0000000
--- a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/ViewPagerFragmentTest.kt
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2
-
-import androidx.test.filters.LargeTest
-import org.junit.runner.RunWith
-import org.junit.runners.Parameterized
-
-@LargeTest
-@RunWith(Parameterized::class)
-class ViewPagerFragmentTest(config: ViewPagerBaseTest.TestConfig) :
- ViewPagerBaseTest<CardFragmentActivity>(CardFragmentActivity::class.java, config)
diff --git a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/ViewPagerViewTest.kt b/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/ViewPagerViewTest.kt
deleted file mode 100644
index a48ee69..0000000
--- a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/ViewPagerViewTest.kt
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2
-
-import androidx.test.filters.LargeTest
-import org.junit.runner.RunWith
-import org.junit.runners.Parameterized
-
-@LargeTest
-@RunWith(Parameterized::class)
-class ViewPagerViewTest(config: ViewPagerBaseTest.TestConfig) :
- ViewPagerBaseTest<CardViewActivity>(CardViewActivity::class.java, config)
diff --git a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/test/AnimationVerifier.kt b/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/test/AnimationVerifier.kt
deleted file mode 100644
index 083cfcf..0000000
--- a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/test/AnimationVerifier.kt
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2.test
-
-import androidx.core.view.ViewCompat
-import androidx.recyclerview.widget.LinearLayoutManager
-import androidx.recyclerview.widget.RecyclerView
-import androidx.test.espresso.matcher.ViewMatchers.assertThat
-import androidx.viewpager2.widget.ViewPager2
-import org.hamcrest.CoreMatchers.equalTo
-import java.util.concurrent.CountDownLatch
-import java.util.concurrent.TimeUnit
-import kotlin.math.abs
-
-/**
- * Verifies if animation happened in the given [ViewPager2]. It listens to
- * [ViewPager2.OnPageChangeCallback.onPageScrolled] to wait for a frame where the ViewPager2 is not
- * snapped and assumes that if animation should occur, it will occur in that frame.
- */
-class AnimationVerifier(private val viewPager: ViewPager2) {
- private val epsilon = 0.00001f
- private val timeout = 2L
- private val timeoutUnit = TimeUnit.SECONDS
-
- private lateinit var recordAnimationLatch: CountDownLatch
- private var foundAnimatedFrame = false
- private var hasRotation = false
- private var hasTranslation = false
- private var hasScale = false
-
- private val isAnimationRecorded get() = recordAnimationLatch.count == 0L
-
- private val callback = object : ViewPager2.OnPageChangeCallback() {
- override fun onPageScrolled(position: Int, offset: Float, offsetPx: Int) {
- if (!foundAnimatedFrame && offsetPx != 0) {
- foundAnimatedFrame = true
- // Page transformations are done *after* OnPageChangeCallbacks are called,
- // so postpone the actual verification
- viewPager.post {
- recordAnimationProperties(position)
- }
- }
- }
- }
-
- init {
- reset()
- }
-
- fun awaitAnimation() {
- assertThat(
- "Couldn't get hold of an animated frame, so can't verify if it worked",
- recordAnimationLatch.await(timeout, timeoutUnit),
- equalTo(true)
- )
- }
-
- fun verify(expectRotation: Boolean, expectTranslation: Boolean, expectScale: Boolean) {
- assertThat(isAnimationRecorded, equalTo(true))
- assertThat(hasRotation, equalTo(expectRotation))
- assertThat(hasTranslation, equalTo(expectTranslation))
- assertThat(hasScale, equalTo(expectScale))
- }
-
- fun reset() {
- // Unregister potentially lingering callback
- viewPager.unregisterOnPageChangeCallback(callback)
- viewPager.registerOnPageChangeCallback(callback)
- // Reset recording mechanism
- recordAnimationLatch = CountDownLatch(1)
- foundAnimatedFrame = false
- // Actual values don't need to be reset, they will be overwritten in the next recording
- }
-
- private fun recordAnimationProperties(position: Int) {
- // Get hold of the page at the specified position
- val recyclerView = viewPager.getChildAt(0) as RecyclerView
- val lm = recyclerView.layoutManager as LinearLayoutManager
- val page = lm.findViewByPosition(position)
-
- // Get the animation values to verify
- hasRotation = !isZero(page!!.rotation) || !isZero(page.rotationX) ||
- !isZero(page.rotationY)
- hasTranslation = !isZero(page.translationX) || !isZero(page.translationY) ||
- !isZero(ViewCompat.getTranslationZ(page))
- hasScale = !isOne(page.scaleX) || !isOne(page.scaleY)
-
- // Mark verification as done
- recordAnimationLatch.countDown()
- viewPager.unregisterOnPageChangeCallback(callback)
- }
-
- private fun isZero(f: Float): Boolean {
- return abs(f) < epsilon
- }
-
- private fun isOne(f: Float): Boolean {
- return isZero(f - 1)
- }
-}
\ No newline at end of file
diff --git a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/test/ViewInteractions.kt b/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/test/ViewInteractions.kt
deleted file mode 100644
index aca87272..0000000
--- a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/test/ViewInteractions.kt
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2.test
-
-import androidx.test.espresso.Espresso.onView
-import androidx.test.espresso.ViewInteraction
-import androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom
-import androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA
-import androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast
-import androidx.test.espresso.matcher.ViewMatchers.withChild
-import androidx.test.espresso.matcher.ViewMatchers.withParent
-import androidx.test.espresso.matcher.ViewMatchers.withText
-import androidx.viewpager2.widget.ViewPager2
-import com.google.android.material.tabs.TabLayout
-import org.hamcrest.CoreMatchers.allOf
-
-/**
- * Creates a [ViewInteraction] that interacts with a [ViewPager2].
- */
-fun onViewPager(): ViewInteraction {
- return onView(isAssignableFrom(ViewPager2::class.java))
-}
-
-/**
- * Creates a [ViewInteraction] that interacts with the currently visible page of a [ViewPager2]. The
- * currently visible page is the page that is displaying at least 50% of its content. When two pages
- * both show exactly 50%, the selected page is undefined.
- */
-fun onCurrentPage(): ViewInteraction {
- return onView(allOf(
- withParent(withParent(isAssignableFrom(ViewPager2::class.java))),
- isDisplayingAtLeast(50)
- ))
-}
-
-/**
- * Creates a [ViewInteraction] that interacts with a tab from a [TabLayout] that contains the given
- * text.
- */
-fun onTab(withText: String): ViewInteraction {
- return onView(
- allOf(
- isDescendantOfA(isAssignableFrom(TabLayout::class.java)),
- withChild(withText(withText))
- )
- )
-}
diff --git a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/test/ViewPagerActions.kt b/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/test/ViewPagerActions.kt
deleted file mode 100644
index 6628d9d..0000000
--- a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/test/ViewPagerActions.kt
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2.test
-
-import android.view.View
-import androidx.core.view.ViewCompat
-import androidx.test.espresso.UiController
-import androidx.test.espresso.ViewAction
-import androidx.test.espresso.action.ViewActions.swipeDown
-import androidx.test.espresso.action.ViewActions.swipeLeft
-import androidx.test.espresso.action.ViewActions.swipeRight
-import androidx.test.espresso.action.ViewActions.swipeUp
-import androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom
-import androidx.test.espresso.matcher.ViewMatchers.isDisplayingAtLeast
-import androidx.viewpager2.widget.ViewPager2
-import com.example.androidx.viewpager2.test.SwipeAction.Direction.BACKWARD
-import com.example.androidx.viewpager2.test.SwipeAction.Direction.FORWARD
-import org.hamcrest.CoreMatchers.allOf
-import org.hamcrest.Matcher
-
-/**
- * ViewAction that issues a swipe gesture on a [ViewPager2] to move that ViewPager2 to the next
- * page, taking orientation and layout direction into account.
- */
-fun swipeNext(): ViewAction {
- return SwipeAction(FORWARD)
-}
-
-/**
- * ViewAction that issues a swipe gesture on a [ViewPager2] to move that ViewPager2 to the previous
- * page, taking orientation and layout direction into account.
- */
-fun swipePrevious(): ViewAction {
- return SwipeAction(BACKWARD)
-}
-
-private class SwipeAction(val direction: Direction) : ViewAction {
- enum class Direction {
- FORWARD,
- BACKWARD
- }
-
- override fun getDescription(): String = "Swiping $direction"
-
- override fun getConstraints(): Matcher<View> =
- allOf(isAssignableFrom(ViewPager2::class.java), isDisplayingAtLeast(90))
-
- override fun perform(uiController: UiController, view: View) {
- val vp = view as ViewPager2
- val isForward = direction == FORWARD
- val swipeAction: ViewAction
- if (vp.orientation == ViewPager2.ORIENTATION_HORIZONTAL) {
- swipeAction = if (isForward == vp.isRtl()) swipeRight() else swipeLeft()
- } else {
- swipeAction = if (isForward) swipeUp() else swipeDown()
- }
- swipeAction.perform(uiController, view)
- }
-
- private fun ViewPager2.isRtl(): Boolean {
- return ViewCompat.getLayoutDirection(this) == ViewCompat.LAYOUT_DIRECTION_RTL
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/test/ViewPagerIdleWatcher.kt b/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/test/ViewPagerIdleWatcher.kt
deleted file mode 100644
index b032a68..0000000
--- a/viewpager2/integration-tests/testapp/src/androidTest/java/com/example/androidx/viewpager2/test/ViewPagerIdleWatcher.kt
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2.test
-
-import androidx.test.espresso.IdlingRegistry
-import androidx.test.espresso.idling.CountingIdlingResource
-import androidx.viewpager2.widget.ViewPager2
-
-/**
- * Watcher that uses a [CountingIdlingResource] to keep track of the idling state of a ViewPager2. A
- * ViewPager2 is idle when it is in [ViewPager2.SCROLL_STATE_IDLE]. To work around a bug in Espresso
- * where touch input is blocked when IdlingResources are not idle, this watcher will only flip its
- * idling state to not idle when [waitForIdle] is called while ViewPager2 is not idle. Once the
- * ViewPager2 reaches the idle state, the watcher will remain idle until waitForIdle is called again
- * during ViewPager2's non-idle state.
- *
- * @constructor Creates a ViewPagerIdleWatcher that keeps track of the given ViewPager2's idle
- * state. It will register its IdlingResource and starts listening to the viewPager's
- * OnPageChangeCallbacks on creation. Call [unregister] to remove its IdlingResource and stop
- * listening to viewPager.
- */
-class ViewPagerIdleWatcher(private val viewPager: ViewPager2) : ViewPager2.OnPageChangeCallback() {
- private var state = ViewPager2.SCROLL_STATE_IDLE
- private var waitingForIdle = false
- private val lock = Object()
- private val counter = CountingIdlingResource("Idle when $viewPager is not scrolling")
-
- init {
- IdlingRegistry.getInstance().register(counter)
- viewPager.registerOnPageChangeCallback(this)
- }
-
- override fun onPageScrollStateChanged(state: Int) {
- synchronized(lock) {
- this.state = state
- if (waitingForIdle && state == ViewPager2.SCROLL_STATE_IDLE) {
- counter.decrement()
- waitingForIdle = false
- }
- }
- }
-
- /**
- * Flips the IdlingResource to non-idling if the watched ViewPager2 is in a non-idle state. Does
- * nothing otherwise. Call this when the watched ViewPager2 is in a non-idle state and you need
- * to wait until it reached its idle state.
- */
- fun waitForIdle() {
- synchronized(lock) {
- if (!waitingForIdle && state != ViewPager2.SCROLL_STATE_IDLE) {
- waitingForIdle = true
- counter.increment()
- }
- }
- }
-
- /**
- * Unregisters this watcher's IdlingResource from the IdlingRegistry and stops listening to the
- * watched ViewPager2.
- */
- fun unregister() {
- viewPager.unregisterOnPageChangeCallback(this)
- IdlingRegistry.getInstance().unregister(counter)
- }
-}
\ No newline at end of file
diff --git a/viewpager2/integration-tests/testapp/src/main/AndroidManifest.xml b/viewpager2/integration-tests/testapp/src/main/AndroidManifest.xml
deleted file mode 100644
index c7c6848..0000000
--- a/viewpager2/integration-tests/testapp/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 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
- xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.androidx.viewpager2">
-
- <application
- android:icon="@drawable/app_sample_code"
- android:label="@string/activity_sample_code"
- android:supportsRtl="true"
- android:theme="@style/Theme.AppCompat.Light">
-
- <activity android:name=".CardViewActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.SAMPLE_CODE"/>
- </intent-filter>
- </activity>
-
- <activity android:name=".CardFragmentActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.SAMPLE_CODE"/>
- </intent-filter>
- </activity>
-
- <activity android:name=".MutableCollectionFragmentActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.SAMPLE_CODE"/>
- </intent-filter>
- </activity>
-
- <activity android:name=".MutableCollectionViewActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.SAMPLE_CODE"/>
- </intent-filter>
- </activity>
-
- <activity android:name=".CardViewTabLayoutActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.SAMPLE_CODE"/>
- </intent-filter>
- </activity>
-
- <activity android:name=".BrowseActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
- </application>
-</manifest>
diff --git a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/BaseCardActivity.kt b/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/BaseCardActivity.kt
deleted file mode 100644
index f90425b..0000000
--- a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/BaseCardActivity.kt
+++ /dev/null
@@ -1,139 +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 com.example.androidx.viewpager2
-
-import android.os.Bundle
-import android.view.View
-import android.widget.AdapterView
-import android.widget.ArrayAdapter
-import android.widget.Button
-import android.widget.CheckBox
-import android.widget.Spinner
-import android.widget.SpinnerAdapter
-import androidx.fragment.app.FragmentActivity
-import androidx.viewpager2.widget.ViewPager2
-import androidx.viewpager2.widget.ViewPager2.ORIENTATION_HORIZONTAL
-import androidx.viewpager2.widget.ViewPager2.ORIENTATION_VERTICAL
-import com.example.androidx.viewpager2.cards.Card
-
-/**
- * Base class for the two activities in the demo. Sets up the list of cards and implements UI to
- * jump to arbitrary cards using setCurrentItem, either with or without smooth scrolling.
- */
-abstract class BaseCardActivity : FragmentActivity() {
-
- lateinit var viewPager: ViewPager2
- private lateinit var cardSelector: Spinner
- private lateinit var smoothScrollCheckBox: CheckBox
- private lateinit var rotateCheckBox: CheckBox
- private lateinit var translateCheckBox: CheckBox
- private lateinit var scaleCheckBox: CheckBox
- private lateinit var gotoPage: Button
- private lateinit var orientationSelector: Spinner
- private lateinit var disableUserInputCheckBox: CheckBox
- private var orientation: Int = ORIENTATION_HORIZONTAL
-
- private val translateX get() = orientation == ORIENTATION_VERTICAL &&
- translateCheckBox.isChecked
- private val translateY get() = orientation == ORIENTATION_HORIZONTAL &&
- translateCheckBox.isChecked
-
- protected open val layoutId: Int = R.layout.activity_no_tablayout
-
- private val mAnimator = ViewPager2.PageTransformer { page, position ->
- val absPos = Math.abs(position)
- page.apply {
- rotation = if (rotateCheckBox.isChecked) position * 360 else 0f
- translationY = if (translateY) absPos * 500f else 0f
- translationX = if (translateX) absPos * 350f else 0f
- if (scaleCheckBox.isChecked) {
- val scale = if (absPos > 1) 0F else 1 - absPos
- scaleX = scale
- scaleY = scale
- } else {
- scaleX = 1f
- scaleY = 1f
- }
- }
- }
-
- public override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(layoutId)
-
- viewPager = findViewById(R.id.view_pager)
- orientationSelector = findViewById(R.id.orientation_spinner)
- disableUserInputCheckBox = findViewById(R.id.disable_user_input_checkbox)
- cardSelector = findViewById(R.id.card_spinner)
- smoothScrollCheckBox = findViewById(R.id.smooth_scroll_checkbox)
- rotateCheckBox = findViewById(R.id.rotate_checkbox)
- translateCheckBox = findViewById(R.id.translate_checkbox)
- scaleCheckBox = findViewById(R.id.scale_checkbox)
- gotoPage = findViewById(R.id.jump_button)
-
- disableUserInputCheckBox.setOnCheckedChangeListener { _, isDisabled ->
- viewPager.isUserInputEnabled = !isDisabled
- }
-
- orientationSelector.adapter = createOrientationAdapter()
- cardSelector.adapter = createCardAdapter()
-
- viewPager.setPageTransformer(mAnimator)
-
- orientationSelector.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
- override fun onItemSelected(
- parent: AdapterView<*>,
- view: View?,
- position: Int,
- id: Long
- ) {
- when (parent.selectedItem.toString()) {
- HORIZONTAL -> orientation = ORIENTATION_HORIZONTAL
- VERTICAL -> orientation = ORIENTATION_VERTICAL
- }
- viewPager.orientation = orientation
- }
-
- override fun onNothingSelected(adapterView: AdapterView<*>) {}
- }
-
- gotoPage.setOnClickListener {
- val card = cardSelector.selectedItemPosition
- val smoothScroll = smoothScrollCheckBox.isChecked
- viewPager.setCurrentItem(card, smoothScroll)
- }
- }
-
- private fun createCardAdapter(): SpinnerAdapter {
- val adapter = ArrayAdapter(this, android.R.layout.simple_spinner_item, Card.DECK)
- adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
- return adapter
- }
-
- private fun createOrientationAdapter(): SpinnerAdapter {
- val adapter = ArrayAdapter(this,
- android.R.layout.simple_spinner_item, arrayOf(HORIZONTAL, VERTICAL))
- adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
- return adapter
- }
-
- companion object {
- val cards = Card.DECK
- private const val HORIZONTAL = "horizontal"
- private const val VERTICAL = "vertical"
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/BrowseActivity.kt b/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/BrowseActivity.kt
deleted file mode 100644
index ca544d3..0000000
--- a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/BrowseActivity.kt
+++ /dev/null
@@ -1,66 +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 com.example.androidx.viewpager2
-
-import android.app.ListActivity
-import android.content.Intent
-import android.os.Bundle
-import android.view.View
-import android.widget.ListView
-import android.widget.SimpleAdapter
-
-/**
- * This activity lists all the activities in this application.
- */
-class BrowseActivity : ListActivity() {
-
- public override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
-
- listAdapter = SimpleAdapter(this, getData(),
- android.R.layout.simple_list_item_1, arrayOf("title"),
- intArrayOf(android.R.id.text1))
- }
-
- private fun getData(): List<Map<String, Any>> {
- val myData = mutableListOf<Map<String, Any>>()
-
- myData.add(mapOf("title" to "ViewPager2 with Views",
- "intent" to activityToIntent(CardViewActivity::class.java.name)))
- myData.add(mapOf("title" to "ViewPager2 with Fragments",
- "intent" to activityToIntent(CardFragmentActivity::class.java.name)))
- myData.add(mapOf("title" to "ViewPager2 with a Mutable Collection (Views)",
- "intent" to activityToIntent(MutableCollectionViewActivity::class.java.name)))
- myData.add(mapOf("title" to "ViewPager2 with a Mutable Collection (Fragments)",
- "intent" to activityToIntent(MutableCollectionFragmentActivity::class.java.name)))
- myData.add(mapOf("title" to "ViewPager2 with a TabLayout (Views)",
- "intent" to activityToIntent(CardViewTabLayoutActivity::class.java.name)))
-
- return myData
- }
-
- private fun activityToIntent(activity: String): Intent =
- Intent(Intent.ACTION_VIEW).setClassName(this.packageName, activity)
-
- override fun onListItemClick(listView: ListView, view: View, position: Int, id: Long) {
- val map = listView.getItemAtPosition(position) as Map<*, *>
-
- val intent = Intent(map["intent"] as Intent)
- intent.addCategory(Intent.CATEGORY_SAMPLE_CODE)
- startActivity(intent)
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/CardFragmentActivity.kt b/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/CardFragmentActivity.kt
deleted file mode 100644
index 4049be5..0000000
--- a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/CardFragmentActivity.kt
+++ /dev/null
@@ -1,73 +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 com.example.androidx.viewpager2
-
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import androidx.fragment.app.Fragment
-import androidx.viewpager2.adapter.FragmentStateAdapter
-
-import com.example.androidx.viewpager2.cards.Card
-import com.example.androidx.viewpager2.cards.CardView
-
-/**
- * Shows how to use a [androidx.viewpager2.widget.ViewPager2] with Fragments, via a
- * [androidx.viewpager2.adapter.FragmentStateAdapter]
- *
- * @see CardViewActivity for an example of using {@link androidx.viewpager2.widget.ViewPager2} with
- * Views.
- */
-class CardFragmentActivity : BaseCardActivity() {
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
-
- viewPager.adapter = object : FragmentStateAdapter(supportFragmentManager) {
- override fun getItem(position: Int): Fragment {
- return CardFragment.create(cards[position])
- }
-
- override fun getItemCount(): Int {
- return cards.size
- }
- }
- }
-
- class CardFragment : Fragment() {
- override fun onCreateView(
- inflater: LayoutInflater,
- container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View? {
- val cardView = CardView(layoutInflater, container)
- cardView.bind(Card.fromBundle(arguments!!))
- return cardView.view
- }
-
- companion object {
-
- /** Creates a Fragment for a given [Card] */
- fun create(card: Card): CardFragment {
- val fragment = CardFragment()
- fragment.arguments = card.toBundle()
- return fragment
- }
- }
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/CardViewActivity.kt b/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/CardViewActivity.kt
deleted file mode 100644
index 71fc7d3..0000000
--- a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/CardViewActivity.kt
+++ /dev/null
@@ -1,63 +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 com.example.androidx.viewpager2
-
-import android.os.Bundle
-import android.view.ViewGroup
-import androidx.recyclerview.widget.RecyclerView
-import androidx.viewpager2.widget.ViewPager2
-
-import com.example.androidx.viewpager2.cards.Card
-import com.example.androidx.viewpager2.cards.CardView
-
-/**
- * Shows how to use [ViewPager2.setAdapter] with Views.
- *
- * @see CardFragmentActivity for an example of using {@link ViewPager2} with Fragments.
- */
-open class CardViewActivity : BaseCardActivity() {
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
-
- viewPager.adapter = object : RecyclerView.Adapter<CardViewHolder>() {
- override fun onCreateViewHolder(
- parent: ViewGroup,
- viewType: Int
- ): CardViewHolder {
- return CardViewHolder(CardView(layoutInflater, parent))
- }
-
- override fun onBindViewHolder(holder: CardViewHolder, position: Int) {
- holder.bind(cards[position])
- }
-
- override fun getItemCount(): Int {
- return cards.size
- }
- }
- }
-
- class CardViewHolder internal constructor(
- private val cardView: CardView
- ) : RecyclerView.ViewHolder(cardView.view) {
-
- internal fun bind(card: Card) {
- cardView.bind(card)
- }
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/CardViewTabLayoutActivity.kt b/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/CardViewTabLayoutActivity.kt
deleted file mode 100644
index a34b936..0000000
--- a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/CardViewTabLayoutActivity.kt
+++ /dev/null
@@ -1,36 +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 com.example.androidx.viewpager2
-
-import android.os.Bundle
-import com.google.android.material.tabs.TabLayout
-
-class CardViewTabLayoutActivity : CardViewActivity() {
-
- private lateinit var tabLayout: TabLayout
-
- override val layoutId: Int = R.layout.activity_tablayout
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
-
- tabLayout = findViewById(R.id.tabs)
- TabLayoutMediator(tabLayout, viewPager) { tab, position ->
- tab.text = cards[position].toString()
- }.attach()
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/MutableCollectionFragmentActivity.kt b/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/MutableCollectionFragmentActivity.kt
deleted file mode 100644
index 746c1ad..0000000
--- a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/MutableCollectionFragmentActivity.kt
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.viewpager2
-
-import android.os.Bundle
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.Button
-import android.widget.TextView
-import androidx.fragment.app.Fragment
-import androidx.recyclerview.widget.RecyclerView
-import androidx.viewpager2.adapter.FragmentStateAdapter
-import androidx.viewpager2.widget.ViewPager2
-
-private const val KEY_ITEM_TEXT = "com.example.androidx.viewpager2.KEY_ITEM_TEXT"
-private const val KEY_CLICK_COUNT = "com.example.androidx.viewpager2.KEY_CLICK_COUNT"
-
-/**
- * Shows how to use [FragmentStateAdapter.notifyDataSetChanged] with [ViewPager2]. Here [ViewPager2]
- * represents pages as [Fragment]s.
- */
-class MutableCollectionFragmentActivity : MutableCollectionBaseActivity() {
- override fun createViewPagerAdapter(): RecyclerView.Adapter<*> {
- val items = items // avoids resolving the ViewModel multiple times
- return object : FragmentStateAdapter(supportFragmentManager) {
- override fun getItem(position: Int): PageFragment {
- val itemId = items.itemId(position)
- val itemText = items.getItemById(itemId)
- return PageFragment.create(itemText)
- }
- override fun getItemCount(): Int = items.size
- override fun getItemId(position: Int): Long = items.itemId(position)
- override fun containsItem(itemId: Long): Boolean = items.contains(itemId)
- }
- }
-}
-
-class PageFragment : Fragment() {
- private lateinit var textViewItemText: TextView
- private lateinit var textViewCount: TextView
- private lateinit var buttonCountIncrease: Button
-
- override fun onCreateView(
- inflater: LayoutInflater,
- container: ViewGroup?,
- savedInstanceState: Bundle?
- ): View? {
- val view = inflater.inflate(R.layout.item_mutable_collection, container, false)
-
- textViewItemText = view.findViewById(R.id.textViewItemText)
- textViewCount = view.findViewById(R.id.textViewCount)
- buttonCountIncrease = view.findViewById(R.id.buttonCountIncrease)
-
- textViewItemText.text = arguments?.getString(KEY_ITEM_TEXT) ?: throw IllegalStateException()
-
- fun updateCountText(count: Int) {
- textViewCount.text = "$count"
- }
- updateCountText(savedInstanceState?.getInt(KEY_CLICK_COUNT) ?: 0)
-
- buttonCountIncrease.setOnClickListener {
- updateCountText(clickCount() + 1)
- }
-
- return view
- }
-
- /**
- * [FragmentStateAdapter] minimizes the number of [Fragment]s kept in memory by saving state of
- [Fragment]s that are no longer near the viewport. Here we demonstrate this behavior by relying
- on it to persist click counts through configuration changes (rotation) and data-set changes
- (when items are added or removed).
- */
- override fun onSaveInstanceState(outState: Bundle) {
- outState.putInt(KEY_CLICK_COUNT, clickCount())
- }
-
- private fun clickCount(): Int {
- return "${textViewCount.text}".toInt()
- }
-
- companion object {
- fun create(itemText: String) =
- PageFragment().apply {
- arguments = Bundle(1).apply {
- putString(KEY_ITEM_TEXT, itemText)
- }
- }
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/TabLayoutMediator.java b/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/TabLayoutMediator.java
deleted file mode 100644
index ae0d30f..0000000
--- a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/TabLayoutMediator.java
+++ /dev/null
@@ -1,365 +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 com.example.androidx.viewpager2;
-
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
-import static androidx.viewpager2.widget.ViewPager2.SCROLL_STATE_DRAGGING;
-import static androidx.viewpager2.widget.ViewPager2.SCROLL_STATE_IDLE;
-import static androidx.viewpager2.widget.ViewPager2.SCROLL_STATE_SETTLING;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RestrictTo;
-import androidx.recyclerview.widget.RecyclerView;
-import androidx.viewpager2.widget.ViewPager2;
-
-import com.google.android.material.tabs.TabLayout;
-
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Method;
-
-/**
- * A mediator to link a TabLayout with a ViewPager2. The mediator will synchronize the ViewPager2's
- * position with the selected tab when a tab is selected, and the TabLayout's scroll position when
- * the user drags the ViewPager2.
- *
- * Establish the link by creating an instance of this class, make sure the ViewPager2 has an adapter
- * and then call {@link #attach()} on it. When creating an instance of this class, you must supply
- * an implementation of {@link OnConfigureTabCallback} in which you set the text of the tab, and/or
- * perform any styling of the tabs that you require.
- *
- * @hide
- */
-@RestrictTo(LIBRARY_GROUP)
-public final class TabLayoutMediator {
- private final @NonNull TabLayout mTabLayout;
- private final @NonNull ViewPager2 mViewPager;
- private final boolean mAutoRefresh;
- private final OnConfigureTabCallback mOnConfigureTabCallback;
- private RecyclerView.Adapter mAdapter;
- private boolean mAttached;
-
- private TabLayoutOnPageChangeCallback mOnPageChangeCallback;
- private TabLayout.OnTabSelectedListener mOnTabSelectedListener;
- private RecyclerView.AdapterDataObserver mPagerAdapterObserver;
-
- /**
- * A callback interface that must be implemented to set the text and styling of newly created
- * tabs.
- */
- public interface OnConfigureTabCallback {
- /**
- * Called to configure the tab for the page at the specified position. Typically calls
- * {@link TabLayout.Tab#setText(CharSequence)}, but any form of styling can be applied.
- *
- * @param tab The Tab which should be configured to represent the title of the item at the
- * given position in the data set.
- * @param position The position of the item within the adapter's data set.
- */
- void onConfigureTab(@NonNull TabLayout.Tab tab, int position);
- }
-
- /**
- * Creates a TabLayoutMediator to synchronize a TabLayout and a ViewPager2 together. It will
- * update the tabs automatically when the data set of the view pager's adapter changes. The link
- * will be established after {@link #attach()} is called.
- *
- * @param tabLayout The tab bar to link
- * @param viewPager The view pager to link
- */
- public TabLayoutMediator(@NonNull TabLayout tabLayout, @NonNull ViewPager2 viewPager,
- @NonNull OnConfigureTabCallback onConfigureTabCallback) {
- this(tabLayout, viewPager, true, onConfigureTabCallback);
- }
-
- /**
- * Creates a TabLayoutMediator to synchronize a TabLayout and a ViewPager2 together. If {@code
- * autoRefresh} is true, it will update the tabs automatically when the data set of the view
- * pager's adapter changes. The link will be established after {@link #attach()} is called.
- *
- * @param tabLayout The tab bar to link
- * @param viewPager The view pager to link
- * @param autoRefresh If {@code true}, will recreate all tabs when the data set of the view
- * pager's adapter changes.
- */
- public TabLayoutMediator(@NonNull TabLayout tabLayout, @NonNull ViewPager2 viewPager,
- boolean autoRefresh, @NonNull OnConfigureTabCallback onConfigureTabCallback) {
- mTabLayout = tabLayout;
- mViewPager = viewPager;
- mAutoRefresh = autoRefresh;
- mOnConfigureTabCallback = onConfigureTabCallback;
- }
-
- /**
- * Link the TabLayout and the ViewPager2 together.
- * @throws IllegalStateException If the mediator is already attached, or the ViewPager2 has no
- * adapter.
- */
- public void attach() {
- if (mAttached) {
- throw new IllegalStateException("TabLayoutMediator is already attached");
- }
- mAdapter = mViewPager.getAdapter();
- if (mAdapter == null) {
- throw new IllegalStateException("TabLayoutMediator attached before ViewPager2 has an "
- + "adapter");
- }
- mAttached = true;
-
- // Add our custom OnPageChangeCallback to the ViewPager
- mOnPageChangeCallback = new TabLayoutOnPageChangeCallback(mTabLayout);
- mViewPager.registerOnPageChangeCallback(mOnPageChangeCallback);
-
- // Now we'll add a tab selected listener to set ViewPager's current item
- mOnTabSelectedListener = new ViewPagerOnTabSelectedListener(mViewPager);
- mTabLayout.addOnTabSelectedListener(mOnTabSelectedListener);
-
- // Now we'll populate ourselves from the pager adapter, adding an observer if
- // autoRefresh is enabled
- if (mAutoRefresh) {
- // Register our observer on the new adapter
- mPagerAdapterObserver = new PagerAdapterObserver();
- mAdapter.registerAdapterDataObserver(mPagerAdapterObserver);
- }
-
- populateTabsFromPagerAdapter();
-
- // Now update the scroll position to match the ViewPager's current item
- mTabLayout.setScrollPosition(mViewPager.getCurrentItem(), 0f, true);
- }
-
- /**
- * Unlink the TabLayout and the ViewPager
- */
- public void detach() {
- mAdapter.unregisterAdapterDataObserver(mPagerAdapterObserver);
- mTabLayout.removeOnTabSelectedListener(mOnTabSelectedListener);
- mViewPager.unregisterOnPageChangeCallback(mOnPageChangeCallback);
- mPagerAdapterObserver = null;
- mOnTabSelectedListener = null;
- mOnPageChangeCallback = null;
- }
-
- @SuppressWarnings("WeakerAccess")
- void populateTabsFromPagerAdapter() {
- mTabLayout.removeAllTabs();
-
- if (mAdapter != null) {
- int adapterCount = mAdapter.getItemCount();
- for (int i = 0; i < adapterCount; i++) {
- TabLayout.Tab tab = mTabLayout.newTab();
- mOnConfigureTabCallback.onConfigureTab(tab, i);
- mTabLayout.addTab(tab, false);
- }
-
- // Make sure we reflect the currently set ViewPager item
- if (adapterCount > 0) {
- int currItem = mViewPager.getCurrentItem();
- if (currItem != mTabLayout.getSelectedTabPosition()) {
- mTabLayout.getTabAt(currItem).select();
- }
- }
- }
- }
-
- /**
- * A {@link ViewPager2.OnPageChangeCallback} class which contains the necessary calls back to
- * the provided {@link TabLayout} so that the tab position is kept in sync.
- *
- * <p>This class stores the provided TabLayout weakly, meaning that you can use {@link
- * ViewPager2#registerOnPageChangeCallback(ViewPager2.OnPageChangeCallback)} without removing
- * the callback and not cause a leak.
- */
- private static class TabLayoutOnPageChangeCallback extends ViewPager2.OnPageChangeCallback {
- private final WeakReference<TabLayout> mTabLayoutRef;
- private int mPreviousScrollState;
- private int mScrollState;
-
- TabLayoutOnPageChangeCallback(TabLayout tabLayout) {
- mTabLayoutRef = new WeakReference<>(tabLayout);
- reset();
- }
-
- @Override
- public void onPageScrollStateChanged(final int state) {
- mPreviousScrollState = mScrollState;
- mScrollState = state;
- }
-
- @Override
- public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
- TabLayout tabLayout = mTabLayoutRef.get();
- if (tabLayout != null) {
- // Only update the text selection if we're not settling, or we are settling after
- // being dragged
- boolean updateText = mScrollState != SCROLL_STATE_SETTLING
- || mPreviousScrollState == SCROLL_STATE_DRAGGING;
- // Update the indicator if we're not settling after being idle. This is caused
- // from a setCurrentItem() call and will be handled by an animation from
- // onPageSelected() instead.
- boolean updateIndicator = !(mScrollState == SCROLL_STATE_SETTLING
- && mPreviousScrollState == SCROLL_STATE_IDLE);
- setScrollPosition(tabLayout, position, positionOffset, updateText, updateIndicator);
- }
- }
-
- @Override
- public void onPageSelected(final int position) {
- TabLayout tabLayout = mTabLayoutRef.get();
- if (tabLayout != null
- && tabLayout.getSelectedTabPosition() != position
- && position < tabLayout.getTabCount()) {
- // Select the tab, only updating the indicator if we're not being dragged/settled
- // (since onPageScrolled will handle that).
- boolean updateIndicator = mScrollState == SCROLL_STATE_IDLE
- || (mScrollState == SCROLL_STATE_SETTLING
- && mPreviousScrollState == SCROLL_STATE_IDLE);
- selectTab(tabLayout, tabLayout.getTabAt(position), updateIndicator);
- }
- }
-
- void reset() {
- mPreviousScrollState = mScrollState = SCROLL_STATE_IDLE;
- }
- }
-
- // region Reflective calls
-
- // Temporarily call methods TabLayout.setScrollPosition(int, float, boolean, boolean) and
- // TabLayout.selectTab(TabLayout.Tab, boolean) through reflection, until they have been made
- // public in the Material Design Components library.
-
- private static Method sSetScrollPosition;
- private static Method sSelectTab;
- private static final String SET_SCROLL_POSITION_NAME = "TabLayout.setScrollPosition(int, float,"
- + " boolean, boolean)";
- private static final String SELECT_TAB_NAME = "TabLayout.selectTab(TabLayout.Tab, boolean)";
-
- static {
- try {
- sSetScrollPosition = TabLayout.class.getDeclaredMethod("setScrollPosition", int.class,
- float.class, boolean.class, boolean.class);
- sSetScrollPosition.setAccessible(true);
-
- sSelectTab = TabLayout.class.getDeclaredMethod("selectTab", TabLayout.Tab.class,
- boolean.class);
- sSelectTab.setAccessible(true);
- } catch (NoSuchMethodException e) {
- throw new IllegalStateException("Can't reflect into method TabLayout"
- + ".setScrollPosition(int, float, boolean, boolean)");
- }
- }
-
- @SuppressWarnings("WeakerAccess")
- static void setScrollPosition(TabLayout tabLayout, int position, float positionOffset,
- boolean updateSelectedText, boolean updateIndicatorPosition) {
- try {
- if (sSetScrollPosition != null) {
- sSetScrollPosition.invoke(tabLayout, position, positionOffset, updateSelectedText,
- updateIndicatorPosition);
- } else {
- throwMethodNotFound(SET_SCROLL_POSITION_NAME);
- }
- } catch (Exception e) {
- throwInvokeFailed(SET_SCROLL_POSITION_NAME);
- }
- }
-
- @SuppressWarnings("WeakerAccess")
- static void selectTab(TabLayout tabLayout, TabLayout.Tab tab, boolean updateIndicator) {
- try {
- if (sSelectTab != null) {
- sSelectTab.invoke(tabLayout, tab, updateIndicator);
- } else {
- throwMethodNotFound(SELECT_TAB_NAME);
- }
- } catch (Exception e) {
- throwInvokeFailed(SELECT_TAB_NAME);
- }
- }
-
- private static void throwMethodNotFound(String method) {
- throw new IllegalStateException("Method " + method + " not found");
- }
-
- private static void throwInvokeFailed(String method) {
- throw new IllegalStateException("Couldn't invoke method " + method);
- }
-
- // endregion
-
- /**
- * A {@link TabLayout.OnTabSelectedListener} class which contains the necessary calls back to
- * the provided {@link ViewPager2} so that the tab position is kept in sync.
- */
- private static class ViewPagerOnTabSelectedListener implements TabLayout.OnTabSelectedListener {
- private final ViewPager2 mViewPager;
-
- ViewPagerOnTabSelectedListener(ViewPager2 viewPager) {
- this.mViewPager = viewPager;
- }
-
- @Override
- public void onTabSelected(TabLayout.Tab tab) {
- mViewPager.setCurrentItem(tab.getPosition(), true);
- }
-
- @Override
- public void onTabUnselected(TabLayout.Tab tab) {
- // No-op
- }
-
- @Override
- public void onTabReselected(TabLayout.Tab tab) {
- // No-op
- }
- }
-
- private class PagerAdapterObserver extends RecyclerView.AdapterDataObserver {
- PagerAdapterObserver() {}
-
- @Override
- public void onChanged() {
- populateTabsFromPagerAdapter();
- }
-
- @Override
- public void onItemRangeChanged(int positionStart, int itemCount) {
- populateTabsFromPagerAdapter();
- }
-
- @Override
- public void onItemRangeChanged(int positionStart, int itemCount, @Nullable Object payload) {
- populateTabsFromPagerAdapter();
- }
-
- @Override
- public void onItemRangeInserted(int positionStart, int itemCount) {
- populateTabsFromPagerAdapter();
- }
-
- @Override
- public void onItemRangeRemoved(int positionStart, int itemCount) {
- populateTabsFromPagerAdapter();
- }
-
- @Override
- public void onItemRangeMoved(int fromPosition, int toPosition, int itemCount) {
- populateTabsFromPagerAdapter();
- }
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/cards/Card.kt b/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/cards/Card.kt
deleted file mode 100644
index 0499751..0000000
--- a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/cards/Card.kt
+++ /dev/null
@@ -1,55 +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 com.example.androidx.viewpager2.cards
-
-import android.os.Bundle
-
-/**
- * Playing card
- */
-class Card private constructor(val suit: String, val value: String) {
-
- val cornerLabel: String
- get() = value + "\n" + suit
-
- /** Use in conjunction with [Card.fromBundle] */
- fun toBundle(): Bundle {
- val args = Bundle(1)
- args.putStringArray(ARGS_BUNDLE, arrayOf(suit, value))
- return args
- }
-
- override fun toString(): String {
- return "$value $suit"
- }
-
- companion object {
- internal val ARGS_BUNDLE = Card::class.java.name + ":Bundle"
-
- val SUITS = setOf("♣" /* clubs*/, "♦" /* diamonds*/, "♥" /* hearts*/, "♠" /*spades*/)
- val VALUES = setOf("2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A")
- val DECK = SUITS.flatMap { suit ->
- VALUES.map { value -> Card(suit, value) }
- }
-
- /** Use in conjunction with [Card.toBundle] */
- fun fromBundle(bundle: Bundle): Card {
- val spec = bundle.getStringArray(ARGS_BUNDLE)
- return Card(spec!![0], spec[1])
- }
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/cards/CardView.kt b/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/cards/CardView.kt
deleted file mode 100644
index 3942233..0000000
--- a/viewpager2/integration-tests/testapp/src/main/java/com/example/androidx/viewpager2/cards/CardView.kt
+++ /dev/null
@@ -1,89 +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 com.example.androidx.viewpager2.cards
-
-import android.view.LayoutInflater
-import android.view.View
-import android.view.ViewGroup
-import android.widget.TextView
-
-import androidx.annotation.ColorRes
-
-import com.example.androidx.viewpager2.R
-
-/** Inflates and populates a [View] representing a [Card] */
-class CardView(layoutInflater: LayoutInflater, container: ViewGroup?) {
- val view: View = layoutInflater.inflate(R.layout.item_card_layout, container, false)
- private val textSuite: TextView
- private val textCorner1: TextView
- private val textCorner2: TextView
-
- init {
- textSuite = view.findViewById(R.id.label_center)
- textCorner1 = view.findViewById(R.id.label_top)
- textCorner2 = view.findViewById(R.id.label_bottom)
- }
-
- /**
- * Updates the view to represent the passed in card
- */
- fun bind(card: Card) {
- textSuite.text = card.suit
- view.setBackgroundResource(getColorRes(card))
-
- val cornerLabel = card.cornerLabel
- textCorner1.text = cornerLabel
- textCorner2.text = cornerLabel
- }
-
- @ColorRes
- private fun getColorRes(card: Card): Int {
- val shade = getShade(card)
- val color = getColor(card)
- return COLOR_MAP[color][shade]
- }
-
- private fun getShade(card: Card): Int {
- when (card.value) {
- "2", "6", "10", "A" -> return 2
- "3", "7", "J" -> return 3
- "4", "8", "Q" -> return 0
- "5", "9", "K" -> return 1
- }
- throw IllegalStateException("Card value cannot be $card.value")
- }
-
- private fun getColor(card: Card): Int {
- when (card.suit) {
- "♣" -> return 0
- "♦" -> return 1
- "♥" -> return 2
- "♠" -> return 3
- }
- throw IllegalStateException("Card suit cannot be $card.suit")
- }
-
- companion object {
- private val COLOR_MAP = arrayOf(
- intArrayOf(R.color.red_100, R.color.red_300, R.color.red_500, R.color.red_700),
- intArrayOf(R.color.blue_100, R.color.blue_300, R.color.blue_500, R.color.blue_700),
- intArrayOf(R.color.green_100, R.color.green_300, R.color.green_500,
- R.color.green_700),
- intArrayOf(R.color.yellow_100, R.color.yellow_300, R.color.yellow_500,
- R.color.yellow_700))
- }
-}
diff --git a/viewpager2/integration-tests/testapp/src/main/res/drawable/border.xml b/viewpager2/integration-tests/testapp/src/main/res/drawable/border.xml
deleted file mode 100644
index 82f0ba2..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/drawable/border.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2019 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.
--->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
- <corners android:radius="4dp"/>
- <stroke android:width="1dp" android:color="@color/purple_500"/>
- <solid android:color="@color/magnolia_50"/>
-</shape>
\ No newline at end of file
diff --git a/viewpager2/integration-tests/testapp/src/main/res/layout-land/activity_no_tablayout.xml b/viewpager2/integration-tests/testapp/src/main/res/layout-land/activity_no_tablayout.xml
deleted file mode 100644
index 4fc34cc..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/layout-land/activity_no_tablayout.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal"
- tools:background="#FFFFFF">
-
- <include layout="@layout/controls" />
-
- <androidx.viewpager2.widget.ViewPager2
- android:id="@+id/view_pager"
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1" />
-
-</LinearLayout>
diff --git a/viewpager2/integration-tests/testapp/src/main/res/layout-land/activity_tablayout.xml b/viewpager2/integration-tests/testapp/src/main/res/layout-land/activity_tablayout.xml
deleted file mode 100644
index 024b9dc..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/layout-land/activity_tablayout.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal"
- tools:background="#FFFFFF">
-
- <include layout="@layout/controls" />
-
- <LinearLayout
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:orientation="vertical">
-
- <com.google.android.material.tabs.TabLayout
- android:id="@+id/tabs"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- app:tabMode="scrollable" />
-
- <androidx.viewpager2.widget.ViewPager2
- android:id="@+id/view_pager"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1" />
-
- </LinearLayout>
-
-</LinearLayout>
diff --git a/viewpager2/integration-tests/testapp/src/main/res/layout-land/controls.xml b/viewpager2/integration-tests/testapp/src/main/res/layout-land/controls.xml
deleted file mode 100644
index 2fa297e..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/layout-land/controls.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_margin="16dp"
- android:orientation="vertical">
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center_vertical|start"
- android:orientation="horizontal">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/label_orientation"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- <Spinner
- android:id="@+id/orientation_spinner"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
-
- </LinearLayout>
-
- <CheckBox
- android:id="@+id/disable_user_input_checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/disable_user_input"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center_vertical|start"
- android:orientation="horizontal">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/label_jump_to"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- <Spinner
- android:id="@+id/card_spinner"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginLeft="8dp" />
-
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center_vertical|start"
- android:orientation="horizontal">
-
- <CheckBox
- android:id="@+id/smooth_scroll_checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/checkbox_smoothscroll"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- <Button
- android:id="@+id/jump_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginLeft="8dp"
- android:text="@string/label_jump"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- </LinearLayout>
-
- <CheckBox
- android:id="@+id/rotate_checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/checkbox_rotate"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- <CheckBox
- android:id="@+id/translate_checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/checkbox_translate"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- <CheckBox
- android:id="@+id/scale_checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/checkbox_scale"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- </LinearLayout>
-
- <View
- android:layout_width="1dp"
- android:layout_height="match_parent"
- android:background="#000000" />
-
-</merge>
\ No newline at end of file
diff --git a/viewpager2/integration-tests/testapp/src/main/res/layout/activity_mutable_collection.xml b/viewpager2/integration-tests/testapp/src/main/res/layout/activity_mutable_collection.xml
deleted file mode 100644
index 3ff4be6..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/layout/activity_mutable_collection.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2019 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.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <TextView
- android:text="@string/viewpager2"
- android:textStyle="bold"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/spacer_large"
- android:layout_marginLeft="@dimen/spacer_small"
- android:layout_marginRight="@dimen/spacer_small"/>
-
- <androidx.viewpager2.widget.ViewPager2
- android:id="@+id/viewPager"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1"/>
-
- <View
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="?android:attr/listDivider"/>
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:layout_margin="@dimen/spacer_small">
-
- <TextView
- android:text="@string/toolbox"
- android:textStyle="bold"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="@dimen/spacer_small"/>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
-
- <TextView
- android:layout_margin="@dimen/spacer_small"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/choose_a_page"/>
-
- <Spinner
- android:id="@+id/itemSpinner"
- android:layout_margin="@dimen/spacer_small"
- android:layout_width="0dp"
- android:layout_weight="1"
- android:layout_height="wrap_content"/>
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:gravity="center">
-
- <Button
- android:id="@+id/buttonGoTo"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_margin="@dimen/spacer_small"
- android:text="@string/go_to_page"/>
-
- <Button
- android:id="@+id/buttonRemove"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_margin="@dimen/spacer_small"
- android:text="@string/remove_page"/>
-
- <Button
- android:id="@+id/buttonAddBefore"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_margin="@dimen/spacer_small"
- android:text="@string/add_new_before"/>
-
- <Button
- android:id="@+id/buttonAddAfter"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_margin="@dimen/spacer_small"
- android:text="@string/add_new_after"/>
- </LinearLayout>
- </LinearLayout>
-</LinearLayout>
\ No newline at end of file
diff --git a/viewpager2/integration-tests/testapp/src/main/res/layout/activity_no_tablayout.xml b/viewpager2/integration-tests/testapp/src/main/res/layout/activity_no_tablayout.xml
deleted file mode 100644
index 69abd0d..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/layout/activity_no_tablayout.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- tools:background="#FFFFFF">
-
- <include layout="@layout/controls" />
-
- <androidx.viewpager2.widget.ViewPager2
- android:id="@+id/view_pager"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1" />
-
-</LinearLayout>
diff --git a/viewpager2/integration-tests/testapp/src/main/res/layout/activity_tablayout.xml b/viewpager2/integration-tests/testapp/src/main/res/layout/activity_tablayout.xml
deleted file mode 100644
index af0cf28..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/layout/activity_tablayout.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- tools:background="#FFFFFF">
-
- <include layout="@layout/controls" />
-
- <com.google.android.material.tabs.TabLayout
- android:id="@+id/tabs"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- app:tabMode="scrollable" />
-
- <androidx.viewpager2.widget.ViewPager2
- android:id="@+id/view_pager"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1" />
-
-</LinearLayout>
diff --git a/viewpager2/integration-tests/testapp/src/main/res/layout/controls.xml b/viewpager2/integration-tests/testapp/src/main/res/layout/controls.xml
deleted file mode 100644
index ba32af4..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/layout/controls.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="16dp"
- android:layout_marginTop="16dp"
- android:layout_marginRight="16dp"
- android:gravity="center_vertical|start"
- android:orientation="horizontal">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/label_orientation"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- <Spinner
- android:id="@+id/orientation_spinner"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
-
- </LinearLayout>
-
- <CheckBox
- android:id="@+id/disable_user_input_checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginLeft="16dp"
- android:text="@string/disable_user_input"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="16dp"
- android:layout_marginRight="16dp"
- android:gravity="center_vertical|start"
- android:orientation="horizontal">
-
- <Button
- android:id="@+id/jump_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginLeft="8dp"
- android:text="@string/label_jump_to"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- <Spinner
- android:id="@+id/card_spinner"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginLeft="8dp" />
-
- <CheckBox
- android:id="@+id/smooth_scroll_checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginLeft="8dp"
- android:text="@string/checkbox_smoothscroll"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="16dp"
- android:layout_marginRight="16dp"
- android:layout_marginBottom="8dp"
- android:gravity="center_vertical|start"
- android:orientation="horizontal">
-
- <CheckBox
- android:id="@+id/rotate_checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/checkbox_rotate"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- <CheckBox
- android:id="@+id/translate_checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginLeft="8dp"
- android:text="@string/checkbox_translate"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- <CheckBox
- android:id="@+id/scale_checkbox"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginLeft="8dp"
- android:text="@string/checkbox_scale"
- android:textAppearance="@android:style/TextAppearance.Medium" />
-
- </LinearLayout>
-
- <View
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="#000000" />
-
-</merge>
\ No newline at end of file
diff --git a/viewpager2/integration-tests/testapp/src/main/res/layout/item_card_layout.xml b/viewpager2/integration-tests/testapp/src/main/res/layout/item_card_layout.xml
deleted file mode 100644
index 9f86006..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/layout/item_card_layout.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 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.
--->
-
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:background="#FEFEFE"
- android:padding="16dp">
-
- <TextView
- android:id="@+id/label_top"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top|start"
- android:gravity="center"
- android:textAppearance="@android:style/TextAppearance.Large"
- tools:text="A"/>
-
- <TextView
- android:id="@+id/label_center"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:textAppearance="@android:style/TextAppearance.Large"
- tools:text="♠"/>
-
- <TextView
- android:id="@+id/label_bottom"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom|end"
- android:gravity="center"
- android:textAppearance="@android:style/TextAppearance.Large"
- android:rotation="180"
- tools:text="A"/>
-</FrameLayout>
diff --git a/viewpager2/integration-tests/testapp/src/main/res/layout/item_mutable_collection.xml b/viewpager2/integration-tests/testapp/src/main/res/layout/item_mutable_collection.xml
deleted file mode 100644
index 69f7e60..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/layout/item_mutable_collection.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2019 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.
--->
-
-<!--Topmost element margins are not supported (ignored) hence the wrapping FrameLayout-->
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_margin="@dimen/spacer_large"
- android:gravity="center_vertical|start"
- android:background="@drawable/border"
- android:orientation="vertical">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:gravity="center"
- android:background="@color/magnolia_100"
- android:layout_margin="@dimen/spacer_large">
-
- <TextView
- android:layout_margin="@dimen/spacer_small"
- android:text="@string/id_colon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
- <TextView
- android:layout_margin="@dimen/spacer_small"
- android:id="@+id/textViewItemText"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"/>
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/magnolia_100"
- android:orientation="horizontal"
- android:gravity="center"
- android:layout_margin="@dimen/spacer_large">
-
- <TextView
- android:layout_margin="@dimen/spacer_small"
- android:text="@string/count_colon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
-
- <TextView
- android:layout_margin="@dimen/spacer_small"
- android:id="@+id/textViewCount"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_weight="1"/>
- </LinearLayout>
-
- <Button
- android:id="@+id/buttonCountIncrease"
- android:layout_margin="@dimen/spacer_large"
- android:layout_width="wrap_content"
- android:backgroundTint="@color/teal_200"
- android:text="@string/increase_count"
- android:layout_height="wrap_content"/>
- </LinearLayout>
-</FrameLayout>
\ No newline at end of file
diff --git a/viewpager2/integration-tests/testapp/src/main/res/values-land/dimens.xml b/viewpager2/integration-tests/testapp/src/main/res/values-land/dimens.xml
deleted file mode 100644
index 8f7e369..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/values-land/dimens.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2019 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.
--->
-
-<resources>
- <dimen name="spacer_large">10dp</dimen>
- <dimen name="spacer_small">3dp</dimen>
-</resources>
\ No newline at end of file
diff --git a/viewpager2/integration-tests/testapp/src/main/res/values/colors.xml b/viewpager2/integration-tests/testapp/src/main/res/values/colors.xml
deleted file mode 100644
index b48a183..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- 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.
--->
-
-<resources>
- <color name="red_100">#F4C7C3</color>
- <color name="red_300">#E67C73</color>
- <color name="red_500">#DB4437</color>
- <color name="red_700">#C53929</color>
- <color name="blue_100">#C6DAFC</color>
- <color name="blue_300">#7BAAF7</color>
- <color name="blue_500">#4285F4</color>
- <color name="blue_700">#3367D6</color>
- <color name="green_100">#B7E1CD</color>
- <color name="green_300">#57BB8A</color>
- <color name="green_500">#0F9D58</color>
- <color name="green_700">#0B8043</color>
- <color name="yellow_100">#FCE8B2</color>
- <color name="yellow_300">#F7CB4D</color>
- <color name="yellow_500">#F4B400</color>
- <color name="yellow_700">#F09300</color>
-
- <color name="magnolia_50">#efe5fd</color>
- <color name="magnolia_100">#d4bff9</color>
- <color name="purple_500">#6200EE</color>
- <color name="teal_200">#03DAC5</color>
-</resources>
\ No newline at end of file
diff --git a/viewpager2/integration-tests/testapp/src/main/res/values/dimens.xml b/viewpager2/integration-tests/testapp/src/main/res/values/dimens.xml
deleted file mode 100644
index 140a630..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2019 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.
--->
-
-<resources>
- <dimen name="spacer_large">20dp</dimen>
- <dimen name="spacer_small">5dp</dimen>
-</resources>
\ No newline at end of file
diff --git a/viewpager2/integration-tests/testapp/src/main/res/values/strings.xml b/viewpager2/integration-tests/testapp/src/main/res/values/strings.xml
deleted file mode 100644
index 496ab87..0000000
--- a/viewpager2/integration-tests/testapp/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright 2017 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.
--->
-
-<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
- <string name="activity_sample_code">ViewPager2 Demos</string>
- <string name="label_orientation">Orientation:</string>
- <string name="label_jump_to">Jump to:</string>
- <string name="label_jump">Jump</string>
- <string name="disable_user_input">Disable user input</string>
- <string name="checkbox_smoothscroll">Smooth</string>
- <string name="checkbox_rotate">Rotate</string>
- <string name="checkbox_translate">Translate</string>
- <string name="checkbox_scale">Scale</string>
- <string name="increase_count">Count++</string>
- <string name="count_colon">Count:</string>
- <string name="id_colon">Id:</string>
- <string name="add_new_before">Add new before</string>
- <string name="add_new_after">Add new after</string>
- <string name="remove_page">Remove page</string>
- <string name="go_to_page">Go to page</string>
- <string name="choose_a_page">Choose a page:</string>
- <string name="toolbox">Toolbox</string>
- <string name="viewpager2">ViewPager2</string>
-</resources>
diff --git a/viewpager2/src/androidTest/java/androidx/viewpager2/test/ui/TouchConsumingTextView.kt b/viewpager2/src/androidTest/java/androidx/viewpager2/test/ui/TouchConsumingTextView.kt
deleted file mode 100644
index 0061566..0000000
--- a/viewpager2/src/androidTest/java/androidx/viewpager2/test/ui/TouchConsumingTextView.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2019 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.viewpager2.test.ui
-
-import android.content.Context
-import android.util.AttributeSet
-import android.view.MotionEvent
-import androidx.appcompat.widget.AppCompatTextView
-
-class TouchConsumingTextView(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) :
- AppCompatTextView(context, attrs, defStyleAttr) {
-
- constructor(context: Context?) : this(context, null, 0)
- constructor(context: Context?, attrs: AttributeSet?) : this(context, attrs, 0)
-
- var consumeTouches = false
-
- override fun onTouchEvent(event: MotionEvent?): Boolean {
- return consumeTouches || super.onTouchEvent(event)
- }
-}
\ No newline at end of file
diff --git a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/BaseTest.kt b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/BaseTest.kt
index 9b308b1..8630a0d 100644
--- a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/BaseTest.kt
+++ b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/BaseTest.kt
@@ -48,7 +48,6 @@
import androidx.viewpager2.widget.swipe.PageSwiper
import androidx.viewpager2.widget.swipe.PageSwiperEspresso
import androidx.viewpager2.widget.swipe.PageSwiperManual
-import androidx.viewpager2.widget.swipe.SelfChecking
import androidx.viewpager2.widget.swipe.TestActivity
import androidx.viewpager2.widget.swipe.ViewAdapter
import org.hamcrest.CoreMatchers.equalTo
@@ -334,7 +333,7 @@
* 2. Expected text is displayed
* 3. Internal activity state is valid (as per activity self-test)
*/
- fun Context.assertBasicState(pageIx: Int, value: String = pageIx.toString()) {
+ fun Context.assertBasicState(pageIx: Int, value: String) {
assertThat<Int>(
"viewPager.getCurrentItem() should return $pageIx",
viewPager.currentItem, equalTo(pageIx)
@@ -343,8 +342,14 @@
matches(withText(value))
)
- if (viewPager.adapter is SelfChecking) {
- (viewPager.adapter as SelfChecking).selfCheck()
+ // FIXME: too tight coupling
+ if (viewPager.adapter is FragmentAdapter) {
+ val adapter = viewPager.adapter as FragmentAdapter
+ assertThat(
+ "Number of fragment attaches minus fragment destroys must be " +
+ "between 1 and 4 (inclusive)",
+ adapter.attachCount.get() - adapter.destroyCount.get(), isBetweenInIn(1, 4)
+ )
}
}
@@ -352,20 +357,11 @@
targetPage: Int,
smoothScroll: Boolean,
timeout: Long,
- unit: TimeUnit,
- expectEvents: Boolean = (targetPage != currentItem)
+ unit: TimeUnit
) {
- val latch =
- if (expectEvents)
- addWaitForScrolledLatch(targetPage, smoothScroll)
- else
- CountDownLatch(1)
- post {
- setCurrentItem(targetPage, smoothScroll)
- if (!expectEvents) {
- latch.countDown()
- }
- }
+ if (currentItem == targetPage) return
+ val latch = addWaitForScrolledLatch(targetPage, smoothScroll)
+ post { setCurrentItem(targetPage, smoothScroll) }
latch.await(timeout, unit)
}
diff --git a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/BasicTest.java b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/BasicTest.java
index e827a13..a93a568 100644
--- a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/BasicTest.java
+++ b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/BasicTest.java
@@ -28,7 +28,7 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import org.junit.Rule;
import org.junit.Test;
@@ -37,7 +37,7 @@
import java.util.UUID;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class BasicTest {
@Rule
diff --git a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/DisableUserInputTest.kt b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/DisableUserInputTest.kt
deleted file mode 100644
index ea8c091..0000000
--- a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/DisableUserInputTest.kt
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright 2019 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.viewpager2.widget
-
-import androidx.recyclerview.widget.RecyclerView
-import androidx.test.filters.LargeTest
-import androidx.test.filters.MediumTest
-import androidx.testutils.FragmentActivityUtils.waitForCycles
-import androidx.viewpager2.test.ui.TouchConsumingTextView
-import androidx.viewpager2.widget.DisableUserInputTest.Event.OnPageScrollStateChangedEvent
-import androidx.viewpager2.widget.DisableUserInputTest.Event.OnPageScrolledEvent
-import androidx.viewpager2.widget.DisableUserInputTest.Event.OnPageSelectedEvent
-import androidx.viewpager2.widget.DisableUserInputTest.TestConfig
-import androidx.viewpager2.widget.ViewPager2.ORIENTATION_HORIZONTAL
-import androidx.viewpager2.widget.ViewPager2.ORIENTATION_VERTICAL
-import androidx.viewpager2.widget.swipe.ViewAdapter
-import org.hamcrest.CoreMatchers.equalTo
-import org.junit.Assert.assertThat
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.junit.runners.Parameterized
-import java.util.concurrent.TimeUnit.SECONDS
-import kotlin.math.roundToInt
-
-/**
- * Tests what happens when a smooth scroll is interrupted by a drag
- */
-@RunWith(Parameterized::class)
-@LargeTest
-class DisableUserInputTest(private val config: TestConfig) : BaseTest() {
- data class TestConfig(
- @ViewPager2.Orientation val orientation: Int,
- val childViewConsumesTouches: Boolean
- )
-
- companion object {
- @JvmStatic
- @Parameterized.Parameters(name = "{0}")
- fun spec(): List<TestConfig> = createTestSet()
- }
-
- private val pageCount = 10
- private val firstPage = 0
- private val middlePage = pageCount / 2
- private val lastPage = pageCount - 1
-
- private lateinit var test: Context
- private lateinit var adapterProvider: AdapterProvider
-
- private val touchConsumingViewAdapter: AdapterProviderForItems = { items ->
- {
- object : ViewAdapter(items) {
- override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
- super.onBindViewHolder(holder, position)
- (holder.itemView as TouchConsumingTextView).consumeTouches =
- config.childViewConsumesTouches
- }
- }
- }
- }
-
- override fun setUp() {
- super.setUp()
- adapterProvider = touchConsumingViewAdapter(stringSequence(pageCount))
- test = setUpTest(config.orientation).also {
- it.viewPager.isUserInputEnabled = false
- it.setAdapterSync(adapterProvider)
- it.assertBasicState(firstPage)
- }
- }
-
- @Test
- @LargeTest
- fun testSwipe() {
- listOf(firstPage, firstPage + 1).forEach { swipeToAndVerifyNothingHappened(it) }
- test.viewPager.setCurrentItemSync(middlePage, false, 2, SECONDS)
- test.assertBasicState(middlePage)
- listOf(middlePage - 1, middlePage + 1).forEach { swipeToAndVerifyNothingHappened(it) }
- test.viewPager.setCurrentItemSync(lastPage, false, 2, SECONDS)
- test.assertBasicState(lastPage)
- listOf(lastPage - 1, lastPage).forEach { swipeToAndVerifyNothingHappened(it) }
- }
-
- private fun swipeToAndVerifyNothingHappened(targetPage: Int) {
- // given
- val recorder = test.viewPager.addNewRecordingCallback()
- val currentPage = test.viewPager.currentItem
-
- // when
- test.swipe(currentPage, targetPage)
- waitForCycles(3, test.activityTestRule)
-
- // then
- test.assertBasicState(currentPage)
- assertThat(recorder.eventCount, equalTo(0))
-
- test.viewPager.unregisterOnPageChangeCallback(recorder)
-
- // end with a config change to see if internal state didn't get screwed up
- doConfigChangeAndVerify(currentPage)
- }
-
- private fun testSetCurrentItem(smoothScroll: Boolean) {
- listOf(1, 9, 7, 0).forEach { targetPage ->
- // given
- val currentPage = test.viewPager.currentItem
- val recorder = test.viewPager.addNewRecordingCallback()
-
- // when
- test.viewPager.setCurrentItemSync(targetPage, smoothScroll, 2, SECONDS)
-
- // then
- test.assertBasicState(targetPage)
- val pageSize = test.viewPager.pageSize
- recorder.scrollEvents.assertValueSanity(currentPage, targetPage, pageSize)
- recorder.scrollEvents.assertLastCorrect(targetPage)
- recorder.selectEvents.assertSelected(listOf(targetPage))
-
- test.viewPager.unregisterOnPageChangeCallback(recorder)
-
- // end with a config change to see if internal state survives
- doConfigChangeAndVerify(targetPage)
- }
- }
-
- @Test
- @LargeTest
- fun testSetCurrentItemSmooth() {
- testSetCurrentItem(true)
- }
-
- @Test
- @MediumTest
- fun testSetCurrentItemNotSmooth() {
- testSetCurrentItem(false)
- }
-
- private fun doConfigChangeAndVerify(page: Int) {
- test.recreateActivity(adapterProvider)
- test.assertBasicState(page)
- assertThat(test.viewPager.isUserInputEnabled, equalTo(false))
- }
-
- private fun ViewPager2.addNewRecordingCallback(): RecordingCallback {
- return RecordingCallback().also { registerOnPageChangeCallback(it) }
- }
-
- private sealed class Event {
- data class OnPageScrolledEvent(
- val position: Int,
- val positionOffset: Float,
- val positionOffsetPixels: Int
- ) : Event()
-
- data class OnPageSelectedEvent(val position: Int) : Event()
- data class OnPageScrollStateChangedEvent(val state: Int) : Event()
- }
-
- private class RecordingCallback : ViewPager2.OnPageChangeCallback() {
- private val events = mutableListOf<Event>()
-
- val eventCount get() = events.size
- val scrollEvents get() = events.mapNotNull { it as? OnPageScrolledEvent }
- val selectEvents get() = events.mapNotNull { it as? OnPageSelectedEvent }
-
- override fun onPageScrolled(
- position: Int,
- positionOffset: Float,
- positionOffsetPixels: Int
- ) {
- synchronized(events) {
- events.add(OnPageScrolledEvent(position, positionOffset, positionOffsetPixels))
- }
- }
-
- override fun onPageSelected(position: Int) {
- synchronized(events) {
- events.add(OnPageSelectedEvent(position))
- }
- }
-
- override fun onPageScrollStateChanged(state: Int) {
- synchronized(events) {
- events.add(OnPageScrollStateChangedEvent(state))
- }
- }
- }
-
- private fun List<OnPageScrolledEvent>.assertValueSanity(
- initialPage: Int,
- otherPage: Int,
- pageSize: Int
- ) = forEach {
- assertThat(it.position, isBetweenInInMinMax(initialPage, otherPage))
- assertThat(it.positionOffset, isBetweenInEx(0f, 1f))
- assertThat((it.positionOffset * pageSize).roundToInt(), equalTo(it.positionOffsetPixels))
- }
-
- private fun List<OnPageScrolledEvent>.assertLastCorrect(targetPage: Int) {
- last().apply {
- assertThat(position, equalTo(targetPage))
- assertThat(positionOffsetPixels, equalTo(0))
- }
- }
-
- private fun List<OnPageSelectedEvent>.assertSelected(pages: List<Int>) {
- assertThat(map { it.position }, equalTo(pages))
- }
-}
-
-// region Test Suite creation
-
-private fun createTestSet(): List<TestConfig> {
- return listOf(ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL).flatMap { orientation ->
- listOf(true, false).map { consumeTouches ->
- TestConfig(
- orientation,
- consumeTouches
- )
- }
- }
-}
-
-// endregion
diff --git a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/MutableCollectionsTest.kt b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/MutableCollectionsTest.kt
index 1e98bbf..afa6e2a 100644
--- a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/MutableCollectionsTest.kt
+++ b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/MutableCollectionsTest.kt
@@ -28,7 +28,6 @@
import androidx.viewpager2.widget.ViewPager2.ORIENTATION_HORIZONTAL
import androidx.viewpager2.widget.ViewPager2.ORIENTATION_VERTICAL
import androidx.viewpager2.widget.swipe.PageView
-import androidx.viewpager2.widget.swipe.SelfChecking
import org.hamcrest.Matchers.equalTo
import org.junit.Assert.assertThat
import org.junit.Test
@@ -134,9 +133,6 @@
assertThat(isPageContentExpected(expectedValue), equalTo(true))
assertThat(viewPager.currentItem, equalTo(pageIx))
- if (viewPager.adapter is SelfChecking) {
- (viewPager.adapter as SelfChecking).selfCheck()
- }
}
}
@@ -341,25 +337,7 @@
expectedEndItems = listOf("0", "3", "4", "5")
)
- result += TestConfig(
- name = "regression3",
- _items = stringSequence(pageCount = 3),
- adapterProvider = adapterProvider,
- actions = listOf(RemoveItem(_position = 0), AddItem(_position = 1, item = "3")),
- orientation = orientation,
- expectedEndItems = listOf("1", "3", "2")
- )
-
- result += TestConfig(
- name = "regression4",
- _items = stringSequence(pageCount = 3),
- adapterProvider = adapterProvider,
- actions = listOf(RemoveItem(_position = 0), AddItem(_position = 0, item = "3")),
- orientation = orientation,
- expectedEndItems = listOf("3", "1", "2")
- )
-
- repeat(RANDOM_TESTS_PER_CONFIG) {
+ (1..RANDOM_TESTS_PER_CONFIG).forEach {
result += generateRandomTest(adapterProvider, orientation)
}
}
diff --git a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/PageChangeCallbackTest.kt b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/PageChangeCallbackTest.kt
index eae3849..bc8da5a 100644
--- a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/PageChangeCallbackTest.kt
+++ b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/PageChangeCallbackTest.kt
@@ -39,7 +39,6 @@
import org.hamcrest.CoreMatchers.not
import org.hamcrest.CoreMatchers.nullValue
import org.hamcrest.Matchers.allOf
-import org.hamcrest.Matchers.greaterThan
import org.hamcrest.Matchers.greaterThanOrEqualTo
import org.junit.Assert.assertThat
import org.junit.Test
@@ -119,7 +118,7 @@
latch.await(1, SECONDS)
// then
- assertBasicState(targetPage)
+ assertBasicState(targetPage, "$targetPage")
callback.apply {
// verify all events
@@ -180,7 +179,7 @@
latch.await(2, SECONDS)
// then
- assertBasicState(targetPage)
+ assertBasicState(targetPage, "$targetPage")
if (targetPage == initialPage && edgePages.contains(targetPage)) {
callback.apply {
@@ -719,7 +718,7 @@
val callback = test.viewPager.addNewRecordingCallback()
// when
- test.viewPager.setCurrentItemSync(targetPage, false, 2, SECONDS, false)
+ test.viewPager.setCurrentItemSync(targetPage, false, 2, SECONDS)
// then
assertThat(test.viewPager.currentItem, equalTo(0))
@@ -740,23 +739,22 @@
// given
val initialPage = test.viewPager.currentItem
val callback = test.viewPager.addNewRecordingCallback()
- val targetBoundary = if (targetPage <= 0) 0 else n - 1
- // only expect events when we're going to the boundary on the other side
- val expectEvents = initialPage != targetBoundary
// when
- test.viewPager.setCurrentItemSync(targetPage, smoothScroll, 2, SECONDS, expectEvents)
+ test.viewPager.setCurrentItemSync(targetPage, smoothScroll, 2, SECONDS)
// then the viewpager must have scrolled to the respective boundary
- assertThat(test.viewPager.currentItem, equalTo(targetBoundary))
- if (!expectEvents) {
+ val boundary = if (targetPage <= 0) 0 else n - 1
+ assertThat(test.viewPager.currentItem, equalTo(boundary))
+ if (initialPage == boundary) {
+ // when it was already there, no events should have been fired
assertThat(callback.eventCount, equalTo(0))
} else {
- // make sure the page select events and scroll events are correct
+ // otherwise, make sure the page select events and scroll events are correct
val pageSize = test.viewPager.pageSize
- callback.scrollEvents.assertValueSanity(initialPage, targetBoundary, pageSize)
- callback.scrollEvents.assertLastCorrect(targetBoundary)
- callback.assertAllPagesSelected(listOf(targetBoundary))
+ callback.scrollEvents.assertValueSanity(initialPage, boundary, pageSize)
+ callback.scrollEvents.assertLastCorrect(boundary)
+ callback.assertAllPagesSelected(listOf(boundary))
}
test.viewPager.unregisterOnPageChangeCallback(callback)
}
@@ -897,7 +895,6 @@
private fun RecordingCallback.assertTargetReachedAfterMarker(targetPage: Int, marker: Int) {
val finalEvents = eventsAfter(marker)
- assertThat(finalEvents.size, greaterThan(0))
assertThat(finalEvents[0], equalTo(OnPageScrolledEvent(targetPage, 0f, 0) as Event))
assertThat(
finalEvents[1],
diff --git a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/PageTransformerTest.kt b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/PageTransformerTest.kt
index fff346b..aa3abdc 100644
--- a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/PageTransformerTest.kt
+++ b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/PageTransformerTest.kt
@@ -177,7 +177,7 @@
val latch = viewPager.addWaitForScrolledLatch(targetPage)
swipe(currentPage, targetPage)
latch.await(1, SECONDS)
- assertBasicState(targetPage)
+ assertBasicState(targetPage, "$targetPage")
}
private fun ViewPager2.addNewRecordingCallback(): RecordingCallback {
diff --git a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/SwipeTest.kt b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/SwipeTest.kt
index d1b2228..fb6f630 100644
--- a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/SwipeTest.kt
+++ b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/SwipeTest.kt
@@ -42,7 +42,7 @@
val expectedValues = stringSequence(totalPages).toMutableList()
val adapter = adapterProvider(expectedValues.toList()) // immutable defensive copy
setAdapterSync(adapter)
- assertBasicState(0)
+ assertBasicState(0, "0")
pageSequence.forEachIndexed { currentStep, targetPage ->
val currentPage = viewPager.currentItem
@@ -95,15 +95,14 @@
// region test definitions
private fun createTestSet(): List<TestConfig> {
- return listOf(ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL).flatMap { orientation ->
- listOf(
- fragmentAdapterProvider,
- fragmentAdapterProviderCustomIds,
- viewAdapterProvider
- ).flatMap { activity ->
- createTestSet(activity, orientation)
- }
- }
+ return listOf(
+ fragmentAdapterProvider to ORIENTATION_HORIZONTAL,
+ fragmentAdapterProvider to ORIENTATION_VERTICAL,
+ fragmentAdapterProviderCustomIds to ORIENTATION_HORIZONTAL,
+ fragmentAdapterProviderCustomIds to ORIENTATION_VERTICAL,
+ viewAdapterProvider to ORIENTATION_HORIZONTAL,
+ viewAdapterProvider to ORIENTATION_VERTICAL)
+ .flatMap { (activity, orientation) -> createTestSet(activity, orientation) }
}
private fun createTestSet(
diff --git a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/FragmentAdapter.kt b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/FragmentAdapter.kt
index aafcea4..ca81829 100644
--- a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/FragmentAdapter.kt
+++ b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/FragmentAdapter.kt
@@ -24,10 +24,6 @@
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.viewpager2.adapter.FragmentStateAdapter
-import org.hamcrest.Matchers.allOf
-import org.hamcrest.Matchers.greaterThanOrEqualTo
-import org.hamcrest.Matchers.lessThanOrEqualTo
-import org.junit.Assert.assertThat
import java.util.concurrent.atomic.AtomicInteger
private const val ARG_KEY = "key"
@@ -35,9 +31,9 @@
class FragmentAdapter(
fragmentManager: FragmentManager,
private val items: List<String>
-) : FragmentStateAdapter(fragmentManager), SelfChecking {
- private val attachCount = AtomicInteger(0)
- private val destroyCount = AtomicInteger(0)
+) : FragmentStateAdapter(fragmentManager) {
+ val attachCount = AtomicInteger(0)
+ val destroyCount = AtomicInteger(0)
override fun getItem(position: Int): Fragment = PageFragment().apply {
arguments = Bundle(1).apply { putString(ARG_KEY, items[position]) }
@@ -52,15 +48,6 @@
var itemIdToContains: (Long) -> Boolean = { itemId -> super.containsItem(itemId) }
override fun getItemId(position: Int): Long = positionToItemId(position)
override fun containsItem(itemId: Long): Boolean = itemIdToContains(itemId)
-
- override fun selfCheck() =
- /** Detects [Fragment] 'memory leaks'. Core premise of [FragmentStateAdapter] is to keep
- * only a handful of [Fragment]s alive and handle the rest via state save/restore. */
- assertThat(
- "Number of alive fragments must be between 0 and 4",
- attachCount.get() - destroyCount.get(),
- allOf(greaterThanOrEqualTo(0), lessThanOrEqualTo(4))
- )
}
class PageFragment : Fragment() {
@@ -68,10 +55,10 @@
var onDestroyListener: () -> Unit = {}
override fun onCreateView(
- layoutInflater: LayoutInflater,
+ inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
- ): View = PageView.inflatePage(layoutInflater, container)
+ ): View = PageView.inflatePage(container!!)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
setValue(when {
diff --git a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/PageView.kt b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/PageView.kt
index 4913605..0e76607 100644
--- a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/PageView.kt
+++ b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/PageView.kt
@@ -17,19 +17,18 @@
package androidx.viewpager2.widget.swipe
import android.app.Activity
-import android.graphics.Color
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.viewpager2.test.R
-private val PAGE_COLOR_EVEN = Color.parseColor("#FFAAAA")
-private val PAGE_COLOR_ODD = Color.parseColor("#AAAAFF")
+private const val PAGE_COLOR_EVEN = 0xFFFF0000.toInt()
+private const val PAGE_COLOR_ODD = 0xFF0000FF.toInt()
object PageView {
- fun inflatePage(layoutInflater: LayoutInflater, parent: ViewGroup?): View =
- layoutInflater.inflate(R.layout.item_test_layout, parent, false)
+ fun inflatePage(parent: ViewGroup): View =
+ LayoutInflater.from(parent.context).inflate(R.layout.item_test_layout, parent, false)
fun findPageInActivity(activity: Activity): View? = activity.findViewById(R.id.text_view)
diff --git a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/SelfChecking.kt b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/SelfChecking.kt
deleted file mode 100644
index 59b4da7..0000000
--- a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/SelfChecking.kt
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright 2019 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.viewpager2.widget.swipe
-
-/** Interface for test elements that have internal validation logic */
-interface SelfChecking {
- fun selfCheck()
-}
\ No newline at end of file
diff --git a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/ViewAdapter.kt b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/ViewAdapter.kt
index 684cfdb..5d2b9d0 100644
--- a/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/ViewAdapter.kt
+++ b/viewpager2/src/androidTest/java/androidx/viewpager2/widget/swipe/ViewAdapter.kt
@@ -16,14 +16,13 @@
package androidx.viewpager2.widget.swipe
-import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.ViewHolder
-open class ViewAdapter(private val items: List<String>) : RecyclerView.Adapter<ViewHolder>() {
+class ViewAdapter(private val items: List<String>) : RecyclerView.Adapter<ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder =
- object : ViewHolder(PageView.inflatePage(LayoutInflater.from(parent.context), parent)) {}
+ object : ViewHolder(PageView.inflatePage(parent)) {}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
PageView.setPageText(holder.itemView, items[position])
diff --git a/viewpager2/src/androidTest/res/layout/item_test_layout.xml b/viewpager2/src/androidTest/res/layout/item_test_layout.xml
index 74a0e03..3ae261b 100644
--- a/viewpager2/src/androidTest/res/layout/item_test_layout.xml
+++ b/viewpager2/src/androidTest/res/layout/item_test_layout.xml
@@ -14,10 +14,9 @@
limitations under the License.
-->
-<androidx.viewpager2.test.ui.TouchConsumingTextView
+<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/text_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:textColor="@color/primary_text_default_material_light"
android:gravity="center"/>
diff --git a/viewpager2/src/main/java/androidx/viewpager2/adapter/FragmentStateAdapter.java b/viewpager2/src/main/java/androidx/viewpager2/adapter/FragmentStateAdapter.java
index 0af932fc..e8a6452 100644
--- a/viewpager2/src/main/java/androidx/viewpager2/adapter/FragmentStateAdapter.java
+++ b/viewpager2/src/main/java/androidx/viewpager2/adapter/FragmentStateAdapter.java
@@ -23,7 +23,6 @@
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import androidx.collection.LongSparseArray;
import androidx.core.view.ViewCompat;
import androidx.fragment.app.Fragment;
@@ -32,6 +31,9 @@
import androidx.fragment.app.FragmentTransaction;
import androidx.recyclerview.widget.RecyclerView;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* Similar in behavior to {@link FragmentStatePagerAdapter}
* <p>
@@ -50,12 +52,24 @@
*/
public abstract class FragmentStateAdapter extends
RecyclerView.Adapter<FragmentViewHolder> implements StatefulAdapter {
- private static final String KEY_PREFIX_FRAGMENT = "f#";
- private static final String KEY_PREFIX_STATE = "s#";
+ private static final String STATE_ARG_KEYS = "keys";
+ private static final String STATE_ARG_VALUES = "values";
private final LongSparseArray<Fragment> mFragments = new LongSparseArray<>();
private final LongSparseArray<Fragment.SavedState> mSavedStates = new LongSparseArray<>();
+ private final RecyclerView.AdapterDataObserver mDataObserver =
+ new RecyclerView.AdapterDataObserver() {
+ @Override
+ public void onChanged() {
+ // TODO(122667374): implement more efficiently
+ /** Below effectively removes all Fragments and state of no longer used items.
+ * See {@link FragmentStateAdapter#containsItem(long)} */
+ Parcelable state = FragmentStateAdapter.this.saveState();
+ FragmentStateAdapter.this.restoreState(state);
+ }
+ };
+
private final FragmentManager mFragmentManager;
public FragmentStateAdapter(@NonNull FragmentManager fragmentManager) {
@@ -63,6 +77,16 @@
super.setHasStableIds(true);
}
+ @Override
+ public final void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) {
+ registerAdapterDataObserver(mDataObserver);
+ }
+
+ @Override
+ public final void onDetachedFromRecyclerView(@NonNull RecyclerView recyclerView) {
+ unregisterAdapterDataObserver(mDataObserver);
+ }
+
/**
* Provide a Fragment associated with the specified position.
*/
@@ -76,13 +100,7 @@
@Override
public final void onBindViewHolder(final @NonNull FragmentViewHolder holder, int position) {
- Fragment fragment = getFragment(position);
- if (holder.mFragment != fragment) {
- /** There is no guarantee that {@link #onViewRecycled} happened since the last
- * {@link #onBindViewHolder}, so performing a clean-up here. */
- removeFragment(holder);
- }
- holder.mFragment = fragment;
+ holder.mFragment = getFragment(position);
/** Special case when {@link RecyclerView} decides to keep the {@link container}
* attached to the window, but not to the view hierarchy (i.e. parent is null) */
@@ -105,111 +123,20 @@
}
private Fragment getFragment(int position) {
+ Fragment fragment = getItem(position);
long itemId = getItemId(position);
- Fragment activeFragment = mFragments.get(itemId);
- if (activeFragment != null) {
- return activeFragment;
- }
-
- Fragment newFragment = getItem(position);
- newFragment.setInitialSavedState(mSavedStates.get(itemId));
- mFragments.put(itemId, newFragment);
- return newFragment;
+ fragment.setInitialSavedState(mSavedStates.get(itemId));
+ mFragments.put(itemId, fragment);
+ return fragment;
}
@Override
public final void onViewAttachedToWindow(@NonNull FragmentViewHolder holder) {
- Fragment fragment = holder.mFragment;
- FrameLayout container = holder.getContainer();
- View view = fragment.getView();
-
- /*
- possible states:
- - fragment: { added, notAdded }
- - view: { created, notCreated }
- - view: { attached, notAttached }
-
- combinations:
- - { f:added, v:created, v:attached } -> check if attached to the right container
- - { f:added, v:created, v:notAttached} -> attach view to container
- - { f:added, v:notCreated, v:attached } -> impossible
- - { f:added, v:notCreated, v:notAttached} -> schedule callback for when created
- - { f:notAdded, v:created, v:attached } -> illegal state
- - { f:notAdded, v:created, v:notAttached } -> illegal state
- - { f:notAdded, v:notCreated, v:attached } -> impossible
- - { f:notAdded, v:notCreated, v:notAttached } -> add, create, attach
- */
-
- // { f:notAdded, v:created, v:attached } -> illegal state
- // { f:notAdded, v:created, v:notAttached } -> illegal state
- if (!fragment.isAdded() && view != null) {
- throw new IllegalStateException("Design assumption violated.");
- }
-
- // { f:added, v:notCreated, v:notAttached} -> schedule callback for when created
- if (fragment.isAdded() && view == null) {
- scheduleViewAttach(fragment, container);
+ if (holder.mFragment.isAdded()) {
return;
}
-
- // { f:added, v:created, v:attached } -> check if attached to the right container
- if (fragment.isAdded() && view.getParent() != null) {
- if (view.getParent() != container) {
- addViewToContainer(view, container);
- }
- return;
- }
-
- // { f:added, v:created, v:notAttached} -> attach view to container
- if (fragment.isAdded()) {
- addViewToContainer(view, container);
- return;
- }
-
- // { f:notAdded, v:notCreated, v:notAttached } -> add, create, attach
- scheduleViewAttach(fragment, container);
- // TODO(b/122669030): this call might fail, so address with recovery steps
- mFragmentManager.beginTransaction().add(fragment, "f" + holder.getItemId()).commitNow();
- }
-
- private void scheduleViewAttach(final Fragment fragment, final FrameLayout container) {
- // After a config change, Fragments that were in FragmentManager will be recreated. Since
- // ViewHolder container ids are dynamically generated, we opted to manually handle
- // attaching Fragment views to containers. For consistency, we use the same mechanism for
- // all Fragment views.
- mFragmentManager.registerFragmentLifecycleCallbacks(
- new FragmentManager.FragmentLifecycleCallbacks() {
- @Override
- public void onFragmentViewCreated(@NonNull FragmentManager fm,
- @NonNull Fragment f, @NonNull View v,
- @Nullable Bundle savedInstanceState) {
- if (f == fragment) {
- fm.unregisterFragmentLifecycleCallbacks(this);
- addViewToContainer(v, container);
- }
- }
- }, false);
- }
-
- @SuppressWarnings("WeakerAccess") // to avoid creation of a synthetic accessor
- void addViewToContainer(@NonNull View v, FrameLayout container) {
- if (container.getChildCount() > 1) {
- throw new IllegalStateException("Design assumption violated.");
- }
-
- if (v.getParent() == container) {
- return;
- }
-
- if (container.getChildCount() > 0) {
- container.removeAllViews();
- }
-
- if (v.getParent() != null) {
- ((ViewGroup) v.getParent()).removeView(v);
- }
-
- container.addView(v);
+ mFragmentManager.beginTransaction().add(holder.getContainer().getId(),
+ holder.mFragment).commit(); // TODO(122669030): review transaction commit type usage
}
@Override
@@ -229,7 +156,6 @@
private void removeFragment(@NonNull FragmentViewHolder holder) {
removeFragment(holder.mFragment, holder.getItemId());
- holder.getContainer().removeAllViews();
holder.mFragment = null;
}
@@ -239,7 +165,6 @@
private void removeFragment(Fragment fragment, long itemId) {
FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();
removeFragment(fragment, itemId, fragmentTransaction);
- // TODO(b/122669030): this call might fail, so address with recovery steps
fragmentTransaction.commitNow();
}
@@ -295,71 +220,60 @@
@Override
public @NonNull Parcelable saveState() {
- /** TODO(b/122670461): use custom {@link Parcelable} instead of Bundle to save space */
- Bundle savedState = new Bundle(mFragments.size() + mSavedStates.size());
-
- /** save references to active fragments */
+ /** remove active fragments saving their state in {@link mSavedStates) */
+ List<Long> toRemove = new ArrayList<>();
for (int ix = 0; ix < mFragments.size(); ix++) {
- long itemId = mFragments.keyAt(ix);
- Fragment fragment = mFragments.get(itemId);
- if (fragment != null && fragment.isAdded()) {
- String key = createKey(KEY_PREFIX_FRAGMENT, itemId);
- mFragmentManager.putFragment(savedState, key, fragment);
+ toRemove.add(mFragments.keyAt(ix));
+ }
+ if (!toRemove.isEmpty()) {
+ FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();
+ for (Long itemId : toRemove) {
+ removeFragment(mFragments.get(itemId), itemId, fragmentTransaction);
}
+ // TODO(b/122669030): add a recovery step / handle in a more graceful manner
+ fragmentTransaction.commitNowAllowingStateLoss();
}
/** Write {@link mSavedStates) into a {@link Parcelable} */
- for (int ix = 0; ix < mSavedStates.size(); ix++) {
+ final int length = mSavedStates.size();
+ long[] keys = new long[length];
+ Fragment.SavedState[] values = new Fragment.SavedState[length];
+ for (int ix = 0; ix < length; ix++) {
long itemId = mSavedStates.keyAt(ix);
if (containsItem(itemId)) {
- String key = createKey(KEY_PREFIX_STATE, itemId);
- savedState.putParcelable(key, mSavedStates.get(itemId));
+ keys[ix] = itemId;
+ values[ix] = mSavedStates.get(keys[ix]);
}
}
+ /** TODO(b/122670461): use custom {@link Parcelable} instead of Bundle to save space */
+ Bundle savedState = new Bundle(2);
+ savedState.putLongArray(STATE_ARG_KEYS, keys);
+ savedState.putParcelableArray(STATE_ARG_VALUES, values);
return savedState;
}
@Override
public void restoreState(@NonNull Parcelable savedState) {
- if (!mSavedStates.isEmpty() || !mFragments.isEmpty()) {
- throw new IllegalStateException(
- "Expected the adapter to be 'fresh' while restoring state.");
- }
-
- Bundle bundle = (Bundle) savedState;
-
- for (String key : bundle.keySet()) {
- if (isValidKey(key, KEY_PREFIX_FRAGMENT)) {
- long itemId = parseIdFromKey(key, KEY_PREFIX_FRAGMENT);
- Fragment fragment = mFragmentManager.getFragment(bundle, key);
- mFragments.put(itemId, fragment);
- continue;
+ try {
+ Bundle bundle = (Bundle) savedState;
+ long[] keys = bundle.getLongArray(STATE_ARG_KEYS);
+ Fragment.SavedState[] values =
+ (Fragment.SavedState[]) bundle.getParcelableArray(STATE_ARG_VALUES);
+ //noinspection ConstantConditions
+ if (keys.length != values.length) {
+ throw new IllegalStateException();
}
- if (isValidKey(key, KEY_PREFIX_STATE)) {
- long itemId = parseIdFromKey(key, KEY_PREFIX_STATE);
- Fragment.SavedState state = bundle.getParcelable(key);
- mSavedStates.put(itemId, state);
- continue;
+ mSavedStates.clear();
+ for (int ix = 0; ix < keys.length; ix++) {
+ long itemId = keys[ix];
+ if (containsItem(itemId)) {
+ mSavedStates.put(itemId, values[ix]);
+ }
}
-
- throw new IllegalArgumentException("Unexpected key in savedState: " + key);
+ } catch (Exception ex) {
+ throw new IllegalStateException("Invalid savedState passed to the adapter.", ex);
}
}
-
- // Helper function for dealing with save / restore state
- private static @NonNull String createKey(@NonNull String prefix, long id) {
- return prefix + id;
- }
-
- // Helper function for dealing with save / restore state
- private static boolean isValidKey(@NonNull String key, @NonNull String prefix) {
- return key.startsWith(prefix) && key.length() > prefix.length();
- }
-
- // Helper function for dealing with save / restore state
- private static long parseIdFromKey(@NonNull String key, @NonNull String prefix) {
- return Long.parseLong(key.substring(prefix.length()));
- }
}
diff --git a/viewpager2/src/main/java/androidx/viewpager2/widget/ScrollEventAdapter.java b/viewpager2/src/main/java/androidx/viewpager2/widget/ScrollEventAdapter.java
index 5eadede..1c24da7 100644
--- a/viewpager2/src/main/java/androidx/viewpager2/widget/ScrollEventAdapter.java
+++ b/viewpager2/src/main/java/androidx/viewpager2/widget/ScrollEventAdapter.java
@@ -130,6 +130,8 @@
dispatchStateChanged(SCROLL_STATE_SETTLING);
// Determine target page and dispatch onPageSelected on next scroll event
mDispatchSelected = true;
+ // Reset value to recognise if onPageSelected has been fired when going to idle
+ mScrollHappened = false;
}
return;
}
@@ -146,22 +148,23 @@
} else {
// Don't dispatch settling event
mDispatchSelected = true;
+ mScrollHappened = false;
}
} else if (mScrollState == SCROLL_STATE_SETTLING && !mScrollHappened) {
throw new IllegalStateException("RecyclerView sent SCROLL_STATE_SETTLING event "
+ "without scrolling any further before going to SCROLL_STATE_IDLE");
}
- // Special case if we were snapped at a page when going from dragging to settling
- // Happens if there was no velocity or if it was the first or last page
- if (mDispatchSelected) {
- // Fire onPageSelected when snapped page is different from initial position
- // E.g.: smooth scroll from 0 to 1, interrupt with drag at 0.5, release at 0
- updateScrollEventValues();
- if (mDragStartPosition != mScrollValues.mPosition) {
- dispatchSelected(mScrollValues.mPosition);
+ if (!mScrollHappened) {
+ // Special case if we were snapped at a page when going from dragging to settling
+ // Happens if there was no velocity or if it was the first or last page
+ if (mDispatchSelected) {
+ // Fire onPageSelected when snapped page is different from initial position
+ // E.g.: smooth scroll from 0 to 1, interrupt with drag at 0.5, release at 0
+ updateScrollEventValues();
+ if (mDragStartPosition != mScrollValues.mPosition) {
+ dispatchSelected(mScrollValues.mPosition);
+ }
}
- }
- if (!mScrollHappened || mDispatchSelected) {
// Normally idle is fired in onScrolled, but scroll did not happen
dispatchStateChanged(SCROLL_STATE_IDLE);
resetState();
@@ -198,7 +201,7 @@
&& mScrollState != SCROLL_STATE_DRAGGING) {
// When the target page is reached and the user is not dragging anymore, we're settled,
// so go to idle.
- // Special case and a bit of a hack when mTarget == NO_POSITION: RecyclerView is being
+ // Special case and a bit of a hack when there is no target: RecyclerView is being
// initialized and fires a single scroll event. This flags mScrollHappened, so we need
// to reset our state. However, we don't want to dispatch idle. But that won't happen;
// because we were already idle.
diff --git a/viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java b/viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
index 5c7fb00..e184368 100644
--- a/viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
+++ b/viewpager2/src/main/java/androidx/viewpager2/widget/ViewPager2.java
@@ -18,18 +18,15 @@
import static java.lang.annotation.RetentionPolicy.SOURCE;
-import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.os.Build;
-import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.view.Gravity;
-import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
@@ -40,8 +37,6 @@
import androidx.annotation.Px;
import androidx.annotation.RequiresApi;
import androidx.core.view.ViewCompat;
-import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
-import androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.PagerSnapHelper;
import androidx.recyclerview.widget.RecyclerView;
@@ -58,7 +53,7 @@
*
* @see androidx.viewpager.widget.ViewPager
*/
-public final class ViewPager2 extends ViewGroup {
+public class ViewPager2 extends ViewGroup {
@Retention(SOURCE)
@IntDef({ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL})
public @interface Orientation {
@@ -89,7 +84,6 @@
private ScrollEventAdapter mScrollEventAdapter;
private PageTransformerAdapter mPageTransformerAdapter;
private CompositeOnPageChangeCallback mPageChangeEventDispatcher;
- private boolean mUserInputEnabled = true;
public ViewPager2(@NonNull Context context) {
super(context);
@@ -114,10 +108,22 @@
}
private void initialize(Context context, AttributeSet attrs) {
- mRecyclerView = new RecyclerViewImpl(context);
+ mRecyclerView = new RecyclerView(context) {
+ @Override
+ public CharSequence getAccessibilityClassName() {
+ return "androidx.viewpager.widget.ViewPager";
+ }
+
+ @Override
+ public void onInitializeAccessibilityEvent(@NonNull AccessibilityEvent event) {
+ super.onInitializeAccessibilityEvent(event);
+ event.setFromIndex(mCurrentItem);
+ event.setToIndex(mCurrentItem);
+ }
+ };
mRecyclerView.setId(ViewCompat.generateViewId());
- mLayoutManager = new LinearLayoutManagerImpl(context);
+ mLayoutManager = new LinearLayoutManager(context);
mRecyclerView.setLayoutManager(mLayoutManager);
setOrientation(context, attrs);
@@ -198,7 +204,6 @@
ss.mRecyclerViewId = mRecyclerView.getId();
ss.mOrientation = getOrientation();
ss.mCurrentItem = mCurrentItem;
- ss.mUserScrollable = mUserInputEnabled;
ss.mScrollInProgress =
mLayoutManager.findFirstCompletelyVisibleItemPosition() != mCurrentItem;
@@ -221,7 +226,6 @@
super.onRestoreInstanceState(ss.getSuperState());
setOrientation(ss.mOrientation);
mCurrentItem = ss.mCurrentItem;
- mUserInputEnabled = ss.mUserScrollable;
if (ss.mScrollInProgress) {
// A scroll was in progress, so the RecyclerView is not at mCurrentItem right now. Move
// it to mCurrentItem instantly in the _next_ frame, as RecyclerView is not yet fired up
@@ -270,7 +274,6 @@
int mRecyclerViewId;
@Orientation int mOrientation;
int mCurrentItem;
- boolean mUserScrollable;
boolean mScrollInProgress;
Parcelable mAdapterState;
@@ -293,7 +296,6 @@
mRecyclerViewId = source.readInt();
mOrientation = source.readInt();
mCurrentItem = source.readInt();
- mUserScrollable = source.readByte() != 0;
mScrollInProgress = source.readByte() != 0;
mAdapterState = source.readParcelable(loader);
}
@@ -304,7 +306,6 @@
out.writeInt(mRecyclerViewId);
out.writeInt(mOrientation);
out.writeInt(mCurrentItem);
- out.writeByte((byte) (mUserScrollable ? 1 : 0));
out.writeByte((byte) (mScrollInProgress ? 1 : 0));
out.writeParcelable(mAdapterState, flags);
}
@@ -333,16 +334,16 @@
* @see androidx.viewpager2.adapter.FragmentStateAdapter
* @see RecyclerView#setAdapter(Adapter)
*/
- public void setAdapter(@Nullable Adapter adapter) {
+ public final void setAdapter(@Nullable Adapter adapter) {
mRecyclerView.setAdapter(adapter);
}
- public @Nullable Adapter getAdapter() {
+ public final @Nullable Adapter getAdapter() {
return mRecyclerView.getAdapter();
}
@Override
- public void onViewAdded(View child) {
+ public final void onViewAdded(View child) {
// TODO(b/70666620): consider adding a support for Decor views
throw new IllegalStateException(
getClass().getSimpleName() + " does not support direct child views");
@@ -390,11 +391,11 @@
/**
* @param orientation @{link {@link ViewPager2.Orientation}}
*/
- public void setOrientation(@Orientation int orientation) {
+ public final void setOrientation(@Orientation int orientation) {
mLayoutManager.setOrientation(orientation);
}
- public @Orientation int getOrientation() {
+ public final @Orientation int getOrientation() {
return mLayoutManager.getOrientation();
}
@@ -408,7 +409,7 @@
*
* @param item Item index to select
*/
- public void setCurrentItem(int item) {
+ public final void setCurrentItem(int item) {
setCurrentItem(item, true);
}
@@ -420,7 +421,7 @@
* @param item Item index to select
* @param smoothScroll True to smoothly scroll to the new item, false to transition immediately
*/
- public void setCurrentItem(int item, boolean smoothScroll) {
+ public final void setCurrentItem(int item, boolean smoothScroll) {
Adapter adapter = getAdapter();
if (adapter == null || adapter.getItemCount() <= 0) {
return;
@@ -468,35 +469,11 @@
*
* @return Currently selected page
*/
- public int getCurrentItem() {
+ public final int getCurrentItem() {
return mCurrentItem;
}
/**
- * Enable or disable user initiated scrolling. This includes touch input (scroll and fling
- * gestures) and accessibility input. Disabling keyboard input is not yet supported. When user
- * initiated scrolling is disabled, programmatic scrolls through {@link #setCurrentItem(int,
- * boolean) setCurrentItem} still work. By default, user initiated scrolling is enabled.
- *
- * @param enabled {@code true} to allow user initiated scrolling, {@code false} to block user
- * initiated scrolling
- * @see #isUserInputEnabled()
- */
- public void setUserInputEnabled(boolean enabled) {
- mUserInputEnabled = enabled;
- }
-
- /**
- * Returns if user initiated scrolling between pages is enabled. Enabled by default.
- *
- * @return {@code true} if users can scroll the ViewPager2, {@code false} otherwise
- * @see #setUserInputEnabled(boolean)
- */
- public boolean isUserInputEnabled() {
- return mUserInputEnabled;
- }
-
- /**
* Add a callback that will be invoked whenever the page changes or is incrementally
* scrolled. See {@link OnPageChangeCallback}.
*
@@ -504,7 +481,7 @@
*
* @param callback callback to add
*/
- public void registerOnPageChangeCallback(@NonNull OnPageChangeCallback callback) {
+ public final void registerOnPageChangeCallback(@NonNull OnPageChangeCallback callback) {
mExternalPageChangeCallbacks.addOnPageChangeCallback(callback);
}
@@ -514,91 +491,23 @@
*
* @param callback callback to remove
*/
- public void unregisterOnPageChangeCallback(@NonNull OnPageChangeCallback callback) {
+ public final void unregisterOnPageChangeCallback(@NonNull OnPageChangeCallback callback) {
mExternalPageChangeCallbacks.removeOnPageChangeCallback(callback);
}
/**
- * Sets a {@link PageTransformer} that will be called for each attached page whenever the
- * scroll position is changed. This allows the application to apply custom property
- * transformations to each page, overriding the default sliding behavior.
+ * Sets a {@link androidx.viewpager.widget.ViewPager.PageTransformer} that will be called for
+ * each attached page whenever the scroll position is changed. This allows the application to
+ * apply custom property transformations to each page, overriding the default sliding behavior.
*
* @param transformer PageTransformer that will modify each page's animation properties
*/
- public void setPageTransformer(@Nullable PageTransformer transformer) {
+ public final void setPageTransformer(@Nullable PageTransformer transformer) {
// TODO: add support for reverseDrawingOrder: b/112892792
// TODO: add support for pageLayerType: b/112893074
mPageTransformerAdapter.setPageTransformer(transformer);
}
- /**
- * Slightly modified RecyclerView to get ViewPager behavior in accessibility and to
- * enable/disable user scrolling.
- */
- private class RecyclerViewImpl extends RecyclerView {
- RecyclerViewImpl(@NonNull Context context) {
- super(context);
- }
-
- @Override
- public CharSequence getAccessibilityClassName() {
- return "androidx.viewpager.widget.ViewPager";
- }
-
- @Override
- public void onInitializeAccessibilityEvent(@NonNull AccessibilityEvent event) {
- super.onInitializeAccessibilityEvent(event);
- event.setFromIndex(mCurrentItem);
- event.setToIndex(mCurrentItem);
- }
-
- @SuppressLint("ClickableViewAccessibility")
- @Override
- public boolean onTouchEvent(MotionEvent event) {
- return isUserInputEnabled() && super.onTouchEvent(event);
- }
-
- @Override
- public boolean onInterceptTouchEvent(MotionEvent ev) {
- return isUserInputEnabled() && super.onInterceptTouchEvent(ev);
- }
- }
-
- /**
- * Slightly modified LinearLayoutManager to adjust accessibility when user scrolling is
- * disabled.
- */
- private class LinearLayoutManagerImpl extends LinearLayoutManager {
- LinearLayoutManagerImpl(Context context) {
- super(context);
- }
-
- @Override
- public boolean performAccessibilityAction(@NonNull RecyclerView.Recycler recycler,
- @NonNull RecyclerView.State state, int action, @Nullable Bundle args) {
- switch (action) {
- case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD:
- case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD:
- if (!isUserInputEnabled()) {
- return false;
- }
- break;
- }
- return super.performAccessibilityAction(recycler, state, action, args);
- }
-
- @Override
- public void onInitializeAccessibilityNodeInfo(@NonNull RecyclerView.Recycler recycler,
- @NonNull RecyclerView.State state, @NonNull AccessibilityNodeInfoCompat info) {
- super.onInitializeAccessibilityNodeInfo(recycler, state, info);
- if (!isUserInputEnabled()) {
- info.removeAction(AccessibilityActionCompat.ACTION_SCROLL_BACKWARD);
- info.removeAction(AccessibilityActionCompat.ACTION_SCROLL_FORWARD);
- info.setScrollable(false);
- }
- }
- }
-
private static class SmoothScrollToPosition implements Runnable {
private final int mPosition;
private final RecyclerView mRecyclerView;
diff --git a/wear/api/1.0.0.txt b/wear/api/1.0.0.txt
index 6609d67..80ac820 100644
--- a/wear/api/1.0.0.txt
+++ b/wear/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.wear.activity {
public class ConfirmationActivity extends android.app.Activity {
@@ -19,6 +19,14 @@
@Deprecated public final class AmbientMode extends android.app.Fragment {
ctor @Deprecated public AmbientMode();
method @Deprecated public static <T extends android.app.Activity> androidx.wear.ambient.AmbientMode.AmbientController! attachAmbientSupport(T!);
+ method @Deprecated public void dump(String!, java.io.FileDescriptor!, java.io.PrintWriter!, String[]!);
+ method @Deprecated @CallSuper public void onAttach(android.content.Context!);
+ method @Deprecated @CallSuper public void onCreate(android.os.Bundle!);
+ method @Deprecated @CallSuper public void onDestroy();
+ method @Deprecated @CallSuper public void onDetach();
+ method @Deprecated @CallSuper public void onPause();
+ method @Deprecated @CallSuper public void onResume();
+ method @Deprecated @CallSuper public void onStop();
field @Deprecated public static final String EXTRA_BURN_IN_PROTECTION = "com.google.android.wearable.compat.extra.BURN_IN_PROTECTION";
field @Deprecated public static final String EXTRA_LOWBIT_AMBIENT = "com.google.android.wearable.compat.extra.LOWBIT_AMBIENT";
field @Deprecated public static final String FRAGMENT_TAG = "android.support.wearable.ambient.AmbientMode";
@@ -188,12 +196,7 @@
ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!, int, int);
method public void addCallback(androidx.wear.widget.SwipeDismissFrameLayout.Callback!);
- method public float getDismissMinDragWidthRatio();
- method public boolean isSwipeable();
method public void removeCallback(androidx.wear.widget.SwipeDismissFrameLayout.Callback!);
- method public void setDismissMinDragWidthRatio(float);
- method public void setSwipeable(boolean);
- field public static final float DEFAULT_DISMISS_DRAG_WIDTH_RATIO = 0.33f;
}
@UiThread public abstract static class SwipeDismissFrameLayout.Callback {
diff --git a/wear/api/1.1.0-alpha01.ignore b/wear/api/1.1.0-alpha01.ignore
deleted file mode 100644
index f758152..0000000
--- a/wear/api/1.1.0-alpha01.ignore
+++ /dev/null
@@ -1,5 +0,0 @@
-// Baseline format: 1.0
-HiddenSuperclass: androidx.wear.widget.SwipeDismissFrameLayout:
- Public class androidx.wear.widget.SwipeDismissFrameLayout stripped of unavailable superclass androidx.wear.widget.SwipeDismissLayout
-
-
diff --git a/wear/api/1.1.0-alpha01.txt b/wear/api/1.1.0-alpha01.txt
deleted file mode 100644
index 6609d67..0000000
--- a/wear/api/1.1.0-alpha01.txt
+++ /dev/null
@@ -1,329 +0,0 @@
-// Signature format: 3.0
-package androidx.wear.activity {
-
- public class ConfirmationActivity extends android.app.Activity {
- ctor public ConfirmationActivity();
- method protected void onAnimationFinished();
- method public void onCreate(android.os.Bundle!);
- field public static final String EXTRA_ANIMATION_TYPE = "androidx.wear.activity.extra.ANIMATION_TYPE";
- field public static final String EXTRA_MESSAGE = "androidx.wear.activity.extra.MESSAGE";
- field public static final int FAILURE_ANIMATION = 3; // 0x3
- field public static final int OPEN_ON_PHONE_ANIMATION = 2; // 0x2
- field public static final int SUCCESS_ANIMATION = 1; // 0x1
- }
-
-}
-
-package androidx.wear.ambient {
-
- @Deprecated public final class AmbientMode extends android.app.Fragment {
- ctor @Deprecated public AmbientMode();
- method @Deprecated public static <T extends android.app.Activity> androidx.wear.ambient.AmbientMode.AmbientController! attachAmbientSupport(T!);
- field @Deprecated public static final String EXTRA_BURN_IN_PROTECTION = "com.google.android.wearable.compat.extra.BURN_IN_PROTECTION";
- field @Deprecated public static final String EXTRA_LOWBIT_AMBIENT = "com.google.android.wearable.compat.extra.LOWBIT_AMBIENT";
- field @Deprecated public static final String FRAGMENT_TAG = "android.support.wearable.ambient.AmbientMode";
- }
-
- @Deprecated public abstract static class AmbientMode.AmbientCallback {
- ctor @Deprecated public AmbientMode.AmbientCallback();
- method @Deprecated public void onAmbientOffloadInvalidated();
- method @Deprecated public void onEnterAmbient(android.os.Bundle!);
- method @Deprecated public void onExitAmbient();
- method @Deprecated public void onUpdateAmbient();
- }
-
- @Deprecated public static interface AmbientMode.AmbientCallbackProvider {
- method @Deprecated public androidx.wear.ambient.AmbientMode.AmbientCallback! getAmbientCallback();
- }
-
- @Deprecated public final class AmbientMode.AmbientController {
- method @Deprecated public boolean isAmbient();
- method @Deprecated public void setAmbientOffloadEnabled(boolean);
- }
-
- public final class AmbientModeSupport extends androidx.fragment.app.Fragment {
- ctor public AmbientModeSupport();
- method public static <T extends androidx.fragment.app.FragmentActivity> androidx.wear.ambient.AmbientModeSupport.AmbientController! attach(T!);
- field public static final String EXTRA_BURN_IN_PROTECTION = "com.google.android.wearable.compat.extra.BURN_IN_PROTECTION";
- field public static final String EXTRA_LOWBIT_AMBIENT = "com.google.android.wearable.compat.extra.LOWBIT_AMBIENT";
- field public static final String FRAGMENT_TAG = "android.support.wearable.ambient.AmbientMode";
- }
-
- public abstract static class AmbientModeSupport.AmbientCallback {
- ctor public AmbientModeSupport.AmbientCallback();
- method public void onAmbientOffloadInvalidated();
- method public void onEnterAmbient(android.os.Bundle!);
- method public void onExitAmbient();
- method public void onUpdateAmbient();
- }
-
- public static interface AmbientModeSupport.AmbientCallbackProvider {
- method public androidx.wear.ambient.AmbientModeSupport.AmbientCallback! getAmbientCallback();
- }
-
- public final class AmbientModeSupport.AmbientController {
- method public boolean isAmbient();
- method public void setAmbientOffloadEnabled(boolean);
- }
-
-}
-
-package androidx.wear.utils {
-
- public class MetadataConstants {
- method public static int getPreviewDrawableResourceId(android.content.Context!, boolean);
- method public static boolean isNotificationBridgingEnabled(android.content.Context!);
- method public static boolean isStandalone(android.content.Context!);
- field public static final String NOTIFICATION_BRIDGE_MODE_BRIDGING = "BRIDGING";
- field public static final String NOTIFICATION_BRIDGE_MODE_METADATA_NAME = "com.google.android.wearable.notificationBridgeMode";
- field public static final String NOTIFICATION_BRIDGE_MODE_NO_BRIDGING = "NO_BRIDGING";
- field public static final String STANDALONE_METADATA_NAME = "com.google.android.wearable.standalone";
- field public static final String WATCH_FACE_PREVIEW_CIRCULAR_METADATA_NAME = "com.google.android.wearable.watchface.preview_circular";
- field public static final String WATCH_FACE_PREVIEW_METADATA_NAME = "com.google.android.wearable.watchface.preview";
- }
-
-}
-
-package androidx.wear.widget {
-
- @UiThread public class BoxInsetLayout extends android.view.ViewGroup {
- ctor public BoxInsetLayout(android.content.Context);
- ctor public BoxInsetLayout(android.content.Context, android.util.AttributeSet?);
- ctor public BoxInsetLayout(android.content.Context, android.util.AttributeSet?, @StyleRes int);
- method public androidx.wear.widget.BoxInsetLayout.LayoutParams! generateLayoutParams(android.util.AttributeSet!);
- }
-
- public static class BoxInsetLayout.LayoutParams extends android.widget.FrameLayout.LayoutParams {
- ctor public BoxInsetLayout.LayoutParams(android.content.Context, android.util.AttributeSet?);
- ctor public BoxInsetLayout.LayoutParams(int, int);
- ctor public BoxInsetLayout.LayoutParams(int, int, int);
- ctor public BoxInsetLayout.LayoutParams(int, int, int, int);
- ctor public BoxInsetLayout.LayoutParams(android.view.ViewGroup.LayoutParams);
- ctor public BoxInsetLayout.LayoutParams(android.view.ViewGroup.MarginLayoutParams);
- ctor public BoxInsetLayout.LayoutParams(android.widget.FrameLayout.LayoutParams);
- ctor public BoxInsetLayout.LayoutParams(androidx.wear.widget.BoxInsetLayout.LayoutParams);
- field public static final int BOX_ALL = 15; // 0xf
- field public static final int BOX_BOTTOM = 8; // 0x8
- field public static final int BOX_LEFT = 1; // 0x1
- field public static final int BOX_NONE = 0; // 0x0
- field public static final int BOX_RIGHT = 4; // 0x4
- field public static final int BOX_TOP = 2; // 0x2
- field public int boxedEdges;
- }
-
- public class CircularProgressLayout extends android.widget.FrameLayout {
- ctor public CircularProgressLayout(android.content.Context!);
- ctor public CircularProgressLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public CircularProgressLayout(android.content.Context!, android.util.AttributeSet!, int);
- ctor public CircularProgressLayout(android.content.Context!, android.util.AttributeSet!, int, int);
- method @ColorInt public int getBackgroundColor();
- method public int[]! getColorSchemeColors();
- method public androidx.wear.widget.CircularProgressLayout.OnTimerFinishedListener? getOnTimerFinishedListener();
- method public androidx.swiperefreshlayout.widget.CircularProgressDrawable getProgressDrawable();
- method public float getStartingRotation();
- method public float getStrokeWidth();
- method public long getTotalTime();
- method public boolean isIndeterminate();
- method public boolean isTimerRunning();
- method public void setColorSchemeColors(int...!);
- method public void setIndeterminate(boolean);
- method public void setOnTimerFinishedListener(androidx.wear.widget.CircularProgressLayout.OnTimerFinishedListener?);
- method public void setStartingRotation(float);
- method public void setStrokeWidth(float);
- method public void setTotalTime(long);
- method public void startTimer();
- method public void stopTimer();
- }
-
- public static interface CircularProgressLayout.OnTimerFinishedListener {
- method public void onTimerFinished(androidx.wear.widget.CircularProgressLayout!);
- }
-
- public class ConfirmationOverlay {
- ctor public ConfirmationOverlay();
- method public androidx.wear.widget.ConfirmationOverlay! setDuration(int);
- method public androidx.wear.widget.ConfirmationOverlay! setFinishedAnimationListener(androidx.wear.widget.ConfirmationOverlay.OnAnimationFinishedListener?);
- method public androidx.wear.widget.ConfirmationOverlay! setMessage(String!);
- method public androidx.wear.widget.ConfirmationOverlay! setType(@androidx.wear.widget.ConfirmationOverlay.OverlayType int);
- method @MainThread public void showAbove(android.view.View!);
- method @MainThread public void showOn(android.app.Activity!);
- field public static final int DEFAULT_ANIMATION_DURATION_MS = 1000; // 0x3e8
- field public static final int FAILURE_ANIMATION = 1; // 0x1
- field public static final int OPEN_ON_PHONE_ANIMATION = 2; // 0x2
- field public static final int SUCCESS_ANIMATION = 0; // 0x0
- }
-
- public static interface ConfirmationOverlay.OnAnimationFinishedListener {
- method public void onAnimationFinished();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @IntDef({androidx.wear.widget.ConfirmationOverlay.SUCCESS_ANIMATION, androidx.wear.widget.ConfirmationOverlay.FAILURE_ANIMATION, androidx.wear.widget.ConfirmationOverlay.OPEN_ON_PHONE_ANIMATION}) public static @interface ConfirmationOverlay.OverlayType {
- }
-
- public class CurvingLayoutCallback extends androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback {
- ctor public CurvingLayoutCallback(android.content.Context!);
- method public void adjustAnchorOffsetXY(android.view.View!, float[]!);
- method public void onLayoutFinished(android.view.View!, androidx.recyclerview.widget.RecyclerView!);
- }
-
- public class RoundedDrawable extends android.graphics.drawable.Drawable {
- ctor public RoundedDrawable();
- method public void draw(android.graphics.Canvas);
- method @ColorInt public int getBackgroundColor();
- method public android.graphics.drawable.Drawable? getDrawable();
- method public int getOpacity();
- method public int getRadius();
- method public boolean isClipEnabled();
- method public void setAlpha(int);
- method public void setBackgroundColor(@ColorInt int);
- method public void setClipEnabled(boolean);
- method public void setColorFilter(android.graphics.ColorFilter!);
- method public void setDrawable(android.graphics.drawable.Drawable?);
- method public void setRadius(int);
- }
-
- @UiThread public class SwipeDismissFrameLayout extends android.widget.FrameLayout {
- ctor public SwipeDismissFrameLayout(android.content.Context!);
- ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
- ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!, int, int);
- method public void addCallback(androidx.wear.widget.SwipeDismissFrameLayout.Callback!);
- method public float getDismissMinDragWidthRatio();
- method public boolean isSwipeable();
- method public void removeCallback(androidx.wear.widget.SwipeDismissFrameLayout.Callback!);
- method public void setDismissMinDragWidthRatio(float);
- method public void setSwipeable(boolean);
- field public static final float DEFAULT_DISMISS_DRAG_WIDTH_RATIO = 0.33f;
- }
-
- @UiThread public abstract static class SwipeDismissFrameLayout.Callback {
- ctor public SwipeDismissFrameLayout.Callback();
- method public void onDismissed(androidx.wear.widget.SwipeDismissFrameLayout!);
- method public void onSwipeCanceled(androidx.wear.widget.SwipeDismissFrameLayout!);
- method public void onSwipeStarted(androidx.wear.widget.SwipeDismissFrameLayout!);
- }
-
- public class WearableLinearLayoutManager extends androidx.recyclerview.widget.LinearLayoutManager {
- ctor public WearableLinearLayoutManager(android.content.Context!, androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback!);
- ctor public WearableLinearLayoutManager(android.content.Context!);
- method public androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback? getLayoutCallback();
- method public void setLayoutCallback(androidx.wear.widget.WearableLinearLayoutManager.LayoutCallback?);
- }
-
- public abstract static class WearableLinearLayoutManager.LayoutCallback {
- ctor public WearableLinearLayoutManager.LayoutCallback();
- method public abstract void onLayoutFinished(android.view.View!, androidx.recyclerview.widget.RecyclerView!);
- }
-
- public class WearableRecyclerView extends androidx.recyclerview.widget.RecyclerView {
- ctor public WearableRecyclerView(android.content.Context!);
- ctor public WearableRecyclerView(android.content.Context!, android.util.AttributeSet?);
- ctor public WearableRecyclerView(android.content.Context!, android.util.AttributeSet?, int);
- ctor public WearableRecyclerView(android.content.Context!, android.util.AttributeSet?, int, int);
- method public float getBezelFraction();
- method public float getScrollDegreesPerScreen();
- method public boolean isCircularScrollingGestureEnabled();
- method public boolean isEdgeItemsCenteringEnabled();
- method public void setBezelFraction(float);
- method public void setCircularScrollingGestureEnabled(boolean);
- method public void setEdgeItemsCenteringEnabled(boolean);
- method public void setScrollDegreesPerScreen(float);
- }
-
-}
-
-package androidx.wear.widget.drawer {
-
- public class WearableActionDrawerView extends androidx.wear.widget.drawer.WearableDrawerView {
- ctor public WearableActionDrawerView(android.content.Context!);
- ctor public WearableActionDrawerView(android.content.Context!, android.util.AttributeSet!);
- ctor public WearableActionDrawerView(android.content.Context!, android.util.AttributeSet!, int);
- ctor public WearableActionDrawerView(android.content.Context!, android.util.AttributeSet!, int, int);
- method public android.view.Menu! getMenu();
- method public void setOnMenuItemClickListener(android.view.MenuItem.OnMenuItemClickListener!);
- method public void setTitle(CharSequence?);
- }
-
- public class WearableDrawerController {
- method public void closeDrawer();
- method public void openDrawer();
- method public void peekDrawer();
- }
-
- public class WearableDrawerLayout extends android.widget.FrameLayout implements androidx.core.view.NestedScrollingParent android.view.View.OnLayoutChangeListener {
- ctor public WearableDrawerLayout(android.content.Context!);
- ctor public WearableDrawerLayout(android.content.Context!, android.util.AttributeSet!);
- ctor public WearableDrawerLayout(android.content.Context!, android.util.AttributeSet!, int);
- ctor public WearableDrawerLayout(android.content.Context!, android.util.AttributeSet!, int, int);
- method public void onFlingComplete(android.view.View!);
- method public void onLayoutChange(android.view.View!, int, int, int, int, int, int, int, int);
- method public void setDrawerStateCallback(androidx.wear.widget.drawer.WearableDrawerLayout.DrawerStateCallback!);
- }
-
- public static class WearableDrawerLayout.DrawerStateCallback {
- ctor public WearableDrawerLayout.DrawerStateCallback();
- method public void onDrawerClosed(androidx.wear.widget.drawer.WearableDrawerLayout!, androidx.wear.widget.drawer.WearableDrawerView!);
- method public void onDrawerOpened(androidx.wear.widget.drawer.WearableDrawerLayout!, androidx.wear.widget.drawer.WearableDrawerView!);
- method public void onDrawerStateChanged(androidx.wear.widget.drawer.WearableDrawerLayout!, int);
- }
-
- public class WearableDrawerView extends android.widget.FrameLayout {
- ctor public WearableDrawerView(android.content.Context!);
- ctor public WearableDrawerView(android.content.Context!, android.util.AttributeSet!);
- ctor public WearableDrawerView(android.content.Context!, android.util.AttributeSet!, int);
- ctor public WearableDrawerView(android.content.Context!, android.util.AttributeSet!, int, int);
- method public androidx.wear.widget.drawer.WearableDrawerController! getController();
- method public android.view.View? getDrawerContent();
- method public int getDrawerState();
- method public boolean isAutoPeekEnabled();
- method public boolean isClosed();
- method public boolean isLocked();
- method public boolean isLockedWhenClosed();
- method public boolean isOpenOnlyAtTopEnabled();
- method public boolean isOpened();
- method public boolean isPeekOnScrollDownEnabled();
- method public boolean isPeeking();
- method public void onDrawerClosed();
- method public void onDrawerOpened();
- method public void onDrawerStateChanged(int);
- method public void onPeekContainerClicked(android.view.View!);
- method public void setDrawerContent(android.view.View?);
- method public void setIsAutoPeekEnabled(boolean);
- method public void setIsLocked(boolean);
- method public void setLockedWhenClosed(boolean);
- method public void setOpenOnlyAtTopEnabled(boolean);
- method public void setPeekContent(android.view.View!);
- method public void setPeekOnScrollDownEnabled(boolean);
- field public static final int STATE_DRAGGING = 1; // 0x1
- field public static final int STATE_IDLE = 0; // 0x0
- field public static final int STATE_SETTLING = 2; // 0x2
- }
-
- public class WearableNavigationDrawerView extends androidx.wear.widget.drawer.WearableDrawerView {
- ctor public WearableNavigationDrawerView(android.content.Context!);
- ctor public WearableNavigationDrawerView(android.content.Context!, android.util.AttributeSet!);
- ctor public WearableNavigationDrawerView(android.content.Context!, android.util.AttributeSet!, int);
- ctor public WearableNavigationDrawerView(android.content.Context!, android.util.AttributeSet!, int, int);
- method public void addOnItemSelectedListener(androidx.wear.widget.drawer.WearableNavigationDrawerView.OnItemSelectedListener!);
- method public int getNavigationStyle();
- method public void removeOnItemSelectedListener(androidx.wear.widget.drawer.WearableNavigationDrawerView.OnItemSelectedListener!);
- method public void setAdapter(androidx.wear.widget.drawer.WearableNavigationDrawerView.WearableNavigationDrawerAdapter!);
- method public void setCurrentItem(int, boolean);
- field public static final int MULTI_PAGE = 1; // 0x1
- field public static final int SINGLE_PAGE = 0; // 0x0
- }
-
- public static interface WearableNavigationDrawerView.OnItemSelectedListener {
- method public void onItemSelected(int);
- }
-
- public abstract static class WearableNavigationDrawerView.WearableNavigationDrawerAdapter {
- ctor public WearableNavigationDrawerView.WearableNavigationDrawerAdapter();
- method public abstract int getCount();
- method public abstract android.graphics.drawable.Drawable! getItemDrawable(int);
- method public abstract CharSequence! getItemText(int);
- method public void notifyDataSetChanged();
- }
-
-}
-
diff --git a/wear/api/current.txt b/wear/api/current.txt
index 6609d67..80ac820 100644
--- a/wear/api/current.txt
+++ b/wear/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.wear.activity {
public class ConfirmationActivity extends android.app.Activity {
@@ -19,6 +19,14 @@
@Deprecated public final class AmbientMode extends android.app.Fragment {
ctor @Deprecated public AmbientMode();
method @Deprecated public static <T extends android.app.Activity> androidx.wear.ambient.AmbientMode.AmbientController! attachAmbientSupport(T!);
+ method @Deprecated public void dump(String!, java.io.FileDescriptor!, java.io.PrintWriter!, String[]!);
+ method @Deprecated @CallSuper public void onAttach(android.content.Context!);
+ method @Deprecated @CallSuper public void onCreate(android.os.Bundle!);
+ method @Deprecated @CallSuper public void onDestroy();
+ method @Deprecated @CallSuper public void onDetach();
+ method @Deprecated @CallSuper public void onPause();
+ method @Deprecated @CallSuper public void onResume();
+ method @Deprecated @CallSuper public void onStop();
field @Deprecated public static final String EXTRA_BURN_IN_PROTECTION = "com.google.android.wearable.compat.extra.BURN_IN_PROTECTION";
field @Deprecated public static final String EXTRA_LOWBIT_AMBIENT = "com.google.android.wearable.compat.extra.LOWBIT_AMBIENT";
field @Deprecated public static final String FRAGMENT_TAG = "android.support.wearable.ambient.AmbientMode";
@@ -188,12 +196,7 @@
ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!, int);
ctor public SwipeDismissFrameLayout(android.content.Context!, android.util.AttributeSet!, int, int);
method public void addCallback(androidx.wear.widget.SwipeDismissFrameLayout.Callback!);
- method public float getDismissMinDragWidthRatio();
- method public boolean isSwipeable();
method public void removeCallback(androidx.wear.widget.SwipeDismissFrameLayout.Callback!);
- method public void setDismissMinDragWidthRatio(float);
- method public void setSwipeable(boolean);
- field public static final float DEFAULT_DISMISS_DRAG_WIDTH_RATIO = 0.33f;
}
@UiThread public abstract static class SwipeDismissFrameLayout.Callback {
diff --git a/wear/api/res-1.1.0-alpha01.txt b/wear/api/res-1.1.0-alpha01.txt
deleted file mode 100644
index 44b0b55..0000000
--- a/wear/api/res-1.1.0-alpha01.txt
+++ /dev/null
@@ -1 +0,0 @@
-style Widget_Wear_RoundSwitch
diff --git a/wear/api/restricted_1.0.0.txt b/wear/api/restricted_1.0.0.txt
deleted file mode 100644
index bc1db20..0000000
--- a/wear/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,212 +0,0 @@
-// Signature format: 3.0
-package androidx.wear.ambient {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class WearableControllerProvider {
- ctor public WearableControllerProvider();
- method public com.google.android.wearable.compat.WearableActivityController! getWearableController(android.app.Activity!, androidx.wear.ambient.AmbientDelegate.AmbientCallback!);
- }
-
-}
-
-package androidx.wear.internal.widget {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public final class ResourcesUtil {
- method public static int getFractionOfScreenPx(android.content.Context!, int, @FractionRes int);
- method public static int getScreenHeightPx(android.content.Context!);
- method public static int getScreenWidthPx(android.content.Context!);
- }
-
-}
-
-package androidx.wear.internal.widget.drawer {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class MultiPagePresenter extends androidx.wear.internal.widget.drawer.WearableNavigationDrawerPresenter {
- ctor public MultiPagePresenter(androidx.wear.widget.drawer.WearableNavigationDrawerView!, androidx.wear.internal.widget.drawer.MultiPagePresenter.Ui!, boolean);
- method public void onDataSetChanged();
- method public boolean onDrawerTapped();
- method public void onNewAdapter(androidx.wear.widget.drawer.WearableNavigationDrawerView.WearableNavigationDrawerAdapter!);
- method public void onSelected(int);
- method public void onSetCurrentItemRequested(int, boolean);
- }
-
- public static interface MultiPagePresenter.Ui {
- method public void initialize(androidx.wear.widget.drawer.WearableNavigationDrawerView!, androidx.wear.internal.widget.drawer.WearableNavigationDrawerPresenter!);
- method public void notifyNavigationPagerAdapterDataChanged();
- method public void notifyPageIndicatorDataChanged();
- method public void setNavigationPagerAdapter(androidx.wear.widget.drawer.WearableNavigationDrawerView.WearableNavigationDrawerAdapter!);
- method public void setNavigationPagerSelectedItem(int, boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class MultiPageUi implements androidx.wear.internal.widget.drawer.MultiPagePresenter.Ui {
- ctor public MultiPageUi();
- method public void initialize(androidx.wear.widget.drawer.WearableNavigationDrawerView!, androidx.wear.internal.widget.drawer.WearableNavigationDrawerPresenter!);
- method public void notifyNavigationPagerAdapterDataChanged();
- method public void notifyPageIndicatorDataChanged();
- method public void setNavigationPagerAdapter(androidx.wear.widget.drawer.WearableNavigationDrawerView.WearableNavigationDrawerAdapter!);
- method public void setNavigationPagerSelectedItem(int, boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class SinglePagePresenter extends androidx.wear.internal.widget.drawer.WearableNavigationDrawerPresenter {
- ctor public SinglePagePresenter(androidx.wear.internal.widget.drawer.SinglePagePresenter.Ui!, boolean);
- method public void onDataSetChanged();
- method public boolean onDrawerTapped();
- method public void onNewAdapter(androidx.wear.widget.drawer.WearableNavigationDrawerView.WearableNavigationDrawerAdapter!);
- method public void onSelected(int);
- method public void onSetCurrentItemRequested(int, boolean);
- }
-
- public static interface SinglePagePresenter.Ui {
- method public void closeDrawerDelayed(long);
- method public void deselectItem(int);
- method public void initialize(int);
- method public void peekDrawer();
- method public void selectItem(int);
- method public void setIcon(int, android.graphics.drawable.Drawable!, CharSequence!);
- method public void setPresenter(androidx.wear.internal.widget.drawer.WearableNavigationDrawerPresenter!);
- method public void setText(CharSequence!, boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class SinglePageUi implements androidx.wear.internal.widget.drawer.SinglePagePresenter.Ui {
- ctor public SinglePageUi(androidx.wear.widget.drawer.WearableNavigationDrawerView!);
- method public void closeDrawerDelayed(long);
- method public void deselectItem(int);
- method public void initialize(int);
- method public void peekDrawer();
- method public void selectItem(int);
- method public void setIcon(int, android.graphics.drawable.Drawable!, CharSequence!);
- method public void setPresenter(androidx.wear.internal.widget.drawer.WearableNavigationDrawerPresenter!);
- method public void setText(CharSequence!, boolean);
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public abstract class WearableNavigationDrawerPresenter {
- ctor public WearableNavigationDrawerPresenter();
- method @MainThread public abstract void onDataSetChanged();
- method @MainThread public abstract boolean onDrawerTapped();
- method @MainThread public void onItemSelectedListenerAdded(androidx.wear.widget.drawer.WearableNavigationDrawerView.OnItemSelectedListener!);
- method @MainThread public void onItemSelectedListenerRemoved(androidx.wear.widget.drawer.WearableNavigationDrawerView.OnItemSelectedListener!);
- method @MainThread public abstract void onNewAdapter(androidx.wear.widget.drawer.WearableNavigationDrawerView.WearableNavigationDrawerAdapter!);
- method @MainThread public abstract void onSelected(int);
- method @MainThread public abstract void onSetCurrentItemRequested(int, boolean);
- }
-
-}
-
-package androidx.wear.widget {
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface BoxInsetLayout.LayoutParams.BoxedEdges {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class CircledImageView {
- ctor public CircledImageView(android.content.Context!);
- ctor public CircledImageView(android.content.Context!, android.util.AttributeSet!);
- ctor public CircledImageView(android.content.Context!, android.util.AttributeSet!, int);
- method protected void drawableStateChanged();
- method public android.content.res.ColorStateList! getCircleColorStateList();
- method public float getCircleRadius();
- method public float getCircleRadiusPercent();
- method public float getCircleRadiusPressed();
- method public float getCircleRadiusPressedPercent();
- method public long getColorChangeAnimationDuration();
- method public int getDefaultCircleColor();
- method public android.graphics.drawable.Drawable! getImageDrawable();
- method public float getInitialCircleRadius();
- method protected void onDraw(android.graphics.Canvas!);
- method protected void onLayout(boolean, int, int, int, int);
- method protected void onMeasure(int, int);
- method protected boolean onSetAlpha(int);
- method public void onSizeChanged(int, int, int, int);
- method protected void onVisibilityChanged(android.view.View!, int);
- method protected void onWindowVisibilityChanged(int);
- method public void setCircleBorderCap(android.graphics.Paint.Cap!);
- method public void setCircleBorderColor(int);
- method public void setCircleBorderWidth(float);
- method public void setCircleColor(int);
- method public void setCircleColorStateList(android.content.res.ColorStateList!);
- method public void setCircleHidden(boolean);
- method public void setCircleRadius(float);
- method public void setCircleRadiusPercent(float);
- method public void setCircleRadiusPressed(float);
- method public void setCircleRadiusPressedPercent(float);
- method public void setColorChangeAnimationDuration(long);
- method public void setImageCirclePercentage(float);
- method public void setImageDrawable(android.graphics.drawable.Drawable!);
- method public void setImageHorizontalOffcenterPercentage(float);
- method public void setImageResource(int);
- method public void setImageTint(int);
- method public void setPadding(@Px int, @Px int, @Px int, @Px int);
- method public void setPressed(boolean);
- method public void setProgress(float);
- method public void setShadowVisibility(float);
- method public void showIndeterminateProgress(boolean);
- }
-
- public class ConfirmationOverlay {
- method @MainThread @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @VisibleForTesting public void hide();
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class SimpleAnimatorListener {
- ctor public SimpleAnimatorListener();
- method public void onAnimationCancel(android.animation.Animator!);
- method public void onAnimationComplete(android.animation.Animator!);
- method public void onAnimationEnd(android.animation.Animator!);
- method public void onAnimationRepeat(android.animation.Animator!);
- method public void onAnimationStart(android.animation.Animator!);
- method public boolean wasCanceled();
- }
-
-}
-
-package androidx.wear.widget.drawer {
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public class PageIndicatorView {
- ctor public PageIndicatorView(android.content.Context!);
- ctor public PageIndicatorView(android.content.Context!, android.util.AttributeSet!);
- ctor public PageIndicatorView(android.content.Context!, android.util.AttributeSet!, int);
- method public int getDotColor();
- method public int getDotColorSelected();
- method public int getDotFadeInDuration();
- method public int getDotFadeOutDelay();
- method public int getDotFadeOutDuration();
- method public boolean getDotFadeWhenIdle();
- method public float getDotRadius();
- method public float getDotRadiusSelected();
- method public int getDotShadowColor();
- method public float getDotShadowDx();
- method public float getDotShadowDy();
- method public float getDotShadowRadius();
- method public float getDotSpacing();
- method public void notifyDataSetChanged();
- method protected void onDraw(android.graphics.Canvas!);
- method protected void onMeasure(int, int);
- method public void onPageScrollStateChanged(int);
- method public void onPageScrolled(int, float, int);
- method public void onPageSelected(int);
- method public void setDotColor(int);
- method public void setDotColorSelected(int);
- method public void setDotFadeInDuration(int, java.util.concurrent.TimeUnit!);
- method public void setDotFadeOutDelay(int);
- method public void setDotFadeOutDuration(int, java.util.concurrent.TimeUnit!);
- method public void setDotFadeWhenIdle(boolean);
- method public void setDotRadius(int);
- method public void setDotRadiusSelected(int);
- method public void setDotShadowColor(int);
- method public void setDotShadowDx(float);
- method public void setDotShadowDy(float);
- method public void setDotShadowRadius(float);
- method public void setDotSpacing(int);
- method public void setPager(androidx.viewpager.widget.ViewPager!);
- method public void setPagerAdapter(androidx.viewpager.widget.PagerAdapter!);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface WearableDrawerView.DrawerState {
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public static @interface WearableNavigationDrawerView.NavigationStyle {
- }
-
- public abstract static class WearableNavigationDrawerView.WearableNavigationDrawerAdapter {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY}) public void setPresenter(androidx.wear.internal.widget.drawer.WearableNavigationDrawerPresenter!);
- }
-
-}
-
diff --git a/wear/build.gradle b/wear/build.gradle
index 4a940fc..57d60df 100644
--- a/wear/build.gradle
+++ b/wear/build.gradle
@@ -45,5 +45,4 @@
inceptionYear = "2016"
description = "Android Wear Support UI"
failOnDeprecationWarnings = false
- trackRestrictedAPIs = false
}
diff --git a/wear/res/values-bs/strings.xml b/wear/res/values-bs/strings.xml
index cf30702..82c990c 100644
--- a/wear/res/values-bs/strings.xml
+++ b/wear/res/values-bs/strings.xml
@@ -16,6 +16,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="ws_navigation_drawer_content_description" msgid="7216697245762194759">"Ladica za navigaciju"</string>
- <string name="ws_action_drawer_content_description" msgid="1837365417701148489">"Ladica za radnju"</string>
+ <string name="ws_navigation_drawer_content_description" msgid="7216697245762194759">"Panel za navigaciju"</string>
+ <string name="ws_action_drawer_content_description" msgid="1837365417701148489">"Panel za radnju"</string>
</resources>
diff --git a/wear/src/androidTest/java/androidx/wear/ambient/AmbientDelegateTest.java b/wear/src/androidTest/java/androidx/wear/ambient/AmbientDelegateTest.java
index 27c22f2..8f817b4 100644
--- a/wear/src/androidTest/java/androidx/wear/ambient/AmbientDelegateTest.java
+++ b/wear/src/androidTest/java/androidx/wear/ambient/AmbientDelegateTest.java
@@ -24,6 +24,7 @@
import androidx.fragment.app.FragmentActivity;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import com.google.android.wearable.compat.WearableActivityController;
@@ -35,7 +36,7 @@
/**
* Tests for {@link AmbientDelegate}.
*/
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class AmbientDelegateTest {
diff --git a/wear/src/androidTest/java/androidx/wear/ambient/AmbientModeSupportTest.java b/wear/src/androidTest/java/androidx/wear/ambient/AmbientModeSupportTest.java
index 271412e..849d193 100644
--- a/wear/src/androidTest/java/androidx/wear/ambient/AmbientModeSupportTest.java
+++ b/wear/src/androidTest/java/androidx/wear/ambient/AmbientModeSupportTest.java
@@ -20,7 +20,7 @@
import static org.junit.Assert.assertTrue;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import androidx.wear.widget.util.WakeLockRule;
@@ -30,7 +30,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class AmbientModeSupportTest {
@Rule
diff --git a/wear/src/androidTest/java/androidx/wear/ambient/AmbientModeTest.java b/wear/src/androidTest/java/androidx/wear/ambient/AmbientModeTest.java
index f24d3aa..da1d1dc 100644
--- a/wear/src/androidTest/java/androidx/wear/ambient/AmbientModeTest.java
+++ b/wear/src/androidTest/java/androidx/wear/ambient/AmbientModeTest.java
@@ -20,7 +20,7 @@
import static org.junit.Assert.assertTrue;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import androidx.wear.widget.util.WakeLockRule;
@@ -30,7 +30,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class AmbientModeTest {
@Rule
diff --git a/wear/src/androidTest/java/androidx/wear/widget/BoxInsetLayoutTest.java b/wear/src/androidTest/java/androidx/wear/widget/BoxInsetLayoutTest.java
index 494fb25..6b8b79b 100644
--- a/wear/src/androidTest/java/androidx/wear/widget/BoxInsetLayoutTest.java
+++ b/wear/src/androidTest/java/androidx/wear/widget/BoxInsetLayoutTest.java
@@ -39,7 +39,7 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import androidx.wear.test.R;
import androidx.wear.widget.util.WakeLockRule;
@@ -51,7 +51,7 @@
import java.util.HashMap;
import java.util.Map;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class BoxInsetLayoutTest {
private static final float FACTOR = 0.146467f; //(1 - sqrt(2)/2)/2
diff --git a/wear/src/androidTest/java/androidx/wear/widget/CircularProgressLayoutControllerTest.java b/wear/src/androidTest/java/androidx/wear/widget/CircularProgressLayoutControllerTest.java
index f8cbb18..23996aa 100644
--- a/wear/src/androidTest/java/androidx/wear/widget/CircularProgressLayoutControllerTest.java
+++ b/wear/src/androidTest/java/androidx/wear/widget/CircularProgressLayoutControllerTest.java
@@ -25,7 +25,7 @@
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.Before;
import org.junit.Test;
@@ -34,7 +34,7 @@
import java.util.concurrent.TimeUnit;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class CircularProgressLayoutControllerTest {
diff --git a/wear/src/androidTest/java/androidx/wear/widget/CircularProgressLayoutTest.java b/wear/src/androidTest/java/androidx/wear/widget/CircularProgressLayoutTest.java
index 52cee2a..b654b46 100644
--- a/wear/src/androidTest/java/androidx/wear/widget/CircularProgressLayoutTest.java
+++ b/wear/src/androidTest/java/androidx/wear/widget/CircularProgressLayoutTest.java
@@ -23,7 +23,7 @@
import android.content.Intent;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import androidx.wear.test.R;
@@ -34,7 +34,7 @@
import java.util.concurrent.TimeUnit;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class CircularProgressLayoutTest {
diff --git a/wear/src/androidTest/java/androidx/wear/widget/ConfirmationOverlayTest.java b/wear/src/androidTest/java/androidx/wear/widget/ConfirmationOverlayTest.java
index 3f7899e..fdd9f45 100644
--- a/wear/src/androidTest/java/androidx/wear/widget/ConfirmationOverlayTest.java
+++ b/wear/src/androidTest/java/androidx/wear/widget/ConfirmationOverlayTest.java
@@ -29,7 +29,7 @@
import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.rule.ActivityTestRule;
import androidx.wear.R;
import androidx.wear.widget.util.WakeLockRule;
@@ -44,7 +44,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class ConfirmationOverlayTest {
diff --git a/wear/src/androidTest/java/androidx/wear/widget/RoundedDrawableTest.java b/wear/src/androidTest/java/androidx/wear/widget/RoundedDrawableTest.java
index 9889a38..02fa31e 100644
--- a/wear/src/androidTest/java/androidx/wear/widget/RoundedDrawableTest.java
+++ b/wear/src/androidTest/java/androidx/wear/widget/RoundedDrawableTest.java
@@ -35,8 +35,8 @@
import android.os.Build;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.test.rule.ActivityTestRule;
import androidx.wear.test.R;
@@ -47,7 +47,7 @@
import org.mockito.Mock;
/** Tests for {@link RoundedDrawable} */
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class RoundedDrawableTest {
diff --git a/wear/src/androidTest/java/androidx/wear/widget/SwipeDismissFrameLayoutTest.java b/wear/src/androidTest/java/androidx/wear/widget/SwipeDismissFrameLayoutTest.java
index 3d51548..f1a345e 100644
--- a/wear/src/androidTest/java/androidx/wear/widget/SwipeDismissFrameLayoutTest.java
+++ b/wear/src/androidTest/java/androidx/wear/widget/SwipeDismissFrameLayoutTest.java
@@ -41,7 +41,7 @@
import androidx.test.espresso.action.Swipe;
import androidx.test.espresso.matcher.ViewMatchers;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
import androidx.wear.test.R;
@@ -53,7 +53,6 @@
import org.junit.runner.RunWith;
@RunWith(AndroidJUnit4.class)
-@LargeTest
public class SwipeDismissFrameLayoutTest {
private static final long MAX_WAIT_TIME = 4000; //ms
@@ -74,6 +73,7 @@
private int mLayoutHeight;
@Test
+ @SmallTest
public void testCanScrollHorizontally() {
// GIVEN a freshly setup SwipeDismissFrameLayout
setUpSimpleLayout();
@@ -95,6 +95,7 @@
}
@Test
+ @SmallTest
public void canScrollHorizontallyShouldBeFalseWhenInvisible() {
// GIVEN a freshly setup SwipeDismissFrameLayout
setUpSimpleLayout();
@@ -116,6 +117,7 @@
}
@Test
+ @SmallTest
public void canScrollHorizontallyShouldBeFalseWhenGone() {
// GIVEN a freshly setup SwipeDismissFrameLayout
setUpSimpleLayout();
@@ -138,6 +140,7 @@
}
@Test
+ @SmallTest
public void testSwipeDismissEnabledByDefault() {
// GIVEN a freshly setup SwipeDismissFrameLayout
setUpSimpleLayout();
@@ -150,6 +153,7 @@
}
@Test
+ @SmallTest
public void testSwipeDismissesViewIfEnabled() {
// GIVEN a freshly setup SwipeDismissFrameLayout
setUpSimpleLayout();
@@ -160,6 +164,7 @@
}
@Test
+ @SmallTest
public void testSwipeDoesNotDismissViewIfDisabled() {
// GIVEN a freshly setup SwipeDismissFrameLayout with dismiss turned off.
setUpSimpleLayout();
@@ -174,6 +179,7 @@
}
@Test
+ @SmallTest
public void testAddRemoveCallback() {
// GIVEN a freshly setup SwipeDismissFrameLayout
setUpSimpleLayout();
@@ -187,6 +193,7 @@
}
@Test
+ @SmallTest
public void testSwipeDoesNotDismissViewIfScrollable() throws Throwable {
// GIVEN a freshly setup SwipeDismissFrameLayout with dismiss turned off.
setUpSwipeDismissWithHorizontalRecyclerView();
@@ -209,6 +216,7 @@
@Test
+ @SmallTest
public void testEdgeSwipeDoesDismissViewIfScrollable() {
// GIVEN a freshly setup SwipeDismissFrameLayout with dismiss turned off.
setUpSwipeDismissWithHorizontalRecyclerView();
@@ -219,6 +227,7 @@
}
@Test
+ @SmallTest
public void testSwipeDoesNotDismissViewIfStartsInWrongPosition() {
// GIVEN a freshly setup SwipeDismissFrameLayout with dismiss turned on, but only for an
// inner circle.
@@ -230,6 +239,7 @@
}
@Test
+ @SmallTest
public void testSwipeDoesDismissViewIfStartsInRightPosition() {
// GIVEN a freshly setup SwipeDismissFrameLayout with dismiss turned on, but only for an
// inner circle.
@@ -252,6 +262,7 @@
}*/
@Test
+ @SmallTest
public void testArcSwipeDoesNotTriggerDismiss() throws Throwable {
// GIVEN a freshly setup SwipeDismissFrameLayout with vertically scrollable content
setUpSwipeDismissWithVerticalRecyclerView();
diff --git a/wear/src/androidTest/java/androidx/wear/widget/WearableRecyclerViewTest.java b/wear/src/androidTest/java/androidx/wear/widget/WearableRecyclerViewTest.java
index 16eeee5..9be9641 100644
--- a/wear/src/androidTest/java/androidx/wear/widget/WearableRecyclerViewTest.java
+++ b/wear/src/androidTest/java/androidx/wear/widget/WearableRecyclerViewTest.java
@@ -39,7 +39,7 @@
import androidx.test.espresso.action.Press;
import androidx.test.espresso.action.Swipe;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
import androidx.wear.test.R;
@@ -52,7 +52,7 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class WearableRecyclerViewTest {
diff --git a/wear/src/main/java/androidx/wear/widget/ConfirmationOverlay.java b/wear/src/main/java/androidx/wear/widget/ConfirmationOverlay.java
index d167488..cb1e25f 100644
--- a/wear/src/main/java/androidx/wear/widget/ConfirmationOverlay.java
+++ b/wear/src/main/java/androidx/wear/widget/ConfirmationOverlay.java
@@ -229,7 +229,7 @@
*/
@MainThread
@VisibleForTesting
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public void hide() {
Animation fadeOut =
AnimationUtils.loadAnimation(mOverlayView.getContext(), android.R.anim.fade_out);
diff --git a/webkit/api/1.0.0.txt b/webkit/api/1.0.0.txt
index 952c076..d35e844 100644
--- a/webkit/api/1.0.0.txt
+++ b/webkit/api/1.0.0.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.webkit {
public abstract class SafeBrowsingResponseCompat {
diff --git a/webkit/api/1.1.0-alpha01.txt b/webkit/api/1.1.0-alpha01.txt
index ba497b4..f15040d 100644
--- a/webkit/api/1.1.0-alpha01.txt
+++ b/webkit/api/1.1.0-alpha01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.webkit {
public abstract class SafeBrowsingResponseCompat {
@@ -98,30 +98,11 @@
method @RequiresFeature(name=androidx.webkit.WebViewFeature.SAFE_BROWSING_ENABLE, enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") public static void setSafeBrowsingEnabled(android.webkit.WebSettings!, boolean);
}
- public class WebViewAssetLoader {
- method public android.net.Uri? getAssetsHttpPrefix();
- method public android.net.Uri getAssetsHttpsPrefix();
- method public android.net.Uri? getResourcesHttpPrefix();
- method public android.net.Uri getResourcesHttpsPrefix();
- method @RequiresApi(21) public android.webkit.WebResourceResponse? shouldInterceptRequest(android.webkit.WebResourceRequest);
- method public android.webkit.WebResourceResponse? shouldInterceptRequest(String);
- field public static final String KNOWN_UNUSED_AUTHORITY = "appassets.androidplatform.net";
- }
-
- public static final class WebViewAssetLoader.Builder {
- ctor public WebViewAssetLoader.Builder(android.content.Context);
- method public androidx.webkit.WebViewAssetLoader.Builder allowHttp();
- method public androidx.webkit.WebViewAssetLoader build();
- method public androidx.webkit.WebViewAssetLoader.Builder setAssetsHostingPath(String);
- method public androidx.webkit.WebViewAssetLoader.Builder setDomain(String);
- method public androidx.webkit.WebViewAssetLoader.Builder setResourcesHostingPath(String);
- }
-
public class WebViewClientCompat extends android.webkit.WebViewClient {
ctor public WebViewClientCompat();
- method @RequiresApi(23) public final void onReceivedError(android.webkit.WebView, android.webkit.WebResourceRequest, android.webkit.WebResourceError);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @RequiresApi(23) public final void onReceivedError(android.webkit.WebView, android.webkit.WebResourceRequest, android.webkit.WebResourceError);
method @RequiresApi(21) public void onReceivedError(android.webkit.WebView, android.webkit.WebResourceRequest, androidx.webkit.WebResourceErrorCompat);
- method @RequiresApi(27) public final void onSafeBrowsingHit(android.webkit.WebView, android.webkit.WebResourceRequest, int, android.webkit.SafeBrowsingResponse);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @RequiresApi(27) public final void onSafeBrowsingHit(android.webkit.WebView, android.webkit.WebResourceRequest, int, android.webkit.SafeBrowsingResponse);
method public void onSafeBrowsingHit(android.webkit.WebView, android.webkit.WebResourceRequest, int, androidx.webkit.SafeBrowsingResponseCompat);
}
diff --git a/webkit/api/current.txt b/webkit/api/current.txt
index ba497b4..f15040d 100644
--- a/webkit/api/current.txt
+++ b/webkit/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.webkit {
public abstract class SafeBrowsingResponseCompat {
@@ -98,30 +98,11 @@
method @RequiresFeature(name=androidx.webkit.WebViewFeature.SAFE_BROWSING_ENABLE, enforcement="androidx.webkit.WebViewFeature#isFeatureSupported") public static void setSafeBrowsingEnabled(android.webkit.WebSettings!, boolean);
}
- public class WebViewAssetLoader {
- method public android.net.Uri? getAssetsHttpPrefix();
- method public android.net.Uri getAssetsHttpsPrefix();
- method public android.net.Uri? getResourcesHttpPrefix();
- method public android.net.Uri getResourcesHttpsPrefix();
- method @RequiresApi(21) public android.webkit.WebResourceResponse? shouldInterceptRequest(android.webkit.WebResourceRequest);
- method public android.webkit.WebResourceResponse? shouldInterceptRequest(String);
- field public static final String KNOWN_UNUSED_AUTHORITY = "appassets.androidplatform.net";
- }
-
- public static final class WebViewAssetLoader.Builder {
- ctor public WebViewAssetLoader.Builder(android.content.Context);
- method public androidx.webkit.WebViewAssetLoader.Builder allowHttp();
- method public androidx.webkit.WebViewAssetLoader build();
- method public androidx.webkit.WebViewAssetLoader.Builder setAssetsHostingPath(String);
- method public androidx.webkit.WebViewAssetLoader.Builder setDomain(String);
- method public androidx.webkit.WebViewAssetLoader.Builder setResourcesHostingPath(String);
- }
-
public class WebViewClientCompat extends android.webkit.WebViewClient {
ctor public WebViewClientCompat();
- method @RequiresApi(23) public final void onReceivedError(android.webkit.WebView, android.webkit.WebResourceRequest, android.webkit.WebResourceError);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @RequiresApi(23) public final void onReceivedError(android.webkit.WebView, android.webkit.WebResourceRequest, android.webkit.WebResourceError);
method @RequiresApi(21) public void onReceivedError(android.webkit.WebView, android.webkit.WebResourceRequest, androidx.webkit.WebResourceErrorCompat);
- method @RequiresApi(27) public final void onSafeBrowsingHit(android.webkit.WebView, android.webkit.WebResourceRequest, int, android.webkit.SafeBrowsingResponse);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) @RequiresApi(27) public final void onSafeBrowsingHit(android.webkit.WebView, android.webkit.WebResourceRequest, int, android.webkit.SafeBrowsingResponse);
method public void onSafeBrowsingHit(android.webkit.WebView, android.webkit.WebResourceRequest, int, androidx.webkit.SafeBrowsingResponseCompat);
}
diff --git a/webkit/api/restricted_1.0.0.txt b/webkit/api/restricted_1.0.0.txt
deleted file mode 100644
index 46cf789..0000000
--- a/webkit/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-// Signature format: 3.0
-package androidx.webkit {
-
- public abstract class SafeBrowsingResponseCompat {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public SafeBrowsingResponseCompat();
- }
-
- public abstract class ServiceWorkerControllerCompat {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public ServiceWorkerControllerCompat();
- }
-
- public abstract class ServiceWorkerWebSettingsCompat {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public ServiceWorkerWebSettingsCompat();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface ServiceWorkerWebSettingsCompat.CacheMode {
- }
-
- public abstract class WebMessagePortCompat {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public WebMessagePortCompat();
- method @RequiresApi(23) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract android.webkit.WebMessagePort! getFrameworkPort();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract java.lang.reflect.InvocationHandler! getInvocationHandler();
- }
-
- public abstract class WebResourceErrorCompat {
- ctor @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public WebResourceErrorCompat();
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface WebResourceErrorCompat.NetErrorCode {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD}) public static @interface WebSettingsCompat.MenuItemFlags {
- }
-
- public class WebViewClientCompat implements org.chromium.support_lib_boundary.WebViewClientBoundaryInterface {
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final String[]! getSupportedFeatures();
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(21) public final void onReceivedError(android.webkit.WebView, android.webkit.WebResourceRequest, java.lang.reflect.InvocationHandler);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(23) public final void onReceivedError(android.webkit.WebView, android.webkit.WebResourceRequest, android.webkit.WebResourceError);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final void onSafeBrowsingHit(android.webkit.WebView, android.webkit.WebResourceRequest, int, java.lang.reflect.InvocationHandler);
- method @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(27) public final void onSafeBrowsingHit(android.webkit.WebView, android.webkit.WebResourceRequest, int, android.webkit.SafeBrowsingResponse);
- }
-
- @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static @interface WebViewClientCompat.SafeBrowsingThreat {
- }
-
- @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.METHOD}) public static @interface WebViewFeature.WebViewSupportFeature {
- }
-
-}
-
-package @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RestrictTo({androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP}) androidx.webkit.internal {
-
- public class WebMessagePortImpl extends androidx.webkit.WebMessagePortCompat {
- method @RequiresApi(23) public android.webkit.WebMessagePort! getFrameworkPort();
- method public java.lang.reflect.InvocationHandler! getInvocationHandler();
- }
-
-}
-
diff --git a/webkit/build.gradle b/webkit/build.gradle
index 8f9ac2d..24fd75e 100644
--- a/webkit/build.gradle
+++ b/webkit/build.gradle
@@ -30,7 +30,6 @@
androidTestImplementation(TEST_EXT_JUNIT)
androidTestImplementation(TEST_CORE)
androidTestImplementation(TEST_RUNNER)
- androidTestImplementation(TEST_RULES)
androidTestImplementation(project(":concurrent:concurrent-futures"))
}
@@ -56,5 +55,4 @@
mavenGroup = LibraryGroups.WEBKIT
inceptionYear = "2017"
description = "The WebView Support Library is a static library you can add to your Android application in order to use android.webkit APIs that are not available for older platform versions."
- trackRestrictedAPIs = false
}
diff --git a/webkit/integration-tests/testapp/build.gradle b/webkit/integration-tests/testapp/build.gradle
index 4e10fdf..ecbe178 100644
--- a/webkit/integration-tests/testapp/build.gradle
+++ b/webkit/integration-tests/testapp/build.gradle
@@ -28,9 +28,6 @@
defaultConfig {
minSdkVersion 19
}
- lintOptions {
- disable 'UnusedResources'
- }
buildTypes {
release {
minifyEnabled true
diff --git a/webkit/integration-tests/testapp/src/main/AndroidManifest.xml b/webkit/integration-tests/testapp/src/main/AndroidManifest.xml
index a5cd5df..efbf98d 100644
--- a/webkit/integration-tests/testapp/src/main/AndroidManifest.xml
+++ b/webkit/integration-tests/testapp/src/main/AndroidManifest.xml
@@ -23,27 +23,17 @@
<application android:label="@string/main_activity_title"
android:hardwareAccelerated="true"
android:theme="@style/AppTheme"
- android:supportsRtl="true"
- android:usesCleartextTraffic="true">
+ android:supportsRtl="true">
<!-- Top-level Activity -->
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
-
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".SafeBrowsingActivity"
android:exported="true" />
- <activity android:name=".ProxyOverrideActivity"
- android:exported="true" />
- <activity android:name=".AssetLoaderListActivity"
- android:exported="true" />
- <activity android:name=".AssetLoaderSimpleActivity"
- android:exported="true" />
- <activity android:name=".AssetLoaderAjaxActivity"
- android:exported="true" />
</application>
</manifest>
diff --git a/webkit/integration-tests/testapp/src/main/assets/www/ajax_requests.html b/webkit/integration-tests/testapp/src/main/assets/www/ajax_requests.html
deleted file mode 100644
index 66d4564..0000000
--- a/webkit/integration-tests/testapp/src/main/assets/www/ajax_requests.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<html>
-<!-- Copyright (C) 2019 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.
--->
-<head>
- <title>Load html over XMLHttpRequest</title>
-
- <!-- Load html file from android_assets -->
- <script type="text/javascript">
- fetch('https://example.com/androidx_webkit/example/assets/www/some_text.html')
- .then(response => response.text())
- .then(response => {
- document.getElementById("assets_html").innerHTML = response;
- })
- .catch(err => {
- document.getElementById("assets_html").innerHTML = "Loading file from assets failed";
- })
- </script>
-
- <!-- Load html file from android_resources -->
- <script type="text/javascript">
- fetch('https://example.com/androidx_webkit/example/res/raw/some_text.html')
- .then(response => response.text())
- .then(response => {
- document.getElementById("res_html").innerHTML = response;
- })
- .catch(err => {
- document.getElementById("res_html").innerHTML = "Loading file from resources failed";
- })
- </script>
-</head>
-
-<body>
- <h1>Loaded HTML should appear below on success</h1>
- <hr>
- <div id="assets_html"></div>
- <div id="res_html"></div>
-</body>
-</html>
diff --git a/webkit/integration-tests/testapp/src/main/assets/www/some_text.html b/webkit/integration-tests/testapp/src/main/assets/www/some_text.html
deleted file mode 100644
index c7578bc..0000000
--- a/webkit/integration-tests/testapp/src/main/assets/www/some_text.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!-- Copyright (C) 2019 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.
--->
-<h3>Successfully loaded html from assets!</h3>
diff --git a/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/AssetLoaderAjaxActivity.java b/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/AssetLoaderAjaxActivity.java
deleted file mode 100644
index 96b56c0..0000000
--- a/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/AssetLoaderAjaxActivity.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.webkit;
-
-import android.net.Uri;
-import android.os.Bundle;
-import android.webkit.WebResourceRequest;
-import android.webkit.WebResourceResponse;
-import android.webkit.WebSettings;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.webkit.WebViewAssetLoader;
-
-/**
- * An {@link Activity} to show a more useful usecase: performing ajax calls to load files from
- * local app assets and resources in a safer way using WebViewAssetLoader.
- */
-public class AssetLoaderAjaxActivity extends AppCompatActivity {
-
- private class MyWebViewClient extends WebViewClient {
- @Override
- public boolean shouldOverrideUrlLoading(WebView view, String url) {
- return false;
- }
-
- @RequiresApi(21)
- public WebResourceResponse shouldInterceptRequest(WebView view,
- WebResourceRequest request) {
- return mAssetLoader.shouldInterceptRequest(request);
- }
-
- @Override
- public WebResourceResponse shouldInterceptRequest(WebView view, String request) {
- return mAssetLoader.shouldInterceptRequest(request);
- }
- }
-
- private WebViewAssetLoader mAssetLoader;
- private WebView mWebView;
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.activity_asset_loader);
- setTitle(R.string.asset_loader_ajax_activity_title);
- WebkitHelpers.appendWebViewVersionToTitle(this);
-
- // The "https://example.com" domain with the virtual path "/androidx_webkit/example/
- // is used to host resources/assets is used for demonstration purpose only.
- // The developer should ALWAYS use a domain which they are in control of or use
- // the default androidplatform.net reserved by Google for this purpose.
- WebViewAssetLoader.Builder assetLoaderBuilder = new WebViewAssetLoader.Builder(this);
- // using the domain "example.com" instead of the default "appassets.androidplatfrom.net"
- assetLoaderBuilder.setDomain("example.com");
- // Host app resources ... under https://example.com/androidx_webkit/example/res/...
- assetLoaderBuilder.setResourcesHostingPath("/androidx_webkit/example/res/");
- // Host app assets under https://example.com/androidx_webkit/example/assets/...
- assetLoaderBuilder.setAssetsHostingPath("/androidx_webkit/example/assets/");
- mAssetLoader = assetLoaderBuilder.build();
-
- mWebView = findViewById(R.id.webview_asset_loader_webview);
- mWebView.setWebViewClient(new MyWebViewClient());
-
- WebSettings webViewSettings = mWebView.getSettings();
- webViewSettings.setJavaScriptEnabled(true);
- // Setting this off for security. Off by default for SDK versions >= 16.
- webViewSettings.setAllowFileAccessFromFileURLs(false);
- webViewSettings.setAllowUniversalAccessFromFileURLs(false);
- // Keeping these off is less critical but still a good idea, especially
- // if your app is not using file:// or content:// URLs.
- webViewSettings.setAllowFileAccess(false);
- webViewSettings.setAllowContentAccess(false);
-
- Uri path = mAssetLoader.getAssetsHttpsPrefix().buildUpon()
- .appendPath("www")
- .appendPath("ajax_requests.html").build();
- // Load the url http(s)://example.com/androidx_webkit/example/assets/www/ajax_requests.html
- mWebView.loadUrl(path.toString());
- }
-}
diff --git a/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/AssetLoaderListActivity.java b/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/AssetLoaderListActivity.java
deleted file mode 100644
index 24628b15..0000000
--- a/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/AssetLoaderListActivity.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.webkit;
-
-import android.app.Activity;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Bundle;
-import android.widget.ListView;
-
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
-
-/**
- * An {@link Activity} for exercising various WebView functionality. This Activity is a {@link
- * ListView} which starts other Activities, each of which may similarly be a ListView, or may
- * actually exercise specific {@link android.webkit.WebView} features.
- */
-public class AssetLoaderListActivity extends AppCompatActivity {
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.activity_asset_loader_list);
- setTitle(R.string.asset_loader_list_activity_title);
- WebkitHelpers.appendWebViewVersionToTitle(this);
-
- final Context activityContext = this;
- MenuListView listView = findViewById(R.id.asset_loader_list);
- MenuListView.MenuItem[] menuItems = new MenuListView.MenuItem[] {
- new MenuListView.MenuItem(
- getResources().getString(R.string.asset_loader_simple_activity_title),
- new Intent(activityContext, AssetLoaderSimpleActivity.class)),
- new MenuListView.MenuItem(
- getResources().getString(R.string.asset_loader_ajax_activity_title),
- new Intent(activityContext, AssetLoaderAjaxActivity.class)),
- };
- listView.setItems(menuItems);
- }
-}
diff --git a/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/AssetLoaderSimpleActivity.java b/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/AssetLoaderSimpleActivity.java
deleted file mode 100644
index 367b2e8..0000000
--- a/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/AssetLoaderSimpleActivity.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.webkit;
-
-import android.app.Activity;
-import android.net.Uri;
-import android.os.Bundle;
-import android.webkit.WebResourceRequest;
-import android.webkit.WebResourceResponse;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.webkit.WebViewAssetLoader;
-
-/**
- * An {@link Activity} to show case a very simple use case of using
- * {@link androidx.webkit.WebViewAssetLoader}.
- */
-public class AssetLoaderSimpleActivity extends AppCompatActivity {
-
- private class MyWebViewClient extends WebViewClient {
- @Override
- public boolean shouldOverrideUrlLoading(WebView view, String url) {
- return false;
- }
-
- @Override
- @RequiresApi(21)
- public WebResourceResponse shouldInterceptRequest(WebView view,
- WebResourceRequest request) {
- return mAssetLoader.shouldInterceptRequest(request);
- }
-
- @Override
- public WebResourceResponse shouldInterceptRequest(WebView view, String request) {
- return mAssetLoader.shouldInterceptRequest(request);
- }
- }
-
- private WebViewAssetLoader mAssetLoader;
- private WebView mWebView;
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.activity_asset_loader);
- setTitle(R.string.asset_loader_simple_activity_title);
- WebkitHelpers.appendWebViewVersionToTitle(this);
-
- mAssetLoader = (new WebViewAssetLoader.Builder(this)).build();
- mWebView = findViewById(R.id.webview_asset_loader_webview);
- mWebView.setWebViewClient(new MyWebViewClient());
-
- // Host application assets under http://appassets.androidplatform.net/assets/...
- Uri path = mAssetLoader.getAssetsHttpsPrefix().buildUpon()
- .appendPath("www")
- .appendPath("some_text.html").build();
-
- mWebView.loadUrl(path.toString());
- }
-}
diff --git a/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/MainActivity.java b/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/MainActivity.java
index 11e3b03..f0b5889 100644
--- a/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/MainActivity.java
+++ b/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/MainActivity.java
@@ -45,12 +45,6 @@
new MenuListView.MenuItem(
getResources().getString(R.string.safebrowsing_activity_title),
new Intent(activityContext, SafeBrowsingActivity.class)),
- new MenuListView.MenuItem(
- getResources().getString(R.string.proxy_override_activity_title),
- new Intent(activityContext, ProxyOverrideActivity.class)),
- new MenuListView.MenuItem(
- getResources().getString(R.string.asset_loader_list_activity_title),
- new Intent(activityContext, AssetLoaderListActivity.class)),
};
listView.setItems(menuItems);
}
diff --git a/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/Proxy.java b/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/Proxy.java
deleted file mode 100644
index 5bce9f3..0000000
--- a/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/Proxy.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.webkit;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Simple proxy that accepts requests.
- */
-public class Proxy {
-
- /**
- * This interface offers a callback that is run when this proxy serves a request.
- */
- public interface ProxyRequestCallback {
-
- /**
- * Called when this proxy serves a request.
- */
- void onProxyRequestServed();
- }
-
- private static final int TIMEOUT_MILLIS = 5000;
- private boolean mRunning = false;
- private ProxyRequestCallback mCallback;
- private ServerSocket mServerSocket;
- private List<Thread> mThreadsList;
- private int mRequestCount;
-
- /**
- * Create a proxy using provided port number.
- *
- * @param port port number
- * @param callback callback run when this proxy serves a request
- */
- public Proxy(int port, ProxyRequestCallback callback) {
- mRequestCount = 0;
- mCallback = callback;
- mThreadsList = new ArrayList<>();
- try {
- mServerSocket = new ServerSocket(port);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Create a proxy using provided port number.
- *
- * @param port port number
- */
- public Proxy(int port) {
- this (port, null);
- }
-
- /**
- * Create a proxy using an available port.
- */
- public Proxy() {
- this(0, null);
- }
-
- /**
- * Get port number.
- */
- public int getPort() {
- return mServerSocket.getLocalPort();
- }
-
- /**
- * Get the number of requests this proxy has served.
- */
- public int getRequestCount() {
- return mRequestCount;
- }
-
- /**
- * Start listening for requests.
- */
- public void start() {
- if (mRunning) return;
- mRunning = true;
- new Thread(() -> {
- while (mRunning) {
- listen();
- }
- }).start();
- }
-
- private void listen() {
- try {
- Socket socket = mServerSocket.accept();
- mRequestCount++;
- if (mCallback != null) {
- mCallback.onProxyRequestServed();
- }
- Thread thread = new Thread(new RequestHandler(socket));
- mThreadsList.add(thread);
- thread.start();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Shutdown.
- */
- public void shutdown() {
- if (!mRunning) return;
- mRunning = false;
- for (Thread thread : mThreadsList) {
- if (thread.isAlive()) {
- try {
- thread.join(TIMEOUT_MILLIS);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
- mThreadsList.clear();
- try {
- mServerSocket.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- private static class RequestHandler implements Runnable {
- private Socket mSocket;
- private BufferedReader mReader;
- private BufferedWriter mWriter;
-
- RequestHandler(Socket socket) {
- mSocket = socket;
- try {
- mSocket.setSoTimeout(TIMEOUT_MILLIS);
- mReader = new BufferedReader(new InputStreamReader(mSocket.getInputStream()));
- mWriter = new BufferedWriter(new OutputStreamWriter(mSocket.getOutputStream()));
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- public void run() {
- try {
- StringBuilder sb = new StringBuilder();
- String s = mReader.readLine();
- while (s != null && !s.trim().isEmpty()) {
- sb.append(s);
- sb.append(" ");
- s = mReader.readLine();
- }
- String request = sb.toString();
- mWriter.write("HTTP/1.0 200 OK\nUser-Agent: Proxy\n\r\n");
- mWriter.write("<html><head><title>Proxy</title></head>"
- + "<body>Proxy handled this request:<br><br>"
- + request + "</body></html>");
- mWriter.flush();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-}
diff --git a/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/ProxyOverrideActivity.java b/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/ProxyOverrideActivity.java
deleted file mode 100644
index 88d4368..0000000
--- a/webkit/integration-tests/testapp/src/main/java/com/example/androidx/webkit/ProxyOverrideActivity.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright 2019 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 com.example.androidx.webkit;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputMethodManager;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-import android.widget.EditText;
-import android.widget.TextView;
-
-import androidx.annotation.Nullable;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.webkit.ProxyConfig;
-import androidx.webkit.ProxyController;
-import androidx.webkit.WebViewFeature;
-
-/**
- * An {@link Activity} to exercise Proxy Override functionality.
- */
-public class ProxyOverrideActivity extends AppCompatActivity {
- private Proxy mProxy;
- private WebView mWebView;
- private TextView mRequestCountTextView;
- private EditText mNavigationBar;
- private InputMethodManager mInputMethodManager;
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_proxy_override);
- setTitle(R.string.proxy_override_activity_title);
- WebkitHelpers.appendWebViewVersionToTitle(this);
-
- // Initialize proxy server
- // Skip this step if you already have a proxy url
- mProxy = new Proxy(0, () -> mRequestCountTextView.setText(getResources().getString(
- R.string.proxy_override_requests_served, mProxy.getRequestCount()))
- );
- mProxy.start();
-
- // Initialize views
- mRequestCountTextView = findViewById(R.id.proxy_override_textview);
- mRequestCountTextView.setText(getResources().getString(
- R.string.proxy_override_requests_served, 0));
- mWebView = findViewById(R.id.proxy_override_webview);
- mWebView.setWebViewClient(new WebViewClient());
- mInputMethodManager = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE);
- mNavigationBar = findViewById(R.id.proxy_override_edittext);
- mNavigationBar.setOnEditorActionListener((TextView v, int actionId, KeyEvent event) -> {
- // Listen to actions in the navigation bar (i.e. tapping enter on the soft keyboard)
- if (actionId == EditorInfo.IME_ACTION_NEXT) {
- // If action equals to IME_ACTION_NEXT, get the typed url, clear the navigation bar
- // and return true
- String url = mNavigationBar.getText().toString();
- if (!url.isEmpty()) {
- // If the retrieved url is not empty, call WebView.loadUrl passing it
- if (!url.startsWith("http")) url = "http://" + url;
- mWebView.loadUrl(url);
- mNavigationBar.setText("");
- }
- mInputMethodManager.hideSoftInputFromWindow(mNavigationBar.getWindowToken(), 0);
- mWebView.requestFocus();
- return true;
- }
- return false;
- });
-
- // Check for proxy override feature
- if (!WebViewFeature.isFeatureSupported(WebViewFeature.PROXY_OVERRIDE)) {
- // If feature is not supported, just show a warning in the webview
- mRequestCountTextView.setVisibility(View.GONE);
- mNavigationBar.setVisibility(View.GONE);
- mWebView.loadData("<html><body>Proxy override not available</body></html>",
- "text/html", null);
- return;
- }
-
- // Set proxy override
- // Use your proxy url here
- setProxyOverride("localhost:" + mProxy.getPort());
- }
-
- private void setProxyOverride(String proxyUrl) {
- ProxyController proxyController = ProxyController.getInstance();
- ProxyConfig proxyConfig = new ProxyConfig.Builder().addProxyRule(proxyUrl).build();
- proxyController.setProxyOverride(proxyConfig, () -> onProxyOverrideComplete());
- }
-
- private void onProxyOverrideComplete() {
- // Your code goes here, after the proxy override callback was executed
- mWebView.loadUrl("http://www.google.com");
- }
-
- @Override
- protected void onDestroy() {
- mProxy.shutdown();
- super.onDestroy();
- }
-}
diff --git a/webkit/integration-tests/testapp/src/main/res/layout/activity_asset_loader.xml b/webkit/integration-tests/testapp/src/main/res/layout/activity_asset_loader.xml
deleted file mode 100644
index 46ffcc9..0000000
--- a/webkit/integration-tests/testapp/src/main/res/layout/activity_asset_loader.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 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.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/activity_webview_asset_loader"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <WebView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/webview_asset_loader_webview"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
-
-</LinearLayout>
diff --git a/webkit/integration-tests/testapp/src/main/res/layout/activity_asset_loader_list.xml b/webkit/integration-tests/testapp/src/main/res/layout/activity_asset_loader_list.xml
deleted file mode 100644
index 5cca766..0000000
--- a/webkit/integration-tests/testapp/src/main/res/layout/activity_asset_loader_list.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 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.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/activity_asset_loader_list"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <com.example.androidx.webkit.MenuListView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/asset_loader_list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
-
-</LinearLayout>
diff --git a/webkit/integration-tests/testapp/src/main/res/layout/activity_proxy_override.xml b/webkit/integration-tests/testapp/src/main/res/layout/activity_proxy_override.xml
deleted file mode 100644
index 871da6c..0000000
--- a/webkit/integration-tests/testapp/src/main/res/layout/activity_proxy_override.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2019 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.
--->
-
-<RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context=".ProxyOverrideActivity">
-
- <TextView
- android:id="@+id/proxy_override_textview"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="22sp"
- android:layout_marginTop="12dp"
- android:layout_marginLeft="8dp"
- android:layout_marginRight="8dp"/>
-
- <EditText
- android:id="@+id/proxy_override_edittext"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/proxy_override_textview"
- android:layout_marginLeft="6dp"
- android:layout_marginRight="6dp"
- android:maxLines="1"
- android:inputType="textUri"
- android:hint="Type an URL here"/>
-
- <WebView
- android:id="@+id/proxy_override_webview"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_below="@id/proxy_override_edittext" />
-
-</RelativeLayout>
diff --git a/webkit/integration-tests/testapp/src/main/res/raw/some_text.html b/webkit/integration-tests/testapp/src/main/res/raw/some_text.html
deleted file mode 100644
index 502e241..0000000
--- a/webkit/integration-tests/testapp/src/main/res/raw/some_text.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!-- Copyright (C) 2019 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.
--->
-<h3>Successfully loaded html from resources!</h3>
diff --git a/webkit/integration-tests/testapp/src/main/res/values/strings.xml b/webkit/integration-tests/testapp/src/main/res/values/strings.xml
index 5a4fc1e..4edfbcf 100644
--- a/webkit/integration-tests/testapp/src/main/res/values/strings.xml
+++ b/webkit/integration-tests/testapp/src/main/res/values/strings.xml
@@ -17,10 +17,5 @@
<resources>
<string name="main_activity_title">WebView AndroidX Demos</string>
<string name="safebrowsing_activity_title">Safe Browsing</string>
- <string name="proxy_override_activity_title">Proxy Override</string>
<string name="not_updateable_webview">not updatable</string>
- <string name="proxy_override_requests_served">Requests served: %d</string>
- <string name="asset_loader_ajax_activity_title">Asset Loader AJAX Demo</string>
- <string name="asset_loader_list_activity_title">WebView Asset Loader Demos</string>
- <string name="asset_loader_simple_activity_title">Simple Asset Loader</string>
</resources>
diff --git a/webkit/src/androidTest/AndroidManifest.xml b/webkit/src/androidTest/AndroidManifest.xml
index 74a2360..1fc88bf 100644
--- a/webkit/src/androidTest/AndroidManifest.xml
+++ b/webkit/src/androidTest/AndroidManifest.xml
@@ -23,12 +23,5 @@
<!-- Note: we must specify this because our local server uses
http://localhost URLs (and P defaults to blocking cleartext traffic).
-->
-
- <application android:label="WebViewAssetLoaderTestIntegrationTest"
- android:hardwareAccelerated="true"
- android:usesCleartextTraffic="true">
-
- <!-- Top-level Activity -->
- <activity android:name=".WebViewAssetLoaderIntegrationTest$TestActivity"/>
- </application>
+ <application android:usesCleartextTraffic="true" />
</manifest>
diff --git a/webkit/src/androidTest/assets/www/test_with_title.html b/webkit/src/androidTest/assets/www/test_with_title.html
deleted file mode 100644
index 2bd9157..0000000
--- a/webkit/src/androidTest/assets/www/test_with_title.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--
-Copyright 2019 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.
--->
-<head>
- <title>WebViewAssetLoaderTest</title>
-</head>
-
-<body>
- <div>test</div>
-</body>
diff --git a/webkit/src/androidTest/java/androidx/webkit/BoundaryInterfaceTest.java b/webkit/src/androidTest/java/androidx/webkit/BoundaryInterfaceTest.java
index 9cb8180..b30695b 100644
--- a/webkit/src/androidTest/java/androidx/webkit/BoundaryInterfaceTest.java
+++ b/webkit/src/androidTest/java/androidx/webkit/BoundaryInterfaceTest.java
@@ -17,7 +17,7 @@
package androidx.webkit;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.webkit.internal.WebViewFeatureInternal;
import androidx.webkit.internal.WebViewGlueCommunicator;
import androidx.webkit.internal.WebkitToCompatConverter;
@@ -39,7 +39,7 @@
* that proxy will need to look up all the classes referenced from
* {@link org.chromium.support_lib_boundary.WebkitToCompatConverterBoundaryInterface}.
*/
- @MediumTest
+ @SmallTest
@Test
public void testCreateWebkitToCompatConverter() {
// Use the SERVICE_WORKER_BASIC_USAGE feature as a proxy for knowing whether the current
diff --git a/webkit/src/androidTest/java/androidx/webkit/PostMessageTest.java b/webkit/src/androidTest/java/androidx/webkit/PostMessageTest.java
index 586f7fe..c4ce821 100644
--- a/webkit/src/androidTest/java/androidx/webkit/PostMessageTest.java
+++ b/webkit/src/androidTest/java/androidx/webkit/PostMessageTest.java
@@ -25,7 +25,8 @@
import androidx.annotation.NonNull;
import androidx.concurrent.futures.ResolvableFuture;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
+import androidx.test.platform.app.InstrumentationRegistry;
import androidx.webkit.WebMessagePortCompat.WebMessageCallbackCompat;
import junit.framework.Assert;
@@ -38,7 +39,7 @@
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class PostMessageTest {
public static final long TIMEOUT = 6000L;
diff --git a/webkit/src/androidTest/java/androidx/webkit/ProxyControllerTest.java b/webkit/src/androidTest/java/androidx/webkit/ProxyControllerTest.java
index 841a555..1bc2b86 100644
--- a/webkit/src/androidTest/java/androidx/webkit/ProxyControllerTest.java
+++ b/webkit/src/androidTest/java/androidx/webkit/ProxyControllerTest.java
@@ -43,8 +43,6 @@
@Before
public void setUp() throws IOException {
- WebkitUtils.checkFeature(WebViewFeature.PROXY_OVERRIDE);
-
mWebViewOnUiThread = new androidx.webkit.WebViewOnUiThread();
mContentServer = new MockWebServer();
mProxyServer = new MockWebServer();
@@ -54,8 +52,6 @@
@After
public void tearDown() throws Exception {
- if (!WebViewFeature.isFeatureSupported(WebViewFeature.PROXY_OVERRIDE)) return;
-
clearProxyOverrideSync();
if (mWebViewOnUiThread != null) {
mWebViewOnUiThread.cleanUp();
@@ -75,6 +71,8 @@
*/
@Test
public void testCallbacks() throws Exception {
+ WebkitUtils.checkFeature(WebViewFeature.PROXY_OVERRIDE);
+
// Test setProxyOverride's callback
setProxyOverrideSync(new ProxyConfig.Builder().build());
// Test clearProxyOverride's callback with a proxy override setting
@@ -89,6 +87,8 @@
*/
@Test
public void testProxyOverride() throws Exception {
+ WebkitUtils.checkFeature(WebViewFeature.PROXY_OVERRIDE);
+
final String contentUrl = mContentServer.url("/").toString();
final String proxyUrl = mProxyServer.getHostName() + ":" + mProxyServer.getPort();
@@ -124,6 +124,8 @@
*/
@Test
public void testProxyOverrideLocalhost() throws Exception {
+ WebkitUtils.checkFeature(WebViewFeature.PROXY_OVERRIDE);
+
final String contentUrl = mContentServer.url("/").toString();
int proxyServerRequestCount = mProxyServer.getRequestCount();
@@ -145,6 +147,7 @@
*/
@Test
public void testValidInput() throws Exception {
+ WebkitUtils.checkFeature(WebViewFeature.PROXY_OVERRIDE);
ProxyConfig validRules = new ProxyConfig.Builder()
.addProxyRule("direct://")
.addProxyRule("www.example.com")
@@ -174,6 +177,7 @@
*/
@Test
public void testInvalidProxyUrls() throws Exception {
+ WebkitUtils.checkFeature(WebViewFeature.PROXY_OVERRIDE);
String[] invalidProxyUrls = {
null,
"", // empty
@@ -202,6 +206,7 @@
*/
@Test
public void testInvalidBypassRules() throws Exception {
+ WebkitUtils.checkFeature(WebViewFeature.PROXY_OVERRIDE);
String[] invalidBypassRules = {
null,
"", // empty
diff --git a/webkit/src/androidTest/java/androidx/webkit/ServiceWorkerWebSettingsCompatTest.java b/webkit/src/androidTest/java/androidx/webkit/ServiceWorkerWebSettingsCompatTest.java
index e23b116..082a112 100644
--- a/webkit/src/androidTest/java/androidx/webkit/ServiceWorkerWebSettingsCompatTest.java
+++ b/webkit/src/androidTest/java/androidx/webkit/ServiceWorkerWebSettingsCompatTest.java
@@ -19,14 +19,14 @@
import android.webkit.WebSettings;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class ServiceWorkerWebSettingsCompatTest {
private ServiceWorkerWebSettingsCompat mSettings;
diff --git a/webkit/src/androidTest/java/androidx/webkit/TracingControllerTest.java b/webkit/src/androidTest/java/androidx/webkit/TracingControllerTest.java
index adc5c3a..4785c97 100644
--- a/webkit/src/androidTest/java/androidx/webkit/TracingControllerTest.java
+++ b/webkit/src/androidTest/java/androidx/webkit/TracingControllerTest.java
@@ -17,7 +17,8 @@
package androidx.webkit;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
+import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.After;
import org.junit.Assert;
@@ -38,7 +39,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
-@LargeTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class TracingControllerTest {
private TracingController mTracingController;
diff --git a/webkit/src/androidTest/java/androidx/webkit/WebSettingsCompatTest.java b/webkit/src/androidTest/java/androidx/webkit/WebSettingsCompatTest.java
index 763bcb1..f64767f 100644
--- a/webkit/src/androidTest/java/androidx/webkit/WebSettingsCompatTest.java
+++ b/webkit/src/androidTest/java/androidx/webkit/WebSettingsCompatTest.java
@@ -23,14 +23,14 @@
import android.webkit.WebSettings;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
+import androidx.test.filters.MediumTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class WebSettingsCompatTest {
WebViewOnUiThread mWebViewOnUiThread;
diff --git a/webkit/src/androidTest/java/androidx/webkit/WebViewAssetLoaderIntegrationTest.java b/webkit/src/androidTest/java/androidx/webkit/WebViewAssetLoaderIntegrationTest.java
deleted file mode 100644
index e1fe81f..0000000
--- a/webkit/src/androidTest/java/androidx/webkit/WebViewAssetLoaderIntegrationTest.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright 2019 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.webkit;
-
-import android.app.Activity;
-import android.net.Uri;
-import android.os.Bundle;
-import android.webkit.WebResourceRequest;
-import android.webkit.WebResourceResponse;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import androidx.test.filters.MediumTest;
-import androidx.test.rule.ActivityTestRule;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.Callable;
-
-@RunWith(AndroidJUnit4.class)
-public class WebViewAssetLoaderIntegrationTest {
- private static final String TAG = "WebViewAssetLoaderIntegrationTest";
-
- @Rule
- public final ActivityTestRule<TestActivity> mActivityRule =
- new ActivityTestRule<>(TestActivity.class);
-
- // An Activity for Integeration tests
- public static class TestActivity extends Activity {
- private class MyWebViewClient extends WebViewClient {
- @Override
- public boolean shouldOverrideUrlLoading(WebView view, String url) {
- return false;
- }
-
- @Override
- public void onPageFinished(WebView view, String url) {
- mOnPageFinishedUrl.add(url);
- }
-
- @SuppressWarnings({"deprecated"})
- @Override
- public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
- return mAssetLoader.shouldInterceptRequest(url);
- }
-
- @Override
- public WebResourceResponse shouldInterceptRequest(WebView view,
- WebResourceRequest request) {
- return mAssetLoader.shouldInterceptRequest(request);
- }
- }
-
- private WebViewAssetLoader mAssetLoader;
- private WebView mWebView;
- private ArrayBlockingQueue<String> mOnPageFinishedUrl = new ArrayBlockingQueue<String>(5);
-
- public WebViewAssetLoader getAssetLoader() {
- return mAssetLoader;
-
- }
-
- public WebView getWebView() {
- return mWebView;
- }
-
- public ArrayBlockingQueue<String> getOnPageFinishedUrl() {
- return mOnPageFinishedUrl;
- }
-
- private void setUpWebView(WebView view) {
- view.setWebViewClient(new MyWebViewClient());
- }
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- mAssetLoader = (new WebViewAssetLoader.Builder(this)).build();
- mWebView = new WebView(this);
- setUpWebView(mWebView);
- setContentView(mWebView);
- }
-
- @Override
- protected void onDestroy() {
- super.onDestroy();
- mWebView.destroy();
- mWebView = null;
- }
- }
-
- @Test
- @MediumTest
- public void testAssetHosting() throws Exception {
- final TestActivity activity = mActivityRule.getActivity();
- final String test_with_title_path = "www/test_with_title.html";
-
- String url = WebkitUtils.onMainThreadSync(new Callable<String>() {
- @Override
- public String call() {
- WebViewAssetLoader assetLoader = activity.getAssetLoader();
- Uri.Builder testPath =
- assetLoader.getAssetsHttpsPrefix().buildUpon()
- .appendPath(test_with_title_path);
-
- String url = testPath.toString();
- activity.getWebView().loadUrl(url);
-
- return url;
- }
- });
-
- String onPageFinishedUrl = activity.getOnPageFinishedUrl().take();
- Assert.assertEquals(url, onPageFinishedUrl);
-
- String title = WebkitUtils.onMainThreadSync(new Callable<String>() {
- @Override
- public String call() {
- return activity.getWebView().getTitle();
- }
- });
- Assert.assertEquals("WebViewAssetLoaderTest", title);
- }
-
- @Test
- @MediumTest
- public void testResourcesHosting() throws Exception {
- final TestActivity activity = mActivityRule.getActivity();
- final String test_with_title_path = "test_with_title.html";
-
- String url = WebkitUtils.onMainThreadSync(new Callable<String>() {
- @Override
- public String call() {
- WebViewAssetLoader assetLoader = activity.getAssetLoader();
- Uri.Builder testPath =
- assetLoader.getResourcesHttpsPrefix().buildUpon()
- .appendPath("raw")
- .appendPath(test_with_title_path);
-
- String url = testPath.toString();
- activity.getWebView().loadUrl(url);
-
- return url;
- }
- });
-
- String onPageFinishedUrl = activity.getOnPageFinishedUrl().take();
- Assert.assertEquals(url, onPageFinishedUrl);
-
- String title = WebkitUtils.onMainThreadSync(new Callable<String>() {
- @Override
- public String call() {
- return activity.getWebView().getTitle();
- }
- });
- Assert.assertEquals("WebViewAssetLoaderTest", title);
- }
-}
diff --git a/webkit/src/androidTest/java/androidx/webkit/WebViewAssetLoaderTest.java b/webkit/src/androidTest/java/androidx/webkit/WebViewAssetLoaderTest.java
deleted file mode 100644
index ff62e4b..0000000
--- a/webkit/src/androidTest/java/androidx/webkit/WebViewAssetLoaderTest.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright 2019 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.webkit;
-
-import android.content.ContextWrapper;
-import android.net.Uri;
-import android.util.Log;
-import android.webkit.WebResourceResponse;
-
-import androidx.test.core.app.ApplicationProvider;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-import androidx.webkit.internal.AssetHelper;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-
-@RunWith(AndroidJUnit4.class)
-public class WebViewAssetLoaderTest {
- private static final String TAG = "WebViewAssetLoaderTest";
-
- private static String readAsString(InputStream is, String encoding) throws IOException {
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- byte[] buffer = new byte[512];
- int len = 0;
- while ((len = is.read(buffer)) != -1) {
- os.write(buffer, 0, len);
- }
- return new String(os.toByteArray(), encoding);
- }
-
- private static class MockAssetHelper extends AssetHelper {
- MockAssetHelper() {
- super(null);
- }
-
- @Override
- public InputStream openAsset(Uri uri) {
- return null;
- }
-
- @Override
- public InputStream openResource(Uri uri) {
- return null;
- }
- }
-
- private static class MockContext extends ContextWrapper {
- MockContext() {
- super(ApplicationProvider.getApplicationContext());
- }
- }
-
- @Test
- @SmallTest
- public void testCustomPathHandler() throws Throwable {
- final String contents = "Some content for testing\n";
- final String encoding = "utf-8";
-
- WebViewAssetLoader.PathHandler assetsHandler =
- new WebViewAssetLoader.PathHandler("appassets.androidplatform.net", "/notused/",
- true) {
- @Override
- public InputStream handle(Uri url) {
- return null;
- }
- };
-
- WebViewAssetLoader.PathHandler resourcesHandler =
- new WebViewAssetLoader.PathHandler("appassets.androidplatform.net", "/test/",
- true) {
- @Override
- public InputStream handle(Uri url) {
- try {
- return new ByteArrayInputStream(contents.getBytes(encoding));
- } catch (UnsupportedEncodingException e) {
- Log.e(TAG, "exception when creating response", e);
- }
- return null;
- }
- };
-
- WebViewAssetLoader assetLoader = (new WebViewAssetLoader.Builder(new MockContext()))
- .buildForTest(assetsHandler, resourcesHandler);
-
- WebResourceResponse response =
- assetLoader.shouldInterceptRequest("http://appassets.androidplatform.net/test/");
- Assert.assertNotNull(response);
-
- Assert.assertEquals(contents, readAsString(response.getData(), encoding));
- Assert.assertNull(assetLoader.shouldInterceptRequest("http://foo.bar/"));
- }
-
- @Test
- @SmallTest
- public void testHostAssets() throws Throwable {
- final String testHtmlContents = "<body><div>hah</div></body>";
-
- WebViewAssetLoader.Builder builder = new WebViewAssetLoader.Builder(new MockContext());
- WebViewAssetLoader assetLoader = builder.buildForTest(new MockAssetHelper() {
- @Override
- public InputStream openAsset(Uri url) {
- if (url.getPath().equals("www/test.html")) {
- try {
- return new ByteArrayInputStream(testHtmlContents.getBytes("utf-8"));
- } catch (IOException e) {
- Log.e(TAG, "Unable to open asset URL: " + url);
- return null;
- }
- }
- return null;
- }
- });
-
- Assert.assertNull(assetLoader.getAssetsHttpPrefix());
- Assert.assertEquals(assetLoader.getAssetsHttpsPrefix(),
- Uri.parse("https://appassets.androidplatform.net/assets/"));
-
- WebResourceResponse response =
- assetLoader.shouldInterceptRequest("https://appassets.androidplatform.net/assets/www/test.html");
- Assert.assertNotNull(response);
- Assert.assertEquals(testHtmlContents, readAsString(response.getData(), "utf-8"));
- }
-
- @Test
- @SmallTest
- public void testHostResources() throws Throwable {
- final String testHtmlContents = "<body><div>hah</div></body>";
-
- WebViewAssetLoader.Builder builder = new WebViewAssetLoader.Builder(new MockContext());
- WebViewAssetLoader assetLoader = builder.buildForTest(new MockAssetHelper() {
- @Override
- public InputStream openResource(Uri uri) {
- try {
- if (uri.getPath().equals("raw/test.html")) {
- return new ByteArrayInputStream(testHtmlContents.getBytes("utf-8"));
- }
- } catch (IOException e) {
- Log.e(TAG, "exception when creating response", e);
- }
- return null;
- }
- });
-
- Assert.assertNull(assetLoader.getResourcesHttpPrefix());
- Assert.assertEquals(assetLoader.getResourcesHttpsPrefix(), Uri.parse("https://appassets.androidplatform.net/res/"));
-
- WebResourceResponse response =
- assetLoader.shouldInterceptRequest("https://appassets.androidplatform.net/res/raw/test.html");
- Assert.assertNotNull(response);
- Assert.assertEquals(testHtmlContents, readAsString(response.getData(), "utf-8"));
- }
-
- @Test
- @SmallTest
- public void testHostAssetsOnCustomUri() throws Throwable {
- final String testHtmlContents = "<body><div>hah</div></body>";
-
- WebViewAssetLoader.Builder builder = new WebViewAssetLoader.Builder(new MockContext());
- builder.setDomain("example.com")
- .setAssetsHostingPath("/android_assets/")
- .allowHttp();
- WebViewAssetLoader assetLoader = builder.buildForTest(new MockAssetHelper() {
- @Override
- public InputStream openAsset(Uri url) {
- if (url.getPath().equals("www/test.html")) {
- try {
- return new ByteArrayInputStream(testHtmlContents.getBytes("utf-8"));
- } catch (IOException e) {
- Log.e(TAG, "Unable to open asset URL: " + url);
- return null;
- }
- }
- return null;
- }
- });
-
- Assert.assertEquals(assetLoader.getAssetsHttpPrefix(),
- Uri.parse("http://example.com/android_assets/"));
- Assert.assertEquals(assetLoader.getAssetsHttpsPrefix(),
- Uri.parse("https://example.com/android_assets/"));
-
- WebResourceResponse response =
- assetLoader.shouldInterceptRequest("http://example.com/android_assets/www/test.html");
- Assert.assertNotNull(response);
- Assert.assertEquals(testHtmlContents, readAsString(response.getData(), "utf-8"));
- }
-
- @Test
- @SmallTest
- public void testHostResourcesOnCustomUri() throws Throwable {
- final String testHtmlContents = "<body><div>hah</div></body>";
-
- WebViewAssetLoader.Builder builder = new WebViewAssetLoader.Builder(new MockContext());
- builder.setDomain("example.com")
- .setResourcesHostingPath("/android_res/")
- .allowHttp();
- WebViewAssetLoader assetLoader = builder.buildForTest(new MockAssetHelper() {
- @Override
- public InputStream openResource(Uri uri) {
- try {
- if (uri.getPath().equals("raw/test.html")) {
- return new ByteArrayInputStream(testHtmlContents.getBytes("utf-8"));
- }
- } catch (IOException e) {
- Log.e(TAG, "exception when creating response", e);
- }
- return null;
- }
- });
-
- Assert.assertEquals(assetLoader.getResourcesHttpPrefix(),
- Uri.parse("http://example.com/android_res/"));
- Assert.assertEquals(assetLoader.getResourcesHttpsPrefix(),
- Uri.parse("https://example.com/android_res/"));
-
- WebResourceResponse response =
- assetLoader.shouldInterceptRequest("http://example.com/android_res/raw/test.html");
- Assert.assertNotNull(response);
- Assert.assertEquals(testHtmlContents, readAsString(response.getData(), "utf-8"));
- }
-}
diff --git a/webkit/src/androidTest/java/androidx/webkit/WebViewClientCompatTest.java b/webkit/src/androidTest/java/androidx/webkit/WebViewClientCompatTest.java
index d48607b..01fba1b 100644
--- a/webkit/src/androidTest/java/androidx/webkit/WebViewClientCompatTest.java
+++ b/webkit/src/androidTest/java/androidx/webkit/WebViewClientCompatTest.java
@@ -27,7 +27,7 @@
import androidx.annotation.NonNull;
import androidx.concurrent.futures.ResolvableFuture;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
import org.junit.After;
@@ -48,7 +48,7 @@
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class WebViewClientCompatTest {
private WebViewOnUiThread mWebViewOnUiThread;
diff --git a/webkit/src/androidTest/java/androidx/webkit/WebViewOnUiThread.java b/webkit/src/androidTest/java/androidx/webkit/WebViewOnUiThread.java
index cdd8e27..5642e72 100644
--- a/webkit/src/androidTest/java/androidx/webkit/WebViewOnUiThread.java
+++ b/webkit/src/androidTest/java/androidx/webkit/WebViewOnUiThread.java
@@ -211,18 +211,18 @@
public static WebViewRendererClient getWebViewRendererClient(
final WebView webView) {
- return WebkitUtils.onMainThreadSync(new Callable<WebViewRendererClient>() {
+ return getValue(new ValueGetter<WebViewRendererClient>() {
@Override
- public WebViewRendererClient call() {
+ public WebViewRendererClient capture() {
return WebViewCompat.getWebViewRendererClient(webView);
}
});
}
public WebMessagePortCompat[] createWebMessageChannelCompat() {
- return WebkitUtils.onMainThreadSync(new Callable<WebMessagePortCompat[]>() {
+ return getValue(new ValueGetter<WebMessagePortCompat[]>() {
@Override
- public WebMessagePortCompat[] call() {
+ public WebMessagePortCompat[] capture() {
return WebViewCompat.createWebMessageChannel(mWebView);
}
});
@@ -325,27 +325,27 @@
}
public String getTitle() {
- return WebkitUtils.onMainThreadSync(new Callable<String>() {
+ return getValue(new ValueGetter<String>() {
@Override
- public String call() {
+ public String capture() {
return mWebView.getTitle();
}
});
}
public WebSettings getSettings() {
- return WebkitUtils.onMainThreadSync(new Callable<WebSettings>() {
+ return getValue(new ValueGetter<WebSettings>() {
@Override
- public WebSettings call() {
+ public WebSettings capture() {
return mWebView.getSettings();
}
});
}
public String getUrl() {
- return WebkitUtils.onMainThreadSync(new Callable<String>() {
+ return getValue(new ValueGetter<String>() {
@Override
- public String call() {
+ public String capture() {
return mWebView.getUrl();
}
});
@@ -375,9 +375,9 @@
}
public static WebViewClient getWebViewClient(final WebView webView) {
- return WebkitUtils.onMainThreadSync(new Callable<WebViewClient>() {
+ return getValue(new ValueGetter<WebViewClient>() {
@Override
- public WebViewClient call() {
+ public WebViewClient capture() {
return WebViewCompat.getWebViewClient(webView);
}
});
@@ -388,9 +388,9 @@
}
public static WebChromeClient getWebChromeClient(final WebView webView) {
- return WebkitUtils.onMainThreadSync(new Callable<WebChromeClient>() {
+ return getValue(new ValueGetter<WebChromeClient>() {
@Override
- public WebChromeClient call() {
+ public WebChromeClient capture() {
return WebViewCompat.getWebChromeClient(webView);
}
});
@@ -400,6 +400,26 @@
return mWebView;
}
+ private static <T> T getValue(ValueGetter<T> getter) {
+ WebkitUtils.onMainThreadSync(getter);
+ return getter.getValue();
+ }
+
+ private abstract static class ValueGetter<T> implements Runnable {
+ private T mValue;
+
+ @Override
+ public void run() {
+ mValue = capture();
+ }
+
+ protected abstract T capture();
+
+ public T getValue() {
+ return mValue;
+ }
+ }
+
/**
* Returns true if the current thread is the UI thread based on the
* Looper.
diff --git a/webkit/src/androidTest/java/androidx/webkit/WebViewRendererClientTest.java b/webkit/src/androidTest/java/androidx/webkit/WebViewRendererClientTest.java
index e6fdc76..b9dc9af 100644
--- a/webkit/src/androidTest/java/androidx/webkit/WebViewRendererClientTest.java
+++ b/webkit/src/androidTest/java/androidx/webkit/WebViewRendererClientTest.java
@@ -21,7 +21,8 @@
import android.webkit.WebView;
import androidx.concurrent.futures.ResolvableFuture;
-import androidx.test.filters.LargeTest;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.MediumTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.After;
@@ -34,7 +35,7 @@
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger;
-@LargeTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class WebViewRendererClientTest {
WebViewOnUiThread mWebViewOnUiThread;
@@ -85,10 +86,12 @@
}
private void blockRenderer(final JSBlocker blocker) {
- WebkitUtils.onMainThreadSync(new Runnable() {
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
@Override
public void run() {
WebView webView = mWebViewOnUiThread.getWebViewOnCurrentThread();
+ webView.getSettings().setJavaScriptEnabled(true);
+ webView.addJavascriptInterface(blocker, "blocker");
webView.evaluateJavascript("blocker.block();", null);
blocker.waitForBlocked();
// Sending an input event that does not get acknowledged will cause
@@ -99,17 +102,6 @@
});
}
- private void addJsBlockerInterface(final JSBlocker blocker) {
- WebkitUtils.onMainThreadSync(new Runnable() {
- @Override
- public void run() {
- WebView webView = mWebViewOnUiThread.getWebViewOnCurrentThread();
- webView.getSettings().setJavaScriptEnabled(true);
- webView.addJavascriptInterface(blocker, "blocker");
- }
- });
- }
-
private void testWebViewRendererClientOnExecutor(Executor executor) throws Throwable {
WebkitUtils.checkFeature(WebViewFeature.WEB_VIEW_RENDERER_CLIENT_BASIC_USAGE);
final JSBlocker blocker = new JSBlocker();
@@ -134,7 +126,6 @@
mWebViewOnUiThread.setWebViewRendererClient(executor, client);
}
- addJsBlockerInterface(blocker);
mWebViewOnUiThread.loadUrlAndWaitForCompletion("about:blank");
blockRenderer(blocker);
WebkitUtils.waitForFuture(rendererUnblocked);
diff --git a/webkit/src/androidTest/java/androidx/webkit/WebkitUtils.java b/webkit/src/androidTest/java/androidx/webkit/WebkitUtils.java
index 28d0633..e2ea1ed 100644
--- a/webkit/src/androidTest/java/androidx/webkit/WebkitUtils.java
+++ b/webkit/src/androidTest/java/androidx/webkit/WebkitUtils.java
@@ -86,8 +86,8 @@
}
/**
- * Executes a callable synchronously on the main thread, returning its result. This re-throws
- * any exceptions on the thread this is called from. This means callers may use {@link
+ * Executes a callable synchronously on the main thread, returning its result. This rethrows any
+ * exceptions on the thread this is called from. This means callers may use {@link
* org.junit.Assert} methods within the {@link Callable} if they invoke this method from the
* instrumentation thread.
*
@@ -151,40 +151,22 @@
}
/**
- * Waits for {@code future} and returns its value (or times out). If {@code future} has an
- * associated Exception, this will re-throw that Exception on the instrumentation thread
- * (wrapping with an unchecked Exception if necessary, to avoid requiring callers to declare
- * checked Exceptions).
- *
- * @param future the {@link Future} representing a value of interest.
- * @return the value {@code future} represents.
+ * Waits for {@code future} and returns its value (or times out).
*/
public static <T> T waitForFuture(Future<T> future) {
try {
return future.get(TEST_TIMEOUT_MS, TimeUnit.MILLISECONDS);
} catch (ExecutionException e) {
- // ExecutionException means this Future has an associated Exception that we should
- // re-throw on the current thread. We throw the cause instead of ExecutionException,
- // since ExecutionException itself isn't interesting, and might mislead those debugging
- // test failures to suspect this method is the culprit (whereas the root cause is from
- // another thread).
+ // Try to throw the cause itself, to avoid unnecessarily wrapping an unchecked
+ // throwable.
Throwable cause = e.getCause();
- // If the cause is an unchecked Throwable type, re-throw as-is.
if (cause instanceof Error) throw (Error) cause;
if (cause instanceof RuntimeException) throw (RuntimeException) cause;
- // Otherwise, wrap this in an unchecked Exception so callers don't need to declare
- // checked Exceptions.
throw new RuntimeException(cause);
} catch (InterruptedException | TimeoutException e) {
- // Don't call e.getCause() for either of these. Unlike ExecutionException, these don't
- // wrap the root cause, but rather are themselves interesting. Again, we wrap these
- // checked Exceptions with an unchecked Exception for the caller's convenience.
- //
- // Although we might be tempted to handle InterruptedException by calling
- // Thread.currentThread().interrupt(), this is not correct in this case. The interrupted
- // thread was likely a different thread than the current thread, so there's nothing
- // special we need to do.
- throw new RuntimeException(e);
+ // Don't handle InterruptedException specially, since it indicates that a different
+ // Thread was interrupted, not this one.
+ throw new RuntimeException(e.getCause());
}
}
@@ -207,7 +189,7 @@
} catch (TimeoutException | InterruptedException e) {
// Don't handle InterruptedException specially, since it indicates that a different
// Thread was interrupted, not this one.
- throw new RuntimeException(e);
+ throw new RuntimeException(e.getCause());
}
}
diff --git a/webkit/src/androidTest/java/androidx/webkit/internal/WebUriMatcherTest.java b/webkit/src/androidTest/java/androidx/webkit/internal/WebUriMatcherTest.java
new file mode 100644
index 0000000..78cd9e4
--- /dev/null
+++ b/webkit/src/androidTest/java/androidx/webkit/internal/WebUriMatcherTest.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2019 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.webkit.internal;
+
+import android.net.Uri;
+
+import androidx.test.filters.SmallTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+public class WebUriMatcherTest {
+
+ @Test
+ @SmallTest
+ public void testFullHttpUriMatching() {
+ final Object pathMatch = new Object();
+ WebUriMatcher<Object> matcher = new WebUriMatcher<>();
+ matcher.addUri("http", "androidplatform.net", "/some/path", pathMatch);
+
+ Assert.assertEquals("Failed to match the exact http path", pathMatch,
+ matcher.match(Uri.parse("http://androidplatform.net/some/path")));
+ Assert.assertEquals("Failed to match http path with query", pathMatch,
+ matcher.match(Uri.parse("http://androidplatform.net/some/path?asd")));
+ Assert.assertEquals("Failed to match http path with fragment", pathMatch,
+ matcher.match(Uri.parse("http://androidplatform.net/some/path#asd")));
+ Assert.assertEquals("Failed to match http path starts with a correct prefix", pathMatch,
+ matcher.match(Uri.parse("http://androidplatform.net/some/path/thing")));
+
+ Assert.assertNull("Incorrectly matched https path",
+ matcher.match(Uri.parse("https://androidplatform.net/some/path")));
+ Assert.assertNull("Incorrectly matched http path without a separating slash",
+ matcher.match(Uri.parse("http://androidplatform.net/somepath")));
+ Assert.assertNull("Incorrectly matched http .../some/path with .../some/paththing",
+ matcher.match(Uri.parse("http://androidplatform.net/some/paththing")));
+ Assert.assertNull("Incorrectly matched http with an empty path",
+ matcher.match(Uri.parse("http://androidplatform.net/")));
+ Assert.assertNull("Incorrectly matched http with a different prefix",
+ matcher.match(Uri.parse("http://androidplatform.net/another/some/path")));
+ }
+
+ @Test
+ @SmallTest
+ public void testFullHttpsUriMatching() {
+ final Object pathMatch = new Object();
+ WebUriMatcher<Object> matcher = new WebUriMatcher<>();
+ matcher.addUri("https", "androidplatform.net", "/some/path", pathMatch);
+
+ Assert.assertEquals("Failed to match the exact https path", pathMatch,
+ matcher.match(Uri.parse("https://androidplatform.net/some/path")));
+ Assert.assertEquals("Failed to match https path with query", pathMatch,
+ matcher.match(Uri.parse("https://androidplatform.net/some/path?asd")));
+ Assert.assertEquals("Failed to match https path with fragment", pathMatch,
+ matcher.match(Uri.parse("https://androidplatform.net/some/path#asd")));
+ Assert.assertEquals("Failed to match https path starts with a correct prefix", pathMatch,
+ matcher.match(Uri.parse("https://androidplatform.net/some/path/thing")));
+
+ Assert.assertNull("Incorrectly matched http path",
+ matcher.match(Uri.parse("http://androidplatform.net/some/path")));
+ Assert.assertNull("Incorrectly matched https path without a separating slash",
+ matcher.match(Uri.parse("https://androidplatform.net/somepath")));
+ Assert.assertNull("Incorrectly matched https .../some/path with .../some/paththing",
+ matcher.match(Uri.parse("https://androidplatform.net/some/paththing")));
+ Assert.assertNull("Incorrectly matched https with an empty path",
+ matcher.match(Uri.parse("https://androidplatform.net/")));
+ Assert.assertNull("Incorrectly matched https with a different prefix",
+ matcher.match(Uri.parse("https://androidplatform.net/another/some/path")));
+ }
+
+ @Test
+ @SmallTest
+ public void testHttpandHttpsUriMatching() {
+ final Object pathMatch = new Object();
+ WebUriMatcher<Object> matcher = new WebUriMatcher<>();
+ matcher.addUri("http", "androidplatform.net", "/some/path", pathMatch);
+ matcher.addUri("https", "androidplatform.net", "/some/path", pathMatch);
+
+ Assert.assertEquals("Failed to match the exact http path", pathMatch,
+ matcher.match(Uri.parse("http://androidplatform.net/some/path/")));
+ Assert.assertEquals("Failed to match the exact https path", pathMatch,
+ matcher.match(Uri.parse("https://androidplatform.net/some/path/")));
+ }
+
+ @Test
+ @SmallTest
+ public void testEmptyPathMatching() {
+ final Object pathMatch = new Object();
+ WebUriMatcher<Object> matcher = new WebUriMatcher<>();
+ matcher.addUri("http", "androidplatform.net", "/", pathMatch);
+
+ Assert.assertEquals("Failed to match the exact http path", pathMatch,
+ matcher.match(Uri.parse("http://androidplatform.net/")));
+ Assert.assertEquals("Failed to match the exact https path", pathMatch,
+ matcher.match(Uri.parse("http://androidplatform.net/some/path")));
+ Assert.assertEquals("Failed to match the exact http path", pathMatch,
+ matcher.match(Uri.parse("http://androidplatform.net/file.ext")));
+ Assert.assertEquals("Failed to match the exact https path", pathMatch,
+ matcher.match(Uri.parse("http://androidplatform.net/some/path/file.ext")));
+ }
+
+ @Test
+ @SmallTest
+ public void testManyUriMatchers() {
+ final Object pathMatch1 = new Object();
+ final Object pathMatch2 = new Object();
+ WebUriMatcher<Object> matcher = new WebUriMatcher<>();
+ matcher.addUri("http", "androidplatform.net", "/some/path_", pathMatch1);
+ matcher.addUri("http", "androidplatform.net", "/some/path_2", pathMatch2);
+
+ Assert.assertEquals("Failed to match the exact http .../some/path_", pathMatch1,
+ matcher.match(Uri.parse("http://androidplatform.net/some/path_")));
+ Assert.assertEquals("Failed to match the exact http .../some/path_2", pathMatch2,
+ matcher.match(Uri.parse("http://androidplatform.net/some/path_2")));
+ Assert.assertNull("Incorrectly matched a non registered path prefix .../some/path_1",
+ matcher.match(Uri.parse("http://androidplatform.net/some/path_1")));
+ }
+}
diff --git a/webkit/src/androidTest/res/raw/test_with_title.html b/webkit/src/androidTest/res/raw/test_with_title.html
deleted file mode 100644
index 2bd9157..0000000
--- a/webkit/src/androidTest/res/raw/test_with_title.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--
-Copyright 2019 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.
--->
-<head>
- <title>WebViewAssetLoaderTest</title>
-</head>
-
-<body>
- <div>test</div>
-</body>
diff --git a/webkit/src/main/java/androidx/webkit/ProxyConfig.java b/webkit/src/main/java/androidx/webkit/ProxyConfig.java
index 4f42391..3d09ffc 100644
--- a/webkit/src/main/java/androidx/webkit/ProxyConfig.java
+++ b/webkit/src/main/java/androidx/webkit/ProxyConfig.java
@@ -41,7 +41,7 @@
* TODO(laisminchillo): unhide this when we're ready to expose this
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class ProxyConfig {
/**
* Connect to URLs directly instead of using a proxy server.
@@ -60,7 +60,7 @@
*/
public static final String MATCH_ALL_SCHEMES = "*";
/** @hide */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@StringDef({HTTP, HTTPS, MATCH_ALL_SCHEMES})
public @interface ProxyScheme {}
private static final String BYPASS_RULE_LOCAL = "<local>";
@@ -72,7 +72,7 @@
/**
* @hide Internal use only
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public ProxyConfig(String[][] proxyRules, String[] bypassRules) {
mProxyRules = proxyRules;
mBypassRules = bypassRules;
@@ -81,7 +81,7 @@
/**
* @hide Internal use only
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@NonNull
public String[][] proxyRules() {
return mProxyRules;
@@ -90,7 +90,7 @@
/**
* @hide Internal use only
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@NonNull
public String[] bypassRules() {
return mBypassRules;
diff --git a/webkit/src/main/java/androidx/webkit/ProxyController.java b/webkit/src/main/java/androidx/webkit/ProxyController.java
index 14892fe..a7bb6a18 100644
--- a/webkit/src/main/java/androidx/webkit/ProxyController.java
+++ b/webkit/src/main/java/androidx/webkit/ProxyController.java
@@ -53,12 +53,12 @@
* TODO(laisminchillo): unhide this when we're ready to expose this
* @hide
*/
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public abstract class ProxyController {
/**
* @hide Don't allow apps to sub-class this class.
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public ProxyController() {}
/**
diff --git a/webkit/src/main/java/androidx/webkit/SafeBrowsingResponseCompat.java b/webkit/src/main/java/androidx/webkit/SafeBrowsingResponseCompat.java
index 61e760f..de191b8 100644
--- a/webkit/src/main/java/androidx/webkit/SafeBrowsingResponseCompat.java
+++ b/webkit/src/main/java/androidx/webkit/SafeBrowsingResponseCompat.java
@@ -71,7 +71,7 @@
* This class cannot be created by applications.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public SafeBrowsingResponseCompat() {
}
}
diff --git a/webkit/src/main/java/androidx/webkit/ServiceWorkerControllerCompat.java b/webkit/src/main/java/androidx/webkit/ServiceWorkerControllerCompat.java
index ed50725..c78d709 100644
--- a/webkit/src/main/java/androidx/webkit/ServiceWorkerControllerCompat.java
+++ b/webkit/src/main/java/androidx/webkit/ServiceWorkerControllerCompat.java
@@ -43,7 +43,7 @@
*
* @hide Don't allow apps to sub-class this class.
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public ServiceWorkerControllerCompat() {}
/**
diff --git a/webkit/src/main/java/androidx/webkit/ServiceWorkerWebSettingsCompat.java b/webkit/src/main/java/androidx/webkit/ServiceWorkerWebSettingsCompat.java
index 09e7bd2..63bbbb6 100644
--- a/webkit/src/main/java/androidx/webkit/ServiceWorkerWebSettingsCompat.java
+++ b/webkit/src/main/java/androidx/webkit/ServiceWorkerWebSettingsCompat.java
@@ -35,11 +35,11 @@
/**
* @hide Don't allow apps to sub-class this class.
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public ServiceWorkerWebSettingsCompat() {}
/** @hide */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@IntDef(value = {
WebSettings.LOAD_DEFAULT,
WebSettings.LOAD_CACHE_ELSE_NETWORK,
diff --git a/webkit/src/main/java/androidx/webkit/TracingConfig.java b/webkit/src/main/java/androidx/webkit/TracingConfig.java
index 0a22ae3..9b03ea0 100644
--- a/webkit/src/main/java/androidx/webkit/TracingConfig.java
+++ b/webkit/src/main/java/androidx/webkit/TracingConfig.java
@@ -35,7 +35,7 @@
*/
public class TracingConfig {
/** @hide */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@IntDef(flag = true, value = {CATEGORIES_NONE, CATEGORIES_ALL, CATEGORIES_ANDROID_WEBVIEW,
CATEGORIES_WEB_DEVELOPER, CATEGORIES_INPUT_LATENCY, CATEGORIES_RENDERING,
CATEGORIES_JAVASCRIPT_AND_RENDERING, CATEGORIES_FRAME_VIEWER})
@@ -97,7 +97,7 @@
android.webkit.TracingConfig.CATEGORIES_FRAME_VIEWER;
/** @hide */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@IntDef({RECORD_UNTIL_FULL, RECORD_CONTINUOUSLY})
@Retention(RetentionPolicy.SOURCE)
public @interface TracingMode {}
@@ -124,7 +124,7 @@
private @TracingMode int mTracingMode;
/** @hide */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public TracingConfig(@PredefinedCategories int predefinedCategories,
List<String> customIncludedCategories, @TracingMode int tracingMode) {
mPredefinedCategories = predefinedCategories;
diff --git a/webkit/src/main/java/androidx/webkit/TracingController.java b/webkit/src/main/java/androidx/webkit/TracingController.java
index 72dd984..f47b75f 100644
--- a/webkit/src/main/java/androidx/webkit/TracingController.java
+++ b/webkit/src/main/java/androidx/webkit/TracingController.java
@@ -52,7 +52,7 @@
*
* @hide Don't allow apps to sub-class this class.
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public TracingController() {}
/**
diff --git a/webkit/src/main/java/androidx/webkit/WebMessagePortCompat.java b/webkit/src/main/java/androidx/webkit/WebMessagePortCompat.java
index ee21b1e..c314a9b5 100644
--- a/webkit/src/main/java/androidx/webkit/WebMessagePortCompat.java
+++ b/webkit/src/main/java/androidx/webkit/WebMessagePortCompat.java
@@ -83,7 +83,7 @@
/**
* @hide disallow app devs to extend this class.
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public WebMessagePortCompat() { }
/**
@@ -152,7 +152,7 @@
* @hide
*/
@RequiresApi(23)
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public abstract WebMessagePort getFrameworkPort();
/**
@@ -161,7 +161,7 @@
* the WebView APK supports {@link WebMessagePortCompat}.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public abstract InvocationHandler getInvocationHandler();
}
diff --git a/webkit/src/main/java/androidx/webkit/WebResourceErrorCompat.java b/webkit/src/main/java/androidx/webkit/WebResourceErrorCompat.java
index 080f4f1..df9c857 100644
--- a/webkit/src/main/java/androidx/webkit/WebResourceErrorCompat.java
+++ b/webkit/src/main/java/androidx/webkit/WebResourceErrorCompat.java
@@ -32,7 +32,7 @@
*/
public abstract class WebResourceErrorCompat {
/** @hide */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@IntDef(value = {
WebViewClient.ERROR_UNKNOWN,
WebViewClient.ERROR_HOST_LOOKUP,
@@ -89,7 +89,7 @@
* This class cannot be created by applications.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public WebResourceErrorCompat() {
}
}
diff --git a/webkit/src/main/java/androidx/webkit/WebSettingsCompat.java b/webkit/src/main/java/androidx/webkit/WebSettingsCompat.java
index 59e2647..05a04c1 100644
--- a/webkit/src/main/java/androidx/webkit/WebSettingsCompat.java
+++ b/webkit/src/main/java/androidx/webkit/WebSettingsCompat.java
@@ -160,7 +160,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@IntDef(flag = true, value = {
WebSettings.MENU_ITEM_NONE,
WebSettings.MENU_ITEM_SHARE,
diff --git a/webkit/src/main/java/androidx/webkit/WebViewAssetLoader.java b/webkit/src/main/java/androidx/webkit/WebViewAssetLoader.java
deleted file mode 100644
index 96e1454..0000000
--- a/webkit/src/main/java/androidx/webkit/WebViewAssetLoader.java
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * Copyright 2019 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.webkit;
-
-import android.content.Context;
-import android.net.Uri;
-import android.util.Log;
-import android.webkit.WebResourceRequest;
-import android.webkit.WebResourceResponse;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
-import androidx.annotation.VisibleForTesting;
-import androidx.webkit.internal.AssetHelper;
-
-import java.io.InputStream;
-import java.net.URLConnection;
-
-/**
- * Helper class to enable accessing the application's static assets and resources under an
- * http(s):// URL to be loaded by {@link android.webkit.WebView} class.
- * Hosting assets and resources this way is desirable as it is compatible with the Same-Origin
- * policy.
- *
- * <p>
- * For more context about application's assets and resources and how to normally access them please
- * refer to <a href="https://developer.android.com/guide/topics/resources/providing-resources">
- * Android Developer Docs: App resources overview</a>.
- *
- * <p class='note'>
- * This class is expected to be used within
- * {@link android.webkit.WebViewClient#shouldInterceptRequest}, which is not invoked on the
- * application's main thread. Although instances are themselves thread-safe (and may be safely
- * constructed on the application's main thread), exercise caution when accessing private data or
- * the view system.
- *
- * <p>
- * Using http(s):// URLs to access local resources may conflict with a real website. This means
- * that local resources should only be hosted on domains your organization owns (at paths reserved
- * for this purpose) or the default domain Google has reserved for this:
- * {@code appassets.androidplatform.net}.
- *
- * <p>
- * A typical usage would be like:
- * <pre class="prettyprint">
- * WebViewAssetLoader.Builder assetLoaderBuilder = new WebViewAssetLoader.Builder(this);
- * final WebViewAssetLoader assetLoader = assetLoaderBuilder.build();
- * webView.setWebViewClient(new WebViewClient() {
- * @Override
- * public WebResourceResponse shouldInterceptRequest(WebView view,
- * WebResourceRequest request) {
- * return assetLoader.shouldInterceptRequest(request);
- * }
- * });
- * // Assets are hosted under http(s)://appassets.androidplatform.net/assets/... by default.
- * // If the application's assets are in the "main/assets" folder this will read the file
- * // from "main/assets/www/index.html" and load it as if it were hosted on:
- * // https://appassets.androidplatform.net/assets/www/index.html
- * webview.loadUrl(assetLoader.getAssetsHttpsPrefix().buildUpon()
- * .appendPath("www")
- * .appendPath("index.html")
- * .build().toString());
- *
- * </pre>
- */
-public class WebViewAssetLoader {
- private static final String TAG = "WebViewAssetLoader";
-
- /**
- * An unused domain reserved by Google for Android applications to intercept requests
- * for app assets.
- * <p>
- * It'll be used by default unless the user specified a different domain.
- */
- public static final String KNOWN_UNUSED_AUTHORITY = "appassets.androidplatform.net";
-
- private static final String HTTP_SCHEME = "http";
- private static final String HTTPS_SCHEME = "https";
-
- @NonNull private final PathHandler mAssetsHandler;
- @NonNull private final PathHandler mResourcesHandler;
-
- /**
- * A handler that produces responses for the registered paths.
- *
- * Matches URIs on the form: {@code "http(s)://authority/path/**"}, HTTPS is always enabled.
- *
- * <p>
- * Methods of this handler will be invoked on a background thread and care must be taken to
- * correctly synchronize access to any shared state.
- * <p>
- * On Android KitKat and above these methods may be called on more than one thread. This thread
- * may be different than the thread on which the shouldInterceptRequest method was invoked.
- * This means that on Android KitKat and above it is possible to block in this method without
- * blocking other resources from loading. The number of threads used to parallelize loading
- * is an internal implementation detail of the WebView and may change between updates which
- * means that the amount of time spent blocking in this method should be kept to an absolute
- * minimum.
- */
- @VisibleForTesting
- /*package*/ abstract static class PathHandler {
- final boolean mHttpEnabled;
- @NonNull final String mAuthority;
- @NonNull final String mPath;
-
- /**
- * @param authority the authority to match (For instance {@code "example.com"})
- * @param path the prefix path to match, it should start and end with a {@code "/"}.
- * @param httpEnabled enable hosting under the HTTP scheme, HTTPS is always enabled.
- */
- PathHandler(@NonNull final String authority, @NonNull final String path,
- boolean httpEnabled) {
- if (path.isEmpty() || path.charAt(0) != '/') {
- throw new IllegalArgumentException("Path should start with a slash '/'.");
- }
- if (!path.endsWith("/")) {
- throw new IllegalArgumentException("Path should end with a slash '/'");
- }
- this.mAuthority = authority;
- this.mPath = path;
- this.mHttpEnabled = httpEnabled;
- }
-
- /**
- * Open an {@link InputStream} for the requested URL.
- * <p>
- * This method should be called if {@code match(Uri)} returns true in order to
- * open the file requested by this URL.
- *
- * @param url path that has been matched.
- * @return {@link InputStream} for the requested URL, {@code null} if an error happens
- * while opening the file or file doesn't exist.
- */
- @Nullable
- public abstract InputStream handle(@NonNull Uri url);
-
- /**
- * Match against registered scheme, authority and path prefix.
- *
- * Match happens when:
- * <ul>
- * <li>Scheme is "https" <b>or</b> the scheme is "http" and http is enabled.</li>
- * <li>Authority exact matches the given URI's authority.</li>
- * <li>Path is a prefix of the given URI's path.</li>
- * </ul>
- *
- * @param uri the URI whose path we will match against.
- *
- * @return {@code true} if a match happens, {@code false} otherwise.
- */
- public boolean match(@NonNull Uri uri) {
- // Only match HTTP_SCHEME if caller enabled HTTP matches.
- if (uri.getScheme().equals(HTTP_SCHEME) && !mHttpEnabled) {
- return false;
- }
- // Don't match non-HTTP(S) schemes.
- if (!uri.getScheme().equals(HTTP_SCHEME) && !uri.getScheme().equals(HTTPS_SCHEME)) {
- return false;
- }
- if (!uri.getAuthority().equals(mAuthority)) {
- return false;
- }
- return uri.getPath().startsWith(mPath);
- }
- }
-
- static class AssetsPathHandler extends PathHandler {
- private AssetHelper mAssetHelper;
-
- AssetsPathHandler(@NonNull final String authority, @NonNull final String path,
- boolean httpEnabled, @NonNull AssetHelper assetHelper) {
- super(authority, path, httpEnabled);
- mAssetHelper = assetHelper;
- }
-
- @Override
- public InputStream handle(Uri url) {
- String path = url.getPath().replaceFirst(this.mPath, "");
- Uri.Builder assetUriBuilder = new Uri.Builder();
- assetUriBuilder.path(path);
- Uri assetUri = assetUriBuilder.build();
-
- return mAssetHelper.openAsset(assetUri);
- }
- }
-
- static class ResourcesPathHandler extends PathHandler {
- private AssetHelper mAssetHelper;
-
- ResourcesPathHandler(@NonNull final String authority, @NonNull final String path,
- boolean httpEnabled, @NonNull AssetHelper assetHelper) {
- super(authority, path, httpEnabled);
- mAssetHelper = assetHelper;
- }
-
- @Override
- public InputStream handle(Uri url) {
- String path = url.getPath().replaceFirst(this.mPath, "");
- Uri.Builder resourceUriBuilder = new Uri.Builder();
- resourceUriBuilder.path(path);
- Uri resourceUri = resourceUriBuilder.build();
-
- return mAssetHelper.openResource(resourceUri);
- }
- }
-
-
- /**
- * A builder class for constructing {@link WebViewAssetLoader} objects.
- */
- public static final class Builder {
- private final Context mContext;
-
- boolean mAllowHttp;
- @NonNull Uri mAssetsUri;
- @NonNull Uri mResourcesUri;
-
- /**
- * @param context {@link Context} used to resolve resources/assets.
- */
- public Builder(@NonNull Context context) {
- mContext = context;
- mAllowHttp = false;
- mAssetsUri = createUriPrefix(KNOWN_UNUSED_AUTHORITY, "/assets/");
- mResourcesUri = createUriPrefix(KNOWN_UNUSED_AUTHORITY, "/res/");
- }
-
- /**
- * Set the domain under which app assets and resources can be accessed.
- * The default domain is {@code "appassets.androidplatform.net"}
- *
- * @param domain the domain on which app assets should be hosted.
- * @return {@link Builder} object.
- */
- @NonNull
- public Builder setDomain(@NonNull String domain) {
- mAssetsUri = createUriPrefix(domain, mAssetsUri.getPath());
- mResourcesUri = createUriPrefix(domain, mResourcesUri.getPath());
- return this;
- }
-
- /**
- * Set the prefix path under which app assets should be hosted.
- * The default path for assets is {@code "/assets/"}. The path must start and end with
- * {@code "/"}.
- * <p>
- * A custom prefix path can be used in conjunction with a custom domain, to
- * avoid conflicts with real paths which may be hosted at that domain.
- *
- * @param path the path under which app assets should be hosted.
- * @return {@link Builder} object.
- * @throws IllegalArgumentException if the path is invalid.
- */
- @NonNull
- public Builder setAssetsHostingPath(@NonNull String path) {
- mAssetsUri = createUriPrefix(mAssetsUri.getAuthority(), path);
- return this;
- }
-
- /**
- * Set the prefix path under which app resources should be hosted.
- * The default path for resources is {@code "/res/"}. The path must start and end with
- * {@code "/"}. A custom prefix path can be used in conjunction with a custom domain, to
- * avoid conflicts with real paths which may be hosted at that domain.
- *
- * @param path the path under which app resources should be hosted.
- * @return {@link Builder} object.
- * @throws IllegalArgumentException if the path is invalid.
- */
- @NonNull
- public Builder setResourcesHostingPath(@NonNull String path) {
- mResourcesUri = createUriPrefix(mResourcesUri.getAuthority(), path);
- return this;
- }
-
- /**
- * Allow using the HTTP scheme in addition to HTTPS.
- * The default is to not allow HTTP.
- *
- * @return {@link Builder} object.
- */
- @NonNull
- public Builder allowHttp() {
- this.mAllowHttp = true;
- return this;
- }
-
- /**
- * Build and return a {@link WebViewAssetLoader} object.
- *
- * @return immutable {@link WebViewAssetLoader} object.
- */
- @NonNull
- public WebViewAssetLoader build() {
- AssetHelper assetHelper = new AssetHelper(mContext);
- PathHandler assetHandler = new AssetsPathHandler(mAssetsUri.getAuthority(),
- mAssetsUri.getPath(), mAllowHttp, assetHelper);
-
- PathHandler resourceHandler = new ResourcesPathHandler(mResourcesUri.getAuthority(),
- mResourcesUri.getPath(), mAllowHttp,
- assetHelper);
-
- return new WebViewAssetLoader(assetHandler, resourceHandler);
- }
-
- @VisibleForTesting
- @NonNull
- /*package*/ WebViewAssetLoader buildForTest(@NonNull AssetHelper assetHelper) {
- PathHandler assetHandler = new AssetsPathHandler(mAssetsUri.getAuthority(),
- mAssetsUri.getPath(), mAllowHttp, assetHelper);
-
- PathHandler resourceHandler = new ResourcesPathHandler(mResourcesUri.getAuthority(),
- mResourcesUri.getPath(), mAllowHttp,
- assetHelper);
-
- return new WebViewAssetLoader(assetHandler, resourceHandler);
- }
-
- @VisibleForTesting
- @NonNull
- /*package*/ WebViewAssetLoader buildForTest(@NonNull PathHandler assetHandler,
- @NonNull PathHandler resourceHandler) {
- return new WebViewAssetLoader(assetHandler, resourceHandler);
- }
-
- @NonNull
- private static Uri createUriPrefix(@NonNull String domain, @NonNull String virtualPath) {
- if (virtualPath.indexOf('*') != -1) {
- throw new IllegalArgumentException(
- "virtualPath cannot contain the '*' character.");
- }
- if (virtualPath.isEmpty() || virtualPath.charAt(0) != '/') {
- throw new IllegalArgumentException(
- "virtualPath should start with a slash '/'.");
- }
- if (!virtualPath.endsWith("/")) {
- throw new IllegalArgumentException(
- "virtualPath should end with a slash '/'.");
- }
-
- Uri.Builder uriBuilder = new Uri.Builder();
- uriBuilder.authority(domain);
- uriBuilder.path(virtualPath);
-
- return uriBuilder.build();
- }
- }
-
- /*package*/ WebViewAssetLoader(@NonNull PathHandler assetHandler,
- @NonNull PathHandler resourceHandler) {
- this.mAssetsHandler = assetHandler;
- this.mResourcesHandler = resourceHandler;
- }
-
- @Nullable
- private static Uri parseAndVerifyUrl(@Nullable String url) {
- if (url == null) {
- return null;
- }
- Uri uri = Uri.parse(url);
- if (uri == null) {
- Log.e(TAG, "Malformed URL: " + url);
- return null;
- }
- String path = uri.getPath();
- if (path == null || path.length() == 0) {
- Log.e(TAG, "URL does not have a path: " + url);
- return null;
- }
- return uri;
- }
-
- /**
- * Attempt to resolve the {@link WebResourceRequest} to an application resource or
- * asset, and return a {@link WebResourceResponse} for the content.
- * <p>
- * The prefix path used shouldn't be a prefix of a real web path. Thus, in case of having a URL
- * that matches a registered prefix path but the requested asset cannot be found or opened a
- * {@link WebResourceResponse} object with a {@code null} {@link InputStream} will be returned
- * instead of {@code null}. This saves the time of falling back to network and trying to
- * resolve a path that doesn't exist. A {@link WebResourceResponse} with {@code null}
- * {@link InputStream} will be received as an HTTP response with status code {@code 404} and
- * no body.
- * <p>
- * This method should be invoked from within
- * {@link android.webkit.WebViewClient#shouldInterceptRequest(android.webkit.WebView, WebResourceRequest)}.
- *
- * @param request the {@link WebResourceRequest} to process.
- * @return {@link WebResourceResponse} if the request URL matches a registered url,
- * {@code null} otherwise.
- */
- @RequiresApi(21)
- @Nullable
- public WebResourceResponse shouldInterceptRequest(@NonNull WebResourceRequest request) {
- return shouldInterceptRequestImpl(request.getUrl());
- }
-
- /**
- * Attempt to resolve the {@code url} to an application resource or asset, and return
- * a {@link WebResourceResponse} for the content.
- * <p>
- * The prefix path used shouldn't be a prefix of a real web path. Thus, in case of having a URL
- * that matches a registered prefix path but the requested asset cannot be found or opened a
- * {@link WebResourceResponse} object with a {@code null} {@link InputStream} will be returned
- * instead of {@code null}. This saves the time of falling back to network and trying to
- * resolve a path that doesn't exist. A {@link WebResourceResponse} with {@code null}
- * {@link InputStream} will be received as an HTTP response with status code {@code 404} and
- * no body.
- * <p>
- * This method should be invoked from within
- * {@link android.webkit.WebViewClient#shouldInterceptRequest(android.webkit.WebView, String)}.
- *
- * @param url the URL string to process.
- * @return {@link WebResourceResponse} if the request URL matches a registered URL,
- * {@code null} otherwise.
- */
- @Nullable
- public WebResourceResponse shouldInterceptRequest(@NonNull String url) {
- PathHandler handler = null;
- Uri uri = parseAndVerifyUrl(url);
- if (uri == null) {
- return null;
- }
- return shouldInterceptRequestImpl(uri);
- }
-
- @Nullable
- private WebResourceResponse shouldInterceptRequestImpl(@NonNull Uri url) {
- PathHandler handler;
- if (mAssetsHandler.match(url)) {
- handler = mAssetsHandler;
- } else if (mResourcesHandler.match(url)) {
- handler = mResourcesHandler;
- } else {
- return null;
- }
-
- InputStream is = handler.handle(url);
- String mimeType = URLConnection.guessContentTypeFromName(url.getPath());
-
- return new WebResourceResponse(mimeType, null, is);
- }
-
- /**
- * Get the HTTP URL prefix under which assets are hosted.
- * <p>
- * If HTTP is allowed, the prefix will be on the format:
- * {@code "http://<domain>/<prefix-path>/"}, for example:
- * {@code "http://appassets.androidplatform.net/assets/"}.
- *
- * @return the HTTP URL prefix under which assets are hosted, or {@code null} if HTTP is not
- * enabled.
- */
- @Nullable
- public Uri getAssetsHttpPrefix() {
- if (!mAssetsHandler.mHttpEnabled) {
- return null;
- }
-
- Uri.Builder uriBuilder = new Uri.Builder();
- uriBuilder.authority(mAssetsHandler.mAuthority);
- uriBuilder.path(mAssetsHandler.mPath);
- uriBuilder.scheme(HTTP_SCHEME);
-
- return uriBuilder.build();
- }
-
- /**
- * Get the HTTPS URL prefix under which assets are hosted.
- * <p>
- * The prefix will be on the format: {@code "https://<domain>/<prefix-path>/"}, if the default
- * values are used then it will be: {@code "https://appassets.androidplatform.net/assets/"}.
- *
- * @return the HTTPS URL prefix under which assets are hosted.
- */
- @NonNull
- public Uri getAssetsHttpsPrefix() {
- Uri.Builder uriBuilder = new Uri.Builder();
- uriBuilder.authority(mAssetsHandler.mAuthority);
- uriBuilder.path(mAssetsHandler.mPath);
- uriBuilder.scheme(HTTPS_SCHEME);
-
- return uriBuilder.build();
- }
-
- /**
- * Get the HTTP URL prefix under which resources are hosted.
- * <p>
- * If HTTP is allowed, the prefix will be on the format:
- * {@code "http://<domain>/<prefix-path>/"}, for example
- * {@code "http://appassets.androidplatform.net/res/"}.
- *
- * @return the HTTP URL prefix under which resources are hosted, or {@code null} if HTTP is not
- * enabled.
- */
- @Nullable
- public Uri getResourcesHttpPrefix() {
- if (!mResourcesHandler.mHttpEnabled) {
- return null;
- }
-
- Uri.Builder uriBuilder = new Uri.Builder();
- uriBuilder.authority(mResourcesHandler.mAuthority);
- uriBuilder.path(mResourcesHandler.mPath);
- uriBuilder.scheme(HTTP_SCHEME);
-
- return uriBuilder.build();
- }
-
- /**
- * Get the HTTPS URL prefix under which resources are hosted.
- * <p>
- * The prefix will be on the format: {@code "https://<domain>/<prefix-path>/"}, if the default
- * values are used then it will be: {@code "https://appassets.androidplatform.net/res/"}.
- *
- * @return the HTTPs URL prefix under which resources are hosted.
- */
- @NonNull
- public Uri getResourcesHttpsPrefix() {
- Uri.Builder uriBuilder = new Uri.Builder();
- uriBuilder.authority(mResourcesHandler.mAuthority);
- uriBuilder.path(mResourcesHandler.mPath);
- uriBuilder.scheme(HTTPS_SCHEME);
-
- return uriBuilder.build();
- }
-}
diff --git a/webkit/src/main/java/androidx/webkit/WebViewClientCompat.java b/webkit/src/main/java/androidx/webkit/WebViewClientCompat.java
index 689585b..e253a42 100644
--- a/webkit/src/main/java/androidx/webkit/WebViewClientCompat.java
+++ b/webkit/src/main/java/androidx/webkit/WebViewClientCompat.java
@@ -56,7 +56,7 @@
};
/** @hide */
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@IntDef(value = {
WebViewClient.SAFE_BROWSING_THREAT_UNKNOWN,
WebViewClient.SAFE_BROWSING_THREAT_MALWARE,
@@ -73,7 +73,7 @@
* @hide
*/
@Override
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public final String[] getSupportedFeatures() {
return sSupportedFeatures;
}
@@ -120,7 +120,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Override
@RequiresApi(21)
public final void onReceivedError(@NonNull WebView view, @NonNull WebResourceRequest request,
@@ -128,13 +128,14 @@
onReceivedError(view, request, new WebResourceErrorImpl(handler));
}
- // Invoked by chromium (in legacy, pre-67 WebView APKs) for the {@code onReceivedError} event on
- // {@link Build.VERSION_CODES.M} and above. This delegates the callback to the non-final method,
- // which the app may have overridden.
/**
* Applications are not meant to override this, and should instead override the non-final {@link
* #onReceivedError(WebView, WebResourceRequest, WebResourceErrorCompat)} method.
*/
+ // Invoked by chromium (in legacy, pre-67 WebView APKs) for the {@code onReceivedError} event on
+ // {@link Build.VERSION_CODES.M} and above. This delegates the callback to the non-final method,
+ // which the app may have overridden.
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Override
@RequiresApi(23)
public final void onReceivedError(@NonNull WebView view, @NonNull WebResourceRequest request,
@@ -202,7 +203,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Override
public final void onSafeBrowsingHit(@NonNull WebView view, @NonNull WebResourceRequest request,
@SafeBrowsingThreat int threatType,
@@ -210,13 +211,14 @@
onSafeBrowsingHit(view, request, threatType, new SafeBrowsingResponseImpl(handler));
}
- // Invoked by chromium (in legacy, pre-67 WebView APKs) for the {@code onSafeBrowsingHit} event
- // on {@link Build.VERSION_CODES.O_MR1} and above. This delegates the callback to the non-final
- // method, which the app may have overridden.
/**
* Applications are not meant to override this, and should instead override the non-final {@link
* #onSafeBrowsingHit(WebView, WebResourceRequest, int, SafeBrowsingResponseCompat)} method.
*/
+ // Invoked by chromium (in legacy, pre-67 WebView APKs) for the {@code onSafeBrowsingHit} event
+ // on {@link Build.VERSION_CODES.O_MR1} and above. This delegates the callback to the non-final
+ // method, which the app may have overridden.
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Override
@RequiresApi(27)
public final void onSafeBrowsingHit(@NonNull WebView view, @NonNull WebResourceRequest request,
diff --git a/webkit/src/main/java/androidx/webkit/WebViewFeature.java b/webkit/src/main/java/androidx/webkit/WebViewFeature.java
index 9fa1d36..ec5f77f 100644
--- a/webkit/src/main/java/androidx/webkit/WebViewFeature.java
+++ b/webkit/src/main/java/androidx/webkit/WebViewFeature.java
@@ -50,7 +50,7 @@
/**
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@StringDef(value = {
VISUAL_STATE_CALLBACK,
OFF_SCREEN_PRERASTER,
@@ -385,7 +385,7 @@
* TODO(laisminchillo): unhide this when we're ready to expose this
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public static final String PROXY_OVERRIDE = Features.PROXY_OVERRIDE;
/**
diff --git a/webkit/src/main/java/androidx/webkit/WebViewRenderer.java b/webkit/src/main/java/androidx/webkit/WebViewRenderer.java
index 6b5d264..70cff54 100644
--- a/webkit/src/main/java/androidx/webkit/WebViewRenderer.java
+++ b/webkit/src/main/java/androidx/webkit/WebViewRenderer.java
@@ -47,7 +47,7 @@
* This class cannot be created by applications.
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public WebViewRenderer() {
}
}
diff --git a/webkit/src/main/java/androidx/webkit/internal/WebUriMatcher.java b/webkit/src/main/java/androidx/webkit/internal/WebUriMatcher.java
new file mode 100644
index 0000000..a4b78e9
--- /dev/null
+++ b/webkit/src/main/java/androidx/webkit/internal/WebUriMatcher.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2019 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.webkit.internal;
+
+import android.net.Uri;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import java.util.ArrayList;
+
+/**
+ * Utility class to aid in matching URIs. Supports matching scheme, authority, and path prefix.
+ *
+ * @param <T> handler Class returned when a match occurs.
+ */
+public class WebUriMatcher<T> {
+ @NonNull private ArrayList<MatcherValues> mMatchers;
+
+ public WebUriMatcher() {
+ mMatchers = new ArrayList<>();
+ }
+
+ private class MatcherValues {
+ @NonNull final String mScheme;
+ @NonNull final String mAuthority;
+ @NonNull final String mPath;
+ @NonNull final T mHandler;
+
+ MatcherValues(@NonNull final String scheme, @NonNull final String authority,
+ @NonNull final String path, @NonNull final T handler) {
+ mScheme = scheme;
+ mAuthority = authority;
+ mPath = path;
+ mHandler = handler;
+ }
+ }
+
+ /**
+ * Add a URI to match, and the handler to return when this URI is
+ * matched. Matches URIs on the form: "scheme://authority/path/**"
+ *
+ * @param scheme the scheme (http/https) to match
+ * @param authority the authority to match (For example example.com)
+ * @param path the prefix path to match. Should start with a slash "/".
+ * @param handler the handler that is returned when a URI is matched
+ * against the given components.
+ */
+ @NonNull
+ public void addUri(@NonNull final String scheme, @NonNull final String authority,
+ @NonNull final String path, @NonNull final T handler) {
+ if (path.isEmpty()) {
+ throw new IllegalArgumentException("Path cannot be empty");
+ }
+ if (!path.startsWith("/")) {
+ throw new IllegalArgumentException("Path should always start with a slash \"/\"");
+ }
+ mMatchers.add(new MatcherValues(scheme, authority, path, handler));
+ }
+
+ /**
+ * Try to matches the URI against registered matchers. Match happens when:
+ * - Scheme exact matches the given URI's scheme.
+ * - Authority exact matches the given URI's authority.
+ * - Path is a prefix of the given URI's path.
+ * @param uri The URI whose path we will match against.
+ *
+ * @return The handler for the matched node (added using addUri),
+ * or {@code null} if there is no matched node.
+ */
+ @Nullable
+ public T match(@NonNull Uri uri) {
+ for (MatcherValues matcher : mMatchers) {
+ if (uri.getScheme().equals(matcher.mScheme)
+ && uri.getAuthority().equals(matcher.mAuthority)
+ && matchPath(matcher.mPath, uri.getPath())) {
+ return matcher.mHandler;
+ }
+ }
+
+ return null;
+ }
+
+ private static boolean matchPath(String prefix, String path) {
+ if (path.equals(prefix)) {
+ return true;
+ }
+ if (!prefix.endsWith("/")) {
+ prefix = prefix + "/";
+ }
+ return path.startsWith(prefix);
+ }
+}
diff --git a/webkit/src/main/java/androidx/webkit/internal/WebViewRendererClientAdapter.java b/webkit/src/main/java/androidx/webkit/internal/WebViewRendererClientAdapter.java
index d100de5..3537017 100644
--- a/webkit/src/main/java/androidx/webkit/internal/WebViewRendererClientAdapter.java
+++ b/webkit/src/main/java/androidx/webkit/internal/WebViewRendererClientAdapter.java
@@ -52,7 +52,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Override
public final String[] getSupportedFeatures() {
return sSupportedFeatures;
@@ -64,7 +64,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Override
public final void onRendererUnresponsive(
@NonNull final WebView view,
@@ -89,7 +89,7 @@
*
* @hide
*/
- @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX)
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@Override
public final void onRendererResponsive(
@NonNull final WebView view,
diff --git a/webkit/src/main/java/androidx/webkit/internal/package-info.java b/webkit/src/main/java/androidx/webkit/internal/package-info.java
index 14925653..66ab2d9 100644
--- a/webkit/src/main/java/androidx/webkit/internal/package-info.java
+++ b/webkit/src/main/java/androidx/webkit/internal/package-info.java
@@ -17,9 +17,9 @@
/**
* @hide
*/
-@RestrictTo(LIBRARY_GROUP_PREFIX)
+@RestrictTo(LIBRARY_GROUP)
package androidx.webkit.internal;
-import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;
+import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
import androidx.annotation.RestrictTo;
diff --git a/work/integration-tests/testapp/build.gradle b/work/integration-tests/testapp/build.gradle
index 02db71a..4d9a870 100644
--- a/work/integration-tests/testapp/build.gradle
+++ b/work/integration-tests/testapp/build.gradle
@@ -30,7 +30,6 @@
minifyEnabled = true
}
}
-
defaultConfig.vectorDrawables.useSupportLibrary = true
}
diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/MainActivity.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/MainActivity.java
index fa79f17..05f7332 100644
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/MainActivity.java
+++ b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/MainActivity.java
@@ -187,23 +187,6 @@
}
});
- findViewById(R.id.enqueue_periodic_work_flex).setOnClickListener(
- new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Data input = new Data.Builder()
- .putString(ToastWorker.ARG_MESSAGE, "Periodic work with Flex")
- .build();
- PeriodicWorkRequest request =
- new PeriodicWorkRequest.Builder(ToastWorker.class, 15,
- TimeUnit.MINUTES, 10,
- TimeUnit.MINUTES)
- .setInputData(input)
- .build();
- WorkManager.getInstance().enqueue(request);
- }
- });
-
findViewById(R.id.begin_unique_work_loop)
.setOnClickListener(new View.OnClickListener() {
@Override
@@ -296,15 +279,5 @@
}
});
- findViewById(R.id.run_retry_worker).setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- OneTimeWorkRequest request = new OneTimeWorkRequest.Builder(
- RetryWorker.class).build();
-
- WorkManager.getInstance().enqueueUniqueWork(RetryWorker.TAG, REPLACE, request);
- }
- });
-
}
}
diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/RetryWorker.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/RetryWorker.java
deleted file mode 100644
index 7d39c4b..0000000
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/RetryWorker.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2019 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.
- */
-
-/*
- * Copyright 2019 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.work.integration.testapp;
-
-import android.content.Context;
-import android.support.annotation.NonNull;
-import android.util.Log;
-
-import androidx.work.Worker;
-import androidx.work.WorkerParameters;
-
-/**
- * A {@link Worker} which always returns a {@link Result#retry()}.
- */
-public class RetryWorker extends Worker {
-
- /** The name of the unique work. */
- public static final String TAG = "RetryWorker";
-
- public RetryWorker(@NonNull Context context, @NonNull WorkerParameters parameters) {
- super(context, parameters);
- }
-
- @NonNull
- @Override
- public Result doWork() {
- Log.e(TAG, String.format("Requesting retry (%s)", getRunAttemptCount()));
- return Result.retry();
- }
-}
diff --git a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/ToastWorker.java b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/ToastWorker.java
index 2fada74..c35900d 100644
--- a/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/ToastWorker.java
+++ b/work/integration-tests/testapp/src/main/java/androidx/work/integration/testapp/ToastWorker.java
@@ -27,13 +27,10 @@
import androidx.work.Worker;
import androidx.work.WorkerParameters;
-import java.util.Date;
-
/**
* A {@link Worker} that shows a given Toast.
*/
public class ToastWorker extends Worker {
- private static final String TAG = "WM-ToastWorker";
static final String ARG_MESSAGE = "message";
/**
@@ -58,8 +55,6 @@
if (message == null) {
message = "completed!";
}
- final Date now = new Date(System.currentTimeMillis());
- Log.i(TAG, String.format("Run time [%s]: %s", message, now));
final String displayMessage = message;
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
diff --git a/work/integration-tests/testapp/src/main/res/layout/activity_main.xml b/work/integration-tests/testapp/src/main/res/layout/activity_main.xml
index 1da89a0..58306c9 100644
--- a/work/integration-tests/testapp/src/main/res/layout/activity_main.xml
+++ b/work/integration-tests/testapp/src/main/res/layout/activity_main.xml
@@ -127,14 +127,6 @@
android:id="@+id/enqueue_periodic_work"
android:layout_marginTop="12dp"/>
- <Button android:text="@string/enqueue_periodic_work_flex"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="16dp"
- android:layout_marginStart="16dp"
- android:id="@+id/enqueue_periodic_work_flex"
- android:layout_marginTop="12dp"/>
-
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -183,13 +175,5 @@
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"/>
- <Button android:text="@string/run_retry_worker"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/run_retry_worker"
- android:layout_marginTop="12dp"
- android:layout_marginLeft="16dp"
- android:layout_marginStart="16dp"/>
-
</LinearLayout>
</ScrollView>
diff --git a/work/integration-tests/testapp/src/main/res/values/strings.xml b/work/integration-tests/testapp/src/main/res/values/strings.xml
index e836218..b9f4b13 100644
--- a/work/integration-tests/testapp/src/main/res/values/strings.xml
+++ b/work/integration-tests/testapp/src/main/res/values/strings.xml
@@ -17,11 +17,9 @@
<resources>
<string name="analyze_holmes">Analyze Sherlock Holmes!</string>
<string name="enqueue_periodic_work">Enqueue Periodic Work</string>
- <string name="enqueue_periodic_work_flex">Enqueue Periodic Work (with Flex)</string>
<string name="loop_unique_work">Loop Unique Work</string>
<string name="enqueue_lots_of_work">Add Lots of Work</string>
<string name="exploding_work">Test Exploding Work</string>
<string name="replace_completed_work">Test Replacing Completed Work</string>
- <string name="run_retry_worker">Run Retry Worker</string>
<string name="keep">Use KEEP</string>
</resources>
\ No newline at end of file
diff --git a/work/workmanager-ktx/api/1.0.0-alpha10.txt b/work/workmanager-ktx/api/1.0.0-alpha10.txt
index 66f7172..0947101 100644
--- a/work/workmanager-ktx/api/1.0.0-alpha10.txt
+++ b/work/workmanager-ktx/api/1.0.0-alpha10.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public final class DataKt {
diff --git a/work/workmanager-ktx/api/1.0.0-alpha11.txt b/work/workmanager-ktx/api/1.0.0-alpha11.txt
index add24b2..0640e2d 100644
--- a/work/workmanager-ktx/api/1.0.0-alpha11.txt
+++ b/work/workmanager-ktx/api/1.0.0-alpha11.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class CoroutineWorker extends androidx.work.ListenableWorker {
diff --git a/work/workmanager-ktx/api/1.0.0-alpha12.txt b/work/workmanager-ktx/api/1.0.0-alpha12.txt
index 7dcf186..2a29a4d 100644
--- a/work/workmanager-ktx/api/1.0.0-alpha12.txt
+++ b/work/workmanager-ktx/api/1.0.0-alpha12.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class CoroutineWorker extends androidx.work.ListenableWorker {
diff --git a/work/workmanager-ktx/api/1.0.0-alpha13.txt b/work/workmanager-ktx/api/1.0.0-alpha13.txt
index 2bb4be9..81076cb 100644
--- a/work/workmanager-ktx/api/1.0.0-alpha13.txt
+++ b/work/workmanager-ktx/api/1.0.0-alpha13.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class CoroutineWorker extends androidx.work.ListenableWorker {
diff --git a/work/workmanager-ktx/api/1.0.0-beta01.txt b/work/workmanager-ktx/api/1.0.0-beta01.txt
index 2bb4be9..81076cb 100644
--- a/work/workmanager-ktx/api/1.0.0-beta01.txt
+++ b/work/workmanager-ktx/api/1.0.0-beta01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class CoroutineWorker extends androidx.work.ListenableWorker {
diff --git a/work/workmanager-ktx/api/1.0.0-beta02.txt b/work/workmanager-ktx/api/1.0.0-beta02.txt
index 2bb4be9..81076cb 100644
--- a/work/workmanager-ktx/api/1.0.0-beta02.txt
+++ b/work/workmanager-ktx/api/1.0.0-beta02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class CoroutineWorker extends androidx.work.ListenableWorker {
diff --git a/work/workmanager-ktx/api/1.0.0-beta03.txt b/work/workmanager-ktx/api/1.0.0-beta03.txt
index d76133a..81076cb 100644
--- a/work/workmanager-ktx/api/1.0.0-beta03.txt
+++ b/work/workmanager-ktx/api/1.0.0-beta03.txt
@@ -1,9 +1,9 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class CoroutineWorker extends androidx.work.ListenableWorker {
ctor public CoroutineWorker(android.content.Context appContext, androidx.work.WorkerParameters params);
- method public abstract suspend Object? doWork(kotlin.coroutines.experimental.Continuation<? super androidx.work.ListenableWorker.Result> p);
+ method public abstract Object? doWork(kotlin.coroutines.experimental.Continuation<? super androidx.work.ListenableWorker.Result> p);
method public kotlinx.coroutines.CoroutineDispatcher getCoroutineContext();
method public final void onStopped();
method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
@@ -12,7 +12,7 @@
public final class DataKt {
ctor public DataKt();
- method public static inline androidx.work.Data workDataOf(kotlin.Pair<java.lang.String,?>... pairs);
+ method public static androidx.work.Data workDataOf(kotlin.Pair<java.lang.String,?>... pairs);
}
public final class ListenableFutureKt {
@@ -21,21 +21,15 @@
public final class OneTimeWorkRequestKt {
ctor public OneTimeWorkRequestKt();
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.OneTimeWorkRequest.Builder! OneTimeWorkRequestBuilder();
- method public static inline androidx.work.OneTimeWorkRequest.Builder setInputMerger(androidx.work.OneTimeWorkRequest.Builder, kotlin.reflect.KClass<? extends androidx.work.InputMerger> inputMerger);
+ method public static androidx.work.OneTimeWorkRequest.Builder setInputMerger(androidx.work.OneTimeWorkRequest.Builder, kotlin.reflect.KClass<? extends androidx.work.InputMerger> inputMerger);
}
public final class OperationKt {
ctor public OperationKt();
- method public static suspend inline Object! await(androidx.work.Operation, kotlin.coroutines.experimental.Continuation<? super androidx.work.Operation.State.SUCCESS>! p);
}
public final class PeriodicWorkRequestKt {
ctor public PeriodicWorkRequestKt();
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit! repeatIntervalTimeUnit);
- method @RequiresApi(26) public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration! repeatInterval);
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit! repeatIntervalTimeUnit, long flexTimeInterval, java.util.concurrent.TimeUnit! flexTimeIntervalUnit);
- method @RequiresApi(26) public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration! repeatInterval, java.time.Duration! flexTimeInterval);
}
}
diff --git a/work/workmanager-ktx/api/1.0.0-beta04.txt b/work/workmanager-ktx/api/1.0.0-beta04.txt
index d76133a..81076cb 100644
--- a/work/workmanager-ktx/api/1.0.0-beta04.txt
+++ b/work/workmanager-ktx/api/1.0.0-beta04.txt
@@ -1,9 +1,9 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class CoroutineWorker extends androidx.work.ListenableWorker {
ctor public CoroutineWorker(android.content.Context appContext, androidx.work.WorkerParameters params);
- method public abstract suspend Object? doWork(kotlin.coroutines.experimental.Continuation<? super androidx.work.ListenableWorker.Result> p);
+ method public abstract Object? doWork(kotlin.coroutines.experimental.Continuation<? super androidx.work.ListenableWorker.Result> p);
method public kotlinx.coroutines.CoroutineDispatcher getCoroutineContext();
method public final void onStopped();
method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
@@ -12,7 +12,7 @@
public final class DataKt {
ctor public DataKt();
- method public static inline androidx.work.Data workDataOf(kotlin.Pair<java.lang.String,?>... pairs);
+ method public static androidx.work.Data workDataOf(kotlin.Pair<java.lang.String,?>... pairs);
}
public final class ListenableFutureKt {
@@ -21,21 +21,15 @@
public final class OneTimeWorkRequestKt {
ctor public OneTimeWorkRequestKt();
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.OneTimeWorkRequest.Builder! OneTimeWorkRequestBuilder();
- method public static inline androidx.work.OneTimeWorkRequest.Builder setInputMerger(androidx.work.OneTimeWorkRequest.Builder, kotlin.reflect.KClass<? extends androidx.work.InputMerger> inputMerger);
+ method public static androidx.work.OneTimeWorkRequest.Builder setInputMerger(androidx.work.OneTimeWorkRequest.Builder, kotlin.reflect.KClass<? extends androidx.work.InputMerger> inputMerger);
}
public final class OperationKt {
ctor public OperationKt();
- method public static suspend inline Object! await(androidx.work.Operation, kotlin.coroutines.experimental.Continuation<? super androidx.work.Operation.State.SUCCESS>! p);
}
public final class PeriodicWorkRequestKt {
ctor public PeriodicWorkRequestKt();
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit! repeatIntervalTimeUnit);
- method @RequiresApi(26) public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration! repeatInterval);
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit! repeatIntervalTimeUnit, long flexTimeInterval, java.util.concurrent.TimeUnit! flexTimeIntervalUnit);
- method @RequiresApi(26) public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration! repeatInterval, java.time.Duration! flexTimeInterval);
}
}
diff --git a/work/workmanager-ktx/api/1.0.0-rc01.txt b/work/workmanager-ktx/api/1.0.0-rc01.txt
deleted file mode 100644
index d76133a..0000000
--- a/work/workmanager-ktx/api/1.0.0-rc01.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- public abstract class CoroutineWorker extends androidx.work.ListenableWorker {
- ctor public CoroutineWorker(android.content.Context appContext, androidx.work.WorkerParameters params);
- method public abstract suspend Object? doWork(kotlin.coroutines.experimental.Continuation<? super androidx.work.ListenableWorker.Result> p);
- method public kotlinx.coroutines.CoroutineDispatcher getCoroutineContext();
- method public final void onStopped();
- method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- property public kotlinx.coroutines.CoroutineDispatcher coroutineContext;
- }
-
- public final class DataKt {
- ctor public DataKt();
- method public static inline androidx.work.Data workDataOf(kotlin.Pair<java.lang.String,?>... pairs);
- }
-
- public final class ListenableFutureKt {
- ctor public ListenableFutureKt();
- }
-
- public final class OneTimeWorkRequestKt {
- ctor public OneTimeWorkRequestKt();
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.OneTimeWorkRequest.Builder! OneTimeWorkRequestBuilder();
- method public static inline androidx.work.OneTimeWorkRequest.Builder setInputMerger(androidx.work.OneTimeWorkRequest.Builder, kotlin.reflect.KClass<? extends androidx.work.InputMerger> inputMerger);
- }
-
- public final class OperationKt {
- ctor public OperationKt();
- method public static suspend inline Object! await(androidx.work.Operation, kotlin.coroutines.experimental.Continuation<? super androidx.work.Operation.State.SUCCESS>! p);
- }
-
- public final class PeriodicWorkRequestKt {
- ctor public PeriodicWorkRequestKt();
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit! repeatIntervalTimeUnit);
- method @RequiresApi(26) public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration! repeatInterval);
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit! repeatIntervalTimeUnit, long flexTimeInterval, java.util.concurrent.TimeUnit! flexTimeIntervalUnit);
- method @RequiresApi(26) public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration! repeatInterval, java.time.Duration! flexTimeInterval);
- }
-
-}
-
diff --git a/work/workmanager-ktx/api/1.0.0-rc02.txt b/work/workmanager-ktx/api/1.0.0-rc02.txt
deleted file mode 100644
index d76133a..0000000
--- a/work/workmanager-ktx/api/1.0.0-rc02.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- public abstract class CoroutineWorker extends androidx.work.ListenableWorker {
- ctor public CoroutineWorker(android.content.Context appContext, androidx.work.WorkerParameters params);
- method public abstract suspend Object? doWork(kotlin.coroutines.experimental.Continuation<? super androidx.work.ListenableWorker.Result> p);
- method public kotlinx.coroutines.CoroutineDispatcher getCoroutineContext();
- method public final void onStopped();
- method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- property public kotlinx.coroutines.CoroutineDispatcher coroutineContext;
- }
-
- public final class DataKt {
- ctor public DataKt();
- method public static inline androidx.work.Data workDataOf(kotlin.Pair<java.lang.String,?>... pairs);
- }
-
- public final class ListenableFutureKt {
- ctor public ListenableFutureKt();
- }
-
- public final class OneTimeWorkRequestKt {
- ctor public OneTimeWorkRequestKt();
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.OneTimeWorkRequest.Builder! OneTimeWorkRequestBuilder();
- method public static inline androidx.work.OneTimeWorkRequest.Builder setInputMerger(androidx.work.OneTimeWorkRequest.Builder, kotlin.reflect.KClass<? extends androidx.work.InputMerger> inputMerger);
- }
-
- public final class OperationKt {
- ctor public OperationKt();
- method public static suspend inline Object! await(androidx.work.Operation, kotlin.coroutines.experimental.Continuation<? super androidx.work.Operation.State.SUCCESS>! p);
- }
-
- public final class PeriodicWorkRequestKt {
- ctor public PeriodicWorkRequestKt();
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit! repeatIntervalTimeUnit);
- method @RequiresApi(26) public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration! repeatInterval);
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit! repeatIntervalTimeUnit, long flexTimeInterval, java.util.concurrent.TimeUnit! flexTimeIntervalUnit);
- method @RequiresApi(26) public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration! repeatInterval, java.time.Duration! flexTimeInterval);
- }
-
-}
-
diff --git a/work/workmanager-ktx/api/1.0.0.txt b/work/workmanager-ktx/api/1.0.0.txt
deleted file mode 100644
index d76133a..0000000
--- a/work/workmanager-ktx/api/1.0.0.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- public abstract class CoroutineWorker extends androidx.work.ListenableWorker {
- ctor public CoroutineWorker(android.content.Context appContext, androidx.work.WorkerParameters params);
- method public abstract suspend Object? doWork(kotlin.coroutines.experimental.Continuation<? super androidx.work.ListenableWorker.Result> p);
- method public kotlinx.coroutines.CoroutineDispatcher getCoroutineContext();
- method public final void onStopped();
- method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- property public kotlinx.coroutines.CoroutineDispatcher coroutineContext;
- }
-
- public final class DataKt {
- ctor public DataKt();
- method public static inline androidx.work.Data workDataOf(kotlin.Pair<java.lang.String,?>... pairs);
- }
-
- public final class ListenableFutureKt {
- ctor public ListenableFutureKt();
- }
-
- public final class OneTimeWorkRequestKt {
- ctor public OneTimeWorkRequestKt();
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.OneTimeWorkRequest.Builder! OneTimeWorkRequestBuilder();
- method public static inline androidx.work.OneTimeWorkRequest.Builder setInputMerger(androidx.work.OneTimeWorkRequest.Builder, kotlin.reflect.KClass<? extends androidx.work.InputMerger> inputMerger);
- }
-
- public final class OperationKt {
- ctor public OperationKt();
- method public static suspend inline Object! await(androidx.work.Operation, kotlin.coroutines.experimental.Continuation<? super androidx.work.Operation.State.SUCCESS>! p);
- }
-
- public final class PeriodicWorkRequestKt {
- ctor public PeriodicWorkRequestKt();
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit! repeatIntervalTimeUnit);
- method @RequiresApi(26) public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration! repeatInterval);
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit! repeatIntervalTimeUnit, long flexTimeInterval, java.util.concurrent.TimeUnit! flexTimeIntervalUnit);
- method @RequiresApi(26) public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration! repeatInterval, java.time.Duration! flexTimeInterval);
- }
-
-}
-
diff --git a/work/workmanager-ktx/api/current.txt b/work/workmanager-ktx/api/current.txt
index d76133a..81076cb 100644
--- a/work/workmanager-ktx/api/current.txt
+++ b/work/workmanager-ktx/api/current.txt
@@ -1,9 +1,9 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class CoroutineWorker extends androidx.work.ListenableWorker {
ctor public CoroutineWorker(android.content.Context appContext, androidx.work.WorkerParameters params);
- method public abstract suspend Object? doWork(kotlin.coroutines.experimental.Continuation<? super androidx.work.ListenableWorker.Result> p);
+ method public abstract Object? doWork(kotlin.coroutines.experimental.Continuation<? super androidx.work.ListenableWorker.Result> p);
method public kotlinx.coroutines.CoroutineDispatcher getCoroutineContext();
method public final void onStopped();
method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
@@ -12,7 +12,7 @@
public final class DataKt {
ctor public DataKt();
- method public static inline androidx.work.Data workDataOf(kotlin.Pair<java.lang.String,?>... pairs);
+ method public static androidx.work.Data workDataOf(kotlin.Pair<java.lang.String,?>... pairs);
}
public final class ListenableFutureKt {
@@ -21,21 +21,15 @@
public final class OneTimeWorkRequestKt {
ctor public OneTimeWorkRequestKt();
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.OneTimeWorkRequest.Builder! OneTimeWorkRequestBuilder();
- method public static inline androidx.work.OneTimeWorkRequest.Builder setInputMerger(androidx.work.OneTimeWorkRequest.Builder, kotlin.reflect.KClass<? extends androidx.work.InputMerger> inputMerger);
+ method public static androidx.work.OneTimeWorkRequest.Builder setInputMerger(androidx.work.OneTimeWorkRequest.Builder, kotlin.reflect.KClass<? extends androidx.work.InputMerger> inputMerger);
}
public final class OperationKt {
ctor public OperationKt();
- method public static suspend inline Object! await(androidx.work.Operation, kotlin.coroutines.experimental.Continuation<? super androidx.work.Operation.State.SUCCESS>! p);
}
public final class PeriodicWorkRequestKt {
ctor public PeriodicWorkRequestKt();
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit! repeatIntervalTimeUnit);
- method @RequiresApi(26) public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration! repeatInterval);
- method public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(long repeatInterval, java.util.concurrent.TimeUnit! repeatIntervalTimeUnit, long flexTimeInterval, java.util.concurrent.TimeUnit! flexTimeIntervalUnit);
- method @RequiresApi(26) public static inline <reified W extends androidx.work.ListenableWorker> androidx.work.PeriodicWorkRequest.Builder! PeriodicWorkRequestBuilder(java.time.Duration! repeatInterval, java.time.Duration! flexTimeInterval);
}
}
diff --git a/work/workmanager-ktx/api/res-1.0.0-rc01.txt b/work/workmanager-ktx/api/res-1.0.0-rc01.txt
deleted file mode 100644
index e69de29..0000000
--- a/work/workmanager-ktx/api/res-1.0.0-rc01.txt
+++ /dev/null
diff --git a/work/workmanager-ktx/api/res-1.0.0-rc02.txt b/work/workmanager-ktx/api/res-1.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/work/workmanager-ktx/api/res-1.0.0-rc02.txt
+++ /dev/null
diff --git a/work/workmanager-ktx/api/res-1.0.0.txt b/work/workmanager-ktx/api/res-1.0.0.txt
deleted file mode 100644
index e69de29..0000000
--- a/work/workmanager-ktx/api/res-1.0.0.txt
+++ /dev/null
diff --git a/work/workmanager-ktx/api/restricted_1.0.0-beta04.txt b/work/workmanager-ktx/api/restricted_1.0.0-beta04.txt
deleted file mode 100644
index 9973d9f..0000000
--- a/work/workmanager-ktx/api/restricted_1.0.0-beta04.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public enum DirectExecutor {
- ctor protected DirectExecutor();
- method public void execute(Runnable);
- method public String toString();
- enum_constant public static final androidx.work.DirectExecutor INSTANCE;
- }
-
- public final class ListenableFutureKt {
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static <R> Object? await(com.google.common.util.concurrent.ListenableFuture<R>, kotlin.coroutines.Continuation<? super R>);
- }
-
-}
-
diff --git a/work/workmanager-ktx/api/restricted_1.0.0-rc01.ignore b/work/workmanager-ktx/api/restricted_1.0.0-rc01.ignore
deleted file mode 100644
index 65204ca..0000000
--- a/work/workmanager-ktx/api/restricted_1.0.0-rc01.ignore
+++ /dev/null
@@ -1,7 +0,0 @@
-// Baseline format: 1.0
-RemovedMethod: androidx.work.DirectExecutor#DirectExecutor():
- Removed constructor androidx.work.DirectExecutor()
-RemovedMethod: androidx.work.ListenableFutureKt#await(com.google.common.util.concurrent.ListenableFuture<R>, kotlin.coroutines.Continuation<? super R>):
- Removed method androidx.work.ListenableFutureKt.await(com.google.common.util.concurrent.ListenableFuture<R>,kotlin.coroutines.Continuation<? super R>)
-
-
diff --git a/work/workmanager-ktx/api/restricted_1.0.0-rc01.txt b/work/workmanager-ktx/api/restricted_1.0.0-rc01.txt
deleted file mode 100644
index bdec7f9..0000000
--- a/work/workmanager-ktx/api/restricted_1.0.0-rc01.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP}) public enum DirectExecutor implements java.util.concurrent.Executor {
- method public void execute(Runnable command);
- enum_constant public static final androidx.work.DirectExecutor INSTANCE;
- }
-
- public final class ListenableFutureKt {
- method @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP}) public static suspend inline <R> Object! await(com.google.common.util.concurrent.ListenableFuture<R>, kotlin.coroutines.experimental.Continuation<? super R>! p);
- }
-
-}
-
diff --git a/work/workmanager-ktx/api/restricted_1.0.0-rc02.txt b/work/workmanager-ktx/api/restricted_1.0.0-rc02.txt
deleted file mode 100644
index bdec7f9..0000000
--- a/work/workmanager-ktx/api/restricted_1.0.0-rc02.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP}) public enum DirectExecutor implements java.util.concurrent.Executor {
- method public void execute(Runnable command);
- enum_constant public static final androidx.work.DirectExecutor INSTANCE;
- }
-
- public final class ListenableFutureKt {
- method @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP}) public static suspend inline <R> Object! await(com.google.common.util.concurrent.ListenableFuture<R>, kotlin.coroutines.experimental.Continuation<? super R>! p);
- }
-
-}
-
diff --git a/work/workmanager-ktx/api/restricted_1.0.0.txt b/work/workmanager-ktx/api/restricted_1.0.0.txt
deleted file mode 100644
index bdec7f9..0000000
--- a/work/workmanager-ktx/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP}) public enum DirectExecutor implements java.util.concurrent.Executor {
- method public void execute(Runnable command);
- enum_constant public static final androidx.work.DirectExecutor INSTANCE;
- }
-
- public final class ListenableFutureKt {
- method @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP}) public static suspend inline <R> Object! await(com.google.common.util.concurrent.ListenableFuture<R>, kotlin.coroutines.experimental.Continuation<? super R>! p);
- }
-
-}
-
diff --git a/work/workmanager-ktx/api/restricted_current.txt b/work/workmanager-ktx/api/restricted_current.txt
deleted file mode 100644
index bdec7f9..0000000
--- a/work/workmanager-ktx/api/restricted_current.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP}) public enum DirectExecutor implements java.util.concurrent.Executor {
- method public void execute(Runnable command);
- enum_constant public static final androidx.work.DirectExecutor INSTANCE;
- }
-
- public final class ListenableFutureKt {
- method @RestrictTo({RestrictTo.Scope.LIBRARY_GROUP}) public static suspend inline <R> Object! await(com.google.common.util.concurrent.ListenableFuture<R>, kotlin.coroutines.experimental.Continuation<? super R>! p);
- }
-
-}
-
diff --git a/work/workmanager-ktx/src/main/java/androidx/work/CoroutineWorker.kt b/work/workmanager-ktx/src/main/java/androidx/work/CoroutineWorker.kt
index dc98636..b4f3413 100644
--- a/work/workmanager-ktx/src/main/java/androidx/work/CoroutineWorker.kt
+++ b/work/workmanager-ktx/src/main/java/androidx/work/CoroutineWorker.kt
@@ -63,8 +63,8 @@
val coroutineScope = CoroutineScope(coroutineContext + job)
coroutineScope.launch {
try {
- val result = doWork()
- future.set(result)
+ val payload = doWork()
+ future.set(payload)
} catch (t: Throwable) {
future.setException(t)
}
diff --git a/work/workmanager-rxjava2/api/1.0.0-alpha13.txt b/work/workmanager-rxjava2/api/1.0.0-alpha13.txt
index fc1c405..b727350 100644
--- a/work/workmanager-rxjava2/api/1.0.0-alpha13.txt
+++ b/work/workmanager-rxjava2/api/1.0.0-alpha13.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class RxWorker extends androidx.work.ListenableWorker {
diff --git a/work/workmanager-rxjava2/api/1.0.0-beta01.txt b/work/workmanager-rxjava2/api/1.0.0-beta01.txt
index fc1c405..b727350 100644
--- a/work/workmanager-rxjava2/api/1.0.0-beta01.txt
+++ b/work/workmanager-rxjava2/api/1.0.0-beta01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class RxWorker extends androidx.work.ListenableWorker {
diff --git a/work/workmanager-rxjava2/api/1.0.0-beta02.txt b/work/workmanager-rxjava2/api/1.0.0-beta02.txt
index fc1c405..b727350 100644
--- a/work/workmanager-rxjava2/api/1.0.0-beta02.txt
+++ b/work/workmanager-rxjava2/api/1.0.0-beta02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class RxWorker extends androidx.work.ListenableWorker {
diff --git a/work/workmanager-rxjava2/api/1.0.0-beta03.txt b/work/workmanager-rxjava2/api/1.0.0-beta03.txt
index fc1c405..b727350 100644
--- a/work/workmanager-rxjava2/api/1.0.0-beta03.txt
+++ b/work/workmanager-rxjava2/api/1.0.0-beta03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class RxWorker extends androidx.work.ListenableWorker {
diff --git a/work/workmanager-rxjava2/api/1.0.0-beta04.txt b/work/workmanager-rxjava2/api/1.0.0-beta04.txt
index fc1c405..b727350 100644
--- a/work/workmanager-rxjava2/api/1.0.0-beta04.txt
+++ b/work/workmanager-rxjava2/api/1.0.0-beta04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class RxWorker extends androidx.work.ListenableWorker {
diff --git a/work/workmanager-rxjava2/api/1.0.0-rc01.txt b/work/workmanager-rxjava2/api/1.0.0-rc01.txt
deleted file mode 100644
index fc1c405..0000000
--- a/work/workmanager-rxjava2/api/1.0.0-rc01.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- public abstract class RxWorker extends androidx.work.ListenableWorker {
- ctor public RxWorker(android.content.Context, androidx.work.WorkerParameters);
- method @MainThread public abstract io.reactivex.Single<androidx.work.ListenableWorker.Result>! createWork();
- method protected io.reactivex.Scheduler! getBackgroundScheduler();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- }
-
-}
-
diff --git a/work/workmanager-rxjava2/api/1.0.0-rc02.txt b/work/workmanager-rxjava2/api/1.0.0-rc02.txt
deleted file mode 100644
index fc1c405..0000000
--- a/work/workmanager-rxjava2/api/1.0.0-rc02.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- public abstract class RxWorker extends androidx.work.ListenableWorker {
- ctor public RxWorker(android.content.Context, androidx.work.WorkerParameters);
- method @MainThread public abstract io.reactivex.Single<androidx.work.ListenableWorker.Result>! createWork();
- method protected io.reactivex.Scheduler! getBackgroundScheduler();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- }
-
-}
-
diff --git a/work/workmanager-rxjava2/api/1.0.0.txt b/work/workmanager-rxjava2/api/1.0.0.txt
deleted file mode 100644
index fc1c405..0000000
--- a/work/workmanager-rxjava2/api/1.0.0.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- public abstract class RxWorker extends androidx.work.ListenableWorker {
- ctor public RxWorker(android.content.Context, androidx.work.WorkerParameters);
- method @MainThread public abstract io.reactivex.Single<androidx.work.ListenableWorker.Result>! createWork();
- method protected io.reactivex.Scheduler! getBackgroundScheduler();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- }
-
-}
-
diff --git a/work/workmanager-rxjava2/api/current.txt b/work/workmanager-rxjava2/api/current.txt
index fc1c405..b727350 100644
--- a/work/workmanager-rxjava2/api/current.txt
+++ b/work/workmanager-rxjava2/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public abstract class RxWorker extends androidx.work.ListenableWorker {
diff --git a/work/workmanager-rxjava2/api/res-1.0.0-rc01.txt b/work/workmanager-rxjava2/api/res-1.0.0-rc01.txt
deleted file mode 100644
index e69de29..0000000
--- a/work/workmanager-rxjava2/api/res-1.0.0-rc01.txt
+++ /dev/null
diff --git a/work/workmanager-rxjava2/api/res-1.0.0-rc02.txt b/work/workmanager-rxjava2/api/res-1.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/work/workmanager-rxjava2/api/res-1.0.0-rc02.txt
+++ /dev/null
diff --git a/work/workmanager-rxjava2/api/res-1.0.0.txt b/work/workmanager-rxjava2/api/res-1.0.0.txt
deleted file mode 100644
index e69de29..0000000
--- a/work/workmanager-rxjava2/api/res-1.0.0.txt
+++ /dev/null
diff --git a/work/workmanager-rxjava2/api/restricted_1.0.0-beta04.txt b/work/workmanager-rxjava2/api/restricted_1.0.0-beta04.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/work/workmanager-rxjava2/api/restricted_1.0.0-beta04.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/work/workmanager-rxjava2/api/restricted_1.0.0-rc01.txt b/work/workmanager-rxjava2/api/restricted_1.0.0-rc01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/work/workmanager-rxjava2/api/restricted_1.0.0-rc01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/work/workmanager-rxjava2/api/restricted_1.0.0-rc02.txt b/work/workmanager-rxjava2/api/restricted_1.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/work/workmanager-rxjava2/api/restricted_1.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/work/workmanager-rxjava2/api/restricted_1.0.0.txt b/work/workmanager-rxjava2/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/work/workmanager-rxjava2/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/work/workmanager-rxjava2/api/restricted_current.txt b/work/workmanager-rxjava2/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/work/workmanager-rxjava2/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/work/workmanager-rxjava2/src/main/java/androidx/work/RxWorker.java b/work/workmanager-rxjava2/src/main/java/androidx/work/RxWorker.java
index 4af549e..19de267 100644
--- a/work/workmanager-rxjava2/src/main/java/androidx/work/RxWorker.java
+++ b/work/workmanager-rxjava2/src/main/java/androidx/work/RxWorker.java
@@ -38,7 +38,7 @@
* RxJava2 interoperability Worker implementation.
* <p>
* When invoked by the {@link WorkManager}, it will call @{@link #createWork()} to get a
- * {@code Single<Result>} subscribe to it.
+ * {@code Single<Payload>} subscribe to it.
* <p>
* By default, RxWorker will subscribe on the thread pool that runs {@link WorkManager}
* {@link Worker}s. You can change this behavior by overriding {@link #getBackgroundScheduler()}
diff --git a/work/workmanager-testing/api/1.0.0-alpha10.txt b/work/workmanager-testing/api/1.0.0-alpha10.txt
index 4754b0d..5645c13 100644
--- a/work/workmanager-testing/api/1.0.0-alpha10.txt
+++ b/work/workmanager-testing/api/1.0.0-alpha10.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work.testing {
public class SynchronousExecutor implements java.util.concurrent.Executor {
diff --git a/work/workmanager-testing/api/1.0.0-alpha11.txt b/work/workmanager-testing/api/1.0.0-alpha11.txt
index 4754b0d..5645c13 100644
--- a/work/workmanager-testing/api/1.0.0-alpha11.txt
+++ b/work/workmanager-testing/api/1.0.0-alpha11.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work.testing {
public class SynchronousExecutor implements java.util.concurrent.Executor {
diff --git a/work/workmanager-testing/api/1.0.0-alpha12.txt b/work/workmanager-testing/api/1.0.0-alpha12.txt
index 4754b0d..5645c13 100644
--- a/work/workmanager-testing/api/1.0.0-alpha12.txt
+++ b/work/workmanager-testing/api/1.0.0-alpha12.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work.testing {
public class SynchronousExecutor implements java.util.concurrent.Executor {
diff --git a/work/workmanager-testing/api/1.0.0-alpha13.txt b/work/workmanager-testing/api/1.0.0-alpha13.txt
index 4754b0d..5645c13 100644
--- a/work/workmanager-testing/api/1.0.0-alpha13.txt
+++ b/work/workmanager-testing/api/1.0.0-alpha13.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work.testing {
public class SynchronousExecutor implements java.util.concurrent.Executor {
diff --git a/work/workmanager-testing/api/1.0.0-beta01.txt b/work/workmanager-testing/api/1.0.0-beta01.txt
index 4754b0d..5645c13 100644
--- a/work/workmanager-testing/api/1.0.0-beta01.txt
+++ b/work/workmanager-testing/api/1.0.0-beta01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work.testing {
public class SynchronousExecutor implements java.util.concurrent.Executor {
diff --git a/work/workmanager-testing/api/1.0.0-beta02.txt b/work/workmanager-testing/api/1.0.0-beta02.txt
index 4754b0d..5645c13 100644
--- a/work/workmanager-testing/api/1.0.0-beta02.txt
+++ b/work/workmanager-testing/api/1.0.0-beta02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work.testing {
public class SynchronousExecutor implements java.util.concurrent.Executor {
diff --git a/work/workmanager-testing/api/1.0.0-beta03.txt b/work/workmanager-testing/api/1.0.0-beta03.txt
index 4754b0d..5645c13 100644
--- a/work/workmanager-testing/api/1.0.0-beta03.txt
+++ b/work/workmanager-testing/api/1.0.0-beta03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work.testing {
public class SynchronousExecutor implements java.util.concurrent.Executor {
diff --git a/work/workmanager-testing/api/1.0.0-beta04.txt b/work/workmanager-testing/api/1.0.0-beta04.txt
index 4754b0d..5645c13 100644
--- a/work/workmanager-testing/api/1.0.0-beta04.txt
+++ b/work/workmanager-testing/api/1.0.0-beta04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work.testing {
public class SynchronousExecutor implements java.util.concurrent.Executor {
diff --git a/work/workmanager-testing/api/1.0.0-rc01.txt b/work/workmanager-testing/api/1.0.0-rc01.txt
deleted file mode 100644
index 4754b0d..0000000
--- a/work/workmanager-testing/api/1.0.0-rc01.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-// Signature format: 3.0
-package androidx.work.testing {
-
- public class SynchronousExecutor implements java.util.concurrent.Executor {
- ctor public SynchronousExecutor();
- method public void execute(Runnable);
- }
-
- public interface TestDriver {
- method public void setAllConstraintsMet(java.util.UUID);
- method public void setInitialDelayMet(java.util.UUID);
- method public void setPeriodDelayMet(java.util.UUID);
- }
-
- public final class WorkManagerTestInitHelper {
- method public static androidx.work.testing.TestDriver! getTestDriver();
- method public static void initializeTestWorkManager(android.content.Context);
- method public static void initializeTestWorkManager(android.content.Context, androidx.work.Configuration);
- }
-
-}
-
diff --git a/work/workmanager-testing/api/1.0.0-rc02.txt b/work/workmanager-testing/api/1.0.0-rc02.txt
deleted file mode 100644
index 4754b0d..0000000
--- a/work/workmanager-testing/api/1.0.0-rc02.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-// Signature format: 3.0
-package androidx.work.testing {
-
- public class SynchronousExecutor implements java.util.concurrent.Executor {
- ctor public SynchronousExecutor();
- method public void execute(Runnable);
- }
-
- public interface TestDriver {
- method public void setAllConstraintsMet(java.util.UUID);
- method public void setInitialDelayMet(java.util.UUID);
- method public void setPeriodDelayMet(java.util.UUID);
- }
-
- public final class WorkManagerTestInitHelper {
- method public static androidx.work.testing.TestDriver! getTestDriver();
- method public static void initializeTestWorkManager(android.content.Context);
- method public static void initializeTestWorkManager(android.content.Context, androidx.work.Configuration);
- }
-
-}
-
diff --git a/work/workmanager-testing/api/1.0.0.txt b/work/workmanager-testing/api/1.0.0.txt
deleted file mode 100644
index 4754b0d..0000000
--- a/work/workmanager-testing/api/1.0.0.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-// Signature format: 3.0
-package androidx.work.testing {
-
- public class SynchronousExecutor implements java.util.concurrent.Executor {
- ctor public SynchronousExecutor();
- method public void execute(Runnable);
- }
-
- public interface TestDriver {
- method public void setAllConstraintsMet(java.util.UUID);
- method public void setInitialDelayMet(java.util.UUID);
- method public void setPeriodDelayMet(java.util.UUID);
- }
-
- public final class WorkManagerTestInitHelper {
- method public static androidx.work.testing.TestDriver! getTestDriver();
- method public static void initializeTestWorkManager(android.content.Context);
- method public static void initializeTestWorkManager(android.content.Context, androidx.work.Configuration);
- }
-
-}
-
diff --git a/work/workmanager-testing/api/current.txt b/work/workmanager-testing/api/current.txt
index 4754b0d..5645c13 100644
--- a/work/workmanager-testing/api/current.txt
+++ b/work/workmanager-testing/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work.testing {
public class SynchronousExecutor implements java.util.concurrent.Executor {
diff --git a/work/workmanager-testing/api/res-1.0.0-rc01.txt b/work/workmanager-testing/api/res-1.0.0-rc01.txt
deleted file mode 100644
index e69de29..0000000
--- a/work/workmanager-testing/api/res-1.0.0-rc01.txt
+++ /dev/null
diff --git a/work/workmanager-testing/api/res-1.0.0-rc02.txt b/work/workmanager-testing/api/res-1.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/work/workmanager-testing/api/res-1.0.0-rc02.txt
+++ /dev/null
diff --git a/work/workmanager-testing/api/res-1.0.0.txt b/work/workmanager-testing/api/res-1.0.0.txt
deleted file mode 100644
index e69de29..0000000
--- a/work/workmanager-testing/api/res-1.0.0.txt
+++ /dev/null
diff --git a/work/workmanager-testing/api/restricted_1.0.0-beta04.txt b/work/workmanager-testing/api/restricted_1.0.0-beta04.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/work/workmanager-testing/api/restricted_1.0.0-beta04.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/work/workmanager-testing/api/restricted_1.0.0-rc01.txt b/work/workmanager-testing/api/restricted_1.0.0-rc01.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/work/workmanager-testing/api/restricted_1.0.0-rc01.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/work/workmanager-testing/api/restricted_1.0.0-rc02.txt b/work/workmanager-testing/api/restricted_1.0.0-rc02.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/work/workmanager-testing/api/restricted_1.0.0-rc02.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/work/workmanager-testing/api/restricted_1.0.0.txt b/work/workmanager-testing/api/restricted_1.0.0.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/work/workmanager-testing/api/restricted_1.0.0.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/work/workmanager-testing/api/restricted_current.txt b/work/workmanager-testing/api/restricted_current.txt
deleted file mode 100644
index da4f6cc..0000000
--- a/work/workmanager-testing/api/restricted_current.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Signature format: 3.0
diff --git a/work/workmanager-testing/src/androidTest/java/androidx/work/testing/TestSchedulerTest.java b/work/workmanager-testing/src/androidTest/java/androidx/work/testing/TestSchedulerTest.java
index efed667..092c806 100644
--- a/work/workmanager-testing/src/androidTest/java/androidx/work/testing/TestSchedulerTest.java
+++ b/work/workmanager-testing/src/androidTest/java/androidx/work/testing/TestSchedulerTest.java
@@ -23,7 +23,7 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.LargeTest;
+import androidx.test.filters.SmallTest;
import androidx.work.Constraints;
import androidx.work.NetworkType;
import androidx.work.OneTimeWorkRequest;
@@ -45,7 +45,7 @@
import java.util.concurrent.TimeUnit;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@SmallTest
public class TestSchedulerTest {
private TestDriver mTestDriver;
diff --git a/work/workmanager/api/1.0.0-alpha10.txt b/work/workmanager/api/1.0.0-alpha10.txt
index 70541e6..226063f 100644
--- a/work/workmanager/api/1.0.0-alpha10.txt
+++ b/work/workmanager/api/1.0.0-alpha10.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public final class ArrayCreatingInputMerger extends androidx.work.InputMerger {
diff --git a/work/workmanager/api/1.0.0-alpha11.txt b/work/workmanager/api/1.0.0-alpha11.txt
index 90e41b9..c0e4fac 100644
--- a/work/workmanager/api/1.0.0-alpha11.txt
+++ b/work/workmanager/api/1.0.0-alpha11.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public final class ArrayCreatingInputMerger extends androidx.work.InputMerger {
diff --git a/work/workmanager/api/1.0.0-alpha12.txt b/work/workmanager/api/1.0.0-alpha12.txt
index c637d8f..f798f4b 100644
--- a/work/workmanager/api/1.0.0-alpha12.txt
+++ b/work/workmanager/api/1.0.0-alpha12.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public final class ArrayCreatingInputMerger extends androidx.work.InputMerger {
diff --git a/work/workmanager/api/1.0.0-alpha13.txt b/work/workmanager/api/1.0.0-alpha13.txt
index 1f6aa2a..9be7492 100644
--- a/work/workmanager/api/1.0.0-alpha13.txt
+++ b/work/workmanager/api/1.0.0-alpha13.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public final class ArrayCreatingInputMerger extends androidx.work.InputMerger {
diff --git a/work/workmanager/api/1.0.0-beta01.txt b/work/workmanager/api/1.0.0-beta01.txt
index 1f6aa2a..9be7492 100644
--- a/work/workmanager/api/1.0.0-beta01.txt
+++ b/work/workmanager/api/1.0.0-beta01.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public final class ArrayCreatingInputMerger extends androidx.work.InputMerger {
diff --git a/work/workmanager/api/1.0.0-beta02.txt b/work/workmanager/api/1.0.0-beta02.txt
index 1f6aa2a..9be7492 100644
--- a/work/workmanager/api/1.0.0-beta02.txt
+++ b/work/workmanager/api/1.0.0-beta02.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public final class ArrayCreatingInputMerger extends androidx.work.InputMerger {
diff --git a/work/workmanager/api/1.0.0-beta03.txt b/work/workmanager/api/1.0.0-beta03.txt
index bc7e240..9be7492 100644
--- a/work/workmanager/api/1.0.0-beta03.txt
+++ b/work/workmanager/api/1.0.0-beta03.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public final class ArrayCreatingInputMerger extends androidx.work.InputMerger {
@@ -204,7 +204,7 @@
method public java.util.Set<java.lang.String> getTags();
}
- public enum WorkInfo.State {
+ public static enum WorkInfo.State {
method public boolean isFinished();
enum_constant public static final androidx.work.WorkInfo.State BLOCKED;
enum_constant public static final androidx.work.WorkInfo.State CANCELLED;
diff --git a/work/workmanager/api/1.0.0-beta04.txt b/work/workmanager/api/1.0.0-beta04.txt
index bc7e240..9be7492 100644
--- a/work/workmanager/api/1.0.0-beta04.txt
+++ b/work/workmanager/api/1.0.0-beta04.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public final class ArrayCreatingInputMerger extends androidx.work.InputMerger {
@@ -204,7 +204,7 @@
method public java.util.Set<java.lang.String> getTags();
}
- public enum WorkInfo.State {
+ public static enum WorkInfo.State {
method public boolean isFinished();
enum_constant public static final androidx.work.WorkInfo.State BLOCKED;
enum_constant public static final androidx.work.WorkInfo.State CANCELLED;
diff --git a/work/workmanager/api/1.0.0-rc01.txt b/work/workmanager/api/1.0.0-rc01.txt
deleted file mode 100644
index bc7e240..0000000
--- a/work/workmanager/api/1.0.0-rc01.txt
+++ /dev/null
@@ -1,284 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- public final class ArrayCreatingInputMerger extends androidx.work.InputMerger {
- ctor public ArrayCreatingInputMerger();
- method public androidx.work.Data merge(java.util.List<androidx.work.Data>);
- }
-
- public enum BackoffPolicy {
- enum_constant public static final androidx.work.BackoffPolicy EXPONENTIAL;
- enum_constant public static final androidx.work.BackoffPolicy LINEAR;
- }
-
- public final class Configuration {
- method public java.util.concurrent.Executor getExecutor();
- method public int getMaxJobSchedulerId();
- method public int getMinJobSchedulerId();
- method public androidx.work.WorkerFactory getWorkerFactory();
- field public static final int MIN_SCHEDULER_LIMIT = 20; // 0x14
- }
-
- public static final class Configuration.Builder {
- ctor public Configuration.Builder();
- method public androidx.work.Configuration build();
- method public androidx.work.Configuration.Builder setExecutor(java.util.concurrent.Executor);
- method public androidx.work.Configuration.Builder setJobSchedulerJobIdRange(int, int);
- method public androidx.work.Configuration.Builder setMaxSchedulerLimit(int);
- method public androidx.work.Configuration.Builder setMinimumLoggingLevel(int);
- method public androidx.work.Configuration.Builder setWorkerFactory(androidx.work.WorkerFactory);
- }
-
- public final class Constraints {
- ctor public Constraints(androidx.work.Constraints);
- method public androidx.work.NetworkType getRequiredNetworkType();
- method public boolean requiresBatteryNotLow();
- method public boolean requiresCharging();
- method @RequiresApi(23) public boolean requiresDeviceIdle();
- method public boolean requiresStorageNotLow();
- field public static final androidx.work.Constraints! NONE;
- }
-
- public static final class Constraints.Builder {
- ctor public Constraints.Builder();
- method @RequiresApi(24) public androidx.work.Constraints.Builder addContentUriTrigger(android.net.Uri, boolean);
- method public androidx.work.Constraints build();
- method public androidx.work.Constraints.Builder setRequiredNetworkType(androidx.work.NetworkType);
- method public androidx.work.Constraints.Builder setRequiresBatteryNotLow(boolean);
- method public androidx.work.Constraints.Builder setRequiresCharging(boolean);
- method @RequiresApi(23) public androidx.work.Constraints.Builder setRequiresDeviceIdle(boolean);
- method public androidx.work.Constraints.Builder setRequiresStorageNotLow(boolean);
- method @RequiresApi(24) public androidx.work.Constraints.Builder setTriggerContentMaxDelay(long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public androidx.work.Constraints.Builder setTriggerContentMaxDelay(java.time.Duration!);
- method @RequiresApi(24) public androidx.work.Constraints.Builder setTriggerContentUpdateDelay(long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public androidx.work.Constraints.Builder setTriggerContentUpdateDelay(java.time.Duration!);
- }
-
- public final class Data {
- ctor public Data(androidx.work.Data);
- method public boolean getBoolean(String, boolean);
- method public boolean[]? getBooleanArray(String);
- method public double getDouble(String, double);
- method public double[]? getDoubleArray(String);
- method public float getFloat(String, float);
- method public float[]? getFloatArray(String);
- method public int getInt(String, int);
- method public int[]? getIntArray(String);
- method public java.util.Map<java.lang.String,java.lang.Object> getKeyValueMap();
- method public long getLong(String, long);
- method public long[]? getLongArray(String);
- method public String? getString(String);
- method public String[]? getStringArray(String);
- field public static final androidx.work.Data! EMPTY;
- field public static final int MAX_DATA_BYTES = 10240; // 0x2800
- }
-
- public static final class Data.Builder {
- ctor public Data.Builder();
- method public androidx.work.Data build();
- method public androidx.work.Data.Builder putAll(androidx.work.Data);
- method public androidx.work.Data.Builder putAll(java.util.Map<java.lang.String,java.lang.Object>);
- method public androidx.work.Data.Builder putBoolean(String, boolean);
- method public androidx.work.Data.Builder putBooleanArray(String, boolean[]);
- method public androidx.work.Data.Builder putDouble(String, double);
- method public androidx.work.Data.Builder putDoubleArray(String, double[]);
- method public androidx.work.Data.Builder putFloat(String, float);
- method public androidx.work.Data.Builder putFloatArray(String, float[]);
- method public androidx.work.Data.Builder putInt(String, int);
- method public androidx.work.Data.Builder putIntArray(String, int[]);
- method public androidx.work.Data.Builder putLong(String, long);
- method public androidx.work.Data.Builder putLongArray(String, long[]);
- method public androidx.work.Data.Builder putString(String, String?);
- method public androidx.work.Data.Builder putStringArray(String, String[]);
- }
-
- public enum ExistingPeriodicWorkPolicy {
- enum_constant public static final androidx.work.ExistingPeriodicWorkPolicy KEEP;
- enum_constant public static final androidx.work.ExistingPeriodicWorkPolicy REPLACE;
- }
-
- public enum ExistingWorkPolicy {
- enum_constant public static final androidx.work.ExistingWorkPolicy APPEND;
- enum_constant public static final androidx.work.ExistingWorkPolicy KEEP;
- enum_constant public static final androidx.work.ExistingWorkPolicy REPLACE;
- }
-
- public abstract class InputMerger {
- ctor public InputMerger();
- method public abstract androidx.work.Data merge(java.util.List<androidx.work.Data>);
- }
-
- public abstract class ListenableWorker {
- ctor @Keep public ListenableWorker(android.content.Context, androidx.work.WorkerParameters);
- method public final android.content.Context getApplicationContext();
- method public final java.util.UUID getId();
- method public final androidx.work.Data getInputData();
- method @RequiresApi(28) public final android.net.Network? getNetwork();
- method public final int getRunAttemptCount();
- method public final java.util.Set<java.lang.String> getTags();
- method @RequiresApi(24) public final java.util.List<java.lang.String> getTriggeredContentAuthorities();
- method @RequiresApi(24) public final java.util.List<android.net.Uri> getTriggeredContentUris();
- method public final boolean isStopped();
- method public void onStopped();
- method @MainThread public abstract com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- }
-
- public abstract static class ListenableWorker.Result {
- method public static androidx.work.ListenableWorker.Result failure();
- method public static androidx.work.ListenableWorker.Result failure(androidx.work.Data);
- method public static androidx.work.ListenableWorker.Result retry();
- method public static androidx.work.ListenableWorker.Result success();
- method public static androidx.work.ListenableWorker.Result success(androidx.work.Data);
- }
-
- public enum NetworkType {
- enum_constant public static final androidx.work.NetworkType CONNECTED;
- enum_constant public static final androidx.work.NetworkType METERED;
- enum_constant public static final androidx.work.NetworkType NOT_REQUIRED;
- enum_constant public static final androidx.work.NetworkType NOT_ROAMING;
- enum_constant public static final androidx.work.NetworkType UNMETERED;
- }
-
- public final class OneTimeWorkRequest extends androidx.work.WorkRequest {
- method public static androidx.work.OneTimeWorkRequest from(Class<? extends androidx.work.ListenableWorker>);
- method public static java.util.List<androidx.work.OneTimeWorkRequest> from(java.util.List<java.lang.Class<? extends androidx.work.ListenableWorker>>);
- }
-
- public static final class OneTimeWorkRequest.Builder extends androidx.work.WorkRequest.Builder<androidx.work.OneTimeWorkRequest.Builder,androidx.work.OneTimeWorkRequest> {
- ctor public OneTimeWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>);
- method public androidx.work.OneTimeWorkRequest.Builder setInitialDelay(long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public androidx.work.OneTimeWorkRequest.Builder setInitialDelay(java.time.Duration);
- method public androidx.work.OneTimeWorkRequest.Builder setInputMerger(Class<? extends androidx.work.InputMerger>);
- }
-
- public interface Operation {
- method public com.google.common.util.concurrent.ListenableFuture<androidx.work.Operation.State.SUCCESS> getResult();
- method public android.arch.lifecycle.LiveData<androidx.work.Operation.State> getState();
- }
-
- public abstract static class Operation.State {
- }
-
- public static final class Operation.State.FAILURE extends androidx.work.Operation.State {
- ctor public Operation.State.FAILURE(Throwable);
- method public Throwable getThrowable();
- }
-
- public static final class Operation.State.IN_PROGRESS extends androidx.work.Operation.State {
- }
-
- public static final class Operation.State.SUCCESS extends androidx.work.Operation.State {
- }
-
- public final class OverwritingInputMerger extends androidx.work.InputMerger {
- ctor public OverwritingInputMerger();
- method public androidx.work.Data merge(java.util.List<androidx.work.Data>);
- }
-
- public final class PeriodicWorkRequest extends androidx.work.WorkRequest {
- field public static final long MIN_PERIODIC_FLEX_MILLIS = 300000L; // 0x493e0L
- field public static final long MIN_PERIODIC_INTERVAL_MILLIS = 900000L; // 0xdbba0L
- }
-
- public static final class PeriodicWorkRequest.Builder extends androidx.work.WorkRequest.Builder<androidx.work.PeriodicWorkRequest.Builder,androidx.work.PeriodicWorkRequest> {
- ctor public PeriodicWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>, long, java.util.concurrent.TimeUnit);
- ctor @RequiresApi(26) public PeriodicWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>, java.time.Duration);
- ctor public PeriodicWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>, long, java.util.concurrent.TimeUnit, long, java.util.concurrent.TimeUnit);
- ctor @RequiresApi(26) public PeriodicWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>, java.time.Duration, java.time.Duration);
- }
-
- public abstract class WorkContinuation {
- ctor public WorkContinuation();
- method public static androidx.work.WorkContinuation combine(java.util.List<androidx.work.WorkContinuation>);
- method public abstract androidx.work.Operation enqueue();
- method public abstract com.google.common.util.concurrent.ListenableFuture<java.util.List<androidx.work.WorkInfo>> getWorkInfos();
- method public abstract android.arch.lifecycle.LiveData<java.util.List<androidx.work.WorkInfo>> getWorkInfosLiveData();
- method public final androidx.work.WorkContinuation then(androidx.work.OneTimeWorkRequest);
- method public abstract androidx.work.WorkContinuation then(java.util.List<androidx.work.OneTimeWorkRequest>);
- }
-
- public final class WorkInfo {
- method public java.util.UUID getId();
- method public androidx.work.Data getOutputData();
- method public androidx.work.WorkInfo.State getState();
- method public java.util.Set<java.lang.String> getTags();
- }
-
- public enum WorkInfo.State {
- method public boolean isFinished();
- enum_constant public static final androidx.work.WorkInfo.State BLOCKED;
- enum_constant public static final androidx.work.WorkInfo.State CANCELLED;
- enum_constant public static final androidx.work.WorkInfo.State ENQUEUED;
- enum_constant public static final androidx.work.WorkInfo.State FAILED;
- enum_constant public static final androidx.work.WorkInfo.State RUNNING;
- enum_constant public static final androidx.work.WorkInfo.State SUCCEEDED;
- }
-
- public abstract class WorkManager {
- method public final androidx.work.WorkContinuation beginUniqueWork(String, androidx.work.ExistingWorkPolicy, androidx.work.OneTimeWorkRequest);
- method public abstract androidx.work.WorkContinuation beginUniqueWork(String, androidx.work.ExistingWorkPolicy, java.util.List<androidx.work.OneTimeWorkRequest>);
- method public final androidx.work.WorkContinuation beginWith(androidx.work.OneTimeWorkRequest);
- method public abstract androidx.work.WorkContinuation beginWith(java.util.List<androidx.work.OneTimeWorkRequest>);
- method public abstract androidx.work.Operation cancelAllWork();
- method public abstract androidx.work.Operation cancelAllWorkByTag(String);
- method public abstract androidx.work.Operation cancelUniqueWork(String);
- method public abstract androidx.work.Operation cancelWorkById(java.util.UUID);
- method public final androidx.work.Operation enqueue(androidx.work.WorkRequest);
- method public abstract androidx.work.Operation enqueue(java.util.List<? extends androidx.work.WorkRequest>);
- method public abstract androidx.work.Operation enqueueUniquePeriodicWork(String, androidx.work.ExistingPeriodicWorkPolicy, androidx.work.PeriodicWorkRequest);
- method public androidx.work.Operation enqueueUniqueWork(String, androidx.work.ExistingWorkPolicy, androidx.work.OneTimeWorkRequest);
- method public abstract androidx.work.Operation enqueueUniqueWork(String, androidx.work.ExistingWorkPolicy, java.util.List<androidx.work.OneTimeWorkRequest>);
- method public static androidx.work.WorkManager getInstance();
- method public abstract com.google.common.util.concurrent.ListenableFuture<java.lang.Long> getLastCancelAllTimeMillis();
- method public abstract android.arch.lifecycle.LiveData<java.lang.Long> getLastCancelAllTimeMillisLiveData();
- method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.work.WorkInfo> getWorkInfoById(java.util.UUID);
- method public abstract android.arch.lifecycle.LiveData<androidx.work.WorkInfo> getWorkInfoByIdLiveData(java.util.UUID);
- method public abstract com.google.common.util.concurrent.ListenableFuture<java.util.List<androidx.work.WorkInfo>> getWorkInfosByTag(String);
- method public abstract android.arch.lifecycle.LiveData<java.util.List<androidx.work.WorkInfo>> getWorkInfosByTagLiveData(String);
- method public abstract com.google.common.util.concurrent.ListenableFuture<java.util.List<androidx.work.WorkInfo>> getWorkInfosForUniqueWork(String);
- method public abstract android.arch.lifecycle.LiveData<java.util.List<androidx.work.WorkInfo>> getWorkInfosForUniqueWorkLiveData(String);
- method public static void initialize(android.content.Context, androidx.work.Configuration);
- method public abstract androidx.work.Operation pruneWork();
- }
-
- public abstract class WorkRequest {
- method public java.util.UUID getId();
- field public static final long DEFAULT_BACKOFF_DELAY_MILLIS = 30000L; // 0x7530L
- field public static final long MAX_BACKOFF_MILLIS = 18000000L; // 0x112a880L
- field public static final long MIN_BACKOFF_MILLIS = 10000L; // 0x2710L
- }
-
- public abstract static class WorkRequest.Builder<B extends androidx.work.WorkRequest.Builder, W extends androidx.work.WorkRequest> {
- method public final B addTag(String);
- method public final W build();
- method public final B keepResultsForAtLeast(long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public final B keepResultsForAtLeast(java.time.Duration);
- method public final B setBackoffCriteria(androidx.work.BackoffPolicy, long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public final B setBackoffCriteria(androidx.work.BackoffPolicy, java.time.Duration);
- method public final B setConstraints(androidx.work.Constraints);
- method public final B setInputData(androidx.work.Data);
- }
-
- public abstract class Worker extends androidx.work.ListenableWorker {
- ctor @Keep public Worker(android.content.Context, androidx.work.WorkerParameters);
- method @WorkerThread public abstract androidx.work.ListenableWorker.Result doWork();
- method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- }
-
- public abstract class WorkerFactory {
- ctor public WorkerFactory();
- method public abstract androidx.work.ListenableWorker? createWorker(android.content.Context, String, androidx.work.WorkerParameters);
- }
-
- public final class WorkerParameters {
- method public java.util.UUID getId();
- method public androidx.work.Data getInputData();
- method @RequiresApi(28) public android.net.Network? getNetwork();
- method public int getRunAttemptCount();
- method public java.util.Set<java.lang.String> getTags();
- method @RequiresApi(24) public java.util.List<java.lang.String> getTriggeredContentAuthorities();
- method @RequiresApi(24) public java.util.List<android.net.Uri> getTriggeredContentUris();
- }
-
-}
-
diff --git a/work/workmanager/api/1.0.0-rc02.txt b/work/workmanager/api/1.0.0-rc02.txt
deleted file mode 100644
index bc7e240..0000000
--- a/work/workmanager/api/1.0.0-rc02.txt
+++ /dev/null
@@ -1,284 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- public final class ArrayCreatingInputMerger extends androidx.work.InputMerger {
- ctor public ArrayCreatingInputMerger();
- method public androidx.work.Data merge(java.util.List<androidx.work.Data>);
- }
-
- public enum BackoffPolicy {
- enum_constant public static final androidx.work.BackoffPolicy EXPONENTIAL;
- enum_constant public static final androidx.work.BackoffPolicy LINEAR;
- }
-
- public final class Configuration {
- method public java.util.concurrent.Executor getExecutor();
- method public int getMaxJobSchedulerId();
- method public int getMinJobSchedulerId();
- method public androidx.work.WorkerFactory getWorkerFactory();
- field public static final int MIN_SCHEDULER_LIMIT = 20; // 0x14
- }
-
- public static final class Configuration.Builder {
- ctor public Configuration.Builder();
- method public androidx.work.Configuration build();
- method public androidx.work.Configuration.Builder setExecutor(java.util.concurrent.Executor);
- method public androidx.work.Configuration.Builder setJobSchedulerJobIdRange(int, int);
- method public androidx.work.Configuration.Builder setMaxSchedulerLimit(int);
- method public androidx.work.Configuration.Builder setMinimumLoggingLevel(int);
- method public androidx.work.Configuration.Builder setWorkerFactory(androidx.work.WorkerFactory);
- }
-
- public final class Constraints {
- ctor public Constraints(androidx.work.Constraints);
- method public androidx.work.NetworkType getRequiredNetworkType();
- method public boolean requiresBatteryNotLow();
- method public boolean requiresCharging();
- method @RequiresApi(23) public boolean requiresDeviceIdle();
- method public boolean requiresStorageNotLow();
- field public static final androidx.work.Constraints! NONE;
- }
-
- public static final class Constraints.Builder {
- ctor public Constraints.Builder();
- method @RequiresApi(24) public androidx.work.Constraints.Builder addContentUriTrigger(android.net.Uri, boolean);
- method public androidx.work.Constraints build();
- method public androidx.work.Constraints.Builder setRequiredNetworkType(androidx.work.NetworkType);
- method public androidx.work.Constraints.Builder setRequiresBatteryNotLow(boolean);
- method public androidx.work.Constraints.Builder setRequiresCharging(boolean);
- method @RequiresApi(23) public androidx.work.Constraints.Builder setRequiresDeviceIdle(boolean);
- method public androidx.work.Constraints.Builder setRequiresStorageNotLow(boolean);
- method @RequiresApi(24) public androidx.work.Constraints.Builder setTriggerContentMaxDelay(long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public androidx.work.Constraints.Builder setTriggerContentMaxDelay(java.time.Duration!);
- method @RequiresApi(24) public androidx.work.Constraints.Builder setTriggerContentUpdateDelay(long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public androidx.work.Constraints.Builder setTriggerContentUpdateDelay(java.time.Duration!);
- }
-
- public final class Data {
- ctor public Data(androidx.work.Data);
- method public boolean getBoolean(String, boolean);
- method public boolean[]? getBooleanArray(String);
- method public double getDouble(String, double);
- method public double[]? getDoubleArray(String);
- method public float getFloat(String, float);
- method public float[]? getFloatArray(String);
- method public int getInt(String, int);
- method public int[]? getIntArray(String);
- method public java.util.Map<java.lang.String,java.lang.Object> getKeyValueMap();
- method public long getLong(String, long);
- method public long[]? getLongArray(String);
- method public String? getString(String);
- method public String[]? getStringArray(String);
- field public static final androidx.work.Data! EMPTY;
- field public static final int MAX_DATA_BYTES = 10240; // 0x2800
- }
-
- public static final class Data.Builder {
- ctor public Data.Builder();
- method public androidx.work.Data build();
- method public androidx.work.Data.Builder putAll(androidx.work.Data);
- method public androidx.work.Data.Builder putAll(java.util.Map<java.lang.String,java.lang.Object>);
- method public androidx.work.Data.Builder putBoolean(String, boolean);
- method public androidx.work.Data.Builder putBooleanArray(String, boolean[]);
- method public androidx.work.Data.Builder putDouble(String, double);
- method public androidx.work.Data.Builder putDoubleArray(String, double[]);
- method public androidx.work.Data.Builder putFloat(String, float);
- method public androidx.work.Data.Builder putFloatArray(String, float[]);
- method public androidx.work.Data.Builder putInt(String, int);
- method public androidx.work.Data.Builder putIntArray(String, int[]);
- method public androidx.work.Data.Builder putLong(String, long);
- method public androidx.work.Data.Builder putLongArray(String, long[]);
- method public androidx.work.Data.Builder putString(String, String?);
- method public androidx.work.Data.Builder putStringArray(String, String[]);
- }
-
- public enum ExistingPeriodicWorkPolicy {
- enum_constant public static final androidx.work.ExistingPeriodicWorkPolicy KEEP;
- enum_constant public static final androidx.work.ExistingPeriodicWorkPolicy REPLACE;
- }
-
- public enum ExistingWorkPolicy {
- enum_constant public static final androidx.work.ExistingWorkPolicy APPEND;
- enum_constant public static final androidx.work.ExistingWorkPolicy KEEP;
- enum_constant public static final androidx.work.ExistingWorkPolicy REPLACE;
- }
-
- public abstract class InputMerger {
- ctor public InputMerger();
- method public abstract androidx.work.Data merge(java.util.List<androidx.work.Data>);
- }
-
- public abstract class ListenableWorker {
- ctor @Keep public ListenableWorker(android.content.Context, androidx.work.WorkerParameters);
- method public final android.content.Context getApplicationContext();
- method public final java.util.UUID getId();
- method public final androidx.work.Data getInputData();
- method @RequiresApi(28) public final android.net.Network? getNetwork();
- method public final int getRunAttemptCount();
- method public final java.util.Set<java.lang.String> getTags();
- method @RequiresApi(24) public final java.util.List<java.lang.String> getTriggeredContentAuthorities();
- method @RequiresApi(24) public final java.util.List<android.net.Uri> getTriggeredContentUris();
- method public final boolean isStopped();
- method public void onStopped();
- method @MainThread public abstract com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- }
-
- public abstract static class ListenableWorker.Result {
- method public static androidx.work.ListenableWorker.Result failure();
- method public static androidx.work.ListenableWorker.Result failure(androidx.work.Data);
- method public static androidx.work.ListenableWorker.Result retry();
- method public static androidx.work.ListenableWorker.Result success();
- method public static androidx.work.ListenableWorker.Result success(androidx.work.Data);
- }
-
- public enum NetworkType {
- enum_constant public static final androidx.work.NetworkType CONNECTED;
- enum_constant public static final androidx.work.NetworkType METERED;
- enum_constant public static final androidx.work.NetworkType NOT_REQUIRED;
- enum_constant public static final androidx.work.NetworkType NOT_ROAMING;
- enum_constant public static final androidx.work.NetworkType UNMETERED;
- }
-
- public final class OneTimeWorkRequest extends androidx.work.WorkRequest {
- method public static androidx.work.OneTimeWorkRequest from(Class<? extends androidx.work.ListenableWorker>);
- method public static java.util.List<androidx.work.OneTimeWorkRequest> from(java.util.List<java.lang.Class<? extends androidx.work.ListenableWorker>>);
- }
-
- public static final class OneTimeWorkRequest.Builder extends androidx.work.WorkRequest.Builder<androidx.work.OneTimeWorkRequest.Builder,androidx.work.OneTimeWorkRequest> {
- ctor public OneTimeWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>);
- method public androidx.work.OneTimeWorkRequest.Builder setInitialDelay(long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public androidx.work.OneTimeWorkRequest.Builder setInitialDelay(java.time.Duration);
- method public androidx.work.OneTimeWorkRequest.Builder setInputMerger(Class<? extends androidx.work.InputMerger>);
- }
-
- public interface Operation {
- method public com.google.common.util.concurrent.ListenableFuture<androidx.work.Operation.State.SUCCESS> getResult();
- method public android.arch.lifecycle.LiveData<androidx.work.Operation.State> getState();
- }
-
- public abstract static class Operation.State {
- }
-
- public static final class Operation.State.FAILURE extends androidx.work.Operation.State {
- ctor public Operation.State.FAILURE(Throwable);
- method public Throwable getThrowable();
- }
-
- public static final class Operation.State.IN_PROGRESS extends androidx.work.Operation.State {
- }
-
- public static final class Operation.State.SUCCESS extends androidx.work.Operation.State {
- }
-
- public final class OverwritingInputMerger extends androidx.work.InputMerger {
- ctor public OverwritingInputMerger();
- method public androidx.work.Data merge(java.util.List<androidx.work.Data>);
- }
-
- public final class PeriodicWorkRequest extends androidx.work.WorkRequest {
- field public static final long MIN_PERIODIC_FLEX_MILLIS = 300000L; // 0x493e0L
- field public static final long MIN_PERIODIC_INTERVAL_MILLIS = 900000L; // 0xdbba0L
- }
-
- public static final class PeriodicWorkRequest.Builder extends androidx.work.WorkRequest.Builder<androidx.work.PeriodicWorkRequest.Builder,androidx.work.PeriodicWorkRequest> {
- ctor public PeriodicWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>, long, java.util.concurrent.TimeUnit);
- ctor @RequiresApi(26) public PeriodicWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>, java.time.Duration);
- ctor public PeriodicWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>, long, java.util.concurrent.TimeUnit, long, java.util.concurrent.TimeUnit);
- ctor @RequiresApi(26) public PeriodicWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>, java.time.Duration, java.time.Duration);
- }
-
- public abstract class WorkContinuation {
- ctor public WorkContinuation();
- method public static androidx.work.WorkContinuation combine(java.util.List<androidx.work.WorkContinuation>);
- method public abstract androidx.work.Operation enqueue();
- method public abstract com.google.common.util.concurrent.ListenableFuture<java.util.List<androidx.work.WorkInfo>> getWorkInfos();
- method public abstract android.arch.lifecycle.LiveData<java.util.List<androidx.work.WorkInfo>> getWorkInfosLiveData();
- method public final androidx.work.WorkContinuation then(androidx.work.OneTimeWorkRequest);
- method public abstract androidx.work.WorkContinuation then(java.util.List<androidx.work.OneTimeWorkRequest>);
- }
-
- public final class WorkInfo {
- method public java.util.UUID getId();
- method public androidx.work.Data getOutputData();
- method public androidx.work.WorkInfo.State getState();
- method public java.util.Set<java.lang.String> getTags();
- }
-
- public enum WorkInfo.State {
- method public boolean isFinished();
- enum_constant public static final androidx.work.WorkInfo.State BLOCKED;
- enum_constant public static final androidx.work.WorkInfo.State CANCELLED;
- enum_constant public static final androidx.work.WorkInfo.State ENQUEUED;
- enum_constant public static final androidx.work.WorkInfo.State FAILED;
- enum_constant public static final androidx.work.WorkInfo.State RUNNING;
- enum_constant public static final androidx.work.WorkInfo.State SUCCEEDED;
- }
-
- public abstract class WorkManager {
- method public final androidx.work.WorkContinuation beginUniqueWork(String, androidx.work.ExistingWorkPolicy, androidx.work.OneTimeWorkRequest);
- method public abstract androidx.work.WorkContinuation beginUniqueWork(String, androidx.work.ExistingWorkPolicy, java.util.List<androidx.work.OneTimeWorkRequest>);
- method public final androidx.work.WorkContinuation beginWith(androidx.work.OneTimeWorkRequest);
- method public abstract androidx.work.WorkContinuation beginWith(java.util.List<androidx.work.OneTimeWorkRequest>);
- method public abstract androidx.work.Operation cancelAllWork();
- method public abstract androidx.work.Operation cancelAllWorkByTag(String);
- method public abstract androidx.work.Operation cancelUniqueWork(String);
- method public abstract androidx.work.Operation cancelWorkById(java.util.UUID);
- method public final androidx.work.Operation enqueue(androidx.work.WorkRequest);
- method public abstract androidx.work.Operation enqueue(java.util.List<? extends androidx.work.WorkRequest>);
- method public abstract androidx.work.Operation enqueueUniquePeriodicWork(String, androidx.work.ExistingPeriodicWorkPolicy, androidx.work.PeriodicWorkRequest);
- method public androidx.work.Operation enqueueUniqueWork(String, androidx.work.ExistingWorkPolicy, androidx.work.OneTimeWorkRequest);
- method public abstract androidx.work.Operation enqueueUniqueWork(String, androidx.work.ExistingWorkPolicy, java.util.List<androidx.work.OneTimeWorkRequest>);
- method public static androidx.work.WorkManager getInstance();
- method public abstract com.google.common.util.concurrent.ListenableFuture<java.lang.Long> getLastCancelAllTimeMillis();
- method public abstract android.arch.lifecycle.LiveData<java.lang.Long> getLastCancelAllTimeMillisLiveData();
- method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.work.WorkInfo> getWorkInfoById(java.util.UUID);
- method public abstract android.arch.lifecycle.LiveData<androidx.work.WorkInfo> getWorkInfoByIdLiveData(java.util.UUID);
- method public abstract com.google.common.util.concurrent.ListenableFuture<java.util.List<androidx.work.WorkInfo>> getWorkInfosByTag(String);
- method public abstract android.arch.lifecycle.LiveData<java.util.List<androidx.work.WorkInfo>> getWorkInfosByTagLiveData(String);
- method public abstract com.google.common.util.concurrent.ListenableFuture<java.util.List<androidx.work.WorkInfo>> getWorkInfosForUniqueWork(String);
- method public abstract android.arch.lifecycle.LiveData<java.util.List<androidx.work.WorkInfo>> getWorkInfosForUniqueWorkLiveData(String);
- method public static void initialize(android.content.Context, androidx.work.Configuration);
- method public abstract androidx.work.Operation pruneWork();
- }
-
- public abstract class WorkRequest {
- method public java.util.UUID getId();
- field public static final long DEFAULT_BACKOFF_DELAY_MILLIS = 30000L; // 0x7530L
- field public static final long MAX_BACKOFF_MILLIS = 18000000L; // 0x112a880L
- field public static final long MIN_BACKOFF_MILLIS = 10000L; // 0x2710L
- }
-
- public abstract static class WorkRequest.Builder<B extends androidx.work.WorkRequest.Builder, W extends androidx.work.WorkRequest> {
- method public final B addTag(String);
- method public final W build();
- method public final B keepResultsForAtLeast(long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public final B keepResultsForAtLeast(java.time.Duration);
- method public final B setBackoffCriteria(androidx.work.BackoffPolicy, long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public final B setBackoffCriteria(androidx.work.BackoffPolicy, java.time.Duration);
- method public final B setConstraints(androidx.work.Constraints);
- method public final B setInputData(androidx.work.Data);
- }
-
- public abstract class Worker extends androidx.work.ListenableWorker {
- ctor @Keep public Worker(android.content.Context, androidx.work.WorkerParameters);
- method @WorkerThread public abstract androidx.work.ListenableWorker.Result doWork();
- method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- }
-
- public abstract class WorkerFactory {
- ctor public WorkerFactory();
- method public abstract androidx.work.ListenableWorker? createWorker(android.content.Context, String, androidx.work.WorkerParameters);
- }
-
- public final class WorkerParameters {
- method public java.util.UUID getId();
- method public androidx.work.Data getInputData();
- method @RequiresApi(28) public android.net.Network? getNetwork();
- method public int getRunAttemptCount();
- method public java.util.Set<java.lang.String> getTags();
- method @RequiresApi(24) public java.util.List<java.lang.String> getTriggeredContentAuthorities();
- method @RequiresApi(24) public java.util.List<android.net.Uri> getTriggeredContentUris();
- }
-
-}
-
diff --git a/work/workmanager/api/1.0.0.txt b/work/workmanager/api/1.0.0.txt
deleted file mode 100644
index bc7e240..0000000
--- a/work/workmanager/api/1.0.0.txt
+++ /dev/null
@@ -1,284 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- public final class ArrayCreatingInputMerger extends androidx.work.InputMerger {
- ctor public ArrayCreatingInputMerger();
- method public androidx.work.Data merge(java.util.List<androidx.work.Data>);
- }
-
- public enum BackoffPolicy {
- enum_constant public static final androidx.work.BackoffPolicy EXPONENTIAL;
- enum_constant public static final androidx.work.BackoffPolicy LINEAR;
- }
-
- public final class Configuration {
- method public java.util.concurrent.Executor getExecutor();
- method public int getMaxJobSchedulerId();
- method public int getMinJobSchedulerId();
- method public androidx.work.WorkerFactory getWorkerFactory();
- field public static final int MIN_SCHEDULER_LIMIT = 20; // 0x14
- }
-
- public static final class Configuration.Builder {
- ctor public Configuration.Builder();
- method public androidx.work.Configuration build();
- method public androidx.work.Configuration.Builder setExecutor(java.util.concurrent.Executor);
- method public androidx.work.Configuration.Builder setJobSchedulerJobIdRange(int, int);
- method public androidx.work.Configuration.Builder setMaxSchedulerLimit(int);
- method public androidx.work.Configuration.Builder setMinimumLoggingLevel(int);
- method public androidx.work.Configuration.Builder setWorkerFactory(androidx.work.WorkerFactory);
- }
-
- public final class Constraints {
- ctor public Constraints(androidx.work.Constraints);
- method public androidx.work.NetworkType getRequiredNetworkType();
- method public boolean requiresBatteryNotLow();
- method public boolean requiresCharging();
- method @RequiresApi(23) public boolean requiresDeviceIdle();
- method public boolean requiresStorageNotLow();
- field public static final androidx.work.Constraints! NONE;
- }
-
- public static final class Constraints.Builder {
- ctor public Constraints.Builder();
- method @RequiresApi(24) public androidx.work.Constraints.Builder addContentUriTrigger(android.net.Uri, boolean);
- method public androidx.work.Constraints build();
- method public androidx.work.Constraints.Builder setRequiredNetworkType(androidx.work.NetworkType);
- method public androidx.work.Constraints.Builder setRequiresBatteryNotLow(boolean);
- method public androidx.work.Constraints.Builder setRequiresCharging(boolean);
- method @RequiresApi(23) public androidx.work.Constraints.Builder setRequiresDeviceIdle(boolean);
- method public androidx.work.Constraints.Builder setRequiresStorageNotLow(boolean);
- method @RequiresApi(24) public androidx.work.Constraints.Builder setTriggerContentMaxDelay(long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public androidx.work.Constraints.Builder setTriggerContentMaxDelay(java.time.Duration!);
- method @RequiresApi(24) public androidx.work.Constraints.Builder setTriggerContentUpdateDelay(long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public androidx.work.Constraints.Builder setTriggerContentUpdateDelay(java.time.Duration!);
- }
-
- public final class Data {
- ctor public Data(androidx.work.Data);
- method public boolean getBoolean(String, boolean);
- method public boolean[]? getBooleanArray(String);
- method public double getDouble(String, double);
- method public double[]? getDoubleArray(String);
- method public float getFloat(String, float);
- method public float[]? getFloatArray(String);
- method public int getInt(String, int);
- method public int[]? getIntArray(String);
- method public java.util.Map<java.lang.String,java.lang.Object> getKeyValueMap();
- method public long getLong(String, long);
- method public long[]? getLongArray(String);
- method public String? getString(String);
- method public String[]? getStringArray(String);
- field public static final androidx.work.Data! EMPTY;
- field public static final int MAX_DATA_BYTES = 10240; // 0x2800
- }
-
- public static final class Data.Builder {
- ctor public Data.Builder();
- method public androidx.work.Data build();
- method public androidx.work.Data.Builder putAll(androidx.work.Data);
- method public androidx.work.Data.Builder putAll(java.util.Map<java.lang.String,java.lang.Object>);
- method public androidx.work.Data.Builder putBoolean(String, boolean);
- method public androidx.work.Data.Builder putBooleanArray(String, boolean[]);
- method public androidx.work.Data.Builder putDouble(String, double);
- method public androidx.work.Data.Builder putDoubleArray(String, double[]);
- method public androidx.work.Data.Builder putFloat(String, float);
- method public androidx.work.Data.Builder putFloatArray(String, float[]);
- method public androidx.work.Data.Builder putInt(String, int);
- method public androidx.work.Data.Builder putIntArray(String, int[]);
- method public androidx.work.Data.Builder putLong(String, long);
- method public androidx.work.Data.Builder putLongArray(String, long[]);
- method public androidx.work.Data.Builder putString(String, String?);
- method public androidx.work.Data.Builder putStringArray(String, String[]);
- }
-
- public enum ExistingPeriodicWorkPolicy {
- enum_constant public static final androidx.work.ExistingPeriodicWorkPolicy KEEP;
- enum_constant public static final androidx.work.ExistingPeriodicWorkPolicy REPLACE;
- }
-
- public enum ExistingWorkPolicy {
- enum_constant public static final androidx.work.ExistingWorkPolicy APPEND;
- enum_constant public static final androidx.work.ExistingWorkPolicy KEEP;
- enum_constant public static final androidx.work.ExistingWorkPolicy REPLACE;
- }
-
- public abstract class InputMerger {
- ctor public InputMerger();
- method public abstract androidx.work.Data merge(java.util.List<androidx.work.Data>);
- }
-
- public abstract class ListenableWorker {
- ctor @Keep public ListenableWorker(android.content.Context, androidx.work.WorkerParameters);
- method public final android.content.Context getApplicationContext();
- method public final java.util.UUID getId();
- method public final androidx.work.Data getInputData();
- method @RequiresApi(28) public final android.net.Network? getNetwork();
- method public final int getRunAttemptCount();
- method public final java.util.Set<java.lang.String> getTags();
- method @RequiresApi(24) public final java.util.List<java.lang.String> getTriggeredContentAuthorities();
- method @RequiresApi(24) public final java.util.List<android.net.Uri> getTriggeredContentUris();
- method public final boolean isStopped();
- method public void onStopped();
- method @MainThread public abstract com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- }
-
- public abstract static class ListenableWorker.Result {
- method public static androidx.work.ListenableWorker.Result failure();
- method public static androidx.work.ListenableWorker.Result failure(androidx.work.Data);
- method public static androidx.work.ListenableWorker.Result retry();
- method public static androidx.work.ListenableWorker.Result success();
- method public static androidx.work.ListenableWorker.Result success(androidx.work.Data);
- }
-
- public enum NetworkType {
- enum_constant public static final androidx.work.NetworkType CONNECTED;
- enum_constant public static final androidx.work.NetworkType METERED;
- enum_constant public static final androidx.work.NetworkType NOT_REQUIRED;
- enum_constant public static final androidx.work.NetworkType NOT_ROAMING;
- enum_constant public static final androidx.work.NetworkType UNMETERED;
- }
-
- public final class OneTimeWorkRequest extends androidx.work.WorkRequest {
- method public static androidx.work.OneTimeWorkRequest from(Class<? extends androidx.work.ListenableWorker>);
- method public static java.util.List<androidx.work.OneTimeWorkRequest> from(java.util.List<java.lang.Class<? extends androidx.work.ListenableWorker>>);
- }
-
- public static final class OneTimeWorkRequest.Builder extends androidx.work.WorkRequest.Builder<androidx.work.OneTimeWorkRequest.Builder,androidx.work.OneTimeWorkRequest> {
- ctor public OneTimeWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>);
- method public androidx.work.OneTimeWorkRequest.Builder setInitialDelay(long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public androidx.work.OneTimeWorkRequest.Builder setInitialDelay(java.time.Duration);
- method public androidx.work.OneTimeWorkRequest.Builder setInputMerger(Class<? extends androidx.work.InputMerger>);
- }
-
- public interface Operation {
- method public com.google.common.util.concurrent.ListenableFuture<androidx.work.Operation.State.SUCCESS> getResult();
- method public android.arch.lifecycle.LiveData<androidx.work.Operation.State> getState();
- }
-
- public abstract static class Operation.State {
- }
-
- public static final class Operation.State.FAILURE extends androidx.work.Operation.State {
- ctor public Operation.State.FAILURE(Throwable);
- method public Throwable getThrowable();
- }
-
- public static final class Operation.State.IN_PROGRESS extends androidx.work.Operation.State {
- }
-
- public static final class Operation.State.SUCCESS extends androidx.work.Operation.State {
- }
-
- public final class OverwritingInputMerger extends androidx.work.InputMerger {
- ctor public OverwritingInputMerger();
- method public androidx.work.Data merge(java.util.List<androidx.work.Data>);
- }
-
- public final class PeriodicWorkRequest extends androidx.work.WorkRequest {
- field public static final long MIN_PERIODIC_FLEX_MILLIS = 300000L; // 0x493e0L
- field public static final long MIN_PERIODIC_INTERVAL_MILLIS = 900000L; // 0xdbba0L
- }
-
- public static final class PeriodicWorkRequest.Builder extends androidx.work.WorkRequest.Builder<androidx.work.PeriodicWorkRequest.Builder,androidx.work.PeriodicWorkRequest> {
- ctor public PeriodicWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>, long, java.util.concurrent.TimeUnit);
- ctor @RequiresApi(26) public PeriodicWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>, java.time.Duration);
- ctor public PeriodicWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>, long, java.util.concurrent.TimeUnit, long, java.util.concurrent.TimeUnit);
- ctor @RequiresApi(26) public PeriodicWorkRequest.Builder(Class<? extends androidx.work.ListenableWorker>, java.time.Duration, java.time.Duration);
- }
-
- public abstract class WorkContinuation {
- ctor public WorkContinuation();
- method public static androidx.work.WorkContinuation combine(java.util.List<androidx.work.WorkContinuation>);
- method public abstract androidx.work.Operation enqueue();
- method public abstract com.google.common.util.concurrent.ListenableFuture<java.util.List<androidx.work.WorkInfo>> getWorkInfos();
- method public abstract android.arch.lifecycle.LiveData<java.util.List<androidx.work.WorkInfo>> getWorkInfosLiveData();
- method public final androidx.work.WorkContinuation then(androidx.work.OneTimeWorkRequest);
- method public abstract androidx.work.WorkContinuation then(java.util.List<androidx.work.OneTimeWorkRequest>);
- }
-
- public final class WorkInfo {
- method public java.util.UUID getId();
- method public androidx.work.Data getOutputData();
- method public androidx.work.WorkInfo.State getState();
- method public java.util.Set<java.lang.String> getTags();
- }
-
- public enum WorkInfo.State {
- method public boolean isFinished();
- enum_constant public static final androidx.work.WorkInfo.State BLOCKED;
- enum_constant public static final androidx.work.WorkInfo.State CANCELLED;
- enum_constant public static final androidx.work.WorkInfo.State ENQUEUED;
- enum_constant public static final androidx.work.WorkInfo.State FAILED;
- enum_constant public static final androidx.work.WorkInfo.State RUNNING;
- enum_constant public static final androidx.work.WorkInfo.State SUCCEEDED;
- }
-
- public abstract class WorkManager {
- method public final androidx.work.WorkContinuation beginUniqueWork(String, androidx.work.ExistingWorkPolicy, androidx.work.OneTimeWorkRequest);
- method public abstract androidx.work.WorkContinuation beginUniqueWork(String, androidx.work.ExistingWorkPolicy, java.util.List<androidx.work.OneTimeWorkRequest>);
- method public final androidx.work.WorkContinuation beginWith(androidx.work.OneTimeWorkRequest);
- method public abstract androidx.work.WorkContinuation beginWith(java.util.List<androidx.work.OneTimeWorkRequest>);
- method public abstract androidx.work.Operation cancelAllWork();
- method public abstract androidx.work.Operation cancelAllWorkByTag(String);
- method public abstract androidx.work.Operation cancelUniqueWork(String);
- method public abstract androidx.work.Operation cancelWorkById(java.util.UUID);
- method public final androidx.work.Operation enqueue(androidx.work.WorkRequest);
- method public abstract androidx.work.Operation enqueue(java.util.List<? extends androidx.work.WorkRequest>);
- method public abstract androidx.work.Operation enqueueUniquePeriodicWork(String, androidx.work.ExistingPeriodicWorkPolicy, androidx.work.PeriodicWorkRequest);
- method public androidx.work.Operation enqueueUniqueWork(String, androidx.work.ExistingWorkPolicy, androidx.work.OneTimeWorkRequest);
- method public abstract androidx.work.Operation enqueueUniqueWork(String, androidx.work.ExistingWorkPolicy, java.util.List<androidx.work.OneTimeWorkRequest>);
- method public static androidx.work.WorkManager getInstance();
- method public abstract com.google.common.util.concurrent.ListenableFuture<java.lang.Long> getLastCancelAllTimeMillis();
- method public abstract android.arch.lifecycle.LiveData<java.lang.Long> getLastCancelAllTimeMillisLiveData();
- method public abstract com.google.common.util.concurrent.ListenableFuture<androidx.work.WorkInfo> getWorkInfoById(java.util.UUID);
- method public abstract android.arch.lifecycle.LiveData<androidx.work.WorkInfo> getWorkInfoByIdLiveData(java.util.UUID);
- method public abstract com.google.common.util.concurrent.ListenableFuture<java.util.List<androidx.work.WorkInfo>> getWorkInfosByTag(String);
- method public abstract android.arch.lifecycle.LiveData<java.util.List<androidx.work.WorkInfo>> getWorkInfosByTagLiveData(String);
- method public abstract com.google.common.util.concurrent.ListenableFuture<java.util.List<androidx.work.WorkInfo>> getWorkInfosForUniqueWork(String);
- method public abstract android.arch.lifecycle.LiveData<java.util.List<androidx.work.WorkInfo>> getWorkInfosForUniqueWorkLiveData(String);
- method public static void initialize(android.content.Context, androidx.work.Configuration);
- method public abstract androidx.work.Operation pruneWork();
- }
-
- public abstract class WorkRequest {
- method public java.util.UUID getId();
- field public static final long DEFAULT_BACKOFF_DELAY_MILLIS = 30000L; // 0x7530L
- field public static final long MAX_BACKOFF_MILLIS = 18000000L; // 0x112a880L
- field public static final long MIN_BACKOFF_MILLIS = 10000L; // 0x2710L
- }
-
- public abstract static class WorkRequest.Builder<B extends androidx.work.WorkRequest.Builder, W extends androidx.work.WorkRequest> {
- method public final B addTag(String);
- method public final W build();
- method public final B keepResultsForAtLeast(long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public final B keepResultsForAtLeast(java.time.Duration);
- method public final B setBackoffCriteria(androidx.work.BackoffPolicy, long, java.util.concurrent.TimeUnit);
- method @RequiresApi(26) public final B setBackoffCriteria(androidx.work.BackoffPolicy, java.time.Duration);
- method public final B setConstraints(androidx.work.Constraints);
- method public final B setInputData(androidx.work.Data);
- }
-
- public abstract class Worker extends androidx.work.ListenableWorker {
- ctor @Keep public Worker(android.content.Context, androidx.work.WorkerParameters);
- method @WorkerThread public abstract androidx.work.ListenableWorker.Result doWork();
- method public final com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- }
-
- public abstract class WorkerFactory {
- ctor public WorkerFactory();
- method public abstract androidx.work.ListenableWorker? createWorker(android.content.Context, String, androidx.work.WorkerParameters);
- }
-
- public final class WorkerParameters {
- method public java.util.UUID getId();
- method public androidx.work.Data getInputData();
- method @RequiresApi(28) public android.net.Network? getNetwork();
- method public int getRunAttemptCount();
- method public java.util.Set<java.lang.String> getTags();
- method @RequiresApi(24) public java.util.List<java.lang.String> getTriggeredContentAuthorities();
- method @RequiresApi(24) public java.util.List<android.net.Uri> getTriggeredContentUris();
- }
-
-}
-
diff --git a/work/workmanager/api/current.txt b/work/workmanager/api/current.txt
index bc7e240..9be7492 100644
--- a/work/workmanager/api/current.txt
+++ b/work/workmanager/api/current.txt
@@ -1,4 +1,4 @@
-// Signature format: 3.0
+// Signature format: 2.0
package androidx.work {
public final class ArrayCreatingInputMerger extends androidx.work.InputMerger {
@@ -204,7 +204,7 @@
method public java.util.Set<java.lang.String> getTags();
}
- public enum WorkInfo.State {
+ public static enum WorkInfo.State {
method public boolean isFinished();
enum_constant public static final androidx.work.WorkInfo.State BLOCKED;
enum_constant public static final androidx.work.WorkInfo.State CANCELLED;
diff --git a/work/workmanager/api/res-1.0.0-rc01.txt b/work/workmanager/api/res-1.0.0-rc01.txt
deleted file mode 100644
index e69de29..0000000
--- a/work/workmanager/api/res-1.0.0-rc01.txt
+++ /dev/null
diff --git a/work/workmanager/api/res-1.0.0-rc02.txt b/work/workmanager/api/res-1.0.0-rc02.txt
deleted file mode 100644
index e69de29..0000000
--- a/work/workmanager/api/res-1.0.0-rc02.txt
+++ /dev/null
diff --git a/work/workmanager/api/res-1.0.0.txt b/work/workmanager/api/res-1.0.0.txt
deleted file mode 100644
index e69de29..0000000
--- a/work/workmanager/api/res-1.0.0.txt
+++ /dev/null
diff --git a/work/workmanager/api/restricted_1.0.0-beta04.txt b/work/workmanager/api/restricted_1.0.0-beta04.txt
deleted file mode 100644
index 2f83561..0000000
--- a/work/workmanager/api/restricted_1.0.0-beta04.txt
+++ /dev/null
@@ -1,690 +0,0 @@
-// Signature format: 3.0
-package androidx.work {
-
- public final class Configuration {
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @IntRange(from=20L, to=50L) public int getMaxSchedulerLimit();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY}) public int getMinimumLoggingLevel();
- }
-
- public final class Constraints {
- ctor @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public Constraints();
- method @RequiresApi(24) @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.ContentUriTriggers getContentUriTriggers();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public long getTriggerContentUpdateDelay();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public long getTriggerMaxContentDelay();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(24) public boolean hasContentUriTriggers();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(24) public void setContentUriTriggers(androidx.work.ContentUriTriggers?);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setRequiredNetworkType(androidx.work.NetworkType);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setRequiresBatteryNotLow(boolean);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setRequiresCharging(boolean);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(23) public void setRequiresDeviceIdle(boolean);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setRequiresStorageNotLow(boolean);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setTriggerContentUpdateDelay(long);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setTriggerMaxContentDelay(long);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class ContentUriTriggers {
- ctor public ContentUriTriggers();
- method public void add(android.net.Uri, boolean);
- method public boolean equals(Object?);
- method public java.util.Set<androidx.work.ContentUriTriggers.Trigger> getTriggers();
- method public int hashCode();
- method public int size();
- }
-
- public static final class ContentUriTriggers.Trigger {
- method public boolean equals(Object?);
- method public android.net.Uri getUri();
- method public int hashCode();
- method public boolean shouldTriggerForDescendants();
- }
-
- public final class Data {
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.work.Data fromByteArray(byte[]);
- method @VisibleForTesting @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public int size();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static byte[] toByteArray(androidx.work.Data);
- }
-
- public static final class Data.Builder {
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.Data.Builder put(String, Object?);
- }
-
- public abstract class InputMerger {
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.work.InputMerger! fromClassName(String!);
- }
-
- public abstract class ListenableWorker {
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public java.util.concurrent.Executor getBackgroundExecutor();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.impl.utils.taskexecutor.TaskExecutor getTaskExecutor();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.WorkerFactory getWorkerFactory();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final boolean isUsed();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final void setUsed();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final void stop();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final class ListenableWorker.Result.Failure extends androidx.work.ListenableWorker.Result {
- ctor public ListenableWorker.Result.Failure();
- ctor public ListenableWorker.Result.Failure(androidx.work.Data);
- method public boolean equals(Object?);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.Data! getOutputData();
- method public int hashCode();
- method public String toString();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final class ListenableWorker.Result.Retry extends androidx.work.ListenableWorker.Result {
- ctor public ListenableWorker.Result.Retry();
- method public boolean equals(Object?);
- method public int hashCode();
- method public String toString();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final class ListenableWorker.Result.Success extends androidx.work.ListenableWorker.Result {
- ctor public ListenableWorker.Result.Success();
- ctor public ListenableWorker.Result.Success(androidx.work.Data);
- method public boolean equals(Object?);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.Data! getOutputData();
- method public int hashCode();
- method public String toString();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class Logger {
- ctor public Logger(int);
- method public abstract void debug(String!, String!, java.lang.Throwable...!);
- method public abstract void error(String!, String!, java.lang.Throwable...!);
- method public static androidx.work.Logger! get();
- method public abstract void info(String!, String!, java.lang.Throwable...!);
- method public static void setLogger(androidx.work.Logger!);
- method public static String! tagWithPrefix(String);
- method public abstract void verbose(String!, String!, java.lang.Throwable...!);
- method public abstract void warning(String!, String!, java.lang.Throwable...!);
- }
-
- public static class Logger.LogcatLogger extends androidx.work.Logger {
- ctor public Logger.LogcatLogger(int);
- method public void debug(String!, String!, java.lang.Throwable...!);
- method public void error(String!, String!, java.lang.Throwable...!);
- method public void info(String!, String!, java.lang.Throwable...!);
- method public void verbose(String!, String!, java.lang.Throwable...!);
- method public void warning(String!, String!, java.lang.Throwable...!);
- }
-
- public interface Operation {
- field @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final androidx.work.Operation.State.IN_PROGRESS! IN_PROGRESS;
- field @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static final androidx.work.Operation.State.SUCCESS! SUCCESS;
- }
-
- public abstract class WorkContinuation {
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected abstract androidx.work.WorkContinuation combineInternal(java.util.List<androidx.work.WorkContinuation>);
- }
-
- public final class WorkInfo {
- ctor @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public WorkInfo(java.util.UUID, androidx.work.WorkInfo.State, androidx.work.Data, java.util.List<java.lang.String>);
- }
-
- public abstract class WorkManager {
- ctor @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected WorkManager();
- }
-
- public abstract class WorkRequest {
- ctor @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) protected WorkRequest(java.util.UUID, androidx.work.impl.model.WorkSpec, java.util.Set<java.lang.String>);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public String getStringId();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public java.util.Set<java.lang.String> getTags();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.impl.model.WorkSpec getWorkSpec();
- }
-
- public abstract static class WorkRequest.Builder<B extends androidx.work.WorkRequest.Builder, W extends androidx.work.WorkRequest> {
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @VisibleForTesting public final B setInitialRunAttemptCount(int);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @VisibleForTesting public final B setInitialState(androidx.work.WorkInfo.State);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @VisibleForTesting public final B setPeriodStartTime(long, java.util.concurrent.TimeUnit);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @VisibleForTesting public final B setScheduleRequestedAt(long, java.util.concurrent.TimeUnit);
- }
-
- public abstract class WorkerFactory {
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final androidx.work.ListenableWorker? createWorkerWithDefaultFallback(android.content.Context, String, androidx.work.WorkerParameters);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.work.WorkerFactory! getDefaultWorkerFactory();
- }
-
- public final class WorkerParameters {
- ctor @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public WorkerParameters(java.util.UUID, androidx.work.Data, java.util.Collection<java.lang.String>, androidx.work.WorkerParameters.RuntimeExtras, int, java.util.concurrent.Executor, androidx.work.impl.utils.taskexecutor.TaskExecutor, androidx.work.WorkerFactory);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public java.util.concurrent.Executor getBackgroundExecutor();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.impl.utils.taskexecutor.TaskExecutor getTaskExecutor();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.WorkerFactory getWorkerFactory();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class WorkerParameters.RuntimeExtras {
- ctor public WorkerParameters.RuntimeExtras();
- field @RequiresApi(28) public android.net.Network! network;
- field public java.util.List<java.lang.String> triggeredContentAuthorities;
- field public java.util.List<android.net.Uri> triggeredContentUris;
- }
-
-}
-
-package @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) androidx.work.impl {
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface ExecutionListener {
- method public void onExecuted(String, boolean);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class OperationImpl implements androidx.work.Operation {
- ctor public OperationImpl();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.work.Operation.State.SUCCESS> getResult();
- method public android.arch.lifecycle.LiveData<androidx.work.Operation.State> getState();
- method public void setState(androidx.work.Operation.State);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class Processor implements androidx.work.impl.ExecutionListener {
- ctor public Processor(android.content.Context!, androidx.work.Configuration!, androidx.work.impl.utils.taskexecutor.TaskExecutor!, androidx.work.impl.WorkDatabase!, java.util.List<androidx.work.impl.Scheduler>!);
- method public void addExecutionListener(androidx.work.impl.ExecutionListener!);
- method public boolean hasWork();
- method public boolean isCancelled(String!);
- method public boolean isEnqueued(String);
- method public void onExecuted(String, boolean);
- method public void removeExecutionListener(androidx.work.impl.ExecutionListener!);
- method public boolean startWork(String!);
- method public boolean startWork(String!, androidx.work.WorkerParameters.RuntimeExtras!);
- method public boolean stopAndCancelWork(String!);
- method public boolean stopWork(String!);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface Scheduler {
- method public void cancel(String);
- method public void schedule(androidx.work.impl.model.WorkSpec...!);
- field public static final int MAX_SCHEDULER_LIMIT = 50; // 0x32
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class Schedulers {
- method public static void schedule(androidx.work.Configuration, androidx.work.impl.WorkDatabase, java.util.List<androidx.work.impl.Scheduler>!);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WorkContinuationImpl extends androidx.work.WorkContinuation {
- method protected androidx.work.WorkContinuation combineInternal(java.util.List<androidx.work.WorkContinuation>);
- method public androidx.work.Operation enqueue();
- method public java.util.List<java.lang.String>! getAllIds();
- method public androidx.work.ExistingWorkPolicy! getExistingWorkPolicy();
- method public java.util.List<java.lang.String> getIds();
- method public String? getName();
- method public java.util.List<androidx.work.impl.WorkContinuationImpl>! getParents();
- method public java.util.List<? extends androidx.work.WorkRequest> getWork();
- method public com.google.common.util.concurrent.ListenableFuture<java.util.List<androidx.work.WorkInfo>> getWorkInfos();
- method public android.arch.lifecycle.LiveData<java.util.List<androidx.work.WorkInfo>> getWorkInfosLiveData();
- method public androidx.work.impl.WorkManagerImpl getWorkManagerImpl();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public boolean hasCycles();
- method public boolean isEnqueued();
- method public void markEnqueued();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static java.util.Set<java.lang.String>! prerequisitesFor(androidx.work.impl.WorkContinuationImpl!);
- method public androidx.work.WorkContinuation then(java.util.List<androidx.work.OneTimeWorkRequest>!);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class WorkDatabase {
- ctor public WorkDatabase();
- method public static androidx.work.impl.WorkDatabase! create(android.content.Context!, boolean);
- method public abstract androidx.work.impl.model.DependencyDao! dependencyDao();
- method public abstract androidx.work.impl.model.SystemIdInfoDao! systemIdInfoDao();
- method public abstract androidx.work.impl.model.WorkNameDao! workNameDao();
- method public abstract androidx.work.impl.model.WorkSpecDao! workSpecDao();
- method public abstract androidx.work.impl.model.WorkTagDao! workTagDao();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WorkDatabaseMigrations {
- field public static android.arch.persistence.room.migration.Migration! MIGRATION_1_2;
- field public static android.arch.persistence.room.migration.Migration! MIGRATION_3_4;
- field public static android.arch.persistence.room.migration.Migration! MIGRATION_4_5;
- field public static final int VERSION_1 = 1; // 0x1
- field public static final int VERSION_2 = 2; // 0x2
- field public static final int VERSION_3 = 3; // 0x3
- field public static final int VERSION_4 = 4; // 0x4
- field public static final int VERSION_5 = 5; // 0x5
- }
-
- public static class WorkDatabaseMigrations.WorkMigration {
- ctor public WorkDatabaseMigrations.WorkMigration(android.content.Context, int, int);
- method public void migrate(android.arch.persistence.db.SupportSQLiteDatabase);
- }
-
- public class WorkDatabase_Impl extends androidx.work.impl.WorkDatabase {
- method public androidx.work.impl.model.DependencyDao! dependencyDao();
- method public androidx.work.impl.model.SystemIdInfoDao! systemIdInfoDao();
- method public androidx.work.impl.model.WorkNameDao! workNameDao();
- method public androidx.work.impl.model.WorkSpecDao! workSpecDao();
- method public androidx.work.impl.model.WorkTagDao! workTagDao();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WorkManagerImpl extends androidx.work.WorkManager {
- ctor @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public WorkManagerImpl(android.content.Context, androidx.work.Configuration, androidx.work.impl.utils.taskexecutor.TaskExecutor);
- ctor @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public WorkManagerImpl(android.content.Context, androidx.work.Configuration, androidx.work.impl.utils.taskexecutor.TaskExecutor, boolean);
- ctor @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public WorkManagerImpl(android.content.Context, androidx.work.Configuration, androidx.work.impl.utils.taskexecutor.TaskExecutor, androidx.work.impl.WorkDatabase, java.util.List<androidx.work.impl.Scheduler>, androidx.work.impl.Processor);
- method public androidx.work.WorkContinuation beginUniqueWork(String, androidx.work.ExistingWorkPolicy, java.util.List<androidx.work.OneTimeWorkRequest>);
- method public androidx.work.WorkContinuation beginWith(java.util.List<androidx.work.OneTimeWorkRequest>);
- method public androidx.work.Operation cancelAllWork();
- method public androidx.work.Operation cancelAllWorkByTag(String);
- method public androidx.work.Operation cancelUniqueWork(String);
- method public androidx.work.Operation cancelWorkById(java.util.UUID);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public java.util.List<androidx.work.impl.Scheduler> createSchedulers(android.content.Context!);
- method public androidx.work.Operation enqueue(java.util.List<? extends androidx.work.WorkRequest>);
- method public androidx.work.Operation enqueueUniquePeriodicWork(String, androidx.work.ExistingPeriodicWorkPolicy, androidx.work.PeriodicWorkRequest);
- method public androidx.work.Operation enqueueUniqueWork(String, androidx.work.ExistingWorkPolicy, java.util.List<androidx.work.OneTimeWorkRequest>);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public android.content.Context! getApplicationContext();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.Configuration getConfiguration();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static androidx.work.impl.WorkManagerImpl? getInstance();
- method public com.google.common.util.concurrent.ListenableFuture<java.lang.Long> getLastCancelAllTimeMillis();
- method public android.arch.lifecycle.LiveData<java.lang.Long> getLastCancelAllTimeMillisLiveData();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.impl.utils.Preferences getPreferences();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.impl.Processor getProcessor();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public java.util.List<androidx.work.impl.Scheduler> getSchedulers();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.impl.WorkDatabase! getWorkDatabase();
- method public com.google.common.util.concurrent.ListenableFuture<androidx.work.WorkInfo> getWorkInfoById(java.util.UUID);
- method public android.arch.lifecycle.LiveData<androidx.work.WorkInfo> getWorkInfoByIdLiveData(java.util.UUID);
- method public com.google.common.util.concurrent.ListenableFuture<java.util.List<androidx.work.WorkInfo>> getWorkInfosByTag(String);
- method public android.arch.lifecycle.LiveData<java.util.List<androidx.work.WorkInfo>> getWorkInfosByTagLiveData(String);
- method public com.google.common.util.concurrent.ListenableFuture<java.util.List<androidx.work.WorkInfo>> getWorkInfosForUniqueWork(String);
- method public android.arch.lifecycle.LiveData<java.util.List<androidx.work.WorkInfo>> getWorkInfosForUniqueWorkLiveData(String);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public androidx.work.impl.utils.taskexecutor.TaskExecutor getWorkTaskExecutor();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static void initialize(android.content.Context, androidx.work.Configuration);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void onForceStopRunnableCompleted();
- method public androidx.work.Operation pruneWork();
- method public void rescheduleEligibleWork();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static void setDelegate(androidx.work.impl.WorkManagerImpl!);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void setReschedulePendingResult(android.content.BroadcastReceiver.PendingResult);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void startWork(String!);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void startWork(String!, androidx.work.WorkerParameters.RuntimeExtras!);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void stopWork(String!);
- field public static final int MAX_PRE_JOB_SCHEDULER_API_LEVEL = 22; // 0x16
- field public static final int MIN_JOB_SCHEDULER_API_LEVEL = 23; // 0x17
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WorkManagerInitializer {
- ctor public WorkManagerInitializer();
- method public int delete(android.net.Uri, String?, String[]?);
- method public String? getType(android.net.Uri);
- method public android.net.Uri? insert(android.net.Uri, android.content.ContentValues?);
- method public boolean onCreate();
- method public android.database.Cursor? query(android.net.Uri, String[]?, String?, String[]?, String?);
- method public int update(android.net.Uri, android.content.ContentValues?, String?, String[]?);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WorkerWrapper {
- method public com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> getFuture();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public void interrupt(boolean);
- method @WorkerThread public void run();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class WorkerWrapper.Builder {
- ctor public WorkerWrapper.Builder(android.content.Context, androidx.work.Configuration, androidx.work.impl.utils.taskexecutor.TaskExecutor, androidx.work.impl.WorkDatabase, String);
- method public androidx.work.impl.WorkerWrapper! build();
- method public androidx.work.impl.WorkerWrapper.Builder! withRuntimeExtras(androidx.work.WorkerParameters.RuntimeExtras!);
- method public androidx.work.impl.WorkerWrapper.Builder! withSchedulers(java.util.List<androidx.work.impl.Scheduler>!);
- method @VisibleForTesting public androidx.work.impl.WorkerWrapper.Builder! withWorker(androidx.work.ListenableWorker!);
- }
-
-}
-
-package androidx.work.impl.background.greedy {
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class GreedyScheduler implements androidx.work.impl.ExecutionListener androidx.work.impl.Scheduler androidx.work.impl.constraints.WorkConstraintsCallback {
- ctor public GreedyScheduler(android.content.Context!, androidx.work.impl.WorkManagerImpl!);
- ctor @VisibleForTesting public GreedyScheduler(androidx.work.impl.WorkManagerImpl!, androidx.work.impl.constraints.WorkConstraintsTracker!);
- method public void cancel(String);
- method public void onAllConstraintsMet(java.util.List<java.lang.String>);
- method public void onAllConstraintsNotMet(java.util.List<java.lang.String>);
- method public void onExecuted(String, boolean);
- method public void schedule(androidx.work.impl.model.WorkSpec...!);
- }
-
-}
-
-package @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) androidx.work.impl.background.systemalarm {
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class CommandHandler implements androidx.work.impl.ExecutionListener {
- method public void onExecuted(String, boolean);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class DelayMetCommandHandler implements androidx.work.impl.ExecutionListener androidx.work.impl.constraints.WorkConstraintsCallback {
- method public void onAllConstraintsMet(java.util.List<java.lang.String>);
- method public void onAllConstraintsNotMet(java.util.List<java.lang.String>);
- method public void onExecuted(String, boolean);
- method public void onTimeLimitExceeded(String);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class SystemAlarmDispatcher implements androidx.work.impl.ExecutionListener {
- method @MainThread public boolean add(android.content.Intent, int);
- method public void onExecuted(String, boolean);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class SystemAlarmScheduler implements androidx.work.impl.Scheduler {
- ctor public SystemAlarmScheduler(android.content.Context);
- method public void cancel(String);
- method public void schedule(androidx.work.impl.model.WorkSpec...!);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class SystemAlarmService {
- ctor public SystemAlarmService();
- method @MainThread public void onAllCommandsCompleted();
- method public void onCreate();
- method public void onDestroy();
- method public int onStartCommand(android.content.Intent!, int, int);
- }
-
-}
-
-package @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) androidx.work.impl.background.systemjob {
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(23) public class SystemJobScheduler implements androidx.work.impl.Scheduler {
- ctor public SystemJobScheduler(android.content.Context, androidx.work.impl.WorkManagerImpl);
- ctor @VisibleForTesting public SystemJobScheduler(android.content.Context!, androidx.work.impl.WorkManagerImpl!, android.app.job.JobScheduler!, androidx.work.impl.background.systemjob.SystemJobInfoConverter!);
- method public void cancel(String);
- method public static void jobSchedulerCancelAll(android.content.Context);
- method public void schedule(androidx.work.impl.model.WorkSpec...!);
- method @VisibleForTesting public void scheduleInternal(androidx.work.impl.model.WorkSpec!, int);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RequiresApi(23) public class SystemJobService implements androidx.work.impl.ExecutionListener {
- ctor public SystemJobService();
- method public void onCreate();
- method public void onDestroy();
- method public void onExecuted(String, boolean);
- method public boolean onStartJob(android.app.job.JobParameters!);
- method public boolean onStopJob(android.app.job.JobParameters!);
- }
-
-}
-
-package @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) androidx.work.impl.constraints.trackers {
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class BatteryChargingTracker extends androidx.work.impl.constraints.trackers.BroadcastReceiverConstraintTracker<java.lang.Boolean> {
- ctor public BatteryChargingTracker(android.content.Context!);
- method public Boolean! getInitialState();
- method public android.content.IntentFilter! getIntentFilter();
- method public void onBroadcastReceive(android.content.Context!, android.content.Intent);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class BatteryNotLowTracker extends androidx.work.impl.constraints.trackers.BroadcastReceiverConstraintTracker<java.lang.Boolean> {
- ctor public BatteryNotLowTracker(android.content.Context!);
- method public Boolean! getInitialState();
- method public android.content.IntentFilter! getIntentFilter();
- method public void onBroadcastReceive(android.content.Context!, android.content.Intent);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class BroadcastReceiverConstraintTracker<T> extends androidx.work.impl.constraints.trackers.ConstraintTracker<T> {
- ctor public BroadcastReceiverConstraintTracker(android.content.Context!);
- method public abstract android.content.IntentFilter! getIntentFilter();
- method public abstract void onBroadcastReceive(android.content.Context!, android.content.Intent);
- method public void startTracking();
- method public void stopTracking();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class ConstraintTracker<T> {
- method public void addListener(androidx.work.impl.constraints.ConstraintListener<T>!);
- method public abstract T! getInitialState();
- method public void removeListener(androidx.work.impl.constraints.ConstraintListener<T>!);
- method public void setState(T!);
- method public abstract void startTracking();
- method public abstract void stopTracking();
- field protected final android.content.Context! mAppContext;
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class NetworkStateTracker extends androidx.work.impl.constraints.trackers.ConstraintTracker<androidx.work.impl.constraints.NetworkState> {
- ctor public NetworkStateTracker(android.content.Context!);
- method public androidx.work.impl.constraints.NetworkState! getInitialState();
- method public void startTracking();
- method public void stopTracking();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class StorageNotLowTracker extends androidx.work.impl.constraints.trackers.BroadcastReceiverConstraintTracker<java.lang.Boolean> {
- ctor public StorageNotLowTracker(android.content.Context!);
- method public Boolean! getInitialState();
- method public android.content.IntentFilter! getIntentFilter();
- method public void onBroadcastReceive(android.content.Context!, android.content.Intent);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class Trackers {
- method public androidx.work.impl.constraints.trackers.BatteryChargingTracker! getBatteryChargingTracker();
- method public androidx.work.impl.constraints.trackers.BatteryNotLowTracker! getBatteryNotLowTracker();
- method public static androidx.work.impl.constraints.trackers.Trackers! getInstance(android.content.Context!);
- method public androidx.work.impl.constraints.trackers.NetworkStateTracker! getNetworkStateTracker();
- method public androidx.work.impl.constraints.trackers.StorageNotLowTracker! getStorageNotLowTracker();
- method @VisibleForTesting public static void setInstance(androidx.work.impl.constraints.trackers.Trackers);
- }
-
-}
-
-package @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) androidx.work.impl.model {
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class Dependency {
- ctor public Dependency(String, String);
- field public final String prerequisiteId;
- field public final String workSpecId;
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class SystemIdInfo {
- ctor public SystemIdInfo(String, int);
- method public boolean equals(Object?);
- method public int hashCode();
- field public final int systemId;
- field public final String workSpecId;
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WorkName {
- ctor public WorkName(String, String);
- field public final String name;
- field public final String workSpecId;
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WorkSpec {
- ctor public WorkSpec(String, String);
- ctor public WorkSpec(androidx.work.impl.model.WorkSpec);
- method public long calculateNextRunTime();
- method public boolean equals(Object?);
- method public boolean hasConstraints();
- method public int hashCode();
- method public boolean isBackedOff();
- method public boolean isPeriodic();
- method public void setBackoffDelayDuration(long);
- method public void setPeriodic(long);
- method public void setPeriodic(long, long);
- method public String toString();
- field public static final long SCHEDULE_NOT_REQUESTED_YET = -1L; // 0xffffffffffffffffL
- field public static final android.arch.core.util.Function<java.util.List<androidx.work.impl.model.WorkSpec.WorkInfoPojo>,java.util.List<androidx.work.WorkInfo>>! WORK_INFO_MAPPER;
- field public long backoffDelayDuration;
- field public androidx.work.BackoffPolicy backoffPolicy;
- field public androidx.work.Constraints constraints;
- field public long flexDuration;
- field public String id;
- field public long initialDelay;
- field public androidx.work.Data input;
- field public String! inputMergerClassName;
- field public long intervalDuration;
- field public long minimumRetentionDuration;
- field public androidx.work.Data output;
- field public long periodStartTime;
- field public int runAttemptCount;
- field public long scheduleRequestedAt;
- field public androidx.work.WorkInfo.State state;
- field public String workerClassName;
- }
-
- public static class WorkSpec.IdAndState {
- ctor public WorkSpec.IdAndState();
- method public boolean equals(Object?);
- method public int hashCode();
- field public String! id;
- field public androidx.work.WorkInfo.State! state;
- }
-
- public static class WorkSpec.WorkInfoPojo {
- ctor public WorkSpec.WorkInfoPojo();
- method public boolean equals(Object?);
- method public int hashCode();
- method public androidx.work.WorkInfo! toWorkInfo();
- field public String! id;
- field public androidx.work.Data! output;
- field public androidx.work.WorkInfo.State! state;
- field public java.util.List<java.lang.String>! tags;
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WorkTag {
- ctor public WorkTag(String, String);
- field public final String tag;
- field public final String workSpecId;
- }
-
-}
-
-package @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) androidx.work.impl.utils {
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class CancelWorkRunnable {
- ctor public CancelWorkRunnable();
- method public static androidx.work.impl.utils.CancelWorkRunnable! forAll(androidx.work.impl.WorkManagerImpl);
- method public static androidx.work.impl.utils.CancelWorkRunnable! forId(java.util.UUID, androidx.work.impl.WorkManagerImpl);
- method public static androidx.work.impl.utils.CancelWorkRunnable! forName(String, androidx.work.impl.WorkManagerImpl, boolean);
- method public static androidx.work.impl.utils.CancelWorkRunnable! forTag(String, androidx.work.impl.WorkManagerImpl);
- method public androidx.work.Operation! getOperation();
- method public void run();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class EnqueueRunnable {
- ctor public EnqueueRunnable(androidx.work.impl.WorkContinuationImpl);
- method @VisibleForTesting public boolean addToDatabase();
- method public androidx.work.Operation! getOperation();
- method public void run();
- method @VisibleForTesting public void scheduleWorkInBackground();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ForceStopRunnable {
- ctor public ForceStopRunnable(android.content.Context, androidx.work.impl.WorkManagerImpl);
- method @VisibleForTesting public boolean isForceStopped();
- method public void run();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public static class ForceStopRunnable.BroadcastReceiver {
- ctor public ForceStopRunnable.BroadcastReceiver();
- method public void onReceive(android.content.Context!, android.content.Intent!);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class IdGenerator {
- ctor public IdGenerator(android.content.Context!);
- method public int nextAlarmManagerId();
- method public int nextJobSchedulerIdWithRange(int, int);
- field public static final int INITIAL_ID = 0; // 0x0
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class LiveDataUtils {
- method public static <In, Out> android.arch.lifecycle.LiveData<Out>! dedupedMappedLiveDataFor(android.arch.lifecycle.LiveData<In>, android.arch.core.util.Function<In,Out>, androidx.work.impl.utils.taskexecutor.TaskExecutor);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class Preferences {
- ctor public Preferences(android.content.Context);
- ctor @VisibleForTesting public Preferences(android.content.SharedPreferences);
- method public long getLastCancelAllTimeMillis();
- method public android.arch.lifecycle.LiveData<java.lang.Long>! getLastCancelAllTimeMillisLiveData();
- method public boolean needsReschedule();
- method public void setLastCancelAllTimeMillis(long);
- method public void setNeedsReschedule(boolean);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class PruneWorkRunnable {
- ctor public PruneWorkRunnable(androidx.work.impl.WorkManagerImpl!);
- method public androidx.work.Operation! getOperation();
- method public void run();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class StartWorkRunnable {
- ctor public StartWorkRunnable(androidx.work.impl.WorkManagerImpl!, String!, androidx.work.WorkerParameters.RuntimeExtras!);
- method public void run();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class StatusRunnable<T> {
- ctor public StatusRunnable();
- method public static androidx.work.impl.utils.StatusRunnable<java.util.List<androidx.work.WorkInfo>>! forStringIds(androidx.work.impl.WorkManagerImpl, java.util.List<java.lang.String>);
- method public static androidx.work.impl.utils.StatusRunnable<java.util.List<androidx.work.WorkInfo>>! forTag(androidx.work.impl.WorkManagerImpl, String);
- method public static androidx.work.impl.utils.StatusRunnable<androidx.work.WorkInfo>! forUUID(androidx.work.impl.WorkManagerImpl, java.util.UUID);
- method public static androidx.work.impl.utils.StatusRunnable<java.util.List<androidx.work.WorkInfo>>! forUniqueWork(androidx.work.impl.WorkManagerImpl, String);
- method public com.google.common.util.concurrent.ListenableFuture<T>! getFuture();
- method public void run();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class StopWorkRunnable {
- ctor public StopWorkRunnable(androidx.work.impl.WorkManagerImpl!, String!);
- method public void run();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class SynchronousExecutor {
- ctor public SynchronousExecutor();
- method public void execute(Runnable);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WakeLocks {
- method public static void checkWakeLocks();
- method public static android.os.PowerManager.WakeLock! newWakeLock(android.content.Context, String);
- }
-
-}
-
-package @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) androidx.work.impl.utils.futures {
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public abstract class AbstractFuture<V> {
- ctor protected AbstractFuture();
- method public final void addListener(Runnable!, java.util.concurrent.Executor!);
- method protected void afterDone();
- method public final boolean cancel(boolean);
- method public final V! get(long, java.util.concurrent.TimeUnit!);
- method public final V! get();
- method protected void interruptTask();
- method public final boolean isCancelled();
- method public final boolean isDone();
- method protected String? pendingToString();
- method protected boolean set(V?);
- method protected boolean setException(Throwable!);
- method protected boolean setFuture(com.google.common.util.concurrent.ListenableFuture<? extends V>!);
- method public String toString();
- method protected final boolean wasInterrupted();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public final class SettableFuture<V> extends androidx.work.impl.utils.futures.AbstractFuture<V> {
- method public static <V> androidx.work.impl.utils.futures.SettableFuture<V>! create();
- method public boolean set(V?);
- method public boolean setException(Throwable!);
- method public boolean setFuture(com.google.common.util.concurrent.ListenableFuture<? extends V>!);
- }
-
-}
-
-package @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) androidx.work.impl.utils.taskexecutor {
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public interface TaskExecutor {
- method public void executeOnBackgroundThread(Runnable!);
- method public java.util.concurrent.Executor! getBackgroundExecutor();
- method public Thread getBackgroundExecutorThread();
- method public java.util.concurrent.Executor! getMainThreadExecutor();
- method public void postToMainThread(Runnable!);
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class WorkManagerTaskExecutor implements androidx.work.impl.utils.taskexecutor.TaskExecutor {
- ctor public WorkManagerTaskExecutor();
- method public void executeOnBackgroundThread(Runnable!);
- method public java.util.concurrent.Executor! getBackgroundExecutor();
- method public Thread getBackgroundExecutorThread();
- method public java.util.concurrent.Executor! getMainThreadExecutor();
- method public void postToMainThread(Runnable!);
- }
-
-}
-
-package androidx.work.impl.workers {
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class CombineContinuationsWorker extends androidx.work.Worker {
- ctor public CombineContinuationsWorker(android.content.Context, androidx.work.WorkerParameters);
- method public androidx.work.ListenableWorker.Result doWork();
- }
-
- @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) public class ConstraintTrackingWorker extends androidx.work.ListenableWorker implements androidx.work.impl.constraints.WorkConstraintsCallback {
- ctor public ConstraintTrackingWorker(android.content.Context, androidx.work.WorkerParameters);
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @VisibleForTesting public androidx.work.ListenableWorker! getDelegate();
- method @RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP}) @VisibleForTesting public androidx.work.impl.WorkDatabase! getWorkDatabase();
- method public void onAllConstraintsMet(java.util.List<java.lang.String>);
- method public void onAllConstraintsNotMet(java.util.List<java.lang.String>);
- method public com.google.common.util.concurrent.ListenableFuture<androidx.work.ListenableWorker.Result> startWork();
- field public static final String ARGUMENT_CLASS_NAME = "androidx.work.impl.workers.ConstraintTrackingWorker.ARGUMENT_CLASS_NAME";
- }
-
-}
-
diff --git a/work/workmanager/api/restricted_1.0.0-rc01.ignore b/work/workmanager/api/restricted_1.0.0-rc01.ignore
deleted file mode 100644
index 6ac98be..0000000
--- a/work/workmanager/api/restricted_1.0.0-rc01.ignore
+++ /dev/null
@@ -1,79 +0,0 @@
-// Baseline format: 1.0
-HiddenTypeParameter: androidx.work.impl.WorkDatabase#dependencyDao():
- Method androidx.work.impl.WorkDatabase.dependencyDao() references hidden type androidx.work.impl.model.DependencyDao.
-HiddenTypeParameter: androidx.work.impl.WorkDatabase#systemIdInfoDao():
- Method androidx.work.impl.WorkDatabase.systemIdInfoDao() references hidden type androidx.work.impl.model.SystemIdInfoDao.
-HiddenTypeParameter: androidx.work.impl.WorkDatabase#workNameDao():
- Method androidx.work.impl.WorkDatabase.workNameDao() references hidden type androidx.work.impl.model.WorkNameDao.
-HiddenTypeParameter: androidx.work.impl.WorkDatabase#workSpecDao():
- Method androidx.work.impl.WorkDatabase.workSpecDao() references hidden type androidx.work.impl.model.WorkSpecDao.
-HiddenTypeParameter: androidx.work.impl.WorkDatabase#workTagDao():
- Method androidx.work.impl.WorkDatabase.workTagDao() references hidden type androidx.work.impl.model.WorkTagDao.
-HiddenTypeParameter: androidx.work.impl.background.greedy.GreedyScheduler#GreedyScheduler(androidx.work.impl.WorkManagerImpl, androidx.work.impl.constraints.WorkConstraintsTracker) parameter #1:
- Parameter workConstraintsTracker references hidden type androidx.work.impl.constraints.WorkConstraintsTracker.
-HiddenTypeParameter: androidx.work.impl.background.systemjob.SystemJobScheduler#SystemJobScheduler(android.content.Context, androidx.work.impl.WorkManagerImpl, android.app.job.JobScheduler, androidx.work.impl.background.systemjob.SystemJobInfoConverter) parameter #3:
- Parameter systemJobInfoConverter references hidden type androidx.work.impl.background.systemjob.SystemJobInfoConverter.
-HiddenTypeParameter: androidx.work.impl.constraints.trackers.ConstraintTracker#addListener(androidx.work.impl.constraints.ConstraintListener<T>) parameter #0:
- Parameter listener references hidden type androidx.work.impl.constraints.ConstraintListener<T>.
-HiddenTypeParameter: androidx.work.impl.constraints.trackers.ConstraintTracker#removeListener(androidx.work.impl.constraints.ConstraintListener<T>) parameter #0:
- Parameter listener references hidden type androidx.work.impl.constraints.ConstraintListener<T>.
-HiddenTypeParameter: androidx.work.impl.constraints.trackers.NetworkStateTracker#getInitialState():
- Method androidx.work.impl.constraints.trackers.NetworkStateTracker.getInitialState() references hidden type androidx.work.impl.constraints.NetworkState.
-
-
-ReferencesHidden: androidx.work.impl.WorkDatabase#dependencyDao():
- Class androidx.work.impl.model.DependencyDao is hidden but was referenced (as return type) from public method androidx.work.impl.WorkDatabase.dependencyDao()
-ReferencesHidden: androidx.work.impl.WorkDatabase#systemIdInfoDao():
- Class androidx.work.impl.model.SystemIdInfoDao is hidden but was referenced (as return type) from public method androidx.work.impl.WorkDatabase.systemIdInfoDao()
-ReferencesHidden: androidx.work.impl.WorkDatabase#workNameDao():
- Class androidx.work.impl.model.WorkNameDao is hidden but was referenced (as return type) from public method androidx.work.impl.WorkDatabase.workNameDao()
-ReferencesHidden: androidx.work.impl.WorkDatabase#workSpecDao():
- Class androidx.work.impl.model.WorkSpecDao is hidden but was referenced (as return type) from public method androidx.work.impl.WorkDatabase.workSpecDao()
-ReferencesHidden: androidx.work.impl.WorkDatabase#workTagDao():
- Class androidx.work.impl.model.WorkTagDao is hidden but was referenced (as return type) from public method androidx.work.impl.WorkDatabase.workTagDao()
-ReferencesHidden: androidx.work.impl.background.greedy.GreedyScheduler#GreedyScheduler(androidx.work.impl.WorkManagerImpl, androidx.work.impl.constraints.WorkConstraintsTracker) parameter #1:
- Class androidx.work.impl.constraints.WorkConstraintsTracker is hidden but was referenced (as parameter type) from public parameter workConstraintsTracker in androidx.work.impl.background.greedy.GreedyScheduler(androidx.work.impl.WorkManagerImpl workManagerImpl, androidx.work.impl.constraints.WorkConstraintsTracker workConstraintsTracker)
-ReferencesHidden: androidx.work.impl.background.systemjob.SystemJobScheduler#SystemJobScheduler(android.content.Context, androidx.work.impl.WorkManagerImpl, android.app.job.JobScheduler, androidx.work.impl.background.systemjob.SystemJobInfoConverter) parameter #3:
- Class androidx.work.impl.background.systemjob.SystemJobInfoConverter is not public but was referenced (as parameter type) from public parameter systemJobInfoConverter in androidx.work.impl.background.systemjob.SystemJobScheduler(android.content.Context context, androidx.work.impl.WorkManagerImpl workManager, android.app.job.JobScheduler jobScheduler, androidx.work.impl.background.systemjob.SystemJobInfoConverter systemJobInfoConverter)
-ReferencesHidden: androidx.work.impl.constraints.trackers.ConstraintTracker#addListener(androidx.work.impl.constraints.ConstraintListener<T>) parameter #0:
- Class androidx.work.impl.constraints.ConstraintListener is hidden but was referenced (as parameter type) from public parameter listener in androidx.work.impl.constraints.trackers.ConstraintTracker.addListener(androidx.work.impl.constraints.ConstraintListener<T> listener)
-ReferencesHidden: androidx.work.impl.constraints.trackers.ConstraintTracker#removeListener(androidx.work.impl.constraints.ConstraintListener<T>) parameter #0:
- Class androidx.work.impl.constraints.ConstraintListener is hidden but was referenced (as parameter type) from public parameter listener in androidx.work.impl.constraints.trackers.ConstraintTracker.removeListener(androidx.work.impl.constraints.ConstraintListener<T> listener)
-ReferencesHidden: androidx.work.impl.constraints.trackers.NetworkStateTracker#getInitialState():
- Class androidx.work.impl.constraints.NetworkState is hidden but was referenced (as return type) from public method androidx.work.impl.constraints.trackers.NetworkStateTracker.getInitialState()
-
-
-RemovedClass: androidx.work.impl.WorkDatabase_Impl:
- Removed class androidx.work.impl.WorkDatabase_Impl
-
-
-RemovedInterface: androidx.work.impl.background.greedy.GreedyScheduler:
- Class androidx.work.impl.background.greedy.GreedyScheduler no longer implements androidx.work.impl.constraints.WorkConstraintsCallback
-RemovedInterface: androidx.work.impl.background.systemalarm.DelayMetCommandHandler:
- Class androidx.work.impl.background.systemalarm.DelayMetCommandHandler no longer implements androidx.work.impl.constraints.WorkConstraintsCallback
-RemovedInterface: androidx.work.impl.workers.ConstraintTrackingWorker:
- Class androidx.work.impl.workers.ConstraintTrackingWorker no longer implements androidx.work.impl.constraints.WorkConstraintsCallback
-
-
-RemovedMethod: androidx.work.impl.WorkManagerImpl#rescheduleEligibleWork():
- Removed method androidx.work.impl.WorkManagerImpl.rescheduleEligibleWork()
-
-
-UnavailableSymbol: androidx.work.impl.WorkDatabase#dependencyDao():
- Method androidx.work.impl.WorkDatabase.dependencyDao returns unavailable type DependencyDao
-UnavailableSymbol: androidx.work.impl.WorkDatabase#systemIdInfoDao():
- Method androidx.work.impl.WorkDatabase.systemIdInfoDao returns unavailable type SystemIdInfoDao
-UnavailableSymbol: androidx.work.impl.WorkDatabase#workNameDao():
- Method androidx.work.impl.WorkDatabase.workNameDao returns unavailable type WorkNameDao
-UnavailableSymbol: androidx.work.impl.WorkDatabase#workSpecDao():
- Method androidx.work.impl.WorkDatabase.workSpecDao returns unavailable type WorkSpecDao
-UnavailableSymbol: androidx.work.impl.WorkDatabase#workTagDao():
- Method androidx.work.impl.WorkDatabase.workTagDao returns unavailable type WorkTagDao
-UnavailableSymbol: androidx.work.impl.constraints.trackers.ConstraintTracker#addListener(androidx.work.impl.constraints.ConstraintListener<T>):
- Parameter of unavailable type androidx.work.impl.constraints.ConstraintListener<T> in androidx.work.impl.constraints.trackers.ConstraintTracker.addListener()
-UnavailableSymbol: androidx.work.impl.constraints.trackers.ConstraintTracker#removeListener(androidx.work.impl.constraints.ConstraintListener<T>):
- Parameter of unavailable type androidx.work.impl.constraints.ConstraintListener<T> in androidx.work.impl.constraints.trackers.ConstraintTracker.removeListener()
-UnavailableSymbol: androidx.work.impl.constraints.trackers.NetworkStateTracker#getInitialState():
- Method androidx.work.impl.constraints.trackers.NetworkStateTracker.getInitialState returns unavailable type NetworkState
-
-
diff --git a/work/workmanager/build.gradle b/work/workmanager/build.gradle
index f140803..c3bce08 100644
--- a/work/workmanager/build.gradle
+++ b/work/workmanager/build.gradle
@@ -70,5 +70,4 @@
url = SupportLibraryExtension.ARCHITECTURE_URL
failOnUncheckedWarnings = false
failOnDeprecationWarnings = false
- trackRestrictedAPIs = false
}
diff --git a/work/workmanager/src/androidTest/java/androidx/work/WorkDatabaseMigrationTest.java b/work/workmanager/src/androidTest/java/androidx/work/WorkDatabaseMigrationTest.java
index 65556e8..23db9be 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/WorkDatabaseMigrationTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/WorkDatabaseMigrationTest.java
@@ -42,6 +42,7 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.work.impl.WorkDatabase;
import androidx.work.impl.WorkDatabaseMigrations;
@@ -244,7 +245,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testMigrationVersion4To5() throws IOException {
SupportSQLiteDatabase database =
mMigrationTestHelper.createDatabase(TEST_DATABASE, VERSION_4);
diff --git a/work/workmanager/src/androidTest/java/androidx/work/WorkSpecTest.java b/work/workmanager/src/androidTest/java/androidx/work/WorkSpecTest.java
index f5f787e..e3d00b6 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/WorkSpecTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/WorkSpecTest.java
@@ -19,14 +19,9 @@
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.greaterThan;
-import static org.hamcrest.Matchers.lessThan;
-
-import android.os.Build;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
-import androidx.work.impl.WorkManagerImpl;
-import androidx.work.impl.model.WorkSpec;
import androidx.work.worker.InfiniteTestWorker;
import org.junit.Test;
@@ -57,49 +52,7 @@
@Test
@SmallTest
- public void testCalculateNextRunTime_firstRun_periodic_withFlexApplicable() {
- PeriodicWorkRequest periodicWork = new PeriodicWorkRequest.Builder(
- InfiniteTestWorker.class,
- DEFAULT_INTERVAL_TIME_MS,
- TimeUnit.MILLISECONDS,
- DEFAULT_FLEX_TIME_MS,
- TimeUnit.MILLISECONDS)
- .build();
-
- long now = System.currentTimeMillis();
- WorkSpec workSpec = getWorkSpec(periodicWork);
- long nextRunTime = workSpec.calculateNextRunTime();
- if (Build.VERSION.SDK_INT <= WorkManagerImpl.MAX_PRE_JOB_SCHEDULER_API_LEVEL) {
- assertThat(nextRunTime, greaterThan(now));
- } else {
- assertThat(nextRunTime, is(DEFAULT_INTERVAL_TIME_MS - DEFAULT_FLEX_TIME_MS));
- }
- }
-
- @Test
- @SmallTest
- public void testCalculateNextRunTime_firstRun_periodic_withFlexNotApplicable() {
- PeriodicWorkRequest periodicWork = new PeriodicWorkRequest.Builder(
- InfiniteTestWorker.class,
- DEFAULT_INTERVAL_TIME_MS,
- TimeUnit.MILLISECONDS,
- DEFAULT_INTERVAL_TIME_MS,
- TimeUnit.MILLISECONDS)
- .build();
-
- long now = System.currentTimeMillis();
- WorkSpec workSpec = getWorkSpec(periodicWork);
- long nextRunTime = workSpec.calculateNextRunTime();
- if (Build.VERSION.SDK_INT <= WorkManagerImpl.MAX_PRE_JOB_SCHEDULER_API_LEVEL) {
- assertThat(nextRunTime, lessThan(now)); // Should be in the past
- } else {
- assertThat(nextRunTime, is(0L));
- }
- }
-
- @Test
- @SmallTest
- public void testCalculateNextRunTime_nextRun_periodic_withFlexApplicable() {
+ public void testCalculateNextRunTime_firstRunAttempt_periodic() {
PeriodicWorkRequest periodicWork = new PeriodicWorkRequest.Builder(
InfiniteTestWorker.class,
DEFAULT_INTERVAL_TIME_MS,
@@ -108,39 +61,8 @@
TimeUnit.MILLISECONDS)
.setPeriodStartTime(DEFAULT_PERIOD_START_TIME, TimeUnit.MILLISECONDS)
.build();
-
- WorkSpec workSpec = getWorkSpec(periodicWork);
- long nextRunTime = workSpec.calculateNextRunTime();
- if (Build.VERSION.SDK_INT <= WorkManagerImpl.MAX_PRE_JOB_SCHEDULER_API_LEVEL) {
- assertThat(nextRunTime,
- is(DEFAULT_PERIOD_START_TIME + DEFAULT_INTERVAL_TIME_MS));
- } else {
- assertThat(nextRunTime,
- is(DEFAULT_PERIOD_START_TIME
- + DEFAULT_INTERVAL_TIME_MS
- - DEFAULT_FLEX_TIME_MS));
- }
- }
-
- @Test
- @SmallTest
- public void testCalculateNextRunTime_nextRun_periodic_withFlexNotApplicable() {
- PeriodicWorkRequest periodicWork = new PeriodicWorkRequest.Builder(
- InfiniteTestWorker.class,
- DEFAULT_INTERVAL_TIME_MS,
- TimeUnit.MILLISECONDS,
- DEFAULT_INTERVAL_TIME_MS,
- TimeUnit.MILLISECONDS)
- .setPeriodStartTime(DEFAULT_PERIOD_START_TIME, TimeUnit.MILLISECONDS)
- .build();
-
- WorkSpec workSpec = getWorkSpec(periodicWork);
- long nextRunTime = workSpec.calculateNextRunTime();
- if (Build.VERSION.SDK_INT <= WorkManagerImpl.MAX_PRE_JOB_SCHEDULER_API_LEVEL) {
- assertThat(nextRunTime, is(DEFAULT_PERIOD_START_TIME + DEFAULT_INTERVAL_TIME_MS));
- } else {
- assertThat(nextRunTime, is(DEFAULT_PERIOD_START_TIME));
- }
+ assertThat(getWorkSpec(periodicWork).calculateNextRunTime(),
+ is(DEFAULT_PERIOD_START_TIME + DEFAULT_INTERVAL_TIME_MS - DEFAULT_FLEX_TIME_MS));
}
@Test
@@ -246,7 +168,6 @@
.setInitialRunAttemptCount(1)
.setPeriodStartTime(DEFAULT_PERIOD_START_TIME, TimeUnit.MILLISECONDS)
.build();
-
assertThat(getWorkSpec(work).calculateNextRunTime(),
is(DEFAULT_PERIOD_START_TIME + WorkRequest.MAX_BACKOFF_MILLIS));
}
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/ObserveForeverTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/ObserveForeverTest.java
index 65e629e..64a4b8a 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/ObserveForeverTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/ObserveForeverTest.java
@@ -24,7 +24,7 @@
import android.support.annotation.Nullable;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.work.Configuration;
import androidx.work.ExistingWorkPolicy;
@@ -51,7 +51,7 @@
* see: b/74477406 for details.
*/
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
public class ObserveForeverTest {
private WorkManagerImpl mWorkManagerImpl;
private final OneTimeWorkRequest mWork = new OneTimeWorkRequest.Builder(TestWorker.class)
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/SchedulersTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/SchedulersTest.java
index d964c4e..d074ab6 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/SchedulersTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/SchedulersTest.java
@@ -28,8 +28,8 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.work.impl.background.systemalarm.SystemAlarmScheduler;
import androidx.work.impl.background.systemalarm.SystemAlarmService;
import androidx.work.impl.background.systemjob.SystemJobScheduler;
@@ -39,7 +39,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class SchedulersTest {
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkContinuationImplTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/WorkContinuationImplTest.java
index 8cda6bc..df66ef9 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkContinuationImplTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/WorkContinuationImplTest.java
@@ -38,7 +38,6 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
-import androidx.test.filters.MediumTest;
import androidx.test.filters.SmallTest;
import androidx.work.Configuration;
import androidx.work.Data;
@@ -70,7 +69,7 @@
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
public class WorkContinuationImplTest extends WorkManagerTest {
private Configuration mConfiguration;
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java
index 2fa41ad..556278c 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/WorkManagerImplTest.java
@@ -70,6 +70,7 @@
import androidx.test.filters.LargeTest;
import androidx.test.filters.MediumTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.work.BackoffPolicy;
import androidx.work.Configuration;
import androidx.work.Constraints;
@@ -166,7 +167,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueue_insertWork() throws ExecutionException, InterruptedException {
final int workCount = 3;
final OneTimeWorkRequest[] workArray = new OneTimeWorkRequest[workCount];
@@ -190,7 +191,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueue_AddsImplicitTags() throws ExecutionException, InterruptedException {
OneTimeWorkRequest work = new OneTimeWorkRequest.Builder(TestWorker.class).build();
mWorkManagerImpl.enqueue(Collections.singletonList(work)).getResult().get();
@@ -202,7 +203,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueue_insertMultipleWork() throws ExecutionException, InterruptedException {
OneTimeWorkRequest work1 = new OneTimeWorkRequest.Builder(TestWorker.class).build();
OneTimeWorkRequest work2 = new OneTimeWorkRequest.Builder(TestWorker.class).build();
@@ -217,7 +218,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueue_insertMultipleWork_continuationBlocking()
throws ExecutionException, InterruptedException {
@@ -237,7 +238,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueue_insertWithDependencies()
throws ExecutionException, InterruptedException {
@@ -277,7 +278,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueue_insertWithCompletedDependencies_isNotStatusBlocked()
throws ExecutionException, InterruptedException {
@@ -296,7 +297,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueue_insertWithFailedDependencies_isStatusFailed()
throws ExecutionException, InterruptedException {
@@ -315,7 +316,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueue_insertWithCancelledDependencies_isStatusCancelled()
throws ExecutionException, InterruptedException {
@@ -334,7 +335,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = 23)
public void testEnqueue_insertWorkConstraints()
throws ExecutionException, InterruptedException {
@@ -388,7 +389,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueue_insertWorkInitialDelay()
throws ExecutionException, InterruptedException {
@@ -407,7 +408,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueue_insertWorkBackoffPolicy()
throws ExecutionException, InterruptedException {
@@ -429,7 +430,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueue_insertWorkTags() throws ExecutionException, InterruptedException {
final String firstTag = "first_tag";
final String secondTag = "second_tag";
@@ -454,7 +455,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueue_insertPeriodicWork() throws ExecutionException, InterruptedException {
PeriodicWorkRequest periodicWork = new PeriodicWorkRequest.Builder(
TestWorker.class,
@@ -473,7 +474,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueued_work_setsPeriodStartTime()
throws ExecutionException, InterruptedException {
@@ -488,7 +489,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueued_periodicWork_setsPeriodStartTime()
throws ExecutionException, InterruptedException {
@@ -499,16 +500,18 @@
.build();
assertThat(periodicWork.getWorkSpec().periodStartTime, is(0L));
+ long beforeEnqueueTime = System.currentTimeMillis();
+
mWorkManagerImpl.enqueue(Collections.singletonList(periodicWork))
.getResult()
.get();
WorkSpec workSpec = mDatabase.workSpecDao().getWorkSpec(periodicWork.getStringId());
- assertThat(workSpec.periodStartTime, is(0L));
+ assertThat(workSpec.periodStartTime, is(greaterThanOrEqualTo(beforeEnqueueTime)));
}
@Test
- @MediumTest
+ @SmallTest
public void testBeginUniqueWork_setsUniqueName()
throws ExecutionException, InterruptedException {
@@ -527,7 +530,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueueUniquePeriodicWork_setsUniqueName()
throws ExecutionException, InterruptedException {
@@ -548,7 +551,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testBeginUniqueWork_deletesOldWorkOnReplace()
throws ExecutionException, InterruptedException {
@@ -582,7 +585,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueueUniquePeriodicWork_deletesOldWorkOnReplace()
throws ExecutionException, InterruptedException {
@@ -617,7 +620,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testBeginUniqueWork_keepsExistingWorkOnKeep()
throws ExecutionException, InterruptedException {
@@ -651,7 +654,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueueUniquePeriodicWork_keepsExistingWorkOnKeep()
throws ExecutionException, InterruptedException {
@@ -686,7 +689,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testBeginUniqueWork_replacesExistingWorkOnKeepWhenExistingWorkIsDone()
throws ExecutionException, InterruptedException {
@@ -720,7 +723,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testEnqueueUniquePeriodicWork_replacesExistingWorkOnKeepWhenExistingWorkIsDone()
throws ExecutionException, InterruptedException {
@@ -756,7 +759,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testBeginUniqueWork_appendsExistingWorkOnAppend()
throws ExecutionException, InterruptedException {
@@ -794,7 +797,7 @@
@Test
- @MediumTest
+ @SmallTest
public void testEnqueueUniqueWork_appendsExistingWorkOnAppend()
throws ExecutionException, InterruptedException {
// Not duplicating other enqueueUniqueWork with different work policies as they
@@ -833,7 +836,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testBeginUniqueWork_appendsExistingWorkToOnlyLeavesOnAppend()
throws ExecutionException, InterruptedException {
@@ -894,7 +897,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testBeginUniqueWork_insertsExistingWorkWhenNothingToAppendTo()
throws ExecutionException, InterruptedException {
@@ -913,7 +916,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testGetWorkInfoByIdSync() throws ExecutionException, InterruptedException {
OneTimeWorkRequest work = new OneTimeWorkRequest.Builder(TestWorker.class)
.setInitialState(SUCCEEDED)
@@ -926,7 +929,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testGetWorkInfoByIdSync_returnsNullIfNotInDatabase()
throws ExecutionException, InterruptedException {
@@ -937,7 +940,7 @@
// Temporarily disabled due to b/121002352.
// bug b/121090948 filed to keep track.
// @Test
- // @MediumTest
+ // @SmallTest
@SuppressWarnings("unchecked")
public void testGetWorkInfoById() {
OneTimeWorkRequest work0 = new OneTimeWorkRequest.Builder(TestWorker.class).build();
@@ -1001,7 +1004,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testGetWorkInfosByTagSync() throws ExecutionException, InterruptedException {
final String firstTag = "first_tag";
final String secondTag = "second_tag";
@@ -1050,7 +1053,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void getWorkInfosByNameSync() throws ExecutionException, InterruptedException {
final String uniqueName = "myname";
@@ -1091,7 +1094,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SuppressWarnings("unchecked")
public void testGetWorkInfosByName() {
final String uniqueName = "myname";
@@ -1156,7 +1159,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testCancelWorkById() throws ExecutionException, InterruptedException {
WorkSpecDao workSpecDao = mDatabase.workSpecDao();
@@ -1171,7 +1174,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testCancelWorkById_cancelsDependentWork()
throws ExecutionException, InterruptedException {
@@ -1192,7 +1195,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testCancelWorkById_cancelsUnfinishedWorkOnly()
throws ExecutionException, InterruptedException {
@@ -1215,7 +1218,7 @@
}
@Test
- @LargeTest
+ @SmallTest
public void testCancelAllWorkByTag() throws ExecutionException, InterruptedException {
WorkSpecDao workSpecDao = mDatabase.workSpecDao();
@@ -1248,7 +1251,7 @@
}
@Test
- @LargeTest
+ @SmallTest
public void testCancelAllWorkByTag_cancelsDependentWork()
throws ExecutionException, InterruptedException {
@@ -1295,7 +1298,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testCancelWorkByName() throws ExecutionException, InterruptedException {
final String uniqueName = "myname";
@@ -1331,7 +1334,7 @@
}
@Test
- @LargeTest
+ @SmallTest
public void testCancelAllWork() throws ExecutionException, InterruptedException {
OneTimeWorkRequest work0 = new OneTimeWorkRequest.Builder(TestWorker.class).build();
OneTimeWorkRequest work1 = new OneTimeWorkRequest.Builder(TestWorker.class).build();
@@ -1354,7 +1357,7 @@
}
@Test
- @LargeTest
+ @MediumTest
public void testCancelAllWork_updatesLastCancelAllTime() {
Preferences preferences = new Preferences(ApplicationProvider.getApplicationContext());
preferences.setLastCancelAllTimeMillis(0L);
@@ -1367,7 +1370,7 @@
}
@Test
- @LargeTest
+ @SmallTest
@SuppressWarnings("unchecked")
public void testCancelAllWork_updatesLastCancelAllTimeLiveData() throws InterruptedException {
Preferences preferences = new Preferences(ApplicationProvider.getApplicationContext());
@@ -1397,7 +1400,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void pruneFinishedWork() throws InterruptedException, ExecutionException {
OneTimeWorkRequest enqueuedWork = new OneTimeWorkRequest.Builder(TestWorker.class).build();
OneTimeWorkRequest finishedWork =
@@ -1429,7 +1432,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testSynchronousCancelAndGetWorkInfo()
throws ExecutionException, InterruptedException {
@@ -1444,7 +1447,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testGenerateCleanupCallback_resetsRunningWorkStatuses() {
WorkSpecDao workSpecDao = mDatabase.workSpecDao();
@@ -1464,7 +1467,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testGenerateCleanupCallback_deletesOldFinishedWork() {
OneTimeWorkRequest work1 = new OneTimeWorkRequest.Builder(TestWorker.class)
.setInitialState(SUCCEEDED)
@@ -1487,7 +1490,7 @@
}
@Test
- @MediumTest
+ @SmallTest
public void testGenerateCleanupCallback_doesNotDeleteOldFinishedWorkWithActiveDependents() {
OneTimeWorkRequest work0 = new OneTimeWorkRequest.Builder(TestWorker.class)
.setInitialState(SUCCEEDED)
@@ -1576,7 +1579,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(maxSdkVersion = 22)
public void testEnqueueApi22OrLower_withBatteryNotLowConstraint_expectsOriginalWorker()
throws ExecutionException, InterruptedException {
@@ -1593,7 +1596,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(maxSdkVersion = 22)
public void testEnqueueApi22OrLower_withStorageNotLowConstraint_expectsOriginalWorker()
throws ExecutionException, InterruptedException {
@@ -1610,7 +1613,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = 23, maxSdkVersion = 25)
public void testEnqueueApi23To25_withBatteryNotLowConstraint_expectsConstraintTrackingWorker()
throws ExecutionException, InterruptedException {
@@ -1630,7 +1633,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = 23, maxSdkVersion = 25)
public void testEnqueueApi23To25_withStorageNotLowConstraint_expectsConstraintTrackingWorker()
throws ExecutionException, InterruptedException {
@@ -1650,7 +1653,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = 26)
public void testEnqueueApi26OrHigher_withBatteryNotLowConstraint_expectsOriginalWorker()
throws ExecutionException, InterruptedException {
@@ -1667,7 +1670,7 @@
}
@Test
- @MediumTest
+ @SmallTest
@SdkSuppress(minSdkVersion = 26)
public void testEnqueueApi26OrHigher_withStorageNotLowConstraint_expectsOriginalWorker()
throws ExecutionException, InterruptedException {
@@ -1689,7 +1692,7 @@
/*
@Test
- @MediumTest
+ @SmallTest
@RepeatRule.Repeat(times = 10)
@SdkSuppress(maxSdkVersion = 22) // We can't force JobScheduler to run quicker than 15 mins.
public void testPeriodicWork_ExecutesRepeatedly() throws InterruptedException {
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java
index 3a29aed..dfe2a08 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/WorkerWrapperTest.java
@@ -555,11 +555,13 @@
public void testRun_periodicWork_success_updatesPeriodStartTime() {
long intervalDuration = PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS;
long periodStartTime = System.currentTimeMillis();
+ long expectedNextPeriodStartTime = periodStartTime + intervalDuration;
PeriodicWorkRequest periodicWork = new PeriodicWorkRequest.Builder(
TestWorker.class, intervalDuration, TimeUnit.MILLISECONDS).build();
getWorkSpec(periodicWork).periodStartTime = periodStartTime;
+
insertWork(periodicWork);
createBuilder(periodicWork.getStringId())
@@ -567,7 +569,7 @@
.run();
WorkSpec updatedWorkSpec = mWorkSpecDao.getWorkSpec(periodicWork.getStringId());
- assertThat(updatedWorkSpec.calculateNextRunTime(), greaterThan(periodStartTime));
+ assertThat(updatedWorkSpec.periodStartTime, is(expectedNextPeriodStartTime));
}
@Test
@@ -575,11 +577,13 @@
public void testRun_periodicWork_failure_updatesPeriodStartTime() {
long intervalDuration = PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS;
long periodStartTime = System.currentTimeMillis();
+ long expectedNextPeriodStartTime = periodStartTime + intervalDuration;
PeriodicWorkRequest periodicWork = new PeriodicWorkRequest.Builder(
FailureWorker.class, intervalDuration, TimeUnit.MILLISECONDS).build();
getWorkSpec(periodicWork).periodStartTime = periodStartTime;
+
insertWork(periodicWork);
createBuilder(periodicWork.getStringId())
@@ -587,7 +591,7 @@
.run();
WorkSpec updatedWorkSpec = mWorkSpecDao.getWorkSpec(periodicWork.getStringId());
- assertThat(updatedWorkSpec.calculateNextRunTime(), greaterThan(periodStartTime));
+ assertThat(updatedWorkSpec.periodStartTime, is(expectedNextPeriodStartTime));
}
@Test
@@ -682,29 +686,6 @@
WorkerWrapper workerWrapper = createBuilder(periodicWorkId).build();
FutureListener listener = createAndAddFutureListener(workerWrapper);
workerWrapper.run();
- // Should get rescheduled
- assertThat(listener.mResult, is(true));
- }
-
- @Test
- @SmallTest
- public void testPeriodic_firstRun_flexApplied_noDedupe() {
- PeriodicWorkRequest periodicWork = new PeriodicWorkRequest.Builder(
- TestWorker.class,
- PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS,
- TimeUnit.MILLISECONDS,
- PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS,
- TimeUnit.MILLISECONDS)
- .build();
-
- final String periodicWorkId = periodicWork.getStringId();
- final WorkSpec workSpec = periodicWork.getWorkSpec();
- workSpec.periodStartTime = 0;
- insertWork(periodicWork);
- WorkerWrapper workerWrapper = createBuilder(periodicWorkId).build();
- FutureListener listener = createAndAddFutureListener(workerWrapper);
- workerWrapper.run();
- // Should not get rescheduled
assertThat(listener.mResult, is(false));
}
@@ -1080,19 +1061,6 @@
assertThat(mWorkSpecDao.getState(work.getStringId()), is(FAILED));
}
- @Test
- @SmallTest
- public void testWorkerThatThrowsAnException() {
- OneTimeWorkRequest work =
- new OneTimeWorkRequest.Builder(ExceptionWorker.class).build();
- insertWork(work);
- WorkerWrapper workerWrapper = createBuilder(work.getStringId()).build();
- FutureListener listener = createAndAddFutureListener(workerWrapper);
- workerWrapper.run();
- assertThat(listener.mResult, is(false));
- assertThat(mWorkSpecDao.getState(work.getStringId()), is(FAILED));
- }
-
private WorkerWrapper.Builder createBuilder(String workSpecId) {
return new WorkerWrapper.Builder(
mContext,
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcherTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcherTest.java
index 89b94e0..5a05f80 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcherTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemalarm/SystemAlarmDispatcherTest.java
@@ -17,7 +17,6 @@
package androidx.work.impl.background.systemalarm;
import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -39,6 +38,7 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
+import androidx.test.filters.MediumTest;
import androidx.work.Configuration;
import androidx.work.Constraints;
import androidx.work.DatabaseTest;
@@ -59,7 +59,6 @@
import androidx.work.impl.utils.SynchronousExecutor;
import androidx.work.impl.utils.taskexecutor.InstantWorkTaskExecutor;
import androidx.work.impl.utils.taskexecutor.TaskExecutor;
-import androidx.work.worker.RetryWorker;
import androidx.work.worker.SleepTestWorker;
import androidx.work.worker.TestWorker;
@@ -82,7 +81,7 @@
import java.util.concurrent.TimeUnit;
@RunWith(AndroidJUnit4.class)
-@LargeTest
+@MediumTest
public class SystemAlarmDispatcherTest extends DatabaseTest {
@Rule
@@ -289,37 +288,6 @@
}
@Test
- public void testDelayMet_withAlwaysRetryWorker() throws InterruptedException {
- OneTimeWorkRequest work = new OneTimeWorkRequest.Builder(RetryWorker.class)
- .setPeriodStartTime(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
- .build();
-
- insertWork(work);
- String workSpecId = work.getStringId();
-
- final Intent scheduleWork = CommandHandler.createDelayMetIntent(mContext, workSpecId);
- mSpyDispatcher.postOnMainThread(
- new SystemAlarmDispatcher.AddRunnable(mSpyDispatcher, scheduleWork, START_ID));
- mLatch.await(TEST_TIMEOUT, TimeUnit.SECONDS);
-
- assertThat(mLatch.getCount(), is(0L));
- verify(mSpyProcessor, times(1)).startWork(workSpecId);
- List<String> intentActions = mSpyDispatcher.getIntentActions();
- assertThat(intentActions,
- IsIterableContainingInOrder.contains(
- CommandHandler.ACTION_DELAY_MET,
- CommandHandler.ACTION_EXECUTION_COMPLETED,
- CommandHandler.ACTION_SCHEDULE_WORK));
-
- WorkSpecDao workSpecDao = mDatabase.workSpecDao();
- WorkSpec workSpec = workSpecDao.getWorkSpec(work.getStringId());
-
- assertThat(workSpec.state, is(WorkInfo.State.ENQUEUED));
- // It should be scheduled
- assertThat(workSpec.scheduleRequestedAt, is(not(WorkSpec.SCHEDULE_NOT_REQUESTED_YET)));
- }
-
- @Test
public void testSchedule_withConstraints() throws InterruptedException {
when(mBatteryChargingTracker.getInitialState()).thenReturn(true);
OneTimeWorkRequest work = new OneTimeWorkRequest.Builder(TestWorker.class)
@@ -378,7 +346,7 @@
mLatch.await(TEST_TIMEOUT, TimeUnit.SECONDS);
assertThat(mLatch.getCount(), is(0L));
- verify(mSpyProcessor, times(1)).startWork(workSpecId);
+ verify(mSpyProcessor, times(0)).startWork(workSpecId);
}
@Test
@@ -584,13 +552,11 @@
.build();
OneTimeWorkRequest noConstraints = new OneTimeWorkRequest.Builder(TestWorker.class)
- .setScheduleRequestedAt(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
.setPeriodStartTime(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
.build();
OneTimeWorkRequest workWithConstraints = new OneTimeWorkRequest.Builder(TestWorker.class)
.setPeriodStartTime(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
- .setScheduleRequestedAt(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
.setConstraints(new Constraints.Builder()
.setRequiresCharging(true)
.build())
@@ -599,7 +565,6 @@
long hourFromNow = System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1);
OneTimeWorkRequest workInTheFuture = new OneTimeWorkRequest.Builder(TestWorker.class)
.setPeriodStartTime(hourFromNow, TimeUnit.MILLISECONDS)
- .setScheduleRequestedAt(System.currentTimeMillis(), TimeUnit.MILLISECONDS)
.build();
insertWork(failed);
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java
index da750bf..dbb96ca 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/background/systemjob/SystemJobServiceTest.java
@@ -41,6 +41,7 @@
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.filters.SdkSuppress;
+import androidx.test.filters.SmallTest;
import androidx.work.Configuration;
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkInfo;
@@ -161,7 +162,7 @@
}
@Test
- @LargeTest
+ @SmallTest
public void testOnStopJob_ReschedulesWhenNotCancelled() {
// TODO: Remove after we figure out why these tests execute on API 17 emulators.
if (Build.VERSION.SDK_INT < WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL) {
@@ -194,7 +195,7 @@
}
@Test
- @LargeTest
+ @SmallTest
public void testStartJob_ReturnsFalseWithDuplicateJob() {
// TODO: Remove after we figure out why these tests execute on API 17 emulators.
if (Build.VERSION.SDK_INT < WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL) {
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/utils/EnqueueRunnableTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/utils/EnqueueRunnableTest.java
index ee227d9..2c2dcad 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/utils/EnqueueRunnableTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/utils/EnqueueRunnableTest.java
@@ -27,7 +27,7 @@
import android.content.Context;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
+import androidx.test.filters.SmallTest;
import androidx.work.impl.WorkContinuationImpl;
import androidx.work.impl.WorkManagerImpl;
@@ -38,7 +38,7 @@
import org.mockito.stubbing.Answer;
@RunWith(AndroidJUnit4.class)
-@MediumTest
+@SmallTest
public class EnqueueRunnableTest {
private Context mContext;
diff --git a/work/workmanager/src/androidTest/java/androidx/work/impl/utils/ForceStopRunnableTest.java b/work/workmanager/src/androidTest/java/androidx/work/impl/utils/ForceStopRunnableTest.java
index a35a26f..d299eda7 100644
--- a/work/workmanager/src/androidTest/java/androidx/work/impl/utils/ForceStopRunnableTest.java
+++ b/work/workmanager/src/androidTest/java/androidx/work/impl/utils/ForceStopRunnableTest.java
@@ -18,9 +18,6 @@
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.anyLong;
-import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
@@ -33,28 +30,21 @@
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.MediumTest;
-import androidx.work.Configuration;
-import androidx.work.impl.Scheduler;
+import androidx.test.filters.SmallTest;
import androidx.work.impl.WorkDatabase;
import androidx.work.impl.WorkManagerImpl;
-import androidx.work.impl.model.WorkSpec;
import androidx.work.impl.model.WorkSpecDao;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import java.util.Collections;
-
-@MediumTest
+@SmallTest
@RunWith(AndroidJUnit4.class)
public class ForceStopRunnableTest {
private Context mContext;
private WorkManagerImpl mWorkManager;
- private Scheduler mScheduler;
- private Configuration mConfiguration;
private WorkDatabase mWorkDatabase;
private WorkSpecDao mWorkSpecDao;
private Preferences mPreferences;
@@ -67,14 +57,9 @@
mWorkDatabase = mock(WorkDatabase.class);
mWorkSpecDao = mock(WorkSpecDao.class);
mPreferences = mock(Preferences.class);
- mScheduler = mock(Scheduler.class);
- mConfiguration = new Configuration.Builder().build();
-
when(mWorkManager.getWorkDatabase()).thenReturn(mWorkDatabase);
- when(mWorkManager.getSchedulers()).thenReturn(Collections.singletonList(mScheduler));
when(mWorkDatabase.workSpecDao()).thenReturn(mWorkSpecDao);
when(mWorkManager.getPreferences()).thenReturn(mPreferences);
- when(mWorkManager.getConfiguration()).thenReturn(mConfiguration);
mRunnable = new ForceStopRunnable(mContext, mWorkManager);
}
@@ -114,24 +99,4 @@
runnable.run();
verify(mPreferences, times(1)).setNeedsReschedule(false);
}
-
- @Test
- public void test_UnfinishedWork_getsScheduled() {
- ForceStopRunnable runnable = spy(mRunnable);
- when(runnable.shouldRescheduleWorkers()).thenReturn(false);
- when(runnable.isForceStopped()).thenReturn(false);
- String id = "id";
- String worker = "Worker";
- WorkSpec workSpec = new WorkSpec(id, worker);
-
- when(mWorkSpecDao.getEnqueuedWork()).thenReturn(Collections.singletonList(workSpec));
- when(mWorkSpecDao.getEligibleWorkForScheduling(anyInt())).thenReturn(
- Collections.singletonList(workSpec));
-
- runnable.run();
- verify(mWorkSpecDao, times(2))
- .markWorkSpecScheduled(eq(id), anyLong());
-
- verify(mScheduler, times(1)).schedule(eq(workSpec));
- }
}
diff --git a/work/workmanager/src/main/java/androidx/work/ListenableWorker.java b/work/workmanager/src/main/java/androidx/work/ListenableWorker.java
index a419cac..cdf8e84 100644
--- a/work/workmanager/src/main/java/androidx/work/ListenableWorker.java
+++ b/work/workmanager/src/main/java/androidx/work/ListenableWorker.java
@@ -389,11 +389,6 @@
String name = Success.class.getName();
return 31 * name.hashCode() + mOutputData.hashCode();
}
-
- @Override
- public String toString() {
- return "Success {" + "mOutputData=" + mOutputData + '}';
- }
}
/**
@@ -444,11 +439,6 @@
String name = Failure.class.getName();
return 31 * name.hashCode() + mOutputData.hashCode();
}
-
- @Override
- public String toString() {
- return "Failure {" + "mOutputData=" + mOutputData + '}';
- }
}
/**
@@ -476,11 +466,6 @@
String name = Retry.class.getName();
return name.hashCode();
}
-
- @Override
- public String toString() {
- return "Retry";
- }
}
}
}
diff --git a/work/workmanager/src/main/java/androidx/work/Worker.java b/work/workmanager/src/main/java/androidx/work/Worker.java
index 7bba996..ac0ec0e 100644
--- a/work/workmanager/src/main/java/androidx/work/Worker.java
+++ b/work/workmanager/src/main/java/androidx/work/Worker.java
@@ -81,13 +81,8 @@
getBackgroundExecutor().execute(new Runnable() {
@Override
public void run() {
- try {
- Result result = doWork();
- mFuture.set(result);
- } catch (Throwable throwable) {
- mFuture.setException(throwable);
- }
-
+ Result result = doWork();
+ mFuture.set(result);
}
});
return mFuture;
diff --git a/work/workmanager/src/main/java/androidx/work/impl/WorkerWrapper.java b/work/workmanager/src/main/java/androidx/work/impl/WorkerWrapper.java
index 11db087..5c5e13d 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/WorkerWrapper.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/WorkerWrapper.java
@@ -67,15 +67,13 @@
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public class WorkerWrapper implements Runnable {
- // Avoid Synthetic accessor
- static final String TAG = Logger.tagWithPrefix("WorkerWrapper");
+ private static final String TAG = Logger.tagWithPrefix("WorkerWrapper");
private Context mAppContext;
private String mWorkSpecId;
private List<Scheduler> mSchedulers;
private WorkerParameters.RuntimeExtras mRuntimeExtras;
- // Avoid Synthetic accessor
- WorkSpec mWorkSpec;
+ private WorkSpec mWorkSpec;
ListenableWorker mWorker;
// Package-private for synthetic accessor.
@@ -148,9 +146,6 @@
if (mWorkSpec.state != ENQUEUED) {
resolveIncorrectStatus();
mWorkDatabase.setTransactionSuccessful();
- Logger.get().debug(TAG,
- String.format("%s is not in ENQUEUED state. Nothing more to do.",
- mWorkSpec.workerClassName));
return;
}
@@ -167,26 +162,8 @@
if (mWorkSpec.isPeriodic() || mWorkSpec.isBackedOff()) {
long now = System.currentTimeMillis();
- // Allow first run of a PeriodicWorkRequest when flex is applicable
- // (when using AlarmManager) to go through. This is because when periodStartTime=0;
- // calculateNextRunTime() always > now. We are being overly cautious with the
- // SDK_INT check and the intervalDuration != flexDuration check.
- // For more information refer to b/124274584
- boolean isFirstRunWhenFlexApplicable =
- Build.VERSION.SDK_INT < WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL
- && mWorkSpec.intervalDuration != mWorkSpec.flexDuration
- && mWorkSpec.periodStartTime == 0;
-
- if (!isFirstRunWhenFlexApplicable && now < mWorkSpec.calculateNextRunTime()) {
- Logger.get().debug(TAG,
- String.format(
- "Delaying execution for %s because it is being executed "
- + "before schedule.",
- mWorkSpec.workerClassName));
- // For AlarmManager implementation we need to reschedule this kind of Work.
- // This is not a problem for JobScheduler because we will only reschedule
- // work if JobScheduler is unaware of a jobId.
- resolve(true);
+ if (now < mWorkSpec.calculateNextRunTime()) {
+ resolve(false);
return;
}
}
@@ -267,8 +244,6 @@
@Override
public void run() {
try {
- Logger.get().debug(TAG, String.format("Starting work for %s",
- mWorkSpec.workerClassName));
mInnerFuture = mWorker.startWork();
future.setFuture(mInnerFuture);
} catch (Throwable e) {
@@ -292,8 +267,6 @@
"%s returned a null result. Treating it as a failure.",
mWorkSpec.workerClassName));
} else {
- Logger.get().debug(TAG, String.format("%s returned a %s result.",
- mWorkSpec.workerClassName, result));
mResult = result;
}
} catch (CancellationException exception) {
@@ -534,11 +507,15 @@
private void resetPeriodicAndResolve() {
mWorkDatabase.beginTransaction();
try {
- // The system clock may have been changed such that the periodStartTime was in the past.
- // Therefore we always use the current time to determine the next run time of a Worker.
- // This way, the Schedulers will correctly schedule the next instance of the
- // PeriodicWork in the future. This happens in calculateNextRunTime() in WorkSpec.
- mWorkSpecDao.setPeriodStartTime(mWorkSpecId, System.currentTimeMillis());
+ long currentPeriodStartTime = mWorkSpec.periodStartTime;
+ long now = System.currentTimeMillis();
+ long potentialNextStartTime = currentPeriodStartTime + mWorkSpec.intervalDuration;
+ // The system clock may have been changed such that the potentialNextStartTime is still
+ // in the past. When this happens, we need to move the nextPeriodStartTime to the
+ // present. This way, the Schedulers will correctly schedule the next instance of the
+ // PeriodicWork in the future.
+ long nextPeriodStartTime = Math.max(now, potentialNextStartTime);
+ mWorkSpecDao.setPeriodStartTime(mWorkSpecId, nextPeriodStartTime);
mWorkSpecDao.setState(ENQUEUED, mWorkSpecId);
mWorkSpecDao.resetWorkSpecRunAttemptCount(mWorkSpecId);
if (Build.VERSION.SDK_INT < WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL) {
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/greedy/GreedyScheduler.java b/work/workmanager/src/main/java/androidx/work/impl/background/greedy/GreedyScheduler.java
index 88f3fbe..2c14fdc 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/background/greedy/GreedyScheduler.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/background/greedy/GreedyScheduler.java
@@ -91,7 +91,6 @@
constrainedWorkSpecIds.add(workSpec.id);
}
} else {
- Logger.get().debug(TAG, String.format("Starting work for %s", workSpec.id));
mWorkManagerImpl.startWork(workSpec.id);
}
}
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/CommandHandler.java b/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/CommandHandler.java
index 3f40ac5d..6e22c58 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/CommandHandler.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/CommandHandler.java
@@ -25,6 +25,7 @@
import android.support.annotation.WorkerThread;
import androidx.work.Logger;
+import androidx.work.WorkInfo;
import androidx.work.impl.ExecutionListener;
import androidx.work.impl.WorkDatabase;
import androidx.work.impl.WorkManagerImpl;
@@ -118,6 +119,7 @@
@Override
public void onExecuted(@NonNull String workSpecId, boolean needsReschedule) {
+
synchronized (mLock) {
// This listener is only necessary for knowing when a pending work is complete.
// Delegate to the underlying execution listener itself.
@@ -209,28 +211,22 @@
"Skipping scheduling " + workSpecId + " because it's no longer in "
+ "the DB");
return;
- } else if (workSpec.state.isFinished()) {
- // We need to schedule the Alarms, even when the Worker is RUNNING. This is because
- // if the process gets killed, the Alarm is necessary to pick up the execution of
- // Work.
+ } else if (workSpec.state != WorkInfo.State.ENQUEUED) {
Logger.get().warning(TAG,
- "Skipping scheduling " + workSpecId + "because it is finished.");
+ "Skipping scheduling " + workSpecId + " because it is no longer "
+ + "enqueued");
return;
}
- // Note: The first instance of PeriodicWorker getting scheduled will set an alarm in the
- // past. This is because periodStartTime = 0.
long triggerAt = workSpec.calculateNextRunTime();
if (!workSpec.hasConstraints()) {
- Logger.get().debug(TAG,
- String.format("Setting up Alarms for %s at %s", workSpecId, triggerAt));
+ Logger.get().debug(TAG, String.format("Setting up Alarms for %s", workSpecId));
Alarms.setAlarm(mContext, dispatcher.getWorkManager(), workSpecId, triggerAt);
} else {
// Schedule an alarm irrespective of whether all constraints matched.
Logger.get().debug(TAG,
- String.format("Opportunistically setting an alarm for %s at %s", workSpecId,
- triggerAt));
+ String.format("Opportunistically setting an alarm for %s", workSpecId));
Alarms.setAlarm(
mContext,
dispatcher.getWorkManager(),
@@ -262,19 +258,10 @@
synchronized (mLock) {
String workSpecId = extras.getString(KEY_WORKSPEC_ID);
Logger.get().debug(TAG, String.format("Handing delay met for %s", workSpecId));
-
- // Check to see if we are already handling an ACTION_DELAY_MET for the WorkSpec.
- // If we are, then there is nothing for us to do.
- if (!mPendingDelayMet.containsKey(workSpecId)) {
- DelayMetCommandHandler delayMetCommandHandler =
- new DelayMetCommandHandler(mContext, startId, workSpecId, dispatcher);
- mPendingDelayMet.put(workSpecId, delayMetCommandHandler);
- delayMetCommandHandler.handleProcessWork();
- } else {
- Logger.get().debug(TAG,
- String.format("WorkSpec %s is already being handled for ACTION_DELAY_MET",
- workSpecId));
- }
+ DelayMetCommandHandler delayMetCommandHandler =
+ new DelayMetCommandHandler(mContext, startId, workSpecId, dispatcher);
+ mPendingDelayMet.put(workSpecId, delayMetCommandHandler);
+ delayMetCommandHandler.handleProcessWork();
}
}
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/ConstraintsCommandHandler.java b/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/ConstraintsCommandHandler.java
index 869209e..52501f0b 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/ConstraintsCommandHandler.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/ConstraintsCommandHandler.java
@@ -58,9 +58,14 @@
@WorkerThread
void handleConstraintsChanged() {
+ int schedulerLimit = mDispatcher
+ .getWorkManager()
+ .getConfiguration()
+ .getMaxSchedulerLimit();
+
List<WorkSpec> candidates = mDispatcher.getWorkManager().getWorkDatabase()
.workSpecDao()
- .getScheduledWork();
+ .getEligibleWorkForScheduling(schedulerLimit);
// Update constraint proxy to potentially disable proxies for previously
// completed WorkSpecs.
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/DelayMetCommandHandler.java b/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/DelayMetCommandHandler.java
index fc5e814..1cce263 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/DelayMetCommandHandler.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/DelayMetCommandHandler.java
@@ -112,14 +112,6 @@
cleanUp();
- if (needsReschedule) {
- // We need to reschedule the WorkSpec. WorkerWrapper may also call Scheduler.schedule()
- // but given that we will only consider WorkSpecs that are eligible that it safe.
- Intent reschedule = CommandHandler.createScheduleWorkIntent(mContext, mWorkSpecId);
- mDispatcher.postOnMainThread(
- new SystemAlarmDispatcher.AddRunnable(mDispatcher, reschedule, mStartId));
- }
-
if (mHasConstraints) {
// The WorkSpec had constraints. Once the execution of the worker is complete,
// we might need to disable constraint proxies which were previously enabled for
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/RescheduleReceiver.java b/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/RescheduleReceiver.java
index c9d3b31..8a069aa 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/RescheduleReceiver.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/background/systemalarm/RescheduleReceiver.java
@@ -33,7 +33,6 @@
@Override
public void onReceive(Context context, Intent intent) {
- Logger.get().debug(TAG, String.format("Received intent %s", intent));
if (Build.VERSION.SDK_INT >= WorkManagerImpl.MIN_JOB_SCHEDULER_API_LEVEL) {
WorkManagerImpl workManager = WorkManagerImpl.getInstance();
if (workManager == null) {
diff --git a/work/workmanager/src/main/java/androidx/work/impl/background/systemjob/SystemJobScheduler.java b/work/workmanager/src/main/java/androidx/work/impl/background/systemjob/SystemJobScheduler.java
index b5b3e40..b89251c 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/background/systemjob/SystemJobScheduler.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/background/systemjob/SystemJobScheduler.java
@@ -103,17 +103,6 @@
SystemIdInfo info = workDatabase.systemIdInfoDao()
.getSystemIdInfo(workSpec.id);
- if (info != null) {
- JobInfo jobInfo = getPendingJobInfo(mJobScheduler, workSpec.id);
- if (jobInfo != null) {
- Logger.get().debug(TAG, String.format(
- "Skipping scheduling %s because JobScheduler is aware of it "
- + "already.",
- workSpec.id));
- continue;
- }
- }
-
int jobId = info != null ? info.systemId : mIdGenerator.nextJobSchedulerIdWithRange(
mWorkManager.getConfiguration().getMinJobSchedulerId(),
mWorkManager.getConfiguration().getMaxJobSchedulerId());
@@ -209,25 +198,4 @@
}
}
}
-
- private static JobInfo getPendingJobInfo(
- @NonNull JobScheduler jobScheduler,
- @NonNull String workSpecId) {
-
- List<JobInfo> jobInfos = jobScheduler.getAllPendingJobs();
- // Apparently this CAN be null on API 23?
- if (jobInfos != null) {
- for (JobInfo jobInfo : jobInfos) {
- PersistableBundle extras = jobInfo.getExtras();
- if (extras != null
- && extras.containsKey(SystemJobInfoConverter.EXTRA_WORK_SPEC_ID)) {
- if (workSpecId.equals(
- extras.getString(SystemJobInfoConverter.EXTRA_WORK_SPEC_ID))) {
- return jobInfo;
- }
- }
- }
- }
- return null;
- }
}
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpec.java b/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpec.java
index f01f1f1..e7b8269 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpec.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpec.java
@@ -29,7 +29,6 @@
import android.arch.persistence.room.Index;
import android.arch.persistence.room.PrimaryKey;
import android.arch.persistence.room.Relation;
-import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.RestrictTo;
@@ -39,7 +38,6 @@
import androidx.work.Logger;
import androidx.work.WorkInfo;
import androidx.work.WorkRequest;
-import androidx.work.impl.WorkManagerImpl;
import java.util.ArrayList;
import java.util.List;
@@ -250,36 +248,7 @@
: (long) Math.scalb(backoffDelayDuration, runAttemptCount - 1);
return periodStartTime + Math.min(WorkRequest.MAX_BACKOFF_MILLIS, delay);
} else if (isPeriodic()) {
- if (Build.VERSION.SDK_INT <= WorkManagerImpl.MAX_PRE_JOB_SCHEDULER_API_LEVEL) {
- // Flex is only applicable when it's different from interval duration for
- // the AlarmManager implementation.
- boolean isFlexApplicable = flexDuration != intervalDuration;
- if (isFlexApplicable) {
- // When a PeriodicWorkRequest is being scheduled for the first time,
- // the periodStartTime will be 0. To correctly emulate flex, we need to set it
- // to now, so the PeriodicWorkRequest has an initial delay of
- // (interval - flex).
-
- // The subsequent runs will only add the interval duration and no flex.
- // This gives us the following behavior:
- // 1 => now + (interval - flex) = firstRunTime
- // 2 => firstRunTime + 2 * interval - flex
- // 3 => firstRunTime + 3 * interval - flex
-
- long offset = periodStartTime == 0 ? (-1 * flexDuration) : 0;
- long start =
- periodStartTime == 0 ? System.currentTimeMillis() : periodStartTime;
- return start + intervalDuration + offset;
- } else {
- // Don't use flexDuration for determining next run time for PeriodicWork
- // Schedulers <= API 22. This is because intervalDuration could equal
- // flexDuration.
- return periodStartTime + intervalDuration;
- }
-
- } else {
- return periodStartTime + intervalDuration - flexDuration;
- }
+ return periodStartTime + intervalDuration - flexDuration;
} else {
return periodStartTime + initialDelay;
}
diff --git a/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpecDao.java b/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpecDao.java
index 9756b5e..b53caf7 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpecDao.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/model/WorkSpecDao.java
@@ -292,26 +292,6 @@
List<WorkSpec> getEligibleWorkForScheduling(int schedulerLimit);
/**
- * @return The List of {@link WorkSpec}s that are unfinished and scheduled.
- */
- @Query("SELECT * FROM workspec WHERE "
- // Unfinished work
- + "state=" + WorkTypeConverters.StateIds.ENQUEUED
- // We only want WorkSpecs which have been scheduled.
- + " AND schedule_requested_at<>" + WorkSpec.SCHEDULE_NOT_REQUESTED_YET
- )
- List<WorkSpec> getScheduledWork();
-
- /**
- * @return The List of {@link WorkSpec}s that are unfinished and scheduled.
- */
- @Query("SELECT * FROM workspec WHERE "
- // Unfinished work
- + "state=" + WorkTypeConverters.StateIds.ENQUEUED
- )
- List<WorkSpec> getEnqueuedWork();
-
- /**
* Immediately prunes eligible work from the database meeting the following criteria:
* - Is finished (succeeded, failed, or cancelled)
* - Has zero unfinished dependents
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/EnqueueRunnable.java b/work/workmanager/src/main/java/androidx/work/impl/utils/EnqueueRunnable.java
index a3f5cf6..4183ca8 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/utils/EnqueueRunnable.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/utils/EnqueueRunnable.java
@@ -282,14 +282,9 @@
workSpec.state = BLOCKED;
}
} else {
- // Set scheduled times only for work without prerequisites and that are
- // not periodic. Dependent work will set their scheduled times when they are
- // unblocked.
- if (!workSpec.isPeriodic()) {
- workSpec.periodStartTime = currentTimeMillis;
- } else {
- workSpec.periodStartTime = 0L;
- }
+ // Set scheduled times only for work without prerequisites. Dependent work
+ // will set their scheduled times when they are unblocked.
+ workSpec.periodStartTime = currentTimeMillis;
}
if (Build.VERSION.SDK_INT >= 23 && Build.VERSION.SDK_INT <= 25) {
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/ForceStopRunnable.java b/work/workmanager/src/main/java/androidx/work/impl/utils/ForceStopRunnable.java
index adc4d48..e5506628 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/utils/ForceStopRunnable.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/utils/ForceStopRunnable.java
@@ -20,8 +20,6 @@
import static android.app.PendingIntent.FLAG_NO_CREATE;
import static android.app.PendingIntent.FLAG_UPDATE_CURRENT;
-import static androidx.work.impl.model.WorkSpec.SCHEDULE_NOT_REQUESTED_YET;
-
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.ComponentName;
@@ -33,13 +31,8 @@
import android.support.annotation.VisibleForTesting;
import androidx.work.Logger;
-import androidx.work.impl.Schedulers;
-import androidx.work.impl.WorkDatabase;
import androidx.work.impl.WorkManagerImpl;
-import androidx.work.impl.model.WorkSpec;
-import androidx.work.impl.model.WorkSpecDao;
-import java.util.List;
import java.util.concurrent.TimeUnit;
/**
@@ -79,35 +72,6 @@
} else if (isForceStopped()) {
Logger.get().debug(TAG, "Application was force-stopped, rescheduling.");
mWorkManager.rescheduleEligibleWork();
- } else {
- WorkDatabase workDatabase = mWorkManager.getWorkDatabase();
- WorkSpecDao workSpecDao = workDatabase.workSpecDao();
- try {
- workDatabase.beginTransaction();
- List<WorkSpec> workSpecs = workSpecDao.getEnqueuedWork();
- if (workSpecs != null && !workSpecs.isEmpty()) {
- Logger.get().debug(TAG, "Found unfinished work, scheduling it.");
- // Mark every instance of unfinished work with
- // SCHEDULE_NOT_REQUESTED_AT = -1 irrespective of its current state.
- // This is because the application might have crashed previously and we should
- // reschedule jobs that may have been running previously.
- // Also there is a chance that an application crash, happened during
- // onStartJob() and now no corresponding job now exists in JobScheduler.
- // To solve this, we simply force-reschedule all unfinished work.
- for (WorkSpec workSpec : workSpecs) {
- workSpecDao.markWorkSpecScheduled(workSpec.id, SCHEDULE_NOT_REQUESTED_YET);
- }
- Schedulers.schedule(
- mWorkManager.getConfiguration(),
- workDatabase,
- mWorkManager.getSchedulers());
- }
- workDatabase.setTransactionSuccessful();
- } finally {
- workDatabase.endTransaction();
- }
- Logger.get().debug(TAG, "Unfinished Workers exist, rescheduling.");
-
}
mWorkManager.onForceStopRunnableCompleted();
}
diff --git a/work/workmanager/src/main/java/androidx/work/impl/utils/WakeLocks.java b/work/workmanager/src/main/java/androidx/work/impl/utils/WakeLocks.java
index acae4b0..7fa6188 100644
--- a/work/workmanager/src/main/java/androidx/work/impl/utils/WakeLocks.java
+++ b/work/workmanager/src/main/java/androidx/work/impl/utils/WakeLocks.java
@@ -86,7 +86,7 @@
}
for (PowerManager.WakeLock wakeLock : wakeLocksCopy.keySet()) {
- if (wakeLock != null && wakeLock.isHeld()) {
+ if (wakeLock.isHeld()) {
String message = String.format("WakeLock held for %s", wakeLocksCopy.get(wakeLock));
Logger.get().warning(TAG, message);
}